File "form_editor.js"

Full Path: /home/warrior1/public_html/wp-content-20241001222009/plugins/mailpoet/assets/dist/js/form_editor.js
File size: 1.17 MB
MIME-type: text/plain
Charset: utf-8

/*! For license information please see form_editor.js.LICENSE.txt */
(self.webpackChunkMailPoet3=self.webpackChunkMailPoet3||[]).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 l(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,l=function(){e.clientWidth!==n&&d()},a=function(t){window.removeEventListener("resize",l,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",l,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:d}),"vertical"===(s=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),d()}var s;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 l=i("autosize:resized");try{e.dispatchEvent(l)}catch(e){}}}}function a(e){var t=o.get(e);t&&t.destroy()}function s(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 l(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e}),t.default=c,e.exports=t.default},void 0===(r=n.apply(t,[e,t]))||(e.exports=r)},87776:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,{__experimentalGetUnprocessedBlockTypes:function(){return te},getActiveBlockVariation:function(){return le},getBlockStyles:function(){return oe},getBlockSupport:function(){return fe},getBlockType:function(){return re},getBlockTypes:function(){return ne},getBlockVariations:function(){return ie},getCategories:function(){return se},getChildBlockNames:function(){return he},getCollections:function(){return ce},getDefaultBlockName:function(){return ue},getDefaultBlockVariation:function(){return ae},getFreeformFallbackBlockName:function(){return de},getGroupingBlockName:function(){return me},getUnregisteredFallbackBlockName:function(){return pe},hasBlockSupport:function(){return ge},hasChildBlocks:function(){return be},hasChildBlocksWithInserterSupport:function(){return ye},isMatchingSearchTerm:function(){return ve}});var o={};n.r(o),n.d(o,{__experimentalReapplyBlockTypeFilters:function(){return kt},__experimentalRegisterBlockType:function(){return _t},addBlockCollection:function(){return Pt},addBlockStyles:function(){return xt},addBlockTypes:function(){return yt},addBlockVariations:function(){return Et},removeBlockCollection:function(){return Dt},removeBlockStyles:function(){return Ct},removeBlockTypes:function(){return wt},removeBlockVariations:function(){return St},setCategories:function(){return At},setDefaultBlockName:function(){return It},setFreeformFallbackBlockName:function(){return Tt},setGroupingBlockName:function(){return Bt},setUnregisteredFallbackBlockName:function(){return Nt},updateCategory:function(){return Lt}});var i={};n.r(i),n.d(i,{__experimentalGetActiveBlockIdByBlockNames:function(){return Hl},__experimentalGetAllowedBlocks:function(){return wl},__experimentalGetAllowedPatterns:function(){return Sl},__experimentalGetBlockListSettingsForBlocks:function(){return Ll},__experimentalGetDirectInsertBlock:function(){return xl},__experimentalGetGlobalBlocksByName:function(){return oi},__experimentalGetLastBlockAttributeChanges:function(){return Rl},__experimentalGetParsedPattern:function(){return Cl},__experimentalGetPatternTransformItems:function(){return Tl},__experimentalGetPatternsByBlockTypes:function(){return Il},__experimentalGetReusableBlockTitle:function(){return Pl},__unstableGetBlockWithoutInnerBlocks:function(){return Jo},__unstableGetClientIdWithClientIdsTree:function(){return Qo},__unstableGetClientIdsTree:function(){return ei},__unstableGetSelectedBlocksWithPartialSelection:function(){return Oi},__unstableGetVisibleBlocks:function(){return Ul},__unstableIsFullySelected:function(){return Di},__unstableIsLastBlockChangeIgnored:function(){return Dl},__unstableIsSelectionCollapsed:function(){return Ri},__unstableIsSelectionMergeable:function(){return Mi},areInnerBlocksControlled:function(){return zl},canEditBlock:function(){return pl},canInsertBlockType:function(){return ll},canInsertBlocks:function(){return al},canLockBlockType:function(){return ml},canMoveBlock:function(){return ul},canMoveBlocks:function(){return dl},canRemoveBlock:function(){return sl},canRemoveBlocks:function(){return cl},didAutomaticChange:function(){return jl},getAdjacentBlockClientId:function(){return _i},getBlock:function(){return Yo},getBlockAttributes:function(){return Ko},getBlockCount:function(){return li},getBlockHierarchyRootClientId:function(){return bi},getBlockIndex:function(){return ji},getBlockInsertionPoint:function(){return Qi},getBlockListSettings:function(){return Nl},getBlockMode:function(){return $i},getBlockName:function(){return Go},getBlockOrder:function(){return Fi},getBlockParents:function(){return gi},getBlockParentsByBlockName:function(){return vi},getBlockRootClientId:function(){return fi},getBlockSelectionEnd:function(){return ui},getBlockSelectionStart:function(){return ci},getBlockTransformItems:function(){return _l},getBlocks:function(){return Xo},getBlocksByClientId:function(){return ii},getClientIdsOfDescendants:function(){return ti},getClientIdsWithDescendants:function(){return ni},getDraggedBlockClientIds:function(){return Ki},getFirstMultiSelectedBlockClientId:function(){return Ii},getGlobalBlockCount:function(){return ri},getInserterItems:function(){return yl},getLastMultiSelectedBlockClientId:function(){return Ti},getLowestCommonAncestorWithSelectedBlock:function(){return yi},getMultiSelectedBlockClientIds:function(){return Ei},getMultiSelectedBlocks:function(){return Si},getMultiSelectedBlocksEndClientId:function(){return Pi},getMultiSelectedBlocksStartClientId:function(){return Li},getNextBlockClientId:function(){return wi},getPreviousBlockClientId:function(){return ki},getSelectedBlock:function(){return hi},getSelectedBlockClientId:function(){return mi},getSelectedBlockClientIds:function(){return Ci},getSelectedBlockCount:function(){return di},getSelectedBlocksInitialCaretPosition:function(){return xi},getSelectionEnd:function(){return si},getSelectionStart:function(){return ai},getSettings:function(){return Bl},getTemplate:function(){return nl},getTemplateLock:function(){return rl},hasBlockMovingClientId:function(){return Fl},hasInserterItems:function(){return kl},hasMultiSelection:function(){return Vi},hasSelectedBlock:function(){return pi},hasSelectedInnerBlock:function(){return zi},isAncestorBeingDragged:function(){return Ji},isAncestorMultiSelected:function(){return Ai},isBlockBeingDragged:function(){return Yi},isBlockHighlighted:function(){return Zl},isBlockInsertionPointVisible:function(){return el},isBlockMultiSelected:function(){return Bi},isBlockSelected:function(){return Zi},isBlockValid:function(){return qo},isBlockVisible:function(){return Wl},isBlockWithinSelection:function(){return Hi},isCaretWithinFormattedText:function(){return Xi},isDraggingBlocks:function(){return qi},isFirstMultiSelectedBlock:function(){return Ni},isLastBlockChangePersistent:function(){return Al},isMultiSelecting:function(){return Wi},isNavigationMode:function(){return Ol},isSelectionEnabled:function(){return Ui},isTyping:function(){return Gi},isValidTemplate:function(){return tl},wasBlockJustInserted:function(){return Vl}});var l={};n.r(l),n.d(l,{__unstableDeleteSelection:function(){return Ca},__unstableExpandSelection:function(){return Sa},__unstableMarkAutomaticChange:function(){return Ua},__unstableMarkLastChangeAsPersistent:function(){return Va},__unstableMarkNextChangeAsNotPersistent:function(){return Wa},__unstableSaveReusableBlock:function(){return Ha},__unstableSplitSelection:function(){return Ea},clearSelectedBlock:function(){return sa},duplicateBlocks:function(){return qa},enterFormattedText:function(){return Ma},exitFormattedText:function(){return Oa},flashBlock:function(){return Xa},hideInsertionPoint:function(){return ka},insertAfterBlock:function(){return Ya},insertBeforeBlock:function(){return Ka},insertBlock:function(){return ba},insertBlocks:function(){return ya},insertDefaultBlock:function(){return ja},mergeBlocks:function(){return Ia},moveBlockToPosition:function(){return va},moveBlocksDown:function(){return ha},moveBlocksToPosition:function(){return ga},moveBlocksUp:function(){return fa},multiSelect:function(){return aa},receiveBlocks:function(){return Ql},removeBlock:function(){return Na},removeBlocks:function(){return Ta},replaceBlock:function(){return pa},replaceBlocks:function(){return da},replaceInnerBlocks:function(){return Ba},resetBlocks:function(){return Yl},resetSelection:function(){return Xl},selectBlock:function(){return na},selectNextBlock:function(){return oa},selectPreviousBlock:function(){return ra},selectionChange:function(){return Fa},setBlockMovingClientId:function(){return Ga},setBlockVisibility:function(){return es},setHasControlledInnerBlocks:function(){return Qa},setNavigationMode:function(){return $a},setTemplateValidity:function(){return wa},showInsertionPoint:function(){return _a},startDraggingBlocks:function(){return Da},startMultiSelect:function(){return ia},startTyping:function(){return La},stopDraggingBlocks:function(){return Ra},stopMultiSelect:function(){return la},stopTyping:function(){return Pa},synchronizeTemplate:function(){return xa},toggleBlockHighlight:function(){return Ja},toggleBlockMode:function(){return Aa},toggleSelection:function(){return ca},updateBlock:function(){return ta},updateBlockAttributes:function(){return ea},updateBlockListSettings:function(){return Za},updateSettings:function(){return za},validateBlocksToTemplate:function(){return Jl}});var a={};n.r(a),n.d(a,{applyStylesToAllTextInputs:function(){return yB},blocksChangedInBlockEditor:function(){return bB},changeActiveSidebar:function(){return lB},changeFormBlocks:function(){return VN},changeFormName:function(){return WN},changeFormSettings:function(){return nB},changeFormStyles:function(){return qN},changePreviewSettings:function(){return aB},createCustomField:function(){return gB},createCustomFieldDone:function(){return QN},createCustomFieldFailed:function(){return tB},createCustomFieldStarted:function(){return eB},customFieldEdited:function(){return KN},deleteCustomField:function(){return vB},deleteCustomFieldDone:function(){return $N},deleteCustomFieldFailed:function(){return GN},deleteCustomFieldStarted:function(){return UN},hidePreview:function(){return uB},historyRedo:function(){return kB},historyUndo:function(){return _B},removeNotice:function(){return dB},saveCustomField:function(){return fB},saveCustomFieldDone:function(){return YN},saveCustomFieldFailed:function(){return XN},saveCustomFieldStarted:function(){return JN},saveForm:function(){return hB},saveFormDone:function(){return rB},saveFormFailed:function(){return iB},saveFormStarted:function(){return oB},showPlacementSettings:function(){return sB},showPreview:function(){return cB},switchDefaultSidebarTab:function(){return pB},toggleForm:function(){return zN},toggleFullscreen:function(){return HN},toggleInserter:function(){return ZN},toggleSidebar:function(){return jN},toggleSidebarPanel:function(){return mB},tutorialDismissed:function(){return wB}});var s={};n.r(s),n.d(s,{selectCategory:function(){return oz},selectTemplate:function(){return rz}});var c={};n.r(c),n.d(c,{CALL_API:function(){return FB.t},TRACK_EVENT:function(){return iz}});var u=n(49231),d=n(64151),p=n(34206),m=n(76087),h=n(1349),f=n(65443),g=n.n(f),v=n(90938),b=n(87834),y=n(85479),_=n(33851),k=n(90057),w=n(30337);const{wp:x}=window,C=[],E=()=>x.media.view.MediaFrame.Select.extend({featuredImageToolbar(e){this.createSelectToolbar(e,{text:x.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const e=this.state("featured-image").get("selection"),t=new x.media.view.EditImage({model:e.single(),controller:this}).render();this.content.set(t),t.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 x.media.controller.FeaturedImage,new x.media.controller.EditImage({model:this.options.editImage})])}}),S=()=>x.media.view.MediaFrame.Post.extend({galleryToolbar(){const e=this.state().get("editing");this.toolbar.set(new x.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:e?x.media.view.l10n.updateGallery:x.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 e=this.state("gallery").get("selection"),t=new x.media.view.EditImage({model:e.single(),controller:this}).render();this.content.set(t),t.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 x.media.controller.Library({id:"gallery",title:x.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:x.media.query({type:"image",...this.options.library})}),new x.media.controller.EditImage({model:this.options.editImage}),new x.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new x.media.controller.GalleryAdd])}}),I=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,n)=>(null!=e&&e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{}),T=e=>x.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"});class N extends u.Component{constructor(e){let{allowedTypes:t,gallery:n=!1,unstableFeaturedImageFlow:r=!1,modalClass:o,multiple:i=!1,title:l=(0,w.__)("Select or Upload Media")}=e;if(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),n)this.buildAndSetGalleryFrame();else{const e={title:l,multiple:i};t&&(e.library={type:t}),this.frame=x.media(e)}o&&this.frame.$el.addClass(o),r&&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=C}=this.props;if(r===this.lastGalleryValue)return;let o;this.lastGalleryValue=r,this.frame&&this.frame.remove(),o=e?"gallery-library":r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=S());const i=T(r),l=new x.media.model.Selection(i.models,{props:i.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:o,multiple:n,selection:l,editing:!(!r||!r.length)}),x.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const e=E(),t=T(this.props.value),n=new x.media.model.Selection(t.models,{props:t.props.toJSON()});this.frame=new e({mimeType:this.props.allowedTypes,state:"featured-image",multiple:this.props.multiple,selection:n,editing:!!this.props.value}),x.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=>I(e.toJSON()))):I(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{value:e}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(e)?null!=e&&e.length:e))return;const t=this.props.gallery,n=this.frame.state().get("selection"),r=Array.isArray(e)?e:[e];t||r.forEach((e=>{n.add(x.media.attachment(e))}));const o=T(r);o.more().done((function(){var e;t&&null!=o&&null!==(e=o.models)&&void 0!==e&&e.length&&n.add(o.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 B=N;const{createObjectURL:A,revokeObjectURL:L}=window.URL,P={};function D(e){const t=A(e);return P[t]=e,t}function R(e){P[e]&&L(e),delete P[e]}function M(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}const O=()=>{};async function F(e){let{allowedTypes:t,additionalData:n={},filesList:r,maxUploadFileSize:o,onError:i=O,onFileChange:l,wpAllowedMimeTypes:a=null}=e;const s=[...r],c=[],u=(e,t)=>{var n;R(null===(n=c[e])||void 0===n?void 0:n.url),c[e]=t,l(c.filter(Boolean))},d=e=>!t||t.some((t=>t.includes("/")?t===e:e.startsWith(`${t}/`))),p=(m=a)?Object.entries(m).map((e=>{let[t,n]=e;const[r]=n.split("/");return[n,...t.split("|").map((e=>`${r}/${e}`))]})).flat():m;var m;const h=[];for(const e of s)p&&e.type&&(f=e.type,!p.includes(f))?i({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,w.sprintf)((0,w.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e}):!e.type||d(e.type)?o&&e.size>o?i({code:"SIZE_ABOVE_LIMIT",message:(0,w.sprintf)((0,w.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e}):e.size<=0?i({code:"EMPTY_FILE",message:(0,w.sprintf)((0,w.__)("%s: This file is empty."),e.name),file:e}):(h.push(e),c.push({url:D(e)}),l(c)):i({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,w.sprintf)((0,w.__)("%s: Sorry, this file type is not supported here."),e.name),file:e});var f;for(let e=0;e<h.length;++e){const t=h[e];try{var g,v;const r=await j(t,n),{alt_text:o,source_url:i,...l}=r;u(e,{...l,alt:r.alt_text,caption:null!==(g=null===(v=r.caption)||void 0===v?void 0:v.raw)&&void 0!==g?g:"",title:r.title.raw,url:r.source_url})}catch(n){let r;u(e,null),r=n.message?n.message:(0,w.sprintf)((0,w.__)("Error while uploading file %s to the media library."),t.name),i({code:"GENERAL",message:r,file:t})}}}function j(e,t){const n=new window.FormData;return n.append("file",e,e.name||e.type.replace("/",".")),t&&Object.entries(t).forEach((e=>{let[t,r]=e;return n.append(t,r)})),(0,p.default)({path:"/wp/v2/media",body:n,method:"POST"})}var Z=n(18024),z=n(38104),H=n(61888),V=n(79097),W=n.n(V);const U=[{slug:"text",title:(0,w.__)("Text")},{slug:"media",title:(0,w.__)("Media")},{slug:"design",title:(0,w.__)("Design")},{slug:"widgets",title:(0,w.__)("Widgets")},{slug:"theme",title:(0,w.__)("Theme")},{slug:"embed",title:(0,w.__)("Embeds")},{slug:"reusable",title:(0,w.__)("Reusable blocks")}];function $(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function G(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"REMOVE_BLOCK_TYPES":return-1!==n.names.indexOf(t)?null:t;case e:return n.name||null}return t}}const q=G("SET_DEFAULT_BLOCK_NAME"),K=G("SET_FREEFORM_FALLBACK_BLOCK_NAME"),Y=G("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),J=G("SET_GROUPING_BLOCK_NAME");var X=W()({unprocessedBlockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.blockType.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return(0,H.omit)(e,t.names)}return e},blockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...$(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return(0,H.omit)(e,t.names)}return e},blockStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,H.mapValues)($(t.blockTypes),(t=>(0,H.uniqBy)([...(0,H.get)(t,["styles"],[]).map((e=>({...e,source:"block"}))),...(0,H.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))],(e=>e.name))))};case"ADD_BLOCK_STYLES":return{...e,[t.blockName]:(0,H.uniqBy)([...(0,H.get)(e,[t.blockName],[]),...t.styles],(e=>e.name))};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(0,H.filter)((0,H.get)(e,[t.blockName],[]),(e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,H.mapValues)($(t.blockTypes),(t=>(0,H.uniqBy)([...(0,H.get)(t,["variations"],[]).map((e=>({...e,source:"block"}))),...(0,H.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))],(e=>e.name))))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:(0,H.uniqBy)([...(0,H.get)(e,[t.blockName],[]),...t.variations],(e=>e.name))};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(0,H.filter)((0,H.get)(e,[t.blockName],[]),(e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:q,freeformFallbackBlockName:K,unregisteredFallbackBlockName:Y,groupingBlockName:J,categories:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||(0,H.isEmpty)(t.category))return e;if((0,H.find)(e,["slug",t.slug]))return(0,H.map)(e,(e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return(0,H.omit)(e,t.namespace)}return e}}),Q=n(6870);const ee=(e,t)=>"string"==typeof t?re(e,t):t;function te(e){return e.unprocessedBlockTypes}const ne=(0,Q.Z)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function re(e,t){return e.blockTypes[t]}function oe(e,t){return e.blockStyles[t]}const ie=(0,Q.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 le(e,t,n,r){const o=ie(e,t,r);return null==o?void 0:o.find((r=>{var o;if(Array.isArray(r.isActive)){const o=re(e,t),i=Object.keys((null==o?void 0:o.attributes)||{}),l=r.isActive.filter((e=>i.includes(e)));return 0!==l.length&&l.every((e=>n[e]===r.attributes[e]))}return null===(o=r.isActive)||void 0===o?void 0:o.call(r,n,r.attributes)}))}function ae(e,t,n){const r=ie(e,t,n);return[...r].reverse().find((e=>{let{isDefault:t}=e;return!!t}))||r[0]}function se(e){return e.categories}function ce(e){return e.collections}function ue(e){return e.defaultBlockName}function de(e){return e.freeformFallbackBlockName}function pe(e){return e.unregisteredFallbackBlockName}function me(e){return e.groupingBlockName}const he=(0,Q.Z)(((e,t)=>(0,H.map)((0,H.filter)(e.blockTypes,(e=>(0,H.includes)(e.parent,t))),(e=>{let{name:t}=e;return t}))),(e=>[e.blockTypes])),fe=(e,t,n,r)=>{const o=ee(e,t);return null!=o&&o.supports?(0,H.get)(o.supports,n,r):r};function ge(e,t,n,r){return!!fe(e,t,n,r)}function ve(e,t,n){const r=ee(e,t),o=(0,H.flow)([H.deburr,e=>e.toLowerCase(),e=>e.trim()]),i=o(n),l=(0,H.flow)([o,e=>(0,H.includes)(e,i)]);return l(r.title)||(0,H.some)(r.keywords,l)||l(r.category)||l(r.description)}const be=(e,t)=>he(e,t).length>0,ye=(e,t)=>(0,H.some)(he(e,t),(t=>ge(e,t,"inserter",!0)));var _e=n(4857),ke=n(85799),we=n(46688),xe=n(33780),Ce=n(70154);function Ee(e){(0,Ce.c)(e.parentNode,"node.parentNode"),e.parentNode.removeChild(e)}function Se(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let r=n.length;for(;r--;){const e=n[r];if("SCRIPT"===e.tagName)Ee(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 Ie(e){e=Se(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}const Te="block-default",Ne=["attributes","supports","save","migrate","isEligible","apiVersion"],Be={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},background:{value:["color","gradient"],support:["color","gradients"]},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},filter:{value:["filter","duotone"],support:["color","__experimentalDuotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"]},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},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},"--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}},Ae={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"},Le={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"typography.fontFamilies":!0,"typography.fontSizes":!0},Pe={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"]}]},De={};function Re(e){return null!==e&&"object"==typeof e}function Me(e){let{textdomain:t,...n}=e;const r=(0,H.pick)(n,["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","supports","styles","example","variations"]);return t&&Object.keys(Pe).forEach((e=>{r[e]&&(r[e]=Fe(Pe[e],r[e],t))})),r}function Oe(e,t){const n=Re(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,z.select)(Rt).getBlockType(n))return void console.error('Block "'+n+'" is already registered.');Re(e)&&function(e){for(const t of Object.keys(e))De[t]?(void 0===De[t].apiVersion&&e[t].apiVersion&&(De[t].apiVersion=e[t].apiVersion),void 0===De[t].ancestor&&e[t].ancestor&&(De[t].ancestor=e[t].ancestor)):De[t]=(0,H.mapKeys)((0,H.pickBy)(e[t],(e=>null!=e)),((e,t)=>(0,H.camelCase)(t)))}({[n]:Me(e)});const r={name:n,icon:Te,keywords:[],attributes:{},providesContext:{},usesContext:[],supports:{},styles:[],variations:[],save:()=>null,...null==De?void 0:De[n],...t};return(0,z.dispatch)(Rt).__experimentalRegisterBlockType(r),(0,z.select)(Rt).getBlockType(n)}function Fe(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,w._x)(t,e,n):Array.isArray(e)&&!(0,H.isEmpty)(e)&&Array.isArray(t)?t.map((t=>Fe(e[0],t,n))):Re(e)&&!(0,H.isEmpty)(e)&&Re(t)?Object.keys(t).reduce(((r,o)=>e[o]?(r[o]=Fe(e[o],t[o],n),r):(r[o]=t[o],r)),{}):t}function je(){return(0,z.select)(Rt).getFreeformFallbackBlockName()}function Ze(){return(0,z.select)(Rt).getUnregisteredFallbackBlockName()}function ze(){return(0,z.select)(Rt).getDefaultBlockName()}function He(e){var t;return null===(t=(0,z.select)(Rt))||void 0===t?void 0:t.getBlockType(e)}function Ve(){return(0,z.select)(Rt).getBlockTypes()}function We(e,t,n){return(0,z.select)(Rt).getBlockSupport(e,t,n)}function Ue(e,t,n){return(0,z.select)(Rt).hasBlockSupport(e,t,n)}function $e(e){return"core/block"===(null==e?void 0:e.name)}const Ge=(e,t)=>(0,z.select)(Rt).getBlockVariations(e,t);var qe=n(66711);function Ke(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=mt(e,t),o=(0,qe.Z)();return{clientId:o,name:e,isValid:!0,attributes:r,innerBlocks:n}}function Ye(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,r,o=[]]=t;return Ke(n,r,Ye(o))}))}function Je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=(0,qe.Z)(),o=mt(e.name,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map((e=>Je(e)))}}function Xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=(0,qe.Z)();return{...e,clientId:r,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map((e=>Xe(e)))}}const Qe=(e,t,n)=>{if((0,H.isEmpty)(n))return!1;const r=n.length>1,o=(0,H.first)(n).name;if(!et(e)&&r&&!e.isMultiBlock)return!1;if(!et(e)&&!(0,H.every)(n,{name:o}))return!1;if("block"!==e.type)return!1;const i=(0,H.first)(n);return!("from"===t&&-1===e.blocks.indexOf(i.name)&&!et(e)||!r&&tt(i.name)&&tt(e.blockName)||!it(e,n)||e.usingMobileTransformations&&et(e)&&!tt(i.name))},et=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),tt=e=>e===(0,z.select)(Rt).getGroupingBlockName();function nt(e){if((0,H.isEmpty)(e))return[];const t=(e=>{if((0,H.isEmpty)(e))return[];const t=Ve();return(0,H.filter)(t,(t=>!!rt(ot("from",t.name),(t=>Qe(t,"from",e)))))})(e),n=(e=>{if((0,H.isEmpty)(e))return[];const t=He((0,H.first)(e).name),n=t?ot("to",t.name):[];return(0,H.filter)(n,(t=>t&&Qe(t,"to",e))).map((e=>e.blocks)).flat().map((e=>"*"===e?e:He(e)))})(e);return(0,H.uniq)([...t,...n])}function rt(e,t){const n=(0,_e.Hu)();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 ot(e,t){if(void 0===t)return Ve().map((t=>{let{name:n}=t;return ot(e,n)})).flat();const n=dt(t),{name:r,transforms:o}=n||{};if(!o||!Array.isArray(o[e]))return[];const i=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms);return(i?(0,H.filter)(o[e],(e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!et(e)||(0,H.every)(e.blocks,(e=>o.supportedMobileTransforms.includes(e)))))):o[e]).map((e=>({...e,blockName:r,usingMobileTransformations:i})))}function it(e,t){if("function"!=typeof e.isMatch)return!0;const n=(0,H.first)(t),r=e.isMultiBlock?t.map((e=>e.attributes)):n.attributes,o=e.isMultiBlock?t:n;return e.isMatch(r,o)}function lt(e,t){const n=(0,H.castArray)(e),r=n.length>1,o=n[0],i=o.name,l=ot("from",t),a=rt(ot("to",i),(e=>"block"===e.type&&(et(e)||-1!==e.blocks.indexOf(t))&&(!r||e.isMultiBlock)&&it(e,n)))||rt(l,(e=>"block"===e.type&&(et(e)||-1!==e.blocks.indexOf(i))&&(!r||e.isMultiBlock)&&it(e,n)));if(!a)return null;let s;return s=a.isMultiBlock?(0,H.has)(a,"__experimentalConvert")?a.__experimentalConvert(n):a.transform(n.map((e=>e.attributes)),n.map((e=>e.innerBlocks))):(0,H.has)(a,"__experimentalConvert")?a.__experimentalConvert(o):a.transform(o.attributes,o.innerBlocks),null===s||"object"!=typeof s?null:(s=(0,H.castArray)(s),s.some((e=>!He(e.name)))?null:"*"===t||(0,H.some)(s,(e=>e.name===t))?s.map(((t,n,r)=>(0,_e.O)("blocks.switchToBlockType.transformedBlock",t,e,n,r))):null)}const at=(e,t)=>Ke(e,t.attributes,(0,H.map)(t.innerBlocks,(e=>at(e.name,e))));(0,ke.l7)([we.Z,xe.Z]);const st=["#191e23","#f8f9f9"];function ct(e){const t=ze();if(e.name!==t)return!1;ct.block&&ct.block.name===t||(ct.block=Ke(t));const n=ct.block,r=He(t);return(0,H.every)(null==r?void 0:r.attributes,((t,r)=>n.attributes[r]===e.attributes[r]))}function ut(e){return!!e&&("string"==typeof e||(0,u.isValidElement)(e)||"function"==typeof e||e instanceof u.Component)}function dt(e){return"string"==typeof e?He(e):e}function pt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visual";const{__experimentalLabel:r,title:o}=e,i=r&&r(t,{context:n});return i?Ie(i):o}function mt(e,t){const n=He(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return(0,H.reduce)(n.attributes,((e,n,r)=>{const o=t[r];return void 0!==o?e[r]=o:n.hasOwnProperty("default")&&(e[r]=n.default),-1!==["node","children"].indexOf(n.source)&&("string"==typeof e[r]?e[r]=[e[r]]:Array.isArray(e[r])||(e[r]=[])),e}),{})}const{error:ht,warn:ft}=window.console,gt={common:"text",formatting:"text",layout:"design"};function vt(e){return"function"==typeof e}const bt=(e,t)=>{let{select:n}=t;const{name:r}=e,o=(0,_e.O)("blocks.registerBlockType",{...e},r,null);if(o.deprecated&&(o.deprecated=o.deprecated.map((t=>(0,H.pick)((0,_e.O)("blocks.registerBlockType",{...(0,H.omit)(e,Ne),...t},r,t),Ne)))),(0,H.isPlainObject)(o))if(vt(o.save))if(!("edit"in o)||vt(o.edit))if(gt.hasOwnProperty(o.category)&&(o.category=gt[o.category]),"category"in o&&!(0,H.some)(n.getCategories(),{slug:o.category})&&(ft('The block "'+r+'" 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(ut(e=e||Te))return{src:e};if((0,H.has)(e,["background"])){const t=(0,ke.Vi)(e.background);return{...e,foreground:e.foreground?e.foreground:(0,H.maxBy)(st,(e=>t.contrast(e))),shadowColor:t.alpha(.3).toRgbString()}}return e}(o.icon),ut(o.icon.src))return o;ht("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 ht("Block titles must be strings.");else ht('The block "'+r+'" must have a title.');else ht('The "edit" property must be a valid function.');else ht('The "save" property must be a valid function.');else ht("Block settings must be a valid object.")};function yt(e){return{type:"ADD_BLOCK_TYPES",blockTypes:(0,H.castArray)(e)}}const _t=e=>t=>{let{dispatch:n,select:r}=t;n({type:"ADD_UNPROCESSED_BLOCK_TYPE",blockType:e});const o=bt(e,{select:r});o&&n.addBlockTypes(o)},kt=()=>e=>{let{dispatch:t,select:n}=e;const r=n.__experimentalGetUnprocessedBlockTypes(),o=Object.keys(r).reduce(((e,t)=>{const o=bt(r[t],{select:n});return o&&e.push(o),e}),[]);o.length&&t.addBlockTypes(o)};function wt(e){return{type:"REMOVE_BLOCK_TYPES",names:(0,H.castArray)(e)}}function xt(e,t){return{type:"ADD_BLOCK_STYLES",styles:(0,H.castArray)(t),blockName:e}}function Ct(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:(0,H.castArray)(t),blockName:e}}function Et(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:(0,H.castArray)(t),blockName:e}}function St(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:(0,H.castArray)(t),blockName:e}}function It(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function Tt(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Nt(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function Bt(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function At(e){return{type:"SET_CATEGORIES",categories:e}}function Lt(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Pt(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function Dt(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}const Rt=(0,Z.Z)("core/blocks",{reducer:X,selectors:r,actions:o});let Mt,Ot,Ft,jt;(0,z.register)(Rt);const Zt=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function zt(e,t,n,r,o){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:r,innerContent:o}}function Ht(e){return zt(null,{},[],e,[e])}function Vt(){const e=function(){const e=Zt.exec(Mt);if(null===e)return["no-more-tokens"];const t=e.index,[n,r,o,i,l,,a]=e,s=n.length,c=!!r,u=!!a,d=(o||"core/")+i,p=!!l?function(e){try{return JSON.parse(e)}catch(e){return null}}(l):{};return u?["void-block",d,p,t,s]:c?["block-closer",d,null,t,s]:["block-opener",d,p,t,s]}(),[t,n,r,o,i]=e,l=jt.length,a=o>Ot?Ot:null;switch(t){case"no-more-tokens":if(0===l)return Wt(),!1;if(1===l)return $t(),!1;for(;0<jt.length;)$t();return!1;case"void-block":return 0===l?(null!==a&&Ft.push(Ht(Mt.substr(a,o-a))),Ft.push(zt(n,r,[],"",[])),Ot=o+i,!0):(Ut(zt(n,r,[],"",[]),o,i),Ot=o+i,!0);case"block-opener":return jt.push(function(e,t,n,r,o){return{block:e,tokenStart:t,tokenLength:n,prevOffset:r||t+n,leadingHtmlStart:o}}(zt(n,r,[],"",[]),o,i,o+i,a)),Ot=o+i,!0;case"block-closer":if(0===l)return Wt(),!1;if(1===l)return $t(o),Ot=o+i,!0;const e=jt.pop(),t=Mt.substr(e.prevOffset,o-e.prevOffset);return e.block.innerHTML+=t,e.block.innerContent.push(t),e.prevOffset=o+i,Ut(e.block,e.tokenStart,e.tokenLength,o+i),Ot=o+i,!0;default:return Wt(),!1}}function Wt(e){const t=e||Mt.length-Ot;0!==t&&Ft.push(Ht(Mt.substr(Ot,t)))}function Ut(e,t,n,r){const o=jt[jt.length-1];o.block.innerBlocks.push(e);const i=Mt.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 $t(e){const{block:t,leadingHtmlStart:n,prevOffset:r,tokenStart:o}=jt.pop(),i=e?Mt.substr(r,e-r):Mt.substr(r);i&&(t.innerHTML+=i,t.innerContent.push(i)),null!==n&&Ft.push(Ht(Mt.substr(n,o-n))),Ft.push(t)}const Gt=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");function qt(e,t){const n=function(e){const t=[];let n,r=e;for(;n=r.match(Gt);){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 l=o[i];if(-1!==n[e].indexOf(l)){n[e]=n[e].replace(new RegExp(l,"g"),t[l]),r=!0;break}}return r&&(e=n.join("")),e}var Kt=n(21075),Yt=n(45805),Jt=n(8313);function Xt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isCommentDelimited:n=!0}=t,{blockName:r,attrs:o={},innerBlocks:i=[],innerContent:l=[]}=e;let a=0;const s=l.map((e=>null!==e?e:Xt(i[a++],t))).join("\n").replace(/\n+/g,"\n").trim();return n?an(r,o,s):s}function Qt(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,_e.O)("blocks.getBlockDefaultClassName",t,e)}function en(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,_e.O)("blocks.getBlockMenuDefaultClassName",t,e)}const tn={},nn={};function rn(e,t,n){const r=dt(e);return(0,Yt.ZP)(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=dt(e);let{save:o}=r;if(o.prototype instanceof u.Component){const e=new o({attributes:t});o=e.render.bind(e)}tn.blockType=r,tn.attributes=t,nn.innerBlocks=n;let i=o({attributes:t,innerBlocks:n});if(null!==i&&"object"==typeof i&&(0,_e.H7)("blocks.getSaveContent.extraProps")&&!(r.apiVersion>1)){const e=(0,_e.O)("blocks.getSaveContent.extraProps",{...i.props},r,t);(0,Jt.ZP)(e,i.props)||(i=(0,u.cloneElement)(i,e))}return(0,_e.O)("blocks.getSaveElement",i,r,t)}(r,t,n))}function on(e,t){return(0,H.reduce)(e.attributes,((e,n,r)=>{const o=t[r];return void 0===o||void 0!==n.source||"default"in n&&n.default===o||(e[r]=o),e}),{})}function ln(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=rn(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function an(e,t,n){const r=(0,H.isEmpty)(t)?"":function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ",o=(0,H.startsWith)(e,"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 sn(e,t){return(0,H.castArray)(e).map((e=>function(e){let{isInnerBlocks:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.isValid&&e.__unstableBlockSource)return Xt(e.__unstableBlockSource);const n=e.name,r=ln(e);if(n===Ze()||!t&&n===je())return r;const o=He(n);if(!o)return r;const i=on(o,e.attributes);return an(n,i,r)}(e,t))).join("\n\n")}var cn=/[\t\n\f ]/,un=/[A-Za-z]/,dn=/\r\n?/g;function pn(e){return cn.test(e)}function mn(e){return un.test(e)}var hn=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||mn(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(){pn(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();pn(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();pn(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(!pn(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();pn(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();pn(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();pn(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();pn(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();pn(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();pn(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();pn(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();pn(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();pn(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();pn(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();pn(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();pn(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||mn(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(dn,"\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}(),fn=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 hn(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}(),gn=n(86218);function vn(){function e(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return e("Block validation: "+t,...r)}}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}function bn(){const e=[],t=vn();return{error(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.push({log:t.error,args:r})},warning(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.push({log:t.warning,args:r})},getItems:()=>e}}const yn=/[\t\n\r\v\f ]+/g,_n=/^[\t\n\r\v\f ]*$/,kn=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,wn=["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"],xn=[...wn,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Cn=[e=>e,function(e){return Nn(e).join(" ")}],En=/^[\da-z]+$/i,Sn=/^#\d+$/,In=/^#x[\da-f]+$/i;class Tn{parse(e){if(t=e,En.test(t)||Sn.test(t)||In.test(t))return(0,gn.decodeEntities)("&"+e+";");var t}}function Nn(e){return e.trim().split(yn)}function Bn(e){return e.attributes.filter((e=>{const[t,n]=e;return n||0===t.indexOf("data-")||(0,H.includes)(xn,t)}))}function An(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vn(),r=e.chars,o=t.chars;for(let e=0;e<Cn.length;e++){const t=Cn[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 Ln(e){return 0===parseFloat(e)?"0":0===e.indexOf(".")?"0"+e:e}function Pn(e){return Nn(e).map(Ln).join(" ").replace(kn,"url($1)")}function Dn(e){const t=e.replace(/;?\s*$/,"").split(";").map((e=>{const[t,...n]=e.split(":"),r=n.join(":");return[t.trim(),Pn(r.trim())]}));return Object.fromEntries(t)}const Rn={class:(e,t)=>!(0,H.xor)(...[e,t].map(Nn)).length,style:(e,t)=>(0,H.isEqual)(...[e,t].map(Dn)),...Object.fromEntries(wn.map((e=>[e,()=>!0])))};function Mn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vn();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],l=o.toLowerCase();if(!r.hasOwnProperty(l))return n.warning("Encountered unexpected attribute `%s`.",o),!1;const a=r[l],s=Rn[l];if(s){if(!s(i,a))return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,a,i),!1}else if(i!==a)return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,a,i),!1}return!0}const On={StartTag:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vn();return e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(n.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):Mn(...[e,t].map(Bn),n)},Chars:An,Comment:An};function Fn(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!_n.test(t.chars))return t}}function jn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vn();try{return new fn(new Tn).tokenize(e)}catch(n){t.warning("Malformed HTML detected: %s",e)}return null}function Zn(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function zn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vn();if(e===t)return!0;const[r,o]=[e,t].map((e=>jn(e,n)));if(!r||!o)return!1;let i,l;for(;i=Fn(r);){if(l=Fn(o),!l)return n.warning("Expected end of content, instead saw %o.",i),!1;if(i.type!==l.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",l.type,l,i.type,i),!1;const e=On[i.type];if(e&&!e(i,l,n))return!1;Zn(i,o[0])?Fn(o):Zn(l,r[0])&&Fn(r)}return!(l=Fn(o))||(n.warning("Expected %o, instead saw end of content.",l),!1)}function Hn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.name;const n=e.name===je()||e.name===Ze();if(n)return[!0,[]];const r=bn(),o=dt(t);let i;try{i=rn(o,e.attributes)}catch(e){return r.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,r.getItems()]}const l=zn(e.originalContent,i,r);return l||r.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",o.name,o,i,e.originalContent),[l,r.getItems()]}function Vn(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]}function Wn(e,t){for(var n,r=t.split(".");n=r.shift();){if(!(n in e))return;e=e[n]}return e}var Un,$n=function(){return Un||(Un=document.implementation.createHTMLDocument("")),Un};function Gn(e,t){if(t){if("string"==typeof e){var n=$n();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]=Gn(e,t[r]),n}),{})}}function qn(e,t){return 1===arguments.length&&(t=e,e=void 0),function(n){var r=n;if(e&&(r=n.querySelector(e)),r)return Wn(r,t)}}var Kn=n(35721),Yn=n.n(Kn);function Jn(e){const t={};for(let n=0;n<e.length;n++){const{name:r,value:o}=e[n];t[r]=o}return t}function Xn(e){if(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:{...Jn(e.attributes),children:Qn(e.childNodes)}}}function Qn(e){const t=[];for(let n=0;n<e.length;n++)try{t.push(Xn(e[n]))}catch(e){}return t}function er(e){return t=>{let n=t;return e&&(n=t.querySelector(e)),n?Qn(n.childNodes):[]}}var tr={concat:function(){const e=[];for(let t=0;t<arguments.length;t++){const n=(0,H.castArray)(t<0||arguments.length<=t?void 0:arguments[t]);for(let t=0;t<n.length;t++){const r=n[t];"string"==typeof r&&"string"==typeof e[e.length-1]?e[e.length-1]+=r:e.push(r)}}return e},getChildrenArray:function(e){return e},fromDOM:Qn,toHTML:function(e){const t=e;return(0,Yt.ZP)(t)},matcher:er};function nr(e,t,n,r){let o;switch(t.source){case void 0:o=r?r[e]:void 0;break;case"attribute":case"property":case"html":case"text":case"children":case"node":case"query":case"tag":o=ir(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,(0,H.castArray)(t))}(o,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(o,t.enum)||(o=void 0),void 0===o&&(o=t.default),o}const rr=Yn()((e=>{switch(e.source){case"attribute":let t=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(n){var r=qn(e,"attributes")(n);if(r&&r.hasOwnProperty(t))return r[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>(0,H.flow)([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 qn(e,"textContent")}(e.selector);case"children":return er(e.selector);case"node":return function(e){return t=>{let n=t;e&&(n=t.querySelector(e));try{return Xn(n)}catch(e){return null}}}(e.selector);case"query":const n=(0,H.mapValues)(e.query,rr);return function(e,t){return function(n){var r=n.querySelectorAll(e);return[].map.call(r,(function(e){return Gn(e,t)}))}}(e.selector,n);case"tag":return(0,H.flow)([qn(e.selector,"nodeName"),e=>e?e.toLowerCase():void 0]);default:console.error(`Unknown source type "${e.source}"`)}}));function or(e){return Gn(e,(e=>e))}function ir(e,t){return rr(t)(or(e))}function lr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=or(t),o=dt(e),i=(0,H.mapValues)(o.attributes,((e,t)=>nr(t,e,r,n)));return(0,_e.O)("blocks.getBlockAttributes",i,o,t,n)}const ar={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function sr(e){const t=ir(`<div data-custom-class-name>${e}</div>`,ar);return t?t.trim().split(/\s+/):[]}function cr(e,t){const n=function(e,t,n){if(Ue(t,"customClassName",!0)){const r=rn(t,(0,H.omit)(e,["className"])),o=sr(r),i=sr(n),l=(0,H.difference)(i,o);l.length?e.className=l.join(" "):r&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:n}}function ur(){return!1}function dr(e,t){let n=function(e,t){const n=je(),r=e.blockName||je(),o=e.attrs||{},i=e.innerBlocks||[];let l=e.innerHTML.trim();return r!==n||null!=t&&t.__unstableSkipAutop||(l=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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 l="<pre wp-pre-tag-"+r+"></pre>";n.push([l,o.substr(i)+"</pre>"]),e+=o.substr(0,i)+l}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=qt(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=e.replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,((e,t)=>t?e:"<br />\n"))).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}(l).trim()),{...e,blockName:r,attrs:o,innerHTML:l,innerBlocks:i}}(e,t);n=function(e){const[t,n]=Vn(e.blockName,e.attrs);return{...e,blockName:t,attrs:n}}(n);let r=He(n.blockName);r||(n=function(e){const t=Ze()||je(),n=Xt(e,{isCommentDelimited:!1}),r=Xt(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=He(n.blockName));const o=n.blockName===je()||n.blockName===Ze();if(!r||!n.innerHTML&&o)return;const i=n.innerBlocks.map((e=>dr(e,t))).filter((e=>!!e)),l=Ke(n.blockName,lr(r,n.innerHTML,n.attrs),i);l.originalContent=n.innerHTML;const a=function(e,t){const[n]=Hn(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const r=cr(e,t),[o,i]=Hn(e,t);return{...r,isValid:o,validationIssues:i}}(l,r),{validationIssues:s}=a,c=function(e,t,n){const r=t.attrs,{deprecated:o}=n;if(!o||!o.length)return e;for(let t=0;t<o.length;t++){const{isEligible:i=ur}=o[t];if(e.isValid&&!i(r,e.innerBlocks))continue;const l=Object.assign((0,H.omit)(n,Ne),o[t]);let a={...e,attributes:lr(l,e.originalContent,r)},[s]=Hn(a,l);if(s||(a=cr(a,l),[s]=Hn(a,l)),!s)continue;let c=a.innerBlocks,u=a.attributes;const{migrate:d}=l;d&&([u=r,c=e.innerBlocks]=(0,H.castArray)(d(u,e.innerBlocks))),e={...e,attributes:u,innerBlocks:c,isValid:!0,validationIssues:[]}}return e}(a,n,r);return c.isValid||(c.__unstableBlockSource=e),a.isValid||!c.isValid||null!=t&&t.__unstableSkipMigrationLogs?a.isValid||c.isValid||s.forEach((e=>{let{log:t,args:n}=e;return t(...n)})):(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,rn(r,c.attributes),c.originalContent),console.groupEnd()),c}function pr(e,t){return(e=>{Mt=e,Ot=0,Ft=[],jt=[],Zt.lastIndex=0;do{}while(Vt());return Ft})(e).reduce(((e,n)=>{const r=dr(n,t);return r&&e.push(r),e}),[])}function mr(){return(0,H.filter)(ot("from"),{type:"raw"}).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function hr(e){const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children).flatMap((e=>{const t=rt(mr(),(t=>{let{isMatch:n}=t;return n(e)}));if(!t)return Ke("core/html",lr("core/html",e.outerHTML));const{transform:n,blockName:r}=t;return n?n(e):Ke(r,lr(r,e.outerHTML))}))}function fr(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(fr));default:return!0}}const gr={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":{}};(0,H.without)(Object.keys(gr),"#text","br").forEach((e=>{gr[e].children=(0,H.omit)(gr,e)}));const vr={...gr,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 br(e){return"paste"!==e?vr:(0,H.omit)({...vr,ins:{children:vr.ins.children},del:{children:vr.del.children}},["u","abbr","data","time","wbr","bdi","bdo"])}function yr(e){const t=e.nodeName.toLowerCase();return br().hasOwnProperty(t)||"span"===t}function _r(e){const t=e.nodeName.toLowerCase();return gr.hasOwnProperty(t)||"span"===t}function kr(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?fr(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?fr(e)?r.removeChild(e):o.appendChild(e):yr(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 wr(e,t){(0,Ce.c)(t.parentNode,"referenceNode.parentNode"),t.parentNode.insertBefore(e,t.nextSibling)}function xr(e,t){(0,Ce.c)(e.parentNode,"processedNode.parentNode"),wr(t,e.parentNode),Ee(e)}function Cr(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,Ee(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,l=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[n.slice(0,r).reduce(l,null),i,n.slice(r+1).reduce(l,null)].forEach((t=>t&&o.insertBefore(t,e.parentNode))),Ee(e.parentNode)}else xr(e,i)}(e,t):xr(e,function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t)))}function Er(e){const t=e.parentNode;for((0,Ce.c)(t,"node.parentNode");e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function Sr(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Ir(e){if(!Sr(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((e=>{let{nodeValue:t=""}=e;return t})).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&&Sr(r)){const t=e.previousElementSibling;t?t.appendChild(e):Er(e)}}function Tr(e){"BLOCKQUOTE"===e.nodeName&&(e.innerHTML=kr(e.innerHTML))}function Nr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Br(e,t,n){if(!function(e,t){const n=e.nodeName.toLowerCase();return"figcaption"!==n&&!_r(e)&&(0,H.has)(t,["figure","children",n])}(e,n))return;let r=e;const o=e.parentNode;(function(e,t){const n=e.nodeName.toLowerCase();return(0,H.has)(t,["figure","children","a","children",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())&&Nr(r,i):Nr(r,i):"BODY"===r.parentNode.nodeName&&Nr(r)}function Ar(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=Lr(e);r.lastIndex=n;const o=r.exec(t);if(!o)return;if("["===o[1]&&"]"===o[7])return Ar(e,t,r.lastIndex);const i={index:o.index,content:o[0],shortcode:Dr(o)};return o[1]&&(i.content=i.content.slice(1),i.index++),o[7]&&(i.content=i.content.slice(0,-1)),i}function Lr(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const Pr=Yn()((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 Dr(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new Rr({tag:e[2],attrs:e[3],type:t,content:e[5]})}const Rr=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=Pr(n):n.length===i.length&&i.every(((e,t)=>e===n[t]))?this.attrs=n:Object.entries(n).forEach((e=>{let[t,n]=e;this.set(t,n)}))}),{next:Ar,replace:function(e,t,n){return t.replace(Lr(e),(function(e,t,r,o,i,l,a,s){if("["===t&&"]"===s)return e;const c=n(Dr(arguments));return c||""===c?t+c+s:e}))},string:function(e){return new Rr(e).string()},regexp:Lr,attrs:Pr,fromMatch:Dr});Object.assign(Rr.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=>{let[n,r]=t;e+=" "+n+'="'+r+'"'})),"single"===this.type?e+"]":"self-closing"===this.type?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});var Mr=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=ot("from"),i=rt(o,(e=>-1===r.indexOf(e.blockName)&&"shortcode"===e.type&&(0,H.some)((0,H.castArray)(e.tag),(e=>Lr(e).test(t)))));if(!i)return[t];const l=(0,H.castArray)(i.tag),a=(0,H.find)(l,(e=>Lr(e).test(t)));let s;const c=n;if(s=Ar(a,t,n)){n=s.index+s.content.length;const o=t.substr(0,s.index),l=t.substr(n);if(!((0,H.includes)(s.shortcode.content||"","<")||/(\n|<p>)\s*$/.test(o)&&/^\s*(\n|<\/p>)/.test(l)))return e(t,n);if(i.isMatch&&!i.isMatch(s.shortcode.attrs))return e(t,c,[...r,i.blockName]);let a=[];if("function"==typeof i.transform)a=[].concat(i.transform(s.shortcode.attrs,s)),a=a.map((e=>(e.originalContent=s.shortcode.content,cr(e,He(e.name)))));else{const e=(0,H.mapValues)((0,H.pickBy)(i.attributes,(e=>e.shortcode)),(e=>e.shortcode(s.shortcode.attrs,s))),n=He(i.blockName);if(!n)return[t];const r={...n,attributes:i.attributes};let o=Ke(i.blockName,lr(r,s.shortcode.content,e));o.originalContent=s.shortcode.content,o=cr(o,r),a=[o]}return[...e(o),...a,...e(l)]}return[t]};function Or(e){return function(e,t){const n={phrasingContentSchema:br(t),isPaste:"paste"===t},r=e.map((e=>{let{isMatch:t,blockName:r,schema:o}=e;const i=Ue(r,"anchor");return o="function"==typeof o?o(n):o,i||t?(0,H.mapValues)(o,(e=>{let n=e.attributes||[];return i&&(n=[...n,"id"]),{...e,attributes:n,isMatch:t||void 0}})):o}));return(0,H.mergeWith)({},...r,((e,t,n)=>{switch(n){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return function(){return e(...arguments)||t(...arguments)}}}))}(mr(),e)}function Fr(e,t,n,r){Array.from(e).forEach((e=>{Fr(e.childNodes,t,n,r),t.forEach((t=>{n.contains(e)&&t(e,n,r)}))}))}function jr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,Fr(r.body.childNodes,t,r,n),r.body.innerHTML}function Zr(e,t){const n=e[`${t}Sibling`];if(n&&yr(n))return n;const{parentNode:r}=e;return r&&yr(r)?Zr(r,t):void 0}function zr(e){let{HTML:t=""}=e;if(-1!==t.indexOf("\x3c!-- wp:"))return pr(t);const n=Mr(t),r=Or();return n.map((e=>"string"!=typeof e?e:hr(e=kr(e=jr(e,[Ir,Cr,Br,Tr],r))))).flat().filter(Boolean)}const Hr=()=>{};function Vr(e,t,n,r){Array.from(e).forEach((e=>{var o,i;const l=e.nodeName.toLowerCase();if(n.hasOwnProperty(l)&&(!n[l].isMatch||null!==(o=(i=n[l]).isMatch)&&void 0!==o&&o.call(i,e))){if(function(e){return!!e&&e.nodeType===e.ELEMENT_NODE}(e)){const{attributes:o=[],classes:i=[],children:a,require:s=[],allowEmpty:c}=n[l];if(a&&!c&&fr(e))return void Ee(e);if(e.hasAttributes()&&(Array.from(e.attributes).forEach((t=>{let{name:n}=t;"class"===n||(0,H.includes)(o,n)||e.removeAttribute(n)})),e.classList&&e.classList.length)){const t=i.map((e=>"string"==typeof e?t=>t===e:e instanceof RegExp?t=>e.test(t):Hr));Array.from(e.classList).forEach((n=>{t.some((e=>e(n)))||e.classList.remove(n)})),e.classList.length||e.removeAttribute("class")}if(e.hasChildNodes()){if("*"===a)return;if(a)s.length&&!e.querySelector(s.join(","))?(Vr(e.childNodes,t,n,r),Er(e)):e.parentNode&&"BODY"===e.parentNode.nodeName&&yr(e)?(Vr(e.childNodes,t,n,r),Array.from(e.childNodes).some((e=>!yr(e)))&&Er(e)):Vr(e.childNodes,t,a,r);else for(;e.firstChild;)Ee(e.firstChild)}}}else Vr(e.childNodes,t,n,r),r&&!yr(e)&&e.nextElementSibling&&wr(t.createElement("br"),e),Er(e)}))}function Wr(e,t,n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,Vr(r.body.childNodes,r,t,n),r.body.innerHTML}function Ur(e){e.nodeType===e.COMMENT_NODE&&Ee(e)}function $r(e,t){return e.every((e=>function(e,t){if(_r(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===(0,H.difference)([n,t],e).length))}(e,t)&&$r(Array.from(e.children),t)))}function Gr(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}function qr(e,t){(0,Ce.c)(t.parentNode,"referenceNode.parentNode"),t.parentNode.insertBefore(e,t),e.appendChild(t)}function Kr(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return(0,Ce.c)(e.parentNode,"node.parentNode"),e.parentNode.replaceChild(n,e),n}function Yr(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:r,textDecorationLine:o,textDecoration:i,verticalAlign:l}=e.style;"bold"!==n&&"700"!==n||qr(t.createElement("strong"),e),"italic"===r&&qr(t.createElement("em"),e),("line-through"===o||(0,H.includes)(i,"line-through"))&&qr(t.createElement("s"),e),"super"===l?qr(t.createElement("sup"),e):"sub"===l&&qr(t.createElement("sub"),e)}else"B"===e.nodeName?e=Kr(e,"strong"):"I"===e.nodeName?e=Kr(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 Jr(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}const{parseInt:Xr}=window;function Qr(e){return"OL"===e.nodeName||"UL"===e.nodeName}function eo(e,t){if("P"!==e.nodeName)return;const n=e.getAttribute("style");if(!n)return;if(-1===n.indexOf("mso-list"))return;const r=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);if(!r)return;let o=Xr(r[1],10)-1||0;const i=e.previousElementSibling;if(!i||!Qr(i)){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 l=e.previousElementSibling,a=l.nodeName,s=t.createElement("li");let c=l;for(e.removeChild(e.firstChild);e.firstChild;)s.appendChild(e.firstChild);for(;o--;)c=c.lastChild||c,Qr(c)&&(c=c.lastChild||c);Qr(c)||(c=c.appendChild(t.createElement(a))),c.appendChild(s),e.parentNode.removeChild(e)}const{atob:to,File:no}=window;function ro(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=to(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 l=r.replace("/","."),a=new no([i],l,{type:r});e.src=D(a)}1!==e.height&&1!==e.width||e.parentNode.removeChild(e)}}function oo(e){"DIV"===e.nodeName&&(e.innerHTML=kr(e.innerHTML))}var io=n(52965);const lo=new(n.n(io)().Converter)({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function ao(e){if("IFRAME"===e.nodeName){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function so(e){e.id&&0===e.id.indexOf("docs-internal-guid-")&&Er(e)}function co(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=Zr(e,"previous");t&&"BR"!==t.nodeName&&" "!==t.textContent.slice(-1)||(n=n.slice(1))}if(" "===n[n.length-1]){const t=Zr(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 uo(e){"BR"===e.nodeName&&(Zr(e,"next")||e.parentNode.removeChild(e))}function po(e){"P"===e.nodeName&&(e.hasChildNodes()||e.parentNode.removeChild(e))}const{console:mo}=window;function ho(e,t){return e=Wr(e=jr(e,[so,Yr,Ur]),br("paste"),{inline:!0}),t||(e=jr(e,[co,uo])),mo.log("Processed inline HTML:\n\n",e),e}function fo(e){let{HTML:t="",plainText:n="",mode:r="AUTO",tagName:o,preserveWhiteSpace:i}=e;if(t=t.replace(/<meta[^>]+>/g,""),t=t.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,""),t=t.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==r){const e=t||n;if(-1!==e.indexOf("\x3c!-- wp:"))return pr(e)}var l;if(String.prototype.normalize&&(t=t.normalize()),!n||t&&!function(e){return!/<(?!br[ />])/i.test(e)}(t)||(t=n,/^\s+$/.test(n)||(l=t,t=lo.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,n,r)=>`${t}\n${n}\n${r}`))}(l))),"AUTO"===r&&-1===n.indexOf("\n")&&0!==n.indexOf("<p>")&&0===t.indexOf("<p>")&&(r="INLINE")),"INLINE"===r)return ho(t,i);const a=Mr(t),s=a.length>1;if("AUTO"===r&&!s&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const r=Array.from(n.body.children);return!r.some(Gr)&&$r(r,t)}(t,o))return ho(t,i);const c=br("paste"),u=Or("paste"),d=a.map((e=>{if("string"!=typeof e)return e;const t=[so,eo,Jr,Ir,ro,Yr,Cr,Ur,ao,Br,Tr,oo],n={...u,...c};return e=jr(e,t,u),e=jr(e=kr(e=Wr(e,n)),[co,uo,po],u),mo.log("Processed HTML piece:\n\n",e),hr(e)})).flat().filter(Boolean);if("AUTO"===r&&1===d.length&&Ue(d[0].name,"__unstablePasteTextInline",!1)){const e=n.replace(/^[\n]+|[\n]+$/g,"");if(""!==e&&-1===e.indexOf("\n"))return Wr(ln(d[0]),c)}return d}function go(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,H.every)(t,((t,n)=>{let[r,,o]=t;const i=e[n];return r===i.name&&go(i.innerBlocks,o)}))}function vo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t?(0,H.map)(t,((t,n)=>{let[r,o,i]=t;const l=e[n];if(l&&l.name===r){const e=vo(l.innerBlocks,i);return{...l,innerBlocks:e}}const a=He(r),s=(e,t)=>(0,H.mapValues)(t,((t,n)=>c(e[n],t))),c=(e,t)=>{return n=e,"html"===(0,H.get)(n,["source"])&&Array.isArray(t)?(0,Yt.ZP)(t):(e=>"query"===(0,H.get)(e,["source"]))(e)&&t?t.map((t=>s(e.query,t))):t;var n},u=s((0,H.get)(a,["attributes"],{}),o);let[d,p]=Vn(r,u);return void 0===He(d)&&(p={originalName:r,originalContent:"",originalUndelimitedContent:""},d="core/missing"),Ke(d,p,vo([],i))})):e}(0,_e.KJ)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&Ue(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var bo=n(86215),yo=n(73703),_o=n(66558),ko=n(50850),wo=n(8021),xo={default:(0,_.up)("BlockControls"),block:(0,_.up)("BlockControlsBlock"),inline:(0,_.up)("BlockFormatControls"),other:(0,_.up)("BlockControlsOther"),parent:(0,_.up)("BlockControlsParent")};const Co={insertUsage:{}},Eo={alignWide:!1,supportsLayout:!0,colors:[{name:(0,w.__)("Black"),slug:"black",color:"#000000"},{name:(0,w.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,w.__)("White"),slug:"white",color:"#ffffff"},{name:(0,w.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,w.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,w.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,w.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,w.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,w.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,w.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,w.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,w.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,w._x)("Small","font size name"),size:13,slug:"small"},{name:(0,w._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,w._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,w._x)("Large","font size name"),size:36,slug:"large"},{name:(0,w._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,w.__)("Thumbnail")},{slug:"medium",name:(0,w.__)("Medium")},{slug:"large",name:(0,w.__)("Large")},{slug:"full",name:(0,w.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,w.__)("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,w.__)("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,w.__)("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,w.__)("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,w.__)("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,w.__)("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,w.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,w.__)("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,w.__)("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,w.__)("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,w.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,w.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function So(e,t,n){return[...e.slice(0,n),...(0,H.castArray)(t),...e.slice(n)]}function Io(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const o=[...e];return o.splice(t,r),So(o,e.slice(t,t+r),n)}const To=e=>e;function No(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:r,innerBlocks:o}=e;n[t].push(r),Object.assign(n,No(o,r))})),n}function Bo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},Bo(n.innerBlocks,n.clientId))),{})}function Ao(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:To;const n={},r=[...e];for(;r.length;){const{innerBlocks:e,...o}=r.shift();r.push(...e),n[o.clientId]=t(o)}return n}function Lo(e){return Ao(e,(e=>(0,H.omit)(e,"attributes")))}function Po(e){return Ao(e,(e=>e.attributes))}function Do(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,H.isEqual)(e.clientIds,t.clientIds)&&(n=e.attributes,r=t.attributes,(0,H.isEqual)(Object.keys(n),Object.keys(r)));var n,r}function Ro(e,t){const n={},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[e.clientId]={};for(const t of o)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function Mo(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=new Set([]),i=new Set;for(const t of n){let n=r?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){i.add(n);break}o.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of o)t[e]={...t[e]};for(const n of o)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of i)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const Oo=(0,H.flow)(W(),(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=(0,H.mapValues)(t.attributes,((n,o)=>{const{name:i}=t.byClientId[o];return"core/block"===i&&n.ref===e?{...n,ref:r}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const r=e(t,n);if(r===t)return t;switch(r.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=Ro(r,n.blocks);r.tree=Mo(r,{...r.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":r.tree=Mo(r,{...r.tree,[n.clientId]:{...r.tree[n.clientId],...r.byClientId[n.clientId],attributes:r.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...r.tree[t],attributes:r.attributes[t]},e)),{});r.tree=Mo(r,{...r.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=Ro(r,n.blocks);r.tree=Mo(r,{...(0,H.omit)(r.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const o=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!r.byClientId[t.parents[e]]||o.push(t.parents[e]);r.tree=Mo(r,r.tree,o,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const o of n.clientIds)void 0===t.parents[o]||""!==t.parents[o]&&!r.byClientId[t.parents[o]]||e.push(t.parents[o]);r.tree=Mo(r,(0,H.omit)(r.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),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=Mo(r,r.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];r.tree=Mo(r,r.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,H.omitBy)(r.attributes,((e,t)=>"core/block"!==r.byClientId[t].name||e.ref!==n.updatedId)));r.tree=Mo(r,{...r.tree,...e.reduce(((e,t)=>(e[t]={...r.byClientId[t],attributes:r.attributes[t],innerBlocks:r.tree[t].innerBlocks},e)),{})},e,!1)}}return r}),(e=>(t,n)=>{const r=e=>{let r=e;for(let o=0;o<r.length;o++)!t.order[r[o]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[r[o]]||(r===e&&(r=[...r]),r.push(...t.order[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[n.rootClientId]&&(o=e(o,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:r,clientIds:t.order[n.rootClientId]}));let i=o;return n.blocks.length&&(i=e(i,{...n,type:"INSERT_BLOCKS",index:0}),i.order={...i.order,...(0,H.reduce)(r,((e,n,r)=>(t.order[r]&&(e[r]=t.order[r]),e)),{})},i.tree={...i.tree,...(0,H.reduce)(r,((e,n,r)=>{const o=`controlled||${r}`;return t.tree[o]&&(e[o]=t.tree[o]),e}),{})}),i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:Lo(n.blocks),attributes:Po(n.blocks),order:No(n.blocks),parents:Bo(n.blocks),controlledInnerBlocks:{},visibility:{}},r=Ro(e,n.blocks);return e.tree={...r,"":{innerBlocks:n.blocks.map((e=>r[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(r,o)=>{let i=e(r,o);const l="MARK_LAST_CHANGE_AS_PERSISTENT"===o.type||n;if(r===i&&!l){var a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type;const e=null===(a=null==r?void 0:r.isPersistentChange)||void 0===a||a;return r.isPersistentChange===e?r:{...i,isPersistentChange:e}}return i={...i,isPersistentChange:l?!n:!Do(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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...Lo(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,H.omit)(t.updates,"attributes");return(0,H.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,H.omit)(e,t.replacedClientIds),...Lo(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,H.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...Po(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,r)=>({...n,[r]:(0,H.reduce)(t.uniqueByBlock?t.attributes[r]:t.attributes,((t,n,o)=>{var i,l;return n!==t[o]&&((t=(i=e[r])===(l=t)?{...i}:l)[o]=n),t}),e[r])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,H.omit)(e,t.replacedClientIds),...Po(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,H.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=No(t.blocks);return{...e,...(0,H.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,r=e[n]||[],o=No(t.blocks,n),{index:i=r.length}=t;return{...e,...o,[n]:So(r,o[n],i)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:r="",clientIds:o}=t,{index:i=e[r].length}=t;if(n===r){const t=e[r].indexOf(o[0]);return{...e,[r]:Io(e[r],t,i,o.length)}}return{...e,[n]:(0,H.without)(e[n],...o),[r]:So(e[r],o,i)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:r=""}=t,o=(0,H.first)(n),i=e[r];if(!i.length||o===(0,H.first)(i))return e;const l=i.indexOf(o);return{...e,[r]:Io(i,l,l-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:r=""}=t,o=(0,H.first)(n),i=(0,H.last)(n),l=e[r];if(!l.length||i===(0,H.last)(l))return e;const a=l.indexOf(o);return{...e,[r]:Io(l,a,a+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const r=No(t.blocks);return(0,H.flow)([e=>(0,H.omit)(e,t.replacedClientIds),e=>({...e,...(0,H.omit)(r,"")}),e=>(0,H.mapValues)(e,(e=>(0,H.reduce)(e,((e,t)=>t===n[0]?[...e,...r[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,H.flow)([e=>(0,H.omit)(e,t.removedClientIds),e=>(0,H.mapValues)(e,(e=>(0,H.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...Bo(t.blocks)};case"INSERT_BLOCKS":return{...e,...Bo(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,H.omit)(e,t.replacedClientIds),...Bo(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,H.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:r}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:r}:e},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});function Fo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var jo=W()({blocks:Oo,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,r;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;switch(i.type){case"SELECTION_CHANGE":return i.clientId?{selectionStart:{clientId:i.clientId,attributeKey:i.attributeKey,offset:i.startOffset},selectionEnd:{clientId:i.clientId,attributeKey:i.attributeKey,offset:i.endOffset}}:{selectionStart:i.start||o.selectionStart,selectionEnd:i.end||o.selectionEnd};case"RESET_SELECTION":const{selectionStart:l,selectionEnd:a}=i;return{selectionStart:l,selectionEnd:a};case"MULTI_SELECT":const{start:s,end:c}=i;return s===(null===(e=o.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=o.selectionEnd)||void 0===t?void 0:t.clientId)?o:{selectionStart:{clientId:s},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==o||null===(n=o.selectionStart)||void 0===n?void 0:n.clientId,d=null==o||null===(r=o.selectionEnd)||void 0===r?void 0:r.clientId;if(!u&&!d)return o;if(!i.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!i.blocks.some((e=>e.clientId===d)))return{...o,selectionEnd:o.selectionStart}}return{selectionStart:Fo(o.selectionStart,i),selectionEnd:Fo(o.selectionEnd,i)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,H.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,H.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,H.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:r}=t;return{rootClientId:e,index:n,__unstableWithInserter:r};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Eo,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Co,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:r,name:o}=n,i=(0,z.select)(Rt).getActiveBlockVariation(o,r);let l=null!=i&&i.name?`${o}/${i.name}`:o;const a={name:l};return"core/block"===o&&(a.ref=r.ref,l+="/"+r.ref),{...e,insertUsage:{...e.insertUsage,[l]:{time:t.time,count:e.insertUsage[l]?e.insertUsage[l].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,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 null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:r}=t;return r?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}}),Zo=n(12518),zo=n(33140),Ho=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),Vo=n(26478),Wo=n(41356);function Uo(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:r}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:r}}const $o=[];function Go(e,t){const n=e.blocks.byClientId[t],r="core/social-link";if("web"!==Zo.Z.OS&&(null==n?void 0:n.name)===r){const n=e.blocks.attributes[t],{service:o}=n;return o?`core/social-link-${o}`:r}return n?n.name:null}function qo(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function Ko(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function Yo(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const Jo=(0,Q.Z)(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:Ko(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function Xo(e,t){var n;const r=t&&zl(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[r])||void 0===n?void 0:n.innerBlocks)||$o}const Qo=(0,Q.Z)(((e,t)=>({clientId:t,innerBlocks:ei(e,t)})),(e=>[e.blocks.order])),ei=(0,Q.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,H.map)(Fi(e,t),(t=>Qo(e,t)))}),(e=>[e.blocks.order])),ti=(0,Q.Z)(((e,t)=>{const n=[];for(const r of t)for(const t of Fi(e,r))n.push(t,...ti(e,[t]));return n}),(e=>[e.blocks.order])),ni=(0,Q.Z)((e=>{const t=[];for(const n of Fi(e))t.push(n,...ti(e,[n]));return t}),(e=>[e.blocks.order])),ri=(0,Q.Z)(((e,t)=>{const n=ni(e);return t?(0,H.reduce)(n,((n,r)=>e.blocks.byClientId[r].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),oi=(0,Q.Z)(((e,t)=>{if(!t)return $o;const n=ni(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:$o}),(e=>[e.blocks.order,e.blocks.byClientId])),ii=(0,Q.Z)(((e,t)=>(0,H.map)((0,H.castArray)(t),(t=>Yo(e,t)))),((e,t)=>(0,H.map)((0,H.castArray)(t),(t=>e.blocks.tree[t]))));function li(e,t){return Fi(e,t).length}function ai(e){return e.selection.selectionStart}function si(e){return e.selection.selectionEnd}function ci(e){return e.selection.selectionStart.clientId}function ui(e){return e.selection.selectionEnd.clientId}function di(e){return Ei(e).length||(e.selection.selectionStart.clientId?1:0)}function pi(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function mi(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:r}=t;return r&&r===n.clientId?r:null}function hi(e){const t=mi(e);return t?Yo(e,t):null}function fi(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const gi=(0,Q.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];let o=t;for(;e.blocks.parents[o];)o=e.blocks.parents[o],r.push(o);return n?r:r.reverse()}),(e=>[e.blocks.parents])),vi=(0,Q.Z)((function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=gi(e,t,r);return(0,H.map)((0,H.filter)((0,H.map)(o,(t=>({id:t,name:Go(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function bi(e,t){let n,r=t;do{n=r,r=e.blocks.parents[r]}while(r);return n}function yi(e,t){const n=mi(e),r=[...gi(e,t),t],o=[...gi(e,n),n];let i;const l=Math.min(r.length,o.length);for(let e=0;e<l&&r[e]===o[e];e++)i=r[e];return i}function _i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=mi(e)),void 0===t&&(t=n<0?Ii(e):Ti(e)),!t)return null;const r=fi(e,t);if(null===r)return null;const{order:o}=e.blocks,i=o[r],l=i.indexOf(t),a=l+1*n;return a<0||a===i.length?null:i[a]}function ki(e,t){return _i(e,t,-1)}function wi(e,t){return _i(e,t,1)}function xi(e){return e.initialPosition}const Ci=(0,Q.Z)((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return $o;if(t.clientId===n.clientId)return[t.clientId];const r=fi(e,t.clientId);if(null===r)return $o;const o=Fi(e,r),i=o.indexOf(t.clientId),l=o.indexOf(n.clientId);return i>l?o.slice(l,i+1):o.slice(i,l+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ei(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?$o:Ci(e)}const Si=(0,Q.Z)((e=>{const t=Ei(e);return t.length?t.map((t=>Yo(e,t))):$o}),(e=>[...Ci.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ii(e){return(0,H.first)(Ei(e))||null}function Ti(e){return(0,H.last)(Ei(e))||null}function Ni(e,t){return Ii(e)===t}function Bi(e,t){return-1!==Ei(e).indexOf(t)}const Ai=(0,Q.Z)(((e,t)=>{let n=t,r=!1;for(;n&&!r;)n=fi(e,n),r=Bi(e,n);return r}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Li(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Pi(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Di(e){const t=ai(e),n=si(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ri(e){const t=ai(e),n=si(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Mi(e,t){const n=ai(e),r=si(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=fi(e,n.clientId);if(o!==fi(e,r.clientId))return!1;const i=Fi(e,o);let l,a;i.indexOf(n.clientId)>i.indexOf(r.clientId)?(l=r,a=n):(l=n,a=r);const s=t?a.clientId:l.clientId,c=t?l.clientId:a.clientId,u=Yo(e,s);if(!He(u.name).merge)return!1;const d=Yo(e,c);if(d.name===u.name)return!0;const p=lt(d,u.name);return p&&p.length}const Oi=e=>{const t=ai(e),n=si(e);if(t.clientId===n.clientId)return $o;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return $o;const r=fi(e,t.clientId);if(r!==fi(e,n.clientId))return $o;const o=Fi(e,r),i=o.indexOf(t.clientId),l=o.indexOf(n.clientId),[a,s]=i>l?[n,t]:[t,n],c=Yo(e,a.clientId),u=He(c.name),d=Yo(e,s.clientId),p=He(d.name),m=c.attributes[a.attributeKey],h=d.attributes[s.attributeKey],f=u.attributes[a.attributeKey],g=p.attributes[s.attributeKey];let v=(0,Vo.Ue)({html:m,...Uo(f)}),b=(0,Vo.Ue)({html:h,...Uo(g)});return v=(0,Vo.Od)(v,0,a.offset),b=(0,Vo.Od)(b,s.offset,b.text.length),[{...c,attributes:{...c.attributes,[a.attributeKey]:(0,Vo.Jz)({value:v,...Uo(f)})}},{...d,attributes:{...d.attributes,[s.attributeKey]:(0,Vo.Jz)({value:b,...Uo(g)})}}]};function Fi(e,t){return e.blocks.order[t||""]||$o}function ji(e,t){return Fi(e,fi(e,t)).indexOf(t)}function Zi(e,t){const{selectionStart:n,selectionEnd:r}=e.selection;return n.clientId===r.clientId&&n.clientId===t}function zi(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,H.some)(Fi(e,t),(t=>Zi(e,t)||Bi(e,t)||n&&zi(e,t,n)))}function Hi(e,t){if(!t)return!1;const n=Ei(e),r=n.indexOf(t);return r>-1&&r<n.length-1}function Vi(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Wi(e){return e.isMultiSelecting}function Ui(e){return e.isSelectionEnabled}function $i(e,t){return e.blocksMode[t]||"visual"}function Gi(e){return e.isTyping}function qi(e){return!!e.draggedBlocks.length}function Ki(e){return e.draggedBlocks}function Yi(e,t){return e.draggedBlocks.includes(t)}function Ji(e,t){if(!qi(e))return!1;const n=gi(e,t);return(0,H.some)(n,(t=>Yi(e,t)))}function Xi(){return(0,Wo.Z)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qi(e){let t,n;const{insertionPoint:r,selection:{selectionEnd:o}}=e;if(null!==r)return r;const{clientId:i}=o;return i?(t=fi(e,i)||void 0,n=ji(e,o.clientId)+1):n=Fi(e).length,{rootClientId:t,index:n}}function el(e){return null!==e.insertionPoint}function tl(e){return e.template.isValid}function nl(e){return e.settings.template}function rl(e,t){if(!t)return e.settings.templateLock;const n=Nl(e,t);return n?n.templateLock:null}const ol=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},il=function(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=He(t),!n)return!1;const{allowedBlockTypes:o}=Bl(e),i=ol(o,t,!0);if(!i)return!1;const l=!!rl(e,r);if(l)return!1;const a=Nl(e,r);if(r&&void 0===a)return!1;const s=null==a?void 0:a.allowedBlocks,c=ol(s,t),u=n.parent,d=Go(e,r),p=ol(u,d);let m=!0;const h=n.ancestor;if(h){const t=[r,...gi(e,r)];m=(0,H.some)(t,(t=>ol(h,Go(e,t))))}const f=m&&(null===c&&null===p||!0===c||!0===p);return f?(0,_e.O)("blockEditor.__unstableCanInsertBlockType",f,n,r,{getBlock:Yo.bind(null,e),getBlockParentsByBlockName:vi.bind(null,e)}):f},ll=(0,Q.Z)(il,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function al(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ll(e,Go(e,t),n)))}function sl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Ko(e,t);if(null===r)return!0;const{lock:o}=r,i=!!rl(e,n);return void 0===o||void 0===(null==o?void 0:o.remove)?!i:!(null!=o&&o.remove)}function cl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>sl(e,t,n)))}function ul(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Ko(e,t);if(null===r)return;const{lock:o}=r,i="all"===rl(e,n);return void 0===o||void 0===(null==o?void 0:o.move)?!i:!(null!=o&&o.move)}function dl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ul(e,t,n)))}function pl(e,t){const n=Ko(e,t);if(null===n)return!0;const{lock:r}=n;return!(null!=r&&r.edit)}function ml(e,t){var n;return!!Ue(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function hl(e,t){var n,r;return null!==(n=null===(r=e.preferences.insertUsage)||void 0===r?void 0:r[t])&&void 0!==n?n:null}const fl=(e,t,n)=>!!Ue(t,"inserter",!0)&&il(e,t.name,n),gl=(e,t)=>n=>{const r=`${t.id}/${n.name}`,{time:o,count:i=0}=hl(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:vl(o,i)}},vl=(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}},bl=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const r=t.name;let o=!1;Ue(t.name,"multiple",!0)||(o=(0,H.some)(ii(e,ni(e)),{name:t.name}));const{time:i,count:l=0}=hl(e,r)||{},a={id:r,name:t.name,title:t.title,icon:t.icon,isDisabled:o,frecency:vl(i,l)};if("transform"===n)return a;const s=Ge(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:s,example:t.example,utility:1}}},yl=(0,Q.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=bl(e,{buildScope:"inserter"}),r=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,o=t=>{let n=Ho;if("web"===Zo.Z.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(r);if(e){const[,,t="core/",r]=e,o=He(t+r);o&&(n=o.icon)}}const o=`core/block/${t.id}`,{time:i,count:l=0}=hl(e,o)||{},a=vl(i,l);return{id:o,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:a}},i=Ve().filter((n=>fl(e,n,t))).map(n),l=il(e,"core/block",t)?Ml(e).map(o):[],a=i.reduce(((t,n)=>{const{variations:r=[]}=n;if(r.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),r.length){const o=gl(e,n);t.push(...r.map(o))}return t}),[]),s=(e,t)=>{const{core:n,noncore:r}=e;return(t.name.startsWith("core/")?n:r).push(t),e},{core:c,noncore:u}=a.reduce(s,{core:[],noncore:[]}),d=[...c,...u];return[...d,...l]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Ml(e),Ve()])),_l=(0,Q.Z)((function(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=(0,H.castArray)(t),[i]=o,l=bl(e,{buildScope:"transform"}),a=Ve().filter((t=>fl(e,t,r))).map(l),s=(0,H.mapKeys)(a,(e=>{let{name:t}=e;return t}));s["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,w.__)("Unwrap"),icon:null===(n=s[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const c=nt(o).reduce(((e,t)=>("*"===t?e.push(s["*"]):s[null==t?void 0:t.name]&&e.push(s[t.name]),e)),[]);return(0,H.orderBy)(c,(e=>s[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Ve()])),kl=(0,Q.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,H.some)(Ve(),(n=>fl(e,n,t)));if(n)return!0;const r=il(e,"core/block",t)&&Ml(e).length>0;return r}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Ml(e),Ve()])),wl=(0,Q.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,H.filter)(Ve(),(n=>fl(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Ve()])),xl=(0,Q.Z)((function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!r)return;const o=null===(t=e.blockListSettings[r])||void 0===t?void 0:t.__experimentalDefaultBlock,i=null===(n=e.blockListSettings[r])||void 0===n?void 0:n.__experimentalDirectInsert;return o&&i?"function"==typeof i?i(Yo(e,r))?o:null:o:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),Cl=(0,Q.Z)(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:pr(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),El=(0,Q.Z)((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=Bl(e),r=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return Cl(e,n)})),o=r.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var r;const e=n.shift();if(!ol(t,e.name||e.blockName,!0))return!1;null===(r=e.innerBlocks)||void 0===r||r.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return o}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Sl=(0,Q.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=El(e),r=(0,H.filter)(n,(n=>{let{blocks:r}=n;return r.every((n=>{let{name:r}=n;return ll(e,r,t)}))}));return r}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),Il=(0,Q.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return $o;const r=Sl(e,n),o=Array.isArray(t)?t:[t];return r.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>o.includes(e)))}))}),((e,t)=>[...Sl.getDependants(e,t)])),Tl=(0,Q.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return $o;if(t.some((t=>{let{clientId:n,innerBlocks:r}=t;return r.length||zl(e,n)})))return $o;const r=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Il(e,r,n)}),((e,t)=>[...Il.getDependants(e,t)]));function Nl(e,t){return e.blockListSettings[t]}function Bl(e){return e.settings}function Al(e){return e.blocks.isPersistentChange}const Ll=(0,Q.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Pl=(0,Q.Z)(((e,t)=>{var n;const r=(0,H.find)(Ml(e),(e=>e.id===t));return r?null===(n=r.title)||void 0===n?void 0:n.raw:null}),(e=>[Ml(e)]));function Dl(e){return e.blocks.isIgnoredChange}function Rl(e){return e.lastBlockAttributesChange}function Ml(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:$o}function Ol(e){return e.isNavigationMode}function Fl(e){return e.hasBlockMovingClientId}function jl(e){return!!e.automaticChangeStatus}function Zl(e,t){return e.highlightedBlock===t}function zl(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Hl=(0,Q.Z)(((e,t)=>{if(!t.length)return null;const n=mi(e);if(t.includes(Go(e,n)))return n;const r=Ei(e),o=vi(e,n||r[0],t);return o?(0,H.last)(o):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Vl(e,t,n){const{lastBlockInserted:r}=e;return r.clientId===t&&r.source===n}function Wl(e,t){var n,r;return null===(n=null===(r=e.blocks.visibility)||void 0===r?void 0:r[t])||void 0===n||n}const Ul=(0,Q.Z)((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility]));var $l=n(45538);const Gl="†";function ql(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Gl)}))}const Kl=e=>Array.isArray(e)?e:[e],Yl=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Jl(e))},Jl=e=>t=>{let{select:n,dispatch:r}=t;const o=n.getTemplate(),i=n.getTemplateLock(),l=!o||"all"!==i||go(e,o);if(l!==n.isValidTemplate())return r.setTemplateValidity(l),l};function Xl(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ql(e){return(0,Wo.Z)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function ea(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Kl(e),attributes:t,uniqueByBlock:n}}function ta(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function na(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const ra=e=>t=>{let{select:n,dispatch:r}=t;const o=n.getPreviousBlockClientId(e);o&&r.selectBlock(o,-1)},oa=e=>t=>{let{select:n,dispatch:r}=t;const o=n.getNextBlockClientId(e);o&&r.selectBlock(o)};function ia(){return{type:"START_MULTI_SELECT"}}function la(){return{type:"STOP_MULTI_SELECT"}}const aa=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return r=>{let{select:o,dispatch:i}=r;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;i({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const l=o.getSelectedBlockCount();(0,$l.D)((0,w.sprintf)((0,w._n)("%s block selected.","%s blocks selected.",l),l),"assertive")}};function sa(){return{type:"CLEAR_SELECTED_BLOCK"}}function ca(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function ua(e,t){var n,r;const o=null!==(n=null==t||null===(r=t.__experimentalPreferredStyleVariations)||void 0===r?void 0:r.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!Ue(n,"defaultStylePicker",!0))return e;if(!o[n])return e;const r=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=r&&r.includes("is-style-"))return e;const{attributes:i={}}=e,l=o[n];return{...e,attributes:{...i,className:`${r||""} is-style-${l}`.trim()}}}))}const da=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0;return i=>{let{select:l,dispatch:a}=i;e=Kl(e),t=ua(Kl(t),l.getSettings());const s=l.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!l.canInsertBlockType(n.name,s))return}a({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:r,meta:o}),a((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:r}=t.getSettings();r||n.insertDefaultBlock()}))}};function pa(e,t){return da(e,t)}const ma=e=>(t,n)=>r=>{let{select:o,dispatch:i}=r;o.canMoveBlocks(t,n)&&i({type:e,clientIds:Kl(t),rootClientId:n})},ha=ma("MOVE_BLOCKS_DOWN"),fa=ma("MOVE_BLOCKS_UP"),ga=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0;return o=>{let{select:i,dispatch:l}=o;if(i.canMoveBlocks(e,t)){if(t!==n){if(!i.canRemoveBlocks(e,t))return;if(!i.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:r})}}};function va(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0;return ga([e],t,n,r)}function ba(e,t,n,r,o){return ya([e],t,n,r,0,o)}const ya=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5?arguments[5]:void 0;return l=>{let{select:a,dispatch:s}=l;null!==o&&"object"==typeof o&&(i=o,o=0,(0,Wo.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=ua(Kl(e),a.getSettings());const c=[];for(const t of e)a.canInsertBlockType(t.name,n)&&c.push(t);c.length&&s({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:r,initialPosition:r?o:null,meta:i})}};function _a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:r}}function ka(){return{type:"HIDE_INSERTION_POINT"}}function wa(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const xa=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const r=vo(t.getBlocks(),t.getTemplate());n.resetBlocks(r)},Ca=e=>t=>{let{registry:n,select:r,dispatch:o}=t;const i=r.getSelectionStart(),l=r.getSelectionEnd();if(i.clientId===l.clientId)return;if(!i.attributeKey||!l.attributeKey||void 0===i.offset||void 0===l.offset)return!1;const a=r.getBlockRootClientId(i.clientId);if(a!==r.getBlockRootClientId(l.clientId))return;const s=r.getBlockOrder(a);let c,u;s.indexOf(i.clientId)>s.indexOf(l.clientId)?(c=l,u=i):(c=i,u=l);const d=e?u:c,p=r.getBlock(d.clientId),m=He(p.name);if(!m.merge)return;const h=c,f=u,g=r.getBlock(h.clientId),v=He(g.name),b=r.getBlock(f.clientId),y=He(b.name),_=g.attributes[h.attributeKey],k=b.attributes[f.attributeKey],w=v.attributes[h.attributeKey],x=y.attributes[f.attributeKey];let C=(0,Vo.Ue)({html:_,...Uo(w)}),E=(0,Vo.Ue)({html:k,...Uo(x)});C=(0,Vo.Od)(C,h.offset,C.text.length),E=(0,Vo.$T)(E,Gl,0,f.offset);const S=Xe(g,{[h.attributeKey]:(0,Vo.Jz)({value:C,...Uo(w)})}),I=Xe(b,{[f.attributeKey]:(0,Vo.Jz)({value:E,...Uo(x)})}),T=e?S:I,N=g.name===b.name?[T]:lt(T,m.name);if(!N||!N.length)return;let B;if(e){const e=N.pop();B=m.merge(e.attributes,I.attributes)}else{const e=N.shift();B=m.merge(S.attributes,e.attributes)}const A=ql(B),L=B[A],P=(0,Vo.Ue)({html:L,...Uo(m.attributes[A])}),D=P.text.indexOf(Gl),R=(0,Vo.Od)(P,D,D+1),M=(0,Vo.Jz)({value:R,...Uo(m.attributes[A])});B[A]=M;const O=r.getSelectedBlockClientIds(),F=[...e?N:[],{...p,attributes:{...p.attributes,...B}},...e?[]:N];n.batch((()=>{o.selectionChange(p.clientId,A,D,D),o.replaceBlocks(O,F,0,r.getSelectedBlocksInitialCaretPosition())}))},Ea=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getSelectionStart(),o=t.getSelectionEnd();if(r.clientId===o.clientId)return;if(!r.attributeKey||!o.attributeKey||void 0===r.offset||void 0===o.offset)return;const i=t.getBlockRootClientId(r.clientId);if(i!==t.getBlockRootClientId(o.clientId))return;const l=t.getBlockOrder(i);let a,s;l.indexOf(r.clientId)>l.indexOf(o.clientId)?(a=o,s=r):(a=r,s=o);const c=a,u=s,d=t.getBlock(c.clientId),p=He(d.name),m=t.getBlock(u.clientId),h=He(m.name),f=d.attributes[c.attributeKey],g=m.attributes[u.attributeKey],v=p.attributes[c.attributeKey],b=h.attributes[u.attributeKey];let y=(0,Vo.Ue)({html:f,...Uo(v)}),_=(0,Vo.Ue)({html:g,...Uo(b)});y=(0,Vo.Od)(y,c.offset,y.text.length),_=(0,Vo.Od)(_,0,u.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...d,attributes:{...d.attributes,[c.attributeKey]:(0,Vo.Jz)({value:y,...Uo(v)})}},Ke(ze()),{...m,attributes:{...m.attributes,[u.attributeKey]:(0,Vo.Jz)({value:_,...Uo(b)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Sa=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getSelectionStart(),o=t.getSelectionEnd();n.selectionChange({start:{clientId:r.clientId},end:{clientId:o.clientId}})},Ia=(e,t)=>n=>{let{select:r,dispatch:o}=n;const i=[e,t];o({type:"MERGE_BLOCKS",blocks:i});const[l,a]=i,s=r.getBlock(l),c=He(s.name);if(c&&!c.merge)return void o.selectBlock(s.clientId);const u=r.getBlock(a),d=He(u.name),{clientId:p,attributeKey:m,offset:h}=r.getSelectionStart(),f=(p===l?c:d).attributes[m],g=(p===l||p===a)&&void 0!==m&&void 0!==h&&!!f;f||("number"==typeof m?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 m):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const v=Xe(s),b=Xe(u);if(g){const e=p===l?v:b,t=e.attributes[m],n=(0,Vo.$T)((0,Vo.Ue)({html:t,...Uo(f)}),Gl,h,h);e.attributes[m]=(0,Vo.Jz)({value:n,...Uo(f)})}const y=s.name===u.name?[b]:lt(b,s.name);if(!y||!y.length)return;const _=c.merge(v.attributes,y[0].attributes);if(g){const e=ql(_),t=_[e],n=(0,Vo.Ue)({html:t,...Uo(c.attributes[e])}),r=n.text.indexOf(Gl),i=(0,Vo.Od)(n,r,r+1),l=(0,Vo.Jz)({value:i,...Uo(c.attributes[e])});_[e]=l,o.selectionChange(s.clientId,e,r,r)}o.replaceBlocks([s.clientId,u.clientId],[{...s,attributes:{...s.attributes,..._}},...y.slice(1)],0)},Ta=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:r,dispatch:o}=n;if(!e||!e.length)return;e=Kl(e);const i=r.getBlockRootClientId(e[0]);r.canRemoveBlocks(e,i)&&(t&&o.selectPreviousBlock(e[0]),o({type:"REMOVE_BLOCKS",clientIds:e}),o((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:r}=t.getSettings();r||n.insertDefaultBlock()})))}};function Na(e,t){return Ta([e],t)}function Ba(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?r:null,time:Date.now()}}function Aa(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function La(){return{type:"START_TYPING"}}function Pa(){return{type:"STOP_TYPING"}}function Da(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Ra(){return{type:"STOP_DRAGGING_BLOCKS"}}function Ma(){return(0,Wo.Z)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Oa(){return(0,Wo.Z)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Fa(e,t,n,r){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:r}:{type:"SELECTION_CHANGE",...e}}const ja=(e,t,n)=>r=>{let{dispatch:o}=r;const i=ze();if(!i)return;const l=Ke(i,e);return o.insertBlock(l,n,t)};function Za(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function za(e){return{type:"UPDATE_SETTINGS",settings:e}}function Ha(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Va(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Wa(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Ua=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},$a=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,$l.D)((0,w.__)("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.")):(0,$l.D)((0,w.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Ga=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,$l.D)((0,w.__)("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."))}},qa=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:r,dispatch:o}=n;if(!e||!e.length)return;const i=r.getBlocksByClientId(e);if(i.some((e=>!e)))return;const l=i.map((e=>e.name));if(l.some((e=>!Ue(e,"multiple",!0))))return;const a=r.getBlockRootClientId(e[0]),s=Kl(e),c=r.getBlockIndex(s[s.length-1]),u=i.map((e=>Je(e)));return o.insertBlocks(u,c+1,a,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},Ka=e=>t=>{let{select:n,dispatch:r}=t;if(!e)return;const o=n.getBlockRootClientId(e);if(n.getTemplateLock(o))return;const i=n.getBlockIndex(e);return r.insertDefaultBlock({},o,i)},Ya=e=>t=>{let{select:n,dispatch:r}=t;if(!e)return;const o=n.getBlockRootClientId(e);if(n.getTemplateLock(o))return;const i=n.getBlockIndex(e);return r.insertDefaultBlock({},o,i+1)};function Ja(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Xa=e=>async t=>{let{dispatch:n}=t;n(Ja(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Ja(e,!1))};function Qa(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function es(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}const ts="core/block-editor",ns={reducer:jo,selectors:i,actions:l},rs=(0,Z.Z)(ts,{...ns,persist:["preferences"]});(0,z.registerStore)(ts,{...ns,persist:["preferences"]});const os={name:"",isSelected:!1},is=(0,u.createContext)(os),{Provider:ls}=is;function as(){return(0,u.useContext)(is)}function ss(){const{isSelected:e,clientId:t,name:n}=as();return(0,b.Z)((r=>{if(e)return!0;const{getBlockName:o,isFirstMultiSelectedBlock:i,getMultiSelectedBlockClientIds:l}=r(rs);return!!i(t)&&l().every((e=>o(e)===n))}),[t,e,n])}function cs(e){let{group:t="default",controls:n,children:r,__experimentalShareWithChildBlocks:o=!1}=e;const i=function(e,t){const n=ss(),{clientId:r}=as(),o=(0,b.Z)((e=>{const{getBlockName:n,hasSelectedInnerBlock:o}=e(rs),{hasBlockSupport:i}=e(Rt);return t&&i(n(r),"__experimentalExposeControlsToChildren",!1)&&o(r)}),[t,r]);var i;return n?null===(i=xo[e])||void 0===i?void 0:i.Fill:o?xo.parent.Fill:null}(t,o);return i?(0,u.createElement)(_o.Z,{document:document},(0,u.createElement)(i,null,(e=>{const o=(0,H.isEmpty)(e)?null:e;return(0,u.createElement)(ko.Z.Provider,{value:o},"default"===t&&(0,u.createElement)(wo.Z,{controls:n}),r)}))):null}var us=n(15768);function ds(e){let{group:t="default",...n}=e;const r=(0,u.useContext)(ko.Z),o=xo[t].Slot,i=(0,us.Z)(o.__unstableName);return Boolean(i.fills&&i.fills.length)?"default"===t?(0,u.createElement)(o,(0,bo.Z)({},n,{bubblesVirtually:!0,fillProps:r})):(0,u.createElement)(wo.Z,null,(0,u.createElement)(o,(0,bo.Z)({},n,{bubblesVirtually:!0,fillProps:r}))):null}const ps=cs;ps.Slot=ds;const ms=e=>(0,u.createElement)(cs,(0,bo.Z)({group:"inline"},e));ms.Slot=e=>(0,u.createElement)(ds,(0,bo.Z)({group:"inline"},e));var hs=ps,fs=n(51160),gs=n(53703),vs=n(73435),bs=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),ys=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),_s=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),ks=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),ws=n(43624),xs=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"})),Cs=n(9090),Es=n(6258),Ss=n(52278),Is=n(58897);function Ts(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Ns(e,t,n,r){var o,i;let l="";return null!=t&&null!==(o=t[n])&&void 0!==o&&null!==(i=o.spacingStyles)&&void 0!==i&&i.length&&r&&t[n].spacingStyles.forEach((t=>{l+=`${Ts(e,t.selector.trim())} { `,l+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||r}`})).join("; "),l+="; }"})),l}var Bs=n(47869),As=n(53321),Ls=n(71608),Ps=n(39917);const Ds=(0,u.createContext)({refs:new Map,callbacks:new Map});function Rs(e){let{children:t}=e;const n=(0,u.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,u.createElement)(Ds.Provider,{value:n},t)}function Ms(e){const{refs:t,callbacks:n}=(0,u.useContext)(Ds),r=(0,u.useRef)();return(0,u.useLayoutEffect)((()=>(t.set(r,e),()=>{t.delete(r)})),[e]),(0,Ps.Z)((t=>{r.current=t,n.forEach(((n,r)=>{e===n&&r(t)}))}),[e])}function Os(e){const{refs:t}=(0,u.useContext)(Ds),n=(0,u.useRef)();return n.current=e,(0,u.useMemo)((()=>({get current(){let e=null;for(const[r,o]of t.entries())o===n.current&&r.current&&(e=r.current);return e}})),[])}function Fs(e){const{callbacks:t}=(0,u.useContext)(Ds),n=Os(e),[r,o]=(0,u.useState)(null);return(0,u.useLayoutEffect)((()=>{if(e)return t.set(o,e),()=>{t.delete(o)}}),[e]),n.current||r}const js=["color","border","typography","spacing"],Zs={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0: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=>void 0===e.fontSizes?void 0: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},zs={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function Hs(e){const{name:t,clientId:n}=as();return(0,b.Z)((r=>{if(js.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let o;const i=(e=>zs[e]||e)(e);[...r(rs).getBlockParents(n),n].forEach((e=>{if(Ue(r(rs).getBlockName(e),"__experimentalSettings",!1)){var n;const l=r(rs).getBlockAttributes(e),a=null!==(n=(0,H.get)(l,`settings.blocks.${t}.${i}`))&&void 0!==n?n:(0,H.get)(l,`settings.${i}`);void 0!==a&&(o=a)}}));const l=r(rs).getSettings();if(void 0===o){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;o=null!==(a=(0,H.get)(l,n))&&void 0!==a?a:(0,H.get)(l,e)}var s,c;if(void 0!==o)return Le[i]?null!==(s=null!==(c=o.custom)&&void 0!==c?c:o.theme)&&void 0!==s?s:o.default:o;const u=Zs[i]?Zs[i](l):void 0;return void 0!==u?u:"typography.dropCap"===i||void 0}),[t,n,e])}var Vs=n(29334),Ws=n(66889),Us={default:(0,_.up)("InspectorControls"),advanced:(0,_.up)("InspectorAdvancedControls"),border:(0,_.up)("InspectorControlsBorder"),color:(0,_.up)("InspectorControlsColor"),dimensions:(0,_.up)("InspectorControlsDimensions"),typography:(0,_.up)("InspectorControlsTypography")},$s=n(44675);function Gs(e){var t;let{__experimentalGroup:n="default",children:r}=e;const o=ss(),i=null===(t=Us[n])||void 0===t?void 0:t.Fill;return i?o?(0,u.createElement)(_o.Z,{document:document},(0,u.createElement)(i,null,(e=>{const t=(0,H.isEmpty)(e)?null:e;return(0,u.createElement)(Ws.h.Provider,{value:t},r)}))):null:(void 0!==$s&&$s.env,null)}var qs=n(72660);const Ks=e=>e,Ys=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,H.pickBy)((0,H.mapValues)(e,Ys),Ks);return(0,H.isEmpty)(t)?void 0:t};function Js(e,t,n){return(0,H.setWith)(e?(0,H.clone)(e):{},t,n,H.clone)}function Xs(e,t,n,r,o,i){var l;if((0,H.every)(e,(e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===r.length)return n;let a=null===(l=r[0])||void 0===l?void 0:l.attributes;if(i.length>1&&r.length>1){if(!r[o])return n;var s;a=null===(s=r[o])||void 0===s?void 0:s.attributes}let c=n;return(0,H.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,H.get)(a,e);t&&(c={...c,attributes:Js(c.attributes,e,t)})}))})),c}function Qs(e,t,n){const r=We(e,t),o=null==r?void 0:r.__experimentalSkipSerialization;return Array.isArray(o)?o.includes(n):o}function ec(e){let{children:t,group:n,label:r}=e;const{updateBlockAttributes:o}=(0,y.Z)(rs),{getBlockAttributes:i,getMultiSelectedBlockClientIds:l,getSelectedBlockClientId:a,hasMultiSelection:s}=(0,b.Z)(rs),c=a(),d=(0,u.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=s()?l():[c];n.forEach((n=>{const{style:r}=i(n);let o={style:r};e.forEach((e=>{o={...o,...e(o)}})),o={...o,style:Ys(o.style)},t[n]=o})),o(n,t,!0)}),[Ys,i,l,s,c,o]);return(0,u.createElement)(qs.Z,{className:`${n}-block-support-panel`,label:r,resetAll:d,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function tc(e){let{Slot:t,...n}=e;const r=(0,u.useContext)(Ws.h);return(0,u.createElement)(t,(0,bo.Z)({},n,{fillProps:r,bubblesVirtually:!0}))}var nc=n(44675);function rc(e){var t;let{__experimentalGroup:n="default",label:r,...o}=e;const i=null===(t=Us[n])||void 0===t?void 0:t.Slot,l=(0,us.Z)(null==i?void 0:i.__unstableName);return i&&l?Boolean(l.fills&&l.fills.length)?r?(0,u.createElement)(ec,{group:n,label:r},(0,u.createElement)(tc,(0,bo.Z)({},o,{Slot:i}))):(0,u.createElement)(i,(0,bo.Z)({},o,{bubblesVirtually:!0})):null:(void 0!==nc&&nc.env,null)}const oc=Gs;oc.Slot=rc;const ic=e=>(0,u.createElement)(Gs,(0,bo.Z)({},e,{__experimentalGroup:"advanced"}));ic.Slot=e=>(0,u.createElement)(rc,(0,bo.Z)({},e,{__experimentalGroup:"advanced"})),ic.slotName="InspectorAdvancedControls";var lc=oc,ac=function(e){return(0,Ps.Z)((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])};function sc(e){let{clientId:t,bottomClientId:n,children:r,__unstableRefreshSize:o,__unstableCoverTarget:i=!1,__unstablePopoverSlot:l,__unstableContentRef:a,...s}=e;const c=Fs(t),d=Fs(null!=n?n:t),p=ac(a),m=(0,u.useMemo)((()=>c&&d===c?{position:"absolute",width:c.offsetWidth,height:c.offsetHeight}:{}),[c,d,o]);if(!c||n&&!d)return null;const h={top:c,bottom:d};return(0,u.createElement)(k.Z,(0,bo.Z)({ref:p,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:h,__unstableSlotName:l||null,__unstableObserveElement:c,__unstableForcePosition:!0,__unstableShift:!0},s,{className:g()("block-editor-block-popover",s.className)}),i&&(0,u.createElement)("div",{style:m},r),!i&&r)}function cc(e){const t=We(e,vc);return!!(!0===t||null!=t&&t.margin)}function uc(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Hs("spacing.margin"),n=!xc(e,"margin");return!cc(e)||t||n}function dc(e){var t;const{name:n,attributes:{style:r},setAttributes:o}=e,i=(0,Bs.nj)({availableUnits:Hs("spacing.units")||["%","px","em","rem","vw"]}),l=wc(n,"margin"),a=l&&l.some((e=>yc.includes(e)));return uc(e)?null:Zo.Z.select({web:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(As.Z,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};o({style:Ys(t)})},label:(0,w.__)("Margin"),sides:l,units:i,allowReset:!1,splitOnAxis:a})),native:null})}function pc(e){var t,n;let{clientId:r,attributes:o}=e;const i=null==o||null===(t=o.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,l=(0,u.useMemo)((()=>{var e,t,n,r;return{borderTopWidth:null!==(e=null==i?void 0:i.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==i?void 0:i.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==i?void 0:i.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(r=null==i?void 0:i.left)&&void 0!==r?r:0,top:null!=i&&i.top?`-${i.top}`:0,right:null!=i&&i.right?`-${i.right}`:0,bottom:null!=i&&i.bottom?`-${i.bottom}`:0,left:null!=i&&i.left?`-${i.left}`:0}}),[i]),[a,s]=(0,u.useState)(!1),c=(0,u.useRef)(i),d=(0,u.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,u.useEffect)((()=>((0,Jt.ZP)(i,c.current)||(s(!0),c.current=i,p(),d.current=setTimeout((()=>{s(!1)}),400)),()=>p())),[i]),a?(0,u.createElement)(sc,{clientId:r,__unstableCoverTarget:!0,__unstableRefreshSize:i},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:l})):null}function mc(e){const t=We(e,vc);return!!(!0===t||null!=t&&t.padding)}function hc(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Hs("spacing.padding"),n=!xc(e,"padding");return!mc(e)||t||n}function fc(e){var t;const{name:n,attributes:{style:r},setAttributes:o}=e,i=(0,Bs.nj)({availableUnits:Hs("spacing.units")||["%","px","em","rem","vw"]}),l=wc(n,"padding"),a=l&&l.some((e=>yc.includes(e)));return hc(e)?null:Zo.Z.select({web:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(As.Z,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};o({style:Ys(t)})},label:(0,w.__)("Padding"),sides:l,units:i,allowReset:!1,splitOnAxis:a})),native:null})}function gc(e){var t,n;let{clientId:r,attributes:o}=e;const i=null==o||null===(t=o.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,l=(0,u.useMemo)((()=>{var e,t,n,r;return{borderTopWidth:null!==(e=null==i?void 0:i.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==i?void 0:i.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==i?void 0:i.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(r=null==i?void 0:i.left)&&void 0!==r?r:0}}),[i]),[a,s]=(0,u.useState)(!1),c=(0,u.useRef)(i),d=(0,u.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,u.useEffect)((()=>((0,Jt.ZP)(i,c.current)||(s(!0),c.current=i,p(),d.current=setTimeout((()=>{s(!1)}),400)),()=>p())),[i]),a?(0,u.createElement)(sc,{clientId:r,__unstableCoverTarget:!0,__unstableRefreshSize:i},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:l})):null}const vc="spacing",bc=["top","right","bottom","left"],yc=["vertical","horizontal"];function _c(e){const t=Sc(e),n=hc(e),r=uc(e),o=kc(e),i=(l=e.name,"web"===Zo.Z.OS&&(Cc(l)||mc(l)||cc(l)));var l;if(o||!i)return null;const a=We(e.name,[vc,"__experimentalDefaultControls"]),s=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(lc,{__experimentalGroup:"dimensions"},!n&&(0,u.createElement)(Vs.Z,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,w.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:Ys({...r,spacing:{...null==r?void 0:r.spacing,padding:void 0}})})}(e),resetAllFilter:s("padding"),isShownByDefault:null==a?void 0:a.padding,panelId:e.clientId},(0,u.createElement)(fc,e)),!r&&(0,u.createElement)(Vs.Z,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,w.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:Ys({...r,spacing:{...null==r?void 0:r.spacing,margin:void 0}})})}(e),resetAllFilter:s("margin"),isShownByDefault:null==a?void 0:a.margin,panelId:e.clientId},(0,u.createElement)(dc,e)),!t&&(0,u.createElement)(Vs.Z,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,w.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:{...r,spacing:{...null==r?void 0:r.spacing,blockGap:void 0}}})}(e),resetAllFilter:s("blockGap"),isShownByDefault:null==a?void 0:a.blockGap,panelId:e.clientId},(0,u.createElement)(Ic,e))),!n&&(0,u.createElement)(gc,e),!r&&(0,u.createElement)(pc,e))}const kc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Sc(e),n=hc(e),r=uc(e);return t&&n&&r};function wc(e,t){var n;const r=We(e,vc);if(r&&"boolean"!=typeof r[t])return Array.isArray(r[t])?r[t]:null!==(n=r[t])&&void 0!==n&&n.sides?r[t].sides:void 0}function xc(e,t){const n=wc(e,t);return!(n&&n.some((e=>bc.includes(e)))&&n.some((e=>yc.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function Cc(e){const t=We(e,vc);return!!(!0===t||null!=t&&t.blockGap)}function Ec(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Sc(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Hs("spacing.blockGap");return!Cc(e)||t}function Ic(e){var t;const{clientId:n,attributes:{style:r},name:o,setAttributes:i}=e,l=(0,Bs.nj)({availableUnits:Hs("spacing.units")||["%","px","em","rem","vw"]}),a=wc(o,"blockGap"),s=Os(n);if(Sc(e))return null;const c=a&&a.some((e=>yc.includes(e))),d=e=>{var t;let n=e;e&&c&&(n={...Ec(e)});const o={...r,spacing:{...null==r?void 0:r.spacing,blockGap:n}};i({style:Ys(o)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var a;s.current&&l&&(null===(a=s.current.parentNode)||void 0===a||a.replaceChild(s.current,s.current))},p=Ec(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),m=c?{...p,right:null==p?void 0:p.left,bottom:null==p?void 0:p.top}:null==p?void 0:p.top;return Zo.Z.select({web:(0,u.createElement)(u.Fragment,null,c?(0,u.createElement)(As.Z,{label:(0,w.__)("Block spacing"),min:0,onChange:d,units:l,sides:a,values:m,allowReset:!1,splitOnAxis:c}):(0,u.createElement)(Ls.ZP,{label:(0,w.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:l,value:m})),native:null})}const Tc=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Nc=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Bc={top:{icon:(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,w._x)("Align top","Block vertical alignment setting")},center:{icon:Nc,title:(0,w._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Tc,title:(0,w._x)("Align bottom","Block vertical alignment setting")}},Ac=["top","center","bottom"],Lc={isAlternate:!0};var Pc=function(e){let{value:t,onChange:n,controls:r=Ac,isCollapsed:o=!0,isToolbar:i}=e;const l=Bc[t],a=Bc.top,s=i?wo.Z:fs.Z,c=i?{isCollapsed:o}:{};return(0,u.createElement)(s,(0,bo.Z)({popoverProps:Lc,icon:l?l.icon:a.icon,label:(0,w._x)("Change vertical alignment","Block vertical alignment setting label"),controls:r.map((e=>{return{...Bc[e],isActive:t===e,role:o?"menuitemradio":void 0,onClick:(r=e,()=>n(t===r?void 0:r))};var r}))},c))};const Dc=e=>(0,u.createElement)(Pc,(0,bo.Z)({},e,{isToolbar:!1})),Rc=e=>(0,u.createElement)(Pc,(0,bo.Z)({},e,{isToolbar:!0})),Mc={left:bs,center:ys,right:_s,"space-between":ks};var Oc=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:r,value:o,popoverProps:i,isToolbar:l}=e;const a=e=>{r(e===o?void 0:e)},s=o?Mc[o]:Mc.left,c=[{name:"left",icon:bs,title:(0,w.__)("Justify items left"),isActive:"left"===o,onClick:()=>a("left")},{name:"center",icon:ys,title:(0,w.__)("Justify items center"),isActive:"center"===o,onClick:()=>a("center")},{name:"right",icon:_s,title:(0,w.__)("Justify items right"),isActive:"right"===o,onClick:()=>a("right")},{name:"space-between",icon:ks,title:(0,w.__)("Space between items"),isActive:"space-between"===o,onClick:()=>a("space-between")}],d=l?wo.Z:fs.Z,p=l?{isCollapsed:n}:{};return(0,u.createElement)(d,(0,bo.Z)({icon:s,popoverProps:i,label:(0,w.__)("Change items justification"),controls:c.filter((e=>t.includes(e.name)))},p))};const Fc=e=>(0,u.createElement)(Oc,(0,bo.Z)({},e,{isToolbar:!1})),jc={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Zc={left:"flex-start",right:"flex-end",center:"center"},zc={top:"flex-start",center:"center",bottom:"flex-end"},Hc=["wrap","nowrap"];var Vc={name:"flex",label:(0,w.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:r={}}=e;const{allowOrientation:o=!0}=r;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Cs.Z,null,(0,u.createElement)(Es.Z,null,(0,u.createElement)(Uc,{layout:t,onChange:n})),(0,u.createElement)(Es.Z,null,o&&(0,u.createElement)(Gc,{layout:t,onChange:n}))),(0,u.createElement)($c,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:r}=e;if(null!=r&&r.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=r;return(0,u.createElement)(hs,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Uc,{layout:t,onChange:n,isToolbar:!0}),o&&"vertical"!==(null==t?void 0:t.orientation)&&(0,u.createElement)(Wc,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:r,layout:o,style:i,blockName:l,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{orientation:c="horizontal"}=o,u=null!=i&&null!==(t=i.spacing)&&void 0!==t&&t.blockGap&&!Qs(l,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=Ec(e);if(!n)return null;const r=(null==n?void 0:n.top)||t,o=(null==n?void 0:n.left)||t;return r===o?r:`${r} ${o}`}(null==i||null===(n=i.spacing)||void 0===n?void 0:n.blockGap):void 0,d=jc[o.justifyContent],p=Hc.includes(o.flexWrap)?o.flexWrap:"wrap",m=zc[o.verticalAlignment],h=Zc[o.justifyContent]||Zc.left;let f="";const g=[];return p&&"wrap"!==p&&g.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&g.push(`align-items: ${m}`),d&&g.push(`justify-content: ${d}`)):(g.push("flex-direction: column"),g.push(`align-items: ${h}`)),g.length&&(f=`${Ts(r)} {\n\t\t\t\t${g.join("; ")};\n\t\t\t}`),a&&u&&(f+=Ns(r,s,"flex",u)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Wc(e){let{layout:t,onChange:n,isToolbar:r=!1}=e;const{verticalAlignment:o=zc.center}=t,i=e=>{n({...t,verticalAlignment:e})};if(r)return(0,u.createElement)(Dc,{onChange:i,value:o});const l=[{value:"flex-start",label:(0,w.__)("Align items top")},{value:"center",label:(0,w.__)("Align items center")},{value:"flex-end",label:(0,w.__)("Align items bottom")}];return(0,u.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,u.createElement)("legend",null,(0,w.__)("Vertical alignment")),(0,u.createElement)("div",null,l.map(((e,t,n)=>(0,u.createElement)(Ss.Z,{key:e,label:n,icon:t,isPressed:o===e,onClick:()=>i(e)})))))}function Uc(e){let{layout:t,onChange:n,isToolbar:r=!1}=e;const{justifyContent:o="left",orientation:i="horizontal"}=t,l=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===i&&a.push("space-between"),r)return(0,u.createElement)(Fc,{allowedControls:a,value:o,onChange:l,popoverProps:{position:"bottom right",isAlternate:!0}});const s=[{value:"left",icon:bs,label:(0,w.__)("Justify items left")},{value:"center",icon:ys,label:(0,w.__)("Justify items center")},{value:"right",icon:_s,label:(0,w.__)("Justify items right")}];return"horizontal"===i&&s.push({value:"space-between",icon:ks,label:(0,w.__)("Space between items")}),(0,u.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,u.createElement)("legend",null,(0,w.__)("Justification")),(0,u.createElement)("div",null,s.map((e=>{let{value:t,icon:n,label:r}=e;return(0,u.createElement)(Ss.Z,{key:t,label:r,icon:n,isPressed:o===t,onClick:()=>l(t)})}))))}function $c(e){let{layout:t,onChange:n}=e;const{flexWrap:r="wrap"}=t;return(0,u.createElement)(Is.Z,{label:(0,w.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===r})}function Gc(e){let{layout:t,onChange:n}=e;const{orientation:r="horizontal"}=t;return(0,u.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,u.createElement)("legend",null,(0,w.__)("Orientation")),(0,u.createElement)(Ss.Z,{label:(0,w.__)("Horizontal"),icon:ws.Z,isPressed:"horizontal"===r,onClick:()=>n({...t,orientation:"horizontal"})}),(0,u.createElement)(Ss.Z,{label:(0,w.__)("Vertical"),icon:xs,isPressed:"vertical"===r,onClick:()=>n({...t,orientation:"vertical"})}))}var qc=n(47842),Kc=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Yc=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const Jc="var:";function Xc(e,t,n,r){const o=(0,H.get)(e,n);return o?[{selector:null==t?void 0:t.selector,key:r,value:eu(o)}]:[]}function Qc(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const i=(0,H.get)(e,n);if(!i)return[];const l=[];if("string"==typeof i)l.push({selector:null==t?void 0:t.selector,key:r.default,value:i});else{const e=o.reduce(((e,n)=>{const o=eu((0,H.get)(i,[n]));return o&&e.push({selector:null==t?void 0:t.selector,key:null==r?void 0:r.individual.replace("%s",tu(n)),value:o}),e}),[]);l.push(...e)}return l}function eu(e){return"string"==typeof e&&e.startsWith(Jc)?`var(--wp--${e.slice(Jc.length).split("|").join("--")})`:e}function tu(e){let[t,...n]=e;return t.toUpperCase()+n.join("")}const nu={name:"color",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","color"],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderColor";return Xc(e,t,n,r)}},ru={name:"radius",generate:(e,t)=>Qc(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},ou={name:"style",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","style"],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderStyle";return Xc(e,t,n,r)}},iu={name:"width",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","width"],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderWidth";return Xc(e,t,n,r)}},lu=[nu,ou,iu],au=e=>(t,n)=>{var r;const o=null==t||null===(r=t.border)||void 0===r?void 0:r[e];return o?lu.reduce(((r,i)=>{const l=i.name;if(o.hasOwnProperty(l)&&"function"==typeof i.generate){const o=`border${tu(e)}${tu(l)}`;r.push(...i.generate(t,n,["border",e,l],o))}return r}),[]):[]},su={name:"borderTop",generate:au("top")},cu={name:"borderRight",generate:au("right")},uu={name:"borderBottom",generate:au("bottom")},du={name:"borderLeft",generate:au("left")},pu={name:"background",generate:(e,t)=>Xc(e,t,["color","background"],"backgroundColor")},mu={name:"gradient",generate:(e,t)=>Xc(e,t,["color","gradient"],"background")},hu={name:"text",generate:(e,t)=>Xc(e,t,["color","text"],"color")},fu={name:"padding",generate:(e,t)=>Qc(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},gu={name:"margin",generate:(e,t)=>Qc(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},vu={name:"fontSize",generate:(e,t)=>Xc(e,t,["typography","fontSize"],"fontSize")},bu={name:"fontStyle",generate:(e,t)=>Xc(e,t,["typography","fontStyle"],"fontStyle")},yu={name:"fontWeight",generate:(e,t)=>Xc(e,t,["typography","fontWeight"],"fontWeight")},_u={name:"letterSpacing",generate:(e,t)=>Xc(e,t,["typography","letterSpacing"],"letterSpacing")},ku={name:"letterSpacing",generate:(e,t)=>Xc(e,t,["typography","lineHeight"],"lineHeight")},wu={name:"textDecoration",generate:(e,t)=>Xc(e,t,["typography","textDecoration"],"textDecoration")},xu={name:"textTransform",generate:(e,t)=>Xc(e,t,["typography","textTransform"],"textTransform")},Cu=[...lu,ru,su,cu,uu,du,hu,mu,pu,gu,fu,vu,bu,yu,_u,ku,wu,xu];function Eu(e,t){const n=Su(e,t);if(null==t||!t.selector){const e=[];return n.forEach((t=>{e.push(`${(0,H.kebabCase)(t.key)}: ${t.value};`)})),e.join(" ")}const r=(0,H.groupBy)(n,"selector");return Object.keys(r).reduce(((e,t)=>(e.push(`${t} { ${r[t].map((e=>`${(0,H.kebabCase)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Su(e,t){const n=[];return Cu.forEach((r=>{"function"==typeof r.generate&&n.push(...r.generate(e,t))})),n}var Iu={name:"default",label:(0,w.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:r,contentSize:o}=t,i=(0,Bs.nj)({availableUnits:Hs("spacing.units")||["%","px","em","rem","vw"]});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(Ls.ZP,{label:(0,w.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:i}),(0,u.createElement)(qc.Z,{icon:Kc})),(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(Ls.ZP,{label:(0,w.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:i}),(0,u.createElement)(qc.Z,{icon:Yc}))),(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,u.createElement)(Ss.Z,{variant:"secondary",isSmall:!0,disabled:!o&&!r,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,w.__)("Reset"))),(0,u.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,w.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:r,layout:o={},style:i,blockName:l,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{contentSize:c,wideSize:u}=o,d=Ec(null==i||null===(t=i.spacing)||void 0===t?void 0:t.blockGap),p=null!=d&&d.top&&!Qs(l,"spacing","blockGap")?null==d?void 0:d.top:"";let m=c||u?`\n\t\t\t\t\t${Ts(r,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${Ts(r,"> .alignwide")}  {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${Ts(r,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return null!=i&&null!==(n=i.spacing)&&void 0!==n&&n.padding&&Su(i).forEach((e=>{"paddingRight"===e.key?m+=`\n\t\t\t\t\t${Ts(r,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(m+=`\n\t\t\t\t\t${Ts(r,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),a&&p&&(m+=Ns(r,s,"default",p)),m},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,r={},o=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return o.test(t)&&(r.none=(0,w.sprintf)((0,w.__)("Max %s wide"),t)),o.test(n)&&(r.wide=(0,w.sprintf)((0,w.__)("Max %s wide"),n)),r}(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}};const Tu=[Iu,Vc];function Nu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Tu.find((t=>t.name===e))}const Bu={type:"default"},Au=(0,u.createContext)(Bu),Lu=Au.Provider;function Pu(){return(0,u.useContext)(Au)}function Du(e){let{layout:t={},css:n,...r}=e;const o=Nu(t.type),i=null!==Hs("spacing.blockGap");if(o){var l;if(n)return(0,u.createElement)("style",null,n);const e=null===(l=o.getLayoutStyle)||void 0===l?void 0:l.call(o,{hasBlockGapSupport:i,layout:t,...r});if(e)return(0,u.createElement)("style",null,e)}return null}const Ru=["none","left","center","right","wide","full"],Mu=["wide","full"];function Ou(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ru;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,b.Z)((e=>{const{getSettings:t}=e(rs),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),r=Pu(),o=Nu(null==r?void 0:r.type),i=o.getAlignments(r);if(n){const t=i.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==o.name)return[];const{alignments:l=Ru}=r,a=e.filter((e=>(r.alignments||t||!Mu.includes(e))&&l.includes(e))).map((e=>({name:e})));return 1===a.length&&"none"===a[0].name?[]:a}var Fu=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),ju=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Zu=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),zu=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const Hu={none:{icon:Fu,title:(0,w._x)("None","Alignment option")},left:{icon:ju,title:(0,w.__)("Align left")},center:{icon:Kc,title:(0,w.__)("Align center")},right:{icon:Zu,title:(0,w.__)("Align right")},wide:{icon:Yc,title:(0,w.__)("Wide width")},full:{icon:zu,title:(0,w.__)("Full width")}},Vu={isAlternate:!0};var Wu=function(e){let{value:t,onChange:n,controls:r,isToolbar:o,isCollapsed:i=!0}=e;const l=Ou(r);if(!l.length)return null;function a(e){n([t,"none"].includes(e)?void 0:e)}const s=Hu[t],c=Hu.none,d=o?wo.Z:fs.Z,p={popoverProps:Vu,icon:s?s.icon:c.icon,label:(0,w.__)("Align"),toggleProps:{describedBy:(0,w.__)("Change alignment")}},m=o?{isCollapsed:i,controls:l.map((e=>{let{name:n}=e;return{...Hu[n],isActive:t===n||!t&&"none"===n,role:i?"menuitemradio":void 0,onClick:()=>a(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(gs.Z,{className:"block-editor-block-alignment-control__menu-group"},l.map((e=>{let{name:r,info:o}=e;const{icon:i,title:l}=Hu[r],s=r===t||!t&&"none"===r;return(0,u.createElement)(vs.Z,{key:r,icon:i,iconPosition:"left",className:g()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{a(r),n()},role:"menuitemradio",info:o},l)}))))}};return(0,u.createElement)(d,(0,bo.Z)({},p,m))};const Uu=e=>(0,u.createElement)(Wu,(0,bo.Z)({},e,{isToolbar:!1})),$u=["left","center","right","wide","full"],Gu=["wide","full"];function qu(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?$u.filter((t=>e.includes(t))):!0===e?[...$u]:[],!r||!0===e&&!n?(0,H.without)(t,...Gu):t}const Ku=(0,yo.o)((e=>t=>{const{name:n}=t,r=Ou(qu(We(n,"align"),Ue(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,u.createElement)(u.Fragment,null,!!r.length&&(0,u.createElement)(hs,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Uu,{value:t.attributes.align,onChange:e=>{if(!e){var n,r;const o=He(t.name);(null==o||null===(n=o.attributes)||void 0===n||null===(r=n.align)||void 0===r?void 0:r.default)&&(e="")}t.setAttributes({align:e})},controls:r})),(0,u.createElement)(e,t))}),"withToolbarControls"),Yu=(0,yo.o)((e=>t=>{const{name:n,attributes:r}=t,{align:o}=r,i=Ou(qu(We(n,"align"),Ue(n,"alignWide",!0)));if(void 0===o)return(0,u.createElement)(e,t);let l=t.wrapperProps;return i.some((e=>e.name===o))&&(l={...l,"data-align":o}),(0,u.createElement)(e,(0,bo.Z)({},t,{wrapperProps:l}))}));(0,_e.KJ)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,H.has)(e.attributes,["align","type"])||Ue(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...$u,""]}}),e})),(0,_e.KJ)("editor.BlockListBlock","core/editor/align/with-data-align",Yu),(0,_e.KJ)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Ku),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:r}=n;return qu(We(t,"align"),Ue(t,"alignWide",!0)).includes(r)&&(e.className=g()(`align${r}`,e.className)),e})),(0,_e.KJ)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,H.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));var Ju=n(54600),Xu=n(22449),Qu=n(21840);const ed=/[\s#]/g,td={type:"string",source:"attribute",attribute:"id",selector:"*"},nd=(0,yo.o)((e=>t=>{if(Ue(t.name,"anchor")&&t.isSelected){const n="web"===Zo.Z.OS,r=(0,u.createElement)(Ju.Z,{className:"html-anchor-control",label:(0,w.__)("HTML anchor"),help:(0,u.createElement)(u.Fragment,null,(0,w.__)("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,u.createElement)(Xu.Z,{href:(0,w.__)("https://wordpress.org/support/article/page-jumps/")},(0,w.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,w.__)("Add an anchor"),onChange:e=>{e=e.replace(ed,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&(0,u.createElement)(lc,{__experimentalGroup:"advanced"},r),!n&&"core/heading"===t.name&&(0,u.createElement)(lc,null,(0,u.createElement)(Qu.Z,{title:(0,w.__)("Heading settings")},r)))}return(0,u.createElement)(e,t)}),"withInspectorControl");(0,_e.KJ)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,H.has)(e.attributes,["anchor","type"])||Ue(e,"anchor")&&(e.attributes={...e.attributes,anchor:td}),e})),(0,_e.KJ)("editor.BlockEdit","core/editor/anchor/with-inspector-control",nd),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return Ue(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const rd={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,_e.KJ)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||Ue(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:rd}),e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return Ue(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const od=(0,yo.o)((e=>t=>Ue(t.name,"customClassName",!0)&&t.isSelected?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),(0,u.createElement)(lc,{__experimentalGroup:"advanced"},(0,u.createElement)(Ju.Z,{autoComplete:"off",label:(0,w.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,w.__)("Separate multiple classes with spaces.")}))):(0,u.createElement)(e,t)),"withInspectorControl");(0,_e.KJ)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return Ue(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,_e.KJ)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",od),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return Ue(t,"customClassName",!0)&&n.className&&(e.className=g()(e.className,n.className)),e})),(0,_e.KJ)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){if(!Ue(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]){var o;const r=null===(o=t[n])||void 0===o?void 0:o.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return Ue(t,"className",!0)&&("string"==typeof e.className?e.className=(0,H.uniq)([Qt(t.name),...e.className.split(" ")]).join(" ").trim():e.className=Qt(t.name)),e}));var id=n(98742),ld=n(79574),ad=n(43627),sd=n(10356),cd=n(41658),ud=n(5523),dd=n(19006),pd=n(79496),md=n(91038),hd=n(90922);const fd=(0,u.createContext)({});function gd(e){let{value:t,children:n}=e;const r=(0,u.useContext)(fd),o=(0,u.useMemo)((()=>({...r,...t})),[r,t]);return(0,u.createElement)(fd.Provider,{value:o,children:n})}var vd=fd;const bd={};var yd=(0,cd.Z)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,r=He(n),o=(0,u.useContext)(vd),i=(0,u.useMemo)((()=>r&&r.usesContext?(0,H.pick)(o,r.usesContext):bd),[r,o]);if(!r)return null;const l=r.edit||r.save;if(r.apiVersion>1)return(0,u.createElement)(l,(0,bo.Z)({},e,{context:i}));const a=Ue(r,"className",!0)?Qt(n):null,s=g()(a,t.className);return(0,u.createElement)(l,(0,bo.Z)({},e,{context:i,className:s}))}));function _d(e){const{name:t,isSelected:n,clientId:r}=e,o={name:t,isSelected:n,clientId:r};return(0,u.createElement)(ls,{value:(0,u.useMemo)((()=>o),Object.values(o))},(0,u.createElement)(yd,e))}var kd=n(77333),wd=n(83115),xd=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Cd=function(e){let{className:t,actions:n,children:r,secondaryActions:o}=e;return(0,u.createElement)("div",{style:{display:"contents",all:"initial"}},(0,u.createElement)("div",{className:g()(t,"block-editor-warning")},(0,u.createElement)("div",{className:"block-editor-warning__contents"},(0,u.createElement)("p",{className:"block-editor-warning__message"},r),(u.Children.count(n)>0||o)&&(0,u.createElement)("div",{className:"block-editor-warning__actions"},u.Children.count(n)>0&&u.Children.map(n,((e,t)=>(0,u.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),o&&(0,u.createElement)(wd.Z,{className:"block-editor-warning__secondary",icon:xd,label:(0,w.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,u.createElement)(gs.Z,null,o.map(((e,t)=>(0,u.createElement)(vs.Z,{onClick:e.onClick,key:t},e.title))))))))))},Ed=n(79646);function Sd(e){let{title:t,rawContent:n,renderedContent:r,action:o,actionText:i,className:l}=e;return(0,u.createElement)("div",{className:l},(0,u.createElement)("div",{className:"block-editor-block-compare__content"},(0,u.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,u.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,u.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,u.createElement)(Kt.Z,null,Se(r)))),(0,u.createElement)("div",{className:"block-editor-block-compare__action"},(0,u.createElement)(Ss.Z,{variant:"secondary",tabIndex:"0",onClick:o},i)))}var Id=function(e){let{block:t,onKeep:n,onConvert:r,convertor:o,convertButtonText:i}=e;const l=(a=o(t),(0,H.castArray)(a).map((e=>rn(e.name,e.attributes,e.innerBlocks))).join(""));var a;const s=(c=t.originalContent,d=l,(0,Ed.Kx)(c,d).map(((e,t)=>{const n=g()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,u.createElement)("span",{key:t,className:n},e.value)})));var c,d;return(0,u.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,u.createElement)(Sd,{title:(0,w.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,w.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,u.createElement)(Sd,{title:(0,w.__)("After Conversion"),className:"block-editor-block-compare__converted",action:r,actionText:i,rawContent:s,renderedContent:l}))};const Td=e=>zr({HTML:e.originalContent});var Nd=(0,pd.Z)([(0,ud.Z)(((e,t)=>{let{clientId:n}=t;return{block:e(rs).getBlock(n)}})),(0,dd.Z)(((e,t)=>{let{block:n}=t;const{replaceBlock:r}=e(rs);return{convertToClassic(){r(n.clientId,(e=>Ke("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){r(n.clientId,(e=>Ke("core/html",{content:e.originalContent}))(n))},convertToBlocks(){r(n.clientId,Td(n))},attemptBlockRecovery(){r(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:r}=e;return Ke(t,n,r)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:r,attemptBlockRecovery:o,block:i}=e;const l=!!He("core/html"),[a,s]=(0,u.useState)(!1),c=(0,u.useCallback)((()=>s(!0)),[]),d=(0,u.useCallback)((()=>s(!1)),[]),p=(0,u.useMemo)((()=>[{title:(0,w._x)("Resolve","imperative verb"),onClick:c},l&&{title:(0,w.__)("Convert to HTML"),onClick:t},{title:(0,w.__)("Convert to Classic Block"),onClick:r}].filter(Boolean)),[c,t,r]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Cd,{actions:[(0,u.createElement)(Ss.Z,{key:"recover",onClick:o,variant:"primary"},(0,w.__)("Attempt Block Recovery"))],secondaryActions:p},(0,w.__)("This block contains unexpected or invalid content.")),a&&(0,u.createElement)(kd.Z,{title:(0,w.__)("Resolve Block"),onRequestClose:d,className:"block-editor-block-compare"},(0,u.createElement)(Id,{block:i,onKeep:t,onConvert:n,convertor:Td,convertButtonText:(0,w.__)("Convert to Blocks")})))}));const Bd=(0,u.createElement)(Cd,{className:"block-editor-block-list__block-crash-warning"},(0,w.__)("This block has encountered an error and cannot be previewed."));var Ad=()=>Bd;class Ld extends u.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 Pd=Ld,Dd=n(86683),Rd=function(e){let{clientId:t}=e;const[n,r]=(0,u.useState)(""),o=(0,b.Z)((e=>e(rs).getBlock(t)),[t]),{updateBlock:i}=(0,y.Z)(rs);return(0,u.useEffect)((()=>{r(ln(o))}),[o]),(0,u.createElement)(Dd.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=He(o.name);if(!e)return;const l=lr(e,n,o.attributes),a=n||rn(e,l),[s]=n?Hn({...o,attributes:l,originalContent:a}):[!0];i(t,{attributes:l,originalContent:a,isValid:s}),n||r({content:a})},onChange:e=>r(e.target.value)})},Md=n(60930);let Od=Qd();const Fd=e=>Kd(e,Od);let jd=Qd();Fd.write=e=>Kd(e,jd);let Zd=Qd();Fd.onStart=e=>Kd(e,Zd);let zd=Qd();Fd.onFrame=e=>Kd(e,zd);let Hd=Qd();Fd.onFinish=e=>Kd(e,Hd);let Vd=[];Fd.setTimeout=(e,t)=>{let n=Fd.now()+t,r=()=>{let e=Vd.findIndex((e=>e.cancel==r));~e&&Vd.splice(e,1),Gd-=~e?1:0},o={time:n,handler:e,cancel:r};return Vd.splice(Wd(n),0,o),Gd+=1,Yd(),o};let Wd=e=>~(~Vd.findIndex((t=>t.time>e))||~Vd.length);Fd.cancel=e=>{Zd.delete(e),zd.delete(e),Hd.delete(e),Od.delete(e),jd.delete(e)},Fd.sync=e=>{qd=!0,Fd.batchedUpdates(e),qd=!1},Fd.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,Fd.onStart(n)}return r.handler=e,r.cancel=()=>{Zd.delete(n),t=null},r};let Ud="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Fd.use=e=>Ud=e,Fd.now="undefined"!=typeof performance?()=>performance.now():Date.now,Fd.batchedUpdates=e=>e(),Fd.catch=console.error,Fd.frameLoop="always",Fd.advance=()=>{"demand"!==Fd.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Xd()};let $d=-1,Gd=0,qd=!1;function Kd(e,t){qd?(t.delete(e),e(0)):(t.add(e),Yd())}function Yd(){$d<0&&($d=0,"demand"!==Fd.frameLoop&&Ud(Jd))}function Jd(){~$d&&(Ud(Jd),Fd.batchedUpdates(Xd))}function Xd(){let e=$d;$d=Fd.now();let t=Wd($d);t&&(ep(Vd.splice(0,t),(e=>e.handler())),Gd-=t),Gd?(Zd.flush(),Od.flush(e?Math.min(64,$d-e):16.667),zd.flush(),jd.flush(),Hd.flush()):$d=-1}function Qd(){let e=new Set,t=e;return{add(n){Gd+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Gd-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Gd-=t.size,ep(t,(t=>t(n)&&e.add(t))),Gd+=e.size,t=e)}}}function ep(e,t){e.forEach((e=>{try{t(e)}catch(e){Fd.catch(e)}}))}function tp(){}const np={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 rp(e,t){if(np.arr(e)){if(!np.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}const op=(e,t)=>e.forEach(t);function ip(e,t,n){if(np.arr(e))for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);else for(const r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}const lp=e=>np.und(e)?[]:np.arr(e)?e:[e];function ap(e,t){if(e.size){const n=Array.from(e);e.clear(),op(n,t)}}const sp=(e,...t)=>ap(e,(e=>e(...t))),cp=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let up,dp,pp=null,mp=!1,hp=tp;var fp=Object.freeze({__proto__:null,get createStringInterpolator(){return up},get to(){return dp},get colors(){return pp},get skipAnimation(){return mp},get willAdvance(){return hp},assign:e=>{e.to&&(dp=e.to),e.now&&(Fd.now=e.now),void 0!==e.colors&&(pp=e.colors),null!=e.skipAnimation&&(mp=e.skipAnimation),e.createStringInterpolator&&(up=e.createStringInterpolator),e.requestAnimationFrame&&Fd.use(e.requestAnimationFrame),e.batchedUpdates&&(Fd.batchedUpdates=e.batchedUpdates),e.willAdvance&&(hp=e.willAdvance),e.frameLoop&&(Fd.frameLoop=e.frameLoop)}});const gp=new Set;let vp=[],bp=[],yp=0;const _p={get idle(){return!gp.size&&!vp.length},start(e){yp>e.priority?(gp.add(e),Fd.onStart(kp)):(wp(e),Fd(Cp))},advance:Cp,sort(e){if(yp)Fd.onFrame((()=>_p.sort(e)));else{const t=vp.indexOf(e);~t&&(vp.splice(t,1),xp(e))}},clear(){vp=[],gp.clear()}};function kp(){gp.forEach(wp),gp.clear(),Fd(Cp)}function wp(e){vp.includes(e)||xp(e)}function xp(e){vp.splice(function(t,n){const r=t.findIndex((t=>t.priority>e.priority));return r<0?t.length:r}(vp),0,e)}function Cp(e){const t=bp;for(let n=0;n<vp.length;n++){const r=vp[n];yp=r.priority,r.idle||(hp(r),r.advance(e),r.idle||t.push(r))}return yp=0,bp=vp,bp.length=0,vp=t,vp.length>0}const Ep="[-+]?\\d*\\.?\\d+",Sp=Ep+"%";function Ip(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Tp=new RegExp("rgb"+Ip(Ep,Ep,Ep)),Np=new RegExp("rgba"+Ip(Ep,Ep,Ep,Ep)),Bp=new RegExp("hsl"+Ip(Ep,Sp,Sp)),Ap=new RegExp("hsla"+Ip(Ep,Sp,Sp,Ep)),Lp=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Pp=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Dp=/^#([0-9a-fA-F]{6})$/,Rp=/^#([0-9a-fA-F]{8})$/;function Mp(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 Op(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=Mp(o,r,e+1/3),l=Mp(o,r,e),a=Mp(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*l)<<16|Math.round(255*a)<<8}function Fp(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function jp(e){return(parseFloat(e)%360+360)%360/360}function Zp(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function zp(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Hp(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Dp.exec(e))?parseInt(t[1]+"ff",16)>>>0:pp&&void 0!==pp[e]?pp[e]:(t=Tp.exec(e))?(Fp(t[1])<<24|Fp(t[2])<<16|Fp(t[3])<<8|255)>>>0:(t=Np.exec(e))?(Fp(t[1])<<24|Fp(t[2])<<16|Fp(t[3])<<8|Zp(t[4]))>>>0:(t=Lp.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Rp.exec(e))?parseInt(t[1],16)>>>0:(t=Pp.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Bp.exec(e))?(255|Op(jp(t[1]),zp(t[2]),zp(t[3])))>>>0:(t=Ap.exec(e))?(Op(jp(t[1]),zp(t[2]),zp(t[3]))|Zp(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})`)}const Vp=(e,t,n)=>{if(np.fun(e))return e;if(np.arr(e))return Vp({range:e,output:t,extrapolate:n});if(np.str(e.output[0]))return up(e);const r=e,o=r.output,i=r.range||[0,1],l=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",s=r.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,l,a,s){let c=s?s(e):e;if(c<t){if("identity"===l)return c;"clamp"===l&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r,c)}(e,i[t],i[t+1],o[t],o[t+1],s,l,a,r.map)}};function Wp(){return Wp=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},Wp.apply(this,arguments)}const Up=Symbol.for("FluidValue.get"),$p=Symbol.for("FluidValue.observers"),Gp=e=>Boolean(e&&e[Up]),qp=e=>e&&e[Up]?e[Up]():e,Kp=e=>e[$p]||null;function Yp(e,t){let n=e[$p];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Jp{constructor(e){if(this[Up]=void 0,this[$p]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Xp(this,e)}}const Xp=(e,t)=>tm(e,Up,t);function Qp(e,t){if(e[Up]){let n=e[$p];n||tm(e,$p,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function em(e,t){let n=e[$p];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[$p]=null,e.observerRemoved&&e.observerRemoved(r,t)}}const tm=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),nm=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rm=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,om=new RegExp(`(${nm.source})(%|[a-z]+)`,"i"),im=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,lm=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,am=e=>{const[t,n]=sm(e);if(!t||cp())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&lm.test(n)?am(n):n||e},sm=e=>{const t=lm.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]};let cm;const um=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,dm=e=>{cm||(cm=pp?new RegExp(`(${Object.keys(pp).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>qp(e).replace(lm,am).replace(rm,Hp).replace(cm,Hp))),n=t.map((e=>e.match(nm).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]})))),o=r.map((t=>Vp(Wp({},e,{output:t}))));return e=>{var n;const r=!om.test(t[0])&&(null==(n=t.find((e=>om.test(e))))?void 0:n.replace(nm,""));let i=0;return t[0].replace(nm,(()=>`${o[i++](e)}${r||""}`)).replace(im,um)}},pm="react-spring: ",mm=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${pm}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},hm=mm(console.warn),fm=mm(console.warn);function gm(e){return np.str(e)&&("#"==e[0]||/\d/.test(e)||!cp()&&lm.test(e)||e in(pp||{}))}const vm=cp()?u.useEffect:u.useLayoutEffect;function bm(){const e=(0,u.useState)()[1],t=(()=>{const e=(0,u.useRef)(!1);return vm((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const ym=e=>(0,u.useEffect)(e,_m),_m=[];function km(e){const t=(0,u.useRef)();return(0,u.useEffect)((()=>{t.current=e})),t.current}const wm=Symbol.for("Animated:node"),xm=e=>e&&e[wm],Cm=(e,t)=>{return n=e,r=wm,o=t,Object.defineProperty(n,r,{value:o,writable:!0,configurable:!0});var n,r,o},Em=e=>e&&e[wm]&&e[wm].getPayload();class Sm{constructor(){this.payload=void 0,Cm(this,this)}getPayload(){return this.payload||[]}}class Im extends Sm{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,np.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Im(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return np.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,np.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Tm extends Im{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Vp({output:[e,e]})}static create(e){return new Tm(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(np.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=Vp({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Nm={dependencies:null};class Bm extends Sm{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ip(this.source,((n,r)=>{var o;(o=n)&&o[wm]===o?t[r]=n.getValue(e):Gp(n)?t[r]=qp(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&op(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return ip(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Nm.dependencies&&Gp(e)&&Nm.dependencies.add(e);const t=Em(e);t&&op(t,(e=>this.add(e)))}}class Am extends Bm{constructor(e){super(e)}static create(e){return new Am(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Lm)),!0)}}function Lm(e){return(gm(e)?Tm:Im).create(e)}function Pm(e){const t=xm(e);return t?t.constructor:np.arr(e)?Am:gm(e)?Tm:Im}function Dm(){return Dm=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},Dm.apply(this,arguments)}const Rm=(e,t)=>{const n=!np.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,u.forwardRef)(((r,o)=>{const i=(0,u.useRef)(null),l=n&&(0,u.useCallback)((e=>{i.current=function(e,t){return e&&(np.fun(e)?e(t):e.current=t),t}(o,e)}),[o]),[a,s]=function(e,t){const n=new Set;return Nm.dependencies=n,e.style&&(e=Dm({},e,{style:t.createAnimatedStyle(e.style)})),e=new Bm(e),Nm.dependencies=null,[e,n]}(r,t),c=bm(),d=()=>{const e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},p=new Mm(d,s),m=(0,u.useRef)();vm((()=>(m.current=p,op(s,(e=>Qp(e,p))),()=>{m.current&&(op(m.current.deps,(e=>em(e,m.current))),Fd.cancel(m.current.update))}))),(0,u.useEffect)(d,[]),ym((()=>()=>{const e=m.current;op(e.deps,(t=>em(t,e)))}));const h=t.getComponentProps(a.getValue());return u.createElement(e,Dm({},h,{ref:l}))}))};class Mm{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Fd.write(this.update)}}const Om=Symbol.for("AnimatedComponent"),Fm=e=>np.str(e)?e:e&&np.str(e.displayName)?e.displayName:np.fun(e)&&e.name||null;function jm(){return jm=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},jm.apply(this,arguments)}function Zm(e,...t){return np.fun(e)?e(...t):e}const zm=(e,t)=>!0===e||!!(t&&e&&(np.fun(e)?e(t):lp(e).includes(t))),Hm=(e,t)=>np.obj(e)?t&&e[t]:e,Vm=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Wm=e=>e,Um=(e,t=Wm)=>{let n=$m;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const r={};for(const o of n){const n=t(e[o],o);np.und(n)||(r[o]=n)}return r},$m=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Gm={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 qm(e){const t=function(e){const t={};let n=0;if(ip(e,((e,r)=>{Gm[r]||(t[r]=e,n++)})),n)return t}(e);if(t){const n={to:t};return ip(e,((e,r)=>r in t||(n[r]=e))),n}return jm({},e)}function Km(e){return e=qp(e),np.arr(e)?e.map(Km):gm(e)?fp.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ym(e){for(const t in e)return!0;return!1}function Jm(e){return np.fun(e)||np.arr(e)&&np.obj(e[0])}function Xm(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Qm(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const eh=jm({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class th{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,eh)}}function nh(e,t){if(np.und(t.decay)){const n=!np.und(t.tension)||!np.und(t.friction);!n&&np.und(t.frequency)&&np.und(t.damping)&&np.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const rh=[];class oh{constructor(){this.changed=!1,this.values=rh,this.toValues=null,this.fromValues=rh,this.to=void 0,this.from=void 0,this.config=new th,this.immediate=!1}}function ih(e,{key:t,props:n,defaultProps:r,state:o,actions:i}){return new Promise(((l,a)=>{var s;let c,u,d=zm(null!=(s=n.cancel)?s:null==r?void 0:r.cancel,t);if(d)h();else{np.und(n.pause)||(o.paused=zm(n.pause,t));let e=null==r?void 0:r.pause;!0!==e&&(e=o.paused||zm(e,t)),c=Zm(n.delay||0,t),e?(o.resumeQueue.add(m),i.pause()):(i.resume(),m())}function p(){o.resumeQueue.add(m),o.timeouts.delete(u),u.cancel(),c=u.time-Fd.now()}function m(){c>0&&!fp.skipAnimation?(o.delayed=!0,u=Fd.setTimeout(h,c),o.pauseQueue.add(p),o.timeouts.add(u)):h()}function h(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(p),o.timeouts.delete(u),e<=(o.cancelId||0)&&(d=!0);try{i.start(jm({},n,{callId:e,cancel:d}),l)}catch(e){a(e)}}}))}const lh=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ch(e.get()):t.every((e=>e.noop))?ah(e.get()):sh(e.get(),t.every((e=>e.finished))),ah=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),sh=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ch=e=>({value:e,cancelled:!0,finished:!1});function uh(e,t,n,r){const{callId:o,parentId:i,onRest:l}=t,{asyncTo:a,promise:s}=n;return i||e!==a||t.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;const c=Um(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=o<=(n.cancelId||0)&&ch(r)||o!==n.asyncId&&sh(r,!1);if(t)throw e.result=t,d(e),e},h=(e,t)=>{const i=new ph,l=new mh;return(async()=>{if(fp.skipAnimation)throw dh(n),l.result=sh(r,!1),d(l),l;m(i);const a=np.obj(e)?jm({},e):jm({},t,{to:e});a.parentId=o,ip(c,((e,t)=>{np.und(a[t])&&(a[t]=e)}));const s=await r.start(a);return m(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};let f;if(fp.skipAnimation)return dh(n),sh(r,!1);try{let t;t=np.arr(e)?(async e=>{for(const t of e)await h(t)})(e):Promise.resolve(e(h,r.stop.bind(r))),await Promise.all([t.then(u),p]),f=sh(r.get(),!0,!1)}catch(e){if(e instanceof ph)f=e.result;else{if(!(e instanceof mh))throw e;f=e.result}}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?s:void 0)}return np.fun(l)&&Fd.batchedUpdates((()=>{l(f,r,r.item)})),f})():s}function dh(e,t){ap(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class ph extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class mh extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const hh=e=>e instanceof gh;let fh=1;class gh extends Jp{constructor(...e){super(...e),this.id=fh++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=xm(this);return e&&e.getValue()}to(...e){return fp.to(this,e)}interpolate(...e){return hm(`${pm}The "interpolate" function is deprecated in v9 (use "to" instead)`),fp.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){Yp(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||_p.sort(this),Yp(this,{type:"priority",parent:this,priority:e})}}const vh=Symbol.for("SpringPhase"),bh=e=>(1&e[vh])>0,yh=e=>(2&e[vh])>0,_h=e=>(4&e[vh])>0,kh=(e,t)=>t?e[vh]|=3:e[vh]&=-3,wh=(e,t)=>t?e[vh]|=4:e[vh]&=-5;class xh extends gh{constructor(e,t){if(super(),this.key=void 0,this.animation=new oh,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!np.und(e)||!np.und(t)){const n=np.obj(e)?jm({},e):jm({},t,{from:e});np.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(yh(this)||this._state.asyncTo)||_h(this)}get goal(){return qp(this.animation.to)}get velocity(){const e=xm(this);return e instanceof Im?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return bh(this)}get isAnimating(){return yh(this)}get isPaused(){return _h(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{config:o,toValues:i}=r;const l=Em(r.to);!l&&Gp(r.to)&&(i=lp(qp(r.to))),r.values.forEach(((a,s)=>{if(a.done)return;const c=a.constructor==Tm?1:l?l[s].lastPosition:i[s];let u=r.immediate,d=c;if(!u){if(d=a.lastPosition,o.tension<=0)return void(a.done=!0);let t=a.elapsedTime+=e;const n=r.fromValues[s],i=null!=a.v0?a.v0:a.v0=np.arr(o.velocity)?o.velocity[s]:o.velocity;let l;if(np.und(o.duration))if(o.decay){const e=!0===o.decay?.998:o.decay,r=Math.exp(-(1-e)*t);d=n+i/(1-e)*(1-r),u=Math.abs(a.lastPosition-d)<.1,l=i*r}else{l=null==a.lastVelocity?i:a.lastVelocity;const t=o.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),r=o.restVelocity||t/10,s=o.clamp?0:o.bounce,p=!np.und(s),m=n==c?a.v0>0:n<c;let h,f=!1;const g=1,v=Math.ceil(e/g);for(let e=0;e<v&&(h=Math.abs(l)>r,h||(u=Math.abs(c-d)<=t,!u));++e)p&&(f=d==c||d>c==m,f&&(l=-l*s,d=c)),l+=(1e-6*-o.tension*(d-c)+.001*-o.friction*l)/o.mass*g,d+=l*g}else{let r=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,a.durationProgress>0&&(a.elapsedTime=o.duration*a.durationProgress,t=a.elapsedTime+=e)),r=(o.progress||0)+t/this._memoizedDuration,r=r>1?1:r<0?0:r,a.durationProgress=r),d=n+o.easing(r)*(c-n),l=(d-a.lastPosition)/e,u=1==r}a.lastVelocity=l,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}l&&!l[s].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,o.round)&&(n=!0)}));const a=xm(this),s=a.getValue();if(t){const e=qp(r.to);s===e&&!n||o.decay?n&&o.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return Fd.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(yh(this)){const{to:e,config:t}=this.animation;Fd.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 np.und(e)?(n=this.queue||[],this.queue=[]):n=[np.obj(e)?e:jm({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>lh(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),dh(this._state,e&&this._lastCallId),Fd.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=np.obj(n)?n[t]:n,(null==n||Jm(n))&&(n=void 0),r=np.obj(r)?r[t]:r,null==r&&(r=void 0);const o={to:n,from:r};return bh(this)||(e.reverse&&([n,r]=[r,n]),r=qp(r),np.und(r)?xm(this)||this._set(n):this._set(r)),o}_update(e,t){let n=jm({},e);const{key:r,defaultProps:o}=this;n.default&&Object.assign(o,Um(n,((e,t)=>/^on/.test(t)?Hm(e,r):e))),Bh(this,n,"onProps"),Ah(this,"onProps",n,this);const i=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const l=this._state;return ih(++this._lastCallId,{key:r,props:n,defaultProps:o,state:l,actions:{pause:()=>{_h(this)||(wh(this,!0),sp(l.pauseQueue),Ah(this,"onPause",sh(this,Ch(this,this.animation.to)),this))},resume:()=>{_h(this)&&(wh(this,!1),yh(this)&&this._resume(),sp(l.resumeQueue),Ah(this,"onResume",sh(this,Ch(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Eh(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ch(this));const r=!np.und(e.to),o=!np.und(e.from);if(r||o){if(!(t.callId>this._lastToId))return n(ch(this));this._lastToId=t.callId}const{key:i,defaultProps:l,animation:a}=this,{to:s,from:c}=a;let{to:u=s,from:d=c}=e;!o||r||t.default&&!np.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!rp(d,c);p&&(a.from=d),d=qp(d);const m=!rp(u,s);m&&this._focus(u);const h=Jm(t.to),{config:f}=a,{decay:g,velocity:v}=f;(r||o)&&(f.velocity=0),t.config&&!h&&function(e,t,n){n&&(nh(n=jm({},n),t),t=jm({},n,t)),nh(e,t),Object.assign(e,t);for(const t in eh)null==e[t]&&(e[t]=eh[t]);let{mass:r,frequency:o,damping:i}=e;np.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,Zm(t.config,i),t.config!==l.config?Zm(l.config,i):void 0);let b=xm(this);if(!b||np.und(u))return n(sh(this,!0));const y=np.und(t.reset)?o&&!t.default:!np.und(d)&&zm(t.reset,i),_=y?d:this.get(),k=Km(u),w=np.num(k)||np.arr(k)||gm(k),x=!h&&(!w||zm(l.immediate||t.immediate,i));if(m){const e=Pm(u);if(e!==b.constructor){if(!x)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(k)}}const C=b.constructor;let E=Gp(u),S=!1;if(!E){const e=y||!bh(this)&&p;(m||e)&&(S=rp(Km(_),k),E=!S),(rp(a.immediate,x)||x)&&rp(f.decay,g)&&rp(f.velocity,v)||(E=!0)}if(S&&yh(this)&&(a.changed&&!y?E=!0:E||this._stop(s)),!h&&((E||Gp(s))&&(a.values=b.getPayload(),a.toValues=Gp(u)?null:C==Tm?[1]:lp(k)),a.immediate!=x&&(a.immediate=x,x||y||this._set(s)),E)){const{onRest:e}=a;op(Nh,(e=>Bh(this,t,e)));const r=sh(this,Ch(this,s));sp(this._pendingCalls,r),this._pendingCalls.add(n),a.changed&&Fd.batchedUpdates((()=>{a.changed=!y,null==e||e(r,this),y?Zm(l.onRest,r):null==a.onStart||a.onStart(r,this)}))}y&&this._set(_),h?n(uh(t.to,t,this._state,this)):E?this._start():yh(this)&&!m?this._pendingCalls.add(n):n(ah(_))}_focus(e){const t=this.animation;e!==t.to&&(Kp(this)&&this._detach(),t.to=e,Kp(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Gp(t)&&(Qp(t,this),hh(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Gp(e)&&em(e,this)}_set(e,t=!0){const n=qp(e);if(!np.und(n)){const e=xm(this);if(!e||!rp(n,e.getValue())){const r=Pm(n);e&&e.constructor==r?e.setValue(n):Cm(this,r.create(n)),e&&Fd.batchedUpdates((()=>{this._onChange(n,t)}))}}return xm(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Ah(this,"onStart",sh(this,Ch(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Zm(this.animation.onChange,e,this)),Zm(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;xm(this).reset(qp(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),yh(this)||(kh(this,!0),_h(this)||this._resume())}_resume(){fp.skipAnimation?this.finish():_p.start(this)}_stop(e,t){if(yh(this)){kh(this,!1);const n=this.animation;op(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Yp(this,{type:"idle",parent:this});const r=t?ch(this.get()):sh(this.get(),Ch(this,null!=e?e:n.to));sp(this._pendingCalls,r),n.changed&&(n.changed=!1,Ah(this,"onRest",r,this))}}}function Ch(e,t){const n=Km(t);return rp(Km(e.get()),n)}function Eh(e,t=e.loop,n=e.to){let r=Zm(t);if(r){const o=!0!==r&&qm(r),i=(o||e).reverse,l=!o||o.reset;return Sh(jm({},e,{loop:t,default:!1,pause:void 0,to:!i||Jm(n)?n:void 0,from:l?e.from:void 0,reset:l},o))}}function Sh(e){const{to:t,from:n}=e=qm(e),r=new Set;return np.obj(t)&&Th(t,r),np.obj(n)&&Th(n,r),e.keys=r.size?Array.from(r):null,e}function Ih(e){const t=Sh(e);return np.und(t.default)&&(t.default=Um(t)),t}function Th(e,t){ip(e,((e,n)=>null!=e&&t.add(n)))}const Nh=["onStart","onRest","onChange","onPause","onResume"];function Bh(e,t,n){e.animation[n]=t[n]!==Vm(t,n)?Hm(t[n],e.key):void 0}function Ah(e,t,...n){var r,o,i,l;null==(r=(o=e.animation)[t])||r.call(o,...n),null==(i=(l=e.defaultProps)[t])||i.call(l,...n)}const Lh=["onStart","onChange","onRest"];let Ph=1;class Dh{constructor(e,t){this.id=Ph++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(jm({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];np.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Sh(e)),this}start(e){let{queue:t}=this;return e?t=lp(e).map(Sh):this.queue=[],this._flush?this._flush(this,t):(zh(this,t),Rh(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;op(lp(t),(t=>n[t].stop(!!e)))}else dh(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(np.und(e))this.start({pause:!0});else{const t=this.springs;op(lp(e),(e=>t[e].pause()))}return this}resume(e){if(np.und(e))this.start({pause:!1});else{const t=this.springs;op(lp(e),(e=>t[e].resume()))}return this}each(e){ip(this.springs,e)}_onFrame(){const{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,ap(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const i=!r&&this._started,l=o||i&&n.size?this.get():null;o&&t.size&&ap(t,(([e,t])=>{t.value=l,e(t,this,this._item)})),i&&(this._started=!1,ap(n,(([e,t])=>{t.value=l,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)}Fd.onFrame(this._onFrame)}}function Rh(e,t){return Promise.all(t.map((t=>Mh(e,t)))).then((t=>lh(e,t)))}async function Mh(e,t,n){const{keys:r,to:o,from:i,loop:l,onRest:a,onResolve:s}=t,c=np.obj(t.default)&&t.default;l&&(t.loop=!1),!1===o&&(t.to=null),!1===i&&(t.from=null);const u=np.arr(o)||np.fun(o)?o:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):op(Lh,(n=>{const r=t[n];if(np.fun(r)){const o=e._events[n];t[n]=({finished:e,cancelled:t})=>{const 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])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,sp(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Vm(t,"cancel");(u||m&&d.asyncId)&&p.push(ih(++e._lastAsyncId,{props:t,state:d,actions:{pause:tp,resume:tp,start(t,n){m?(dh(d,e._lastAsyncId),n(ch(e))):(t.onRest=a,n(uh(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const h=lh(e,await Promise.all(p));if(l&&h.finished&&(!n||!h.noop)){const n=Eh(t,l,o);if(n)return zh(e,[n]),Mh(e,n,!0)}return s&&Fd.batchedUpdates((()=>s(h,e,e.item))),h}function Oh(e,t){const n=jm({},e.springs);return t&&op(lp(t),(e=>{np.und(e.keys)&&(e=Sh(e)),np.obj(e.to)||(e=jm({},e,{to:void 0})),Zh(n,e,(e=>jh(e)))})),Fh(e,n),n}function Fh(e,t){ip(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Qp(t,e))}))}function jh(e,t){const n=new xh;return n.key=e,t&&Qp(n,t),n}function Zh(e,t,n){t.keys&&op(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}function zh(e,t){op(t,(t=>{Zh(e.springs,t,(t=>jh(t,e)))}))}const Hh=["children"],Vh=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,Hh);const r=(0,u.useContext)(Wh),o=n.pause||!!r.pause,i=n.immediate||!!r.immediate;n=function(e,t){const[n]=(0,u.useState)((()=>({inputs:t,result:e()}))),r=(0,u.useRef)(),o=r.current;let i=o;if(i){const n=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));n||(i={inputs:t,result:e()})}else i=n;return(0,u.useEffect)((()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:o,immediate:i})),[o,i]);const{Provider:l}=Wh;return u.createElement(l,{value:n},t)},Wh=(Uh=Vh,Object.assign(Uh,u.createContext({})),Uh.Provider._context=Uh,Uh.Consumer._context=Uh,Uh);var Uh;Vh.Provider=Wh.Provider,Vh.Consumer=Wh.Consumer;const $h=()=>{const e=[],t=function(t){fm(`${pm}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const r=[];return op(e,((e,o)=>{if(np.und(t))r.push(e.start());else{const 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){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return op(e,(e=>e.pause(...arguments))),this},t.resume=function(){return op(e,(e=>e.resume(...arguments))),this},t.set=function(t){op(e,(e=>e.set(t)))},t.start=function(t){const n=[];return op(e,((e,r)=>{if(np.und(t))n.push(e.start());else{const o=this._getProps(t,e,r);o&&n.push(e.start(o))}})),n},t.stop=function(){return op(e,(e=>e.stop(...arguments))),this},t.update=function(t){return op(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return np.fun(e)?e(n,t):e};return t._getProps=n,t};function Gh(e,t,n){const r=np.fun(t)&&t;r&&!n&&(n=[]);const o=(0,u.useMemo)((()=>r||3==arguments.length?$h():void 0),[]),i=(0,u.useRef)(0),l=bm(),a=(0,u.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Oh(e,t);return i.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Rh(e,t):new Promise((r=>{Fh(e,n),a.queue.push((()=>{r(Rh(e,t))})),l()}))}})),[]),s=(0,u.useRef)([...a.ctrls]),c=[],d=km(e)||0;function p(e,n){for(let o=e;o<n;o++){const e=s.current[o]||(s.current[o]=new Dh(null,a.flush)),n=r?r(o,e):t[o];n&&(c[o]=Ih(n))}}(0,u.useMemo)((()=>{op(s.current.slice(e,d),(e=>{Xm(e,o),e.stop(!0)})),s.current.length=e,p(d,e)}),[e]),(0,u.useMemo)((()=>{p(0,Math.min(d,e))}),n);const m=s.current.map(((e,t)=>Oh(e,c[t]))),h=(0,u.useContext)(Vh),f=km(h),g=h!==f&&Ym(h);vm((()=>{i.current++,a.ctrls=s.current;const{queue:e}=a;e.length&&(a.queue=[],op(e,(e=>e()))),op(s.current,((e,t)=>{null==o||o.add(e),g&&e.start({default:h});const n=c[t];n&&(Qm(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ym((()=>()=>{op(a.ctrls,(e=>e.stop(!0)))}));const v=m.map((e=>jm({},e)));return o?[v,o]:v}let qh;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(qh||(qh={}));class Kh extends gh{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Vp(...t);const n=this._get(),r=Pm(n);Cm(this,r.create(n))}advance(e){const t=this._get();rp(t,this.get())||(xm(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Jh(this._active)&&Xh(this)}_get(){const e=np.arr(this.source)?this.source.map(qp):lp(qp(this.source));return this.calc(...e)}_start(){this.idle&&!Jh(this._active)&&(this.idle=!1,op(Em(this),(e=>{e.done=!1})),fp.skipAnimation?(Fd.batchedUpdates((()=>this.advance())),Xh(this)):_p.start(this))}_attach(){let e=1;op(lp(this.source),(t=>{Gp(t)&&Qp(t,this),hh(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){op(lp(this.source),(e=>{Gp(e)&&em(e,this)})),this._active.clear(),Xh(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=lp(this.source).reduce(((e,t)=>Math.max(e,(hh(t)?t.priority:0)+1)),0))}}function Yh(e){return!1!==e.idle}function Jh(e){return!e.size||Array.from(e).every(Yh)}function Xh(e){e.idle||(e.idle=!0,op(Em(e),(e=>{e.done=!0})),Yp(e,{type:"idle",parent:e}))}function Qh(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}fp.assign({createStringInterpolator:dm,to:(e,t)=>new Kh(e,t)}),_p.advance;const ef=["style","children","scrollTop","scrollLeft"],tf=/^--/;function nf(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||tf.test(e)||of.hasOwnProperty(e)&&of[e]?(""+t).trim():t+"px"}const rf={};let of={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};const lf=["Webkit","Ms","Moz","O"];of=Object.keys(of).reduce(((e,t)=>(lf.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),of);const af=["x","y","z"],sf=/^(matrix|translate|scale|rotate|skew)/,cf=/^(translate)/,uf=/^(rotate|skew)/,df=(e,t)=>np.num(e)&&0!==e?e+t:e,pf=(e,t)=>np.arr(e)?e.every((e=>pf(e,t))):np.num(e)?e===t:parseFloat(e)===t;class mf extends Bm{constructor(e){let{x:t,y:n,z:r}=e,o=Qh(e,af);const i=[],l=[];(t||n||r)&&(i.push([t||0,n||0,r||0]),l.push((e=>[`translate3d(${e.map((e=>df(e,"px"))).join(",")})`,pf(e,0)]))),ip(o,((e,t)=>{if("transform"===t)i.push([e||""]),l.push((e=>[e,""===e]));else if(sf.test(t)){if(delete o[t],np.und(e))return;const n=cf.test(t)?"px":uf.test(t)?"deg":"";i.push(lp(e)),l.push("rotate3d"===t?([e,t,r,o])=>[`rotate3d(${e},${t},${r},${df(o,n)})`,pf(o,0)]:e=>[`${t}(${e.map((e=>df(e,n))).join(",")})`,pf(e,t.startsWith("scale")?1:0)])}})),i.length&&(o.transform=new hf(i,l)),super(o)}}class hf extends Jp{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return op(this.inputs,((n,r)=>{const o=qp(n[0]),[i,l]=this.transforms[r](np.arr(o)?o:n.map(qp));e+=" "+i,t=t&&l})),t?"none":e}observerAdded(e){1==e&&op(this.inputs,(e=>op(e,(e=>Gp(e)&&Qp(e,this)))))}observerRemoved(e){0==e&&op(this.inputs,(e=>op(e,(e=>Gp(e)&&em(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Yp(this,e)}}const ff=["scrollTop","scrollLeft"];fp.assign({batchedUpdates:d.unstable_batchedUpdates,createStringInterpolator:dm,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}});const gf=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Bm(e)),getComponentProps:r=(e=>e)}={})=>{const o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=e=>{const t=Fm(e)||"Anonymous";return(e=np.str(e)?i[e]||(i[e]=Rm(e,o)):e[Om]||(e[Om]=Rm(e,o))).displayName=`Animated(${t})`,e};return ip(e,((t,n)=>{np.arr(e)&&(n=Fm(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;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,r=t,{style:o,children:i,scrollTop:l,scrollLeft:a}=r,s=Qh(r,ef),c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:rf[t]||(rf[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==i&&(e.textContent=i);for(let t in o)if(o.hasOwnProperty(t)){const n=nf(t,o[t]);tf.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==a&&(e.scrollLeft=a)},createAnimatedStyle:e=>new mf(e),getComponentProps:e=>Qh(e,ff)});gf.animated;var vf=n(90155),bf=n(76426);const yf=e=>e+1,_f=e=>({top:e.offsetTop,left:e.offsetLeft});var kf=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:r,triggerAnimationOnChange:o}=e;const i=(0,u.useRef)(),l=(0,vf.Z)()||!r,[a,s]=(0,u.useReducer)(yf,0),[c,d]=(0,u.useReducer)(yf,0),[p,m]=(0,u.useState)({x:0,y:0}),h=(0,u.useMemo)((()=>i.current?_f(i.current):null),[o]),f=(0,u.useMemo)((()=>{if(!n||!i.current)return()=>{};const e=(0,bf.Z)(i.current);if(!e)return()=>{};const t=i.current.getBoundingClientRect();return()=>{const n=i.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[o,n]);function g(e){let{value:n}=e,{x:r,y:o}=n;r=Math.round(r),o=Math.round(o),r===g.x&&o===g.y||(function(e){let{x:n,y:r}=e;if(!i.current)return;const o=0===n&&0===r;i.current.style.transformOrigin=o?"":"center",i.current.style.transform=o?"":`translate3d(${n}px,${r}px,0)`,i.current.style.zIndex=!t||o?"":"1",f()}({x:r,y:o}),g.x=r,g.y=o)}return(0,u.useLayoutEffect)((()=>{a&&d()}),[a]),(0,u.useLayoutEffect)((()=>{if(!h)return;if(l)return void f();i.current.style.transform="";const e=_f(i.current);s(),m({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[o]),g.x=0,g.y=0,function(e,t){const n=np.fun(e),[[r],o]=Gh(1,n?e:[e],n?t||[]:t)}({from:{x:p.x,y:p.y},to:{x:0,y:0},reset:a!==c,config:{mass:5,tension:2e3,friction:200},immediate:l,onChange:g}),i},wf=n(39439);function xf(e){return function(e){return"INPUT"===(null==e?void 0:e.nodeName)}(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 Cf(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function Ef(e){if(!e)return!1;const{tagName:t}=e;return Cf(e)||"BUTTON"===t||"SELECT"===t}var Sf=n(25544);function If(e,t,n,r){const o=r.style.zIndex,i=r.style.position,{position:l="static"}=(0,Sf.Z)(r);"static"===l&&(r.style.position="relative"),r.style.zIndex="10000";const a=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,a}function Tf(e){return"rtl"===(0,Sf.Z)(e).direction}function Nf(e,t,n){const{ownerDocument:r}=e,o=Tf(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),If(r,n,o?i.bottom-1:i.top+1,e)}function Bf(e,t,n){if(!e)return;if(e.focus(),Cf(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;let r=Nf(e,t,n);if(!(r&&r.startContainer&&e.contains(r.startContainer)||(e.scrollIntoView(t),r=r=Nf(e,t,n),r&&r.startContainer&&e.contains(r.startContainer))))return;const{ownerDocument:o}=e,{defaultView:i}=o;(0,Ce.c)(i,"defaultView");const l=i.getSelection();(0,Ce.c)(l,"selection"),l.removeAllRanges(),l.addRange(r)}function Af(e,t){return Bf(e,t,void 0)}const Lf=".block-editor-block-list__block",Pf=".block-list-appender",Df=".block-editor-button-block-appender";function Rf(e,t){return t.closest([Lf,Pf,Df].join(","))===e}function Mf(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Lf);return t?t.id.slice("block-".length):void 0}function Of(e){const t=(0,u.useRef)(),n=function(e){return(0,b.Z)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:r,isBlockSelected:o}=t(rs);if(o(e)&&!r())return n()}),[e])}(e),{isBlockSelected:r,isMultiSelecting:o}=(0,b.Z)(rs);return(0,u.useEffect)((()=>{if(!r(e)||o())return;if(null==n)return;if(!t.current)return;const{ownerDocument:i}=t.current;if(t.current.contains(i.activeElement))return;const l=wf.T_.tabbable.find(t.current).filter((e=>xf(e))),a=-1===n,s=(a?H.last:H.first)(l)||t.current;if(Rf(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=wf.T_.tabbable.findNext(t.current);if(e&&Rf(t.current,e)&&Ef(e))return void e.focus()}Af(s,a)}else t.current.focus()}),[n,e]),t}function Ff(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function jf(){const e=(0,b.Z)((e=>{const{isNavigationMode:t,getSettings:n}=e(rs);return t()||n().outlineMode}),[]);return(0,Ps.Z)((t=>{if(e)return t.addEventListener("mouseout",Ff),t.addEventListener("mouseover",Ff),()=>{t.removeEventListener("mouseout",Ff),t.removeEventListener("mouseover",Ff),t.classList.remove("is-hovered")}}),[e])}function Zf(e){return(0,b.Z)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:r,isBlockSelected:o,isBlockMultiSelected:i,getBlockName:l,getSettings:a,hasSelectedInnerBlock:s,isTyping:c,__unstableIsFullySelected:u}=t(rs),{outlineMode:d}=a(),p=n(e),m=o(e),h=l(e),f=s(e,!0),v=i(e);return g()({"is-selected":m,"is-highlighted":r(e),"is-multi-selected":v,"is-partially-selected":v&&!u(),"is-reusable":$e(He(h)),"is-dragging":p,"has-child-selected":f,"remove-outline":m&&d&&c()})}),[e])}function zf(e){return(0,b.Z)((t=>{const n=t(rs).getBlockName(e),r=He(n);if((null==r?void 0:r.apiVersion)>1)return Qt(n)}),[e])}function Hf(e){return(0,b.Z)((t=>{const{getBlockName:n,getBlockAttributes:r}=t(rs),o=r(e);if(null==o||!o.className)return;const i=He(n(e));return(null==i?void 0:i.apiVersion)>1?o.className:void 0}),[e])}function Vf(e){return(0,b.Z)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:r,getBlockName:o,getBlockRootClientId:i,isBlockSelected:l}=t(rs);if(!l(e))return;const a=n();return a?g()("is-block-moving-mode",{"can-insert-moving-block":r(o(a),i(e))}):void 0}),[e])}function Wf(e){const{isBlockSelected:t}=(0,b.Z)(rs),{selectBlock:n,selectionChange:r}=(0,y.Z)(rs);return(0,Ps.Z)((o=>{function i(i){o.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||r(e):Rf(o,i.target)&&n(e))}return o.addEventListener("focusin",i),()=>{o.removeEventListener("focusin",i)}}),[t,n])}var Uf=n(83830);function $f(e){const t=(0,b.Z)((t=>t(rs).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:r}=(0,b.Z)(rs),{insertDefaultBlock:o,removeBlock:i}=(0,y.Z)(rs);return(0,Ps.Z)((l=>{if(t)return l.addEventListener("keydown",a),l.addEventListener("dragstart",s),()=>{l.removeEventListener("keydown",a),l.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==Uf.ENTER&&a!==Uf.BACKSPACE&&a!==Uf.DELETE||s!==l||xf(s)||(t.preventDefault(),a===Uf.ENTER?o({},n(e),r(e)+1):i(e))}function s(e){e.preventDefault()}}),[e,t,n,r,o,i])}function Gf(e){const{isNavigationMode:t,isBlockSelected:n}=(0,b.Z)(rs),{setNavigationMode:r,selectBlock:o}=(0,y.Z)(rs);return(0,Ps.Z)((i=>{function l(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?r(!1):o(e))}return i.addEventListener("mousedown",l),()=>{i.addEventListener("mousedown",l)}}),[e,t,n,r])}function qf(){const e=(0,u.useContext)(mk);return(0,Ps.Z)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}var Kf=n(44675);function Yf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:r,className:o,wrapperProps:i={},isAligned:l}=(0,u.useContext)(Jf),{index:a,mode:s,name:c,blockApiVersion:d,blockTitle:p,isPartOfSelection:m,adjustScrolling:h,enableAnimation:f}=(0,b.Z)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:o,isTyping:i,getGlobalBlockCount:l,isBlockSelected:a,isBlockMultiSelected:s,isAncestorMultiSelected:c,isFirstMultiSelectedBlock:u}=e(rs),d=a(r),p=s(r)||c(r),m=o(r),h=He(m);return{index:t(r),mode:n(r),name:m,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:d||p,adjustScrolling:d||u(r),enableAnimation:!i()&&l()<=200}}),[r]),v=(0,w.sprintf)((0,w.__)("Block: %s"),p),y="html"!==s||t?"":"-visual",_=(0,sd.Z)([e.ref,Of(r),Ms(r),Wf(r),$f(r),Gf(r),jf(),qf(),kf({isSelected:m,adjustScrolling:h,enableAnimation:f,triggerAnimationOnChange:a}),(0,Md.Z)({isDisabled:!n})]),k=as();return d<2&&r===k.clientId&&void 0!==Kf&&Kf.env,{...i,...e,ref:_,id:`block-${r}${y}`,tabIndex:0,role:"document","aria-label":v,"data-block":r,"data-type":c,"data-title":p,className:g()(g()("block-editor-block-list__block",{"wp-block":!l}),o,e.className,i.className,Zf(r),zf(r),Hf(r),Vf(r)),style:{...i.style,...e.style}}}Yf.save=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{blockType:t,attributes:n}=tn;return(0,_e.O)("blocks.getSaveContent.extraProps",{...e},t,n)};const Jf=(0,u.createContext)();function Xf(e){let{children:t,isHtml:n,...r}=e;return(0,u.createElement)("div",Yf(r,{__unstableIsHtml:n}),t)}const Qf=(0,ud.Z)(((e,t)=>{let{clientId:n,rootClientId:r}=t;const{isBlockSelected:o,getBlockMode:i,isSelectionEnabled:l,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(rs),d=s(n),p=o(n),m=a(r),h=c(n,r),f=u(n,r),{name:g,attributes:v,isValid:b}=d||{};return{mode:i(n),isSelectionEnabled:l(),isLocked:!!m,canRemove:h,canMove:f,block:d,name:g,attributes:v,isValid:b,isSelected:p}})),eg=(0,dd.Z)(((e,t,n)=>{let{select:r}=n;const{updateBlockAttributes:o,insertBlocks:i,mergeBlocks:l,replaceBlocks:a,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c}=e(rs);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=r(rs),i=n(),{clientId:l}=t,a=i.length?i:[l];o(a,e)},onInsertBlocks(e,n){const{rootClientId:r}=t;i(e,n,r)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:o}=t,{getBlockIndex:l}=r(rs),a=l(n);i(e,a+1,o)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:o,getNextBlockClientId:i}=r(rs);if(e){const e=i(n);e&&l(n,e)}else{const e=o(n);e&&l(e,n)}},onReplace(e,n,r){e.length&&!ct(e[e.length-1])&&c(),a([t.clientId],e,n,r)},toggleSelection(e){s(e)}}}));var tg=(0,pd.Z)(md.Z,Qf,eg,(0,hd.Z)((e=>{let{block:t}=e;return!!t})),(0,cd.Z)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:r,isLocked:o,canRemove:i,clientId:l,isSelected:a,isSelectionEnabled:s,className:c,name:d,isValid:p,attributes:m,wrapperProps:h,setAttributes:f,onReplace:v,onInsertBlocksAfter:_,onMerge:k,toggleSelection:w}=e;const x=(0,b.Z)((e=>{const{getSettings:t}=e(rs);return t().supportsLayout}),[]),{removeBlock:C}=(0,y.Z)(rs),E=(0,u.useCallback)((()=>C(l)),[l]);let S=(0,u.createElement)(_d,{name:d,isSelected:a,attributes:m,setAttributes:f,insertBlocksAfter:o?void 0:_,onReplace:i?v:void 0,onRemove:i?E:void 0,mergeBlocks:i?k:void 0,clientId:l,isSelectionEnabled:s,toggleSelection:w});const I=He(d);null!=I&&I.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=g()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(h,I.getEditWrapperProps(m)));const T=h&&!!h["data-align"]&&!x;let N;if(T&&(S=(0,u.createElement)("div",{className:"wp-block","data-align":h["data-align"]},S)),p)N="html"===r?(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{display:"none"}},S),(0,u.createElement)(Xf,{isHtml:!0},(0,u.createElement)(Rd,{clientId:l}))):(null==I?void 0:I.apiVersion)>1?S:(0,u.createElement)(Xf,h,S);else{const e=n?Xt(n):rn(I,m);N=(0,u.createElement)(Xf,{className:"has-warning"},(0,u.createElement)(Nd,{clientId:l}),(0,u.createElement)(Kt.Z,null,Se(e)))}const B={clientId:l,className:null!==(t=h)&&void 0!==t&&t["data-align"]&&x?g()(c,`align${h["data-align"]}`):c,wrapperProps:(0,H.omit)(h,["data-align"]),isAligned:T},A=(0,u.useMemo)((()=>B),Object.values(B));return(0,u.createElement)(Jf.Provider,{value:A},(0,u.createElement)(Pd,{fallback:(0,u.createElement)(Xf,{className:"has-warning"},(0,u.createElement)(Ad,null))},N))})),ng=n(17921),rg=n(96097),og=n(34380),ig=n(2637),lg=n(72007),ag=n(78853);const sg=[(0,lg.Z)((0,w.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,u.createElement)("kbd",null)}),(0,lg.Z)((0,w.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,lg.Z)((0,w.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,w.__)("Drag files into the editor to automatically insert media blocks."),(0,w.__)("Change a block's type by pressing the block icon on the toolbar.")];var cg=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*sg.length));return(0,u.createElement)(ag.Z,null,sg[e])},ug=n(3610),dg=n(1779),pg=(0,u.memo)((function(e){var t;let{icon:n,showColors:r=!1,className:o}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:dg.Z});const i=(0,u.createElement)(ug.Z,{icon:n&&n.src?n.src:n}),l=r?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,u.createElement)("span",{style:l,className:g()("block-editor-block-icon",o,{"has-colors":r})},i)})),mg=function(e){let{title:t,icon:n,description:r,blockType:o}=e;return o&&((0,Wo.Z)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:r}=o)),(0,u.createElement)("div",{className:"block-editor-block-card"},(0,u.createElement)(pg,{icon:n,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-block-card__content"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,u.createElement)("span",{className:"block-editor-block-card__description"},r)))},hg=n(9974),fg=n(81631),gg=n(85559),vg=(0,yo.o)((e=>(0,hg.Z)((t=>{let{useSubRegistry:n=!0,registry:r,...o}=t;if(!n)return(0,u.createElement)(e,(0,bo.Z)({registry:r},o));const[i,l]=(0,u.useState)(null);return(0,u.useEffect)((()=>{const e=(0,fg.p)({},r);e.registerStore(ts,ns),l(e)}),[r]),i?(0,u.createElement)(gg.ZP,{value:i},(0,u.createElement)(e,(0,bo.Z)({registry:i},o))):null}))),"withRegistryProvider"),bg=n(78869);const yg=()=>{};function _g(e){let{clientId:t=null,value:n,selection:r,onChange:o=yg,onInput:i=yg}=e;const l=(0,bg.Z)(),{resetBlocks:a,resetSelection:s,replaceInnerBlocks:c,setHasControlledInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:p}=l.dispatch(rs),{getBlockName:m,getBlocks:h}=l.select(rs),f=(0,b.Z)((e=>!t||e(rs).areInnerBlocksControlled(t)),[t]),g=(0,u.useRef)({incoming:null,outgoing:[]}),v=(0,u.useRef)(!1),y=()=>{n&&(p(),t?l.batch((()=>{d(t,!0);const e=n.map((e=>Xe(e)));v.current&&(g.current.incoming=e),p(),c(t,e)})):(v.current&&(g.current.incoming=n),a(n)))},_=(0,u.useRef)(i),k=(0,u.useRef)(o);(0,u.useEffect)((()=>{_.current=i,k.current=o}),[i,o]),(0,u.useEffect)((()=>{g.current.outgoing.includes(n)?(0,H.last)(g.current.outgoing)===n&&(g.current.outgoing=[]):h(t)!==n&&(g.current.outgoing=[],y(),r&&s(r.selectionStart,r.selectionEnd,r.initialPosition))}),[n,t]),(0,u.useEffect)((()=>{f||(g.current.outgoing=[],y())}),[f]),(0,u.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:r,isLastBlockChangePersistent:o,__unstableIsLastBlockChangeIgnored:i,areInnerBlocksControlled:a}=l.select(rs);let s=h(t),c=o(),u=!1;v.current=!0;const d=l.subscribe((()=>{if(null!==t&&null===m(t))return;if(t&&!a(t))return;const l=o(),d=h(t),p=d!==s;if(s=d,p&&(g.current.incoming||i()))return g.current.incoming=null,void(c=l);(p||u&&!p&&l&&!c)&&(c=l,g.current.outgoing.push(s),(c?k.current:_.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:r()}})),u=p}));return()=>d()}),[l,t])}var kg=vg((function(e){const{children:t,settings:n}=e,{updateSettings:r}=(0,y.Z)(rs);return(0,u.useEffect)((()=>{r(n)}),[n]),_g(e),(0,u.createElement)(Rs,null,t)})),wg=n(90836);function xg(e){let{onClick:t}=e;return(0,u.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,u.createElement)(wg.Z,null,(0,u.createElement)(fk,null)))}var Cg=n(15640);function Eg(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,b.Z)(rs),{clearSelectedBlock:n}=(0,y.Z)(rs);return(0,Ps.Z)((r=>{function o(o){(e()||t())&&o.target===r&&n()}return r.addEventListener("mousedown",o),()=>{r.removeEventListener("mousedown",o)}}),[e,t,n])}function Sg(e){return(0,u.createElement)("div",(0,bo.Z)({ref:Eg()},e))}function Ig(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:r,getSelectedBlockClientId:o,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:l}=e(rs);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:r(),selectedBlockClientId:o(),initialPosition:i(),isFullSelection:l()}}function Tg(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:r,selectedBlockClientId:o,isFullSelection:i}=(0,b.Z)(Ig,[]);return(0,Ps.Z)((o=>{const{ownerDocument:l}=o,{defaultView:a}=l;if(null==e)return;if(!r||t)return;const{length:s}=n;s<2||i&&(o.contentEditable=!0,a.getSelection().removeAllRanges(),o.focus())}),[r,t,n,o,e,i])}function Ng(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map((e=>{let{top:t}=e;return t})));return Math.max(...t.map((e=>{let{bottom:t}=e;return t})))-n}function Bg(e){if(!e.collapsed){const t=Array.from(e.getClientRects());if(1===t.length)return t[0];const n=t.filter((e=>{let{width:t}=e;return t>1}));if(0===n.length)return e.getBoundingClientRect();if(1===n.length)return n[0];let{top:r,bottom:o,left:i,right:l}=n[0];for(const{top:e,bottom:t,left:a,right:s}of n)e<r&&(r=e),t>o&&(o=t),a<i&&(i=a),s>l&&(l=s);return new window.DOMRect(i,r,l-i,o-r)}const{startContainer:t}=e,{ownerDocument:n}=t;if("BR"===t.nodeName){const{parentNode:r}=t;(0,Ce.c)(r,"parentNode");const o=Array.from(r.childNodes).indexOf(t);(0,Ce.c)(n,"ownerDocument"),(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,Ce.c)(n,"ownerDocument");const t=n.createTextNode("​");(e=e.cloneRange()).insertNode(t),o=e.getClientRects()[0],(0,Ce.c)(t.parentNode,"padNode.parentNode"),t.parentNode.removeChild(t)}return o}function Ag(e){const{anchorNode:t,focusNode:n,anchorOffset:r,focusOffset:o}=e;(0,Ce.c)(t,"anchorNode"),(0,Ce.c)(n,"focusNode");const i=t.compareDocumentPosition(n);return!(i&t.DOCUMENT_POSITION_PRECEDING)&&(!!(i&t.DOCUMENT_POSITION_FOLLOWING)||0!==i||r<=o)}function Lg(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Cf(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;(0,Ce.c)(o,"defaultView");const i=o.getSelection();if(!i||!i.rangeCount)return!1;const l=i.getRangeAt(0),a=l.cloneRange(),s=Ag(i),c=i.isCollapsed;c||a.collapse(!s);const u=Bg(a),d=Bg(l);if(!u||!d)return!1;const p=Ng(l);if(!c&&p&&p>u.height&&s===t)return!1;const m=Tf(e)?!t:t,h=e.getBoundingClientRect(),f=m?h.left+1:h.right-1,g=t?h.top+1:h.bottom-1,v=If(r,f,g,e);if(!v)return!1;const b=Bg(v);if(!b)return!1;const y=t?"top":"bottom",_=m?"left":"right",k=b[y]-d[y],w=b[_]-u[_],x=Math.abs(k)<=1,C=Math.abs(w)<=1;return n?x:x&&C}function Pg(e,t){return Lg(e,t,!0)}function Dg(e,t){return Lg(e,t)}function Rg(e,t,n,r){let o,i=wf.T_.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),i.find((function(e){if(!wf.T_.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 Mg(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:r,getNextBlockClientId:o,getSettings:i,hasMultiSelection:l,__unstableIsFullySelected:a}=(0,b.Z)(rs),{selectBlock:s}=(0,y.Z)(rs);return(0,Ps.Z)((c=>{let u;function d(){u=null}function p(d){const{keyCode:p,target:m}=d,h=p===Uf.UP,f=p===Uf.DOWN,g=p===Uf.LEFT,v=p===Uf.RIGHT,b=h||g,y=g||v,_=h||f,k=y||_,w=d.shiftKey,x=w||d.ctrlKey||d.altKey||d.metaKey,C=_?Pg:Dg,{ownerDocument:E}=c,{defaultView:S}=E;if(l()){if(!a())return;if(d.defaultPrevented)return;if(!k)return;if(w)return;return d.preventDefault(),void(b?s(t()):s(n(),-1))}if(_?u||(u=function(e){const t=e.getSelection();(0,Ce.c)(t,"selection");const n=t.rangeCount?t.getRangeAt(0):null;return n?Bg(n):null}(S)):u=null,d.defaultPrevented)return;if(!k)return;if(!function(e,t,n){if((t===Uf.UP||t===Uf.DOWN)&&!n)return!0;const{tagName:r}=e;return"INPUT"===r?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==r}(m,p,x))return;const I=Tf(m)?!b:b,{keepCaretInsideBlock:T}=i(),N=e();if(w){const e=n(),t=r(e||N),i=o(e||N);(b&&t||!b&&i)&&function(e,t){const n=Rg(e,t,c);return!(n&&(r=e,o=n,r.closest(Lf)===o.closest(Lf)));var r,o}(m,b)&&C(m,b)&&(c.contentEditable=!0,c.focus())}else if(_&&Pg(m,b)&&!T){const e=Rg(m,b,c,!0);e&&(function(e,t,n){Bf(e,t,null==n?void 0:n.left)}(e,b,u),d.preventDefault())}else y&&S.getSelection().isCollapsed&&Dg(m,I)&&!T&&(Af(Rg(m,I,c),b),d.preventDefault())}return c.addEventListener("mousedown",d),c.addEventListener("keydown",p),()=>{c.removeEventListener("mousedown",d),c.removeEventListener("keydown",p)}}),[])}function Og(e,t,n){let r=t;do{if(e===r)return!0;r=r[n]}while(r);return!1}var Fg=n(353);function jg(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,b.Z)(rs),{multiSelect:r}=(0,y.Z)(rs),o=(0,Fg.sx)();return(0,Ps.Z)((i=>{function l(i){if(!o("core/block-editor/select-all",i))return;const l=t();if(l.length<2&&!function(e){if(Cf(e))return 0===e.selectionStart&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const{ownerDocument:t}=e,{defaultView:n}=t;(0,Ce.c)(n,"defaultView");const r=n.getSelection();(0,Ce.c)(r,"selection");const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:i,endContainer:l,startOffset:a,endOffset:s}=o;if(i===e&&l===e&&0===a&&s===e.childNodes.length)return!0;const c=e.lastChild;(0,Ce.c)(c,"lastChild");const u=l.nodeType===l.TEXT_NODE?l.data.length:l.childNodes.length;return Og(i,e,"firstChild")&&Og(l,e,"lastChild")&&0===a&&s===u}(i.target))return;const[a]=l,s=n(a);let c=e(s);l.length===c.length&&(c=e(n(s)));const u=(0,H.first)(c),d=(0,H.last)(c);u!==d&&(r(u,d),i.preventDefault())}return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}}),[])}function Zg(e,t){e.contentEditable=t,t&&e.focus()}function zg(){const{startMultiSelect:e,stopMultiSelect:t}=(0,y.Z)(rs),{isSelectionEnabled:n,hasMultiSelection:r}=(0,b.Z)(rs);return(0,Ps.Z)((o=>{const{ownerDocument:i}=o,{defaultView:l}=i;let a,s;function c(){t(),l.removeEventListener("mouseup",c),s=l.requestAnimationFrame((()=>{if(r())return;Zg(o,!1);const e=l.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function u(t){let{buttons:r,target:s}=t;1===r&&s.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),l.addEventListener("mouseup",c),Zg(o,!0))}return o.addEventListener("mouseout",u),()=>{o.removeEventListener("mouseout",u),l.removeEventListener("mouseup",c),l.cancelAnimationFrame(s)}}),[e,t,n,r])}function Hg(e,t){e.contentEditable=t,t&&e.focus()}function Vg(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,y.Z)(rs),{getBlockParents:r,getBlockSelectionStart:o}=(0,b.Z)(rs);return(0,Ps.Z)((n=>{const{ownerDocument:i}=n,{defaultView:l}=i;function a(i){const a=l.getSelection();if(!a.rangeCount)return;const s=i.shiftKey&&"mouseup"===i.type;if(a.isCollapsed&&!s)return void Hg(n,!1);let c=Mf(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(a)),u=Mf(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(a));if(s){const e=o(),t=Mf(i.target),n=t!==u;(c===u&&a.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 Hg(n,!1)}function s(){i.addEventListener("selectionchange",a),l.addEventListener("mouseup",a)}function c(){i.removeEventListener("selectionchange",a),l.removeEventListener("mouseup",a)}function u(){c(),s()}return s(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,r])}function Wg(){const{selectBlock:e}=(0,y.Z)(rs),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:r}=(0,b.Z)(rs);return(0,Ps.Z)((o=>{function i(i){if(!t()||0!==i.button)return;const l=n(),a=Mf(i.target);i.shiftKey?l!==a&&(o.contentEditable=!0,o.focus()):r()&&e(a)}return o.addEventListener("mousedown",i),()=>{o.removeEventListener("mousedown",i)}}),[e,t,n,r])}function Ug(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:r}=(0,b.Z)(rs),{replaceBlocks:o,__unstableSplitSelection:i,removeBlocks:l,__unstableDeleteSelection:a,__unstableExpandSelection:s}=(0,y.Z)(rs);return(0,Ps.Z)((c=>{function u(e){var t;r()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function d(u){u.defaultPrevented||r()&&(u.keyCode===Uf.ENTER?(c.contentEditable=!1,u.preventDefault(),e()?o(t(),Ke(ze())):i()):u.keyCode===Uf.BACKSPACE||u.keyCode===Uf.DELETE?(c.contentEditable=!1,u.preventDefault(),e()?l(t()):n()?a(u.keyCode===Uf.DELETE):s()):1!==u.key.length||u.metaKey||u.ctrlKey||(c.contentEditable=!1,n()?a(u.keyCode===Uf.DELETE):(u.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){r()&&(c.contentEditable=!1,n()?a():(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 $g(){const[e,t,n]=function(){const e=(0,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),r=(0,u.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:i,getBlockCount:l}=(0,b.Z)(rs),{setNavigationMode:a}=(0,y.Z)(rs),s=(0,b.Z)((e=>e(rs).isNavigationMode()),[])?void 0:"0",c=(0,u.useRef)();function d(t){if(c.current)c.current=null;else if(o())e.current.focus();else if(i())r.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";wf.T_.tabbable[n](t.target).focus()}}const p=(0,u.createElement)("div",{ref:t,tabIndex:s,onFocus:d}),m=(0,u.createElement)("div",{ref:n,tabIndex:s,onFocus:d}),h=(0,Ps.Z)((s=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===Uf.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==Uf.TAB)return;const r=e.shiftKey,l=r?"findPrevious":"findNext";if(!o()&&!i())return void(e.target===s&&a(!0));if((Ef(e.target)||e.target.getAttribute("data-block")===i())&&Ef(wf.T_.tabbable[l](e.target)))return;const u=r?t:n;c.current=!0,u.current.focus({preventScroll:!0})}function d(e){r.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==l()||s.focus()}function p(r){var o;if(r.keyCode!==Uf.TAB)return;if("region"===(null===(o=r.target)||void 0===o?void 0:o.getAttribute("role")))return;if(e.current===r.target)return;const i=r.shiftKey?"findPrevious":"findNext",l=wf.T_.tabbable[i](r.target);l!==t.current&&l!==n.current||(r.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:h}=m;return h.addEventListener("keydown",p),s.addEventListener("keydown",u),s.addEventListener("focusout",d),()=>{h.removeEventListener("keydown",p),s.removeEventListener("keydown",u),s.removeEventListener("focusout",d)}}),[]);return[p,(0,sd.Z)([e,h]),m]}(),r=(0,b.Z)((e=>e(rs).hasMultiSelection()),[]);return[e,(0,sd.Z)([t,Ug(),zg(),Vg(),Wg(),Tg(),jg(),Mg(),(0,Ps.Z)((e=>{if(e.tabIndex=-1,e.contentEditable=r,r)return e.setAttribute("aria-label",(0,w.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[r])]),n]}var Gg=(0,u.forwardRef)((function(e,t){let{children:n,...r}=e;const[o,i,l]=$g();return(0,u.createElement)(u.Fragment,null,o,(0,u.createElement)("div",(0,bo.Z)({},r,{ref:(0,sd.Z)([i,t]),className:g()(r.className,"block-editor-writing-flow")}),n),l)}));const qg="editor-styles-wrapper";function Kg(e){return(0,u.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var Yg=(0,u.forwardRef)((function(e,t){let{contentRef:n,children:r,head:o,tabIndex:i=0,assets:l,...a}=e;const[,s]=(0,u.useReducer)((()=>({}))),[c,p]=(0,u.useState)(),[m,h]=(0,u.useState)([]),f=Kg(null==l?void 0:l.styles),v=Kg(null==l?void 0:l.scripts),b=Eg(),[y,_,k]=$g(),x=(0,Ps.Z)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:r,documentElement:o}=t;return("interactive"===r||"complete"===r)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function r(e){const r=Object.getPrototypeOf(e).constructor.name,o=window[r],i={};for(const t in e)i[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();i.clientX+=e.left,i.clientY+=e.top}const l=new o(e.type,i);!n.dispatchEvent(l)&&e.preventDefault()}const o=["dragover"];for(const t of o)e.addEventListener(t,r)}(t),p(t),b(o),h(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,o.removeChild(t.head),o.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),C=(0,Ps.Z)((e=>{v.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:r}=t;return new Promise(((t,o)=>{const i=e.ownerDocument.createElement("script");i.id=n,r?(i.src=r,i.onload=()=>t(),i.onerror=()=>o()):t(),e.appendChild(i)}))}(e,n)))),Promise.resolve()).finally((()=>{s()}))}),[]),E=(0,sd.Z)([n,b,_]),S=(0,Ps.Z)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:r}=t;if(r&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:r,cssRules:o}=t;return r?e(o):n&&(n.includes(`.${qg}`)||n.includes(".wp-block"))}))}(r)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),r=document.getElementById(t);r&&e.appendChild(r.cloneNode(!0))}}))}),[]);return o=(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",null,"body{margin:0}"),f.map((e=>{let{tagName:t,href:n,id:r,rel:o,media:i,textContent:l}=e;const a=t.toLowerCase();return"style"===a?(0,u.createElement)(a,{id:r,key:r},l):(0,u.createElement)(a,{href:n,id:r,rel:o,media:i,key:r})})),o),(0,u.createElement)(u.Fragment,null,i>=0&&y,(0,u.createElement)("iframe",(0,bo.Z)({},a,{ref:(0,sd.Z)([t,x]),tabIndex:i,srcDoc:"<!doctype html>",title:(0,w.__)("Editor canvas")}),c&&(0,d.createPortal)((0,u.createElement)(u.Fragment,null,(0,u.createElement)("head",{ref:C},o),(0,u.createElement)("body",{ref:E,className:g()(qg,...m)},(0,u.createElement)("div",{style:{display:"none"},ref:S}),(0,u.createElement)(_o.Z,{document:c},r))),c.documentElement)),i>=0&&k)})),Jg=n(73645),Xg=n.n(Jg);const Qg=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function ev(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 l(e),m(),t}}function l(e){this.start=e,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;const a=[];function s(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;a.push(i)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),h(n);e.length&&"}"!==e.charAt(0)&&(t=C()||E());)!1!==t&&(n.push(t),h(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 m(){p(/^\s*/)}function h(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 s("End of comment missing");const l=e.slice(2,n-2);return r+=2,o(l),e=e.slice(n),r+=2,t({type:"comment",comment:l})}function g(){const e=p(/^([^{]+)/);if(e)return tv(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 v(){const e=i();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=tv(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),r=e({type:"declaration",property:t.replace(Qg,""),value:n?tv(n[0]).replace(Qg,""):""});return p(/^[;\s]*/),r}function b(){const e=[];if(!c())return s("missing '{'");let t;for(h(e);t=v();)!1!==t&&(e.push(t),h(e));return u()?e:s("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:b()})}const _=x("import"),k=x("charset"),w=x("namespace");function x(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 s("@keyframes missing name");const r=t[1];if(!c())return s("@keyframes missing '{'");let o,l=h();for(;o=y();)l.push(o),l=l.concat(h());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:l}):s("@keyframes missing '}'")}()||function(){const e=i(),t=p(/^@media *([^{]+)/);if(!t)return;const n=tv(t[1]);if(!c())return s("@media missing '{'");const r=h().concat(d());return u()?e({type:"media",media:n,rules:r}):s("@media missing '}'")}()||function(){const e=i(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:tv(t[1]),media:tv(t[2])})}()||function(){const e=i(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=tv(t[1]);if(!c())return s("@supports missing '{'");const r=h().concat(d());return u()?e({type:"supports",supports:n,rules:r}):s("@supports missing '}'")}()||_()||k()||w()||function(){const e=i(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=tv(t[1]),r=tv(t[2]);if(!c())return s("@document missing '{'");const o=h().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):s("@document missing '}'")}()||function(){const e=i();if(!p(/^@page */))return;const t=g()||[];if(!c())return s("@page missing '{'");let n,r=h();for(;n=v();)r.push(n),r=r.concat(h());return u()?e({type:"page",selectors:t,declarations:r}):s("@page missing '}'")}()||function(){const e=i();if(!p(/^@host\s*/))return;if(!c())return s("@host missing '{'");const t=h().concat(d());return u()?e({type:"host",rules:t}):s("@host missing '}'")}()||function(){const e=i();if(!p(/^@font-face\s*/))return;if(!c())return s("@font-face missing '{'");let t,n=h();for(;t=v();)n.push(t),n=n.concat(h());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function E(){const e=i(),t=g();return t?(h(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return nv(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function tv(e){return e?e.replace(/^\s+|\s+$/g,""):""}function nv(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){nv(e,r)})):n&&"object"==typeof n&&nv(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var rv=n(89118),ov=n.n(rv),iv=lv;function lv(e){this.options=e||{}}lv.prototype.emit=function(e){return e},lv.prototype.visit=function(e){return this[e.type](e)},lv.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 av=sv;function sv(e){iv.call(this,e)}ov()(sv,iv),sv.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},sv.prototype.comment=function(e){return this.emit("",e.position)},sv.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},sv.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},sv.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("}")},sv.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},sv.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},sv.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},sv.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},sv.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},sv.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("}")},sv.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},sv.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},sv.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},sv.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("}"):""},sv.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var cv=uv;function uv(e){e=e||{},iv.call(this,e),this.indentation=e.indent}ov()(uv,iv),uv.prototype.compile=function(e){return this.stylesheet(e)},uv.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},uv.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},uv.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},uv.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}")},uv.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}")},uv.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},uv.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},uv.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}")},uv.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)+"}")},uv.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")},uv.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}")},uv.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}")},uv.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}")},uv.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},uv.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()+"}"):""},uv.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},uv.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||"  ")};var dv=function(e,t){try{const o=ev(e),i=Xg().map(o,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=i,((r=r||{}).compress?new av(r):new cv(r)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,r};function pv(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 mv(e,t){return new URL(e,t).toString()}var hv=e=>t=>{if("declaration"===t.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]};pv(e)&&r.push(e)}return r}(t.value).map((o=e,e=>({...e,newUrl:"url("+e.before+e.quote+mv(e.value,o)+e.quote+e.after+")"})));return{...t,value:(n=t.value,r=i,r.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,r,o;return t};const fv=/^(body|html|:root).*$/;var gv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(fv)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},vv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,H.map)(e,(e=>{let{css:n,baseURL:r}=e;const o=[];return t&&o.push(gv(t)),r&&o.push(hv(r)),o.length?dv(n,(0,pd.Z)(o)):n}))};const bv=".editor-styles-wrapper";function yv(e){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:r}=t,o=t.querySelector(bv);let i;if(o)i=n.getComputedStyle(o,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),i=n.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const l=(0,ke.Vi)(i);l.luminance()>.5||0===l.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e])}function _v(e){let{styles:t}=e;const n=(0,u.useMemo)((()=>vv(t,bv)),[t]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",{ref:yv(t)}),n.map(((e,t)=>(0,u.createElement)("style",{key:t},e))))}function kv(e){let{selector:t,id:n}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,u.createElement)("style",null,r)}function wv(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,u.createElement)("style",null,n)}function xv(e){let{id:t,colors:n}=e;const r=function(){const e={r:[],g:[],b:[],a:[]};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>{const n=(0,ke.Vi)(t).toRgb();e.r.push(n.r/255),e.g.push(n.g/255),e.b.push(n.b/255),e.a.push(n.a)})),e}(n);return(0,u.createElement)(zo.Wj,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,u.createElement)("defs",null,(0,u.createElement)("filter",{id:t},(0,u.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,u.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,u.createElement)("feFuncR",{type:"table",tableValues:r.r.join(" ")}),(0,u.createElement)("feFuncG",{type:"table",tableValues:r.g.join(" ")}),(0,u.createElement)("feFuncB",{type:"table",tableValues:r.b.join(" ")}),(0,u.createElement)("feFuncA",{type:"table",tableValues:r.a.join(" ")})),(0,u.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function Cv(e){let{preset:t}=e;return(0,u.createElement)(xv,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Ev;(0,ke.l7)([we.Z,xe.Z]);const Sv=2e3;var Iv=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:r}=e;const[o,{width:i}]=(0,Cg.Z)(),[l,{height:a}]=(0,Cg.Z)(),{styles:s,assets:c,duotone:d}=(0,b.Z)((e=>{var t,n;const r=e(rs).getSettings();return{styles:r.styles,assets:r.__unstableResolvedAssets,duotone:null===(t=r.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),p=(0,u.useMemo)((()=>s?[...s,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:s),[s]),m=(0,u.useMemo)((()=>{var e,t;return[...null!==(e=null==d?void 0:d.default)&&void 0!==e?e:[],...null!==(t=null==d?void 0:d.theme)&&void 0!==t?t:[]]}),[d]);Ev=Ev||(0,md.Z)(fk);const h=i/t;return(0,u.createElement)("div",{className:"block-editor-block-preview__container"},o,(0,u.createElement)(wg.Z,{className:"block-editor-block-preview__content",style:{transform:`scale(${h})`,height:a*h,maxHeight:a>Sv?Sv*h:void 0,minHeight:r}},(0,u.createElement)(Yg,{head:(0,u.createElement)(_v,{styles:p}),assets:c,contentRef:(0,Ps.Z)((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.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:a,pointerEvents:"none",maxHeight:Sv,minHeight:0!==h&&h<1&&r?r/h:r}},l,m.map((e=>(0,u.createElement)(Cv,{preset:e,key:e.slug}))),(0,u.createElement)(Ev,{renderAppender:!1}))))},Tv=(0,u.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:r=1200,__experimentalLive:o=!1,__experimentalOnClick:i,__experimentalMinHeight:l}=e;const a=(0,b.Z)((e=>e(rs).getSettings()),[]),s=(0,u.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),c=(0,u.useMemo)((()=>(0,H.castArray)(t)),[t]);return t&&0!==t.length?(0,u.createElement)(kg,{value:c,settings:s},o?(0,u.createElement)(xg,{onClick:i}):(0,u.createElement)(Iv,{viewportWidth:r,__experimentalPadding:n,__experimentalMinHeight:l})):null})),Nv=function(e){var t;let{item:n}=e;const{name:r,title:o,icon:i,description:l,initialAttributes:a,example:s}=n,c=$e(n);return(0,u.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,u.createElement)("div",{className:"block-editor-inserter__preview"},c||s?(0,u.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,u.createElement)(Tv,{__experimentalPadding:16,viewportWidth:null!==(t=null==s?void 0:s.viewportWidth)&&void 0!==t?t:500,blocks:s?at(n.name,{attributes:{...s.attributes,...a},innerBlocks:s.innerBlocks}):Ke(r,a)})):(0,u.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,w.__)("No Preview Available."))),!c&&(0,u.createElement)(mg,{title:o,icon:i,description:l}))},Bv=n(27329);function Av(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}var Lv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{step:1};const{step:n=1}=t,[r,o]=(0,u.useState)([]);return(0,u.useEffect)((()=>{let t=Av(e,r);t.length<n&&(t=t.concat(e.slice(t.length,n))),o(t);let i=t.length;const l=(0,Bv.j)(),a=()=>{e.length<=i||(o((t=>[...t,...e.slice(i,i+n)])),i+=n,l.add({},a))};return l.add({},a),()=>l.reset()}),[e]),r},Pv=n(37892),Dv=n(88565),Rv=(0,u.createContext)(),Mv=(0,u.forwardRef)((function(e,t){let{isFirst:n,as:r,children:o,...i}=e;const l=(0,u.useContext)(Rv);return(0,u.createElement)(Dv.A,(0,bo.Z)({ref:t,state:l,role:"option",focusable:!0},i),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return r?(0,u.createElement)(r,t,o):"function"==typeof o?o(t):(0,u.createElement)(Ss.Z,t,o)}))})),Ov=n(93066),Fv=(0,u.createElement)(zo.Wj,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function jv(e){let{count:t,icon:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,u.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,u.createElement)(Cs.Z,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,u.createElement)(Es.Z,null,n?(0,u.createElement)(pg,{icon:n}):(0,w.sprintf)((0,w._n)("%d block","%d blocks",t),t)),(0,u.createElement)(Es.Z,null,(0,u.createElement)(pg,{icon:Fv})))))}var Zv=e=>{let{isEnabled:t,blocks:n,icon:r,children:o}=e;const i={type:"inserter",blocks:n};return(0,u.createElement)(Ov.Z,{__experimentalTransferDataType:"wp-blocks",transferData:i,__experimentalDragComponent:(0,u.createElement)(jv,{count:n.length,icon:r})},(e=>{let{onDraggableStart:n,onDraggableEnd:r}=e;return o({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?r:void 0})}))};function zv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var Hv=(0,u.memo)((function(e){let{className:t,isFirst:n,item:r,onSelect:o,onHover:i,isDraggable:l,...a}=e;const s=(0,u.useRef)(!1),c=r.icon?{backgroundColor:r.icon.background,color:r.icon.foreground}:{},d=(0,u.useMemo)((()=>[Ke(r.name,r.initialAttributes,Ye(r.innerBlocks))]),[r.name,r.initialAttributes,r.initialAttributes]);return(0,u.createElement)(Zv,{isEnabled:l&&!r.disabled,blocks:d,icon:r.icon},(e=>{let{draggable:l,onDragStart:d,onDragEnd:p}=e;return(0,u.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:l,onDragStart:e=>{s.current=!0,d&&(i(null),d(e))},onDragEnd:e=>{s.current=!1,p&&p(e)}},(0,u.createElement)(Mv,(0,bo.Z)({isFirst:n,className:g()("block-editor-block-types-list__item",t),disabled:r.isDisabled,onClick:e=>{e.preventDefault(),o(r,zv()?e.metaKey:e.ctrlKey),i(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Uf.ENTER&&(e.preventDefault(),o(r,zv()?e.metaKey:e.ctrlKey),i(null))},onFocus:()=>{s.current||i(r)},onMouseEnter:()=>{s.current||i(r)},onMouseLeave:()=>i(null),onBlur:()=>i(null)},a),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:c},(0,u.createElement)(pg,{icon:r.icon,showColors:!0})),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,u.createElement)(Pv.Z,{numberOfLines:3},r.title))))}))})),Vv=(0,u.forwardRef)((function(e,t){const[n,r]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,$l.D)((0,w.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,u.createElement)("div",(0,bo.Z)({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&r(!1)}},e))})),Wv=n(17750),Uv=(0,u.forwardRef)((function(e,t){const n=(0,u.useContext)(Rv);return(0,u.createElement)(Wv.E,(0,bo.Z)({state:n,role:"presentation",ref:t},e))})),$v=function(e){let{items:t=[],onSelect:n,onHover:r=(()=>{}),children:o,label:i,isDraggable:l=!0}=e;return(0,u.createElement)(Vv,{className:"block-editor-block-types-list","aria-label":i},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}(t).map(((e,t)=>(0,u.createElement)(Uv,{key:t},e.map(((e,o)=>(0,u.createElement)(Hv,{key:e.id,item:e,className:en(e.id),onSelect:n,onHover:r,isDraggable:l,isFirst:0===t&&0===o})))))),o)},Gv=function(e){let{title:t,icon:n,children:r}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,u.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,u.createElement)(ug.Z,{icon:n})),(0,u.createElement)("div",{className:"block-editor-inserter__panel-content"},r))},qv=(e,t)=>{const{categories:n,collections:r,items:o}=(0,b.Z)((t=>{const{getInserterItems:n}=t(rs),{getCategories:r,getCollections:o}=t(Rt);return{categories:r(),collections:o(),items:n(e)}}),[e]);return[o,n,r,(0,u.useCallback)(((e,n)=>{let{name:r,initialAttributes:o,innerBlocks:i}=e;const l=Ke(r,o,Ye(i));t(l,void 0,n)}),[t])]},Kv=n(15596),Yv=function(e){let{children:t}=e;const n=(0,Kv.u)({shift:!0,wrap:"horizontal"});return(0,u.createElement)(Rv.Provider,{value:n},t)};const Jv=[];var Xv=function(e){let{rootClientId:t,onInsert:n,onHover:r,showMostUsedBlocks:o}=e;const[i,l,a,s]=qv(t,n),c=(0,u.useMemo)((()=>(0,H.orderBy)(i,["frecency"],["desc"]).slice(0,6)),[i]),d=(0,u.useMemo)((()=>i.filter((e=>!e.category))),[i]),p=(0,u.useMemo)((()=>(0,H.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,H.groupBy)(e,"category")))(i)),[i]),m=(0,u.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=i.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[i,a]);(0,u.useEffect)((()=>()=>r(null)),[]);const h=Lv(l),f=l.length===h.length,g=(0,u.useMemo)((()=>Object.entries(a)),[a]),v=Lv(f?g:Jv);return(0,u.createElement)(Yv,null,(0,u.createElement)("div",null,o&&!!c.length&&(0,u.createElement)(Gv,{title:(0,w._x)("Most used","blocks")},(0,u.createElement)($v,{items:c,onSelect:s,onHover:r,label:(0,w._x)("Most used","blocks")})),(0,H.map)(h,(e=>{const t=p[e.slug];return t&&t.length?(0,u.createElement)(Gv,{key:e.slug,title:e.title,icon:e.icon},(0,u.createElement)($v,{items:t,onSelect:s,onHover:r,label:e.title})):null})),f&&d.length>0&&(0,u.createElement)(Gv,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,w.__)("Uncategorized")},(0,u.createElement)($v,{items:d,onSelect:s,onHover:r,label:(0,w.__)("Uncategorized")})),(0,H.map)(v,(e=>{let[t,n]=e;const o=m[t];return o&&o.length?(0,u.createElement)(Gv,{key:t,title:n.title,icon:n.icon},(0,u.createElement)($v,{items:o,onSelect:s,onHover:r,label:n.title})):null}))))},Qv=n(97873),eb=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r,openPatternExplorer:o}=e;const i=(0,ad.Z)("medium","<"),l=g()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,u.createElement)(Cs.Z,{justify:"space-between",align:"start",gap:"4",className:l},(0,u.createElement)(Es.Z,{isBlock:!0},(0,u.createElement)(Qv.Z,{className:"block-editor-inserter__panel-dropdown",label:(0,w.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{r(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!i&&(0,u.createElement)(Es.Z,null,(0,u.createElement)(Ss.Z,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,w.__)("Explore all patterns"),onClick:()=>o()},(0,w._x)("Explore","Label for showing all block patterns"))))},tb=n(18439),nb=(e,t)=>{const{patternCategories:n,patterns:r}=(0,b.Z)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:r}=e(rs);return{patterns:n(t),patternCategories:r().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:o}=(0,y.Z)(tb.h),i=(0,u.useCallback)(((t,n)=>{e((0,H.map)(n,(e=>Xe(e))),t.name),o((0,w.sprintf)((0,w.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[r,n,i]},rb=n(73763);function ob(e){let{isDraggable:t,pattern:n,onClick:r,composite:o}=e;const{blocks:i,viewportWidth:l}=n,a=`block-editor-block-patterns-list__item-description-${(0,id.Z)(ob)}`;return(0,u.createElement)(Zv,{isEnabled:t,blocks:i},(e=>{let{draggable:t,onDragStart:s,onDragEnd:c}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?a:void 0,draggable:t,onDragStart:s,onDragEnd:c},(0,u.createElement)(Dv.A,(0,bo.Z)({role:"option",as:"div"},o,{className:"block-editor-block-patterns-list__item",onClick:()=>r(n,i)}),(0,u.createElement)(Tv,{blocks:i,viewportWidth:l}),(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,u.createElement)(og.Z,{id:a},n.description)))}))}function ib(){return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var lb=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:r,onClickPattern:o,orientation:i,label:l=(0,w.__)("Block Patterns")}=e;const a=(0,Kv.u)({orientation:i});return(0,u.createElement)(rb.b,(0,bo.Z)({},a,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":l}),n.map((e=>r.includes(e)?(0,u.createElement)(ob,{key:e.name,pattern:e,onClick:o,isDraggable:t,composite:a}):(0,u.createElement)(ib,{key:e.name}))))};function ab(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r}=e;const o="block-editor-block-patterns-explorer__sidebar";return(0,u.createElement)("div",{className:`${o}__categories-list`},n.map((e=>{let{name:n,label:i}=e;return(0,u.createElement)(Ss.Z,{key:n,label:i,className:`${o}__categories-list__item`,isPressed:t===n,onClick:()=>{r(n)}},i)})))}function sb(e){let{filterValue:t,setFilterValue:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,u.createElement)(ig.Z,{onChange:n,value:t,label:(0,w.__)("Search for patterns"),placeholder:(0,w.__)("Search")}))}var cb=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r,filterValue:o,setFilterValue:i}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,u.createElement)(sb,{filterValue:o,setFilterValue:i}),!o&&(0,u.createElement)(ab,{selectedCategory:t,patternCategories:n,onClickCategory:r}))},ub=n(92304),db=n(38692),pb=function(){return(0,u.createElement)("div",{className:"block-editor-inserter__no-results"},(0,u.createElement)(qc.Z,{className:"block-editor-inserter__no-results-icon",icon:dg.Z}),(0,u.createElement)("p",null,(0,w.__)("No results found.")))},mb=function(e){let{rootClientId:t="",insertionIndex:n,clientId:r,isAppender:o,onSelect:i,shouldFocusBlock:l=!0}=e;const{getSelectedBlock:a}=(0,b.Z)(rs),{destinationRootClientId:s,destinationIndex:c}=(0,b.Z)((e=>{const{getSelectedBlockClientId:i,getBlockRootClientId:l,getBlockIndex:a,getBlockOrder:s}=e(rs),c=i();let u,d=t;return void 0!==n?u=n:r?u=a(r):!o&&c?(d=l(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,r,o]),{replaceBlocks:d,insertBlocks:p,showInsertionPoint:m,hideInsertionPoint:h}=(0,y.Z)(rs),f=(0,u.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=a();!o&&r&&ct(r)?d(r.clientId,e,null,l||n?0:null,t):p(e,c,s,!0,l||n?0:null,t);const u=(0,w.sprintf)((0,w._n)("%d block added.","%d blocks added.",(0,H.castArray)(e).length),(0,H.castArray)(e).length);(0,$l.D)(u),i&&i()}),[o,a,d,p,s,c,i,l]),g=(0,u.useCallback)((e=>{e?m(s,c):h()}),[m,h,s,c]);return[s,f,g]};const hb=e=>e.name||"",fb=e=>e.title,gb=e=>e.description||"",vb=e=>e.keywords||[],bb=e=>e.category,yb=()=>null;function _b(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,H.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const kb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,H.words)(_b(e))},wb=(e,t)=>e.filter((e=>!kb(t).some((t=>t.includes(e))))),xb=(e,t,n,r)=>0===kb(r).length?e:Cb(e,r,{getCategory:e=>{var n;return null===(n=(0,H.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}}),Cb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=kb(t);if(0===r.length)return e;const o=e.map((e=>[e,Eb(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return o.sort(((e,t)=>{let[,n]=e,[,r]=t;return r-n})),o.map((e=>{let[t]=e;return t}))};function Eb(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:r=hb,getTitle:o=fb,getDescription:i=gb,getKeywords:l=vb,getCategory:a=bb,getCollection:s=yb}=n,c=r(e),u=o(e),d=i(e),p=l(e),m=a(e),h=s(e),f=_b(t),g=_b(u);let v=0;if(f===g)v+=30;else if(g.startsWith(f))v+=20;else{const e=[c,u,d,...p,m,h].join(" "),t=(0,H.words)(f);0===wb(t,e).length&&(v+=10)}return 0!==v&&c.startsWith("core/")&&(v+=c!==e.id?1:2),v}function Sb(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,u.createElement)(db.Z,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,w.sprintf)((0,w._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var Ib=function(e){let{filterValue:t,selectedCategory:n,patternCategories:r}=e;const o=(0,ub.Z)($l.D,500),[i,l]=mb({shouldFocusBlock:!0}),[a,,s]=nb(l,i),c=(0,u.useMemo)((()=>r.map((e=>e.name))),[r]),d=(0,u.useMemo)((()=>t?Cb(a,t):a.filter((e=>{var t,r;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!c.includes(e))):null===(r=e.categories)||void 0===r?void 0:r.includes(n)}))),[t,n,a]);(0,u.useEffect)((()=>{if(!t)return;const e=d.length,n=(0,w.sprintf)((0,w._n)("%d result found.","%d results found.",e),e);o(n)}),[t,o]);const p=Lv(d,{step:2}),m=!(null==d||!d.length);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},m&&(0,u.createElement)(Sb,{filterValue:t,filteredBlockPatternsLength:d.length}),(0,u.createElement)(Yv,null,!m&&(0,u.createElement)(pb,null),m&&(0,u.createElement)(lb,{shownPatterns:p,blockPatterns:d,onClickPattern:s,isDraggable:!1})))};function Tb(e){let{initialCategory:t,patternCategories:n}=e;const[r,o]=(0,u.useState)(""),[i,l]=(0,u.useState)(null==t?void 0:t.name);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,u.createElement)(cb,{selectedCategory:i,patternCategories:n,onClickCategory:l,filterValue:r,setFilterValue:o}),(0,u.createElement)(Ib,{filterValue:r,selectedCategory:i,patternCategories:n}))}var Nb=function(e){let{onModalClose:t,...n}=e;return(0,u.createElement)(kd.Z,{title:(0,w.__)("Patterns"),closeLabel:(0,w.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,u.createElement)(Tb,n))};function Bb(e){let{rootClientId:t,onInsert:n,selectedCategory:r,populatedCategories:o}=e;const[i,,l]=nb(n,t),a=(0,u.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=o.reduce(((e,t,n)=>{let{name:r}=t;return e[r]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[o]),s=(0,u.useMemo)((()=>i.filter((e=>{var t;return"uncategorized"===r.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(r.name)}))),[i,r]),c=(0,u.useMemo)((()=>s.sort(((e,t)=>a(e)-a(t)))),[s,a]),d=Lv(c);return s.length?(0,u.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,u.createElement)(lb,{shownPatterns:d,blockPatterns:s,onClickPattern:l,label:r.label,orientation:"vertical",isDraggable:!0})):null}var Ab=function(e){let{rootClientId:t,onInsert:n,onClickCategory:r,selectedCategory:o}=e;const[i,l]=(0,u.useState)(!1),[a,s]=nb(),c=(0,u.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>s.some((t=>t.name===e))))),[s]),d=(0,u.useMemo)((()=>{const e=s.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:r}=t;return[n,r].includes("featured")?"featured"===n?-1:1:0}));return a.some((e=>!c(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,w._x)("Uncategorized")}),e}),[a,s]),p=o||d[0];return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(eb,{selectedCategory:p,patternCategories:d,onClickCategory:r,openPatternExplorer:()=>l(!0)}),!i&&(0,u.createElement)(Bb,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),i&&(0,u.createElement)(Nb,{initialCategory:p,patternCategories:d,onModalClose:()=>l(!1)}))},Lb=n(95393);function Pb(e){let{onHover:t,onInsert:n,rootClientId:r}=e;const[o,,,i]=qv(r,n),l=(0,u.useMemo)((()=>o.filter((e=>{let{category:t}=e;return"reusable"===t}))),[o]);return 0===l.length?(0,u.createElement)(pb,null):(0,u.createElement)(Gv,{title:(0,w.__)("Reusable blocks")},(0,u.createElement)($v,{items:l,onSelect:i,onHover:t,label:(0,w.__)("Reusable blocks")}))}var Db=function(e){let{rootClientId:t,onInsert:n,onHover:r}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Pb,{onHover:r,onInsert:n,rootClientId:t}),(0,u.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,u.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,Lb.f)("edit.php",{post_type:"wp_block"})},(0,w.__)("Manage Reusable blocks"))))};const{Fill:Rb,Slot:Mb}=(0,_.up)("__unstableInserterMenuExtension");Rb.Slot=Mb;var Ob=Rb;const Fb=[];var jb=function(e){let{filterValue:t,onSelect:n,onHover:r,rootClientId:o,clientId:i,isAppender:l,__experimentalInsertionIndex:a,maxBlockPatterns:s,maxBlockTypes:c,showBlockDirectory:d=!1,isDraggable:p=!0,shouldFocusBlock:m=!0,prioritizePatterns:h}=e;const f=(0,ub.Z)($l.D,500),[g,v]=mb({onSelect:n,rootClientId:o,clientId:i,isAppender:l,insertionIndex:a,shouldFocusBlock:m}),[b,y,_,k]=qv(g,v),[x,,C]=nb(v,g),E=(0,u.useMemo)((()=>{if(0===s)return[];const e=Cb(x,t);return void 0!==s?e.slice(0,s):e}),[t,x,s]);let S=c;h&&E.length>2&&(S=0);const I=(0,u.useMemo)((()=>{if(0===S)return[];const e=xb((0,H.orderBy)(b,["frecency"],["desc"]),y,_,t);return void 0!==S?e.slice(0,S):e}),[t,b,y,_,c]);(0,u.useEffect)((()=>{if(!t)return;const e=I.length+E.length,n=(0,w.sprintf)((0,w._n)("%d result found.","%d results found.",e),e);f(n)}),[t,f]);const T=Lv(I,{step:9}),N=Lv(T.length===I.length?E:Fb),B=!(0,H.isEmpty)(I)||!(0,H.isEmpty)(E),A=!!I.length&&(0,u.createElement)(Gv,{title:(0,u.createElement)(og.Z,null,(0,w.__)("Blocks"))},(0,u.createElement)($v,{items:T,onSelect:k,onHover:r,label:(0,w.__)("Blocks"),isDraggable:p})),L=!!E.length&&(0,u.createElement)(Gv,{title:(0,u.createElement)(og.Z,null,(0,w.__)("Block Patterns"))},(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,u.createElement)(lb,{shownPatterns:N,blockPatterns:E,onClickPattern:C,isDraggable:p})));return(0,u.createElement)(Yv,null,!d&&!B&&(0,u.createElement)(pb,null),h?L:A,!!I.length&&!!E.length&&(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),h?A:L,d&&(0,u.createElement)(Ob.Slot,{fillProps:{onSelect:k,onHover:r,filterValue:t,hasItems:B,rootClientId:g}},(e=>e.length?e:B?null:(0,u.createElement)(pb,null))))},Zb=n(2348);const zb={name:"blocks",title:(0,w.__)("Blocks")},Hb={name:"patterns",title:(0,w.__)("Patterns")},Vb={name:"reusable",title:(0,w.__)("Reusable")};var Wb=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:r=!1,onSelect:o}=e;const i=(0,u.useMemo)((()=>{const e=[zb];return n&&e.push(Hb),r&&e.push(Vb),e}),[zb,n,Hb,r,Vb]);return(0,u.createElement)(Zb.Z,{className:"block-editor-inserter__tabs",tabs:i,onSelect:o},t)},Ub=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:r,isAppender:o,__experimentalInsertionIndex:i,onSelect:l,showInserterHelpPanel:a,showMostUsedBlocks:s,__experimentalFilterValue:c="",shouldFocusBlock:d=!0}=e;const[p,m]=(0,u.useState)(c),[h,f]=(0,u.useState)(null),[g,v]=(0,u.useState)(null),[y,_,k]=mb({rootClientId:n,clientId:r,isAppender:o,insertionIndex:i,shouldFocusBlock:d}),{showPatterns:x,hasReusableBlocks:C}=(0,b.Z)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:r}=e(rs);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=r().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),E=(0,u.useCallback)(((e,t,n)=>{_(e,t,n),l()}),[_,l]),S=(0,u.useCallback)(((e,t)=>{_(e,{patternName:t}),l()}),[_,l]),I=(0,u.useCallback)((e=>{k(!!e),f(e)}),[k,f]),T=(0,u.useCallback)((e=>{v(e)}),[v]),N=(0,u.useMemo)((()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__block-list"},(0,u.createElement)(Xv,{rootClientId:y,onInsert:E,onHover:I,showMostUsedBlocks:s})),a&&(0,u.createElement)("div",{className:"block-editor-inserter__tips"},(0,u.createElement)(og.Z,{as:"h2"},(0,w.__)("A tip for using the block editor")),(0,u.createElement)(cg,null)))),[y,E,I,p,s,a]),B=(0,u.useMemo)((()=>(0,u.createElement)(Ab,{rootClientId:y,onInsert:S,onClickCategory:T,selectedCategory:g})),[y,S,T,g]),A=(0,u.useMemo)((()=>(0,u.createElement)(Db,{rootClientId:y,onInsert:E,onHover:I})),[y,E,I]),L=(0,u.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?B:A),[N,B,A]),P=(0,u.useRef)();return(0,u.useImperativeHandle)(t,(()=>({focusSearch:()=>{P.current.focus()}}))),(0,u.createElement)("div",{className:"block-editor-inserter__menu"},(0,u.createElement)("div",{className:"block-editor-inserter__main-area"},(0,u.createElement)("div",{className:"block-editor-inserter__content"},(0,u.createElement)(ig.Z,{className:"block-editor-inserter__search",onChange:e=>{h&&f(null),m(e)},value:p,label:(0,w.__)("Search for blocks and patterns"),placeholder:(0,w.__)("Search"),ref:P}),!!p&&(0,u.createElement)(jb,{filterValue:p,onSelect:l,onHover:I,rootClientId:n,clientId:r,isAppender:o,__experimentalInsertionIndex:i,showBlockDirectory:!0,shouldFocusBlock:d}),!p&&(x||C)&&(0,u.createElement)(Wb,{showPatterns:x,showReusableBlocks:C},L),!p&&!x&&!C&&N)),a&&h&&(0,u.createElement)(Nv,{item:h}))}));function $b(e){let{onSelect:t,rootClientId:n,clientId:r,isAppender:o,prioritizePatterns:i}=e;const[l,a]=(0,u.useState)(""),[s,c]=mb({onSelect:t,rootClientId:n,clientId:r,isAppender:o}),[d]=qv(s,c),[p]=nb(c,s),{setInserterIsOpened:m,insertionIndex:h}=(0,b.Z)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:o}=e(rs),i=t(),l=n(r),a=o();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===l?a:l}}),[r]),f=p.length&&(!!l||i),v=f&&p.length>6||d.length>6;(0,u.useEffect)((()=>{m&&m(!1)}),[m]);let y=0;return f&&(y=i?4:2),(0,u.createElement)("div",{className:g()("block-editor-inserter__quick-inserter",{"has-search":v,"has-expand":m})},v&&(0,u.createElement)(ig.Z,{className:"block-editor-inserter__search",value:l,onChange:e=>{a(e)},label:(0,w.__)("Search for blocks and patterns"),placeholder:(0,w.__)("Search")}),(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,u.createElement)(jb,{filterValue:l,onSelect:t,rootClientId:n,clientId:r,isAppender:o,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:i})),m&&(0,u.createElement)(Ss.Z,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{m({rootClientId:n,insertionIndex:h,filterValue:l})},"aria-label":(0,w.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,w.__)("Browse all")))}const Gb=e=>{let t,{onToggle:n,disabled:r,isOpen:o,blockTitle:i,hasSingleBlockType:l,toggleProps:a={},prioritizePatterns:s}=e;t=l?(0,w.sprintf)((0,w._x)("Add %s","directly add the only allowed block"),i):s?(0,w.__)("Add pattern"):(0,w._x)("Add block","Generic label for block inserter button");const{onClick:c,...d}=a;return(0,u.createElement)(Ss.Z,(0,bo.Z)({icon:rg.Z,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),c&&c(e)},className:"block-editor-inserter__toggle","aria-haspopup":!l&&"true","aria-expanded":!l&&o,disabled:r},d))};class qb extends u.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(e){let{onToggle:t,isOpen:n}=e;const{disabled:r,blockTitle:o,hasSingleBlockType:i,directInsertBlock:l,toggleProps:a,hasItems:s,renderToggle:c=Gb,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:r||!s,blockTitle:o,hasSingleBlockType:i,directInsertBlock:l,toggleProps:a,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i,__experimentalIsQuick:l,prioritizePatterns:a}=this.props;return l?(0,u.createElement)($b,{onSelect:()=>{t()},rootClientId:n,clientId:r,isAppender:o,prioritizePatterns:a}):(0,u.createElement)(Ub,{onSelect:()=>{t()},rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:r,__experimentalIsQuick:o,onSelectOrClose:i}=this.props;return t||n?this.renderToggle({onToggle:r}):(0,u.createElement)(ng.Z,{className:"block-editor-inserter",contentClassName:g()("block-editor-inserter__popover",{"is-quick":o}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,w.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}var Kb=(0,pd.Z)([(0,ud.Z)(((e,t)=>{var n;let{clientId:r,rootClientId:o}=t;const{getBlockRootClientId:i,hasInserterItems:l,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:s,getBlockIndex:c,getBlockCount:u,getSettings:d}=e(rs),{getBlockVariations:p}=e(Rt);o=o||i(r)||void 0;const m=a(o),h=s(o),f=c(r),g=u(),v=d(),b=1===(null==m?void 0:m.length)&&0===(null===(n=p(m[0].name,"inserter"))||void 0===n?void 0:n.length);let y=!1;return b&&(y=m[0]),{hasItems:l(o),hasSingleBlockType:b,blockTitle:y?y.title:"",allowedBlockType:y,directInsertBlock:h,rootClientId:o,prioritizePatterns:v.__experimentalPreferPatternsOnRoot&&!o&&f>0&&(f<g||0===g)}})),(0,dd.Z)(((e,t,n)=>{let{select:r}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:o,isAppender:i,hasSingleBlockType:l,allowedBlockType:a,directInsertBlock:s,onSelectOrClose:c}=t;if(!l&&!s)return;const{insertBlock:u}=e(rs);let d;if(s){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=r(rs);if(!e||!o&&!n)return{};const l={};let a={};if(o){const e=t(o),n=t(i(o));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(a=(null==n?void 0:n.attributes)||{})}else{var c;const e=t(n);if(null!=e&&null!==(c=e.innerBlocks)&&void 0!==c&&c.length){const t=e.innerBlocks[e.innerBlocks.length-1];s&&(null==s?void 0:s.name)===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(l[e]=a[e])})),l}(s.attributesToCopy);d=Ke(s.name,{...s.attributes||{},...e})}else d=Ke(a.name);u(d,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:a}=r(rs);if(o)return e(o);const s=t();return!i&&s&&a(s)===n?e(s)+1:l(n).length}(),n),c&&c();const p=(0,w.sprintf)((0,w.__)("%s block added"),a.title);(0,$l.D)(p)}}})),(0,hd.Z)((e=>{let{hasItems:t,isAppender:n,rootClientId:r,clientId:o}=e;return t||!n&&!r&&!o}))])(qb),Yb=(0,pd.Z)((0,ud.Z)(((e,t)=>{const{getBlockCount:n,getSettings:r,getTemplateLock:o}=e(rs),i=!n(t.rootClientId),{bodyPlaceholder:l}=r();return{showPrompt:i,isLocked:!!o(t.rootClientId),placeholder:l}})),(0,dd.Z)(((e,t)=>{const{insertDefaultBlock:n,startTyping:r}=e(rs);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),r()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:r,placeholder:o,rootClientId:i}=e;if(t)return null;const l=(0,gn.decodeEntities)(o)||(0,w.__)("Type / to choose a block");return(0,u.createElement)("div",{"data-root-client-id":i||"",className:g()("block-editor-default-block-appender",{"has-visible-prompt":r})},(0,u.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,w.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Uf.ENTER!==e.keyCode&&Uf.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{r&&n()}},r?l:"\ufeff"),(0,u.createElement)(Kb,{rootClientId:i,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))})),Jb=n(28072);function Xb(e,t){let{rootClientId:n,className:r,onFocus:o,tabIndex:i}=e;return(0,u.createElement)(Kb,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:l,disabled:a,isOpen:s,blockTitle:c,hasSingleBlockType:d}=e;n=d?(0,w.sprintf)((0,w._x)("Add %s","directly add the only allowed block"),c):(0,w._x)("Add block","Generic label for block inserter button");const p=!d;let m=(0,u.createElement)(Ss.Z,{ref:t,onFocus:o,tabIndex:i,className:g()(r,"block-editor-button-block-appender"),onClick:l,"aria-haspopup":p?"true":void 0,"aria-expanded":p?s:void 0,disabled:a,label:n},!d&&(0,u.createElement)(og.Z,{as:"span"},n),(0,u.createElement)(qc.Z,{icon:rg.Z}));return(p||d)&&(m=(0,u.createElement)(Jb.Z,{text:n},m)),m},isAppender:!0})}(0,u.forwardRef)(((e,t)=>((0,Wo.Z)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Xb(e,t))));var Qb=(0,u.forwardRef)(Xb),ey=(0,ud.Z)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:r,getTemplateLock:o,getSelectedBlockClientId:i}=e(rs);return{isLocked:!!o(n),canInsertDefaultBlock:r(ze(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:r,isLocked:o,renderAppender:i,className:l,selectedBlockClientId:a,tagName:s="div"}=e;if(o||!1===i)return null;if(i)t=(0,u.createElement)(i,null);else{if(a!==n&&(n||a))return null;t=r?(0,u.createElement)(Yb,{rootClientId:n}):(0,u.createElement)(Qb,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,u.createElement)(s,{tabIndex:-1,className:g()("block-list-appender wp-block",l),contentEditable:!1,"data-block":!0},t)})),ty=n(76518);(0,u.createContext)();var ny=function(e){let{previousClientId:t,nextClientId:n,children:r,__unstablePopoverSlot:o,__unstableContentRef:i,...l}=e;const{orientation:a,rootClientId:s,isVisible:c}=(0,b.Z)((e=>{var r;const{getBlockListSettings:o,getBlockRootClientId:i,isBlockVisible:l}=e(rs),a=i(t);return{orientation:(null===(r=o(a))||void 0===r?void 0:r.orientation)||"vertical",rootClientId:a,isVisible:l(t)&&l(n)}}),[t]),d=Fs(t),p=Fs(n),m="vertical"===a,h=(0,u.useMemo)((()=>{if(!d&&!p||!c)return{};const e=d?d.getBoundingClientRect():null,t=p?p.getBoundingClientRect():null;if(m)return{width:d?d.offsetWidth:p.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,w.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:d?d.offsetHeight:p.offsetHeight}}),[d,p,m]),f=(0,u.useCallback)((()=>{if(!d&&!p||!c)return{};const{ownerDocument:e}=d||p,t=d?d.getBoundingClientRect():null,n=p?p.getBoundingClientRect():null;return m?(0,w.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:(0,w.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}}),[d,p]),v=ac(i);return d&&p&&c?(0,u.createElement)(k.Z,(0,bo.Z)({ref:v,animate:!1,getAnchorRect:f,focusOnMount:!1,__unstableSlotName:o||null,key:n+"--"+s},l,{className:g()("block-editor-block-popover",l.className),__unstableForcePosition:!0}),(0,u.createElement)("div",{style:h},r)):null};const ry=(0,u.createContext)();function oy(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:r,hideInsertionPoint:o}=(0,y.Z)(rs),i=(0,u.useContext)(ry),l=(0,u.useRef)(),{orientation:a,previousClientId:s,nextClientId:c,rootClientId:d,isInserterShown:p}=(0,b.Z)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:r,getBlockInsertionPoint:o,isBlockBeingDragged:i,getPreviousBlockClientId:l,getNextBlockClientId:a}=e(rs),s=o(),c=n(s.rootClientId);if(!c.length)return{};let u=c[s.index-1],d=c[s.index];for(;i(u);)u=l(u);for(;i(d);)d=a(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=r(s.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:s.rootClientId,isInserterShown:null==s?void 0:s.__unstableWithInserter}}),[]),m="vertical"===a,h=(0,vf.Z)(),f={start:{...m?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...m?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:p?.4:0}},hover:{...m?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},v={start:{scale:h?1:0},rest:{scale:1,transition:{delay:.2}}},_=g()("block-editor-block-list__insertion-point","is-"+a);return(0,u.createElement)(ny,{previousClientId:s,nextClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n},(0,u.createElement)(ty.E.div,{layout:!h,initial:h?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&c&&r(c,-1)},onFocus:function(e){e.target!==l.current&&(i.current=!0)},className:g()(_,{"is-with-inserter":p}),onHoverEnd:function(e){e.target!==l.current||i.current||o()}},(0,u.createElement)(ty.E.div,{variants:f,className:"block-editor-block-list__insertion-point-indicator"}),p&&(0,u.createElement)(ty.E.div,{variants:v,className:g()("block-editor-block-list__insertion-point-inserter")},(0,u.createElement)(Kb,{position:"bottom center",clientId:c,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{i.current=e},onSelectOrClose:()=>{i.current=!1}}))))}function iy(e){let{children:t,...n}=e;const r=(0,b.Z)((e=>e(rs).isBlockInsertionPointVisible()),[]);return(0,u.createElement)(ry.Provider,{value:(0,u.useRef)(!1)},r&&(0,u.createElement)(oy,n),t)}function ly(){const e=(0,u.useContext)(ry),t=(0,b.Z)((e=>e(rs).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:r,getBlockIndex:o,isBlockInsertionPointVisible:i,isMultiSelecting:l,getSelectedBlockClientIds:a,getTemplateLock:s}=(0,b.Z)(rs),{showInsertionPoint:c,hideInsertionPoint:d}=(0,y.Z)(rs);return(0,Ps.Z)((r=>{if(!t)return r.addEventListener("mousemove",u),()=>{r.removeEventListener("mousemove",u)};function u(t){var r,u;if(e.current)return;if(l())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(i()&&d());let p;if(t.target.classList.contains("is-root-container")||(p=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),s(p))return;const m=(null===(r=n(p))||void 0===r?void 0:r.orientation)||"vertical",h=t.target.getBoundingClientRect(),f=t.clientY-h.top,g=t.clientX-h.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>f||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>g));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(u=v.parentElement)||void 0===u?void 0:u.closest(".block-editor-block-content-overlay"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const y=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>y.bottom||t.clientY<y.top)||"vertical"===m&&(t.clientX>y.right||t.clientX<y.left))return void(i()&&d());const _=o(b);0!==_?c(p,_,{__unstableWithInserter:!0}):i()&&d()}}),[e,n,r,o,i,l,c,d,a])}const ay="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,sy="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function cy(e){return(0,b.Z)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:r}=t(rs),{getBlockType:o,getActiveBlockVariation:i}=t(Rt),l=n(e),a=o(l);if(!a)return null;const s=r(e),c=i(l,s),u={title:a.title,icon:a.icon,description:a.description,anchor:null==s?void 0:s.anchor};return c?{title:c.title||a.title,icon:c.icon||a.icon,description:c.description||a.description,anchor:null==s?void 0:s.anchor}:u}),[e])}function uy(e){let{clientId:t,maximumLength:n,context:r}=e;const{attributes:o,name:i,reusableBlockTitle:l}=(0,b.Z)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:r,__experimentalGetReusableBlockTitle:o}=e(rs),i=n(t);if(!i)return{};const l=$e(He(i));return{attributes:r(t),name:i,reusableBlockTitle:l&&o(r(t).ref)}}),[t]),a=cy(t);if(!i||!a)return null;const s=He(i),c=s?pt(s,o,r):null,u=l||c,d=u&&u!==s.title?u:a.title;if(n&&n>0&&d.length>n){const e="...";return d.slice(0,n-e.length)+e}return d}function dy(e){let{clientId:t,maximumLength:n,context:r}=e;return uy({clientId:t,maximumLength:n,context:r})}var py=e=>{let{children:t,clientIds:n,cloneClassname:r,onDragStart:o,onDragEnd:i}=e;const{srcRootClientId:l,isDraggable:a,icon:s}=(0,b.Z)((e=>{var t;const{canMoveBlocks:r,getBlockRootClientId:o,getBlockName:i}=e(rs),l=o(n[0]),a=i(n[0]);return{srcRootClientId:l,isDraggable:r(n,l),icon:null===(t=He(a))||void 0===t?void 0:t.icon}}),[n]),c=(0,u.useRef)(!1),[d,p,m]=function(){const e=(0,u.useRef)(null),t=(0,u.useRef)(null),n=(0,u.useRef)(null),r=(0,u.useRef)(null);return(0,u.useEffect)((()=>()=>{r.current&&(clearInterval(r.current),r.current=null)}),[]),[(0,u.useCallback)((o=>{e.current=o.clientY,n.current=(0,bf.Z)(o.target),r.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,u.useCallback)((r=>{if(!n.current)return;const o=n.current.offsetHeight,i=e.current-n.current.offsetTop,l=r.clientY-n.current.offsetTop;if(r.clientY>i){const e=Math.max(o-i-50,0),n=Math.max(l-i-50,0)/e;t.current=25*n}else if(r.clientY<i){const e=Math.max(i-50,0),n=Math.max(i-l-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}(),{startDraggingBlocks:h,stopDraggingBlocks:f}=(0,y.Z)(rs);if((0,u.useEffect)((()=>()=>{c.current&&f()}),[]),!a)return t({isDraggable:!1});const g={type:"block",srcClientIds:n,srcRootClientId:l};return(0,u.createElement)(Ov.Z,{cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:g,onDragStart:e=>{h(n),c.current=!0,d(e),o&&o()},onDragOver:p,onDragEnd:()=>{f(),c.current=!1,m(),i&&i()},__experimentalDragComponent:(0,u.createElement)(jv,{count:n.length,icon:s})},(e=>{let{onDraggableStart:n,onDraggableEnd:r}=e;return t({draggable:!0,onDragStart:n,onDragEnd:r})}))},my=function(e){let{clientId:t,rootClientId:n}=e;const r=cy(t),o=(0,b.Z)((e=>{var r;const{getBlock:o,getBlockIndex:i,hasBlockMovingClientId:l,getBlockListSettings:a}=e(rs),s=i(t),{name:c,attributes:u}=o(t);return{index:s,name:c,attributes:u,blockMovingMode:l(),orientation:null===(r=a(n))||void 0===r?void 0:r.orientation}}),[t,n]),{index:i,name:l,attributes:a,blockMovingMode:s,orientation:c}=o,{setNavigationMode:d,removeBlock:p}=(0,y.Z)(rs),m=(0,u.useRef)(),h=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vertical";const o=null==e?void 0:e.title,i=e?pt(e,t,"accessibility"):"",l=void 0!==n,a=i&&i!==o;return l&&"vertical"===r?a?(0,w.sprintf)((0,w.__)("%1$s Block. Row %2$d. %3$s"),o,n,i):(0,w.sprintf)((0,w.__)("%1$s Block. Row %2$d"),o,n):l&&"horizontal"===r?a?(0,w.sprintf)((0,w.__)("%1$s Block. Column %2$d. %3$s"),o,n,i):(0,w.sprintf)((0,w.__)("%1$s Block. Column %2$d"),o,n):a?(0,w.sprintf)((0,w.__)("%1$s Block. %2$s"),o,i):(0,w.sprintf)((0,w.__)("%s Block"),o)}(He(l),a,i+1,c);(0,u.useEffect)((()=>{m.current.focus(),(0,$l.D)(h)}),[h]);const f=Fs(t),{hasBlockMovingClientId:v,getBlockIndex:_,getBlockRootClientId:k,getClientIdsOfDescendants:x,getSelectedBlockClientId:C,getMultiSelectedBlocksEndClientId:E,getPreviousBlockClientId:S,getNextBlockClientId:I}=(0,b.Z)(rs),{selectBlock:T,clearSelectedBlock:N,setBlockMovingClientId:B,moveBlockToPosition:A}=(0,y.Z)(rs),L=g()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!s}),P=(0,w.__)("Drag");return(0,u.createElement)("div",{className:L},(0,u.createElement)(Cs.Z,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,u.createElement)(Es.Z,null,(0,u.createElement)(pg,{icon:null==r?void 0:r.icon,showColors:!0})),(0,u.createElement)(Es.Z,null,(0,u.createElement)(py,{clientIds:[t]},(e=>(0,u.createElement)(Ss.Z,(0,bo.Z)({icon:Fv,className:"block-selection-button_drag-handle","aria-hidden":"true",label:P,tabIndex:"-1"},e))))),(0,u.createElement)(Es.Z,null,(0,u.createElement)(Ss.Z,{ref:m,onClick:()=>d(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===Uf.UP,o=n===Uf.DOWN,i=n===Uf.LEFT,l=n===Uf.RIGHT,a=n===Uf.TAB,s=n===Uf.ESCAPE,c=n===Uf.ENTER,u=n===Uf.SPACE,d=e.shiftKey;if(n===Uf.BACKSPACE||n===Uf.DELETE)return p(t),void e.preventDefault();const m=C(),h=E(),g=S(h||m),b=I(h||m),y=a&&d||r,w=a&&!d||o,L=i,P=l;let D;if(y)D=g;else if(w)D=b;else if(L){var R;D=null!==(R=k(m))&&void 0!==R?R:m}else if(P){var M;D=null!==(M=x([m])[0])&&void 0!==M?M:m}const O=v();if(s&&O&&!e.defaultPrevented&&(B(null),e.preventDefault()),(c||u)&&O){const e=k(O),t=k(m),n=_(O);let r=_(m);n<r&&e===t&&(r-=1),A(O,e,t,r),T(O),B(null)}if(w||y||L||P)if(D)e.preventDefault(),T(D);else if(a&&m){let t;if(w){t=f;do{t=wf.T_.tabbable.findNext(t)}while(t&&f.contains(t));t||(t=f.ownerDocument.defaultView.frameElement,t=wf.T_.tabbable.findNext(t))}else t=wf.T_.tabbable.findPrevious(f);t&&(e.preventDefault(),t.focus(),N())}},label:h,showTooltip:!1,className:"block-selection-button_select-button"},(0,u.createElement)(dy,{clientId:t,maximumLength:35})))))},hy=n(68955),fy=n(67911);function gy(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var vy=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:r,__experimentalOnIndexChange:o,...i}=e;const l=(0,u.useRef)(),a=function(e){const[t,n]=(0,u.useState)(!0),r=(0,u.useCallback)((()=>{const t=!wf.T_.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||(0,Wo.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,u.useLayoutEffect)((()=>{const t=new window.MutationObserver(r);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(l);return function(e,t,n,r,o){const[i]=(0,u.useState)(t),[l]=(0,u.useState)(r),a=(0,u.useCallback)((()=>{!function(e){const[t]=wf.T_.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,Fg.bx)("core/block-editor/focus-toolbar",a),(0,u.useEffect)((()=>{i&&a()}),[n,i,a]),(0,u.useEffect)((()=>{let t=0;return l&&!i&&(t=window.requestAnimationFrame((()=>{const t=gy(e.current),n=l||0;var r;t[n]&&(r=e.current).contains(r.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!o||!e.current)return;const n=gy(e.current).findIndex((e=>0===e.tabIndex));o(n)}}),[l,i])}(l,n,a,r,o),a?(0,u.createElement)(hy.Z,(0,bo.Z)({label:i["aria-label"],ref:l},i),t):(0,u.createElement)(fy.Z,(0,bo.Z)({orientation:"horizontal",role:"toolbar",ref:l},i),t)},by=n(9487),yy=n(11325),_y=n(98950),ky=n(5115),wy=n(82435);const xy=(e,t)=>"up"===e?"horizontal"===t?(0,w.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,w.isRTL)()?"left":"right":"down":null;const Cy=(e,t)=>"up"===e?"horizontal"===t?(0,w.isRTL)()?yy.Z:_y.Z:ky.Z:"down"===e?"horizontal"===t?(0,w.isRTL)()?_y.Z:yy.Z:wy.Z:null,Ey=(e,t)=>"up"===e?"horizontal"===t?(0,w.isRTL)()?(0,w.__)("Move right"):(0,w.__)("Move left"):(0,w.__)("Move up"):"down"===e?"horizontal"===t?(0,w.isRTL)()?(0,w.__)("Move left"):(0,w.__)("Move right"):(0,w.__)("Move down"):null,Sy=(0,u.forwardRef)(((e,t)=>{let{clientIds:n,direction:r,orientation:o,...i}=e;const l=(0,id.Z)(Sy),a=(0,H.castArray)(n).length,{blockType:s,isDisabled:c,rootClientId:d,isFirst:p,isLast:m,firstIndex:h,orientation:f="vertical"}=(0,b.Z)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:l,getBlock:a,getBlockListSettings:s}=e(rs),c=(0,H.castArray)(n),u=(0,H.first)(c),d=i(u),p=t(u),m=t((0,H.last)(c)),h=l(d),f=a(u),g=0===p,v=m===h.length-1,{orientation:b}=s(d)||{};return{blockType:f?He(f.name):null,isDisabled:"up"===r?g:v,rootClientId:d,firstIndex:p,isFirst:g,isLast:v,orientation:o||b}}),[n,r]),{moveBlocksDown:v,moveBlocksUp:_}=(0,y.Z)(rs),k="up"===r?_:v,x=`block-editor-block-mover-button__description-${l}`;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Ss.Z,(0,bo.Z)({ref:t,className:g()("block-editor-block-mover-button",`is-${r}-button`),icon:Cy(r,f),label:Ey(r,f),"aria-describedby":x},i,{onClick:c?null:e=>{k(n,d),i.onClick&&i.onClick(e)},disabled:c,__experimentalIsFocusable:!0})),(0,u.createElement)(og.Z,{id:x},function(e,t,n,r,o,i,l){const a=n+1;if(e>1)return function(e,t,n,r,o,i){const l=t+1;if(n&&r)return(0,w.__)("All blocks are selected, and cannot be moved");if(o>0&&!r){const t=xy("down",i);if("down"===t)return(0,w.sprintf)((0,w.__)("Move %1$d blocks from position %2$d down by one place"),e,l);if("left"===t)return(0,w.sprintf)((0,w.__)("Move %1$d blocks from position %2$d left by one place"),e,l);if("right"===t)return(0,w.sprintf)((0,w.__)("Move %1$d blocks from position %2$d right by one place"),e,l)}if(o>0&&r){const e=xy("down",i);if("down"===e)return(0,w.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,w.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,w.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(o<0&&!n){const t=xy("up",i);if("up"===t)return(0,w.sprintf)((0,w.__)("Move %1$d blocks from position %2$d up by one place"),e,l);if("left"===t)return(0,w.sprintf)((0,w.__)("Move %1$d blocks from position %2$d left by one place"),e,l);if("right"===t)return(0,w.sprintf)((0,w.__)("Move %1$d blocks from position %2$d right by one place"),e,l)}if(o<0&&n){const e=xy("up",i);if("up"===e)return(0,w.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,w.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,w.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,r,o,i,l);if(r&&o)return(0,w.sprintf)((0,w.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!o){const e=xy("down",l);if("down"===e)return(0,w.sprintf)((0,w.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,w.sprintf)((0,w.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,w.sprintf)((0,w.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&o){const e=xy("down",l);if("down"===e)return(0,w.sprintf)((0,w.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,w.sprintf)((0,w.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,w.sprintf)((0,w.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(i<0&&!r){const e=xy("up",l);if("up"===e)return(0,w.sprintf)((0,w.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,w.sprintf)((0,w.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,w.sprintf)((0,w.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){const e=xy("up",l);if("up"===e)return(0,w.sprintf)((0,w.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,w.sprintf)((0,w.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,w.sprintf)((0,w.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(a,s&&s.title,h,p,m,"up"===r?-1:1,f)))})),Iy=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Sy,(0,bo.Z)({direction:"up",ref:t},e)))),Ty=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Sy,(0,bo.Z)({direction:"down",ref:t},e))));var Ny=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:r,rootClientId:o,isFirst:i,isLast:l,orientation:a}=(0,b.Z)((e=>{var n;const{getBlockIndex:r,getBlockListSettings:o,canMoveBlocks:i,getBlockOrder:l,getBlockRootClientId:a}=e(rs),s=(0,H.castArray)(t),c=(0,H.first)(s),u=a((0,H.first)(s)),d=r(c),p=r((0,H.last)(s)),m=l(u);return{canMove:i(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=o(u))||void 0===n?void 0:n.orientation}}),[t]);if(!r||i&&l&&!o)return null;const s=(0,w.__)("Drag");return(0,u.createElement)(wo.Z,{className:g()("block-editor-block-mover",{"is-horizontal":"horizontal"===a})},!n&&(0,u.createElement)(py,{clientIds:t},(e=>(0,u.createElement)(Ss.Z,(0,bo.Z)({icon:Fv,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:s,tabIndex:"-1"},e)))),(0,u.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,u.createElement)(by.Z,null,(e=>(0,u.createElement)(Iy,(0,bo.Z)({clientIds:t},e)))),(0,u.createElement)(by.Z,null,(e=>(0,u.createElement)(Ty,(0,bo.Z)({clientIds:t},e))))))},By=n(73783);const{clearTimeout:Ay,setTimeout:Ly}=window,Py=()=>{},Dy=200;function Ry(e){let{ref:t,isFocused:n,debounceTimeout:r=Dy,onChange:o=Py}=e;const[i,l]=(0,u.useState)(!1),a=(0,u.useRef)(),s=e=>{null!=t&&t.current&&l(e),o(e)},c=()=>{const e=a.current;e&&Ay&&Ay(e)};return(0,u.useEffect)((()=>()=>{s(!1),c()}),[]),{showMovers:i,debouncedShowMovers:e=>{e&&e.stopPropagation(),c(),i||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),c(),a.current=Ly((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&s(!1)}),r)}}}function My(e){let{ref:t,debounceTimeout:n=Dy,onChange:r=Py}=e;const[o,i]=(0,u.useState)(!1),{showMovers:l,debouncedShowMovers:a,debouncedHideMovers:s}=Ry({ref:t,debounceTimeout:n,isFocused:o,onChange:r}),c=(0,u.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,u.useEffect)((()=>{const e=t.current,n=()=>{d()&&(i(!0),a())},r=()=>{d()||(i(!1),s())};return e&&!c.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",r,!0),c.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",r))}}),[t,c,i,a,s]),{showMovers:l,gestures:{onMouseMove:a,onMouseLeave:s}}}function Oy(){const{selectBlock:e,toggleBlockHighlight:t}=(0,y.Z)(rs),{firstParentClientId:n,shouldHide:r,hasReducedUI:o}=(0,b.Z)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:r,getSettings:o}=e(rs),{hasBlockSupport:i}=e(Rt),l=n(r()),a=l[l.length-1],s=He(t(a)),c=o();return{firstParentClientId:a,shouldHide:!i(s,"__experimentalParentSelector",!0),hasReducedUI:c.hasReducedUI}}),[]),i=cy(n),l=(0,u.useRef)(),{gestures:a}=My({ref:l,onChange(e){e&&o||t(n,e)}});return r||void 0===n?null:(0,u.createElement)("div",(0,bo.Z)({className:"block-editor-block-parent-selector",key:n,ref:l},a),(0,u.createElement)(By.Z,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,w.sprintf)((0,w.__)("Select %s"),i.title),showTooltip:!0,icon:(0,u.createElement)(pg,{icon:i.icon})}))}var Fy=n(49237);function jy(e){let{blocks:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(k.Z,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,w.__)("Preview")),(0,u.createElement)(Tv,{viewportWidth:500,blocks:t})))))}var Zy=e=>{let{className:t,possibleBlockTransformations:n,onSelect:r,blocks:o}=e;const[i,l]=(0,u.useState)();return(0,u.createElement)(gs.Z,{label:(0,w.__)("Transform to"),className:t},i&&(0,u.createElement)(jy,{blocks:lt(o,i)}),n.map((e=>{const{name:t,icon:n,title:o,isDisabled:i}=e;return(0,u.createElement)(vs.Z,{key:t,className:en(t),onClick:e=>{e.preventDefault(),r(t)},disabled:i,onMouseLeave:()=>l(null),onMouseEnter:()=>l(t)},(0,u.createElement)(pg,{icon:n,showColors:!0}),o)})))},zy=n(14676),Hy=n(62271);class Vy{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.value=e,this._currentValue,this._valueAsArray}entries(){return this._valueAsArray.entries(...arguments)}forEach(){return this._valueAsArray.forEach(...arguments)}keys(){return this._valueAsArray.keys(...arguments)}values(){return this._valueAsArray.values(...arguments)}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(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.value+=" "+t.join(" ")}remove(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.value=this._valueAsArray.filter((e=>!t.includes(e))).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}}function Wy(e,t,n){const r=new Vy(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+n.name),r.value}function Uy(e){return(0,H.find)(e,"isDefault")}function $y(e){let{clientId:t,onSwitch:n}=e;const{styles:r,block:o,blockType:i,className:l}=(0,b.Z)((e=>{const{getBlock:n}=e(rs),r=n(t);if(!r)return{};const o=He(r.name),{getBlockStyles:i}=e(Rt);return{block:r,blockType:o,styles:i(r.name),className:r.attributes.className||""}}),[t]),{updateBlockAttributes:a}=(0,y.Z)(rs),s=function(e){return e&&0!==e.length?Uy(e)?e:[{name:"default",label:(0,w._x)("Default","block style"),isDefault:!0},...e]:[]}(r),c=function(e,t){for(const n of new Vy(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),r=(0,H.find)(e,{name:t});if(r)return r}return(0,H.find)(e,"isDefault")}(s,l),d=function(e,t){return(0,u.useMemo)((()=>{const n=null==t?void 0:t.example,r=null==t?void 0:t.name;return n&&r?at(r,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?Xe(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(o,i);return{onSelect:e=>{const r=Wy(l,c,e);a(t,{className:r}),n()},stylesToRender:s,activeStyle:c,genericPreviewBlock:d,className:l}}const Gy=()=>{};function qy(e){let{clientId:t,onSwitch:n=Gy}=e;const{onSelect:r,stylesToRender:o,activeStyle:i}=$y({clientId:t,onSwitch:n});return o&&0!==o.length?(0,u.createElement)(u.Fragment,null,o.map((e=>{const t=e.label||e.name;return(0,u.createElement)(vs.Z,{key:e.name,icon:i.name===e.name?Hy.Z:null,onClick:()=>r(e)},(0,u.createElement)(zy.Z,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Ky(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:r}=t;return(0,u.createElement)(gs.Z,{label:(0,w.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,u.createElement)(qy,{clientId:r,onSwitch:n}))}const Yy=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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=Yy(e,t,n);if(r)return r}}},Jy=(e,t)=>{const n=((e,t)=>{const n=function(e,t){var n;const r=null===(n=He(e))||void 0===n?void 0:n.attributes;if(!r)return[];return Object.keys(r).filter((e=>{var n;return(null===(n=r[e])||void 0===n?void 0:n.__experimentalRole)===t}))}(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function Xy(e){let{patterns:t,onSelect:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(k.Z,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,w.__)("Preview")),(0,u.createElement)(Qy,{patterns:t,onSelect:n})))))}function Qy(e){let{patterns:t,onSelect:n}=e;const r=(0,Kv.u)();return(0,u.createElement)(rb.b,(0,bo.Z)({},r,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,w.__)("Patterns list")}),t.map((e=>(0,u.createElement)(e_,{key:e.name,pattern:e,onSelect:n,composite:r}))))}function e_(e){let{pattern:t,onSelect:n,composite:r}=e;const o="block-editor-block-switcher__preview-patterns-container",i=(0,id.Z)(e_,`${o}-list__item-description`);return(0,u.createElement)("div",{className:`${o}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?i:void 0},(0,u.createElement)(Dv.A,(0,bo.Z)({role:"option",as:"div"},r,{className:`${o}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,u.createElement)(Tv,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,u.createElement)("div",{className:`${o}-list__item-title`},t.title)),!!t.description&&(0,u.createElement)(og.Z,{id:i},t.description))}var t_=function(e){let{blocks:t,patterns:n,onSelect:r}=e;const[o,i]=(0,u.useState)(!1),l=((e,t)=>(0,u.useMemo)((()=>e.reduce(((e,n)=>{const r=((e,t)=>{const n=t.map((e=>Xe(e))),r=new Set;for(const t of e){let e=!1;for(const o of n){const n=Yy(o,t.name,r);if(n){e=!0,r.add(n.clientId),Jy(n,t);break}}if(!e)return}return n})(t,n.blocks);return r&&e.push({...n,transformedBlocks:r}),e}),[])),[e,t]))(n,t);return l.length?(0,u.createElement)(gs.Z,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},o&&(0,u.createElement)(Xy,{patterns:l,onSelect:r}),(0,u.createElement)(vs.Z,{onClick:e=>{e.preventDefault(),i(!o)},icon:yy.Z},(0,w.__)("Patterns"))):null};const n_=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:r}=(0,y.Z)(rs),o=cy(n[0].clientId),{possibleBlockTransformations:i,canRemove:l,hasBlockStyles:a,icon:s,blockTitle:c,patterns:d}=(0,b.Z)((e=>{var r;const{getBlockRootClientId:i,getBlockTransformItems:l,__experimentalGetPatternTransformItems:a}=e(rs),{getBlockStyles:s,getBlockType:c}=e(Rt),{canRemoveBlocks:u}=e(rs),d=i((0,H.castArray)(t)[0]),[{name:p}]=n,m=1===n.length,h=m&&s(p);let f;var g;m?f=null==o?void 0:o.icon:f=1===(0,H.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(g=c(p))||void 0===g?void 0:g.icon:Fy.Z;return{possibleBlockTransformations:l(n,d),canRemove:u(t,d),hasBlockStyles:!(null==h||!h.length),icon:f,blockTitle:null===(r=c(p))||void 0===r?void 0:r.title,patterns:a(n,d)}}),[t,n,null==o?void 0:o.icon]),p=1===n.length&&$e(n[0]),m=1===n.length&&"core/template-part"===n[0].name,h=!!i.length&&l&&!m,f=!(null==d||!d.length)&&l;if(!a&&!h)return(0,u.createElement)(wo.Z,null,(0,u.createElement)(By.Z,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:c,icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(pg,{icon:s,showColors:!0}),(p||m)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,u.createElement)(dy,{clientId:t,maximumLength:35})))}));const g=c,v=1===n.length?(0,w.sprintf)((0,w.__)("%s: Change block type or style"),c):(0,w.sprintf)((0,w._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),_=a||h||f;return(0,u.createElement)(wo.Z,null,(0,u.createElement)(by.Z,null,(e=>(0,u.createElement)(wd.Z,{className:"block-editor-block-switcher",label:g,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(pg,{icon:s,className:"block-editor-block-switcher__toggle",showColors:!0}),(p||m)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,u.createElement)(dy,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:v,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:o}=e;return _&&(0,u.createElement)("div",{className:"block-editor-block-switcher__container"},f&&(0,u.createElement)(t_,{blocks:n,patterns:d,onSelect:e=>{(e=>{r(t,e)})(e),o()}}),h&&(0,u.createElement)(Zy,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{r(t,lt(n,e))})(e),o()}}),a&&(0,u.createElement)(Ky,{hoveredBlock:n[0],onSwitch:o}))})))))};var r_=e=>{let{clientIds:t}=e;const n=(0,b.Z)((e=>e(rs).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,u.createElement)(n_,{clientIds:t,blocks:n})};const{Fill:o_,Slot:i_}=(0,_.up)("__unstableBlockToolbarLastItem");o_.Slot=i_;var l_=o_,a_=n(62006),s_=n(39977);function c_(e){let{clientIds:t,children:n,__experimentalUpdateSelection:r}=e;const{canInsertBlockType:o,getBlockRootClientId:i,getBlocksByClientId:l,canMoveBlocks:a,canRemoveBlocks:s}=(0,b.Z)(rs),{getDefaultBlockName:c,getGroupingBlockName:d}=(0,b.Z)(Rt),p=l(t),m=i(t[0]),h=(0,H.every)(p,(e=>!!e&&Ue(e.name,"multiple",!0)&&o(e.name,m))),f=o(c(),m),g=a(t,m),v=s(t,m),{removeBlocks:_,replaceBlocks:k,duplicateBlocks:x,insertAfterBlock:C,insertBeforeBlock:E,flashBlock:S,setBlockMovingClientId:I,setNavigationMode:T,selectBlock:N}=(0,y.Z)(rs),B=function(){const{getBlockName:e}=(0,b.Z)(rs),{getBlockType:t}=(0,b.Z)(Rt),{createSuccessNotice:n}=(0,y.Z)(tb.h);return(0,u.useCallback)(((r,o)=>{let i="";if(1===o.length){var l;const n=o[0],a=null===(l=t(e(n)))||void 0===l?void 0:l.title;i="copy"===r?(0,w.sprintf)((0,w.__)('Copied "%s" to clipboard.'),a):(0,w.sprintf)((0,w.__)('Moved "%s" to clipboard.'),a)}else i="copy"===r?(0,w.sprintf)((0,w._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",o.length),o.length):(0,w.sprintf)((0,w._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",o.length),o.length);n(i,{type:"snackbar"})}),[])}();return n({canDuplicate:h,canInsertDefaultBlock:f,canMove:g,canRemove:v,rootClientId:m,blocks:p,onDuplicate:()=>x(t,r),onRemove:()=>_(t,r),onInsertBefore(){E((0,H.first)((0,H.castArray)(t)))},onInsertAfter(){C((0,H.last)((0,H.castArray)(t)))},onMoveTo(){T(!0),N(t[0]),I(t[0])},onGroup(){if(!p.length)return;const e=d(),n=lt(p,e);n&&k(t,n)},onUngroup(){if(!p.length)return;const e=p[0].innerBlocks;e.length&&k(t,e)},onCopy(){const e=p.map((e=>{let{clientId:t}=e;return t}));1===p.length&&S(e[0]),B("copy",e)}})}const u_=()=>{};var d_=(0,pd.Z)([(0,ud.Z)(((e,t)=>{let{clientId:n}=t;const{getBlock:r,getBlockMode:o,getSettings:i}=e(rs),l=r(n),a=i().codeEditingEnabled;return{mode:o(n),blockType:l?He(l.name):null,isCodeEditingEnabled:a}})),(0,dd.Z)(((e,t)=>{let{onToggle:n=u_,clientId:r}=t;return{onToggleMode(){e(rs).toggleBlockMode(r),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:r,small:o=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!Ue(t,"html",!0)||!i)return null;const l="visual"===n?(0,w.__)("Edit as HTML"):(0,w.__)("Edit visually");return(0,u.createElement)(vs.Z,{onClick:r},!o&&l)})),p_=(0,pd.Z)((0,ud.Z)(((e,t)=>{let{clientId:n}=t;const r=e(rs).getBlock(n);return{block:r,shouldRender:r&&"core/html"===r.name}})),(0,dd.Z)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(rs).replaceBlocks(n.clientId,zr({HTML:ln(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:r}=e;if(!t)return null;const o=(0,w.__)("Convert to Blocks");return(0,u.createElement)(vs.Z,{onClick:n},!r&&o)}));const{Fill:m_,Slot:h_}=(0,_.up)("__unstableBlockSettingsMenuFirstItem");m_.Slot=h_;var f_=m_;function g_(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:r,groupingBlockName:o}=(0,b.Z)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:r,canInsertBlockType:o,getSelectedBlockClientIds:i}=e(rs),{getGroupingBlockName:l}=e(Rt),a=i(),s=l(),c=o(s,null!=a&&a.length?n(a[0]):void 0),u=r(a),d=1===u.length&&(null===(t=u[0])||void 0===t?void 0:t.name)===s;return{clientIds:a,isGroupable:c&&u.length,isUngroupable:d&&!!u[0].innerBlocks.length,blocksSelection:u,groupingBlockName:s}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:r,groupingBlockName:o}}function v_(e){let{clientIds:t,isGroupable:n,isUngroupable:r,blocksSelection:o,groupingBlockName:i,onClose:l=(()=>{})}=e;const{replaceBlocks:a}=(0,y.Z)(rs);return n||r?(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(vs.Z,{onClick:()=>{(()=>{const e=lt(o,i);e&&a(t,e)})(),l()}},(0,w._x)("Group","verb")),r&&(0,u.createElement)(vs.Z,{onClick:()=>{(()=>{const e=o[0].innerBlocks;e.length&&a(t,e)})(),l()}},(0,w._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function b_(e){return(0,b.Z)((t=>{const{canEditBlock:n,canMoveBlock:r,canRemoveBlock:o,canLockBlockType:i,getBlockName:l,getBlockRootClientId:a}=t(rs),s=a(e),c=n(e),u=r(e,s),d=o(e,s);return{canEdit:c,canMove:u,canRemove:d,canLock:i(l(e)),isLocked:!c||!u||!d}}),[e])}var y_=(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),__=(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})),k_=n(59113);function w_(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function x_(e){let{clientId:t,onClose:n}=e;const[r,o]=(0,u.useState)({move:!1,remove:!1}),{canEdit:i,canMove:l,canRemove:a}=b_(t),{isReusable:s,templateLock:c,hasTemplateLock:d}=(0,b.Z)((e=>{var n,r;const{getBlockName:o,getBlockAttributes:i}=e(rs),l=He(o(t));return{isReusable:$e(l),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==l||null===(r=l.attributes)||void 0===r||!r.templateLock)}}),[t]),[p,m]=(0,u.useState)(!!c),{updateBlockAttributes:h}=(0,y.Z)(rs),f=cy(t),g=(0,id.Z)(x_,"block-editor-block-lock-modal__options-title");(0,u.useEffect)((()=>{o({move:!l,remove:!a,...s?{edit:!i}:{}})}),[i,l,a,s]);const v=Object.values(r).every(Boolean),_=Object.values(r).some(Boolean)&&!v;return(0,u.createElement)(kd.Z,{title:(0,w.sprintf)((0,w.__)("Lock %s"),f.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,w.__)("Close"),onRequestClose:n},(0,u.createElement)("p",null,(0,w.__)("Choose specific attributes to restrict or lock all available options.")),(0,u.createElement)("form",{onSubmit:e=>{e.preventDefault(),h([t],{lock:r,templateLock:p?w_(r):void 0}),n()}},(0,u.createElement)("div",{role:"group","aria-labelledby":g,className:"block-editor-block-lock-modal__options"},(0,u.createElement)(k_.C,{className:"block-editor-block-lock-modal__options-title",label:(0,u.createElement)("span",{id:g},(0,w.__)("Lock all")),checked:v,indeterminate:_,onChange:e=>o({move:e,remove:e,...s?{edit:e}:{}})}),(0,u.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},s&&(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(k_.C,{label:(0,u.createElement)(u.Fragment,null,(0,w.__)("Restrict editing"),(0,u.createElement)(ug.Z,{icon:r.edit?__:y_})),checked:!!r.edit,onChange:e=>o((t=>({...t,edit:e})))})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(k_.C,{label:(0,u.createElement)(u.Fragment,null,(0,w.__)("Disable movement"),(0,u.createElement)(ug.Z,{icon:r.move?__:y_})),checked:r.move,onChange:e=>o((t=>({...t,move:e})))})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(k_.C,{label:(0,u.createElement)(u.Fragment,null,(0,w.__)("Prevent removal"),(0,u.createElement)(ug.Z,{icon:r.remove?__:y_})),checked:r.remove,onChange:e=>o((t=>({...t,remove:e})))}))),d&&(0,u.createElement)(Is.Z,{className:"block-editor-block-lock-modal__template-lock",label:(0,w.__)("Apply to all blocks inside"),checked:p,disabled:r.move&&!r.remove,onChange:()=>m(!p)})),(0,u.createElement)(Cs.Z,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(Es.Z,null,(0,u.createElement)(Ss.Z,{variant:"tertiary",onClick:n},(0,w.__)("Cancel"))),(0,u.createElement)(Es.Z,null,(0,u.createElement)(Ss.Z,{variant:"primary",type:"submit"},(0,w.__)("Apply"))))))}function C_(e){let{clientId:t}=e;const{canLock:n,isLocked:r}=b_(t),[o,i]=(0,u.useReducer)((e=>!e),!1);if(!n)return null;const l=r?(0,w.__)("Unlock"):(0,w.__)("Lock");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(vs.Z,{icon:r?y_:__,onClick:i},l),o&&(0,u.createElement)(x_,{clientId:t,onClose:i}))}const{Fill:E_,Slot:S_}=(0,_.up)("BlockSettingsMenuControls");function I_(e){let{...t}=e;return(0,u.createElement)(_o.Z,{document:document},(0,u.createElement)(E_,t))}I_.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:r,selectedClientIds:o,canRemove:i}=(0,b.Z)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:r,canRemoveBlocks:o}=e(rs),i=null!==n?n:r();return{selectedBlocks:(0,H.map)(t(i).filter(Boolean),(e=>e.name)),selectedClientIds:i,canRemove:o(i)}}),[n]),{canLock:l}=b_(o[0]),a=1===o.length&&l,s=g_(),{isGroupable:c,isUngroupable:d}=s,p=(c||d)&&i;return(0,u.createElement)(S_,{fillProps:{...t,selectedBlocks:r,selectedClientIds:o}},(e=>!(null!=e&&e.length)>0&&!p&&!a?null:(0,u.createElement)(gs.Z,null,a&&(0,u.createElement)(C_,{clientId:o[0]}),e,p&&(0,u.createElement)(v_,(0,bo.Z)({},s,{onClose:null==t?void 0:t.onClose})))))};var T_=I_;const N_=()=>{},B_={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function A_(e){let{blocks:t,onCopy:n}=e;const r=(0,s_.Z)((()=>sn(t)),n),o=t.length>1?(0,w.__)("Copy blocks"):(0,w.__)("Copy block");return(0,u.createElement)(vs.Z,{ref:r},o)}var L_=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:r,...o}=e;const i=(0,H.castArray)(t),l=i.length,a=i[0],{firstParentClientId:s,hasReducedUI:c,onlyBlock:d,parentBlockType:p,previousBlockClientId:m,nextBlockClientId:h,selectedBlockClientIds:f}=(0,b.Z)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:r,getPreviousBlockClientId:o,getNextBlockClientId:i,getSelectedBlockClientIds:l,getSettings:s}=e(rs),c=r(a),u=c[c.length-1],d=n(u);return{firstParentClientId:u,hasReducedUI:s().hasReducedUI,onlyBlock:1===t(),parentBlockType:He(d),previousBlockClientId:o(a),nextBlockClientId:i(a),selectedBlockClientIds:l()}}),[a]),g=(0,b.Z)((e=>{const{getShortcutRepresentation:t}=e(Fg.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")}}),[]),{selectBlock:v,toggleBlockHighlight:_}=(0,y.Z)(rs),k=(0,u.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:N_,[n]),x=uy({clientId:a,maximumLength:25}),C=(0,u.useCallback)(n?()=>{const e=m||h;e&&f.includes(a)&&!f.includes(e)&&n(e)}:N_,[n,m,h,f]),E=(0,w.sprintf)((0,w.__)("Remove %s"),x),S=1===l?E:(0,w.__)("Remove blocks"),I=(0,u.useRef)(),{gestures:T}=My({ref:I,onChange(e){e&&c||_(s,e)}});return(0,u.createElement)(c_,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:i,canMove:c,canRemove:m,onDuplicate:h,onInsertAfter:f,onInsertBefore:b,onRemove:y,onCopy:_,onMoveTo:x,blocks:E}=e;return(0,u.createElement)(wd.Z,(0,bo.Z)({icon:a_.Z,label:(0,w.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:B_,noIcons:!0},o),(e=>{let{onClose:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(gs.Z,null,(0,u.createElement)(f_.Slot,{fillProps:{onClose:o}}),void 0!==s&&(0,u.createElement)(vs.Z,(0,bo.Z)({},T,{ref:I,icon:(0,u.createElement)(pg,{icon:p.icon}),onClick:()=>v(s)}),(0,w.sprintf)((0,w.__)("Select parent block (%s)"),p.title)),1===l&&(0,u.createElement)(p_,{clientId:a}),(0,u.createElement)(A_,{blocks:E,onCopy:_}),n&&(0,u.createElement)(vs.Z,{onClick:(0,H.flow)(o,h,k),shortcut:g.duplicate},(0,w.__)("Duplicate")),i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(vs.Z,{onClick:(0,H.flow)(o,b),shortcut:g.insertBefore},(0,w.__)("Insert before")),(0,u.createElement)(vs.Z,{onClick:(0,H.flow)(o,f),shortcut:g.insertAfter},(0,w.__)("Insert after"))),c&&!d&&(0,u.createElement)(vs.Z,{onClick:(0,H.flow)(o,x)},(0,w.__)("Move to")),1===l&&(0,u.createElement)(d_,{clientId:a,onToggle:o})),(0,u.createElement)(T_.Slot,{fillProps:{onClose:o},clientIds:t}),"function"==typeof r?r({onClose:o}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:o}))),m&&(0,u.createElement)(gs.Z,null,(0,u.createElement)(vs.Z,{onClick:(0,H.flow)(o,y,C),shortcut:g.remove},S)))}))}))};function P_(e){let{clientIds:t,...n}=e;const{block:r,shouldRender:o}=(0,b.Z)((e=>{const n=t[0],{isBlockMultiSelected:r,getBlockMode:o,getBlock:i}=e(rs),l=!r(n),a="html"===o(n);return{block:i(n),shouldRender:l&&a}}),[t[0]]),{replaceBlocks:i}=(0,y.Z)(rs),l=(0,u.useCallback)((()=>{i(r.clientId,zr({HTML:ln(r)}))}),[r]);return o?(0,u.createElement)(wo.Z,null,(0,u.createElement)(By.Z,(0,bo.Z)({onClick:l},n),(0,w.__)("Edit visually"))):null}var D_=function(e){let{clientIds:t,...n}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(P_,(0,bo.Z)({clientIds:t},n)),(0,u.createElement)(wo.Z,null,(0,u.createElement)(by.Z,null,(e=>(0,u.createElement)(L_,(0,bo.Z)({clientIds:t,toggleProps:e},n))))))};function R_(e){let{clientId:t}=e;const n=cy(t),{canEdit:r,canMove:o,canRemove:i,canLock:l}=b_(t),[a,s]=(0,u.useReducer)((e=>!e),!1);return l?r&&o&&i?null:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(wo.Z,{className:"block-editor-block-lock-toolbar"},(0,u.createElement)(By.Z,{icon:__,label:(0,w.sprintf)((0,w.__)("Unlock %s"),n.title),onClick:s})),a&&(0,u.createElement)(x_,{clientId:t,onClose:s})):null}var M_=(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),O_=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),F_=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"}));const j_={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Z_=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:r}=g_(),{replaceBlocks:o}=(0,y.Z)(rs),{canRemove:i,variations:l}=(0,b.Z)((e=>{const{canRemoveBlocks:r}=e(rs),{getBlockVariations:o}=e(Rt);return{canRemove:r(t),variations:o(n,"transform")}}),[t,n]),a=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=lt(e,n);i&&i.length>0&&(i[0].attributes.layout=j_[r],o(t,i))};if(!r||!i)return null;const s=!!l.find((e=>{let{name:t}=e;return"group-row"===t})),c=!!l.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,u.createElement)(wo.Z,null,(0,u.createElement)(By.Z,{icon:M_,label:(0,w._x)("Group","verb"),onClick:a}),s&&(0,u.createElement)(By.Z,{icon:O_,label:(0,w._x)("Row","single horizontal line"),onClick:()=>a("row")}),c&&(0,u.createElement)(By.Z,{icon:F_,label:(0,w._x)("Stack","verb"),onClick:()=>a("stack")}))},z_=(0,u.createContext)(""),H_=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:r,blockType:o,hasFixedToolbar:i,hasReducedUI:l,isValid:a,isVisual:s}=(0,b.Z)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:r,isBlockValid:o,getBlockRootClientId:i,getSettings:l}=e(rs),a=r(),s=a[0],c=i(s),u=l();return{blockClientIds:a,blockClientId:s,blockType:s&&He(t(s)),hasFixedToolbar:u.hasFixedToolbar,hasReducedUI:u.hasReducedUI,rootClientId:c,isValid:a.every((e=>o(e))),isVisual:a.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:c}=(0,y.Z)(rs),d=(0,u.useRef)(),{showMovers:p,gestures:m}=My({ref:d,onChange(e){e&&l||c(r,e)}}),h=(0,ad.Z)("medium","<")||i;if(o&&!Ue(o,"__experimentalToolbar",!0))return null;const f=h||p;if(0===n.length)return null;const v=a&&s,_=n.length>1,k=g()("block-editor-block-toolbar",f&&"is-showing-movers");return(0,u.createElement)("div",{className:k},!_&&!h&&(0,u.createElement)(Oy,{clientIds:n}),(0,u.createElement)("div",(0,bo.Z)({ref:d},m),(v||_)&&(0,u.createElement)(wo.Z,{className:"block-editor-block-toolbar__block-controls"},(0,u.createElement)(r_,{clientIds:n}),!_&&(0,u.createElement)(R_,{clientId:n[0]}),(0,u.createElement)(Ny,{clientIds:n,hideDragHandle:t||l}))),v&&_&&(0,u.createElement)(Z_,null),v&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(hs.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(hs.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(hs.Slot,{className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(hs.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(hs.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(z_.Provider,{value:null==o?void 0:o.name},(0,u.createElement)(l_.Slot,null))),(0,u.createElement)(D_,{clientIds:n}))},V_=function(e){let{focusOnMount:t,isFixed:n,...r}=e;const{blockType:o,hasParents:i,showParentSelector:l}=(0,b.Z)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:r}=e(rs),{getBlockType:o}=e(Rt),i=r(),l=i[0],a=n(l),s=o(t(a[a.length-1]));return{blockType:l&&o(t(l)),hasParents:a.length,showParentSelector:s&&Ue(s,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(o&&!Ue(o,"__experimentalToolbar",!0))return null;const a=g()("block-editor-block-contextual-toolbar",{"has-parent":i&&l,"is-fixed":n});return(0,u.createElement)(vy,(0,bo.Z)({focusOnMount:t,className:a,"aria-label":(0,w.__)("Block tools")},r),(0,u.createElement)(H_,{hideDragHandle:n}))};function W_(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:r,isTyping:o,getSettings:i,getLastMultiSelectedBlockClientId:l}=e(rs);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:r()?l():null}}function U_(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:r,capturingClientId:o,__unstablePopoverSlot:i,__unstableContentRef:l}=e;const{isNavigationMode:a,isMultiSelecting:s,isTyping:c,hasFixedToolbar:d,lastClientId:p}=(0,b.Z)(W_,[]),m=(0,b.Z)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:r,getBlockOrder:o}=e(rs);if(!n())return!1;const i=r();return o(i.rootClientId)[i.index]===t}),[t]),h=(0,ad.Z)("medium"),f=(0,u.useRef)(!1),{stopTyping:v}=(0,y.Z)(rs),_=a,k=!a&&!d&&h&&!s&&!(!c&&!a&&r)&&!c,w=!(a||k||d||r);(0,Fg.bx)("core/block-editor/focus-toolbar",(()=>{f.current=!0,v(!0)}),{isDisabled:!w}),(0,u.useEffect)((()=>{f.current=!1}));const x=(0,u.useRef)();return _||k?(0,u.createElement)(sc,{clientId:o||t,bottomClientId:p,className:g()("block-editor-block-list__block-popover",{"is-insertion-point-visible":m}),__unstablePopoverSlot:i,__unstableContentRef:l},k&&(0,u.createElement)(V_,{focusOnMount:f.current,__experimentalInitialIndex:x.current,__experimentalOnIndexChange:e=>{x.current=e},key:t}),_&&(0,u.createElement)(my,{clientId:t,rootClientId:n})):null}function $_(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:r,getBlock:o,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:l}=e(rs),a=t()||n();if(!a)return;const{name:s,attributes:c={}}=o(a)||{},u=i(a),d=l(u),p=(0,H.find)(u,(e=>{var t;return null===(t=d[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:r(a),name:s,isEmptyDefaultBlock:s&&ct({name:s,attributes:c}),capturingClientId:p}}function G_(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const r=(0,b.Z)($_,[]);if(!r)return null;const{clientId:o,rootClientId:i,name:l,isEmptyDefaultBlock:a,capturingClientId:s}=r;return l?(0,u.createElement)(U_,{clientId:o,rootClientId:i,isEmptyDefaultBlock:a,capturingClientId:s,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function q_(e){let{children:t}=e;const n=(0,u.useContext)(ry),r=(0,u.useContext)(wg.Z.Context);return n||r?t:((0,Wo.Z)('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,u.createElement)(iy,{__unstablePopoverSlot:"block-toolbar"},(0,u.createElement)(G_,{__unstablePopoverSlot:"block-toolbar"}),t))}var K_=(0,yo.o)((e=>t=>{const{clientId:n}=as();return(0,u.createElement)(e,(0,bo.Z)({},t,{clientId:n}))}),"withClientId"),Y_=K_((e=>{let{clientId:t,showSeparator:n,isFloating:r,onAddBlock:o,isToggle:i}=e;return(0,u.createElement)(Qb,{className:g()({"block-list-appender__toggle":i}),rootClientId:t,showSeparator:n,isFloating:r,onAddBlock:o})})),J_=(0,pd.Z)([K_,(0,ud.Z)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:r}=e(rs),o=r(n);return{lastBlockClientId:(0,H.last)(o)}}))])((e=>{let{clientId:t}=e;return(0,u.createElement)(Yb,{rootClientId:t})}));const X_=new WeakMap;var Q_=n(73384);function ek(e,t,n){const r=(0,Q_.Pr)((()=>(0,H.throttle)(e,t,n)),[e,t,n]);return(0,u.useEffect)((()=>()=>r.cancel()),[r]),r}var tk=n(68265),nk=n(9324);function rk(e,t){const n=(0,b.Z)((e=>e(rs).getSettings().mediaUpload),[]),{canInsertBlockType:r,getBlockIndex:o,getClientIdsOfDescendants:i}=(0,b.Z)(rs),{insertBlocks:l,moveBlocksToPosition:a,updateBlockAttributes:s,clearSelectedBlock:c}=(0,y.Z)(rs),u=function(e,t,n,r,o,i,l){return a=>{const{srcRootClientId:s,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}(a);if("inserter"===u){l();const n=d.map((e=>Xe(e)));i(n,t,e,!0,null)}if("block"===u){const i=n(c[0]);if(s===e&&i===t)return;if(c.includes(e)||r(c).some((t=>t===e)))return;const l=s===e,a=c.length;o(c,s,e,l&&i<t?t-a:t)}}}(e,t,o,i,a,l,c),d=function(e,t,n,r,o,i){return l=>{if(!n)return;const a=rt(ot("from"),(t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(l)));if(a){const n=a.transform(l,r);i(n,t,e)}}}(e,t,n,s,r,l),p=function(e,t,n){return r=>{const o=fo({HTML:r,mode:"BLOCKS"});o.length&&n(o,t,e)}}(e,t,l);return e=>{const t=(0,nk.f)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?p(n):t.length?d(t):u(e)}}function ok(e,t,n){const r="top"===n||"bottom"===n,{x:o,y:i}=e,l=r?o:i,a=r?i:o,s=r?t.left:t.top,c=r?t.right:t.bottom,u=t[n];let d;return d=l>=s&&l<=c?l:l<c?s:c,Math.sqrt((l-d)**2+(a-u)**2)}function ik(e,t,n){const r="horizontal"===n?["left","right"]:["top","bottom"],o=(0,w.isRTL)();let i,l;return e.forEach(((e,n)=>{const a=e.getBoundingClientRect(),[s,c]=function(e,t){let n,r;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"]).forEach((o=>{const i=ok(e,t,o);(void 0===n||i<n)&&(n=i,r=o)})),[n,r]}(t,a,r);(void 0===l||s<l)&&(l=s,i=n+("bottom"===c||!o&&"right"===c||o&&"left"===c?1:0))})),i}function lk(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,u.useState)(null),r=(0,b.Z)((t=>{const{getTemplateLock:n}=t(rs);return"all"===n(e)}),[e]),{getBlockListSettings:o}=(0,b.Z)(rs),{showInsertionPoint:i,hideInsertionPoint:l}=(0,y.Z)(rs),a=rk(e,t),s=ek((0,u.useCallback)(((t,r)=>{var l;const a=ik(Array.from(r.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(l=o(e))||void 0===l?void 0:l.orientation);n(void 0===a?0:a),null!==a&&i(e,a)}),[]),200);return(0,tk.Z)({isDisabled:r,onDrop:a,onDragOver(e){s(e,e.currentTarget)},onDragLeave(){s.cancel(),l(),n(null)},onDragEnd(){s.cancel(),l(),n(null)}})}function ak(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:r,__experimentalDirectInsert:o,template:i,templateLock:l,wrapperRef:a,templateInsertUpdatesSelection:s,__experimentalCaptureToolbars:c,__experimentalAppenderTagName:d,renderAppender:p,orientation:m,placeholder:h,__experimentalLayout:f}=e;!function(e,t,n,r,o,i,l,a){const{updateBlockListSettings:s}=(0,y.Z)(rs),{blockListSettings:c,parentLock:d}=(0,b.Z)((t=>{const n=t(rs).getBlockRootClientId(e);return{blockListSettings:t(rs).getBlockListSettings(e),parentLock:t(rs).getTemplateLock(n)}}),[e]),p=(0,u.useMemo)((()=>t),t);(0,u.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===o?d:o};if(void 0!==i&&(t.__experimentalCaptureToolbars=i),void 0!==l)t.orientation=l;else{const e=Nu(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==r&&(t.__experimentalDirectInsert=r),(0,Jt.ZP)(c,t)||s(e,t)}),[e,c,p,n,r,o,d,i,l,s,a])}(t,n,r,o,l,c,m,f),function(e,t,n,r){const{getSelectedBlocksInitialCaretPosition:o}=(0,b.Z)(rs),{replaceInnerBlocks:i}=(0,y.Z)(rs),l=(0,b.Z)((t=>t(rs).getBlocks(e)),[e]),a=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{if((0===l.length||"all"===n)&&!(0,H.isEqual)(t,a.current)){a.current=t;const n=vo(l,t);(0,H.isEqual)(n,l)||i(e,n,0===l.length&&r&&0!==n.length,o())}}),[l,t,n,e])}(t,i,l,s);const g=(0,b.Z)((e=>{const n=e(rs).getBlock(t),r=He(n.name);if(r&&r.providesContext)return function(e,t){X_.has(t)||X_.set(t,new WeakMap);const n=X_.get(t);if(!n.has(e)){const r=(0,H.mapValues)(t.providesContext,(t=>e[t]));n.set(e,r)}return n.get(e)}(n.attributes,r)}),[t]);return(0,u.createElement)(gd,{value:g},(0,u.createElement)(vk,{rootClientId:t,renderAppender:p,__experimentalAppenderTagName:d,__experimentalLayout:f,wrapperRef:a,placeholder:h}))}function sk(e){return _g(e),(0,u.createElement)(ak,e)}const ck=(0,u.forwardRef)(((e,t)=>{const n=uk({ref:t},e);return(0,u.createElement)("div",{className:"block-editor-inner-blocks"},(0,u.createElement)("div",n))}));function uk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=as(),r=(0,ad.Z)("medium","<"),{__experimentalCaptureToolbars:o,hasOverlay:i}=(0,b.Z)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:o,hasSelectedInnerBlock:i,isNavigationMode:l}=e(rs),a=t(n),s=l()||r;return{__experimentalCaptureToolbars:e(Rt).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!o(n)&&!i(n,!0)&&s}}),[n,r]),l=(0,sd.Z)([e.ref,lk({rootClientId:n})]),a={__experimentalCaptureToolbars:o,...t},s=a.value&&a.onChange?sk:ak;return{...e,ref:l,className:g()(e.className,"block-editor-block-list__layout",{"has-overlay":i}),children:n?(0,u.createElement)(s,(0,bo.Z)({},a,{clientId:n})):(0,u.createElement)(vk,t)}}uk.save=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{innerBlocks:t}=nn,n=sn(t,{isInnerBlocks:!0}),r=(0,u.createElement)(Kt.Z,null,n);return{...e,children:r}},ck.DefaultBlockAppender=J_,ck.ButtonBlockAppender=Y_,ck.Content=()=>uk.save().children;var dk=ck;const pk=(0,u.createContext)(),mk=(0,u.createContext)();function hk(e){let{className:t,...n}=e;const[r,o]=(0,u.useState)(),i=(0,ad.Z)("medium"),{isOutlineMode:l,isFocusMode:a,isNavigationMode:s}=(0,b.Z)((e=>{const{getSettings:t,isNavigationMode:n}=e(rs),{outlineMode:r,focusMode:o}=t();return{isOutlineMode:r,isFocusMode:o,isNavigationMode:n()}}),[]),{setBlockVisibility:c}=(0,y.Z)(rs),d=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;c(t)}))}),[]),p=uk({ref:(0,sd.Z)([Eg(),ly(),o]),className:g()("is-root-container",t,{"is-outline-mode":l,"is-focus-mode":a&&i,"is-navigate-mode":s})},n);return(0,u.createElement)(pk.Provider,{value:r},(0,u.createElement)(mk.Provider,{value:d},(0,u.createElement)("div",p)))}function fk(e){return function(){const e=(0,b.Z)((e=>e(rs).getSettings().__experimentalBlockPatterns),[]);(0,u.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const r=()=>{n++,n>=e.length||((0,z.select)(rs).__experimentalGetParsedPattern(e[n].name),t=ay(r))};return t=ay(r),()=>sy(t)}),[e])}(),(0,u.createElement)(q_,null,(0,u.createElement)(ls,{value:os},(0,u.createElement)(hk,e)))}function gk(e){let{placeholder:t,rootClientId:n,renderAppender:r,__experimentalAppenderTagName:o,__experimentalLayout:i=Bu}=e;const{order:l,selectedBlocks:a,visibleBlocks:s}=(0,b.Z)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:o}=e(rs);return{order:t(n),selectedBlocks:r(),visibleBlocks:o()}}),[n]);return(0,u.createElement)(Lu,{value:i},l.map((e=>(0,u.createElement)(ld.ZP,{key:e,value:!s.has(e)&&!a.includes(e)},(0,u.createElement)(tg,{rootClientId:n,clientId:e})))),l.length<1&&t,(0,u.createElement)(ey,{tagName:o,rootClientId:n,renderAppender:r}))}function vk(e){return(0,u.createElement)(ld.ZP,{value:!1},(0,u.createElement)(gk,e))}fk.__unstableElementContext=pk;var bk=n(1565),yk=n(32628),_k=n(82667);function kk(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function wk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,Bs.YX)(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=kk(r),l=0===o||o?`${o}${i}`:void 0;return l}function xk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=wk(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Ck(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Ek(e){let{onChange:t,values:n,...r}=e;const o=wk(n),i=Ck(n)&&xk(n),l=i?(0,w.__)("Mixed"):null;return(0,u.createElement)(Ls.ZP,(0,bo.Z)({},r,{"aria-label":(0,w.__)("Border radius"),disableUnits:i,isOnly:!0,value:o,onChange:t,placeholder:l}))}const Sk={topLeft:(0,w.__)("Top left"),topRight:(0,w.__)("Top right"),bottomLeft:(0,w.__)("Bottom left"),bottomRight:(0,w.__)("Bottom right")};function Ik(e){let{onChange:t,values:n,...r}=e;const o="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,u.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Sk).map((e=>{let[n,i]=e;return(0,u.createElement)(Jb.Z,{text:i,position:"top",key:n},(0,u.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,u.createElement)(Ls.ZP,(0,bo.Z)({},r,{"aria-label":i,value:o[n],onChange:(l=n,e=>{t&&t({...o,[l]:e||void 0})})}))));var l})))}var Tk=n(45391),Nk=n(41165);function Bk(e){let{isLinked:t,...n}=e;const r=t?(0,w.__)("Unlink Radii"):(0,w.__)("Link Radii");return(0,u.createElement)(Jb.Z,{text:r},(0,u.createElement)(Ss.Z,(0,bo.Z)({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Tk.Z:Nk.Z,iconSize:16,"aria-label":r})))}const Ak={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Lk={px:100,em:20,rem:20};function Pk(e){let{onChange:t,values:n}=e;const[r,o]=(0,u.useState)(!Ck(n)||!xk(n)),i=(0,Bs.nj)({availableUnits:Hs("spacing.units")||["px","em","rem"]}),l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,Bs.YX)(e);return t||"px"}const t=Object.values(e).map((e=>{const[,t]=(0,Bs.YX)(e);return t}));return kk(t)||"px"}(n),a=i&&i.find((e=>e.value===l)),s=(null==a?void 0:a.step)||1,[c]=(0,Bs.YX)(wk(n));return(0,u.createElement)("fieldset",{className:"components-border-radius-control"},(0,u.createElement)("legend",null,(0,w.__)("Radius")),(0,u.createElement)("div",{className:"components-border-radius-control__wrapper"},r?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Ek,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:i}),(0,u.createElement)(_k.Z,{label:(0,w.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=c?c:"",min:0,max:Lk[l],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${l}`:void 0)},step:s})):(0,u.createElement)(Ik,{min:0,onChange:t,values:n||Ak,units:i}),(0,u.createElement)(Bk,{onClick:()=>o(!r),isLinked:r})))}function Dk(e){var t;const{attributes:{style:n},setAttributes:r}=e;return(0,u.createElement)(Pk,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Ys(t)),r({style:t})}})}(0,ke.l7)([we.Z,xe.Z]);const Rk=(e,t,n)=>{if(t){const n=(0,H.find)(e,{slug:t});if(n)return n}return{color:n}},Mk=(e,t)=>(0,H.find)(e,{color:t});function Ok(e,t){if(e&&t)return`has-${(0,H.kebabCase)(t)}-${e}`}function Fk(){return{disableCustomColors:!Hs("color.custom"),disableCustomGradients:!Hs("color.customGradient")}}function jk(){const e=Fk(),t=Hs("color.palette.custom"),n=Hs("color.palette.theme"),r=Hs("color.palette.default"),o=Hs("color.defaultPalette");e.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,w._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,w._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,w._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[r,n,t]);const i=Hs("color.gradients.custom"),l=Hs("color.gradients.theme"),a=Hs("color.gradients.default"),s=Hs("color.defaultGradients");return e.gradients=(0,u.useMemo)((()=>{const e=[];return l&&l.length&&e.push({name:(0,w._x)("Theme","Indicates this palette comes from the theme."),gradients:l}),s&&a&&a.length&&e.push({name:(0,w._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),i&&i.length&&e.push({name:(0,w._x)("Custom","Indicates this palette is created by the user."),gradients:i}),e}),[i,l,a]),e}const Zk="__experimentalBorder",zk=["top","right","bottom","left"],Hk=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},Vk=(e,t,n)=>{let r;return e.some((e=>e.colors.some((e=>e[t]===n&&(r=e,!0))))),r},Wk=e=>{let{colors:t,namedColor:n,customColor:r}=e;if(n){const e=Vk(t,"slug",n);if(e)return e}if(!r)return{color:void 0};return Vk(t,"color",r)||{color:r}};function Uk(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function $k(e){const{attributes:t,clientId:n,setAttributes:r}=e,{style:o}=t,{colors:i}=jk(),l=Gk(e.name),a=Hs("border.color")&&Gk(e.name,"color"),s=Hs("border.radius")&&Gk(e.name,"radius"),c=Hs("border.style")&&Gk(e.name,"style"),d=Hs("border.width")&&Gk(e.name,"width");if([!a,!s,!c,!d].every(Boolean)||!l)return null;const p=We(e.name,[Zk,"__experimentalDefaultControls"]),m=(null==p?void 0:p.color)||(null==p?void 0:p.width),h=((e,t)=>{const{borderColor:n,style:r}=e,{border:o}=r||{};if(n){const{color:e}=Wk({colors:t,namedColor:n});return e?{...o,color:e}:o}if(!o)return o;const i={...o};return zk.forEach((e=>{var n;const r=Uk(null===(n=i[e])||void 0===n?void 0:n.color);if(r){const{color:n}=Wk({colors:t,namedColor:r});i[e]={...i[e],color:n}}})),i})(t,i);return(0,u.createElement)(lc,{__experimentalGroup:"border"},(d||a)&&(0,u.createElement)(Vs.Z,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,bk.lX)(null==n?void 0:n.border)||!!t})(e),label:(0,w.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:r}=e;const{style:o}=n;r({borderColor:void 0,style:{...o,border:Ys({radius:null==o||null===(t=o.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:m,resetAllFilter:Hk,panelId:n},(0,u.createElement)(yk.Z,{colors:i,enableAlpha:!0,onChange:e=>{var t;let n,l={...e};if((0,bk.Al)(e))l={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},zk.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var r;const n=Wk({colors:i,customColor:null===(r=e[t])||void 0===r?void 0:r.color});n.slug&&(l[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,r=Wk({colors:i,customColor:t});r.slug&&(n=r.slug,l.color=void 0)}const a=Ys({...o,border:{radius:null==o||null===(t=o.border)||void 0===t?void 0:t.radius,...l}});r({style:a,borderColor:n})},popoverPlacement:"left-start",popoverOffset:40,showStyle:c,value:h,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),s&&(0,u.createElement)(Vs.Z,{hasValue:()=>function(e){var t,n;const r=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof r?Object.entries(r).some(Boolean):!!r}(e),label:(0,w.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:qk(r,"radius")})}(e),isShownByDefault:null==p?void 0:p.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,u.createElement)(Dk,e)))}function Gk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==Zo.Z.OS)return!1;const n=We(e,Zk);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function qk(e,t){return Ys({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Kk(e,t,n){if(!Gk(t,"color")||Qs(t,Zk,"color"))return e;const r=Yk(n),o=g()(e.className,r);return e.className=o||void 0,e}function Yk(e){var t;const{borderColor:n,style:r}=e,o=Ok("border-color",n);return g()({"has-border-color":n||(null==r||null===(t=r.border)||void 0===t?void 0:t.color),[o]:!!o})}const Jk=(0,yo.o)((e=>t=>{var n,r,o,i,l,a,s,c,d;const{name:p,attributes:m}=t,{borderColor:h,style:f}=m,{colors:g}=jk();if(!Gk(p,"color")||Qs(p,Zk,"color"))return(0,u.createElement)(e,t);const{color:v}=Wk({colors:g,namedColor:h}),{color:b}=Wk({colors:g,namedColor:Uk(null==f||null===(n=f.border)||void 0===n||null===(r=n.top)||void 0===r?void 0:r.color)}),{color:y}=Wk({colors:g,namedColor:Uk(null==f||null===(o=f.border)||void 0===o||null===(i=o.right)||void 0===i?void 0:i.color)}),{color:_}=Wk({colors:g,namedColor:Uk(null==f||null===(l=f.border)||void 0===l||null===(a=l.bottom)||void 0===a?void 0:a.color)}),{color:k}=Wk({colors:g,namedColor:Uk(null==f||null===(s=f.border)||void 0===s||null===(c=s.left)||void 0===c?void 0:c.color)}),w={borderTopColor:b||v,borderRightColor:y||v,borderBottomColor:_||v,borderLeftColor:k||v};let x=t.wrapperProps;return x={...t.wrapperProps,style:{...null===(d=t.wrapperProps)||void 0===d?void 0:d.style,...w}},(0,u.createElement)(e,(0,bo.Z)({},t,{wrapperProps:x}))}));(0,_e.KJ)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Gk(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Kk),(0,_e.KJ)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Gk(e,"color")||Qs(e,Zk,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),Kk(r,e,n)},e})),(0,_e.KJ)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Jk);var Xk=n(13495),Qk=n(10586),ew=n(3475),tw=n(47331),nw=n(92373),rw=n(79838),ow=n(75842);const iw=["colors","disableCustomColors","gradients","disableCustomGradients"],lw={name:"color",title:"Solid color",value:"color"},aw={name:"gradient",title:"Gradient",value:"gradient"},sw=[lw,aw];function cw(e){let{colors:t,gradients:n,disableCustomColors:r,disableCustomGradients:o,__experimentalHasMultipleOrigins:i,__experimentalIsRenderedInSidebar:l,className:a,label:s,onColorChange:c,onGradientChange:d,colorValue:p,gradientValue:m,clearable:h,showTitle:f=!0,enableAlpha:v}=e;const b=c&&(!(0,H.isEmpty)(t)||!r),y=d&&(!(0,H.isEmpty)(n)||!o);if(!b&&!y)return null;const _={[lw.value]:(0,u.createElement)(tw.ZP,{value:p,onChange:y?e=>{c(e),d()}:c,colors:t,disableCustomColors:r,__experimentalHasMultipleOrigins:i,__experimentalIsRenderedInSidebar:l,clearable:h,enableAlpha:v}),[aw.value]:(0,u.createElement)(nw.Z,{value:m,onChange:b?e=>{d(e),c()}:d,gradients:n,disableCustomGradients:o,__experimentalHasMultipleOrigins:i,__experimentalIsRenderedInSidebar:l,clearable:h})};return(0,u.createElement)(rw.ZP,{__nextHasNoMarginBottom:!0,className:g()("block-editor-color-gradient-control",a)},(0,u.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,u.createElement)(ow.Z,{spacing:1},f&&(0,u.createElement)("legend",null,(0,u.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,u.createElement)(rw.ZP.VisualLabel,null,s))),b&&y&&(0,u.createElement)(Zb.Z,{className:"block-editor-color-gradient-control__tabs",tabs:sw,initialTabName:m?aw.value:!!b&&lw.value},(e=>(0,u.createElement)("div",{className:"block-editor-color-gradient-control__tab-panel"},_[e.value]))),!y&&_[lw.value],!b&&_[aw.value])))}function uw(e){const t={};return t.colors=Hs("color.palette"),t.gradients=Hs("color.gradients"),t.disableCustomColors=!Hs("color.custom"),t.disableCustomGradients=!Hs("color.customGradient"),(0,u.createElement)(cw,(0,bo.Z)({},t,e))}var dw=function(e){return(0,H.every)(iw,(t=>e.hasOwnProperty(t)))?(0,u.createElement)(cw,e):(0,u.createElement)(uw,e)};const pw=e=>{let{setting:t,children:n,panelId:r,...o}=e;return(0,u.createElement)(Vs.Z,(0,bo.Z)({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},o,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:r,resetAllFilter:t.resetAllFilter}),n)},mw=e=>{let{colorValue:t,label:n}=e;return(0,u.createElement)(Xk.Z,{justify:"flex-start"},(0,u.createElement)(Qk.Z,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,u.createElement)(Es.Z,null,n))},hw=e=>t=>{let{onToggle:n,isOpen:r}=t;const{colorValue:o,label:i}=e,l={onClick:n,className:g()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r};return(0,u.createElement)(Ss.Z,l,(0,u.createElement)(mw,{colorValue:o,label:i}))};function fw(e){let t,{colors:n,disableCustomColors:r,disableCustomGradients:o,enableAlpha:i,gradients:l,settings:a,__experimentalHasMultipleOrigins:s,__experimentalIsRenderedInSidebar:c,...d}=e;return c&&(t={placement:"left-start",offset:36,__unstableShift:!0}),(0,u.createElement)(u.Fragment,null,a.map(((e,a)=>{var p;const m={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:r,disableCustomGradients:o,enableAlpha:i,gradientValue:e.gradientValue,gradients:l,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:s,__experimentalIsRenderedInSidebar:c,...e},h={colorValue:null!==(p=e.gradientValue)&&void 0!==p?p:e.colorValue,label:e.label};return e&&(0,u.createElement)(pw,(0,bo.Z)({key:a,setting:e},d),(0,u.createElement)(ng.Z,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:hw(h),renderContent:()=>(0,u.createElement)(ew.Z,{paddingSize:"medium"},(0,u.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,u.createElement)(dw,m)))}))})))}var gw=n(99318);(0,ke.l7)([we.Z,xe.Z]);var vw=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:r,fallbackLinkColor:o,fontSize:i,isLargeText:l,textColor:a,linkColor:s,enableAlphaChecker:c=!1}=e;const d=t||n;if(!d)return null;const p=a||r,m=s||o;if(!p&&!m)return null;const h=[{color:p,description:(0,w.__)("text color")},{color:m,description:(0,w.__)("link color")}],f=(0,ke.Vi)(d),g=f.alpha()<1,v=f.brightness(),b={level:"AA",size:l||!1!==l&&i>=24?"large":"small"};let y="",_="";for(const e of h){if(!e.color)continue;const t=(0,ke.Vi)(e.color),n=t.isReadable(f,b),r=t.alpha()<1;if(!n){if(g||r)continue;y=v<t.brightness()?(0,w.sprintf)((0,w.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,w.sprintf)((0,w.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),_=(0,w.__)("This color combination may be hard for people to read.");break}r&&c&&(y=(0,w.__)("Transparent text may be hard for people to read."),_=(0,w.__)("Transparent text may be hard for people to read."))}return y?((0,$l.D)(_),(0,u.createElement)("div",{className:"block-editor-contrast-checker"},(0,u.createElement)(gw.Z,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function bw(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function yw(e){let{enableAlpha:t=!1,settings:n,clientId:r,enableContrastChecking:o=!0}=e;const[i,l]=(0,u.useState)(),[a,s]=(0,u.useState)(),[c,d]=(0,u.useState)(),p=Os(r);(0,u.useEffect)((()=>{var e;if(!o)return;if(!p.current)return;s(bw(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(bw(t).color);let n=p.current,r=bw(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,r=bw(n).backgroundColor;l(r)}));const m=jk();return(0,u.createElement)(lc,{__experimentalGroup:"color"},(0,u.createElement)(fw,(0,bo.Z)({enableAlpha:t,panelId:r,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},m)),o&&(0,u.createElement)(vw,{backgroundColor:i,textColor:a,enableAlphaChecker:t,linkColor:c}))}const _w="color",kw=e=>{const t=We(e,_w);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},ww=e=>{if("web"!==Zo.Z.OS)return!1;const t=We(e,_w);return null!==t&&"object"==typeof t&&!!t.link},xw=e=>{const t=We(e,_w);return null!==t&&"object"==typeof t&&!!t.gradients},Cw=e=>{const t=We(e,_w);return t&&!1!==t.background},Ew=e=>{const t=We(e,_w);return t&&!1!==t.text},Sw=(e,t)=>Ys(Js(t,e,void 0)),Iw=e=>({textColor:void 0,style:Sw(["color","text"],e.style)}),Tw=e=>({style:Sw(["elements","link","color","text"],e.style)}),Nw=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function Bw(e,t,n){var r,o,i,l,a,s;if(!kw(t)||Qs(t,_w))return e;const c=xw(t),{backgroundColor:u,textColor:d,gradient:p,style:m}=n,h=e=>!Qs(t,_w,e),f=h("text")?Ok("color",d):void 0,v=h("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(p):void 0,b=h("background")?Ok("background-color",u):void 0,y=h("background")||h("gradients"),_=u||(null==m||null===(r=m.color)||void 0===r?void 0:r.background)||c&&(p||(null==m||null===(o=m.color)||void 0===o?void 0:o.gradient)),k=g()(e.className,f,v,{[b]:!(c&&null!=m&&null!==(i=m.color)&&void 0!==i&&i.gradient||!b),"has-text-color":h("text")&&(d||(null==m||null===(l=m.color)||void 0===l?void 0:l.text)),"has-background":y&&_,"has-link-color":h("link")&&(null==m||null===(a=m.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=k||void 0,e}const Aw=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Rk(e,n[1]).color:t};function Lw(e){var t,n,r,o,i,l,a,s,c;const{name:d,attributes:p}=e,m=Hs("color.palette.custom"),h=Hs("color.palette.theme"),f=Hs("color.palette.default"),g=(0,u.useMemo)((()=>[...m||[],...h||[],...f||[]]),[m,h,f]),v=Hs("color.gradients.custom"),b=Hs("color.gradients.theme"),y=Hs("color.gradients.default"),_=(0,u.useMemo)((()=>[...v||[],...b||[],...y||[]]),[v,b,y]),k=Hs("color.custom"),x=Hs("color.customGradient"),C=Hs("color.background"),E=Hs("color.link"),S=Hs("color.text"),I=k||!h||(null==h?void 0:h.length)>0,T=x||!b||(null==b?void 0:b.length)>0,N=(0,u.useRef)(p);if((0,u.useEffect)((()=>{N.current=p}),[p]),!kw(d))return null;const B=ww(d)&&E&&I,A=Ew(d)&&S&&I,L=Cw(d)&&C&&I,P=xw(d)&&T;if(!(B||A||L||P))return null;const{style:D,textColor:R,backgroundColor:M,gradient:O}=p;let F;if(P&&O)F=function(e,t){const n=(0,H.find)(e,["slug",t]);return n&&n.gradient}(_,O);else if(P){var j;F=null==D||null===(j=D.color)||void 0===j?void 0:j.gradient}const Z=t=>n=>{var r,o;const i=Mk(g,n),l=t+"Color",a={...N.current.style,color:{...null===(r=N.current)||void 0===r||null===(o=r.style)||void 0===o?void 0:o.color,[t]:null!=i&&i.slug?void 0:n}},s=null!=i&&i.slug?i.slug:void 0,c={style:Ys(a),[l]:s};e.setAttributes(c),N.current={...N.current,...c}},z=!("web"!==Zo.Z.OS||O||null!=D&&null!==(t=D.color)&&void 0!==t&&t.gradient),V=We(e.name,[_w,"__experimentalDefaultControls"]);return(0,u.createElement)(yw,{enableContrastChecking:z,clientId:e.clientId,enableAlpha:!0,settings:[...A?[{label:(0,w.__)("Text"),onColorChange:Z("text"),colorValue:Rk(g,R,null==D||null===(n=D.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==V?void 0:V.text,resetAllFilter:Iw}]:[],...L||P?[{label:(0,w.__)("Background"),onColorChange:L?Z("background"):void 0,colorValue:Rk(g,M,null==D||null===(r=D.color)||void 0===r?void 0:r.background).color,gradientValue:F,onGradientChange:P?t=>{const n=function(e,t){const n=function(e,t){return(0,H.find)(e,["gradient",t])}(e,t);return n&&n.slug}(_,t);let r;if(n){var o,i,l;const e={...null===(o=N.current)||void 0===o?void 0:o.style,color:{...null===(i=N.current)||void 0===i||null===(l=i.style)||void 0===l?void 0:l.color,gradient:void 0}};r={style:Ys(e),gradient:n}}else{var a,s,c;const e={...null===(a=N.current)||void 0===a?void 0:a.style,color:{...null===(s=N.current)||void 0===s||null===(c=s.style)||void 0===c?void 0:c.color,gradient:t}};r={style:Ys(e),gradient:void 0}}e.setAttributes(r),N.current={...N.current,...r}}:void 0,isShownByDefault:null==V?void 0:V.background,resetAllFilter:Nw}]:[],...B?[{label:(0,w.__)("Link"),onColorChange:t=>{var n;const r=Mk(g,t),o=null!=r&&r.slug?`var:preset|color|${r.slug}`:t,i=Ys(Js(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],o));e.setAttributes({style:i}),N.current={...N.current,style:i}},colorValue:Aw(g,null==D||null===(o=D.elements)||void 0===o||null===(i=o.link)||void 0===i||null===(l=i.color)||void 0===l?void 0:l.text),clearable:!(null==D||null===(a=D.elements)||void 0===a||null===(s=a.link)||void 0===s||null===(c=s.color)||void 0===c||!c.text),isShownByDefault:null==V?void 0:V.link,resetAllFilter:Tw}]:[]]})}const Pw=(0,yo.o)((e=>t=>{var n;const{name:r,attributes:o}=t,{backgroundColor:i,textColor:l}=o,a=Hs("color.palette.custom")||[],s=Hs("color.palette.theme")||[],c=Hs("color.palette.default")||[],d=(0,u.useMemo)((()=>[...a||[],...s||[],...c||[]]),[a,s,c]);if(!kw(r)||Qs(r,_w))return(0,u.createElement)(e,t);const p={};var m,h;l&&!Qs(r,_w,"text")&&(p.color=null===(m=Rk(d,l))||void 0===m?void 0:m.color),i&&!Qs(r,_w,"background")&&(p.backgroundColor=null===(h=Rk(d,i))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...p,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,u.createElement)(e,(0,bo.Z)({},t,{wrapperProps:f}))})),Dw={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,_e.KJ)("blocks.registerBlockType","core/color/addAttribute",(function(e){return kw(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),xw(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Bw),(0,_e.KJ)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!kw(e)||Qs(e,_w))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),Bw(r,e,n)},e})),(0,_e.KJ)("editor.BlockListBlock","core/color/with-color-palette-styles",Pw),(0,_e.KJ)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){const o=e.name;return Xs({linkColor:ww(o),textColor:Ew(o),backgroundColor:Cw(o),gradient:xw(o)},Dw,e,t,n,r)}));var Rw=n(75929);const Mw=[{name:(0,w._x)("Regular","font style"),value:"normal"},{name:(0,w._x)("Italic","font style"),value:"italic"}],Ow=[{name:(0,w._x)("Thin","font weight"),value:"100"},{name:(0,w._x)("Extra Light","font weight"),value:"200"},{name:(0,w._x)("Light","font weight"),value:"300"},{name:(0,w._x)("Regular","font weight"),value:"400"},{name:(0,w._x)("Medium","font weight"),value:"500"},{name:(0,w._x)("Semi Bold","font weight"),value:"600"},{name:(0,w._x)("Bold","font weight"),value:"700"},{name:(0,w._x)("Extra Bold","font weight"),value:"800"},{name:(0,w._x)("Black","font weight"),value:"900"}],Fw=(e,t)=>e?t?(0,w.__)("Appearance"):(0,w.__)("Font style"):(0,w.__)("Font weight");function jw(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:r=!0,value:{fontStyle:o,fontWeight:i}}=e,l=n||r,a=Fw(n,r),s={key:"default",name:(0,w.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},c=(0,u.useMemo)((()=>n&&r?(()=>{const e=[s];return Mw.forEach((t=>{let{name:n,value:r}=t;Ow.forEach((t=>{let{name:o,value:i}=t;const l="normal"===r?o:(0,w.sprintf)((0,w.__)("%1$s %2$s"),o,n);e.push({key:`${r}-${i}`,name:l,style:{fontStyle:r,fontWeight:i}})}))})),e})():n?(()=>{const e=[s];return Mw.forEach((t=>{let{name:n,value:r}=t;e.push({key:r,name:n,style:{fontStyle:r,fontWeight:void 0}})})),e})():(()=>{const e=[s];return Ow.forEach((t=>{let{name:n,value:r}=t;e.push({key:r,name:n,style:{fontStyle:void 0,fontWeight:r}})})),e})()),[e.options]),d=c.find((e=>e.style.fontStyle===o&&e.style.fontWeight===i))||c[0];return l&&(0,u.createElement)(Rw.Z,{className:"components-font-appearance-control",label:a,describedBy:d?n?r?(0,w.sprintf)((0,w.__)("Currently selected font appearance: %s"),d.name):(0,w.sprintf)((0,w.__)("Currently selected font style: %s"),d.name):(0,w.sprintf)((0,w.__)("Currently selected font weight: %s"),d.name):(0,w.__)("No selected font appearance"),options:c,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}var Zw=n(83716);var zw=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:r=!1,__unstableInputWidth:o="60px"}=e;const i=function(e){return void 0!==e&&""!==e}(t),l=i?t:"";r||(0,Wo.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 a=r?void 0:{marginBottom:24};return(0,u.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,u.createElement)(Zw.Z,{__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{var n;const r=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),o=((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}})(e.value,r);return{...e,value:o}},onChange:n,label:(0,w.__)("Line height"),placeholder:1.5,step:.1,value:l,min:0}))};const Hw="typography.lineHeight";function Vw(e){var t;const{attributes:{style:n},setAttributes:r}=e;return(0,u.createElement)(zw,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};r({style:Ys(t)})}})}function Ww(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Hs("typography.lineHeight");return!Ue(e,Hw)||t}const Uw="typography.__experimentalFontStyle",$w="typography.__experimentalFontWeight";function Gw(e){var t,n;const{attributes:{style:r},setAttributes:o}=e,i=!qw(e),l=!Kw(e),a=null==r||null===(t=r.typography)||void 0===t?void 0:t.fontStyle,s=null==r||null===(n=r.typography)||void 0===n?void 0:n.fontWeight;return(0,u.createElement)(jw,{onChange:e=>{o({style:Ys({...r,typography:{...null==r?void 0:r.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:i,hasFontWeights:l,value:{fontStyle:a,fontWeight:s}})}function qw(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ue(e,Uw),n=Hs("typography.fontStyle");return!t||!n}function Kw(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ue(e,$w),n=Hs("typography.fontWeight");return!t||!n}function Yw(e){const t=qw(e),n=Kw(e);return t&&n}function Jw(e){let{value:t="",onChange:n,fontFamilies:r,...o}=e;const i=Hs("typography.fontFamilies");if(r||(r=i),(0,H.isEmpty)(r))return null;const l=[{value:"",label:(0,w.__)("Default")},...r.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,u.createElement)(Qv.Z,(0,bo.Z)({label:(0,w.__)("Font family"),options:l,value:t,onChange:n,labelPosition:"top"},o))}const Xw="typography.__experimentalFontFamily";function Qw(e,t,n){if(!Ue(t,Xw))return e;if(Qs(t,Ax,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const r=new Vy(e.className);r.add(`has-${(0,H.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const o=r.value;return e.className=o||void 0,e}function ex(e){var t;let{setAttributes:n,attributes:{fontFamily:r}}=e;const o=Hs("typography.fontFamilies"),i=null===(t=(0,H.find)(o,(e=>{let{slug:t}=e;return r===t})))||void 0===t?void 0:t.fontFamily;return(0,u.createElement)(Jw,{className:"block-editor-hooks-font-family-control",fontFamilies:o,value:i,onChange:function(e){const t=(0,H.find)(o,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function tx(e){let{name:t}=e;const n=Hs("typography.fontFamilies");return!n||0===n.length||!Ue(t,Xw)}(0,_e.KJ)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return Ue(e,Xw)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Qw),(0,_e.KJ)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!Ue(e,Xw))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),Qw(r,e,n)},e}));const nx=(e,t,n)=>{if(t){const n=(0,H.find)(e,{slug:t});if(n)return n}return{size:n}};function rx(e){if(e)return`has-${(0,H.kebabCase)(e)}-font-size`}var ox=n(91016),ix=function(e){const t=Hs("typography.fontSizes"),n=!Hs("typography.customFontSize");return(0,u.createElement)(ox.Z,(0,bo.Z)({},e,{fontSizes:t,disableCustomFontSizes:n}))};const lx="typography.fontSize";function ax(e,t,n){if(!Ue(t,lx))return e;if(Qs(t,Ax,"fontSize"))return e;const r=new Vy(e.className);r.add(rx(n.fontSize));const o=r.value;return e.className=o||void 0,e}function sx(e){var t,n;const{attributes:{fontSize:r,style:o},setAttributes:i}=e,l=Hs("typography.fontSizes"),a=nx(l,r,null==o||null===(t=o.typography)||void 0===t?void 0:t.fontSize),s=(null==a?void 0:a.size)||(null==o||null===(n=o.typography)||void 0===n?void 0:n.fontSize)||r;return(0,u.createElement)(ix,{onChange:e=>{const t=function(e,t){return(0,H.find)(e,{size:t})||{size:t}}(l,e).slug;i({style:Ys({...o,typography:{...null==o?void 0:o.typography,fontSize:t?void 0:e}}),fontSize:t})},value:s,withReset:!1})}function cx(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hs("typography.fontSizes"),n=!(null==t||!t.length);return!Ue(e,lx)||!n}const ux=(0,yo.o)((e=>t=>{var n,r;const o=Hs("typography.fontSizes"),{name:i,attributes:{fontSize:l,style:a},wrapperProps:s}=t;if(!Ue(i,lx)||Qs(i,Ax,"fontSize")||!l||null!=a&&null!==(n=a.typography)&&void 0!==n&&n.fontSize)return(0,u.createElement)(e,t);const c=nx(o,l,null==a||null===(r=a.typography)||void 0===r?void 0:r.fontSize).size,d={...t,wrapperProps:{...s,style:{fontSize:c,...null==s?void 0:s.style}}};return(0,u.createElement)(e,d)}),"withFontSizeInlineStyles"),dx={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,_e.KJ)("blocks.registerBlockType","core/font/addAttribute",(function(e){return Ue(e,lx)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/font/addSaveProps",ax),(0,_e.KJ)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!Ue(e,lx))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),ax(r,e,n)},e})),(0,_e.KJ)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ux),(0,_e.KJ)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,r){return Xs({fontSize:Ue(e.name,lx)},dx,e,t,n,r)}));var px=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),mx=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const hx=[{name:(0,w.__)("Underline"),value:"underline",icon:px},{name:(0,w.__)("Strikethrough"),value:"line-through",icon:mx}];function fx(e){let{value:t,onChange:n}=e;return(0,u.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,u.createElement)("legend",null,(0,w.__)("Decoration")),(0,u.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},hx.map((e=>(0,u.createElement)(Ss.Z,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const gx="typography.__experimentalTextDecoration";function vx(e){var t;const{attributes:{style:n},setAttributes:r}=e;return(0,u.createElement)(fx,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){r({style:Ys({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function bx(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Ue(e,gx),n=Hs("typography.textDecoration");return t||!n}var yx=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),_x=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),kx=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const wx=[{name:(0,w.__)("Uppercase"),value:"uppercase",icon:yx},{name:(0,w.__)("Lowercase"),value:"lowercase",icon:_x},{name:(0,w.__)("Capitalize"),value:"capitalize",icon:kx}];function xx(e){let{value:t,onChange:n}=e;return(0,u.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,u.createElement)("legend",null,(0,w.__)("Letter case")),(0,u.createElement)("div",{className:"block-editor-text-transform-control__buttons"},wx.map((e=>(0,u.createElement)(Ss.Z,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Cx="typography.__experimentalTextTransform";function Ex(e){var t;const{attributes:{style:n},setAttributes:r}=e;return(0,u.createElement)(xx,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){r({style:Ys({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Sx(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Ue(e,Cx),n=Hs("typography.textTransform");return t||!n}function Ix(e){let{value:t,onChange:n,__unstableInputWidth:r="60px"}=e;const o=(0,Bs.nj)({availableUnits:Hs("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,u.createElement)(Ls.ZP,{label:(0,w.__)("Letter spacing"),value:t,__unstableInputWidth:r,units:o,onChange:n})}const Tx="typography.__experimentalLetterSpacing";function Nx(e){var t;const{attributes:{style:n},setAttributes:r}=e;return(0,u.createElement)(Ix,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){r({style:Ys({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Bx(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Ue(e,Tx),n=Hs("typography.letterSpacing");return t||!n}const Ax="typography",Lx=[Hw,lx,Uw,$w,Xw,gx,Cx,Tx];function Px(e){const{clientId:t}=e,n=tx(e),r=cx(e),o=Yw(e),i=Ww(e),l=bx(e),a=Sx(e),s=Bx(e),c=!qw(e),d=!Kw(e),p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Yw(e),cx(e),Ww(e),tx(e),bx(e),Sx(e),Bx(e)];return t.filter(Boolean).length===t.length}(e),m=Dx(e.name);if(p||!m)return null;const h=We(e.name,[Ax,"__experimentalDefaultControls"]),f=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,u.createElement)(lc,{__experimentalGroup:"typography"},!n&&(0,u.createElement)(Vs.Z,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,w.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==h?void 0:h.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,u.createElement)(ex,e)),!r&&(0,u.createElement)(Vs.Z,{hasValue:()=>function(e){var t;const{fontSize:n,style:r}=e.attributes;return!!n||!(null==r||null===(t=r.typography)||void 0===t||!t.fontSize)}(e),label:(0,w.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({fontSize:void 0,style:Ys({...r,typography:{...null==r?void 0:r.typography,fontSize:void 0}})})}(e),isShownByDefault:null==h?void 0:h.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,u.createElement)(sx,e)),!o&&(0,u.createElement)(Vs.Z,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:r}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!r}(e),label:Fw(c,d),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:Ys({...r,typography:{...null==r?void 0:r.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==h?void 0:h.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,u.createElement)(Gw,e)),!i&&(0,u.createElement)(Vs.Z,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,w.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:Ys({...r,typography:{...null==r?void 0:r.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==h?void 0:h.lineHeight,resetAllFilter:f("lineHeight"),panelId:t},(0,u.createElement)(Vw,e)),!l&&(0,u.createElement)(Vs.Z,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,w.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:Ys({...r,typography:{...null==r?void 0:r.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==h?void 0:h.textDecoration,resetAllFilter:f("textDecoration"),panelId:t},(0,u.createElement)(vx,e)),!a&&(0,u.createElement)(Vs.Z,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,w.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:Ys({...r,typography:{...null==r?void 0:r.typography,textTransform:void 0}})})}(e),isShownByDefault:null==h?void 0:h.textTransform,resetAllFilter:f("textTransform"),panelId:t},(0,u.createElement)(Ex,e)),!s&&(0,u.createElement)(Vs.Z,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,w.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:Ys({...r,typography:{...null==r?void 0:r.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==h?void 0:h.letterSpacing,resetAllFilter:f("letterSpacing"),panelId:t},(0,u.createElement)(Nx,e)))}const Dx=e=>Lx.some((t=>Ue(e,t))),Rx=[...Lx,Zk,_w,vc],Mx=e=>Rx.some((t=>Ue(e,t))),Ox="var:";function Fx(e){var t;return null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,Ox)?`var(--wp--${e.slice(Ox.length).split("|").join("--")})`:e}function jx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(Be).forEach((r=>{if(Be[r].rootOnly)return;const o=Be[r].value,i=Be[r].properties;if((0,H.has)(e,o)&&"elements"!==(null==o?void 0:o[0])){const l=(0,H.get)(e,o);Be[r].useEngine||(i&&"string"!=typeof l?Object.entries(i).forEach((e=>{const[t,r]=e,o=(0,H.get)(l,[r]);o&&(n[t]=Fx(o))})):t.includes(o.join("."))||(n[r]=Fx((0,H.get)(e,o))))}}));const r=Su(e);return r.forEach((e=>{n[e.key]=e.value})),n}const Zx={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[_w],[`${Ax}.__experimentalSkipSerialization`]:[Ax],[`${vc}.__experimentalSkipSerialization`]:["spacing"]},zx={...Zx,[`${vc}`]:["spacing.blockGap"]},Hx={gradients:"gradient"};function Vx(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zx;if(!Mx(t))return e;let{style:o}=n;return Object.entries(r).forEach((e=>{let[n,r]=e;const i=We(t,n);!0===i&&(o=(0,H.omit)(o,r)),Array.isArray(i)&&i.forEach((e=>{const t=Hx[e]||e;o=(0,H.omit)(o,[[...r,t]])}))})),e.style={...jx(o),...e.style},e}const Wx=(0,yo.o)((e=>t=>{const n=ss();return(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Lw,t),(0,u.createElement)(Px,t),(0,u.createElement)($k,t),(0,u.createElement)(_c,t)),(0,u.createElement)(e,t))}),"withToolbarControls"),Ux=(0,yo.o)((e=>t=>{var n,r;const o=`wp-elements-${(0,id.Z)(e)}`,i=Qs(t.name,_w,"link"),l=(0,u.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,r=[];if(n&&Object.keys(n).length>0){var l;const e={...n,link:{...n.link,color:i||null===(l=n.link)||void 0===l?void 0:l.color}};for(const[t,n]of Object.entries(e)){const e=Eu(n,{selector:`.editor-styles-wrapper .${o} ${Ae[t]}`});e&&r.push(e)}}return r.length>0?r:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),a=(0,u.useContext)(fk.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,l&&a&&(0,d.createPortal)((0,u.createElement)("style",{dangerouslySetInnerHTML:{__html:l}}),a),(0,u.createElement)(e,(0,bo.Z)({},t,{className:null!==(r=t.attributes.style)&&void 0!==r&&r.elements?g()(t.className,o):t.className})))}));(0,_e.KJ)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Mx(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Vx),(0,_e.KJ)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Mx(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),Vx(r,e,n,Zx)},e})),(0,_e.KJ)("editor.BlockEdit","core/style/with-block-controls",Wx),(0,_e.KJ)("editor.BlockListBlock","core/editor/with-elements-styles",Ux),(0,_e.KJ)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t;return Ue(e,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var $x=n(78998),Gx=n(28734),qx=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),Kx=function(e){let t,{colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:l,onChange:a}=e;return t="unset"===l?(0,u.createElement)(Qk.Z,{className:"block-editor-duotone-control__unset-indicator"}):l?(0,u.createElement)($x.Z,{values:l}):(0,u.createElement)(qc.Z,{icon:qx}),(0,u.createElement)(ng.Z,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,w.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,u.createElement)(By.Z,{showTooltip:!0,onClick:r,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==Uf.DOWN||(e.preventDefault(),r())},label:(0,w.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,u.createElement)(gs.Z,{label:(0,w.__)("Duotone")},(0,u.createElement)("div",{className:"block-editor-duotone-control__description"},(0,w.__)("Create a two-tone color effect without losing your original image.")),(0,u.createElement)(Gx.Z,{colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:l,onChange:a}))})};const Yx=[];function Jx(e){let{selector:t,id:n,colors:r}=e;return"unset"===r?(0,u.createElement)(wv,{selector:t}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(xv,{id:n,colors:r}),(0,u.createElement)(kv,{id:n,selector:t}))}function Xx(e){let{presetSetting:t,defaultSetting:n}=e;const r=!Hs(n),o=Hs(`${t}.custom`)||Yx,i=Hs(`${t}.theme`)||Yx,l=Hs(`${t}.default`)||Yx;return(0,u.useMemo)((()=>[...o,...i,...r?Yx:l]),[r,o,i,l])}function Qx(e){var t;let{attributes:n,setAttributes:r}=e;const o=null==n?void 0:n.style,i=null==o||null===(t=o.color)||void 0===t?void 0:t.duotone,l=Xx({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Xx({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!Hs("color.custom"),c=!Hs("color.customDuotone")||0===(null==a?void 0:a.length)&&s;return 0===(null==l?void 0:l.length)&&c?null:(0,u.createElement)(hs,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Kx,{duotonePalette:l,colorPalette:a,disableCustomDuotone:c,disableCustomColors:s,value:i,onChange:e=>{const t={...o,color:{...null==o?void 0:o.color,duotone:e}};r({style:t})}}))}(0,ke.l7)([we.Z]);const eC=(0,yo.o)((e=>t=>{const n=Ue(t.name,"color.__experimentalDuotone");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&(0,u.createElement)(Qx,t))}),"withDuotoneControls"),tC=(0,yo.o)((e=>t=>{var n,r,o;const i=We(t.name,"color.__experimentalDuotone"),l=null==t||null===(n=t.attributes)||void 0===n||null===(r=n.style)||void 0===r||null===(o=r.color)||void 0===o?void 0:o.duotone;if(!i||!l)return(0,u.createElement)(e,t);const a=`wp-duotone-${(0,id.Z)(e)}`,s=function(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(", ")}(`.editor-styles-wrapper .${a}`,i),c=g()(null==t?void 0:t.className,a),p=(0,u.useContext)(fk.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,p&&(0,d.createPortal)((0,u.createElement)(Jx,{selector:s,id:a,colors:l}),p),(0,u.createElement)(e,(0,bo.Z)({},t,{className:c})))}),"withDuotoneStyles");(0,_e.KJ)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return Ue(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,_e.KJ)("editor.BlockEdit","core/editor/duotone/with-editor-controls",eC),(0,_e.KJ)("editor.BlockListBlock","core/editor/duotone/with-styles",tC);var nC=n(82741);const rC="__experimentalLayout";function oC(e){let{setAttributes:t,attributes:n,name:r}=e;const{layout:o}=n,i=Hs("layout"),l=(0,b.Z)((e=>{const{getSettings:t}=e(rs);return t().supportsLayout}),[]),a=We(r,rC,{}),{allowSwitching:s,allowEditing:c=!0,allowInheriting:d=!0,default:p}=a;if(!c)return null;const m=!(!d||!i||null!=o&&o.type&&"default"!==(null==o?void 0:o.type)&&(null==o||!o.inherit)),h=o||p||{},{inherit:f=!1,type:g="default"}=h;if("default"===g&&!l)return null;const v=Nu(g),y=e=>t({layout:e});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(lc,null,(0,u.createElement)(Qu.Z,{title:(0,w.__)("Layout")},m&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Is.Z,{label:(0,w.__)("Inner blocks use full width"),checked:!f,onChange:()=>t({layout:{inherit:!f}})}),(0,u.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},f?(0,w.__)("Nested blocks use theme content width with options for full and wide widths."):(0,w.__)("Nested blocks will fill the width of this container."))),!f&&s&&(0,u.createElement)(iC,{type:g,onChange:e=>t({layout:{type:e}})}),!f&&v&&(0,u.createElement)(v.inspectorControls,{layout:h,onChange:y,layoutBlockSupport:a}))),!f&&v&&(0,u.createElement)(v.toolBarControls,{layout:h,onChange:y,layoutBlockSupport:a}))}function iC(e){let{type:t,onChange:n}=e;return(0,u.createElement)(nC.Z,null,Tu.map((e=>{let{name:r,label:o}=e;return(0,u.createElement)(Ss.Z,{key:r,isPressed:t===r,onClick:()=>n(r)},o)})))}const lC=(0,yo.o)((e=>t=>{const{name:n}=t;return[Ue(n,rC)&&(0,u.createElement)(oC,(0,bo.Z)({key:"layout"},t)),(0,u.createElement)(e,(0,bo.Z)({key:"edit"},t))]}),"withInspectorControls"),aC=(0,yo.o)((e=>t=>{const{name:n,attributes:r}=t,o=Ue(n,rC),i=(0,id.Z)(e),l=Hs("layout")||{},a=(0,u.useContext)(fk.__unstableElementContext),{layout:s}=r,{default:c}=We(n,rC)||{},p=null!=s&&s.inherit?l:s||c||{},m=o?function(e,t){var n;const r=(0,b.Z)((e=>{var t;const{getSettings:n}=e(rs);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),o=[];var i;return null!=t&&null!==(n=t[(null==e?void 0:e.type)||"default"])&&void 0!==n&&n.className&&o.push(null==t||null===(i=t[(null==e?void 0:e.type)||"default"])||void 0===i?void 0:i.className),(null!=e&&e.inherit||null!=e&&e.contentSize)&&r&&o.push("has-global-padding"),null!=e&&e.orientation&&o.push(`is-${(0,H.kebabCase)(e.orientation)}`),null!=e&&e.justifyContent&&o.push(`is-content-justification-${(0,H.kebabCase)(e.justifyContent)}`),null!=e&&e.flexWrap&&"nowrap"===e.flexWrap&&o.push("is-nowrap"),o}(p,null==l?void 0:l.definitions):null,h=`.${Qt(n)}.wp-container-${i}`,f=null!==Hs("spacing.blockGap");let v;if(o){var y;const e=Nu((null==p?void 0:p.type)||"default");v=null==e||null===(y=e.getLayoutStyle)||void 0===y?void 0:y.call(e,{blockName:n,selector:h,layout:p,layoutDefinitions:null==l?void 0:l.definitions,style:null==r?void 0:r.style,hasBlockGapSupport:f})}const _=g()(null==t?void 0:t.className,{[`wp-container-${i}`]:o&&!!v},m);return(0,u.createElement)(u.Fragment,null,o&&a&&!!v&&(0,d.createPortal)((0,u.createElement)(Du,{blockName:n,selector:h,css:v,layout:p,style:null==r?void 0:r.style}),a),(0,u.createElement)(e,(0,bo.Z)({},t,{className:_})))}));function sC(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Yk(e)||void 0,style:jx({border:n})}}function cC(e){const{colors:t}=jk(),n=sC(e),{borderColor:r}=e;if(r){const e=Wk({colors:t,namedColor:r});n.style.borderColor=e.color}return n}(0,_e.KJ)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,H.has)(e.attributes,["layout","type"])||Ue(e,rC)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,_e.KJ)("editor.BlockListBlock","core/editor/layout/with-layout-styles",aC),(0,_e.KJ)("editor.BlockEdit","core/editor/layout/with-inspector-controls",lC);var uC=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),dC=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),pC=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const mC=[{icon:uC,title:(0,w.__)("Align text left"),align:"left"},{icon:dC,title:(0,w.__)("Align text center"),align:"center"},{icon:pC,title:(0,w.__)("Align text right"),align:"right"}],hC={position:"bottom right",isAlternate:!0};var fC=function(e){let{value:t,onChange:n,alignmentControls:r=mC,label:o=(0,w.__)("Align"),describedBy:i=(0,w.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:a}=e;function s(e){return()=>n(t===e?void 0:e)}const c=(0,H.find)(r,(e=>e.align===t)),d=a?wo.Z:fs.Z,p=a?{isCollapsed:l}:{};return(0,u.createElement)(d,(0,bo.Z)({icon:c?c.icon:(0,w.isRTL)()?pC:uC,label:o,toggleProps:{describedBy:i},popoverProps:hC,controls:r.map((e=>{const{align:n}=e,r=t===n;return{...e,isActive:r,role:l?"menuitemradio":void 0,onClick:s(n)}}))},p))};const gC=e=>(0,u.createElement)(fC,(0,bo.Z)({},e,{isToolbar:!1}));var vC=n(2302),bC=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),yC=function(e){let{icon:t=bC,label:n=(0,w.__)("Choose variation"),instructions:r=(0,w.__)("Select a variation to start with."),variations:o,onSelect:i,allowSkip:l}=e;const a=g()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,u.createElement)(vC.Z,{icon:t,label:n,instructions:r,className:a},(0,u.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,w.__)("Block variations")},o.map((e=>(0,u.createElement)("li",{key:e.name},(0,u.createElement)(Ss.Z,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>i(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,u.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),l&&(0,u.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,u.createElement)(Ss.Z,{variant:"link",onClick:()=>i()},(0,w.__)("Skip"))))},_C=(0,yo.o)((e=>t=>{const n=Hs("color.palette"),r=!Hs("color.custom"),o=void 0===t.colors?n:t.colors,i=void 0===t.disableCustomColors?r:t.disableCustomColors,l=!(0,H.isEmpty)(o)||!i;return(0,u.createElement)(e,(0,bo.Z)({},t,{colors:o,disableCustomColors:i,hasColorsToChoose:l}))}),"withColorContext")(tw.ZP),kC=function(e,t){return kC=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])},kC(e,t)},wC=function(){return wC=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},wC.apply(this,arguments)};Object.create,Object.create;var xC=n(91544),CC=n.n(xC);function EC(e,t,n,r,o,i){void 0===i&&(i=0);var l=MC(e,t,i),a=l.width,s=l.height,c=Math.min(a,n),u=Math.min(s,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}function SC(e,t,n,r,o){void 0===o&&(o=0);var i=MC(t.width,t.height,o),l=i.width,a=i.height;return{x:IC(e.x,l,n.width,r),y:IC(e.y,a,n.height,r)}}function IC(e,t,n,r){var o=t*r/2-n/2;return Math.min(o,Math.max(e,-o))}function TC(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function NC(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function BC(e,t,n,r,o,i,l){void 0===i&&(i=0),void 0===l&&(l=!0);var a=l&&0===i?AC:LC,s={x:a(100,((t.width-n.width/o)/2-e.x/o)/t.width*100),y:a(100,((t.height-n.height/o)/2-e.y/o)/t.height*100),width:a(100,n.width/t.width*100/o),height:a(100,n.height/t.height*100/o)},c=Math.round(a(t.naturalWidth,s.width*t.naturalWidth/100)),u=Math.round(a(t.naturalHeight,s.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*r?{width:Math.round(u*r),height:u}:{width:c,height:Math.round(c/r)};return{croppedAreaPercentages:s,croppedAreaPixels:wC(wC({},d),{x:Math.round(a(t.naturalWidth-d.width,s.x*t.naturalWidth/100)),y:Math.round(a(t.naturalHeight-d.height,s.y*t.naturalHeight/100))})}}function AC(e,t){return Math.min(e,Math.max(0,t))}function LC(e,t){return t}function PC(e,t,n){var r=t.width/t.naturalWidth,o=function(e,t,n){var r=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/r/e.height:n.width/r/e.width;var o=e.width/e.height;return t.naturalWidth>=t.naturalHeight*o?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),i=r*o;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*i,y:((t.naturalHeight-e.height)/2-e.y)*i},zoom:o}}function DC(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function RC(e,t,n,r,o){var i=Math.cos,l=Math.sin,a=o*Math.PI/180;return[(e-n)*i(a)-(t-r)*l(a)+n,(e-n)*l(a)+(t-r)*i(a)+r]}function MC(e,t,n){var r=e/2,o=t/2,i=[RC(0,0,r,o,n),RC(e,0,r,o,n),RC(e,t,r,o,n),RC(0,t,r,o,n)],l=Math.min.apply(Math,i.map((function(e){return e[0]}))),a=Math.max.apply(Math,i.map((function(e){return e[0]}))),s=Math.min.apply(Math,i.map((function(e){return e[1]})));return{width:a-l,height:Math.max.apply(Math,i.map((function(e){return e[1]})))-s}}function OC(){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 FC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,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.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,r=e.cropSize;if(t){var o=PC(t,n.mediaSize,r),i=o.crop,l=o.zoom;n.props.onCropChange(i),n.props.onZoomChange&&n.props.onZoomChange(l)}},n.computeSizes=function(){var e,t,r,o,i,l,a=n.imageRef||n.videoRef;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.mediaSize={width:a.offsetWidth,height:a.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(r=n.imageRef)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef)||void 0===o?void 0:o.videoHeight)||0};var s=n.props.cropSize?n.props.cropSize:EC(a.offsetWidth,a.offsetHeight,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===s.height&&(null===(l=n.state.cropSize)||void 0===l?void 0:l.width)===s.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(s),n.setState({cropSize:s},n.recomputeCropPosition)}},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.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.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=wC({},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.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.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},l=n.props.restrictPosition?SC(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(l)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var r=t.getMousePoint(e),o=CC()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r),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=window.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,l=o.zoom;return{x:(t+i.x)/l,y:(r+i.y)/l}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var r=n.getPointOnContainer(t),o=n.getPointOnMedia(r),i=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),l={x:o.x*i-r.x,y:o.y*i-r.y},a=n.props.restrictPosition?SC(l,n.mediaSize,n.state.cropSize,i,n.props.rotation):l;n.props.onCropChange(a),n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?BC(n.props.restrictPosition?SC(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?SC(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}kC(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),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",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,l,a,s,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(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===(l=this.props.crop)||void 0===l?void 0:l.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(s=this.props.crop)||void 0===s?void 0:s.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef)||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=TC(n,r),this.lastPinchRotation=NC(n,r),this.onDragStart(DC(n,r))},t.prototype.onPinchMove=function(e){var n=this,r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=DC(r,o);this.onDrag(i),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=TC(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i),n.lastPinchDistance=e;var l=NC(r,o),a=n.props.rotation+(l-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=l}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,r=t.video,o=t.mediaProps,i=t.transform,l=t.crop,a=l.x,s=l.y,c=t.rotation,d=t.zoom,p=t.cropShape,m=t.showGrid,h=t.style,f=h.containerStyle,g=h.cropAreaStyle,v=h.mediaStyle,b=t.classes,y=b.containerClassName,_=b.cropAreaClassName,k=b.mediaClassName,w=t.objectFit;return u.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:OC("reactEasyCrop_Container",y)},n?u.createElement("img",wC({alt:"",className:OC("reactEasyCrop_Image","contain"===w&&"reactEasyCrop_Contain","horizontal-cover"===w&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===w&&"reactEasyCrop_Cover_Vertical",k)},o,{src:n,ref:function(t){return e.imageRef=t},style:wC(wC({},v),{transform:i||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+d+")"}),onLoad:this.onMediaLoad})):r&&u.createElement("video",wC({autoPlay:!0,loop:!0,muted:!0,className:OC("reactEasyCrop_Video","contain"===w&&"reactEasyCrop_Contain","horizontal-cover"===w&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===w&&"reactEasyCrop_Cover_Vertical",k)},o,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:wC(wC({},v),{transform:i||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+d+")"}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map((function(e){return u.createElement("source",wC({key:e.src},e))}))),this.state.cropSize&&u.createElement("div",{style:wC(wC({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:OC("reactEasyCrop_CropArea","round"===p&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(u.Component),jC=FC,ZC=n(3386);const zC={position:"bottom right",isAlternate:!0};const HC=(0,u.createContext)({}),VC=()=>(0,u.useContext)(HC);function WC(e){let{id:t,url:n,naturalWidth:r,naturalHeight:o,isEditing:i,onFinishEditing:l,onSaveImage:a,children:s}=e;const c=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:r}=e;const[o,i]=(0,u.useState)(),[l,a]=(0,u.useState)(),[s,c]=(0,u.useState)({x:0,y:0}),[d,p]=(0,u.useState)(),[m,h]=(0,u.useState)(),[f,g]=(0,u.useState)(),[v,b]=(0,u.useState)(),y=(0,u.useCallback)((()=>{c({x:0,y:0}),p(100),h(0),g(n/r),b(n/r)}),[n,r,c,p,h,g,b]),_=(0,u.useCallback)((()=>{const e=(m+90)%360;let o=n/r;if(m%180==90&&(o=r/n),0===e)return i(),h(e),g(1/f),void c({x:-s.y*o,y:s.x*o});const l=new window.Image;l.src=t,l.onload=function(t){const n=document.createElement("canvas");let r=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(r=n.width),270!==e&&180!==e||(l=n.height);const a=n.getContext("2d");a.translate(r,l),a.rotate(e*Math.PI/180),a.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),g(1/f),c({x:-s.y*o,y:s.x*o})}))};const a=(0,_e.O)("media.crossOrigin",void 0,t);"string"==typeof a&&(l.crossOrigin=a)}),[m,n,r,i,h,g,c]);return(0,u.useMemo)((()=>({editedUrl:o,setEditedUrl:i,crop:l,setCrop:a,position:s,setPosition:c,zoom:d,setZoom:p,rotation:m,setRotation:h,rotateClockwise:_,aspect:f,setAspect:g,defaultAspect:v,initializeTransformValues:y})),[o,i,l,a,s,c,d,p,m,h,_,f,g,v,y])}(e),{initializeTransformValues:r}=n;return(0,u.useEffect)((()=>{t&&r()}),[t,r]),n}({url:n,naturalWidth:r,naturalHeight:o},i),d=function(e){let{crop:t,rotation:n,height:r,width:o,aspect:i,url:l,id:a,onSaveImage:s,onFinishEditing:c}=e;const{createErrorNotice:d}=(0,y.Z)(tb.h),[m,h]=(0,u.useState)(!1),f=(0,u.useCallback)((()=>{h(!1),c()}),[h,c]),g=(0,u.useCallback)((()=>{h(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=l,(0,p.default)({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{s({id:e.id,url:e.source_url,height:r&&o?o/i:void 0})})).catch((e=>{d((0,w.sprintf)((0,w.__)("Could not edit image. %s"),Ie(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{h(!1),c()}))}),[h,t,n,r,o,i,l,s,d,h,c]);return(0,u.useMemo)((()=>({isInProgress:m,apply:g,cancel:f})),[m,g,f])}({id:t,url:n,onSaveImage:a,onFinishEditing:l,...c}),m=(0,u.useMemo)((()=>({...c,...d})),[c,d]);return(0,u.createElement)(HC.Provider,{value:m},s)}function UC(e){let{url:t,width:n,height:r,clientWidth:o,naturalHeight:i,naturalWidth:l,borderProps:a}=e;const{isInProgress:s,editedUrl:c,position:d,zoom:p,aspect:m,setPosition:h,setCrop:f,setZoom:v,rotation:b}=VC();let y=r||o*i/l;return b%180==90&&(y=o*l/i),(0,u.createElement)("div",{className:g()("wp-block-image__crop-area",null==a?void 0:a.className,{"is-applying":s}),style:{...null==a?void 0:a.style,width:n||o,height:y}},(0,u.createElement)(jC,{image:c||t,disabled:s,minZoom:1,maxZoom:3,crop:d,zoom:p/100,aspect:m,onCropChange:h,onCropComplete:e=>{f(e)},onZoomChange:e=>{v(100*e)}}),s&&(0,u.createElement)(ZC.ZP,null))}var $C=n(567);function GC(){const{isInProgress:e,zoom:t,setZoom:n}=VC();return(0,u.createElement)(ng.Z,{contentClassName:"wp-block-image__zoom",popoverProps:zC,renderToggle:t=>{let{isOpen:n,onToggle:r}=t;return(0,u.createElement)(By.Z,{icon:$C.Z,label:(0,w.__)("Zoom"),onClick:r,"aria-expanded":n,disabled:e})},renderContent:()=>(0,u.createElement)(_k.Z,{label:(0,w.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var qC=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function KC(e){let{aspectRatios:t,isDisabled:n,label:r,onClick:o,value:i}=e;return(0,u.createElement)(gs.Z,{label:r},t.map((e=>{let{title:t,aspect:r}=e;return(0,u.createElement)(vs.Z,{key:r,disabled:n,onClick:()=>{o(r)},role:"menuitemradio",isSelected:r===i,icon:r===i?Hy.Z:void 0},t)})))}function YC(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:r,setAspect:o,defaultAspect:i}=VC();return(0,u.createElement)(wd.Z,{icon:qC,label:(0,w.__)("Aspect Ratio"),popoverProps:zC,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(KC,{isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,w.__)("Original"),aspect:i},{title:(0,w.__)("Square"),aspect:1}]}),(0,u.createElement)(KC,{label:(0,w.__)("Landscape"),isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,w.__)("16:10"),aspect:1.6},{title:(0,w.__)("16:9"),aspect:16/9},{title:(0,w.__)("4:3"),aspect:4/3},{title:(0,w.__)("3:2"),aspect:1.5}]}),(0,u.createElement)(KC,{label:(0,w.__)("Portrait"),isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,w.__)("10:16"),aspect:.625},{title:(0,w.__)("9:16"),aspect:9/16},{title:(0,w.__)("3:4"),aspect:3/4},{title:(0,w.__)("2:3"),aspect:2/3}]}))}))}var JC=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function XC(){const{isInProgress:e,rotateClockwise:t}=VC();return(0,u.createElement)(By.Z,{icon:JC,label:(0,w.__)("Rotate"),onClick:t,disabled:e})}function QC(){const{isInProgress:e,apply:t,cancel:n}=VC();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(By.Z,{onClick:t,disabled:e},(0,w.__)("Apply")),(0,u.createElement)(By.Z,{onClick:n},(0,w.__)("Cancel")))}function eE(e){let{url:t,width:n,height:r,clientWidth:o,naturalHeight:i,naturalWidth:l,borderProps:a}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(UC,{borderProps:a,url:t,width:n,height:r,clientWidth:o,naturalHeight:i,naturalWidth:l}),(0,u.createElement)(hs,null,(0,u.createElement)(wo.Z,null,(0,u.createElement)(GC,null),(0,u.createElement)(by.Z,null,(e=>(0,u.createElement)(YC,{toggleProps:e}))),(0,u.createElement)(XC,null)),(0,u.createElement)(wo.Z,null,(0,u.createElement)(QC,null))))}const tE=[25,50,75,100],nE=()=>{};function rE(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:r=[],isResizable:o=!0,slug:i,width:l,height:a,onChange:s,onChangeImage:c=nE}=e;const{currentHeight:d,currentWidth:p,updateDimension:m,updateDimensions:h}=function(e,t,n,r,o){var i,l;const[a,s]=(0,u.useState)(null!==(i=null!=t?t:r)&&void 0!==i?i:""),[c,d]=(0,u.useState)(null!==(l=null!=e?e:n)&&void 0!==l?l:"");return(0,u.useEffect)((()=>{void 0===t&&void 0!==r&&s(r),void 0===e&&void 0!==n&&d(n)}),[r,n]),(0,u.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(c)&&d(e)}),[t,e]),{currentHeight:c,currentWidth:a,updateDimension:(e,t)=>{"width"===e?s(t):d(t),o({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),s(null!=t?t:r),o({height:e,width:t})}}}(a,l,n,t,s);return(0,u.createElement)(u.Fragment,null,!(0,H.isEmpty)(r)&&(0,u.createElement)(Qv.Z,{label:(0,w.__)("Image size"),value:i,options:r,onChange:c}),o&&(0,u.createElement)("div",{className:"block-editor-image-size-control"},(0,u.createElement)("p",{className:"block-editor-image-size-control__row"},(0,w.__)("Image dimensions")),(0,u.createElement)("div",{className:"block-editor-image-size-control__row"},(0,u.createElement)(Ju.Z,{type:"number",className:"block-editor-image-size-control__width",label:(0,w.__)("Width"),value:p,min:1,onChange:e=>m("width",e)}),(0,u.createElement)(Ju.Z,{type:"number",className:"block-editor-image-size-control__height",label:(0,w.__)("Height"),value:d,min:1,onChange:e=>m("height",e)})),(0,u.createElement)("div",{className:"block-editor-image-size-control__row"},(0,u.createElement)(nC.Z,{"aria-label":(0,w.__)("Image size presets")},tE.map((e=>{const r=Math.round(t*(e/100)),o=Math.round(n*(e/100)),i=p===r&&d===o;return(0,u.createElement)(Ss.Z,{key:e,isSmall:!0,variant:i?"primary":void 0,isPressed:i,onClick:()=>h(o,r)},e,"%")}))),(0,u.createElement)(Ss.Z,{isSmall:!0,onClick:()=>h()},(0,w.__)("Reset")))))}var oE=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,u.createElement)(zo.y$,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));const iE=()=>{};var lE=e=>{let{value:t,onChange:n=iE,settings:r}=e;if(!r||!r.length)return null;const o=e=>r=>{n({...t,[e.id]:r})},i=r.map((e=>(0,u.createElement)(Is.Z,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:o(e),checked:!!t&&!!t[e.id]})));return(0,u.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,u.createElement)(og.Z,{as:"legend"},(0,w.__)("Currently selected link settings")),i)},aE=n(63162),sE=n.n(aE),cE=n(55451);const uE=(0,yo.o)((e=>class extends u.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=(0,H.without)(this.timeouts,e)}render(){return(0,u.createElement)(e,(0,bo.Z)({},this.props,{setTimeout:this.setTimeout,clearTimeout:this.clearTimeout}))}}),"withSafeTimeout");var dE=uE,pE=n(42113),mE=n(34960);function hE(e){return"function"==typeof e}class fE extends u.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,u.createRef)(),this.inputRef=(0,u.createRef)(),this.updateSuggestions=(0,H.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,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,sE()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===r||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=r&&r.length?this.updateSuggestions(r):o&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:r}=this.props;if(!n)return;const o=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!o&&(t.length<2||!r&&(0,mE.P)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const i=n(t,{isInitialSuggestions:o});i.then((e=>{this.suggestionsRequest===i&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,w.sprintf)((0,w._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,w.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===i&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=i}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:r,loading:o}=this.state;if(!t||!r.length||o){switch(e.keyCode){case Uf.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Uf.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Uf.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Uf.UP:{e.preventDefault();const t=n?n-1:r.length-1;this.setState({selectedSuggestion:t});break}case Uf.DOWN:{e.preventDefault();const t=null===n||n===r.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Uf.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,w.__)("Link selected.")));break;case Uf.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:r,disableSuggestions:o,__experimentalShowInitialSuggestions:i=!1}=e,{showSuggestions:l}=t,a=l;const s=n&&n.length;return i||s||(a=!1),!0===o&&(a=!1),{showSuggestions:a,suggestionsListboxId:`block-editor-url-input-suggestions-${r}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${r}`}}render(){return(0,u.createElement)(u.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:r,placeholder:o=(0,w.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:l=""}=this.props,{loading:a,showSuggestions:s,selectedSuggestion:c,suggestionsListboxId:d,suggestionOptionIdPrefix:p}=this.state,m=`url-input-control-${r}`,h={id:m,label:e,className:g()("block-editor-url-input",t,{"is-full-width":n})},f={id:m,value:l,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:o,onKeyDown:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,w.__)("URL"),"aria-expanded":s,"aria-autocomplete":"list","aria-owns":d,"aria-activedescendant":null!==c?`${p}-${c}`:void 0,ref:this.inputRef};return i?i(h,f,a):(0,u.createElement)(rw.ZP,h,(0,u.createElement)("input",f),a&&(0,u.createElement)(ZC.ZP,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:r=!1}=this.props,{showSuggestions:o,suggestions:i,selectedSuggestion:l,suggestionsListboxId:a,suggestionOptionIdPrefix:s,loading:c}=this.state,d={id:a,ref:this.autocompleteRef,role:"listbox"},p=(e,t)=>({role:"option",tabIndex:"-1",id:`${s}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===l});return hE(t)&&o&&i.length?t({suggestions:i,selectedSuggestion:l,suggestionsListProps:d,buildSuggestionItemProps:p,isLoading:c,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:r&&!(n&&n.length)}):!hE(t)&&o&&i.length?(0,u.createElement)(k.Z,{position:"bottom",focusOnMount:!1},(0,u.createElement)("div",(0,bo.Z)({},d,{className:g()("block-editor-url-input__suggestions",`${e}__suggestions`)}),i.map(((e,t)=>(0,u.createElement)(Ss.Z,(0,bo.Z)({},p(0,t),{key:e.id,className:g()("block-editor-url-input__suggestion",{"is-selected":t===l}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var gE=(0,pd.Z)(dE,cE.Z,pE.Z,(0,ud.Z)(((e,t)=>{if(hE(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(rs);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(fE),vE=e=>{let t,{searchTerm:n,onClick:r,itemProps:o,isSelected:i,buttonText:l}=e;return n?(t=l?"function"==typeof l?l(n):l:(0,lg.Z)((0,w.sprintf)((0,w.__)("Create: <mark>%s</mark>"),n),{mark:(0,u.createElement)("mark",null)}),(0,u.createElement)(Ss.Z,(0,bo.Z)({},o,{className:g()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":i}),onClick:r}),(0,u.createElement)(qc.Z,{className:"block-editor-link-control__search-item-icon",icon:rg.Z}),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},bE=n(51457),yE=n(73963),_E=n(18642),kE=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})),wE=e=>{let{itemProps:t,suggestion:n,isSelected:r=!1,onClick:o,isURL:i=!1,searchTerm:l="",shouldShowType:a=!1}=e;return(0,u.createElement)(Ss.Z,(0,bo.Z)({},t,{onClick:o,className:g()("block-editor-link-control__search-item",{"is-selected":r,"is-url":i,"is-entity":!i})}),i&&(0,u.createElement)(qc.Z,{className:"block-editor-link-control__search-item-icon",icon:kE}),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,u.createElement)(_E.Z,{text:n.title,highlight:l})),(0,u.createElement)("span",{"aria-hidden":!i,className:"block-editor-link-control__search-item-info"},!i&&((0,bE.w)((0,yE.x)(n.url))||""),i&&(0,w.__)("Press ENTER to add this link"))),a&&n.type&&(0,u.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const xE="__CREATE__",CE="mailto",EE="internal",SE=["URL",CE,"tel",EE],IE=[{id:"opensInNewTab",title:(0,w.__)("Open in new tab")}];function TE(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:r,handleSuggestionClick:o,suggestionsListProps:i,buildSuggestionItemProps:l,suggestions:a,selectedSuggestion:s,isLoading:c,isInitialSuggestions:d,createSuggestionButtonText:p,suggestionsQuery:m}=e;const h=g()("block-editor-link-control__search-results",{"is-loading":c}),f=1===a.length&&SE.includes(a[0].type),v=n&&!f&&!d,b=!(null!=m&&m.type),y=`block-editor-link-control-search-results-label-${t}`,_=d?(0,w.__)("Recently updated"):(0,w.sprintf)((0,w.__)('Search results for "%s"'),r),k=(0,u.createElement)(d?u.Fragment:og.Z,{},(0,u.createElement)("span",{className:"block-editor-link-control__search-results-label",id:y},_));return(0,u.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},k,(0,u.createElement)("div",(0,bo.Z)({},i,{className:h,"aria-labelledby":y}),a.map(((e,t)=>v&&xE===e.type?(0,u.createElement)(vE,{searchTerm:r,buttonText:p,onClick:()=>o(e),key:e.type,itemProps:l(e,t),isSelected:t===s}):xE===e.type?null:(0,u.createElement)(wE,{key:`${e.id}-${e.type}`,itemProps:l(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===s,isURL:SE.includes(e.type),searchTerm:r,shouldShowType:b,isFrontPage:null==e?void 0:e.isFrontPage})))))}var NE=n(72778),BE=n(45366);function AE(e){const t=(0,H.startsWith)(e,"#");return(0,mE.P)(e)||e&&e.includes("www.")||t}const LE=()=>Promise.resolve([]),PE=e=>{let t="URL";const n=(0,NE.E)(e)||"";return n.includes("mailto")&&(t=CE),n.includes("tel")&&(t="tel"),(0,H.startsWith)(e,"#")&&(t=EE),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,BE.u)(e):e,type:t}])};const DE=()=>Promise.resolve([]),RE=()=>{},ME=(0,u.forwardRef)(((e,t)=>{let{value:n,children:r,currentLink:o={},className:i=null,placeholder:l=null,withCreateSuggestion:a=!1,onCreateSuggestion:s=RE,onChange:c=RE,onSelect:d=RE,showSuggestions:p=!0,renderSuggestions:m=(e=>(0,u.createElement)(TE,e)),fetchSuggestions:h=null,allowDirectEntry:f=!0,showInitialSuggestions:v=!1,suggestionsQuery:y={},withURLSuggestion:_=!0,createSuggestionButtonText:k,useLabel:x=!1}=e;const C=function(e,t,n,r){const{fetchSearchSuggestions:o,pageOnFront:i}=(0,b.Z)((e=>{const{getSettings:t}=e(rs);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?PE:LE;return(0,u.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return AE(t)?l(t,{isInitialSuggestions:s}):(async(e,t,n,r,o,i,l)=>{const{isInitialSuggestions:a}=t;let s=!1,c=await Promise.all([n(e,t),r(e)]);c[0]=c[0].map((e=>Number(e.id)===l?(s=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!s&&u&&i&&!a?c[0].concat(c[1]):c[0],a||AE(e)||!o?c:c.concat({title:e,url:e,type:xE})})(t,{...e,isInitialSuggestions:s},o,l,n,r,i)}),[l,o,n])}(y,f,a,_),E=p?h||C:DE,S=(0,id.Z)(ME),[I,T]=(0,u.useState)(),N=async e=>{let t=e;if(xE!==e.type)(f||t&&Object.keys(t).length>=1)&&d({...(0,H.omit)(o,"id","url"),...t},t);else try{var n;t=await s(e.title),null!==(n=t)&&void 0!==n&&n.url&&d(t)}catch(e){}},B=g()(i,{"has-no-label":!x});return(0,u.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,u.createElement)(gE,{label:x?"URL":void 0,className:B,value:n,onChange:(e,t)=>{c(e),T(t)},placeholder:null!=l?l:(0,w.__)("Search or type url"),__experimentalRenderSuggestions:p?e=>m({...e,instanceId:S,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:k,suggestionsQuery:y,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),N(t)}}):null,__experimentalFetchLinkSuggestions:E,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:v,onSubmit:(e,t)=>{var r;const o=e||I;o||null!=n&&null!==(r=n.trim())&&void 0!==r&&r.length?N(o||{url:n}):t.preventDefault()},ref:t}),r)}));var OE=ME,FE=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),jE=n(9578);const{Slot:ZE,Fill:zE}=(0,_.up)("BlockEditorLinkControlViewer");function HE(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function VE(e){var t;let{value:n,onEditClick:r,hasRichPreviews:o=!1,hasUnlinkControl:i=!1,onRemove:l}=e;const a=o?null==n?void 0:n.url:null,{richData:s,isFetching:c}=function(e){const[t,n]=(0,u.useReducer)(HE,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,b.Z)((e=>{const{getSettings:t}=e(rs);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,u.useEffect)((()=>{if(null!=e&&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}(a),d=s&&Object.keys(s).length,p=n&&(0,bE.w)((0,yE.x)(n.url),16)||"",m=(null==s?void 0:s.title)||(null==n?void 0:n.title)||p,h=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let f;return f=null!=s&&s.icon?(0,u.createElement)("img",{src:null==s?void 0:s.icon,alt:""}):h?(0,u.createElement)(qc.Z,{icon:FE,size:32}):(0,u.createElement)(qc.Z,{icon:kE}),(0,u.createElement)("div",{"aria-label":(0,w.__)("Currently selected"),"aria-selected":"true",className:g()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":d,"is-fetching":!!c,"is-preview":!0,"is-error":h})},(0,u.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:g()("block-editor-link-control__search-item-icon",{"is-image":null==s?void 0:s.icon})},f),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-details"},h?(0,u.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,w.__)("Link is empty")):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Xu.Z,{className:"block-editor-link-control__search-item-title",href:n.url},Ie(m)),(null==n?void 0:n.url)&&(0,u.createElement)("span",{className:"block-editor-link-control__search-item-info"},p)))),(0,u.createElement)(Ss.Z,{icon:jE.Z,label:(0,w.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:r,iconSize:24}),i&&(0,u.createElement)(Ss.Z,{icon:Nk.Z,label:(0,w.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:l,iconSize:24}),(0,u.createElement)(ZE,{fillProps:n})),(d&&((null==s?void 0:s.image)||(null==s?void 0:s.description))||c)&&(0,u.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==s?void 0:s.image)||c)&&(0,u.createElement)("div",{"aria-hidden":!(null!=s&&s.image),className:g()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=s&&s.image)})},(null==s?void 0:s.image)&&(0,u.createElement)("img",{src:null==s?void 0:s.image,alt:""})),((null==s?void 0:s.description)||c)&&(0,u.createElement)("div",{"aria-hidden":!(null!=s&&s.description),className:g()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=s&&s.description)})},(null==s?void 0:s.description)&&(0,u.createElement)(zy.Z,{truncate:!0,numberOfLines:"2"},s.description))))}const WE=()=>{};function UE(e){var t,n,r;let{searchInputPlaceholder:o,value:i,settings:l=IE,onChange:a=WE,onRemove:s,noDirectEntry:c=!1,showSuggestions:d=!0,showInitialSuggestions:p,forceIsEditingLink:m,createSuggestion:h,withCreateSuggestion:f,inputValue:v="",suggestionsQuery:b={},noURLSuggestion:y=!1,createSuggestionButtonText:_,hasRichPreviews:k=!1,hasTextControl:x=!1,renderControlBottom:C=null}=e;void 0===f&&h&&(f=!0);const E=(0,u.useRef)(!0),S=(0,u.useRef)(),I=(0,u.useRef)(),[T,N]=(0,u.useState)((null==i?void 0:i.url)||""),[B,A]=(0,u.useState)((null==i?void 0:i.title)||""),L=v||T,[P,D]=(0,u.useState)(void 0!==m?m:!i||!i.url),R=(0,u.useRef)(!1),M=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length),{createPage:O,isCreatingPage:F,errorMessage:j}=function(e){const t=(0,u.useRef)(),[n,r]=(0,u.useState)(!1),[o,i]=(0,u.useState)(null);return(0,u.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,w.__)("An unknown error occurred during creation. Please try again.")),e}finally{r(!1)}},isCreatingPage:n,errorMessage:o}}(h);function Z(){var e;R.current=!(null===(e=S.current)||void 0===e||!e.contains(S.current.ownerDocument.activeElement)),D(!1)}(0,u.useEffect)((()=>{void 0!==m&&m!==P&&D(m)}),[m]),(0,u.useEffect)((()=>{if(E.current)return void(E.current=!1);const e=null!=I&&I.current?1:0;(wf.T_.focusable.find(S.current)[e]||S.current).focus(),R.current=!1}),[P,F]),(0,u.useEffect)((()=>{null!=i&&i.title&&i.title!==B&&A(i.title),null!=i&&i.url&&N(i.url)}),[i]);const z=()=>{L===(null==i?void 0:i.url)&&B===(null==i?void 0:i.title)||a({...i,url:L,title:B}),Z()},H=s&&i&&!P&&!F,V=!(null==l||!l.length),W=(null==i||null===(n=i.url)||void 0===n||null===(r=n.trim())||void 0===r?void 0:r.length)>0&&x;return(0,u.createElement)("div",{tabIndex:-1,ref:S,className:"block-editor-link-control"},F&&(0,u.createElement)("div",{className:"block-editor-link-control__loading"},(0,u.createElement)(ZC.ZP,null)," ",(0,w.__)("Creating"),"…"),(P||!i)&&!F&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:g()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":W})},W&&(0,u.createElement)(Ju.Z,{ref:I,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:B,onChange:A,onKeyDown:e=>{const{keyCode:t}=e;t!==Uf.ENTER||M||(e.preventDefault(),z())}}),(0,u.createElement)(OE,{currentLink:i,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:o,value:L,withCreateSuggestion:f,onCreateSuggestion:O,onChange:N,onSelect:e=>{a({...e,title:B||(null==e?void 0:e.title)}),Z()},showInitialSuggestions:p,allowDirectEntry:!c,showSuggestions:d,suggestionsQuery:b,withURLSuggestion:!y,createSuggestionButtonText:_,useLabel:W},(0,u.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,u.createElement)(Ss.Z,{onClick:z,label:(0,w.__)("Submit"),icon:oE,className:"block-editor-link-control__search-submit",disabled:M})))),j&&(0,u.createElement)(gw.Z,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},j)),i&&!P&&!F&&(0,u.createElement)(VE,{key:null==i?void 0:i.url,value:i,onEditClick:()=>D(!0),hasRichPreviews:k,hasUnlinkControl:H,onRemove:s}),V&&(0,u.createElement)("div",{className:"block-editor-link-control__tools"},(0,u.createElement)(lE,{value:i,settings:l,onChange:a})),C&&C())}UE.ViewerFill=zE;var $E=UE,GE=n(19459),qE=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),KE=n(4059),YE=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),JE=(0,cd.Z)("editor.MediaUpload")((()=>null)),XE=function(e){let{fallback:t=null,children:n}=e;const r=(0,b.Z)((e=>{const{getSettings:t}=e(rs);return!!t().mediaUpload}),[]);return r?n:t};const QE=()=>{};let eS=0;var tS=(0,pd.Z)([(0,dd.Z)((e=>{const{createNotice:t,removeNotice:n}=e(tb.h);return{createNotice:t,removeNotice:n}})),(0,cd.Z)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:r,allowedTypes:o,accept:i,onError:l,onSelect:a,onSelectURL:s,onToggleFeaturedImage:c,useFeaturedImage:d,onFilesUpload:p=QE,name:m=(0,w.__)("Replace"),createNotice:h,removeNotice:f,children:g,multiple:v=!1,addToGallery:y,handleUpload:_=!0}=e;const k=(0,b.Z)((e=>e(rs).getSettings().mediaUpload),[]),x=(0,u.useRef)(),C="block-editor/media-replace-flow/error-notice/"+ ++eS,E=e=>{const t=Ie(e);l?l(t):setTimeout((()=>{h("error",t,{speak:!0,id:C,isDismissible:!0})}),1e3)},S=(e,t)=>{d&&c&&c(),t(),a(e),(0,$l.D)((0,w.__)("The media file has been replaced")),f(C)},I=e=>{e.keyCode===Uf.DOWN&&(e.preventDefault(),e.target.click())},T=v&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,u.createElement)(ng.Z,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,u.createElement)(By.Z,{ref:x,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:I},m)},renderContent:e=>{let{onClose:l}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fy.Z,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,u.createElement)(u.Fragment,null,(0,u.createElement)(JE,{gallery:T,addToGallery:y,multiple:v,value:v?r:n,onSelect:e=>S(e,l),allowedTypes:o,render:e=>{let{open:t}=e;return(0,u.createElement)(vs.Z,{icon:qE,onClick:t},(0,w.__)("Open Media Library"))}}),(0,u.createElement)(XE,null,(0,u.createElement)(GE.Z,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!_)return t(),a(n);p(n),k({allowedTypes:o,filesList:n,onFileChange:e=>{let[n]=e;S(n,t)},onError:E})})(e,l)},accept:i,multiple:v,render:e=>{let{openFileDialog:t}=e;return(0,u.createElement)(vs.Z,{icon:KE.Z,onClick:()=>{t()}},(0,w.__)("Upload"))}}))),c&&(0,u.createElement)(vs.Z,{icon:YE,onClick:c,isPressed:d},(0,w.__)("Use featured image")),g),s&&(0,u.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,u.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,w.__)("Current media URL:")),(0,u.createElement)(Jb.Z,{text:t,position:"bottom"},(0,u.createElement)("div",null,(0,u.createElement)($E,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;s(t),x.current.focus()}})))))}})})),nS=n(90340);function rS(e){let{url:t,urlLabel:n,className:r}=e;const o=g()(r,"block-editor-url-popover__link-viewer-url");return t?(0,u.createElement)(Xu.Z,{className:o,href:t},n||(0,bE.w)((0,yE.x)(t))):(0,u.createElement)("span",{className:o})}function oS(e){let{additionalControls:t,children:n,renderSettings:r,position:o="bottom center",focusOnMount:i="firstElement",...l}=e;const[a,s]=(0,u.useState)(!1),c=!!r&&a;return(0,u.createElement)(k.Z,(0,bo.Z)({className:"block-editor-url-popover",focusOnMount:i,position:o,__unstableShift:!0},l),(0,u.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,u.createElement)("div",{className:"block-editor-url-popover__row"},n,!!r&&(0,u.createElement)(Ss.Z,{className:"block-editor-url-popover__settings-toggle",icon:wy.Z,label:(0,w.__)("Link settings"),onClick:()=>{s(!a)},"aria-expanded":a})),c&&(0,u.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},r())),t&&!c&&(0,u.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}oS.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:r,value:o,...i}=e;return(0,u.createElement)("form",(0,bo.Z)({className:g()("block-editor-url-popover__link-editor",n)},i),(0,u.createElement)(gE,{value:o,onChange:r,autocompleteRef:t}),(0,u.createElement)(Ss.Z,{icon:oE,label:(0,w.__)("Apply"),type:"submit"}))},oS.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:r,url:o,urlLabel:i,...l}=e;return(0,u.createElement)("div",(0,bo.Z)({className:g()("block-editor-url-popover__link-viewer",t)},l),(0,u.createElement)(rS,{url:o,urlLabel:i,className:n}),r&&(0,u.createElement)(Ss.Z,{icon:jE.Z,label:(0,w.__)("Edit"),onClick:r}))};var iS=oS;const lS=()=>{},aS=e=>{let{src:t,onChange:n,onSubmit:r,onClose:o}=e;return(0,u.createElement)(iS,{onClose:o},(0,u.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:r},(0,u.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,w.__)("URL"),placeholder:(0,w.__)("Paste or type URL"),onChange:n,value:t}),(0,u.createElement)(Ss.Z,{className:"block-editor-media-placeholder__url-input-submit-button",icon:oE,label:(0,w.__)("Apply"),type:"submit"})))};var sS=(0,cd.Z)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:r,icon:o,labels:i={},mediaPreview:l,notices:a,isAppender:s,accept:c,addToGallery:d,multiple:p=!1,handleUpload:m=!0,disableDropZone:h,disableMediaButtons:f,onError:v,onSelect:y,onCancel:_,onSelectURL:k,onToggleFeaturedImage:x,onDoubleClick:C,onFilesPreUpload:E=lS,onHTMLDrop:S=lS,children:I,mediaLibraryButton:T,placeholder:N,style:B}=e;const A=(0,b.Z)((e=>{const{getSettings:t}=e(rs);return t().mediaUpload}),[]),[L,P]=(0,u.useState)(""),[D,R]=(0,u.useState)(!1);(0,u.useEffect)((()=>{var e;P(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const M=e=>{P(e.target.value)},O=()=>{R(!0)},F=()=>{R(!1)},j=e=>{e.preventDefault(),L&&k&&(k(L),F())},Z=e=>{if(!m)return y(e);let r;if(E(e),p)if(d){let e=[];r=n=>{const r=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));y(r.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else r=y;else r=e=>{let[t]=e;return y(t)};A({allowedTypes:n,filesList:e,onFileChange:r,onError:v})},z=e=>{Z(e.target.files)},H=null!=N?N:e=>{let{instructions:t,title:c}=i;if(A||k||(t=(0,w.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===c){const e=null!=n?n:[],[r]=e,o=1===e.length,i=o&&"audio"===r,l=o&&"image"===r,a=o&&"video"===r;void 0===t&&A&&(t=(0,w.__)("Upload a media file or pick one from your media library."),i?t=(0,w.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?t=(0,w.__)("Upload an image file, pick one from your media library, or add one with a URL."):a&&(t=(0,w.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===c&&(c=(0,w.__)("Media"),i?c=(0,w.__)("Audio"):l?c=(0,w.__)("Image"):a&&(c=(0,w.__)("Video")))}const d=g()("block-editor-media-placeholder",r,{"is-appender":s});return(0,u.createElement)(vC.Z,{icon:o,label:c,instructions:t,className:d,notices:a,onDoubleClick:C,preview:l,style:B},e,I)},V=()=>h?null:(0,u.createElement)(nS.Z,{onFilesDrop:Z,onHTMLDrop:S}),W=()=>_&&(0,u.createElement)(Ss.Z,{className:"block-editor-media-placeholder__cancel-button",title:(0,w.__)("Cancel"),variant:"link",onClick:_},(0,w.__)("Cancel")),U=()=>k&&(0,u.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,u.createElement)(Ss.Z,{className:"block-editor-media-placeholder__button",onClick:O,isPressed:D,variant:"tertiary"},(0,w.__)("Insert from URL")),D&&(0,u.createElement)(aS,{src:L,onChange:M,onSubmit:j,onClose:F})),$=()=>x&&(0,u.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,u.createElement)(Ss.Z,{className:"block-editor-media-placeholder__button",onClick:x,variant:"tertiary"},(0,w.__)("Use featured image")));return f?(0,u.createElement)(XE,null,V()):(0,u.createElement)(XE,{fallback:H(U())},(()=>{const e=null!=T?T:e=>{let{open:t}=e;return(0,u.createElement)(Ss.Z,{variant:"tertiary",onClick:()=>{t()}},(0,w.__)("Media Library"))},r=(0,u.createElement)(JE,{addToGallery:d,gallery:p&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:p,onSelect:y,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(A&&s)return(0,u.createElement)(u.Fragment,null,V(),(0,u.createElement)(GE.Z,{onChange:z,accept:c,multiple:p,render:e=>{let{openFileDialog:t}=e;const n=(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Ss.Z,{variant:"primary",className:g()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,w.__)("Upload")),r,U(),$(),W());return H(n)}}));if(A){const e=(0,u.createElement)(u.Fragment,null,V(),(0,u.createElement)(GE.Z,{variant:"primary",className:g()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:z,accept:c,multiple:p},(0,w.__)("Upload")),r,U(),$(),W());return H(e)}return H(r)})())})),cS=n(8990);const uS=()=>{};var dS={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,b.Z)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:r}=e(rs),o=t();return{selectedBlockName:o?n(o):null,rootClientId:r().rootClientId}}),[]),[r,o,i]=qv(t,uS),l=(0,u.useMemo)((()=>(e.trim()?xb(r,o,i,e):(0,H.orderBy)(r,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,o,i]),a=(0,u.useMemo)((()=>l.map((e=>{const{title:t,icon:n,isDisabled:r}=e;return{key:`block-${e.id}`,value:e,label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(pg,{key:"icon",icon:n,showColors:!0}),t),isDisabled:r}}))),[l]);return[a]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:r}=e;return{action:"replace",value:Ke(t,n,Ye(r))}}},pS=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),mS=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),hS={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await(0,p.default)({path:(0,Lb.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=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)(qc.Z,{key:"icon",icon:"page"===e.subtype?pS:mS}),e.title),getOptionCompletion:e=>(0,u.createElement)("a",{href:e.url},e.title)};const fS=[];function gS(e){let{completers:t=fS}=e;const{name:n}=as();return(0,u.useMemo)((()=>{let e=t;return(n===ze()||We(n,"__experimentalSlashInserter",!1))&&(e=e.concat([dS,hS])),(0,_e.H7)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(H.clone)),e=(0,_e.O)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const vS={position:"bottom right",isAlternate:!0};var bS=()=>(0,u.createElement)(u.Fragment,null,["bold","italic","link"].map((e=>(0,u.createElement)(_.g7,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,u.createElement)(_.g7,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,u.createElement)(by.Z,null,(n=>(0,u.createElement)(wd.Z,{icon:wy.Z,label:(0,w.__)("More"),toggleProps:{...n,className:g()(n.className,{"is-pressed":t}),describedBy:(0,w.__)("Displays more block tools")},controls:(0,H.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:vS})))})));function yS(e){let{value:t,anchorRef:n,activeFormats:r}=e;const o=r[r.length-1],i=null==o?void 0:o.type,l=(0,b.Z)((e=>e(Vo.h).getFormatType(i)),[i]),a=(0,Vo.uT)({ref:n,value:t,settings:l});return(0,u.createElement)(_S,{anchorRef:a})}function _S(e){let{anchorRef:t}=e;return(0,u.createElement)(k.Z,{position:"top center",focusOnMount:!1,anchorRef:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,u.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,u.createElement)(wo.Z,null,(0,u.createElement)(bS,null))))}var kS=e=>{let{inline:t,anchorRef:n,value:r}=e;const o=(0,b.Z)((e=>e(rs).getSettings().hasInlineToolbar),[]);if(t)return(0,u.createElement)(_S,{anchorRef:n});if(o){const e=(0,Vo.DL)(r);return(0,Vo.zb)(r)&&!e.length?null:(0,u.createElement)(yS,{anchorRef:n,value:r,activeFormats:e})}return(0,u.createElement)(hs,{group:"inline"},(0,u.createElement)(bS,null))};function wS(){const{didAutomaticChange:e,getSettings:t}=(0,b.Z)(rs);return(0,Ps.Z)((n=>{function r(n){const{keyCode:r}=n;n.defaultPrevented||r!==Uf.DELETE&&r!==Uf.BACKSPACE&&r!==Uf.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}}),[])}function xS(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${D(e)}">`)).join("")}function CS(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function ES(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function SS(e){let{allowedFormats:t,formattingControls:n,disableFormats:r}=e;return r?SS.EMPTY_ARRAY:t||n?t||((0,Wo.Z)("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}function IS(e){let{value:t,pastedBlocks:n=[],onReplace:r,onSplit:o,onSplitMiddle:i,multilineTag:l}=e;if(!r||!o)return;const{start:a=0,end:s=0}=t,c={...t,start:a,end:s},u=[],[d,p]=(0,Vo.Vl)(c),m=n.length>0;let h=-1;const f=(0,Vo.xb)(d)&&!(0,Vo.xb)(p);m&&(0,Vo.xb)(d)||(u.push(o((0,Vo.Jz)({value:d,multilineTag:l}),!f)),h+=1),m?(u.push(...n),h+=n.length):i&&u.push(i()),(m||i)&&(0,Vo.xb)(p)||u.push(o((0,Vo.Jz)({value:p,multilineTag:l}),f)),r(u,m?h:1,m?-1:0)}function TS(e,t){return t?(0,Vo.gx)(e,/\n+/g,Vo.M4):(0,Vo.gx)(e,new RegExp(Vo.M4,"g"),"\n")}function NS(e){const t=(0,u.useRef)(e);return t.current=e,(0,Ps.Z)((e=>{function n(e){const{isSelected:n,disableFormats:r,onChange:o,value:i,formatTypes:l,tagName:a,onReplace:s,onSplit:c,onSplitMiddle:u,__unstableEmbedURLOnPaste:d,multilineTag:p,preserveWhiteSpace:m,pastePlainText:h}=t.current;if(!n)return;const{clipboardData:f}=e;let g="",v="";try{g=f.getData("text/plain"),v=f.getData("text/html")}catch(e){try{v=f.getData("Text")}catch(e){return}}if(v=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const r=(e=e.substring(n+t.length)).indexOf("\x3c!--EndFragment--\x3e");return r>-1&&(e=e.substring(0,r)),e}(v),v=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(v),e.preventDefault(),window.console.log("Received HTML:\n\n",v),window.console.log("Received plain text:\n\n",g),r)return void o((0,Vo.$T)(i,g));const b=l.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:v,plainText:g})),e}),i);if(b!==i)return void o(b);const y=[...(0,nk.f)(f)];if("true"===f.getData("rich-text")){const e=f.getData("rich-text-multi-line-tag")||void 0;let t=(0,Vo.Ue)({html:v,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:m});return t=TS(t,!!p),CS(t,i.activeFormats),void o((0,Vo.$T)(i,t))}if(h)return void o((0,Vo.$T)(i,(0,Vo.Ue)({text:g})));if(null!=y&&y.length&&!function(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}(y,v)){const e=fo({HTML:xS(y),mode:"BLOCKS",tagName:a,preserveWhiteSpace:m});return window.console.log("Received items:\n\n",y),void(s&&(0,Vo.xb)(i)?s(e):IS({value:i,pastedBlocks:e,onReplace:s,onSplit:c,onSplitMiddle:u,multilineTag:p}))}let _=s&&c?"AUTO":"INLINE";var k;"AUTO"===_&&(0,Vo.xb)(i)&&(k=g,Lr(".*").test(k))&&(_="BLOCKS"),d&&(0,Vo.xb)(i)&&(0,mE.P)(g.trim())&&(_="BLOCKS");const w=fo({HTML:v,plainText:g,mode:_,tagName:a,preserveWhiteSpace:m});if("string"==typeof w){let e=(0,Vo.Ue)({html:w});e=TS(e,!!p),CS(e,i.activeFormats),o((0,Vo.$T)(i,e))}else w.length>0&&(s&&(0,Vo.xb)(i)?s(w,w.length-1,-1):IS({value:i,pastedBlocks:w,onReplace:s,onSplit:c,onSplitMiddle:u,multilineTag:p}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function BS(e){let t=e.length;for(;t--;){const n=ql(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Gl,""),e[t].clientId;const r=BS(e[t].innerBlocks);if(r)return r}}function AS(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,y.Z)(rs),r=(0,u.useRef)(e);return r.current=e,(0,Ps.Z)((e=>{function o(){const{value:e,onReplace:t,selectionChange:o}=r.current;if(!t)return;const{start:i,text:l}=e;if(" "!==l.slice(i-1,i))return;const a=l.slice(0,i).trim(),s=rt(ot("from").filter((e=>{let{type:t}=e;return"prefix"===t})),(e=>{let{prefix:t}=e;return a===t}));if(!s)return;const c=(0,Vo.Jz)({value:(0,Vo.$T)(e,Gl,0,i)}),u=s.transform(c);o(BS([u])),t([u]),n()}function i(e){const{inputType:i,type:l}=e,{value:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=r.current;if("insertText"!==i&&"compositionend"!==l)return;c&&o&&o();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:r}=e;return n<t.length||r.slice(n-t.length,n).toLowerCase()!==t?e:(0,Vo.$T)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(a));d!==a&&(t(),s({...d,activeFormats:a.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function LS(e){const{__unstableMarkAutomaticChange:t}=(0,y.Z)(rs),n=(0,u.useRef)(e);return n.current=e,(0,Ps.Z)((e=>{function r(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:r,value:o,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s,onChange:c,disableLineBreaks:u,onSplitAtEnd:d}=n.current;if(e.keyCode!==Uf.ENTER)return;e.preventDefault();const p={...o};p.formats=r(o);const m=i&&l;if(i){const e=rt(ot("from").filter((e=>{let{type:t}=e;return"enter"===t})),(e=>e.regExp.test(p.text)));e&&(i([e.transform({content:p.text})]),t())}if(s)e.shiftKey?u||c((0,Vo.$T)(p,"\n")):m&&(0,Vo.If)(p)?IS({value:p,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s}):c((0,Vo.cw)(p));else{const{text:t,start:n,end:r}=p,o=d&&n===r&&r===t.length;e.shiftKey||!m&&!o?u||c((0,Vo.$T)(p,"\n")):!m&&o?d():m&&IS({value:p,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s})}}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}function PS(e){return e(Vo.h).getFormatTypes()}SS.EMPTY_ARRAY=[];const DS=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function RS(e,t){return"object"!=typeof e?{[t]:e}:(0,H.mapKeys)(e,((e,n)=>`${t}.${n}`))}function MS(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 OS(e){return(0,Ps.Z)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function FS(e){return(0,Ps.Z)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function jS(){const{isMultiSelecting:e}=(0,b.Z)(rs);return(0,Ps.Z)((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)}}),[])}function ZS(e){let{formatTypes:t,onChange:n,onFocus:r,value:o,forwardedRef:i}=e;return t.map((e=>{const{name:t,edit:l}=e;if(!l)return null;const a=(0,Vo.Ye)(o,t);let s=void 0!==a;const c=(0,Vo.Jj)(o),d=void 0!==c&&c.type===t;if("core/link"===t&&!(0,Vo.zb)(o)){const e=o.formats,t=(0,H.find)(e[o.start],{type:"core/link"}),n=(0,H.find)(e[o.end-1],{type:"core/link"});t&&n&&t===n||(s=!1)}return(0,u.createElement)(l,{key:t,isActive:s,activeAttributes:s&&a.attributes||{},isObjectActive:d,activeObjectAttributes:d&&c.attributes||{},value:o,onChange:n,onFocus:r,contentRef:i})}))}const zS=(0,u.createContext)(),HS=(0,u.createContext)(),VS=(0,u.forwardRef)((function e(t,n){let{children:r,tagName:o="div",value:i="",onChange:l,isSelected:a,multiline:s,inlineToolbar:c,wrapperClassName:d,autocompleters:p,onReplace:m,placeholder:h,allowedFormats:f,formattingControls:v,withoutInteractiveFormatting:_,onRemove:w,onMerge:x,onSplit:C,__unstableOnSplitAtEnd:E,__unstableOnSplitMiddle:S,identifier:I,preserveWhiteSpace:T,__unstablePastePlainText:N,__unstableEmbedURLOnPaste:B,__unstableDisableFormats:A,disableLineBreaks:L,unstableOnFocus:P,__unstableAllowPrefixTransformations:D,...R}=t;const M=(0,id.Z)(e);I=I||M,R=function(e){return(0,H.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection"])}(R);const O=(0,u.useRef)(),{clientId:F}=as(),{selectionStart:j,selectionEnd:Z,isSelected:z}=(0,b.Z)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(rs),r=t(),o=n();let i;return void 0===a?i=r.clientId===F&&o.clientId===F&&r.attributeKey===I:a&&(i=r.clientId===F),{selectionStart:i?r.offset:void 0,selectionEnd:i?o.offset:void 0,isSelected:i}})),{selectionChange:V}=(0,y.Z)(rs),W=ES(s),U=SS({allowedFormats:f,formattingControls:v,disableFormats:A}),$=!U||U.length>0;let G=i,q=l;Array.isArray(i)&&(G=tr.toHTML(i),q=e=>l(tr.fromDOM((0,Vo._b)(document,e).childNodes)));const K=(0,u.useCallback)(((e,t)=>{const n={},r=void 0===e&&void 0===t;("number"==typeof e||r)&&(n.start={clientId:F,attributeKey:I,offset:e}),("number"==typeof t||r)&&(n.end={clientId:F,attributeKey:I,offset:t}),V(n)}),[F,I]),{formatTypes:Y,prepareHandlers:J,valueHandlers:X,changeHandlers:Q,dependencies:ee}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:r,allowedFormats:o}=e;const i=(0,b.Z)(PS,[]),l=(0,u.useMemo)((()=>i.filter((e=>{let{name:t,tagName:n}=e;return!(o&&!o.includes(t)||r&&DS.has(n))}))),[i,o,DS]),a=(0,b.Z)((e=>l.reduce(((r,o)=>o.__experimentalGetPropsForEditableTreePreparation?{...r,...RS(o.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t}),o.name)}:r),{})),[l,t,n]),s=(0,y.Z)(),c=[],d=[],p=[],m=[];for(const e in a)m.push(a[e]);return l.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const r=e.__experimentalCreatePrepareEditableTree(MS(a,e.name),{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):c.push(r)}if(e.__experimentalCreateOnChangeEditableValue){let r={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(r=e.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:n,blockClientId:t}));const o=MS(a,e.name);p.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof o?o:{},...r},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:l,prepareHandlers:c,valueHandlers:d,changeHandlers:p,dependencies:m}}({clientId:F,identifier:I,withoutInteractiveFormatting:_,allowedFormats:U});function te(e){return Y.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Vo.Ir)(e,t.name,0,e.text.length))})),e.formats}const{value:ne,onChange:re,ref:oe}=(0,Vo.o2)({value:G,onChange(e,t){let{__unstableFormats:n,__unstableText:r}=t;q(e),Object.values(Q).forEach((e=>{e(n,r)}))},selectionStart:j,selectionEnd:Z,onSelectionChange:K,placeholder:h,__unstableIsSelected:z,__unstableMultilineTag:W,__unstableDisableFormats:A,preserveWhiteSpace:T,__unstableDependencies:[...ee,o],__unstableAfterParse:function(e){return X.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:te,__unstableAddInvisibleFormats:function(e){return J.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ie=function(e){return(0,cS.R)({...e,completers:gS(e)})}({onReplace:m,completers:p,record:ne,onChange:re});!function(e){let{html:t,value:n}=e;const r=(0,u.useRef)(),o=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:i}=(0,y.Z)(rs);(0,u.useLayoutEffect)((()=>{if(r.current){if(r.current!==n.text){const e=window.setTimeout((()=>{i()}),1e3);return r.current=n.text,()=>{window.clearTimeout(e)}}i()}else r.current=n.text}),[t,o])}({html:G,value:ne});const le=(0,u.useRef)(new Set),ae=(0,u.useRef)(new Set);function se(){O.current.focus()}const ce=o,ue=(0,u.createElement)(u.Fragment,null,z&&(0,u.createElement)(zS.Provider,{value:le},(0,u.createElement)(HS.Provider,{value:ae},(0,u.createElement)(k.Z.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},r&&r({value:ne,onChange:re,onFocus:se}),(0,u.createElement)(ZS,{value:ne,onChange:re,onFocus:se,formatTypes:Y,forwardedRef:O})))),z&&$&&(0,u.createElement)(kS,{inline:c,anchorRef:O,value:ne}),(0,u.createElement)(ce,(0,bo.Z)({role:"textbox","aria-multiline":!L,"aria-label":h},R,ie,{ref:(0,sd.Z)([n,ie.ref,R.ref,oe,AS({value:ne,onChange:re,__unstableAllowPrefixTransformations:D,formatTypes:Y,onReplace:m,selectionChange:V}),(0,Ps.Z)((e=>{function t(e){(Uf.isKeyboardEvent.primary(e,"z")||Uf.isKeyboardEvent.primary(e,"y")||Uf.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),OS(le),FS(ae),wS(),NS({isSelected:z,disableFormats:A,onChange:re,value:ne,formatTypes:Y,tagName:o,onReplace:m,onSplit:C,onSplitMiddle:S,__unstableEmbedURLOnPaste:B,multilineTag:W,preserveWhiteSpace:T,pastePlainText:N}),LS({removeEditorOnlyFormats:te,value:ne,onReplace:m,onSplit:C,onSplitMiddle:S,multilineTag:W,onChange:re,disableLineBreaks:L,onSplitAtEnd:E}),jS(),O]),contentEditable:!0,suppressContentEditableWarning:!0,className:g()("block-editor-rich-text__editable",R.className,"rich-text"),onFocus:P,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===Uf.DELETE||t===Uf.BACKSPACE)){const{start:n,end:r,text:o}=ne,i=t===Uf.BACKSPACE,l=ne.activeFormats&&!!ne.activeFormats.length;if(!(0,Vo.zb)(ne)||l||i&&0!==n||!i&&r!==o.length)return;x&&x(!i),w&&(0,Vo.xb)(ne)&&i&&w(!i),e.preventDefault()}}})));if(!d)return ue;(0,Wo.Z)("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const de=g()("block-editor-rich-text",d);return(0,u.createElement)("div",{className:de},ue)}));VS.Content=e=>{let{value:t,tagName:n,multiline:r,...o}=e;Array.isArray(t)&&(t=tr.toHTML(t));const i=ES(r);!t&&i&&(t=`<${i}></${i}>`);const l=(0,u.createElement)(Kt.Z,null,t);return n?(0,u.createElement)(n,(0,H.omit)(o,["format"]),l):l},VS.isEmpty=e=>!e||0===e.length;var WS=VS;function US(e){let{character:t,type:n,onUse:r}=e;const o=(0,u.useContext)(zS),i=(0,u.useRef)();return i.current=r,(0,u.useEffect)((()=>{function e(e){Uf.isKeyboardEvent[n](e,t)&&(i.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t,n]),null}function $S(e){let t,{name:n,shortcutType:r,shortcutCharacter:o,...i}=e,l="RichText.ToolbarControls";return n&&(l+=`.${n}`),r&&o&&(t=Uf.displayShortcut[r](o)),(0,u.createElement)(_.de,{name:l},(0,u.createElement)(By.Z,(0,bo.Z)({},i,{shortcut:t})))}function GS(e){let{inputType:t,onInput:n}=e;const r=(0,u.useContext)(HS),o=(0,u.useRef)();return o.current=n,(0,u.useEffect)((()=>{function e(e){e.inputType===t&&(o.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t]),null}var qS=n(65223);const KS="none",YS="custom",JS="media",XS="attachment",QS=["noreferrer","noopener"],eI=(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,u.createElement)(zo.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,u.createElement)(zo.y$,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),tI=e=>{let{linkDestination:t,onChangeUrl:n,url:r,mediaType:o="image",mediaUrl:i,mediaLink:l,linkTarget:a,linkClass:s,rel:c}=e;const[d,p]=(0,u.useState)(!1),m=(0,u.useCallback)((()=>{p(!0)})),[h,f]=(0,u.useState)(!1),[g,v]=(0,u.useState)(null),b=(0,u.useRef)(null),y=(0,u.useCallback)((()=>{t!==JS&&t!==XS||v(""),f(!0)})),_=(0,u.useCallback)((()=>{f(!1)})),k=(0,u.useCallback)((()=>{v(null),_(),p(!1)})),x=(0,u.useCallback)((()=>e=>{const t=b.current;t&&t.contains(e.target)||(p(!1),v(null),_())})),C=(0,u.useCallback)((()=>e=>{if(g){var t;const e=(null===(t=S().find((e=>e.url===g)))||void 0===t?void 0:t.linkDestination)||YS;n({href:g,linkDestination:e})}_(),v(null),e.preventDefault()})),E=(0,u.useCallback)((()=>{n({linkDestination:KS,href:""})})),S=()=>{const e=[{linkDestination:JS,title:(0,w.__)("Media File"),url:"image"===o?i:void 0,icon:eI}];return"image"===o&&l&&e.push({linkDestination:XS,title:(0,w.__)("Attachment Page"),url:"image"===o?l:void 0,icon:(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,u.createElement)(zo.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},I=(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Is.Z,{label:(0,w.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=c?c:"").split(" ");QS.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===QS.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,u.createElement)(Ju.Z,{label:(0,w.__)("Link Rel"),value:null!=c?c:"",onChange:e=>{n({rel:e})}}),(0,u.createElement)(Ju.Z,{label:(0,w.__)("Link CSS Class"),value:s||"",onChange:e=>{n({linkClass:e})}})),T=null!==g?g:r,N=((0,H.find)(S(),["linkDestination",t])||{}).title;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(By.Z,{icon:Tk.Z,className:"components-toolbar__control",label:r?(0,w.__)("Edit link"):(0,w.__)("Insert link"),"aria-expanded":d,onClick:m}),d&&(0,u.createElement)(iS,{onFocusOutside:x(),onClose:k,renderSettings:()=>I,additionalControls:!T&&(0,u.createElement)(fy.Z,null,(0,H.map)(S(),(e=>(0,u.createElement)(vs.Z,{key:e.linkDestination,icon:e.icon,onClick:()=>{v(null),(e=>{const t=S();let r;r=e?((0,H.find)(t,(t=>t.url===e))||{linkDestination:YS}).linkDestination:KS,n({linkDestination:r,href:e})})(e.url),_()}},e.title))))},(!r||h)&&(0,u.createElement)(iS.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:T,onChangeInputValue:v,onSubmit:C(),autocompleteRef:b}),r&&!h&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(iS.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:r,onEditLinkClick:y,urlLabel:N}),(0,u.createElement)(Ss.Z,{icon:qS.Z,label:(0,w.__)("Remove link"),onClick:E}))))};var nI=(0,ud.Z)((e=>({selectedBlockClientId:e(rs).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=Os(t);return t?(0,u.createElement)(Ss.Z,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,w.__)("Skip to the selected block")):null}));function rI(e){let{genericPreviewBlock:t,style:n,className:r,activeStyle:o}=e;const i=Wy(r,o,n),l=(0,u.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:i+" block-editor-block-styles__block-preview-container"}})),[t,i]);return(0,u.createElement)(Nv,{item:l,isStylePreview:!0})}function oI(e){let{children:t,scope:n,...r}=e;return(0,u.createElement)(_.de,{name:`BlockStylesPreviewPanel/${n}`},(0,u.createElement)("div",r,t))}const iI=()=>{};function lI(e){let{clientId:t,onSwitch:n=iI,onHoverClassName:r=iI,scope:o}=e;const{onSelect:i,stylesToRender:l,activeStyle:a,genericPreviewBlock:s,className:c}=$y({clientId:t,onSwitch:n}),[d,p]=(0,u.useState)(null),[m,h]=(0,u.useState)(0),f=(0,ad.Z)("medium","<");if((0,u.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;h(t+16)}),[d]),!l||0===l.length)return null;const v=(0,H.debounce)(p,250),b=e=>{var t;d!==e?(v(e),r(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):v.cancel()};return(0,u.createElement)("div",{className:"block-editor-block-styles"},(0,u.createElement)("div",{className:"block-editor-block-styles__variants"},l.map((e=>{const t=e.label||e.name;return(0,u.createElement)(Ss.Z,{className:g()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>b(e),onFocus:()=>b(e),onMouseLeave:()=>b(null),onBlur:()=>b(null),onClick:()=>(e=>{i(e),r(null),p(null),v.cancel()})(e),"aria-current":a.name===e.name},(0,u.createElement)(zy.Z,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),d&&!f&&(0,u.createElement)(oI,{scope:o,className:"block-editor-block-styles__preview-panel",style:{top:m},onMouseLeave:()=>b(null)},(0,u.createElement)(rI,{activeStyle:a,className:c,genericPreviewBlock:s,style:d})))}lI.Slot=function(e){let{scope:t}=e;return(0,u.createElement)(_.g7,{name:`BlockStylesPreviewPanel/${t}`})};var aI=lI;const sI={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/&nbsp;|&#160;/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 cI(e,t){return t.replace(e.HTMLRegExp,"\n")}function uI(e,t){return t.replace(e.astralRegExp,"a")}function dI(e,t){return t.replace(e.HTMLEntityRegExp,"")}function pI(e,t){return t.replace(e.connectorRegExp," ")}function mI(e,t){return t.replace(e.removeRegExp,"")}function hI(e,t){return t.replace(e.HTMLcommentRegExp,"")}function fI(e,t){return e.shortcodesRegExp?t.replace(e.shortcodesRegExp,"\n"):t}function gI(e,t){return t.replace(e.spaceRegExp," ")}function vI(e,t){return t.replace(e.HTMLEntityRegExp,"a")}function bI(e,t,n){var r,o;return e=[cI.bind(null,n),hI.bind(null,n),fI.bind(null,n),uI.bind(null,n),gI.bind(null,n),vI.bind(null,n)].reduce(((e,t)=>t(e)),e),null!==(r=null===(o=(e+="\n").match(t))||void 0===o?void 0:o.length)&&void 0!==r?r:0}var yI=(0,ud.Z)((e=>{const{getMultiSelectedBlocks:t}=e(rs);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=function(e,t,n){const r=function(e,t){var n,r;const o=Object.assign({},sI,t);return o.shortcodes=null!==(n=null===(r=o.l10n)||void 0===r?void 0:r.shortcodes)&&void 0!==n?n:[],o.shortcodes&&o.shortcodes.length&&(o.shortcodesRegExp=new RegExp("\\[\\/?(?:"+o.shortcodes.join("|")+")[^\\]]*?\\]","g")),o.type=e,"characters_excluding_spaces"!==o.type&&"characters_including_spaces"!==o.type&&(o.type="words"),o}(t,n);let o;switch(r.type){case"words":return o=r.wordsRegExp,function(e,t,n){var r,o;return e=[cI.bind(null,n),hI.bind(null,n),fI.bind(null,n),gI.bind(null,n),dI.bind(null,n),pI.bind(null,n),mI.bind(null,n)].reduce(((e,t)=>t(e)),e),null!==(r=null===(o=(e+="\n").match(t))||void 0===o?void 0:o.length)&&void 0!==r?r:0}(e,o,r);case"characters_including_spaces":return o=r.characters_including_spacesRegExp,bI(e,o,r);case"characters_excluding_spaces":return o=r.characters_excluding_spacesRegExp,bI(e,o,r);default:return 0}}(sn(t),"words");return(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,u.createElement)(pg,{icon:Fy.Z,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,w.sprintf)((0,w._n)("%d block","%d blocks",t.length),t.length)),(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,w.sprintf)((0,w._n)("%d word","%d words",n),n))))}));function _I(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:r,styles:o}=(0,b.Z)((e=>{var n,r;const o=e(rs).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==o||null===(n=o.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(r=null==o?void 0:o.onChange)&&void 0!==r?r:null,styles:e(Rt).getBlockStyles(t)}}),[t]),i=(0,u.useMemo)((()=>[{label:(0,w.__)("Not set"),value:""},...o.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[o]),l=(0,u.useMemo)((()=>{var e;return null===(e=Uy(o))||void 0===e?void 0:e.name}),[o]),a=(0,u.useCallback)((e=>{r(t,e)}),[t,r]);return n&&n!==l?r&&(0,u.createElement)("div",{className:"default-style-picker__default-switcher"},(0,u.createElement)(Qv.Z,{options:i,value:n||"",label:(0,w.__)("Default Style"),onChange:a})):null}var kI=n(36914);function wI(e){let{className:t,onSelectVariation:n,selectedValue:r,variations:o}=e;return(0,u.createElement)("fieldset",{className:t},(0,u.createElement)(og.Z,{as:"legend"},(0,w.__)("Transform to variation")),o.map((e=>(0,u.createElement)(Ss.Z,{key:e.name,icon:(0,u.createElement)(pg,{icon:e.icon,showColors:!0}),isPressed:r===e.name,label:r===e.name?e.title:(0,w.sprintf)((0,w.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function xI(e){let{className:t,onSelectVariation:n,selectedValue:r,variations:o}=e;const i=o.map((e=>{let{name:t,title:n,description:r}=e;return{value:t,label:n,info:r}}));return(0,u.createElement)(wd.Z,{className:t,label:(0,w.__)("Transform to variation"),text:(0,w.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:wy.Z,toggleProps:{iconPosition:"right"}},(()=>(0,u.createElement)("div",{className:`${t}__container`},(0,u.createElement)(gs.Z,null,(0,u.createElement)(kI.Z,{choices:i,value:r,onSelect:n})))))}var CI=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,y.Z)(rs),{activeBlockVariation:r,variations:o}=(0,b.Z)((e=>{const{getActiveBlockVariation:n,getBlockVariations:r}=e(Rt),{getBlockName:o,getBlockAttributes:i}=e(rs),l=t&&o(t);return{activeBlockVariation:n(l,i(t)),variations:l&&r(l,"transform")}}),[t]),i=null==r?void 0:r.name,l=(0,u.useMemo)((()=>{const e=new Set;return!!o&&(o.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===o.length)}),[o]);if(null==o||!o.length)return null;const a=l?wI:xI;return(0,u.createElement)(a,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...o.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:o})};const EI=e=>{let{clientId:t,blockName:n,hasBlockStyles:r}=e;const o=cy(t);return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(mg,o),(0,u.createElement)(CI,{blockClientId:t}),r&&(0,u.createElement)("div",null,(0,u.createElement)(Qu.Z,{title:(0,w.__)("Styles")},(0,u.createElement)(aI,{scope:"core/block-inspector",clientId:t}),Ue(n,"defaultStylePicker",!0)&&(0,u.createElement)(_I,{blockName:n}))),(0,u.createElement)(lc.Slot,null),(0,u.createElement)(lc.Slot,{__experimentalGroup:"color",label:(0,w.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(lc.Slot,{__experimentalGroup:"typography",label:(0,w.__)("Typography")}),(0,u.createElement)(lc.Slot,{__experimentalGroup:"dimensions",label:(0,w.__)("Dimensions")}),(0,u.createElement)(lc.Slot,{__experimentalGroup:"border",label:(0,w.__)("Border")}),(0,u.createElement)("div",null,(0,u.createElement)(SI,null)),(0,u.createElement)(nI,{key:"back"}))},SI=()=>{const e=(0,us.Z)(ic.slotName);return Boolean(e.fills&&e.fills.length)?(0,u.createElement)(Qu.Z,{className:"block-editor-block-inspector__advanced",title:(0,w.__)("Advanced"),initialOpen:!1},(0,u.createElement)(lc.Slot,{__experimentalGroup:"advanced"})):null};var II=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:r,selectedBlockName:o,selectedBlockClientId:i,blockType:l}=(0,b.Z)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:r}=e(rs),{getBlockStyles:o}=e(Rt),i=t(),l=i&&r(i),a=l&&He(l),s=l&&o(l);return{count:n(),selectedBlockClientId:i,selectedBlockName:l,blockType:a,hasBlockStyles:s&&s.length>0}}),[]);if(n>1)return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(yI,null),(0,u.createElement)(lc.Slot,null),(0,u.createElement)(lc.Slot,{__experimentalGroup:"color",label:(0,w.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(lc.Slot,{__experimentalGroup:"typography",label:(0,w.__)("Typography")}),(0,u.createElement)(lc.Slot,{__experimentalGroup:"dimensions",label:(0,w.__)("Dimensions")}),(0,u.createElement)(lc.Slot,{__experimentalGroup:"border",label:(0,w.__)("Border")}));const a=o===Ze();return l&&i&&!a?(0,u.createElement)(EI,{clientId:i,blockName:l.name,hasBlockStyles:r}):t?(0,u.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,w.__)("No block selected.")):null};function TI(e){let{children:t,__unstableContentRef:n,...r}=e;const o=(0,ad.Z)("medium"),i=(0,b.Z)((e=>e(rs).getSettings().hasFixedToolbar),[]),l=(0,Fg.sx)(),{getSelectedBlockClientIds:a,getBlockRootClientId:s}=(0,b.Z)(rs),{duplicateBlocks:c,removeBlocks:d,insertAfterBlock:p,insertBeforeBlock:m,clearSelectedBlock:h,moveBlocksUp:f,moveBlocksDown:g}=(0,y.Z)(rs);return(0,u.createElement)("div",(0,bo.Z)({},r,{onKeyDown:function(e){if(!e.defaultPrevented)if(l("core/block-editor/move-up",e)){const t=a();if(t.length){e.preventDefault();const n=s((0,H.first)(t));f(t,n)}}else if(l("core/block-editor/move-down",e)){const t=a();if(t.length){e.preventDefault();const n=s((0,H.first)(t));g(t,n)}}else if(l("core/block-editor/duplicate",e)){const t=a();t.length&&(e.preventDefault(),c(t))}else if(l("core/block-editor/remove",e)){const t=a();t.length&&(e.preventDefault(),d(t))}else if(l("core/block-editor/insert-after",e)){const t=a();t.length&&(e.preventDefault(),p((0,H.last)(t)))}else if(l("core/block-editor/insert-before",e)){const t=a();t.length&&(e.preventDefault(),m((0,H.first)(t)))}else l("core/block-editor/unselect",e)&&a().length&&(e.preventDefault(),h(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),null==n||n.current.focus())}}),(0,u.createElement)(iy,{__unstableContentRef:n},(i||!o)&&(0,u.createElement)(V_,{isFixed:!0}),(0,u.createElement)(G_,{__unstableContentRef:n}),(0,u.createElement)(k.Z.Slot,{name:"block-toolbar",ref:ac(n)}),t,(0,u.createElement)(k.Z.Slot,{name:"__unstable-block-tools-after",ref:ac(n)})))}const NI=()=>{};var BI=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i,showMostUsedBlocks:l=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:s,onSelect:c=NI,shouldFocusBlock:d=!1}=e;const p=(0,b.Z)((e=>{const{getBlockRootClientId:t}=e(rs);return n||t(r)||void 0}),[r,n]);return(0,u.createElement)(Ub,{onSelect:c,rootClientId:p,clientId:r,isAppender:o,showInserterHelpPanel:i,showMostUsedBlocks:l,__experimentalInsertionIndex:a,__experimentalFilterValue:s,shouldFocusBlock:d,ref:t})}));function AI(){return null}AI.Register=function(){const{registerShortcut:e}=(0,y.Z)(Fg.h);return(0,u.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,w.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,w.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,w.__)("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,w.__)("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,w.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,w.__)("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,w.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,w.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,w.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,w.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var LI=AI;const PI=new Set([Uf.UP,Uf.RIGHT,Uf.DOWN,Uf.LEFT,Uf.ENTER,Uf.BACKSPACE]);function DI(){const{isTyping:e,hasInlineToolbar:t}=(0,b.Z)((e=>{const{isTyping:t,getSettings:n}=e(rs);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:r}=(0,y.Z)(rs),o=function(){const e=(0,b.Z)((e=>e(rs).isTyping()),[]),{stopTyping:t}=(0,y.Z)(rs);return(0,Ps.Z)((n=>{if(!e)return;const{ownerDocument:r}=n;let o,i;function l(e){const{clientX:n,clientY:r}=e;o&&i&&(o!==n||i!==r)&&t(),o=n,i=r}return r.addEventListener("mousemove",l),()=>{r.removeEventListener("mousemove",l)}}),[e,t])}(),i=(0,Ps.Z)((o=>{const{ownerDocument:i}=o,{defaultView:l}=i,a=l.getSelection();if(e){let c;function u(e){const{target:t}=e;c=l.setTimeout((()=>{xf(t)||r()}))}function d(e){const{keyCode:t}=e;t!==Uf.ESCAPE&&t!==Uf.TAB||r()}function p(){a.isCollapsed||r()}return o.addEventListener("focus",u),o.addEventListener("keydown",d),t||i.addEventListener("selectionchange",p),()=>{l.clearTimeout(c),o.removeEventListener("focus",u),o.removeEventListener("keydown",d),i.removeEventListener("selectionchange",p)}}function s(e){const{type:t,target:r}=e;xf(r)&&o.contains(r)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&PI.has(t)}(e))&&n()}return o.addEventListener("keypress",s),o.addEventListener("keydown",s),()=>{o.removeEventListener("keypress",s),o.removeEventListener("keydown",s)}}),[e,t,n,r]);return(0,sd.Z)([o,i])}var RI=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:DI()},t)};const MI={button:"wp-element-button",caption:"wp-element-caption"},OI=e=>MI[e]?MI[e]:"";var FI=n(51931),jI=n(62668);const ZI=async function(e){let{perPage:t=20}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await(0,p.default)({path:(0,Lb.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,gn.decodeEntities)(e.title)||`(${jI.x.I18n.t("noName")})`,type:e.subtype||e.type}))):[]};var zI=n(39519),HI=n.n(zI),VI=n(20264);function WI(e){let{isActive:t,label:n,info:r,onToggle:o}=e;return(0,VI.jsx)(vs.Z,{icon:t&&Hy.Z,isSelected:t,onClick:o,role:"menuitemcheckbox",info:r,children:n})}var UI=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));function $I(e){const t=(0,b.Z)((e=>e("mailpoet-form-editor").hasEditorUndo()),[]),{historyUndo:n}=(0,y.Z)("mailpoet-form-editor"),{registerShortcut:r}=(0,y.Z)("core/keyboard-shortcuts");return(0,Fg.bx)("mailpoet-form-editor/undo",(e=>{n(),e.preventDefault()})),(0,u.useEffect)((()=>{r({name:"mailpoet-form-editor/undo",category:"block",description:(0,w.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}})}),[r]),(0,VI.jsx)(Ss.Z,{...e,icon:UI,label:(0,w.__)("Undo"),shortcut:Uf.displayShortcut.primary("z"),"aria-disabled":!t,onClick:t?()=>{n()}:void 0,className:"editor-history__undo"})}var GI=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));function qI(e){const t=(0,b.Z)((e=>e("mailpoet-form-editor").hasEditorRedo()),[]),{historyRedo:n}=(0,y.Z)("mailpoet-form-editor"),{registerShortcut:r}=(0,y.Z)("core/keyboard-shortcuts"),o=()=>{n()};return(0,Fg.bx)("mailpoet-form-editor/redo",(e=>{o(),e.preventDefault()})),(0,u.useEffect)((()=>{r({name:"mailpoet-form-editor/redo",category:"block",description:(0,w.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}})}),[r]),(0,VI.jsx)(Ss.Z,{...e,icon:GI,label:(0,w.__)("Redo"),shortcut:Uf.displayShortcut.primaryShift("z"),"aria-disabled":!t,onClick:t?o:void 0,className:"editor-history__redo"})}function KI(e){let{isInserterOpened:t,setIsInserterOpened:n}=e;const r=(0,b.Z)((e=>e("mailpoet-form-editor").getSidebarOpened()),[]),o=(0,b.Z)((e=>e("mailpoet-form-editor").getIsFormSaving()),[]),i=(0,b.Z)((e=>e("mailpoet-form-editor").getIsPreviewShown()),[]),l=(0,b.Z)((e=>e("mailpoet-form-editor").isFullscreenEnabled()),[]),{toggleSidebar:a,saveForm:s,showPreview:c,toggleFullscreen:u}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsxs)("div",{className:"edit-post-header",children:[(0,VI.jsxs)("div",{className:"edit-post-header__settings",children:[(0,VI.jsx)(Ss.Z,{isSecondary:!0,onClick:c,isPressed:i,className:"mailpoet-preview-button","data-automation-id":"form_preview_button",children:(0,w.__)("Preview")}),(0,VI.jsx)(Ss.Z,{isPrimary:!0,className:"editor-post-publish-button","data-automation-id":"form_save_button",isBusy:o,onClick:s,children:o?`${(0,w.__)("Saving")}`:(0,w.__)("Save")}),(0,VI.jsx)(Ss.Z,{icon:"admin-generic",label:jI.x.I18n.t("formSettings"),tooltipPosition:"down",onClick:()=>a(!r),isPressed:r,className:"mailpoet-editor-header-button"}),(0,VI.jsx)(wd.Z,{icon:a_.Z,label:(0,w.__)("More tools & options"),className:"edit-post-more-menu",popoverProps:{className:"edit-post-more-menu__content"},children:()=>(0,VI.jsx)(gs.Z,{label:(0,w._x)("View","noun"),className:"mailpoet-dropdown-menu-group",children:(0,VI.jsx)(WI,{shortcut:"Ctrl+Shift+Alt+F",label:(0,w.__)("Fullscreen mode"),info:(0,w.__)("Work without distraction"),isActive:l,onToggle:()=>u(!l)})})})]}),(0,VI.jsx)("div",{className:"edit-post-header__toolbar",children:(0,VI.jsxs)("div",{className:"toolbar edit-post-header-toolbar edit-post-header-toolbar__left",children:[(0,VI.jsx)(Ss.Z,{isSecondary:!0,href:"?page=mailpoet-forms#/",className:"mailpoet-editor-header-button",children:jI.x.I18n.t("back")}),(0,VI.jsx)(by.Z,{as:Ss.Z,"data-automation-id":"form_inserter_open",className:"edit-post-header-toolbar__inserter-toggle",isPrimary:!0,isPressed:t,onClick:()=>n(!t),icon:rg.Z,label:(0,w._x)("Add block","Generic label for block inserter button")}),(0,VI.jsx)($I,{"data-automation-id":"form_undo_button"}),(0,VI.jsx)(qI,{"data-automation-id":"form_redo_button"})]})})]})}KI.propTypes={isInserterOpened:HI().bool.isRequired,setIsInserterOpened:HI().func.isRequired};var YI=n(69156),JI=n(49029);function XI(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getTutorialUrl()),[]),t=(0,b.Z)((e=>e("mailpoet-form-editor").getTutorialSeen()),[]),{tutorialDismissed:n}=(0,y.Z)("mailpoet-form-editor"),r=(0,u.useCallback)((()=>{n()}),[n]);return t?null:(0,VI.jsx)(YI.u,{isDismissible:!0,onRequestClose:r,children:(0,VI.jsxs)("div",{className:"mailpoet_drag_and_drop_tutorial","data-automation-id":"form-editor-tutorial",children:[(0,VI.jsx)(JI.X,{level:2,children:jI.x.I18n.t("tutorialHeading")}),(0,VI.jsx)("video",{style:{height:"640px"},src:e,controls:!0,autoPlay:!0})]})})}var QI=n(76874),eT=n(53556),tT=n(52405),nT=n(26138),rT=n(65311),oT=n.n(rT),iT=n(35614);n(1201);class lT extends u.Component{constructor(e){super(e),(0,nT.Z)(this,"getFieldId",(e=>{const t=e||this.props;return t.field.id||t.field.name})),(0,nT.Z)(this,"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(iT.ZP.isArray(this.props.item[this.props.field.name]))return this.props.item[this.props.field.name].map((e=>e.id))}return null})),(0,nT.Z)(this,"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),iT.ZP.isArray(e)&&void 0!==this.props.field.filter&&(e=e.filter(this.props.field.filter)),e})),(0,nT.Z)(this,"getLabel",(e=>void 0!==this.props.field.getLabel?this.props.field.getLabel(e,this.props.item):e.name)),(0,nT.Z)(this,"getSearchLabel",(e=>void 0!==this.props.field.getSearchLabel?this.props.field.getSearchLabel(e,this.props.item):null)),(0,nT.Z)(this,"getValue",(e=>void 0!==this.props.field.getValue?this.props.field.getValue(e,this.props.item):e.id)),(0,nT.Z)(this,"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=oT()(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=iT.ZP.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=oT()(`#${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)})),(0,nT.Z)(this,"resetSelect2",(()=>{this.destroySelect2(),this.setupSelect2()})),(0,nT.Z)(this,"destroySelect2",(()=>{this.isSelect2Initialized()&&(oT()(`#${this.selectRef.current.id}`).select2("destroy"),this.cleanupAfterSelect2())})),(0,nT.Z)(this,"cleanupAfterSelect2",(()=>{oT()(`#${this.selectRef.current.id}`).find("option:not(.default)").remove(),oT()(`#${this.selectRef.current.id}`).off("select2:unselecting").off("select2:opening")})),(0,nT.Z)(this,"allowMultipleValues",(()=>!0===this.props.field.multiple)),(0,nT.Z)(this,"isSelect2Initialized",(()=>!0===oT()(`#${this.selectRef.current.id}`).hasClass("select2-hidden-accessible"))),(0,nT.Z)(this,"isSelect2Component",(()=>this.allowMultipleValues()||this.props.field.forceSelect2)),(0,nT.Z)(this,"handleChange",(e=>{if(void 0===this.props.onValueChange)return;const t=oT()(`#${this.selectRef.current.id}`).children(":selected").map((function(){return{id:oT()(this).val(),text:oT()(this).text()}})),n=this.props.field.multiple?iT.ZP.pluck(t,"id"):iT.ZP.pluck(t,"id").toString(),r=this.transformChangedValue(n,t);this.props.onValueChange({target:{value:r,name:this.props.field.name,id:e.target.id}})})),(0,nT.Z)(this,"transformChangedValue",((e,t)=>"function"==typeof this.props.field.transformChangedValue?this.props.field.transformChangedValue.call(this,e,t):e)),(0,nT.Z)(this,"insertEmptyOption",(()=>{if(!this.allowMultipleValues())return this.props.field.placeholder?(0,VI.jsx)("option",{className:"default"}):void 0})),this.selectRef=(0,u.createRef)()}componentDidMount(){this.isSelect2Component()&&this.setupSelect2()}componentDidUpdate(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&oT()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),void 0!==this.props.item&&void 0!==e.item&&this.allowMultipleValues()&&iT.ZP.isArray(this.props.item[this.props.field.name])&&!iT.ZP.isEqual(this.props.item[this.props.field.name],e.item[this.props.field.name])&&oT()(`#${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()}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,VI.jsx)("option",{className:"default",value:r,title:n,children:t},`option-${e.id}`)}));return(0,VI.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]})}}function aT(){const[e,t]=(0,u.useState)(!1),n=(0,b.Z)((e=>e("mailpoet-form-editor").getFormName()),[]),r=g()({"is-selected":e}),{changeFormName:o}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsxs)("div",{className:r,children:[(0,VI.jsx)("label",{htmlFor:"post-title",className:"screen-reader-text",children:jI.x.I18n.t("addFormName")}),(0,VI.jsx)("input",{id:"form-title",className:"form-editor-title",placeholder:jI.x.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 sT(e){let{onToggle:t,isOpened:n}=e;const r=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),o=(0,b.Z)((e=>e("mailpoet-form-editor").getAllAvailableSegments()),[]),i=(0,b.Z)((e=>e("mailpoet-form-editor").getAllAvailablePages()),[]),l=(0,b.Z)((e=>e("mailpoet-form-editor").getNotice("missing-lists")),[]),a=(0,b.Z)((e=>e("mailpoet-form-editor").isFormEnabled()),[]),{changeFormSettings:s,toggleForm:c}=(0,y.Z)("mailpoet-form-editor"),u=r.segments?o.filter((e=>r.segments.includes(e.id.toString()))):[],d=l&&!u.length;return(0,VI.jsx)(QI.Z,{children:(0,VI.jsxs)(Qu.Z,{title:jI.x.I18n.t("formSettings"),opened:n,onToggle:t,children:[(0,VI.jsx)(aT,{}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayForm"),checked:a,onChange:c}),(0,VI.jsxs)(rw.ZP,{label:jI.x.I18n.t("settingsListLabel"),className:g()({"mailpoet-form-missing-lists":d}),children:[d?(0,VI.jsx)("span",{className:"mailpoet-form-lists-error",children:jI.x.I18n.t("settingsPleaseSelectList")}):null,(0,VI.jsx)(lT,{item:{segments:u},onValueChange:e=>{(0,H.isEqual)(r.segments,e.target.value)||s({...r,segments:e.target.value})},field:{id:"segments",name:"segments",values:o,multiple:!0,placeholder:jI.x.I18n.t("settingsPleaseSelectList"),getLabel:e=>`${e.name} (${parseInt(e.subscribers,10).toLocaleString()})`,filter:e=>!(e.deleted_at||"default"!==e.type)}})]}),(0,VI.jsx)(eT.Z,{className:"mailpoet-form-success-types__control",onChange:e=>{s({...r,on_success:e})},selected:r.on_success||"message",label:jI.x.I18n.t("settingsAfterSubmit"),options:[{label:jI.x.I18n.t("settingsShowMessage"),value:"message"},{label:jI.x.I18n.t("settingsGoToPage"),value:"page"}]}),"page"===r.on_success?(0,VI.jsx)(Qv.Z,{value:r.success_page,options:i.map((e=>({value:e.id.toString(),label:e.title}))),onChange:e=>{s({...r,success_page:e})}}):(0,VI.jsx)(tT.Z,{value:r.success_message,onChange:e=>{s({...r,success_message:e})},rows:3})]})})}let cT;lT.propTypes={onValueChange:HI().func,field:HI().shape({name:HI().string.isRequired,values:HI().oneOfType([HI().object,HI().array]),getLabel:HI().func,resetSelect2OnUpdate:HI().bool,selected:HI().func,endpoint:HI().string,filter:HI().func,getSearchLabel:HI().func,getValue:HI().func,placeholder:HI().string,remoteQuery:HI().object,extendSelect2Options:HI().object,multiple:HI().bool,forceSelect2:HI().bool,transformChangedValue:HI().func,disabled:HI().bool,validation:HI().shape({"data-parsley-required":HI().bool,"data-parsley-required-message":HI().string,"data-parsley-type":HI().string,"data-parsley-errors-container":HI().string,maxLength:HI().number})}).isRequired,item:HI().object,disabled:HI().bool,width:HI().string,dropDownParent:HI().string},lT.defaultProps={onValueChange:function(){},disabled:!1,width:"",item:void 0,dropDownParent:void 0},sT.propTypes={onToggle:HI().func.isRequired,isOpened:HI().bool.isRequired},function(e){e.Left="left",e.Center="center",e.Right="right"}(cT||(cT={}));var uT=n(49601);const dT=["colors","disableCustomColors","gradients","disableCustomGradients"],pT=e=>{let{className:t,colors:n,gradients:r,disableCustomColors:o,disableCustomGradients:i,children:l,settings:a,title:s,showTitle:c=!0,__experimentalHasMultipleOrigins:d,__experimentalIsRenderedInSidebar:p,enableAlpha:m}=e;const h=(0,id.Z)(pT),{batch:f}=(0,bg.Z)();return(0,H.isEmpty)(n)&&(0,H.isEmpty)(r)&&o&&i&&(0,H.every)(a,(e=>(0,H.isEmpty)(e.colors)&&(0,H.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,u.createElement)(qs.Z,{className:g()("block-editor-panel-color-gradient-settings",t),label:c?s:void 0,resetAll:()=>{f((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:r,onGradientChange:o}=e;t?r():n&&o()}))}))},panelId:h,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,u.createElement)(fw,{settings:a,panelId:h,colors:n,gradients:r,disableCustomColors:o,disableCustomGradients:i,__experimentalHasMultipleOrigins:d,__experimentalIsRenderedInSidebar:p,enableAlpha:m}),!!l&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(uT.Z,{marginY:4})," ",l))},mT=e=>{const t=Fk();return t.colors=Hs("color.palette"),t.gradients=Hs("color.gradients"),(0,u.createElement)(pT,(0,bo.Z)({},t,e))},hT=e=>{const t=jk();return(0,u.createElement)(pT,(0,bo.Z)({},t,e))};var fT=e=>(0,H.every)(dT,(t=>e.hasOwnProperty(t)))?(0,u.createElement)(pT,e):e.__experimentalHasMultipleOrigins?(0,u.createElement)(hT,e):(0,u.createElement)(mT,e);function gT(e){let{title:t,settings:n}=e;const r=Hs("color.palette"),o=Hs("color.gradients");return(0,VI.jsx)("div",{children:(0,VI.jsx)(fT,{title:t,colors:r,gradients:o,settings:n})})}function vT(e){let{value:t,onChange:n}=e;const r=Hs("typography.fontSizes");return(0,VI.jsx)(ox.Z,{value:t,onChange:n,fontSizes:r})}function bT(e){let{name:t,imageUrl:n,onImageUrlChange:r,imageDisplay:o,onImageDisplayChange:i}=e;return(0,VI.jsxs)("div",{className:"mailpoet-styles-settings-image-url",children:[(0,VI.jsx)(rw.ZP.VisualLabel,{children:t}),(0,VI.jsxs)("div",{className:"mailpoet-styles-settings-image-url-body",children:[(0,VI.jsx)("input",{type:"text",value:n??"",onChange:e=>r(e.target.value)}),(0,VI.jsx)(JE,{onSelect:e=>r(e.url),allowedTypes:["image"],render:e=>{let{open:t}=e;return(0,VI.jsx)(Ss.Z,{isSecondary:!0,isSmall:!0,onClick:t,children:jI.x.I18n.t("formSettingsStylesSelectImage")})}})]}),(0,VI.jsx)("div",{className:"mailpoet-styles-settings-image-url-display",children:(0,VI.jsx)(Qv.Z,{value:o,options:[{label:jI.x.I18n.t("imagePlacementScale"),value:"scale"},{label:jI.x.I18n.t("imagePlacementFit"),value:"fit"},{label:jI.x.I18n.t("imagePlacementTile"),value:"tile"}],onChange:i})})]})}const yT=(0,VI.jsx)(zo.Wj,{width:"14px",height:"14px",viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,VI.jsx)(zo.G,{id:"Symbols",stroke:"none",strokeWidth:"1",children:(0,VI.jsx)(zo.G,{id:"icons/ic_settings",children:(0,VI.jsx)(zo.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"})})})}),_T=(0,VI.jsx)(zo.Wj,{width:"13",height:"13",viewBox:"4 4 16 16",xmlns:"http://www.w3.org/2000/svg",children:(0,VI.jsx)(zo.G,{id:"icons/checkbox-on-small",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,VI.jsx)(zo.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 kT(e){let{label:t,active:n,canBeActive:r,onClick:o,children:i,className:l,automationId:a,displaySettingsIcon:s}=e;const[c,d]=(0,u.useState)(!1);return(0,VI.jsxs)("div",{"data-automation-id":a,className:g()(l,"selection-item",{"selection-item-active":n&&r}),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:o,onKeyDown:e=>{["keydown","keypress"].includes(e.type)&&["Enter"," "].includes(e.key)&&(e.preventDefault(),o())},role:"button",tabIndex:0,children:[(0,VI.jsxs)("div",{className:"selection-item-body",children:[(0,VI.jsxs)("div",{className:"selection-item-settings",children:[s?(0,VI.jsx)("div",{className:g()("selection-item-icon",{"selection-item-icon-hover":c}),children:yT}):(0,VI.jsx)("div",{}),c&&!n&&r&&(0,VI.jsx)("div",{className:"selection-item-settings-oval"}),n&&r&&(0,VI.jsx)("div",{className:"selection-item-check",children:_T})]}),i]}),c&&(0,VI.jsx)("div",{className:"selection-item-overlay"})]},t)}function wT(e){let{label:t,active:n,onClick:r,iconUrl:o}=e;return(0,VI.jsx)(kT,{label:t,onClick:r,active:n,canBeActive:!0,displaySettingsIcon:!1,className:"close-button-selection-item",children:(0,VI.jsx)("img",{src:o,alt:t.replace("_"," "),className:"close-button-selection-item-icon"})})}function xT(e){let{name:t,value:n,onChange:r}=e;const o=(0,b.Z)((e=>e("mailpoet-form-editor").getCloseIconsUrl()),[]);return(0,VI.jsxs)("div",{children:[(0,VI.jsx)(rw.ZP.VisualLabel,{children:t}),(0,VI.jsxs)("div",{className:"close-button-selection-item-list",children:[(0,VI.jsx)(wT,{label:"round_white",active:"round_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/round_white.svg"),onClick:()=>r("round_white")}),(0,VI.jsx)(wT,{label:"round_black",active:"round_black"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/round_black.svg"),onClick:()=>r("round_black")}),(0,VI.jsx)(wT,{label:"square_white",active:"square_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/square_white.svg"),onClick:()=>r("square_white")}),(0,VI.jsx)(wT,{label:"square_black",active:"square_black"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/square_black.svg"),onClick:()=>r("square_black")}),(0,VI.jsx)(wT,{label:"classic",active:"classic"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/classic.svg"),onClick:()=>r("classic")}),(0,VI.jsx)(wT,{label:"classic_white",active:"classic_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/classic_white.svg"),onClick:()=>r("classic_white")})]})]})}kT.defaultProps={canBeActive:!0,displaySettingsIcon:!0,className:void 0,automationId:void 0};const CT={width:{unit:"percent",value:100}},ET={formDelay:15,formCookieExpiration:7},ST={styles:{width:{unit:"pixel",value:560}},...ET,animation:"slideup"},IT={styles:{width:{unit:"percent",value:100}},position:"top",...ET,animation:"slideup"},TT={width:{unit:"percent",value:100}},NT={styles:{width:{unit:"pixel",value:560}},position:"right",...ET,animation:"slideup"},BT={formPadding:20,inputPadding:5,borderSize:0,borderRadius:0,alignment:"left",closeButton:"round_white"},AT=["Arial","Comic Sans MS","Courier New","Georgia","Lucida","Tahoma","Times New Roman","Trebuchet MS","Verdana"];function LT(e){let{onChange:t,value:n,name:r,hideLabelFromVision:o=!1}=e;const i=(0,b.Z)((e=>e("mailpoet-form-editor").getAllCustomFonts()),[]),l={color:"lightgray",backgroundColor:"white",cursor:"default"},a=e=>({fontFamily:e,cursor:"default",marginLeft:16}),s=[{key:jI.x.I18n.t("formFontsDefaultTheme"),name:jI.x.I18n.t("formFontsDefaultTheme"),selectable:!0,value:""},{key:jI.x.I18n.t("formFontsStandard"),name:jI.x.I18n.t("formFontsStandard"),selectable:!1,style:l},...AT.map((e=>({key:e,name:e,selectable:!0,style:a(e),value:e})))];jI.x.libs3rdPartyEnabled&&(s.push({key:jI.x.I18n.t("formFontsCustom"),name:jI.x.I18n.t("formFontsCustom"),selectable:!1,style:l}),i.forEach((e=>{s.push({key:e,name:e,selectable:!0,style:a(e),value:e})})));let c=void 0!==n&&s.find((e=>e.value===n));return c||(c=s[0]),(0,VI.jsx)(Rw.Z,{options:s,onChange:e=>{const n=e.selectedItem;n.selectable&&t(n.value)},value:c,label:r,className:"mailpoet-font-family-select",hideLabelFromVision:o})}function PT(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getAllCustomFonts()),[]);if(!jI.x.libs3rdPartyEnabled)return null;const t=e.map((e=>e.replace(" ","+"))).map((e=>e.concat(":400,400i,700,700i"))).join("|");return(0,VI.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css?family=${t}`})}function DT(e){let{onToggle:t,isOpened:n}=e;const{changeFormSettings:r}=(0,y.Z)("mailpoet-form-editor"),o=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),i=(0,u.useRef)(o);(0,u.useEffect)((()=>{i.current=o}),[o]);const l=(e,t)=>{const n={...i.current};n[e]=t??BT[e]??void 0,r(n),i.current=n};return(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("formSettingsStyles"),opened:n,onToggle:t,children:(0,VI.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,VI.jsx)(gT,{title:jI.x.I18n.t("formSettingsColor"),settings:[{label:jI.x.I18n.t("formSettingsStylesBackground"),colorValue:o.backgroundColor,gradientValue:o.gradient,onColorChange:(0,H.partial)(l,"backgroundColor"),onGradientChange:(0,H.partial)(l,"gradient")},{label:jI.x.I18n.t("formSettingsStylesFont"),colorValue:o.fontColor,onColorChange:(0,H.partial)(l,"fontColor")},{label:jI.x.I18n.t("formSettingsBorder"),colorValue:o.borderColor,onColorChange:(0,H.partial)(l,"borderColor")}]}),(0,VI.jsx)(bT,{name:jI.x.I18n.t("formSettingsStylesBackgroundImage"),imageUrl:o.backgroundImageUrl,onImageUrlChange:(0,H.partial)(l,"backgroundImageUrl"),imageDisplay:o.backgroundImageDisplay,onImageDisplayChange:(0,H.partial)(l,"backgroundImageDisplay")}),(0,VI.jsx)(vT,{value:o.fontSize,onChange:(0,H.partial)(l,"fontSize")}),(0,VI.jsx)(LT,{name:jI.x.I18n.t("formSettingsStylesFontFamily"),value:o.fontFamily,onChange:(0,H.partial)(l,"fontFamily")}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsInputPadding"),value:o.inputPadding,min:0,max:30,allowReset:!0,onChange:(0,H.partial)(l,"inputPadding")}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsBorderSize"),value:void 0!==o.borderSize?o.borderSize:0,min:0,max:10,allowReset:!0,onChange:(0,H.partial)(l,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsBorderRadius"),value:void 0!==o.borderRadius?o.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,H.partial)(l,"borderRadius")}),(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("formSettingsAlignment"),onChange:(0,H.partial)(l,"alignment"),options:[{value:cT.Left,label:jI.x.I18n.t("formSettingsAlignmentLeft")},{value:cT.Center,label:jI.x.I18n.t("formSettingsAlignmentCenter")},{value:cT.Right,label:jI.x.I18n.t("formSettingsAlignmentRight")}],value:o.alignment}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsFormPadding"),value:o.formPadding,min:0,max:40,allowReset:!0,onChange:(0,H.partial)(l,"formPadding")}),(0,VI.jsx)(gT,{title:jI.x.I18n.t("validationMessageColor"),settings:[{label:jI.x.I18n.t("successValidationColorTitle"),colorValue:o.successValidationColor,onColorChange:(0,H.partial)(l,"successValidationColor")},{label:jI.x.I18n.t("errorValidationColorTitle"),colorValue:o.errorValidationColor,onColorChange:(0,H.partial)(l,"errorValidationColor")}]}),(0,VI.jsx)(xT,{name:jI.x.I18n.t("closeButtonHeading"),value:o.closeButton,onChange:(0,H.partial)(l,"closeButton")})]})})})}const RT=(0,VI.jsxs)(zo.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,VI.jsxs)("defs",{children:[(0,VI.jsx)(zo.UL,{id:"a",x:"8",y:"8",width:"128",height:"68",rx:"1"}),(0,VI.jsx)(zo.UL,{id:"b",x:"8",y:"100",width:"128",height:"12",rx:"1"})]}),(0,VI.jsxs)(zo.G,{fill:"none",fillRule:"evenodd",children:[(0,VI.jsx)(zo.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,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,VI.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#a"}),(0,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#b"}),(0,VI.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#b"}),(0,VI.jsx)(zo.UL,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"84",width:"38",height:"8",rx:"1"}),(0,VI.jsx)(zo.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"84",width:"38",height:"8",rx:"1"}),(0,VI.jsx)(zo.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"84",width:"38",height:"8",rx:"1"})]})]});function MT(e){let{label:t,icon:n,active:r,canBeActive:o,onClick:i}=e;return(0,VI.jsxs)(kT,{label:t,onClick:i,active:r,canBeActive:o,className:"form-placement-option",automationId:`form-placement-option-${t}`,children:[(0,VI.jsx)("div",{className:"form-placement-option-icon",children:n}),(0,VI.jsx)("div",{className:"form-placement-option-label",children:(0,VI.jsx)("p",{children:t})})]})}function OT(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{showPlacementSettings:t}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsx)(MT,{active:e.formPlacement.belowPosts.enabled,label:jI.x.I18n.t("placeFormBellowPages"),icon:RT,onClick:()=>{t("below_posts")},canBeActive:!0})}MT.defaultProps={canBeActive:!0};const FT=(0,VI.jsxs)(zo.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,VI.jsxs)("defs",{children:[(0,VI.jsx)(zo.UL,{id:"popup_icon_a",x:"8",y:"8",width:"128",height:"104",rx:"1"}),(0,VI.jsx)(zo.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,VI.jsxs)("filter",{x:"-61.1%",y:"-56.2%",width:"222.2%",height:"237.5%",filterUnits:"objectBoundingBox",id:"popup_icon_b",children:[(0,VI.jsx)("feOffset",{dy:"6",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,VI.jsx)("feGaussianBlur",{stdDeviation:"10",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,VI.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,VI.jsxs)(zo.G,{fill:"none",fillRule:"evenodd",children:[(0,VI.jsx)(zo.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,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_a"}),(0,VI.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#popup_icon_a"}),(0,VI.jsxs)(zo.G,{fillRule:"nonzero",children:[(0,VI.jsx)("use",{fill:"#000",filter:"url(#popup_icon_b)",xlinkHref:"#popup_icon_c"}),(0,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_c"})]}),(0,VI.jsx)(zo.UL,{fill:"#FF5301",fillRule:"nonzero",x:"53",y:"66",width:"38",height:"8",rx:"1"}),(0,VI.jsx)(zo.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"54",width:"38",height:"8",rx:"1"}),(0,VI.jsx)(zo.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"42",width:"38",height:"8",rx:"1"})]})]});function jT(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{showPlacementSettings:t}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsx)(MT,{active:e.formPlacement.popup.enabled,label:jI.x.I18n.t("placePopupFormOnPages"),icon:FT,onClick:()=>{t("popup")},canBeActive:!0})}const ZT=(0,VI.jsxs)(zo.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,VI.jsx)("defs",{children:(0,VI.jsx)(zo.UL,{id:"fixed_bar_a",x:"8",y:"24",width:"128",height:"88",rx:"1"})}),(0,VI.jsxs)(zo.G,{fill:"none",fillRule:"evenodd",children:[(0,VI.jsx)(zo.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,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,VI.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#fixed_bar_a"}),(0,VI.jsx)(zo.UL,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"8",width:"38",height:"8",rx:"1"}),(0,VI.jsx)(zo.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"8",width:"38",height:"8",rx:"1"}),(0,VI.jsx)(zo.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"8",width:"38",height:"8",rx:"1"})]})]});function zT(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{showPlacementSettings:t}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsx)(MT,{active:e.formPlacement.fixedBar.enabled,label:jI.x.I18n.t("placeFixedBarFormOnPages"),icon:ZT,onClick:()=>{t("fixed_bar")},canBeActive:!0})}const HT=(0,VI.jsxs)(zo.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,VI.jsxs)("defs",{children:[(0,VI.jsxs)("filter",{id:"slide_in_prefix__a",width:"216.9%",height:"245.3%",x:"-55.8%",y:"-67.2%",filterUnits:"objectBoundingBox",children:[(0,VI.jsx)("feOffset",{dy:"4",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,VI.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"9"}),(0,VI.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,VI.jsxs)("feMerge",{children:[(0,VI.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,VI.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,VI.jsxs)("filter",{id:"slide_in_prefix__c",width:"226.3%",height:"255.8%",x:"-73.7%",y:"-77.9%",filterUnits:"objectBoundingBox",children:[(0,VI.jsx)("feOffset",{dx:"-3",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,VI.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"5.5"}),(0,VI.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,VI.jsx)(zo.UL,{id:"slide_in_prefix__b",width:"67.556",height:"54.6",x:"4.222",y:"4.2",rx:".525"}),(0,VI.jsx)(zo.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,VI.jsxs)(zo.G,{fill:"none",fillRule:"evenodd",filter:"url(#slide_in_prefix__a)",children:[(0,VI.jsx)(zo.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,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__b"}),(0,VI.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#slide_in_prefix__b"}),(0,VI.jsxs)(zo.G,{fillRule:"nonzero",transform:"translate(43.278 35.7)",children:[(0,VI.jsx)("use",{fill:"#000",filter:"url(#slide_in_prefix__c)",xlinkHref:"#slide_in_prefix__d"}),(0,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__d"}),(0,VI.jsx)(zo.UL,{width:"15.833",height:"4.2",x:"6.333",y:"14.7",fill:"#FF5301",rx:".525"}),(0,VI.jsx)(zo.UL,{width:"15.833",height:"4.2",x:"6.333",y:"9.45",fill:"#FFE0D0",rx:".525"}),(0,VI.jsx)(zo.UL,{width:"15.833",height:"4.2",x:"6.333",y:"4.2",fill:"#FFE0D0",rx:".525"})]})]})]});function VT(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{showPlacementSettings:t}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsx)(MT,{active:e.formPlacement.slideIn.enabled,label:jI.x.I18n.t("placeSlideInFormOnPages"),icon:HT,onClick:()=>{t("slide_in")},canBeActive:!0})}const WT=(0,VI.jsxs)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",width:"144",height:"120",viewBox:"0 0 144 120",children:[(0,VI.jsxs)("defs",{children:[(0,VI.jsx)(zo.UL,{id:"sidebar_icon_prefix__b",width:"82",height:"104",x:"8",y:"8",rx:"1"}),(0,VI.jsx)(zo.UL,{id:"sidebar_icon_prefix__c",width:"38",height:"30",x:"98",y:"8",rx:"1"}),(0,VI.jsx)(zo.UL,{id:"sidebar_icon_prefix__d",width:"38",height:"30",x:"98",y:"82",rx:"1"}),(0,VI.jsxs)("filter",{id:"sidebar_icon_prefix__a",width:"212.5%",height:"235%",x:"-56.2%",y:"-67.5%",filterUnits:"objectBoundingBox",children:[(0,VI.jsx)("feOffset",{dy:"7",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,VI.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"17.5"}),(0,VI.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,VI.jsxs)("feMerge",{children:[(0,VI.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,VI.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,VI.jsxs)(zo.G,{fill:"none",fillRule:"evenodd",filter:"url(#sidebar_icon_prefix__a)",children:[(0,VI.jsx)(zo.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,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__b"}),(0,VI.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__b"}),(0,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__c"}),(0,VI.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__c"}),(0,VI.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__d"}),(0,VI.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__d"}),(0,VI.jsx)(zo.UL,{width:"38",height:"8",x:"98",y:"66",fill:"#FF5301",fillRule:"nonzero",rx:"1"}),(0,VI.jsx)(zo.UL,{width:"38",height:"8",x:"98",y:"56",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"}),(0,VI.jsx)(zo.UL,{width:"38",height:"8",x:"98",y:"46",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"})]})]});function UT(){const{showPlacementSettings:e}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsx)(MT,{active:!1,label:jI.x.I18n.t("formPlacementOtherLabel"),icon:WT,onClick:()=>{e("others")},canBeActive:!1})}function $T(e){let{onToggle:t,isOpened:n}=e;return(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("formPlacement"),opened:n,onToggle:t,className:"form-sidebar-form-placement-panel",children:(0,VI.jsxs)("div",{className:"form-placement-option-list",children:[(0,VI.jsx)(OT,{}),(0,VI.jsx)(zT,{}),(0,VI.jsx)(jT,{}),(0,VI.jsx)(VT,{}),(0,VI.jsx)(UT,{})]})})})}$T.propTypes={onToggle:HI().func.isRequired,isOpened:HI().bool.isRequired};var GT=n(70907),qT=n.n(GT);function KT(e){let{options:t,value:n,onChange:r}=e;const o=(0,u.useRef)(null),i=(0,u.useRef)(null),l=(0,u.useCallback)((e=>{r(e.getValue())}),[r]);return(0,u.useEffect)((()=>(i.current=qT().fromTextArea(o.current,t),i.current.on("change",l),()=>{i.current&&i.current.toTextArea()})),[t,l]),(0,u.useEffect)((()=>{i.current.getValue()!==n&&(i.current.off("change",l),i.current.setValue(n),i.current.on("change",l))}),[n,l]),(0,VI.jsx)("div",{children:(0,VI.jsx)("textarea",{ref:o,name:"name",defaultValue:n,autoComplete:"off"})})}function YT(e){let{onToggle:t,isOpened:n}=e;const r=(0,b.Z)((e=>e("mailpoet-form-editor").getFormStyles()),[]),{changeFormStyles:o}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("customCss"),opened:n,onToggle:t,children:(0,VI.jsx)(KT,{value:r,onChange:o})})})}n(25002),KT.propTypes={value:HI().string.isRequired,onChange:HI().func.isRequired,options:HI().shape({lineNumbers:HI().bool,tabMode:HI().string,matchBrackets:HI().bool,theme:HI().string,mode:HI().string})},KT.defaultProps={options:{lineNumbers:!0,tabMode:"indent",matchBrackets:!0,theme:"neo",mode:"css"}},YT.propTypes={onToggle:HI().func.isRequired,isOpened:HI().bool.isRequired};var JT=n(55741);function XT(e){let{onToggle:t,isOpened:n}=e;const r=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{changeFormSettings:o}=(0,y.Z)("mailpoet-form-editor"),i=jI.x.tags.map((e=>e.name));return(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:"Tags",opened:n,onToggle:t,children:(0,VI.jsx)(JT.T,{label:jI.x.I18n.t("addNewTag"),onChange:e=>{(0,H.isEqual)(r.tags,e.value)||o({...r,tags:e.value})},suggestedValues:i,selectedValues:r.tags})})})}function QT(){const e=(0,y.Z)("mailpoet-form-editor").toggleSidebarPanel,t=(0,b.Z)((e=>e("mailpoet-form-editor").getSidebarOpenedPanels()),[]);return(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(sT,{isOpened:t.includes("basic-settings"),onToggle:(0,H.partial)(e,"basic-settings")}),(0,VI.jsx)(DT,{isOpened:t.includes("styles-settings"),onToggle:(0,H.partial)(e,"styles-settings")}),(0,VI.jsx)($T,{isOpened:t.includes("form-placement"),onToggle:(0,H.partial)(e,"form-placement")}),(0,VI.jsx)(XT,{isOpened:t.includes("tags"),onToggle:(0,H.partial)(e,"tags")}),(0,VI.jsx)(YT,{isOpened:t.includes("custom-css"),onToggle:(0,H.partial)(e,"custom-css")})]})}function eN(){return(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(II,{})})}function tN(e){let{children:t,closeSidebar:n}=e;return(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[(0,VI.jsx)("span",{className:"interface-complementary-area-header__small-title",children:jI.x.I18n.t("formSettings")}),(0,VI.jsx)(Ss.Z,{onClick:n,icon:"no-alt"})]}),(0,VI.jsxs)("div",{className:"components-panel__header interface-complementary-area-header edit-post-sidebar__panel-tabs",children:[t,(0,VI.jsx)(Ss.Z,{onClick:n,icon:"no-alt"})]})]})}function nN(e){let{onClose:t}=e;const n=(0,b.Z)((e=>e("mailpoet-form-editor").getDefaultSidebarActiveTab()),[]),r=(0,b.Z)((e=>e("core/block-editor").getSelectedBlockClientId()),[]),{switchDefaultSidebarTab:o}=(0,y.Z)("mailpoet-form-editor");return(0,u.useEffect)((()=>{o(r?"block":"form")}),[r,o]),(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(tN,{closeSidebar:t,children:(0,VI.jsxs)("ul",{children:[(0,VI.jsx)("li",{children:(0,VI.jsx)("button",{onClick:()=>{o("form")},className:g()("components-button edit-post-sidebar__panel-tab",{"is-active":"form"===n}),"data-automation-id":"mailpoet_form_settings_tab",type:"button",children:jI.x.I18n.t("form")})}),(0,VI.jsx)("li",{children:(0,VI.jsx)("button",{onClick:()=>{o("block")},className:g()("components-button edit-post-sidebar__panel-tab",{"is-active":"block"===n}),"data-automation-id":"mailpoet_block_settings_tab",type:"button",children:(0,w.__)("Block")})})]})}),"form"===n?(0,VI.jsx)(QT,{}):(0,VI.jsx)(eN,{})]})}var rN=n(30211);function oN(e){let{label:t,minPercents:n=0,maxPercents:r=100,minPixels:o=10,maxPixels:i=1e3,value:l,defaultPercentValue:a=50,defaultPixelValue:s=200,onChange:c}=e;const[d,p]=(0,u.useState)(l??{unit:"pixel",value:void 0});return(0,u.useEffect)((()=>{p(l)}),[l]),(0,VI.jsxs)("div",{className:"mailpoet-size-settings-control",children:[(0,VI.jsx)(rw.ZP.VisualLabel,{children:t}),(0,VI.jsx)(eT.Z,{selected:d.unit||"pixel",options:[{label:"px",value:"pixel"},{label:"%",value:"percent"}],onChange:e=>{const t={value:"pixel"===e?s:a,unit:e};p(t),c(t)}}),(0,VI.jsx)(_k.Z,{value:d.value??("pixel"===d.unit?s:a),min:"pixel"===d.unit?o:n,max:"pixel"===d.unit?i:r,onChange:e=>{const t={unit:"pixel"===d.unit?"pixel":"percent",value:e};p(t),c(t)}})]})}function iN(e){let{settingsPlacementKey:t}=e;const n=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),r=(0,b.Z)((e=>(0,rN.sortBy)("name",e("mailpoet-form-editor").getAllWPTags().concat(e("mailpoet-form-editor").getAllWooCommerceTags()))),[]),o=(0,b.Z)((e=>(0,rN.sortBy)("name",e("mailpoet-form-editor").getAllWPCategories().concat(e("mailpoet-form-editor").getAllWooCommerceCategories()))),[]),i=(0,b.Z)((e=>e("mailpoet-form-editor").getAllWPPages()),[]),l=(0,b.Z)((e=>(0,rN.sortBy)("name",e("mailpoet-form-editor").getAllWPPosts().concat(e("mailpoet-form-editor").getAllWooCommerceProducts()))),[]),a=(0,b.Z)((e=>e("mailpoet-form-editor").getIsPreviewShown()),[]),{changeFormSettings:s}=(0,y.Z)("mailpoet-form-editor");let c="no-preview";return a&&(c="preview"),(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("placeFormOnAllPages"),checked:n.formPlacement[t].pages.all,onChange:e=>{(0,rN.compose)([s,(0,rN.assocPath)(`formPlacement.${t}.pages.all`,e),(0,rN.cond)([[()=>e,(0,rN.compose)([(0,rN.assocPath)(`formPlacement.${t}.pages.selected`,[]),(0,rN.assocPath)(`formPlacement.${t}.categories`,[]),(0,rN.assocPath)(`formPlacement.${t}.tags`,[])])],[()=>!e,rN.identity]])])(n)}}),(0,VI.jsx)("div",{"data-automation-id":"form-placement-select-page",children:(0,VI.jsx)("div",{className:"form-editor-placement-selection",children:(0,VI.jsx)(lT,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].pages.selected.join()}`},onValueChange:e=>{const r=n.formPlacement[t].pages.selected;(0,rN.isEqual)(r,e.target.value)||(0,rN.compose)([s,(0,rN.assocPath)(`formPlacement.${t}.pages.selected`,e.target.value),(0,rN.cond)([[()=>!!e.target.value.length,(0,rN.assocPath)(`formPlacement.${t}.pages.all`,!1)],[()=>!e.target.value.length,rN.identity]])])(n)},field:{id:`${c}pages`,name:"pages",values:i,multiple:!0,placeholder:jI.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].pages.selected}})})}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("placeFormOnAllPosts"),checked:n.formPlacement[t].posts.all,onChange:e=>{(0,rN.compose)([s,(0,rN.assocPath)(`formPlacement.${t}.posts.all`,e),(0,rN.cond)([[()=>e,(0,rN.compose)([(0,rN.assocPath)(`formPlacement.${t}.posts.selected`,[]),(0,rN.assocPath)(`formPlacement.${t}.categories`,[]),(0,rN.assocPath)(`formPlacement.${t}.tags`,[])])],[()=>!e,rN.identity]])])(n)}}),(0,VI.jsx)("div",{className:"form-editor-placement-selection",children:(0,VI.jsx)(lT,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].posts.selected.join()}`},onValueChange:e=>{const r=n.formPlacement[t].posts.selected;(0,rN.isEqual)(r,e.target.value)||(0,rN.compose)([s,(0,rN.assocPath)(`formPlacement.${t}.posts.selected`,e.target.value),(0,rN.cond)([[()=>!!e.target.value.length,(0,rN.assocPath)(`formPlacement.${t}.posts.all`,!1)],[()=>!e.target.value.length,rN.identity]])])(n)},field:{id:`${c}posts`,name:"posts",values:l,multiple:!0,placeholder:jI.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].posts.selected}})}),(0,VI.jsxs)("div",{children:[(0,VI.jsx)("h3",{className:"form-editor-sidebar-heading",children:jI.x.I18n.t("displayOnCategories")}),(0,VI.jsx)("div",{className:"form-editor-placement-selection",children:(0,VI.jsx)(lT,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].categories.join()}`},onValueChange:e=>{const r=n.formPlacement[t].categories;(0,rN.isEqual)(r,e.target.value)||(0,rN.compose)([s,(0,rN.assocPath)(`formPlacement.${t}.categories`,e.target.value),(0,rN.cond)([[()=>!!e.target.value.length,(0,rN.compose)([(0,rN.assocPath)(`formPlacement.${t}.pages.all`,!1),(0,rN.assocPath)(`formPlacement.${t}.posts.all`,!1)])],[()=>!e.target.value.length,rN.identity]])])(n)},field:{id:`${c}categories`,name:"categories",values:o,multiple:!0,placeholder:jI.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].categories}})})]}),(0,VI.jsxs)("div",{children:[(0,VI.jsx)("h3",{className:"form-editor-sidebar-heading",children:jI.x.I18n.t("displayOnTags")}),(0,VI.jsx)("div",{className:"form-editor-placement-selection",children:(0,VI.jsx)(lT,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].tags.join()}`},onValueChange:e=>{const r=n.formPlacement[t].tags;(0,rN.isEqual)(r,e.target.value)||(0,rN.compose)([s,(0,rN.assocPath)(`formPlacement.${t}.tags`,e.target.value),(0,rN.cond)([[()=>!!e.target.value.length,(0,rN.compose)([(0,rN.assocPath)(`formPlacement.${t}.pages.all`,!1),(0,rN.assocPath)(`formPlacement.${t}.posts.all`,!1)])],[()=>!e.target.value.length,rN.identity]])])(n)},field:{id:`${c}tags`,name:"tags",values:r,multiple:!0,placeholder:jI.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].tags}})})]})]})}function lN(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{changeFormSettings:t}=(0,y.Z)("mailpoet-form-editor"),n=e.formPlacement.belowPosts.enabled;return(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("p",{children:jI.x.I18n.t("placeFormBellowPagesDescription")}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("enable"),checked:n,onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.belowPosts.enabled",rN.__,e)])}),n&&(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(oN,{label:jI.x.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,rN.assocPath)("formPlacement.belowPosts.styles.width",n,e))}}),(0,VI.jsx)(iN,{settingsPlacementKey:"belowPosts"})]})]})}function aN(e){let{settingsPlacementKey:t}=e;const n=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{changeFormSettings:r}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("animationHeader"),value:n.formPlacement[t].animation,options:[{label:jI.x.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,rN.compose)([r,(0,rN.assocPath)(`formPlacement.${t}.animation`,rN.__,n)])})}function sN(e){let{settingsPlacementKey:t}=e;const n=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{changeFormSettings:r}=(0,y.Z)("mailpoet-form-editor");return(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("formPlacementCookieExpiration"),value:n.formPlacement[t].cookieExpiration,options:[{value:"0",label:jI.x.I18n.t("formPlacementCookieExpirationAlways")},{value:"1",label:jI.x.I18n.t("formPlacementCookieExpirationDay")},...[3,7,14,30,60,90].map((e=>({value:`${e}`,label:jI.x.I18n.t("formPlacementCookieExpirationDays").replace("%1s",e.toString())})))],onChange:(0,rN.compose)([r,(0,rN.assocPath)(`formPlacement.${t}.cookieExpiration`,rN.__,n)])})}const cN=[0,2,5,10,15,30,45,60,120,180,240];function uN(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{changeFormSettings:t}=(0,y.Z)("mailpoet-form-editor"),n=e.formPlacement.popup.enabled;return(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("p",{children:jI.x.I18n.t("placePopupFormOnPagesDescription")}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("enable"),checked:n,onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.popup.enabled",rN.__,e)])}),n&&(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("hr",{}),(0,VI.jsx)(oN,{label:jI.x.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,rN.assocPath)("formPlacement.popup.styles.width",n,e))}}),(0,VI.jsx)(iN,{settingsPlacementKey:"popup"}),(0,VI.jsx)(aN,{settingsPlacementKey:"popup"}),(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.popup.delay}`,onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.popup.delay",rN.__,e)]),options:cN.map((e=>({value:`${e}`,label:jI.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,VI.jsx)(sN,{settingsPlacementKey:"popup"}),(0,VI.jsxs)("div",{children:[(0,VI.jsx)("p",{children:(0,VI.jsx)("b",{children:jI.x.I18n.t("exitIntentTitle")})}),(0,VI.jsx)("p",{children:jI.x.I18n.t("exitIntentDescription")}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("exitIntentSwitch"),checked:e.formPlacement.popup.exitIntentEnabled,onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.popup.exitIntentEnabled",rN.__,e)])})]})]})]})}var dN=n(34352),pN=n.n(dN);function mN(){const[e,t]=(0,u.useState)(null),n=(0,b.Z)((e=>e("mailpoet-form-editor").getFormExports()),[]),r=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),o=(0,b.Z)((e=>e("mailpoet-form-editor").isFormSaved()),[]),{changeFormSettings:i}=(0,y.Z)("mailpoet-form-editor"),l=pN()(jI.x.I18n.t("addFormWidgetHint"),/\[link](.*?)\[\/link]/g,(e=>(0,VI.jsx)("a",{href:"widgets.php",target:"_blank",children:e},"addFormWidgetHintLink"))),a=pN()(jI.x.I18n.t("addFormShortcodeHint"),/\[shortcode]/g,(e=>(0,VI.jsx)("code",{children:n.shortcode},e))),s=(0,H.curry)(((e,r)=>(r.preventDefault(),jI.x.trackEvent("Forms > Embed",{"Embed type":e}),t("php"===e?n.php:n.iframe)))),c=pN()(jI.x.I18n.t("addFormPhpIframeHint"),/\[link](.*?)\[\/link]/g,(e=>"PHP"===e?(0,VI.jsx)("a",{href:"#",onClick:s("php"),children:e},"exportPHP"):(0,VI.jsx)("a",{href:"#",onClick:s("iframe"),children:e},"exportIframe")));return o?(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("p",{children:l}),(0,VI.jsx)("p",{children:a}),(0,VI.jsx)("p",{children:c}),e?(0,VI.jsx)(tT.Z,{readOnly:!0,onClick:e=>e.target.select(),rows:8,value:e,onChange:()=>{}},"copyTextArea"):null,(0,VI.jsx)("hr",{}),(0,VI.jsx)(oN,{label:jI.x.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,rN.assocPath)("formPlacement.others.styles.width",e,r))}})]}):(0,VI.jsx)("p",{children:jI.x.I18n.t("saveFormFirst")})}const hN=[0,2,5,10,15,30,45,60,120,180,240];function fN(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{changeFormSettings:t}=(0,y.Z)("mailpoet-form-editor"),n=e.formPlacement.fixedBar.enabled;return(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("p",{children:jI.x.I18n.t("placeFixedBarFormOnPagesDescription")}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("enable"),checked:n,onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.fixedBar.enabled",rN.__,e)])}),n&&(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("hr",{}),(0,VI.jsx)(eT.Z,{label:jI.x.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.fixedBar.position,options:[{label:jI.x.I18n.t("formPlacementPlacementPositionTop"),value:"top"},{label:jI.x.I18n.t("formPlacementPlacementPositionBottom"),value:"bottom"}],onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.fixedBar.position",rN.__,e)])}),(0,VI.jsx)(oN,{label:jI.x.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,rN.assocPath)("formPlacement.fixedBar.styles.width",n,e))}}),(0,VI.jsx)(iN,{settingsPlacementKey:"fixedBar"}),(0,VI.jsx)(aN,{settingsPlacementKey:"fixedBar"}),(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.fixedBar.delay}`,onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.fixedBar.delay",rN.__,e)]),options:hN.map((e=>({value:`${e}`,label:jI.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,VI.jsx)(sN,{settingsPlacementKey:"fixedBar"})]})]})}const gN=[0,2,5,10,15,30,45,60,120,180,240];function vN(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),{changeFormSettings:t}=(0,y.Z)("mailpoet-form-editor"),n=e.formPlacement.slideIn.enabled;return(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("p",{children:jI.x.I18n.t("placeSlideInFormOnPagesDescription")}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("enable"),checked:n,onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.slideIn.enabled",rN.__,e)])}),n&&(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("hr",{}),(0,VI.jsx)(eT.Z,{label:jI.x.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.slideIn.position,options:[{label:jI.x.I18n.t("formPlacementPlacementPositionLeft"),value:"left"},{label:jI.x.I18n.t("formPlacementPlacementPositionRight"),value:"right"}],onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.slideIn.position",rN.__,e)])}),(0,VI.jsx)(oN,{label:jI.x.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,rN.assocPath)("formPlacement.slideIn.styles.width",n,e))}}),(0,VI.jsx)(iN,{settingsPlacementKey:"slideIn"}),(0,VI.jsx)(aN,{settingsPlacementKey:"slideIn"}),(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.slideIn.delay}`,onChange:(0,rN.compose)([t,(0,rN.assocPath)("formPlacement.slideIn.delay",rN.__,e)]),options:gN.map((e=>({value:`${e}`,label:jI.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,VI.jsx)(sN,{settingsPlacementKey:"slideIn"})]})]})}function bN(e){let{activePanel:t}=e;return(0,VI.jsxs)("div",{className:"mailpoet-styles-settings",children:["others"===t&&(0,VI.jsx)(mN,{}),"below_posts"===t&&(0,VI.jsx)(lN,{}),"fixed_bar"===t&&(0,VI.jsx)(fN,{}),"popup"===t&&(0,VI.jsx)(uN,{}),"slide_in"===t&&(0,VI.jsx)(vN,{})]})}function yN(e){let{onClose:t}=e;const n=(0,b.Z)((e=>e("mailpoet-form-editor").getPreviewSettings()),[]);return(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(tN,{closeSidebar:t,children:(0,VI.jsxs)("h3",{className:"mailpoet-sidebar-header-heading",children:["others"===n.formType&&jI.x.I18n.t("placeFormOthers"),"below_posts"===n.formType&&jI.x.I18n.t("placeFormBellowPages"),"fixed_bar"===n.formType&&jI.x.I18n.t("placeFixedBarFormOnPages"),"popup"===n.formType&&jI.x.I18n.t("placePopupFormOnPages"),"slide_in"===n.formType&&jI.x.I18n.t("placeSlideInFormOnPages")]})}),(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{children:(0,VI.jsx)(bN,{activePanel:n.formType})})})]})}function _N(){const{toggleSidebar:e,changeActiveSidebar:t}=(0,y.Z)("mailpoet-form-editor"),n=(0,b.Z)((e=>e("mailpoet-form-editor").getActiveSidebar()),[]),r=(0,b.Z)((e=>e("core/block-editor").getSelectedBlockClientId()),[]);return(0,u.useEffect)((()=>{r&&t("default")}),[r,t]),(0,VI.jsxs)("div",{className:"edit-post-sidebar interface-complementary-area mailpoet_form_editor_sidebar",children:["default"===n&&(0,VI.jsx)(nN,{onClose:()=>{e(!1)}}),"placement_settings"===n&&(0,VI.jsx)(yN,{onClose:()=>{t("default")}})]})}function kN(e){let{setIsInserterOpened:t}=e;const n=(0,b.Z)((e=>e("mailpoet-form-editor").getInserterPanelInsertPoint()),[]);return(0,VI.jsxs)("div",{className:"edit-post-editor__inserter-panel",children:[(0,VI.jsx)("div",{className:"edit-post-editor__inserter-panel-header",children:(0,VI.jsx)(Ss.Z,{icon:qS.Z,onClick:()=>t(!1)})}),(0,VI.jsx)("div",{className:"edit-post-editor__inserter-panel-content",children:(0,VI.jsx)(BI,{showMostUsedBlocks:!0,showInserterHelpPanel:!1,rootClientId:n.rootClientId??void 0,__experimentalInsertionIndex:n.insertionIndex??void 0})})]})}var wN=n(81535);function xN(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getDismissibleNotices()),[]),t=(0,b.Z)((e=>e("mailpoet-form-editor").getNonDismissibleNotices()),[]),{removeNotice:n}=(0,y.Z)("mailpoet-form-editor"),r=(0,H.memoize)((e=>{setTimeout((()=>n(e)),5e3)}));return e.forEach((e=>r(e.id))),(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(wN.Z,{notices:t,className:"components-editor-notices__pinned"}),(0,VI.jsx)(wN.Z,{notices:e,className:"components-editor-notices__dismissible automation-dismissible-notices",onRemove:n})]})}var CN=n(35572);const EN=()=>{const e=document.getElementById("mailpoet-form-editor-form-styles"),t=(0,b.Z)((e=>e("mailpoet-form-editor").getFormStyles()),[]);try{CN.parse(t)}catch(t){return d.createPortal(null,e)}const n=vv([{css:t}],".editor-styles-wrapper");return d.createPortal(n[0],e)};function SN(){return(0,VI.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,VI.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,VI.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-760.000000, -64.000000)",fillRule:"nonzero",children:(0,VI.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,VI.jsx)("g",{transform:"translate(48.000000, 0.000000)",children:(0,VI.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 IN(){return(0,VI.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,VI.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,VI.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-712.000000, -64.000000)",fillRule:"nonzero",children:(0,VI.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,VI.jsx)("g",{children:(0,VI.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 TN(e){let{children:t,onDisplayTypeChange:n,selectedDisplayType:r}=e;const[o,i]=(0,u.useState)(r),l=e=>{i(e),n(e)};return(0,VI.jsxs)("div",{className:"mailpoet_browser_preview",children:[(0,VI.jsxs)("div",{className:"mailpoet_browser_preview_toggle",children:[(0,VI.jsx)("a",{className:g()("mailpoet_browser_preview_icon",{mailpoet_active:"desktop"===o}),onClick:e=>{e.preventDefault(),l("desktop")},title:jI.x.I18n.t("formPreviewDesktop"),href:"#","data-automation-id":"preview_type_desktop",children:(0,VI.jsx)(IN,{})}),(0,VI.jsx)("a",{className:g()("mailpoet_browser_preview_icon",{mailpoet_active:"mobile"===o}),onClick:e=>{e.preventDefault(),l("mobile")},title:jI.x.I18n.t("formPreviewMobile"),href:"#","data-automation-id":"preview_type_mobile",children:(0,VI.jsx)(SN,{})})]}),(0,VI.jsx)("div",{className:g()("mailpoet_browser_preview_container",{mailpoet_browser_preview_container_mobile:"desktop"!==o},{mailpoet_browser_preview_container_desktop:"desktop"===o}),children:(0,VI.jsx)("div",{className:"mailpoet_browser_preview_border",children:t})}),"desktop"!==o&&(0,VI.jsx)("p",{className:"mailpoet_form_preview_disclaimer",children:jI.x.I18n.t("formPreviewMobileDisclaimer")})]})}function NN(){const e=(0,u.useRef)(null),[t,n]=(0,u.useState)(!1),{hidePreview:r,changePreviewSettings:o}=(0,y.Z)("mailpoet-form-editor"),i=(0,b.Z)((e=>e("mailpoet-form-editor").getIsPreviewShown()),[]),l=(0,b.Z)((e=>e("mailpoet-form-editor").getIsPreviewReady()),[]),a=(0,b.Z)((e=>e("mailpoet-form-editor").getPreviewSettings()),[]),s=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),c=(0,b.Z)((e=>e("mailpoet-form-editor").getFormData().id),[]),d=(0,b.Z)((e=>e("mailpoet-form-editor").getEditorUrl()),[]),p=(0,b.Z)((e=>e("mailpoet-form-editor").getPreviewPageUrl()),[]);(0,u.useEffect)((()=>{n(!1);const e=document.getElementById("beacon-container");i&&e&&(e.style.display="none")}),[i]),(0,u.useEffect)((()=>{if(!e.current||!t)return;const n={formType:a.formType,formSettings:s};e.current.contentWindow.postMessage(n,p)}),[s,e,a,t,p]);const m=(0,u.useCallback)((()=>{const e=document.getElementById("beacon-container");e&&(e.style.display="block"),r()}),[r]),h=(0,u.useCallback)((e=>{n(!1),o({...a,formType:e})}),[o,a]),f=(0,u.useCallback)((e=>{o({...a,displayType:e})}),[o,a]);if(!i)return null;const g={id:c,form_type:a.formType,editor_url:d};let v=`${p}&data=${btoa(JSON.stringify(g))}`;return["below_posts"].includes(a.formType)&&(v+=`#mailpoet_form_preview_${c}`),(0,VI.jsxs)(YI.u,{onRequestClose:m,fullScreen:!0,contentClassName:"mailpoet_form_preview_modal",overlayClassName:"mailpoet_form_preview_modal_overlay",children:[!l&&(0,VI.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,VI.jsx)(ZC.ZP,{})}),l&&(0,VI.jsxs)("div",{className:"mailpoet_preview_content_wrapper",children:[(0,VI.jsxs)("div",{className:"mailpoet_preview_sidebar",children:[(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("formPlacementLabel"),value:a.formType,onChange:h,className:"mailpoet_preview_form_type_selection","data-automation-id":"form_type_selection",options:[{value:"others",label:jI.x.I18n.t("placeFormOthers")},{value:"below_posts",label:jI.x.I18n.t("placeFormBellowPages")},{value:"fixed_bar",label:jI.x.I18n.t("placeFixedBarFormOnPages")},{value:"popup",label:jI.x.I18n.t("placePopupFormOnPages")},{value:"slide_in",label:jI.x.I18n.t("placeSlideInFormOnPages")}]}),(0,VI.jsx)(bN,{activePanel:a.formType})]}),(0,VI.jsxs)(TN,{onDisplayTypeChange:f,selectedDisplayType:a.displayType,children:[!t&&(0,VI.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,VI.jsx)(ZC.ZP,{})}),(0,VI.jsx)("iframe",{ref:e,className:"mailpoet_form_preview_iframe",src:v,title:jI.x.I18n.t("formPreview"),onLoad:()=>n(!0),"data-automation-id":"form_preview_iframe",scrolling:"others"===a.formType?"no":"yes"}),"others"===a.formType&&"desktop"===a.displayType&&(0,VI.jsx)("div",{className:"mailpoet_form_preview_disclaimer",children:jI.x.I18n.t("formPreviewOthersDisclaimer")})]})]})]})}function BN(e){let{children:t}=e;const{fontColor:n,backgroundColor:r,gradient:o,fontSize:i,borderRadius:l,borderSize:a,borderColor:s,alignment:c,formPadding:u,backgroundImageUrl:d,backgroundImageDisplay:p,fontFamily:m}=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),h=(0,b.Z)((e=>e("mailpoet-form-editor").getPreviewSettings()),[]),f=(0,b.Z)((e=>e("mailpoet-form-editor").getFormWidth(h.formType)),[h.formType]);let g;a&&s&&(g="solid");let v,y,_,k="";i&&(k=Number(i)),l&&(v=Number(l)),u&&(y=Number(u)),c&&(_=c);const w=[],x={color:n,fontSize:k,fontFamily:m,lineHeight:1.2,borderRadius:v,borderWidth:a,borderColor:s,borderStyle:g,textAlign:_,padding:y,width:"pixel"===f.unit?f.value:`${f.value}%`,margin:"0 auto",maxWidth:"100%"};if(["others","below_posts"].includes(h.formType)&&"percent"===f.unit&&(x.maxWidth=600),void 0!==d&&d){let e="center",t="no-repeat",n="cover";"fit"===p&&(n="auto",e="center top"),"tile"===p&&(t="repeat",n="auto"),w.push(`url(${d}) ${e}/${n} ${t}`)}if(o&&w.push(o),r&&w.push(r),w.length&&(x.background=w.join(", ")),"fixed_bar"===h.formType){const e={width:x.width,margin:"0 auto"};return x.width="max-content",x.minWidth="100%",x.maxWidth="auto",(0,VI.jsx)("div",{className:"mailpoet-form-background",style:x,children:(0,VI.jsx)("div",{style:e,children:t})})}return(0,VI.jsx)("div",{className:"mailpoet-form-background",style:x,children:t})}function AN(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").isFullscreenEnabled()),[]);return(0,u.useEffect)((()=>{e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")}),[e]),null}function LN(){const e=(0,b.Z)((e=>e("mailpoet-form-editor").getSidebarOpened()),[]),t=(0,b.Z)((e=>e("mailpoet-form-editor").isInserterOpened()),[]),n=(0,b.Z)((e=>e("mailpoet-form-editor").getFormBlocks()),[]),r=(0,b.Z)((e=>e("core").canUser("create","media")),[]),o=(0,b.Z)((e=>e("core/block-editor").getSelectedBlock()),[]),i=g()("edit-post-layout interface-interface-skeleton",o?o.name.replace("/","-"):null,{"is-sidebar-opened":e}),{blocksChangedInBlockEditor:l,toggleInserter:a}=(0,y.Z)("mailpoet-form-editor"),s={mediaUpload:r?F:null,supportsLayout:!1,maxWidth:580,enableCustomSpacing:!0,enableCustomLineHeight:!0,disableCustomFontSizes:!1,enableCustomUnits:!0,__experimentalFetchLinkSuggestions:ZI,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSetIsInserterOpened:a,__experimentalFeatures:{color:{custom:!0,text:!0,background:!0,customGradient:!0,defaultPalette:!0,palette:{default:Eo.colors},gradients:{default:Eo.gradients}}}};return(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(PT,{}),(0,VI.jsx)(Fg.vn,{children:(0,VI.jsx)(_.zt,{children:(0,VI.jsxs)("div",{className:i,children:[(0,VI.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,VI.jsx)("div",{className:"interface-interface-skeleton__header",children:(0,VI.jsx)(KI,{isInserterOpened:t,setIsInserterOpened:a})}),(0,VI.jsx)("div",{className:"interface-interface-skeleton__body",children:(0,VI.jsxs)(kg,{value:n,onInput:l,onChange:l,settings:s,useSubRegistry:!1,children:[t&&(0,VI.jsx)("div",{className:"interface-interface-skeleton__secondary-sidebar",children:(0,VI.jsx)(kN,{setIsInserterOpened:a})}),(0,VI.jsxs)("div",{className:"interface-interface-skeleton__content",children:[(0,VI.jsx)(xN,{}),(0,VI.jsx)(FI.D,{storeName:"mailpoet-form-editor"}),(0,VI.jsx)(Sg,{className:"edit-post-visual-editor editor-styles-wrapper",children:(0,VI.jsxs)(TI,{children:[(0,VI.jsx)(LI,{}),(0,VI.jsx)(LI.Register,{}),(0,VI.jsx)("div",{className:"mailpoet_form",children:(0,VI.jsx)(Gg,{children:(0,VI.jsx)(RI,{children:(0,VI.jsx)(BN,{children:(0,VI.jsx)(fk,{})})})})})]})})]}),e&&(0,VI.jsx)("div",{className:"interface-interface-skeleton__sidebar",children:(0,VI.jsx)(_N,{})})]})}),(0,VI.jsx)(EN,{}),(0,VI.jsx)(AN,{})]}),(0,VI.jsx)(k.Z.Slot,{})]})})}),(0,VI.jsx)(NN,{}),(0,VI.jsx)(XI,{})]})}TN.propTypes={children:HI().node.isRequired,onDisplayTypeChange:HI().func,selectedDisplayType:HI().string},TN.defaultProps={onDisplayTypeChange:()=>{},selectedDisplayType:"desktop"},BN.propTypes={children:HI().node.isRequired};const PN=e=>{const t={full_width:e.fullWidth?"1":"0"};return e.inheritFromTheme||(t.bold=e.bold?"1":"0",(0,H.has)(e,"backgroundColor")&&e.backgroundColor&&(t.background_color=e.backgroundColor),(0,H.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,H.has)(e,"fontSize")&&void 0!==e.fontSize&&(t.font_size=e.fontSize),(0,H.has)(e,"fontColor")&&e.fontColor&&(t.font_color=e.fontColor),(0,H.has)(e,"borderSize")&&void 0!==e.borderSize&&(t.border_size=e.borderSize),(0,H.has)(e,"borderRadius")&&void 0!==e.borderRadius&&(t.border_radius=e.borderRadius),(0,H.has)(e,"borderColor")&&e.borderColor&&(t.border_color=e.borderColor),(0,H.has)(e,"padding")&&void 0!==e.padding&&(t.padding=e.padding),(0,H.has)(e,"fontFamily")&&e.fontFamily&&(t.font_family=e.fontFamily)),t},DN=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.color:n},RN=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.gradient:n},MN=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.size:n},ON=(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=>{var l,a,s,c,u,d,p,m,h,f,g,v,b,y,_,k,w,x,C,E,S,I,T,N,B,A,L,P,D,R,M,O;const F={type:"text",params:{label:i.attributes.label,class_name:i.attributes.className||null}};switch(i.attributes.mandatory&&(F.params.required="1"),i.attributes.labelWithinInput&&(F.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:MN(e,i.attributes.fontSize,null===(l=i.attributes.style)||void 0===l||null===(a=l.typography)||void 0===a?void 0:a.fontSize),text_color:DN(t,i.attributes.textColor,null===(s=i.attributes.style)||void 0===s||null===(c=s.color)||void 0===c?void 0:c.text),line_height:null===(u=i.attributes.style)||void 0===u||null===(d=u.typography)||void 0===d?void 0:d.lineHeight,background_color:DN(t,i.attributes.backgroundColor,null===(p=i.attributes.style)||void 0===p||null===(m=p.color)||void 0===m?void 0:m.background),anchor:i.attributes.anchor||null,class_name:i.attributes.className||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:MN(e,i.attributes.fontSize,null===(h=i.attributes.style)||void 0===h||null===(f=h.typography)||void 0===f?void 0:f.fontSize),line_height:null===(g=i.attributes.style)||void 0===g||null===(v=g.typography)||void 0===v?void 0:v.lineHeight,text_color:DN(t,i.attributes.textColor,null===(b=i.attributes.style)||void 0===b||null===(y=b.color)||void 0===y?void 0:y.text),background_color:DN(t,i.attributes.backgroundColor,null===(_=i.attributes.style)||void 0===_||null===(k=_.color)||void 0===k?void 0:k.background),class_name:i.attributes.className||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:(null===(w=i.attributes.style)||void 0===w||null===(x=w.spacing)||void 0===x?void 0:x.padding)||null,text_color:DN(t,i.attributes.textColor,null===(C=i.attributes.style)||void 0===C||null===(E=C.color)||void 0===E?void 0:E.text),background_color:DN(t,i.attributes.backgroundColor,null===(S=i.attributes.style)||void 0===S||null===(I=S.color)||void 0===I?void 0:I.background),gradient:RN(n,i.attributes.gradient,null===(T=i.attributes.style)||void 0===T||null===(N=T.color)||void 0===N?void 0:N.gradient)}};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:(null===(B=i.attributes.style)||void 0===B||null===(A=B.spacing)||void 0===A?void 0:A.padding)||null,text_color:DN(t,i.attributes.textColor,null===(L=i.attributes.style)||void 0===L||null===(P=L.color)||void 0===P?void 0:P.text),background_color:DN(t,i.attributes.backgroundColor,null===(D=i.attributes.style)||void 0===D||null===(R=D.color)||void 0===R?void 0:R.background),gradient:RN(n,i.attributes.gradient,null===(M=i.attributes.style)||void 0===M||null===(O=M.color)||void 0===O?void 0:O.gradient)}};case"mailpoet-form/email-input":return{...F,id:"email",name:"Email",params:{...F.params,required:"1"},styles:PN(i.attributes.styles)};case"mailpoet-form/first-name-input":return{...F,id:"first_name",name:"First name",styles:PN(i.attributes.styles)};case"mailpoet-form/last-name-input":return{...F,id:"last_name",name:"Last name",styles:PN(i.attributes.styles)};case"mailpoet-form/segment-select":return{...F,id:"segments",type:"segment",name:"List selection",params:{...F.params,values:i.attributes.values.map((e=>({id:e.id,is_checked:e.isChecked?"1":void 0})))}};case"mailpoet-form/submit-button":return{...F,id:"submit",type:"submit",name:"Submit",styles:PN(i.attributes.styles)};case"mailpoet-form/divider":return{...F,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{...F,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=PN(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-textarea")&&(o.type="textarea",o.styles=PN(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,H.has)(e.attributes,"validate")&&(o.params.validate=e.attributes.validate),(0,H.has)(e.attributes,"hideLabel")&&e.attributes.hideLabel&&(o.params.hide_label="1"),(0,H.has)(e.attributes,"defaultToday")&&e.attributes.defaultToday&&(o.params.is_default_today="1"),(0,H.has)(e.attributes,"dateType")&&(o.params.date_type=e.attributes.dateType),(0,H.has)(e.attributes,"lines")&&(o.params.lines=e.attributes.lines),(0,H.has)(e.attributes,"dateFormat")&&(o.params.date_format=e.attributes.dateFormat),(0,H.has)(e.attributes,"values")&&(o.params.values=e.attributes.values.map((e=>{const t={value:e.name};return(0,H.has)(e,"isChecked")&&e.isChecked&&(t.is_checked="1"),t}))),o})(i,r,F):null}})).filter(Boolean)};return o};function FN(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,h,f,g,v,b,y,_,k,w,x,C,E,S,I,T,N,B,A,L,P,D,R,M,O,F,j,Z,z,H,V,W,U,$,G,q,K,Y,J,X,Q,ee,te,ne,re,oe,ie,le,ae,se,ce,ue,de,pe,me,he,fe,ge,ve,be,ye,_e,ke,we,xe,Ce,Ee,Se,Ie,Te,Ne,Be,Ae,Le,Pe,De,Re,Me,Oe,Fe,je,Ze,ze,He,Ve,We,Ue,$e,Ge,qe,Ke,Ye,Je,Xe;const Qe={...e,settings:{...e.settings,form_placement:{popup:{enabled:!0===(null===(t=e.settings.formPlacement)||void 0===t||null===(n=t.popup)||void 0===n?void 0:n.enabled)?"1":"",exit_intent_enabled:null!==(r=e.settings.formPlacement)&&void 0!==r&&null!==(o=r.popup)&&void 0!==o&&o.exitIntentEnabled?"1":"",delay:null===(i=e.settings.formPlacement)||void 0===i||null===(l=i.popup)||void 0===l?void 0:l.delay,cookieExpiration:null===(a=e.settings.formPlacement)||void 0===a||null===(s=a.popup)||void 0===s?void 0:s.cookieExpiration,styles:null===(c=e.settings.formPlacement)||void 0===c||null===(u=c.popup)||void 0===u?void 0:u.styles,animation:null===(d=e.settings.formPlacement)||void 0===d||null===(p=d.popup)||void 0===p?void 0:p.animation,categories:(null===(m=e.settings.formPlacement)||void 0===m||null===(h=m.popup)||void 0===h?void 0:h.categories)??[],tags:(null===(f=e.settings.formPlacement)||void 0===f||null===(g=f.popup)||void 0===g?void 0:g.tags)??[],posts:{all:!0===(null===(v=e.settings.formPlacement)||void 0===v||null===(b=v.popup)||void 0===b||null===(y=b.posts)||void 0===y?void 0:y.all)?"1":"",selected:null===(_=e.settings.formPlacement)||void 0===_||null===(k=_.popup)||void 0===k||null===(w=k.posts)||void 0===w?void 0:w.selected},pages:{all:!0===(null===(x=e.settings.formPlacement)||void 0===x||null===(C=x.popup)||void 0===C||null===(E=C.pages)||void 0===E?void 0:E.all)?"1":"",selected:null===(S=e.settings.formPlacement)||void 0===S||null===(I=S.popup)||void 0===I||null===(T=I.pages)||void 0===T?void 0:T.selected}},fixed_bar:{enabled:!0===(null===(N=e.settings.formPlacement)||void 0===N||null===(B=N.fixedBar)||void 0===B?void 0:B.enabled)?"1":"",delay:null===(A=e.settings.formPlacement)||void 0===A||null===(L=A.fixedBar)||void 0===L?void 0:L.delay,cookieExpiration:null===(P=e.settings.formPlacement)||void 0===P||null===(D=P.fixedBar)||void 0===D?void 0:D.cookieExpiration,styles:null===(R=e.settings.formPlacement)||void 0===R||null===(M=R.fixedBar)||void 0===M?void 0:M.styles,position:null===(O=e.settings.formPlacement)||void 0===O||null===(F=O.fixedBar)||void 0===F?void 0:F.position,animation:null===(j=e.settings.formPlacement)||void 0===j||null===(Z=j.fixedBar)||void 0===Z?void 0:Z.animation,categories:(null===(z=e.settings.formPlacement)||void 0===z||null===(H=z.fixedBar)||void 0===H?void 0:H.categories)??[],tags:(null===(V=e.settings.formPlacement)||void 0===V||null===(W=V.fixedBar)||void 0===W?void 0:W.tags)??[],posts:{all:!0===(null===(U=e.settings.formPlacement)||void 0===U||null===($=U.fixedBar)||void 0===$||null===(G=$.posts)||void 0===G?void 0:G.all)?"1":"",selected:null===(q=e.settings.formPlacement)||void 0===q||null===(K=q.fixedBar)||void 0===K||null===(Y=K.posts)||void 0===Y?void 0:Y.selected},pages:{all:!0===(null===(J=e.settings.formPlacement)||void 0===J||null===(X=J.fixedBar)||void 0===X||null===(Q=X.pages)||void 0===Q?void 0:Q.all)?"1":"",selected:null===(ee=e.settings.formPlacement)||void 0===ee||null===(te=ee.fixedBar)||void 0===te||null===(ne=te.pages)||void 0===ne?void 0:ne.selected}},below_posts:{enabled:!0===(null===(re=e.settings.formPlacement)||void 0===re||null===(oe=re.belowPosts)||void 0===oe?void 0:oe.enabled)?"1":"",styles:null===(ie=e.settings.formPlacement)||void 0===ie||null===(le=ie.belowPosts)||void 0===le?void 0:le.styles,categories:(null===(ae=e.settings.formPlacement)||void 0===ae||null===(se=ae.belowPosts)||void 0===se?void 0:se.categories)??[],tags:(null===(ce=e.settings.formPlacement)||void 0===ce||null===(ue=ce.belowPosts)||void 0===ue?void 0:ue.tags)??[],posts:{all:!0===(null===(de=e.settings.formPlacement)||void 0===de||null===(pe=de.belowPosts)||void 0===pe||null===(me=pe.posts)||void 0===me?void 0:me.all)?"1":"",selected:null===(he=e.settings.formPlacement)||void 0===he||null===(fe=he.belowPosts)||void 0===fe||null===(ge=fe.posts)||void 0===ge?void 0:ge.selected},pages:{all:!0===(null===(ve=e.settings.formPlacement)||void 0===ve||null===(be=ve.belowPosts)||void 0===be||null===(ye=be.pages)||void 0===ye?void 0:ye.all)?"1":"",selected:null===(_e=e.settings.formPlacement)||void 0===_e||null===(ke=_e.belowPosts)||void 0===ke||null===(we=ke.pages)||void 0===we?void 0:we.selected}},slide_in:{enabled:!0===(null===(xe=e.settings.formPlacement)||void 0===xe||null===(Ce=xe.slideIn)||void 0===Ce?void 0:Ce.enabled)?"1":"",delay:null===(Ee=e.settings.formPlacement)||void 0===Ee||null===(Se=Ee.slideIn)||void 0===Se?void 0:Se.delay,cookieExpiration:null===(Ie=e.settings.formPlacement)||void 0===Ie||null===(Te=Ie.slideIn)||void 0===Te?void 0:Te.cookieExpiration,position:null===(Ne=e.settings.formPlacement)||void 0===Ne||null===(Be=Ne.slideIn)||void 0===Be?void 0:Be.position,animation:null===(Ae=e.settings.formPlacement)||void 0===Ae||null===(Le=Ae.slideIn)||void 0===Le?void 0:Le.animation,styles:null===(Pe=e.settings.formPlacement)||void 0===Pe||null===(De=Pe.slideIn)||void 0===De?void 0:De.styles,categories:(null===(Re=e.settings.formPlacement)||void 0===Re||null===(Me=Re.slideIn)||void 0===Me?void 0:Me.categories)??[],tags:(null===(Oe=e.settings.formPlacement)||void 0===Oe||null===(Fe=Oe.slideIn)||void 0===Fe?void 0:Fe.tags)??[],posts:{all:!0===(null===(je=e.settings.formPlacement)||void 0===je||null===(Ze=je.slideIn)||void 0===Ze||null===(ze=Ze.posts)||void 0===ze?void 0:ze.all)?"1":"",selected:null===(He=e.settings.formPlacement)||void 0===He||null===(Ve=He.slideIn)||void 0===Ve||null===(We=Ve.posts)||void 0===We?void 0:We.selected},pages:{all:!0===(null===(Ue=e.settings.formPlacement)||void 0===Ue||null===($e=Ue.slideIn)||void 0===$e||null===(Ge=$e.pages)||void 0===Ge?void 0:Ge.all)?"1":"",selected:null===(qe=e.settings.formPlacement)||void 0===qe||null===(Ke=qe.slideIn)||void 0===Ke||null===(Ye=Ke.pages)||void 0===Ye?void 0:Ye.selected}},others:{styles:null===(Je=e.settings.formPlacement)||void 0===Je||null===(Xe=Je.others)||void 0===Xe?void 0:Xe.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""===Qe.settings.font_family&&delete Qe.settings.font_family,delete Qe.settings.formPlacement,delete Qe.settings.successValidationColor,delete Qe.settings.errorValidationColor,delete Qe.settings.borderRadius,delete Qe.settings.borderSize,delete Qe.settings.formPadding,delete Qe.settings.inputPadding,delete Qe.settings.borderColor,delete Qe.settings.backgroundImageUrl,delete Qe.settings.backgroundImageDisplay,delete Qe.settings.fontFamily,delete Qe.settings.closeButton,Qe}function jN(e){return{type:"TOGGLE_SIDEBAR",toggleTo:e}}function ZN(e){return{type:"TOGGLE_INSERTER_SIDEBAR",value:e}}function zN(e){return e?{type:"ENABLE_FORM"}:{type:"DISABLE_FORM"}}function*HN(e){yield{type:"STORE_LOCALLY",key:"mailpoet_form_view_options",value:e},yield{type:"TOGGLE_FULLSCREEN",toggleTo:e}}function VN(e){return{type:"CHANGE_FORM_BLOCKS",blocks:e}}function WN(e){return{type:"CHANGE_FORM_NAME",name:e}}function UN(){return{type:"DELETE_CUSTOM_FIELD_STARTED"}}function $N(e,t){return{type:"DELETE_CUSTOM_FIELD_DONE",customFieldId:e,clientId:t}}function GN(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{type:"DELETE_CUSTOM_FIELD_FAILED",message:e}}function qN(e){return{type:"CHANGE_FORM_STYLES",styles:e}}function KN(){return{type:"CUSTOM_FIELD_EDITED"}}function YN(e,t){return{type:"SAVE_CUSTOM_FIELD_DONE",customFieldId:e,response:t}}function JN(){return{type:"SAVE_CUSTOM_FIELD_STARTED"}}function XN(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{type:"SAVE_CUSTOM_FIELD_FAILED",message:e}}function QN(e){return{type:"CREATE_CUSTOM_FIELD_DONE",response:e}}function eB(e){return{type:"CREATE_CUSTOM_FIELD_STARTED",customField:e}}function tB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{type:"CREATE_CUSTOM_FIELD_FAILED",message:e}}function nB(e){return{type:"CHANGE_FORM_SETTINGS",settings:e}}function*rB(e){yield{type:"SAVE_FORM_DONE",formId:e},yield{type:"ENSURE_BROWSER_URL",formId:e}}function oB(){return{type:"SAVE_FORM_STARTED"}}function iB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{type:"SAVE_FORM_FAILED",message:e}}function lB(e){return"placement_settings"===e&&(0,z.dispatch)("core/block-editor").clearSelectedBlock(),{type:"CHANGE_ACTIVE_SIDEBAR",sidebar:e}}function*aB(e){const t=(0,z.select)("mailpoet-form-editor").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*sB(e){const t={...(0,z.select)("mailpoet-form-editor").getPreviewSettings(),formType:e};return yield*aB(t),lB("placement_settings")}function*cB(){yield{type:"SHOW_PREVIEW"},yield lB("default");const e=(0,z.select)("mailpoet-form-editor").getAllAvailableCustomFields(),t=(0,z.select)("mailpoet-form-editor").getFormData(),n=(0,z.select)("mailpoet-form-editor").getFormBlocks(),r=ON(Eo.fontSizes,Eo.colors,Eo.gradients,e),{success:o,error:i}=yield{type:"CALL_API",endpoint:"forms",action:"previewEditor",data:{...FN(t),body:r(n)}};return o?{type:"PREVIEW_DATA_SAVED"}:{type:"PREVIEW_DATA_NOT_SAVED",error:i}}function uB(){return{type:"HIDE_PREVIEW"}}function dB(e){return{type:"REMOVE_NOTICE",id:e}}function pB(e){return{type:"SWITCH_DEFAULT_SIDEBAR_TAB",id:e}}function mB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:"TOGGLE_SIDEBAR_PANEL",id:e,toggleTo:t}}function*hB(){yield{type:"SAVE_FORM"}}function*fB(e){yield{type:"SAVE_CUSTOM_FIELD",...e}}function*gB(e,t){yield{type:"CREATE_CUSTOM_FIELD",clientId:t,data:e}}function*vB(e,t){yield{type:"DELETE_CUSTOM_FIELD",customFieldId:e,clientId:t}}function*bB(e){yield{type:"BLOCKS_CHANGED_IN_BLOCK_EDITOR",blocks:e}}function*yB(e){yield{type:"APPLY_STYLES_TO_ALL_TEXT_INPUTS",styles:e}}function _B(){return{type:"HISTORY_UNDO"}}function kB(){return{type:"HISTORY_REDO"}}function*wB(){yield{type:"TUTORIAL_DISMISS"},yield{type:"TUTORIAL_DISMISSED"}}const xB=(e,t)=>e.reduce(((e,n)=>e||(n.name===t?n:Array.isArray(n.innerBlocks)&&n.innerBlocks.length?xB(n.innerBlocks,t):null)),null),CB=(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=xB(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=xB(t,"mailpoet-form/email-input"),i=xB(t,"mailpoet-form/submit-button");return o||r.push("missing-email-input"),i||r.push("missing-submit"),r},EB=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,H.isEqual)(n.data,o.data)&&(0,H.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}},SB=(e,t)=>{let n=e.editorHistoryOffset;0===n&&EB(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}},IB=(TB=jI.x,(e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id)),r=(0,H.trim)(t.customField.name),o=e.customFields.find((e=>e.name===r));return o&&n.push({id:"custom-field",content:TB.I18n.t("customFieldWithNameExists").replace("[name]",r),isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!o,notices:n}});var TB;const NB=(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"),l=t.formErrors.includes("missing-submit");return(i||l)&&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}})(jI.x),BB=(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:jI.x.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 IB(e,t);case"CHANGE_FORM_BLOCKS":return((e,t)=>{const n={...e,formBlocks:t.blocks};return{...n,hasUnsavedChanges:!0,formErrors:CB(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:CB(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,t)=>{let{settings:n}=t;return{...e,previewSettings:n}})(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:`${jI.x.I18n.t("formSaved")} ${jI.x.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 NB(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:jI.x.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,H.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=>SB(e,1))(e);case"HISTORY_REDO":return(e=>SB(e,-1))(e);case"TUTORIAL_DISMISSED":return(e=>({...e,tutorialSeen:!0}))(e);default:return e}},AB=(e,t)=>"CHANGE_FORM_BLOCKS"===t.type||"CHANGE_FORM_NAME"===t.type||"CHANGE_FORM_SETTINGS"===t.type||"CHANGE_FORM_STYLES"===t.type?EB(e):e,LB=e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=AB(t,n);return BB(r,n)},PB=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.reduce(((e,r)=>e.length?e:Array.isArray(r.innerBlocks)&&r.innerBlocks.length?(n.push(r),r.innerBlocks.find((e=>e.clientId===t))?n:PB(r.innerBlocks,t,n)):[]),[])},DB={isFormSaved:e=>"number"==typeof e.formData.id,isFormEnabled:e=>"enabled"===e.formData.status,isFullscreenEnabled:e=>e.fullscreenStatus,isInserterOpened:e=>!!e.inserterPanel,getInserterPanelInsertPoint:e=>e.inserterPanel,getSidebarOpened:e=>e.sidebarOpened,getFormName:e=>e.formData.name,getFormData:e=>e.formData,getFormStyles:e=>e.formData.styles,getFormExports:e=>Object.fromEntries(Object.entries(e.formExports).map((t=>{let[n,r]=t;return[n,r.replace(":form_id:",`${e.formData.id}`)]}))),getFormSettings:e=>e.formData.settings,getAllAvailableSegments:e=>e.segments,getAllAvailableCustomFields:e=>e.customFields,getAllAvailablePages:e=>e.allWpPages.map((e=>({id:e.id,title:e.name}))),getIsFormSaving:e=>e.isFormSaving,getIsPreviewShown:e=>e.isPreviewShown,getIsPreviewReady:e=>e.isPreviewReady,getPreviewSettings(e){if(e.previewSettings)return e.previewSettings;const t={displayType:"desktop",formType:"others"},n=e.formData.settings;return n.formPlacement.belowPosts.enabled&&(t.formType="below_posts"),n.formPlacement.popup.enabled&&(t.formType="popup"),n.formPlacement.fixedBar.enabled&&(t.formType="fixed_bar"),n.formPlacement.slideIn.enabled&&(t.formType="slide_in"),t},getFormWidth(e,t){const n=e.formData.settings;switch(t){case"below_posts":return n.formPlacement.belowPosts.styles.width;case"popup":return n.formPlacement.popup.styles.width;case"slide_in":return n.formPlacement.slideIn.styles.width;case"fixed_bar":return n.formPlacement.fixedBar.styles.width;case"others":return n.formPlacement.others.styles.width;default:throw Error(`Invalid form display type ${t}`)}},getIsCustomFieldSaving:e=>e.isCustomFieldSaving,getIsCustomFieldDeleting:e=>e.isCustomFieldDeleting,getDismissibleNotices:e=>e.notices.filter((e=>!0===e.isDismissible)),getNonDismissibleNotices:e=>e.notices.filter((e=>!1===e.isDismissible)),getNotice:(e,t)=>e.notices.find((e=>e.id===t)),getFormErrors:e=>e.formErrors,getDefaultSidebarActiveTab:e=>e.sidebar.activeTab,getSidebarOpenedPanels:e=>e.sidebar.openedPanels,getFormBlocks:e=>e.formBlocks,getDateSettingsData:e=>e.dateSettingData,getIsCustomFieldCreating:e=>e.isCustomFieldCreating,hasUnsavedChanges:e=>e.hasUnsavedChanges,getEditorUrl:e=>e.editorUrl,getPreviewPageUrl:e=>e.previewPageUrl,getCloseIconsUrl:e=>e.closeIconsUrl,getAllCustomFonts:e=>e.customFonts,getActiveSidebar:e=>e.sidebar.activeSidebar,getAllWPPosts:e=>e.allWpPosts,getAllWPPages:e=>e.allWpPages,getAllWPCategories:e=>e.allWpCategories,getAllWPTags:e=>e.allWpTags,getAllWooCommerceProducts:e=>e.allWooCommerceProducts,getAllWooCommerceCategories:e=>e.allWooCommerceCategories,getAllWooCommerceTags:e=>e.allWooCommerceTags,getTutorialSeen:e=>e.tutorialSeen,getFormEditorUrl:e=>e.formEditorUrl,getTutorialUrl:e=>e.tutorialUrl,getClosestParentAttribute:(e,t,n)=>PB(e.formBlocks,t).reduce(((e,t)=>t.attributes&&void 0!==t.attributes[n]?t.attributes[n]:e),null),hasEditorUndo(e){let t=e.editorHistory.length;return e.editorHistory.length>1&&(t-=1),t>0&&t>e.editorHistoryOffset},hasEditorRedo:e=>e.editorHistoryOffset>0,isUserAdministrator:e=>e.user.isAdministrator};function RB(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 MB=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=RB({},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 l in o)o[l]&&(i+="; "+l,!0!==o[l]&&(i+="="+o[l].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("="),l=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(r[a]=t.read(l,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",RB({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,RB({},this.attributes,t))},withConverter:function(t){return e(RB({},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:"/"}),OB=MB,FB=n(44794),jB=n(88245),ZB=n.n(jB);function zB(e,t){return`${e}-${ZB()(t.name,{lower:!0}).replace(/[^a-z0-9]+/g,"").replace(/-$/,"")}`}const HB=(0,VI.jsxs)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,VI.jsx)(zo.y$,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,VI.jsx)(zo.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,VI.jsx)(zo.UL,{x:"6",y:"10",width:"2",height:"2"}),(0,VI.jsx)(zo.UL,{x:"6",y:"14",width:"8",height:"2"}),(0,VI.jsx)(zo.UL,{x:"16",y:"14",width:"2",height:"2"}),(0,VI.jsx)(zo.UL,{x:"10",y:"10",width:"8",height:"2"})]});var VB=n(73136),WB=n.n(VB);function UB(e){let{isBusy:t,onDelete:n}=e;const r=(0,u.useCallback)((()=>{window.confirm(jI.x.I18n.t("customFieldDeleteConfirm"))&&n()}),[n]);return(0,VI.jsx)(Ss.Z,{isDestructive:!0,isLink:!0,isBusy:t,onClick:r,className:"button-on-top",children:jI.x.I18n.t("customFieldDeleteCTA")})}function $B(e){let{label:t,mandatory:n,dateType:r,dateFormat:o,defaultToday:i,dateSettings:l,isSaving:a,onSave:s,isDeleting:c,onCustomFieldDelete:d,onChange:p}=e;const[m,h]=(0,u.useState)(t),[f,g]=(0,u.useState)(n),[v,b]=(0,u.useState)(i),[y,_]=(0,u.useState)(r),[k,w]=(0,u.useState)(o),x=(0,u.useMemo)((()=>({label:m,mandatory:f,dateType:y,dateFormat:k,defaultToday:v})),[m,f,y,k,v]),C=f!==n||v!==i||y!==r||k!==o||m!==t;return(0,u.useEffect)((()=>{p&&p(x,C)}),[x,p,C]),(0,VI.jsxs)("div",{className:"custom-field-settings",children:[(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:m,"data-automation-id":"settings_custom_date_label_input",onChange:h}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("blockMandatory"),checked:f,onChange:g}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("customFieldDefaultToday"),checked:v,onChange:b}),(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("customFieldDateType"),"data-automation-id":"settings_custom_date_type",value:y,onChange:e=>{_(e);const t=l.dateFormats[e];w(t[0])},options:l.dateTypes}),(()=>{const e=l.dateFormats[y];return Array.isArray(e)&&1===e.length?null:(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("customFieldDateFormat"),"data-automation-id":"settings_custom_date_format",value:k,onChange:e=>w(e),options:e.map((e=>({value:e,label:e})))})})(),s?(0,VI.jsx)(Ss.Z,{isPrimary:!0,onClick:()=>s({mandatory:f,dateType:y,dateFormat:k,defaultToday:v,label:m}),isBusy:a,disabled:a||!C,className:"button-on-top","data-automation-id":"custom_field_save",children:jI.x.I18n.t("customFieldSaveCTA")}):null,d?(0,VI.jsx)(UB,{isBusy:a||c,onDelete:d}):null]})}UB.propTypes={isBusy:HI().bool,onDelete:HI().func},UB.defaultProps={isBusy:!1,onDelete:()=>{}},$B.propTypes={mandatory:HI().bool,label:HI().string,dateType:HI().string,dateFormat:HI().string,defaultToday:HI().bool,onSave:HI().func,isSaving:HI().bool,dateSettings:HI().shape({dateTypes:HI().arrayOf(HI().shape({label:HI().string,value:HI().string})),dateFormats:HI().objectOf(HI().arrayOf(HI().string)),months:HI().arrayOf(HI().string)}).isRequired,isDeleting:HI().bool,onCustomFieldDelete:HI().func,onChange:HI().func},$B.defaultProps={label:"",mandatory:!1,isSaving:!1,dateType:null,dateFormat:null,defaultToday:!1,isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null};const GB=e=>{const t=e.label?e.label:"";return e.mandatory?`${t} *`:t};function qB(e){const t=[];void 0!==e.placeholder&&t.push((0,VI.jsx)("option",{value:"",children:e.placeholder},0));const n=WB()().year();for(let e=n;e>=n-100;e-=1)t.push((0,VI.jsx)("option",{value:e,children:e},e));return(0,VI.jsx)("select",{name:`${e.name}[year]`,value:e.year,onChange:e.onValueChange,className:g()({mailpoet_date_year:e.addDefaultClasses}),children:t})}function KB(e){const t=[];void 0!==e.placeholder&&t.push((0,VI.jsx)("option",{value:"",children:e.placeholder},0));for(let n=1;n<=12;n+=1)t.push((0,VI.jsx)("option",{value:n,children:e.monthNames[n-1]},n));return(0,VI.jsx)("select",{name:`${e.name}[month]`,value:e.month,onChange:e.onValueChange,className:g()({mailpoet_date_month:e.addDefaultClasses}),children:t})}function YB(e){const t=[];void 0!==e.placeholder&&t.push((0,VI.jsx)("option",{value:"",children:e.placeholder},0));for(let e=1;e<=31;e+=1)t.push((0,VI.jsx)("option",{value:e,children:e},e));return(0,VI.jsx)("select",{name:`${e.name}[day]`,value:e.day,onChange:e.onValueChange,className:g()({mailpoet_date_day:e.addDefaultClasses}),children:t})}qB.propTypes={name:HI().string.isRequired,placeholder:HI().string.isRequired,onValueChange:HI().func.isRequired,year:HI().oneOfType([HI().string,HI().number]).isRequired,addDefaultClasses:HI().bool.isRequired},KB.propTypes={name:HI().string.isRequired,placeholder:HI().string.isRequired,onValueChange:HI().func.isRequired,month:HI().oneOfType([HI().string,HI().number]).isRequired,monthNames:HI().arrayOf(HI().string).isRequired,addDefaultClasses:HI().bool.isRequired},YB.propTypes={name:HI().string.isRequired,placeholder:HI().string.isRequired,onValueChange:HI().func.isRequired,day:HI().oneOfType([HI().string,HI().number]).isRequired,addDefaultClasses:HI().bool.isRequired};class JB extends u.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=WB()(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,VI.jsx)(qB,{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,VI.jsx)(KB,{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,VI.jsx)(YB,{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,VI.jsx)("div",{children:"Invalid date type"})}}));return(0,VI.jsx)("div",{children:n})}}function XB(e){let{children:t,className:n}=e;return(0,VI.jsx)("div",{className:g()("mailpoet_paragraph",n),children:t})}function QB(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 eA(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldSaving()),[]),i=(0,b.Z)((e=>e("mailpoet-form-editor").getDateSettingsData()),[]),l=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldDeleting()),[]),{saveCustomField:a,deleteCustomField:s,customFieldEdited:c}=(0,y.Z)("mailpoet-form-editor"),u=(0,VI.jsx)(lc,{children:(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,VI.jsx)($B,{label:t.label,mandatory:t.mandatory,dateSettings:i,defaultToday:t.defaultToday,dateFormat:t.dateFormat,dateType:t.dateType,isSaving:o,onSave:e=>a({customFieldId:t.customFieldId,data:{params:QB("date",e)},onFinish:()=>n({mandatory:e.mandatory,dateType:e.dateType,dateFormat:e.dateFormat,defaultToday:e.defaultToday,label:e.label})}),onCustomFieldDelete:()=>s(t.customFieldId,r),isDeleting:l,onChange:(e,t)=>t&&c()})})})});return(0,VI.jsx)(XB,{className:t.className,children:(0,VI.jsxs)("div",{className:"mailpoet_custom_date",children:[u,(0,VI.jsx)("label",{className:"mailpoet_date_label","data-automation-id":"editor_custom_date_label",htmlFor:r,children:GB(t)}),(0,VI.jsx)(JB,{field:{name:r,day_placeholder:jI.x.I18n.t("customFieldDay"),month_placeholder:jI.x.I18n.t("customFieldMonth"),year_placeholder:jI.x.I18n.t("customFieldYear"),params:{date_type:t.dateType,date_format:t.dateFormat}},item:{[r]:t.defaultToday?WB()().format("YYYY-MM-DD"):""},addDefaultClasses:!0,onValueChange:()=>{}})]})})}function tA(e){return{title:e.name,description:"",icon:HB,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:eA,save:()=>null}}function nA(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t}JB.propTypes={item:HI().object.isRequired,field:HI().shape({name:HI().string,day_placeholder:HI().string,month_placeholder:HI().string,year_placeholder:HI().string,params:HI().object}).isRequired,onValueChange:HI().func.isRequired,addDefaultClasses:HI().bool},JB.defaultProps={addDefaultClasses:!1},XB.propTypes={children:HI().node.isRequired,className:HI().string},XB.defaultProps={className:""},eA.propTypes={attributes:HI().shape({label:HI().string.isRequired,dateFormat:HI().string.isRequired,dateType:HI().string.isRequired,defaultToday:HI().bool,mandatory:HI().bool.isRequired,customFieldId:HI().number.isRequired,className:HI().string}).isRequired,clientId:HI().string.isRequired,setAttributes:HI().func.isRequired};const rA={fullWidth:!0,inheritFromTheme:!0},oA={fullWidth:!1,inheritFromTheme:!0},iA=e=>{if(!e)return oA;const t={fullWidth:"1"===e.full_width||!0===e.full_width,inheritFromTheme:!(0,H.has)(e,"bold")};return t.inheritFromTheme||(t.bold="1"===e.bold||!0===e.bold,(0,H.has)(e,"background_color")&&e.background_color&&(t.backgroundColor=e.background_color),(0,H.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,H.has)(e,"border_size")&&void 0!==e.border_size&&(t.borderSize=Number(e.border_size)),(0,H.has)(e,"font_size")&&void 0!==e.font_size&&(t.fontSize=Number(e.font_size)),(0,H.has)(e,"font_color")&&e.font_color&&(t.fontColor=e.font_color),(0,H.has)(e,"border_radius")&&void 0!==e.border_radius&&(t.borderRadius=Number(e.border_radius)),(0,H.has)(e,"border_color")&&e.border_color&&(t.borderColor=e.border_color),(0,H.has)(e,"padding")&&void 0!==e.padding&&(t.padding=Number(e.padding)),(0,H.has)(e,"font_family")&&e.font_family&&(t.fontFamily=e.font_family)),t},lA=(e,t)=>{const n=e.find((e=>e.color===t));return n?n.slug:void 0},aA=(e,t)=>{const n=e.find((e=>e.gradient===t));return n?n.slug:void 0},sA=(e,t)=>{let n=0;t&&(n=nA(t),void 0===n&&(n=2));const r=e.find((e=>e.size===n));return r?r.slug:void 0};function cA(e){let{label:t,mandatory:n,validate:r,isSaving:o,onSave:i,isDeleting:l,onCustomFieldDelete:a,onChange:s,fieldType:c}=e;const[d,p]=(0,u.useState)(t),[m,h]=(0,u.useState)(n),[f,g]=(0,u.useState)(r),v=(0,u.useMemo)((()=>({label:d,mandatory:m,validate:f})),[d,m,f]),b=m!==n||f!==r||d!==t;return(0,u.useEffect)((()=>{s&&s(v,b)}),[v,s,b,c]),(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:d,"data-automation-id":"settings_custom_text_label_input",onChange:p}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("blockMandatory"),checked:m,onChange:h}),(0,VI.jsx)(Qv.Z,{label:`${jI.x.I18n.t("customFieldValidateFor")}:`,"data-automation-id":"settings_custom_text_input_validation_type",options:[{label:jI.x.I18n.t("customFieldValidateNothing"),value:""},{label:jI.x.I18n.t("customFieldValidateNumbersOnly"),value:"number"},{label:jI.x.I18n.t("customFieldValidateAlphanumerical"),value:"alphanum"},{label:jI.x.I18n.t("customFieldValidatePhoneNumber"),value:"phone"}],value:f,onChange:g}),i?(0,VI.jsx)(Ss.Z,{isPrimary:!0,onClick:()=>i(v),isBusy:o,disabled:o||l||!b,className:"button-on-top","data-automation-id":"custom_field_save",children:jI.x.I18n.t("customFieldSaveCTA")}):null,a?(0,VI.jsx)(UB,{isBusy:o||l,onDelete:a}):null]})}function uA(e){let{styles:t,onChange:n}=e;const r=(0,u.useRef)(t),o=r.current,{applyStylesToAllTextInputs:i}=(0,y.Z)("mailpoet-form-editor"),l=(e,t)=>{const o={...r.current};o[e]=t,n(o),r.current=o};return(0,VI.jsx)(QI.Z,{className:"mailpoet-automation-input-styles-panel",children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,VI.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("formSettingsDisplayFullWidth"),checked:o.fullWidth,onChange:(0,H.partial)(l,"fullWidth")}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("formSettingsInheritStyleFromTheme"),checked:o.inheritFromTheme,onChange:e=>{if(e)return void l("inheritFromTheme",e);const t={...r.current};t.backgroundColor="#ffffff",t.bold=!1,t.borderRadius=0,t.borderSize=1,t.borderColor="#313131",t.inheritFromTheme=e,n(t),r.current=t},className:"mailpoet-automation-inherit-theme-toggle"}),o.inheritFromTheme?null:(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(gT,{title:jI.x.I18n.t("formSettingsColor"),settings:[{label:jI.x.I18n.t("formSettingsStylesFont"),colorValue:o.fontColor,onColorChange:(0,H.partial)(l,"fontColor")},{label:jI.x.I18n.t("formSettingsStylesBackground"),colorValue:o.backgroundColor,onColorChange:(0,H.partial)(l,"backgroundColor")},{label:jI.x.I18n.t("formSettingsBorder"),colorValue:o.borderColor,onColorChange:(0,H.partial)(l,"borderColor")}]}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("formSettingsBold"),checked:o.bold||!1,onChange:(0,H.partial)(l,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsBorderSize"),value:void 0===o.borderSize?1:o.borderSize,min:0,max:10,allowReset:!0,onChange:(0,H.partial)(l,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsBorderRadius"),value:void 0===o.borderRadius?1:o.borderRadius,min:0,max:40,allowReset:!0,onChange:(0,H.partial)(l,"borderRadius")})]}),(0,VI.jsx)("div",{children:(0,VI.jsx)(Ss.Z,{isPrimary:!0,onClick:()=>i(o),"data-automation-id":"styles_apply_to_all",children:jI.x.I18n.t("formSettingsApplyToAll")})})]})})})}cA.propTypes={label:HI().string,mandatory:HI().bool,validate:HI().string,onSave:HI().func,isSaving:HI().bool,isDeleting:HI().bool,onCustomFieldDelete:HI().func,onChange:HI().func,fieldType:HI().string},cA.defaultProps={label:"",mandatory:!1,fieldType:"",isSaving:!1,validate:"",isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null};const dA=HI().shape({fullWidth:HI().bool.isRequired,inheritFromTheme:HI().bool.isRequired,bold:HI().bool,backgroundColor:HI().string,borderSize:HI().number,borderRadius:HI().number,borderColor:HI().string});function pA(e){return e===cT.Right?"0 0 0 auto":e===cT.Center?"0 auto":"auto 0"}function mA(e){let{label:t,labelWithinInput:n,name:r,mandatory:o,styles:i,className:l}=e;const a=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),s=(0,u.useRef)(null),c=`${r}_${Math.random().toString(36).substring(2,15)}`,[d,p]=(0,u.useState)(""),m=i.inheritFromTheme?{}:{fontWeight:i.bold?"bold":"inherit"},h=i.inheritFromTheme?{}:{borderRadius:i.borderRadius?`${i.borderRadius}px`:0,borderWidth:void 0!==i.borderSize?`${i.borderSize}px`:"1px",borderColor:i.borderColor||"initial",borderStyle:"solid"};void 0!==a.inputPadding&&(h.padding=a.inputPadding),void 0!==a.inputPadding&&(h.padding=a.inputPadding),void 0!==a.alignment&&(h.textAlign=a.alignment,h.margin=pA(h.textAlign)),i.fullWidth&&(h.width="100%"),i.backgroundColor&&!i.inheritFromTheme&&(h.backgroundColor=i.backgroundColor);const f={};return i.fontColor&&!i.inheritFromTheme&&(h.color=i.fontColor,n&&(f.color=i.fontColor)),(0,VI.jsxs)(XB,{className:l,children:[n?null:(0,VI.jsx)("label",{className:"mailpoet_text_label","data-automation-id":`editor_${r}_label`,htmlFor:c,style:m,children:GB({label:t,mandatory:o})}),(e=>{let t=`#${c}::placeholder {`;return void 0!==f.color&&(t+=`color: ${f.color};`),a.fontFamily&&(t+=`font-family: ${a.fontFamily};`),t+="}",(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("style",{children:t}),(0,VI.jsx)("input",{id:c,ref:s,className:"mailpoet_text",type:"text",name:r,value:d,onChange:()=>p(""),placeholder:e,"data-automation-id":`editor_${r}_input`,style:h,autoComplete:"off"})]})})(n?GB({label:t,mandatory:o}):"")]})}function hA(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldSaving()),[]),i=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,y.Z)("mailpoet-form-editor"),c=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,VI.jsx)(cA,{updateAttributes:e=>n(e),customFieldId:t.customFieldId,label:t.label,mandatory:t.mandatory,validate:t.validate,isSaving:o,onSave:e=>{l({customFieldId:t.customFieldId,data:{params:QB("text",e)},onFinish:()=>n({mandatory:e.mandatory,validate:e.validate,label:e.label})})},onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("customFieldsFormSettings"),initialOpen:!0,children:(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})})}),(0,VI.jsx)(uA,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,VI.jsxs)(VI.Fragment,{children:[c,(0,VI.jsx)(mA,{className:t.className,name:"custom_text",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}function fA(e){return{title:e.name,description:"",icon:HB,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:rA}},supports:{html:!1,multiple:!1},edit:hA,save:()=>null}}function gA(e){let{name:t,attributes:n,setAttributes:r,clientId:o}=e;const i=`${t.replace(/[^a-zA-Z]/g,"")}_${Math.random().toString(36).substring(2,15)}`,l=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),a=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldSaving()),[]),s=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldDeleting()),[]),[c,d]=(0,u.useState)(""),{saveCustomField:p,deleteCustomField:m,customFieldEdited:h}=(0,y.Z)("mailpoet-form-editor"),f=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,VI.jsx)(cA,{label:n.label,mandatory:n.mandatory,validate:n.validate,isSaving:a,onSave:e=>p({customFieldId:n.customFieldId,data:{params:QB("textarea",e)},onFinish:()=>r({mandatory:e.mandatory,validate:e.validate,lines:e.lines,label:e.label})}),onCustomFieldDelete:()=>m(n.customFieldId,o),isDeleting:s,onChange:(e,t)=>t&&h()})})}),(0,VI.jsx)(QI.Z,{children:(0,VI.jsxs)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayLabelWithinInput"),checked:n.labelWithinInput,onChange:e=>r({labelWithinInput:e})}),(0,VI.jsx)(Qv.Z,{label:`${jI.x.I18n.t("customFieldNumberOfLines")}:`,"data-automation-id":"settings_custom_text_area_number_of_lines",value:n.lines,options:[{label:jI.x.I18n.t("customField1Line"),value:"1"},{label:jI.x.I18n.t("customField2Lines"),value:"2"},{label:jI.x.I18n.t("customField3Lines"),value:"3"},{label:jI.x.I18n.t("customField4Lines"),value:"4"},{label:jI.x.I18n.t("customField5Lines"),value:"5"}],onChange:e=>r({lines:e})})]})}),(0,VI.jsx)(uA,{styles:n.styles,onChange:e=>r({styles:e})})]}),g=n.styles.inheritFromTheme?{}:{fontWeight:n.styles.bold?"bold":"inherit"},v=n.styles.inheritFromTheme?{}:{borderRadius:n.styles.borderRadius?`${n.styles.borderRadius}px`:0,borderWidth:void 0!==n.styles.borderSize?`${n.styles.borderSize}px`:"1px",borderColor:n.styles.borderColor||"initial",borderStyle:"solid"};n.styles.fullWidth&&(v.width="100%"),n.styles.backgroundColor&&!n.styles.inheritFromTheme&&(v.backgroundColor=n.styles.backgroundColor),void 0!==l.inputPadding&&(v.padding=l.inputPadding),void 0!==l.alignment&&(v.textAlign=l.alignment,v.margin=pA(v.textAlign)),v.resize="none";const _={};n.styles.fontColor&&!n.styles.inheritFromTheme&&(v.color=n.styles.fontColor,n.labelWithinInput&&(_.color=n.styles.fontColor));const k=(0,u.useRef)(null),w=e=>{let t=`#${i}::placeholder {`;return void 0!==_.color&&(t+=`color: ${_.color};`),l.fontFamily&&(t+=`font-family: ${l.fontFamily};`),t+="}",(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("style",{children:t}),(0,VI.jsx)("textarea",{id:i,ref:k,className:"mailpoet_textarea",name:"custom_text","data-automation-id":"editor_custom_textarea_input",rows:n.lines,style:v,onChange:()=>d(""),placeholder:e,value:c})]})};return(0,VI.jsxs)(XB,{className:n.className,children:[f,n.labelWithinInput?w(GB(n)):(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("label",{className:"mailpoet_textarea_label","data-automation-id":"editor_custom_text_label",htmlFor:i,style:g,children:GB(n)}),w("")]})]})}function vA(e){return{title:e.name,description:"",icon:HB,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:rA}},supports:{html:!1,multiple:!1},edit:gA,save:()=>null}}mA.propTypes={label:HI().string.isRequired,labelWithinInput:HI().bool.isRequired,name:HI().string.isRequired,mandatory:HI().bool.isRequired,className:HI().string,styles:dA.isRequired},mA.defaultProps={className:""},hA.propTypes={attributes:HI().shape({label:HI().string.isRequired,validate:HI().string,labelWithinInput:HI().bool.isRequired,mandatory:HI().bool.isRequired,customFieldId:HI().number.isRequired,styles:dA.isRequired,className:HI().string}).isRequired,setAttributes:HI().func.isRequired,clientId:HI().string.isRequired},gA.propTypes={attributes:HI().shape({label:HI().string.isRequired,customFieldId:HI().number.isRequired,validate:HI().string,labelWithinInput:HI().bool.isRequired,mandatory:HI().bool.isRequired,lines:HI().string,styles:dA.isRequired,className:HI().string}).isRequired,setAttributes:HI().func.isRequired,clientId:HI().string.isRequired,name:HI().string.isRequired};var bA=n(68379),yA=n(61004),_A=n(4979),kA=u.createContext(null),wA=function(e){e()},xA=function(){return wA},CA={notify:function(){}},EA=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=CA,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=function(){var e=xA(),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)}}}}())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=CA)},e}(),SA=function(e){var t=e.store,n=e.context,r=e.children,o=(0,u.useMemo)((function(){var e=new EA(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),i=(0,u.useMemo)((function(){return t.getState()}),[t]);(0,u.useEffect)((function(){var e=o.subscription;return e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[o,i]);var l=n||kA;return u.createElement(l.Provider,{value:o},r)},IA=n(64996),TA=n(26095),NA=n.n(TA),BA=n(65566),AA="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?u.useLayoutEffect:u.useEffect,LA=[],PA=[null,null];function DA(e,t){var n=e[1];return[t.payload,n+1]}function RA(e,t,n){AA((function(){return e.apply(void 0,t)}),n)}function MA(e,t,n,r,o,i,l){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,l())}function OA(e,t,n,r,o,i,l,a,s,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?l.current||s():(i.current=e,a.current=e,l.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 FA=function(){return[null,0]};function jA(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,l=void 0===i?"connectAdvanced":i,a=n.renderCountProp,s=void 0===a?void 0:a,c=n.shouldHandleStateChanges,d=void 0===c||c,p=n.storeKey,m=void 0===p?"store":p,h=(n.withRef,n.forwardRef),f=void 0!==h&&h,g=n.context,v=void 0===g?kA:g,b=(0,IA.Z)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),y=v;return function(t){var n=t.displayName||t.name||"Component",r=o(n),i=(0,bo.Z)({},b,{getDisplayName:o,methodName:l,renderCountProp:s,shouldHandleStateChanges:d,storeKey:m,displayName:r,wrappedComponentName:n,WrappedComponent:t}),a=b.pure,c=a?u.useMemo:function(e){return e()};function p(n){var r=(0,u.useMemo)((function(){var e=n.forwardedRef,t=(0,IA.Z)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),o=r[0],l=r[1],a=r[2],s=(0,u.useMemo)((function(){return o&&o.Consumer&&(0,BA.isContextConsumer)(u.createElement(o.Consumer,null))?o:y}),[o,y]),p=(0,u.useContext)(s),m=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(p)&&Boolean(p.store);var h=m?n.store:p.store,f=(0,u.useMemo)((function(){return function(t){return e(t.dispatch,i)}(h)}),[h]),g=(0,u.useMemo)((function(){if(!d)return PA;var e=new EA(h,m?null:p.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[h,m,p]),v=g[0],b=g[1],_=(0,u.useMemo)((function(){return m?p:(0,bo.Z)({},p,{subscription:v})}),[m,p,v]),k=(0,u.useReducer)(DA,LA,FA),w=k[0][0],x=k[1];if(w&&w.error)throw w.error;var C=(0,u.useRef)(),E=(0,u.useRef)(a),S=(0,u.useRef)(),I=(0,u.useRef)(!1),T=c((function(){return S.current&&a===E.current?S.current:f(h.getState(),a)}),[h,w,a]);RA(MA,[E,C,I,a,T,S,b]),RA(OA,[d,h,v,f,E,C,I,S,b,x],[h,v,f]);var N=(0,u.useMemo)((function(){return u.createElement(t,(0,bo.Z)({},T,{ref:l}))}),[l,t,T]);return(0,u.useMemo)((function(){return d?u.createElement(s.Provider,{value:_},N):N}),[s,N,_])}var h=a?u.memo(p):p;if(h.WrappedComponent=t,h.displayName=r,f){var g=u.forwardRef((function(e,t){return u.createElement(h,(0,bo.Z)({},e,{forwardedRef:t}))}));return g.displayName=r,g.WrappedComponent=t,NA()(g,t)}return NA()(h,t)}}function ZA(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function zA(e,t){if(ZA(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])||!ZA(e[n[o]],t[n[o]]))return!1;return!0}function HA(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function VA(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function WA(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=VA(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=VA(o),o=r(t,n)),o},r}}var UA=[function(e){return"function"==typeof e?WA(e):void 0},function(e){return e?void 0:HA((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?HA((function(t){return(0,_A.DE)(e,t)})):void 0}],$A=[function(e){return"function"==typeof e?WA(e):void 0},function(e){return e?void 0:HA((function(){return{}}))}];function GA(e,t,n){return(0,bo.Z)({},n,{},e,{},t)}var qA=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,l=!1;return function(t,n,a){var s=e(t,n,a);return l?o&&i(s,r)||(r=s):(l=!0,r=s),r}}}(e):void 0},function(e){return e?void 0:function(){return GA}}];function KA(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function YA(e,t,n,r,o){var i,l,a,s,c,u=o.areStatesEqual,d=o.areOwnPropsEqual,p=o.areStatePropsEqual,m=!1;return function(o,h){return m?function(o,m){var h,f,g=!d(m,l),v=!u(o,i);return i=o,l=m,g&&v?(a=e(i,l),t.dependsOnOwnProps&&(s=t(r,l)),c=n(a,s,l)):g?(e.dependsOnOwnProps&&(a=e(i,l)),t.dependsOnOwnProps&&(s=t(r,l)),c=n(a,s,l)):v?(h=e(i,l),f=!p(h,a),a=h,f&&(c=n(a,s,l)),c):c}(o,h):(a=e(i=o,l=h),s=t(r,l),c=n(a,s,l),m=!0,c)}}function JA(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=(0,IA.Z)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),l=n(e,i),a=r(e,i),s=o(e,i);return(i.pure?YA:KA)(l,a,s,e,i)}function XA(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 QA(e,t){return e===t}function eL(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?jA:n,o=t.mapStateToPropsFactories,i=void 0===o?$A:o,l=t.mapDispatchToPropsFactories,a=void 0===l?UA:l,s=t.mergePropsFactories,c=void 0===s?qA:s,u=t.selectorFactory,d=void 0===u?JA:u;return function(e,t,n,o){void 0===o&&(o={});var l=o,s=l.pure,u=void 0===s||s,p=l.areStatesEqual,m=void 0===p?QA:p,h=l.areOwnPropsEqual,f=void 0===h?zA:h,g=l.areStatePropsEqual,v=void 0===g?zA:g,b=l.areMergedPropsEqual,y=void 0===b?zA:b,_=(0,IA.Z)(l,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),k=XA(e,i,"mapStateToProps"),w=XA(t,a,"mapDispatchToProps"),x=XA(n,c,"mergeProps");return r(d,(0,bo.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:w,initMergeProps:x,pure:u,areStatesEqual:m,areOwnPropsEqual:f,areStatePropsEqual:v,areMergedPropsEqual:y},_))}}var tL,nL=eL();tL=d.unstable_batchedUpdates,wA=tL;var rL=n(34986),oL=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}}},iL=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},lL=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},aL={top:0,right:0,bottom:0,left:0},sL=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?aL:n,o=e.border,i=void 0===o?aL:o,l=e.padding,a=void 0===l?aL:l,s=oL(iL(t,r)),c=oL(lL(t,i)),u=oL(lL(c,a));return{marginBox:s,borderBox:oL(t),paddingBox:c,contentBox:u,margin:r,border:i,padding:a}},cL=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&(0,rL.Z)(!1),n},uL=function(e,t){var n,r,o=e.borderBox,i=e.border,l=e.margin,a=e.padding,s=(r=t,{top:(n=o).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return sL({borderBox:s,border:i,margin:l,padding:a})},dL=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),uL(e,t)},pL=function(e,t){var n={top:cL(t.marginTop),right:cL(t.marginRight),bottom:cL(t.marginBottom),left:cL(t.marginLeft)},r={top:cL(t.paddingTop),right:cL(t.paddingRight),bottom:cL(t.paddingBottom),left:cL(t.paddingLeft)},o={top:cL(t.borderTopWidth),right:cL(t.borderRightWidth),bottom:cL(t.borderBottomWidth),left:cL(t.borderLeftWidth)};return sL({borderBox:e,margin:n,padding:r,border:o})},mL=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return pL(t,n)},hL=n(84471),fL=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 gL(e,t){}function vL(){}function bL(e,t,n){var r=t.map((function(t){var r,o,i=(r=n,o=t.options,(0,bo.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()}))}}gL.bind(null,"warn"),gL.bind(null,"error");function yL(e){this.message=e}function _L(e,t){if(!e)throw new yL("Invariant failed")}yL.prototype.toString=function(){return this.message};var kL=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=vL,t.onWindowError=function(e){var n=t.getCallbacks();n.isDragging()&&n.tryAbort(),e.error instanceof yL&&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,yA.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=bL(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(!(e instanceof yL))throw e;this.setState({})},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(u.Component),wL=function(e){return e+1},xL=function(e,t){var n=e.droppableId===t.droppableId,r=wL(e.index),o=wL(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  "},CL=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    "},EL=function(e){return"\n  The item has returned to its starting position\n  of "+wL(e.index)+"\n"},SL=function(e){return"\n  You have lifted an item in position "+wL(e.source.index)+"\n"},IL=function(e){var t=e.destination;if(t)return xL(e.source,t);var n=e.combine;return n?CL(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},TL=function(e){if("CANCEL"===e.reason)return"\n      Movement cancelled.\n      "+EL(e.source)+"\n    ";var t=e.destination,n=e.combine;return t?"\n      You have dropped the item.\n      "+xL(e.source,t)+"\n    ":n?"\n      You have dropped the item.\n      "+CL(e.draggableId,e.source,n)+"\n    ":"\n    The item has been dropped while not over a drop area.\n    "+EL(e.source)+"\n  "},NL={x:0,y:0},BL=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},AL=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},LL=function(e,t){return e.x===t.x&&e.y===t.y},PL=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},DL=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},RL=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},ML=function(e,t){return Math.min.apply(Math,t.map((function(t){return RL(e,t)})))},OL=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},FL=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},jL=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}]},ZL=function(e,t){return t&&t.shouldClipSubject?function(e,t){var n=oL({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):oL(e)},zL=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,o=e.frame,i=function(e,t){return t?FL(e,t.scroll.diff.displacement):e}(t.marginBox,o),l=function(e,t,n){var r;return n&&n.increasedBy?(0,bo.Z)({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r)):e}(i,r,n);return{page:t,withPlaceholder:n,active:ZL(l,o)}},HL=function(e,t){e.frame||_L(!1);var n=e.frame,r=AL(t,n.scroll.initial),o=PL(r),i=(0,bo.Z)({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}}),l=zL({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return(0,bo.Z)({},e,{frame:i,subject:l})};function VL(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function WL(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 UL(e,t){if(e.find)return e.find(t);var n=WL(e,t);return-1!==n?e[n]:void 0}function $L(e){return Array.prototype.slice.call(e)}var GL=(0,hL.default)((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),qL=(0,hL.default)((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),KL=(0,hL.default)((function(e){return VL(e)})),YL=(0,hL.default)((function(e){return VL(e)})),JL=(0,hL.default)((function(e,t){var n=YL(t).filter((function(t){return e===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}));return n}));function XL(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function QL(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var eP=(0,hL.default)((function(e,t){return t.filter((function(t){return t.descriptor.id!==e.descriptor.id}))})),tP=function(e,t){return e.descriptor.droppableId===t.descriptor.id},nP={point:NL,value:0},rP={invisible:{},visible:{},all:[]},oP={displaced:rP,displacedBy:nP,at:null},iP=function(e,t){return function(n){return e<=n&&n<=t}},lP=function(e){var t=iP(e.top,e.bottom),n=iP(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 l=r.top<e.top&&r.bottom>e.bottom,a=r.left<e.left&&r.right>e.right;return!(!l||!a)||l&&i||a&&o}},aP=function(e){var t=iP(e.top,e.bottom),n=iP(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},sP={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},cP={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},uP=function(e){var t=e.target,n=e.destination,r=e.viewport,o=e.withDroppableDisplacement,i=e.isVisibleThroughFrameFn,l=o?function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:NL;return FL(e,n)}(t,n):t;return function(e,t,n){return!!t.subject.active&&n(t.subject.active)(e)}(l,n,i)&&function(e,t,n){return n(t)(e)}(l,r,i)},dP=function(e){return uP((0,bo.Z)({},e,{isVisibleThroughFrameFn:aP}))};function pP(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,o=e.viewport,i=e.forceShouldAnimate,l=e.last;return t.reduce((function(e,t){var a,s=function(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return oL(iL(n,r))}(t,r),c=t.descriptor.id;if(e.all.push(c),a={target:s,destination:n,viewport:o,withDroppableDisplacement:!0},!uP((0,bo.Z)({},a,{isVisibleThroughFrameFn:lP})))return e.invisible[t.descriptor.id]=!0,e;var u=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}(c,l,i),d={draggableId:c,shouldAnimate:u};return e.visible[c]=d,e}),{all:[],visible:{},invisible:{}})}function mP(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:rP,displacedBy:r,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:i}}}}function hP(e){var t=e.draggable,n=e.insideDestination,r=e.destination,o=e.viewport,i=e.displacedBy,l=e.last,a=e.index,s=e.forceShouldAnimate,c=tP(t,r);if(null==a)return mP({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var u=UL(n,(function(e){return e.descriptor.index===a}));if(!u)return mP({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var d=eP(t,n),p=n.indexOf(u);return{displaced:pP({afterDragging:d.slice(p),destination:r,displacedBy:i,last:l,viewport:o.frame,forceShouldAnimate:s}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function fP(e,t){return Boolean(t.effected[e])}var gP=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},vP=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},bP=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return DL(t.line,n.marginBox[t.end]+gP(t,r),vP(t,n.marginBox,r))},yP=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return DL(t.line,n.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,r),vP(t,n.marginBox,r))},_P=function(e,t){var n=e.frame;return n?BL(t,n.scroll.diff.displacement):t},kP=function(e){var t=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.afterCritical,l=n.page.borderBox.center,a=t.at;return r&&a?"REORDER"===a.type?function(e){var t=e.impact,n=e.draggable,r=e.draggables,o=e.droppable,i=e.afterCritical,l=JL(o.descriptor.id,r),a=n.page,s=o.axis;if(!l.length)return function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return DL(t.line,n.contentBox[t.start]+gP(t,r),vP(t,n.contentBox,r))}({axis:s,moveInto:o.page,isMoving:a});var c=t.displaced,u=t.displacedBy,d=c.all[0];if(d){var p=r[d];if(fP(d,i))return yP({axis:s,moveRelativeTo:p.page,isMoving:a});var m=uL(p.page,u.point);return yP({axis:s,moveRelativeTo:m,isMoving:a})}var h=l[l.length-1];if(h.descriptor.id===n.descriptor.id)return a.borderBox.center;if(fP(h.descriptor.id,i)){var f=uL(h.page,PL(i.displacedBy.point));return bP({axis:s,moveRelativeTo:f,isMoving:a})}return bP({axis:s,moveRelativeTo:h.page,isMoving:a})}({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:i}):function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,o=QL(n);o||_L(!1);var i=o.draggableId,l=r[i].page.borderBox.center,a=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,o=e.displacedBy,i=Boolean(t.visible[r]||t.invisible[r]);return fP(r,n)?i?NL:PL(o.point):i?o.point:NL}({displaced:n.displaced,afterCritical:t,combineWith:i,displacedBy:n.displacedBy});return BL(l,a)}({impact:t,draggables:o,afterCritical:i}):l}(e),n=e.droppable;return n?_P(n,t):t},wP=function(e,t){var n=AL(t,e.scroll.initial),r=PL(n);return{frame:oL({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 xP(e,t){return e.map((function(e){return t[e]}))}var CP=function(e){var t,n,r=e.pageBorderBoxCenter,o=e.draggable,i=(t=e.viewport,n=r,BL(t.scroll.diff.displacement,n)),l=AL(i,o.page.borderBox.center);return BL(o.client.borderBox.center,l)},EP=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,o=e.viewport,i=e.withDroppableDisplacement,l=e.onlyOnMainAxis,a=void 0!==l&&l,s=AL(r,t.page.borderBox.center),c={target:FL(t.page.borderBox,s),destination:n,withDroppableDisplacement:i,viewport:o};return a?function(e){return uP((0,bo.Z)({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=iP(e.top,e.bottom),r=iP(e.left,e.right);return function(e){return t===sP?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}));var t}(c):dP(c)},SP=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.draggables,i=e.previousImpact,l=e.viewport,a=e.previousPageBorderBoxCenter,s=e.previousClientSelection,c=e.afterCritical;if(!r.isEnabled)return null;var u=JL(r.descriptor.id,o),d=tP(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(!XL(i))return null;function l(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return(0,bo.Z)({},i,{at:t})}var a=i.displaced.all,s=a.length?a[0]:null;if(t)return s?l(s):null;var c=eP(n,o);if(!s)return c.length?l(c[c.length-1].descriptor.id):null;var u=WL(c,(function(e){return e.descriptor.id===s}));-1===u&&_L(!1);var d=u-1;return d<0?null:l(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,l=e.insideDestination,a=e.previousImpact,s=e.viewport,c=e.afterCritical,u=a.at;if(u||_L(!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,l=t?i+1:i-1,a=r[0].descriptor.index,s=r[r.length-1].descriptor.index;return l<a||l>(n?s:s+1)?null:l}({isMovingForward:t,isInHomeList:n,location:u.destination,insideDestination:l});return null==d?null:hP({draggable:r,insideDestination:l,destination:i,viewport:s,last:a.displaced,displacedBy:a.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,l=n[i].descriptor.index;return fP(i,o)?t?l:l-1:t?l+1:l}({isMovingForward:t,destination:i,displaced:a.displaced,draggables:o,combine:u.combine,afterCritical:c});return null==p?null:hP({draggable:r,insideDestination:l,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:p})}({isMovingForward:t,isInHomeList:d,draggable:n,draggables:o,destination:r,insideDestination:u,previousImpact:i,viewport:l,afterCritical:c});if(!p)return null;var m=kP({impact:p,draggable:n,droppable:r,draggables:o,afterCritical:c});if(EP({draggable:n,destination:r,newPageBorderBoxCenter:m,viewport:l.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:CP({pageBorderBoxCenter:m,draggable:n,viewport:l}),impact:p,scrollJumpRequest:null};var h=AL(m,a),f=function(e){var t=e.impact,n=e.viewport,r=e.destination,o=e.draggables,i=e.maxScrollChange,l=wP(n,BL(n.scroll.current,i)),a=r.frame?HL(r,BL(r.frame.scroll.current,i)):r,s=t.displaced,c=pP({afterDragging:xP(s.all,o),destination:r,displacedBy:t.displacedBy,viewport:l.frame,last:s,forceShouldAnimate:!1}),u=pP({afterDragging:xP(s.all,o),destination:a,displacedBy:t.displacedBy,viewport:n.frame,last:s,forceShouldAnimate:!1}),d={},p={},m=[s,c,u];return s.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,m);t?p[e]=t:d[e]=!0})),(0,bo.Z)({},t,{displaced:{all:s.all,invisible:d,visible:p}})}({impact:p,viewport:l,destination:r,draggables:o,maxScrollChange:h});return{clientSelection:s,impact:f,scrollJumpRequest:h}},IP=function(e){var t=e.subject.active;return t||_L(!1),t},TP=function(e,t){var n=e.page.borderBox.center;return fP(e.descriptor.id,t)?AL(n,t.displacedBy.point):n},NP=function(e,t){var n=e.page.borderBox;return fP(e.descriptor.id,t)?FL(n,PL(t.displacedBy.point)):n},BP=(0,hL.default)((function(e,t){var n=t[e.line];return{value:n,point:DL(e.line,n)}})),AP=function(e,t){return(0,bo.Z)({},e,{scroll:(0,bo.Z)({},e.scroll,{max:t})})},LP=function(e,t,n){var r=e.frame;tP(t,e)&&_L(!1),e.subject.withPlaceholder&&_L(!1);var o=BP(e.axis,t.displaceBy).point,i=function(e,t,n){var r=e.axis;if("virtual"===e.descriptor.mode)return DL(r.line,t[r.line]);var o=e.subject.page.contentBox[r.size],i=JL(e.descriptor.id,n).reduce((function(e,t){return e+t.client.marginBox[r.size]}),0)+t[r.line]-o;return i<=0?null:DL(r.line,i)}(e,o,n),l={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){var a=zL({page:e.subject.page,withPlaceholder:l,axis:e.axis,frame:e.frame});return(0,bo.Z)({},e,{subject:a})}var s=i?BL(r.scroll.max,i):r.scroll.max,c=AP(r,s),u=zL({page:e.subject.page,withPlaceholder:l,axis:e.axis,frame:c});return(0,bo.Z)({},e,{subject:u,frame:c})},PP=function(e){var t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},DP=function(e){var t=e.state,n=e.type,r=function(e,t){var n=PP(e);return n?t[n]:null}(t.impact,t.dimensions.droppables),o=Boolean(r),i=t.dimensions.droppables[t.critical.droppable.id],l=r||i,a=l.axis.direction,s="vertical"===a&&("MOVE_UP"===n||"MOVE_DOWN"===n)||"horizontal"===a&&("MOVE_LEFT"===n||"MOVE_RIGHT"===n);if(s&&!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,m=p.draggables,h=p.droppables;return s?SP({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,destination:l,draggables:m,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,l=e.droppables,a=e.viewport,s=e.afterCritical,c=function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,r=e.source,o=e.droppables,i=e.viewport,l=r.subject.active;if(!l)return null;var a=r.axis,s=iP(l[a.start],l[a.end]),c=KL(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 lP(i.frame)(IP(e))})).filter((function(e){var n=IP(e);return t?l[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<l[a.crossAxisStart]})).filter((function(e){var t=IP(e),n=iP(t[a.start],t[a.end]);return s(t[a.start])||s(t[a.end])||n(l[a.start])||n(l[a.end])})).sort((function(e,n){var r=IP(e)[a.crossAxisStart],o=IP(n)[a.crossAxisStart];return t?r-o:o-r})).filter((function(e,t,n){return IP(e)[a.crossAxisStart]===IP(n[0])[a.crossAxisStart]}));if(!c.length)return null;if(1===c.length)return c[0];var u=c.filter((function(e){return iP(IP(e)[a.start],IP(e)[a.end])(n[a.line])}));return 1===u.length?u[0]:u.length>1?u.sort((function(e,t){return IP(e)[a.start]-IP(t)[a.start]}))[0]:c.sort((function(e,t){var r=ML(n,jL(IP(e))),o=ML(n,jL(IP(t)));return r!==o?r-o:IP(e)[a.start]-IP(t)[a.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:n,source:o,droppables:l,viewport:a});if(!c)return null;var u=JL(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 dP({target:NP(e,o),destination:r,viewport:n.frame,withDroppableDisplacement:!0})})).sort((function(e,n){var i=RL(t,_P(r,TP(e,o))),l=RL(t,_P(r,TP(n,o)));return i<l?-1:l<i?1:e.descriptor.index-n.descriptor.index}));return i[0]||null}({pageBorderBoxCenter:n,viewport:a,destination:c,insideDestination:u,afterCritical:s}),p=function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,r=e.insideDestination,o=e.draggable,i=e.draggables,l=e.destination,a=e.viewport,s=e.afterCritical;if(!n){if(r.length)return null;var c={displaced:rP,displacedBy:nP,at:{type:"REORDER",destination:{droppableId:l.descriptor.id,index:0}}},u=kP({impact:c,draggable:o,droppable:l,draggables:i,afterCritical:s}),d=tP(o,l)?l:LP(l,o,i);return EP({draggable:o,destination:d,newPageBorderBoxCenter:u,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?c:null}var p,m=Boolean(t[l.axis.line]<=n.page.borderBox.center[l.axis.line]),h=(p=n.descriptor.index,n.descriptor.id===o.descriptor.id||m?p:p+1);return hP({draggable:o,insideDestination:r,destination:l,viewport:a,displacedBy:BP(l.axis,o.displaceBy),last:rP,index:h})}({previousPageBorderBoxCenter:n,destination:c,draggable:r,draggables:i,moveRelativeTo:d,insideDestination:u,viewport:a,afterCritical:s});if(!p)return null;var m=kP({impact:p,draggable:r,droppable:c,draggables:i,afterCritical:s});return{clientSelection:CP({pageBorderBoxCenter:m,draggable:r,viewport:a}),impact:p,scrollJumpRequest:null}}({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,isOver:l,draggables:m,droppables:h,viewport:t.viewport,afterCritical:t.afterCritical})};function RP(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function MP(e){var t=iP(e.top,e.bottom),n=iP(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}var OP=function(e,t){return oL(FL(e,t))};function FP(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}var jP=function(e){var t=e.pageOffset,n=e.draggable,r=e.draggables,o=e.droppables,i=e.previousImpact,l=e.viewport,a=e.afterCritical,s=OP(n.page.borderBox,t),c=function(e){var t=e.pageBorderBox,n=e.draggable,r=e.droppables,o=KL(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(MP(o)(t.center))return!0;var i=e.axis,l=o.center[i.crossAxisLine],a=t[i.crossAxisStart],s=t[i.crossAxisEnd],c=iP(o[i.crossAxisStart],o[i.crossAxisEnd]),u=c(a),d=c(s);return!u&&!d||(u?a<l:s>l)}));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=DL(e.axis.line,t.center[n.line],e.page.borderBox.center[n.crossAxisLine]);return{id:e.descriptor.id,distance:RL(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:s,draggable:n,droppables:o});if(!c)return oP;var u=o[c],d=JL(u.descriptor.id,r),p=function(e,t){var n=e.frame;return n?OP(t,n.scroll.diff.value):t}(u,s);return function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,o=e.destination,i=e.insideDestination,l=e.afterCritical;if(!o.isCombineEnabled)return null;var a=o.axis,s=BP(o.axis,t.displaceBy),c=s.value,u=n[a.start],d=n[a.end],p=UL(eP(t,i),(function(e){var t=e.descriptor.id,n=e.page.borderBox,o=n[a.size]/4,i=fP(t,l),s=FP({displaced:r.displaced,id:t});return i?s?d>n[a.start]+o&&d<n[a.end]-o:u>n[a.start]-c+o&&u<n[a.end]-c-o:s?d>n[a.start]+c+o&&d<n[a.end]+c-o:u>n[a.start]+o&&u<n[a.end]-o}));return p?{displacedBy:s,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:a})||function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,r=e.destination,o=e.insideDestination,i=e.last,l=e.viewport,a=e.afterCritical,s=r.axis,c=BP(r.axis,n.displaceBy),u=c.value,d=t[s.start],p=t[s.end],m=UL(eP(n,o),(function(e){var t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=fP(t,a),o=FP({displaced:i,id:t});return r?o?p<=n:d<n-u:o?p<=n+u:d<n})),h=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:m,inHomeList:tP(n,r)});return hP({draggable:n,insideDestination:o,destination:r,viewport:l,last:i,displacedBy:c,index:h})}({pageBorderBoxWithDroppableScroll:p,draggable:n,destination:u,insideDestination:d,last:i.displaced,viewport:l,afterCritical:a})},ZP=function(e,t){var n;return(0,bo.Z)({},e,((n={})[t.descriptor.id]=t,n))},zP=function(e){var t=e.state,n=e.clientSelection,r=e.dimensions,o=e.viewport,i=e.impact,l=e.scrollJumpRequest,a=o||t.viewport,s=r||t.dimensions,c=n||t.current.client.selection,u=AL(c,t.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:BL(t.initial.client.borderBoxCenter,u)},p={selection:BL(d.selection,a.scroll.current),borderBoxCenter:BL(d.borderBoxCenter,a.scroll.current),offset:BL(d.offset,a.scroll.diff.value)},m={client:d,page:p};if("COLLECTING"===t.phase)return(0,bo.Z)({phase:"COLLECTING"},t,{dimensions:s,viewport:a,current:m});var h=s.draggables[t.critical.draggable.id],f=i||jP({pageOffset:p.offset,draggable:h,draggables:s.draggables,droppables:s.droppables,previousImpact:t.impact,viewport:a,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=PP(t),i=PP(n);if(!o)return r;if(o===i)return r;var l=r[o];if(!l.subject.withPlaceholder)return r;var a=function(e){var t=e.subject.withPlaceholder;t||_L(!1);var n=e.frame;if(!n){var r=zL({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return(0,bo.Z)({},e,{subject:r})}var o=t.oldFrameMaxScroll;o||_L(!1);var i=AP(n,o),l=zL({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return(0,bo.Z)({},e,{subject:l,frame:i})}(l);return ZP(r,a)}({previousImpact:e.previousImpact,impact:o,droppables:r}),l=PP(o);if(!l)return i;var a=r[l];if(tP(t,a))return i;if(a.subject.withPlaceholder)return i;var s=LP(a,t,n);return ZP(i,s)}({draggable:h,impact:f,previousImpact:t.impact,draggables:s.draggables,droppables:s.droppables});return(0,bo.Z)({},t,{current:m,dimensions:{draggables:s.draggables,droppables:g},impact:f,viewport:a,scrollJumpRequest:l||null,forceShouldAnimate:!l&&null})},HP=function(e){var t=e.impact,n=e.viewport,r=e.draggables,o=e.destination,i=e.forceShouldAnimate,l=t.displaced,a=function(e,t){return e.map((function(e){return t[e]}))}(l.all,r),s=pP({afterDragging:a,destination:o,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:i,last:l});return(0,bo.Z)({},t,{displaced:s})},VP=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.viewport,l=e.afterCritical,a=kP({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:l});return CP({pageBorderBoxCenter:a,draggable:n,viewport:i})},WP=function(e){var t=e.state,n=e.dimensions,r=e.viewport;"SNAP"!==t.movementMode&&_L(!1);var o=t.impact,i=r||t.viewport,l=n||t.dimensions,a=l.draggables,s=l.droppables,c=a[t.critical.draggable.id],u=PP(o);u||_L(!1);var d=s[u],p=HP({impact:o,viewport:i,destination:d,draggables:a}),m=VP({impact:p,draggable:c,droppable:d,draggables:a,viewport:i,afterCritical:t.afterCritical});return zP({impact:p,clientSelection:m,state:t,dimensions:l,viewport:i})},UP=function(e){var t=e.draggable,n=e.home,r=e.draggables,o=e.viewport,i=BP(n.axis,t.displaceBy),l=JL(n.descriptor.id,r),a=l.indexOf(t);-1===a&&_L(!1);var s,c=l.slice(a+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:pP({afterDragging:c,destination:n,displacedBy:i,last:null,viewport:o.frame,forceShouldAnimate:!1}),displacedBy:i,at:{type:"REORDER",destination:(s=t.descriptor,{index:s.index,droppableId:s.droppableId})}},afterCritical:d}},$P=function(e){return"SNAP"===e.movementMode},GP=function(e,t,n){var r=function(e,t){return{draggables:e.draggables,droppables:ZP(e.droppables,t)}}(e.dimensions,t);return!$P(e)||n?zP({state:e,dimensions:r}):WP({state:e,dimensions:r})};function qP(e){return e.isDragging&&"SNAP"===e.movementMode?(0,bo.Z)({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var KP={phase:"IDLE",completed:null,shouldFlush:!1},YP=function(e,t){if(void 0===e&&(e=KP),"FLUSH"===t.type)return(0,bo.Z)({},KP,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&_L(!1);var n=t.payload,r=n.critical,o=n.clientSelection,i=n.viewport,l=n.dimensions,a=n.movementMode,s=l.draggables[r.draggable.id],c=l.droppables[r.droppable.id],u={selection:o,borderBoxCenter:s.client.borderBox.center,offset:NL},d={client:u,page:{selection:BL(u.selection,i.scroll.initial),borderBoxCenter:BL(u.selection,i.scroll.initial),offset:BL(u.selection,i.scroll.diff.value)}},p=KL(l.droppables).every((function(e){return!e.isFixedOnPage})),m=UP({draggable:s,home:c,draggables:l.draggables,viewport:i}),h=m.impact;return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:a,dimensions:l,initial:d,current:d,isWindowScrollAllowed:p,impact:h,afterCritical:m.afterCritical,onLiftImpact:h,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&_L(!1),(0,bo.Z)({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&_L(!1),function(e){var t=e.state,n=e.published,r=n.modified.map((function(e){var n=t.dimensions.droppables[e.droppableId];return HL(n,e.scroll)})),o=(0,bo.Z)({},t.dimensions.droppables,{},GL(r)),i=qL(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||_L(!1),t}(n[t]),l=i.scroll.diff.value,a=function(e){var t=e.draggable,n=e.offset,r=e.initialWindowScroll,o=uL(t.client,n),i=dL(o,r);return(0,bo.Z)({},t,{placeholder:(0,bo.Z)({},t.placeholder,{client:o}),client:o,page:i})}({draggable:e,offset:BL(o,l),initialWindowScroll:r.scroll.initial});return a}))}({additions:n.additions,updatedDroppables:o,viewport:t.viewport})),l=(0,bo.Z)({},t.dimensions.draggables,{},i);n.removals.forEach((function(e){delete l[e]}));var a={droppables:o,draggables:l},s=PP(t.impact),c=s?a.droppables[s]:null,u=a.draggables[t.critical.draggable.id],d=a.droppables[t.critical.droppable.id],p=UP({draggable:u,home:d,draggables:l,viewport:t.viewport}),m=p.impact,h=p.afterCritical,f=c&&c.isCombineEnabled?t.impact:m,g=jP({pageOffset:t.current.page.offset,draggable:a.draggables[t.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:f,viewport:t.viewport,afterCritical:h}),v=(0,bo.Z)({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:g,onLiftImpact:m,dimensions:a,afterCritical:h,forceShouldAnimate:!1});return"COLLECTING"===t.phase?v:(0,bo.Z)({phase:"DROP_PENDING"},v,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})}({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;RP(e)||_L(!1);var f=t.payload.client;return LL(f,e.current.client.selection)?e:zP({state:e,clientSelection:f,impact:$P(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return qP(e);if("COLLECTING"===e.phase)return qP(e);RP(e)||_L(!1);var g=t.payload,v=g.id,b=g.newScroll,y=e.dimensions.droppables[v];if(!y)return e;var _=HL(y,b);return GP(e,_,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;RP(e)||_L(!1);var k=t.payload,w=k.id,x=k.isEnabled,C=e.dimensions.droppables[w];C||_L(!1),C.isEnabled===x&&_L(!1);var E=(0,bo.Z)({},C,{isEnabled:x});return GP(e,E,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;RP(e)||_L(!1);var S=t.payload,I=S.id,T=S.isCombineEnabled,N=e.dimensions.droppables[I];N||_L(!1),N.isCombineEnabled===T&&_L(!1);var B=(0,bo.Z)({},N,{isCombineEnabled:T});return GP(e,B,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;RP(e)||_L(!1),e.isWindowScrollAllowed||_L(!1);var A=t.payload.newScroll;if(LL(e.viewport.scroll.current,A))return qP(e);var L=wP(e.viewport,A);return $P(e)?WP({state:e,viewport:L}):zP({state:e,viewport:L})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!RP(e))return e;var P=t.payload.maxScroll;if(LL(P,e.viewport.scroll.max))return e;var D=(0,bo.Z)({},e.viewport,{scroll:(0,bo.Z)({},e.viewport.scroll,{max:P})});return(0,bo.Z)({phase:"DRAGGING"},e,{viewport:D})}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&&_L(!1);var R=DP({state:e,type:t.type});return R?zP({state:e,impact:R.impact,clientSelection:R.clientSelection,scrollJumpRequest:R.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var M=t.payload.reason;return"COLLECTING"!==e.phase&&_L(!1),(0,bo.Z)({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:M})}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&&_L(!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},JP=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},XP=function(){return{type:"COLLECTION_STARTING",payload:null}},QP=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},eD=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},tD=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},nD=function(e){return{type:"MOVE",payload:e}},rD=function(){return{type:"MOVE_UP",payload:null}},oD=function(){return{type:"MOVE_DOWN",payload:null}},iD=function(){return{type:"MOVE_RIGHT",payload:null}},lD=function(){return{type:"MOVE_LEFT",payload:null}},aD=function(e){return{type:"DROP_COMPLETE",payload:e}},sD=function(e){return{type:"DROP",payload:e}},cD="cubic-bezier(.2,1,.1,1)",uD=0,dD=.7,pD=.75,mD="0.2s cubic-bezier(0.2, 0, 0, 1)",hD={fluid:"opacity "+mD,snap:"transform "+mD+", opacity "+mD,drop:function(e){var t=e+"s "+cD;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+mD,placeholder:"height "+mD+", width "+mD+", margin "+mD},fD=function(e){return LL(e,NL)?null:"translate("+e.x+"px, "+e.y+"px)"},gD=fD,vD=.33,bD=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&&_L(!1),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&_L(!1);var l=o.critical,a=o.dimensions,s=a.draggables[o.critical.draggable.id],c=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,o=e.home,i=e.viewport,l=e.onLiftImpact;return r.at&&"DROP"===n?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:(0,bo.Z)({},r,{displaced:rP}),didDropInsideDroppable:!0}:{impact:HP({draggables:t,impact:l,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?XL(u):null,m=d?QL(u):null,h={index:l.draggable.index,droppableId:l.droppable.id},f={draggableId:s.descriptor.id,type:s.descriptor.type,source:h,reason:i,mode:o.movementMode,destination:p,combine:m},g=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,o=e.viewport,i=e.afterCritical,l=r.draggables,a=r.droppables,s=PP(t),c=s?a[s]:null,u=a[n.descriptor.droppableId],d=VP({impact:t,draggable:n,draggables:l,afterCritical:i,droppable:c||u,viewport:o});return AL(d,n.client.borderBox.center)}({impact:u,draggable:s,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),v={critical:o.critical,afterCritical:o.afterCritical,result:f,impact:u};if(!LL(o.current.client.offset,g)||Boolean(f.combine)){var b=function(e){var t=e.reason,n=RL(e.current,e.destination);if(n<=0)return vD;if(n>=1500)return.55;var r=vD+n/1500*.22000000000000003;return Number(("CANCEL"===t?.6*r:r).toFixed(2))}({current:o.current.client.offset,destination:g,reason:i});n({type:"DROP_ANIMATE",payload:{newHomeClientOffset:g,dropDuration:b,completed:v}})}else n(aD({completed:v}))}}else n(function(e){return{type:"DROP_PENDING",payload:e}}({reason:i}))}else e(r)}}},yD=function(){return{x:window.pageXOffset,y:window.pageYOffset}};var _D=function(e){var t=function(e){var t=e.onWindowScroll,n=fL((function(){t(yD())})),r=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(t){t.target!==window&&t.target!==window.document||e()}}}(n),o=vL;function i(){return o!==vL}return{start:function(){i()&&_L(!1),o=bL(window,[r])},stop:function(){i()||_L(!1),n.cancel(),o(),o=vL},isActive:i}}({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{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)}}},kD=function(e,t){t()},wD=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},xD=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))},CD=function(e,t){var n=function(e,t){var n,r=(n=[],{add:function(e){var t=setTimeout((function(){return function(e){var t=WL(n,(function(t){return t.timerId===e}));-1===t&&_L(!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||_L(!1),o=null,kD(0,(function(){return xD(e().onDragEnd,n,t,TL)}))};return{beforeCapture:function(t,n){o&&_L(!1),kD(0,(function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:function(t,n){o&&_L(!1),kD(0,(function(){var r=e().onBeforeDragStart;r&&r(wD(t,n))}))},start:function(n,i){o&&_L(!1);var l=wD(n,i);o={mode:i,lastCritical:n,lastLocation:l.source,lastCombine:null},r.add((function(){kD(0,(function(){return xD(e().onDragStart,l,t,SL)}))}))},update:function(n,i){var l=XL(i),a=QL(i);o||_L(!1);var s=!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);s&&(o.lastCritical=n);var c,u,d=(u=l,!(null==(c=o.lastLocation)&&null==u||null!=c&&null!=u&&c.droppableId===u.droppableId&&c.index===u.index));d&&(o.lastLocation=l);var p=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId}(o.lastCombine,a);if(p&&(o.lastCombine=a),s||d||p){var m=(0,bo.Z)({},wD(n,o.mode),{combine:a,destination:l});r.add((function(){kD(0,(function(){return xD(e().onDragUpdate,m,t,IL)}))}))}},flush:function(){o||_L(!1),r.flush()},drop:i,abort:function(){if(o){var e=(0,bo.Z)({},wD(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 l=e.getState();"DRAGGING"===l.phase&&n.update(l.critical,l.impact)}else n.abort()}else n.beforeCapture(r.payload.draggableId,r.payload.movementMode)}}}},ED=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"===n.type){var r=e.getState();"DROP_ANIMATING"!==r.phase&&_L(!1),e.dispatch(aD({completed:r.completed}))}else t(n)}}},SD=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=bL(window,[i])}))}}}},ID=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(sD({reason:r.reason})))}}}},TD=_A.qC,ND=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,o=e.width,i=AL({x:n,y:t},{x:o,y:r});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},BD=function(){var e=document.documentElement;return e||_L(!1),e},AD=function(){var e=BD();return ND({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function LD(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode}var PD,DD,RD=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,l=e.removals,a=e.modified,s=Object.keys(i).map((function(e){return t.draggable.getById(e).getDimension(NL)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(a).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),u={additions:s,removals:Object.keys(l),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||_L(!1);var o=n.critical.draggable;"ADDITION"===t.type&&LD(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&LD(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:function(r,o){e.droppable.exists(r)||_L(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:function(r,o){n&&(e.droppable.exists(r)||_L(!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)||_L(!1),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:function(t){n&&_L(!1);var r=e.draggable.getById(t.draggableId),i=e.droppable.getById(r.descriptor.droppableId),l={draggable:r.descriptor,droppable:i.descriptor},a=e.subscribe(o);return n={critical:l,unsubscribe:a},function(e){var t=e.critical,n=e.scrollOptions,r=e.registry,o=function(){var e=yD(),t=AD(),n=e.y,r=e.x,o=BD(),i=o.clientWidth,l=o.clientHeight;return{frame:oL({top:n,left:r,right:r+i,bottom:n+l}),scroll:{initial:e,current:e,max:t,diff:{value:NL,displacement:NL}}}}(),i=o.scroll.current,l=t.droppable,a=r.droppable.getAllByType(l.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(i,n)})),s=r.draggable.getAllByType(t.draggable.type).map((function(e){return e.getDimension(i)}));return{dimensions:{draggables:qL(s),droppables:GL(a)},critical:t,viewport:o}}({critical:l,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},MD=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason},OD=function(e){window.scrollBy(e.x,e.y)},FD=(0,hL.default)((function(e){return KL(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),jD=function(e){return Math.pow(e,2)},ZD=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,o=n-t;return 0===o?0:(r-t)/o},zD=360,HD=1200,VD=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=ZD({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=28*jD(1-n);return Math.ceil(r)}(t,n);return 0===i?0:o?Math.max(function(e,t){var n=t,r=HD,o=Date.now()-n;if(o>=HD)return e;if(o<zD)return 1;var i=ZD({startOfRange:zD,endOfRange:r,current:o}),l=e*jD(i);return Math.ceil(l)}(i,r),1):i},WD=function(e){var t=e.container,n=e.distanceToEdges,r=e.dragStartTime,o=e.axis,i=e.shouldUseTimeDampening,l=function(e,t){return{startScrollingFrom:.25*e[t.size],maxScrollValueAt:.05*e[t.size]}}(t,o);return n[o.end]<n[o.start]?VD({distanceToEdge:n[o.end],thresholds:l,dragStartTime:r,shouldUseTimeDampening:i}):-1*VD({distanceToEdge:n[o.start],thresholds:l,dragStartTime:r,shouldUseTimeDampening:i})},UD=OL((function(e){return 0===e?0:e})),$D=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,o=e.center,i=e.shouldUseTimeDampening,l={top:o.y-n.top,right:n.right-o.x,bottom:n.bottom-o.y,left:o.x-n.left},a=WD({container:n,distanceToEdges:l,dragStartTime:t,axis:sP,shouldUseTimeDampening:i}),s=WD({container:n,distanceToEdges:l,dragStartTime:t,axis:cP,shouldUseTimeDampening:i}),c=UD({x:s,y:a});if(LL(c,NL))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?LL(u,NL)?null:u:null},GD=OL((function(e){return 0===e?0:e>0?1:-1})),qD=(PD=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=BL(t,r),i={x:PD(o.x,n.x),y:PD(o.y,n.y)};return LL(i,NL)?null:i}),KD=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=GD(r),l=qD({max:o,current:n,change:i});return!l||0!==i.x&&0===l.x||0!==i.y&&0===l.y},YD=function(e,t){return KD({current:e.scroll.current,max:e.scroll.max,change:t})},JD=function(e,t){var n=e.frame;return!!n&&KD({current:n.scroll.current,max:n.scroll.max,change:t})},XD=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,o=e.scrollWindow,i=e.scrollDroppable,l=t.current.page.borderBoxCenter,a=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var s=function(e){var t=e.viewport,n=e.subject,r=e.center,o=e.shouldUseTimeDampening,i=$D({dragStartTime:e.dragStartTime,container:t.frame,subject:n,center:r,shouldUseTimeDampening:o});return i&&YD(t,i)?i:null}({dragStartTime:n,viewport:t.viewport,subject:a,center:l,shouldUseTimeDampening:r});if(s)return void o(s)}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=UL(FD(t),(function(t){return t.frame||_L(!1),MP(t.frame.pageMarginBox)(e)}));return n}(t,r);return i}({center:l,destination:PP(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,l=t.frame;if(!l)return null;var a=$D({dragStartTime:o,container:l.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:i});return a&&JD(t,a)?a:null}({dragStartTime:n,droppable:c,subject:a,center:l,shouldUseTimeDampening:r});u&&i(c.descriptor.id,u)}},QD=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow;return function(e){var o=e.scrollJumpRequest;if(o){var i=PP(e.impact);i||_L(!1);var l=function(e,t){if(!JD(e,t))return t;var r=function(e,t){var n=e.frame;return n&&JD(e,t)?qD({current:n.scroll.current,max:n.scroll.max,change:t}):null}(e,t);if(!r)return n(e.descriptor.id,t),null;var o=AL(t,r);return n(e.descriptor.id,o),AL(t,o)}(e.dimensions.droppables[i],o);if(l){var a=e.viewport,s=function(e,t,n){if(!e)return n;if(!YD(t,n))return n;var o=function(e,t){if(!YD(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return qD({current:r,max:n,change:t})}(t,n);if(!o)return r(n),null;var i=AL(n,o);return r(i),AL(n,i)}(e.isWindowScrollAllowed,a,l);s&&function(e,n){var r=BL(e.current.client.selection,n);t({client:r})}(e,s)}}}},eR={base:DD="data-rbd-drag-handle",draggableId:DD+"-draggable-id",contextId:DD+"-context-id"},tR=function(){var e="data-rbd-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),nR=function(){var e="data-rbd-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),rR="data-rbd-scroll-container-context-id",oR=function(e,t){return e.map((function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""})).join(" ")},iR="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?u.useLayoutEffect:u.useEffect,lR=function(){var e=document.querySelector("head");return e||_L(!1),e},aR=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};var sR=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function cR(e){return e instanceof sR(e).HTMLElement}function uR(){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||_L(!1),t},findById:r,exists:function(e){return Boolean(r(e))},getAllByType:function(t){return VL(e.draggables).filter((function(e){return e.descriptor.type===t}))}};function i(t){return e.droppables[t]||null}var l={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||_L(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return VL(e.droppables).filter((function(e){return e.descriptor.type===t}))}};return{draggable:o,droppable:l,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 dR=u.createContext(null),pR=function(){var e=document.body;return e||_L(!1),e},mR={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},hR=0,fR={separator:"::"};function gR(e,t){return void 0===t&&(t=fR),(0,Q_.Ye)((function(){return""+e+t.separator+hR++}),[t.separator,e])}var vR=u.createContext(null);function bR(e){var t=(0,u.useRef)(e);return(0,u.useEffect)((function(){t.current=e})),t}var yR,_R,kR=((yR={})[13]=!0,yR[9]=!0,yR),wR=function(e){kR[e.keyCode]&&e.preventDefault()},xR=function(){var e="visibilitychange";return"undefined"==typeof document?e:UL([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}(),CR={type:"IDLE"};function ER(){}var SR=((_R={})[34]=!0,_R[33]=!0,_R[36]=!0,_R[35]=!0,_R);var IR={type:"IDLE"},TR={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function NR(e,t){if(null==t)return!1;if(Boolean(TR[t.tagName.toLowerCase()]))return!0;var n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&NR(e,t.parentElement)}function BR(e,t){var n=t.target;return!!cR(n)&&NR(e,n)}var AR=function(e){return oL(e.getBoundingClientRect()).center},LR=function(){var e="matches";return"undefined"==typeof document?e:UL([e,"msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}))||e}();function PR(e,t){return null==e?null:e[LR](t)?e:PR(e.parentElement,t)}function DR(e,t){return e.closest?e.closest(t):PR(e,t)}function RR(e){e.preventDefault()}function MR(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!!r()&&t===n}function OR(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&&!!MD(n.getState(),o)}var FR=[function(e){var t=(0,u.useRef)(CR),n=(0,u.useRef)(vL),r=(0,Q_.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,l,{sourceEvent:t});if(o){t.preventDefault();var i={x:t.clientX,y:t.clientY};n.current(),c(o,i)}}}}}}),[e]),o=(0,Q_.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,Q_.I4)((function(){n.current=bL(window,[o,r],{passive:!1,capture:!0})}),[o,r]),l=(0,Q_.I4)((function(){"IDLE"!==t.current.type&&(t.current=CR,n.current(),i())}),[i]),a=(0,Q_.I4)((function(){var e=t.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[l]),s=(0,Q_.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 l={x:n,y:i},a=r();if("DRAGGING"===a.type)return e.preventDefault(),void a.actions.move(l);if("PENDING"!==a.type&&_L(!1),s=a.point,c=l,Math.abs(c.x-s.x)>=5||Math.abs(c.y-s.y)>=5){var s,c;e.preventDefault();var u=a.actions.fluidLift(l);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 wR(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&&_L(!1),n.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:xR,fn:t}]}({cancel:a,completed:l,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});n.current=bL(window,e,{capture:!0,passive:!1})}),[a,l]),c=(0,Q_.I4)((function(e,n){"IDLE"!==t.current.type&&_L(!1),t.current={type:"PENDING",point:n,actions:e},s()}),[s]);iR((function(){return i(),function(){n.current()}}),[i])},function(e){var t=(0,u.useRef)(ER),n=(0,Q_.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,s,{sourceEvent:n});if(i){n.preventDefault();var l=!0,a=i.snapLift();t.current(),t.current=bL(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(SR[r.keyCode]?r.preventDefault():wR(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:xR,fn:n}]}(a,s),{capture:!0,passive:!1})}}}function s(){l||_L(!1),l=!1,t.current(),r()}}}}),[e]),r=(0,Q_.I4)((function(){t.current=bL(window,[n],{passive:!1,capture:!0})}),[n]);iR((function(){return r(),function(){t.current()}}),[r])},function(e){var t=(0,u.useRef)(IR),n=(0,u.useRef)(vL),r=(0,Q_.I4)((function(){return t.current}),[]),o=(0,Q_.I4)((function(e){t.current=e}),[]),i=(0,Q_.Ye)((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,a,{sourceEvent:t});if(o){var i=t.touches[0],l={x:i.clientX,y:i.clientY};n.current(),p(o,l)}}}}}}),[e]),l=(0,Q_.I4)((function(){n.current=bL(window,[i],{capture:!0,passive:!1})}),[i]),a=(0,Q_.I4)((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),o(IR),n.current(),l())}),[l,o]),s=(0,Q_.I4)((function(){var e=t.current;a(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[a]),c=(0,Q_.I4)((function(){var e={capture:!0,passive:!1},t={cancel:s,completed:a,getPhase:r},o=bL(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&&_L(!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:xR,fn:t}]}(t),e),i=bL(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:xR,fn:t}]}(t),e);n.current=function(){o(),i()}}),[s,r,a]),d=(0,Q_.I4)((function(){var e=r();"PENDING"!==e.type&&_L(!1);var t=e.actions.fluidLift(e.point);o({type:"DRAGGING",actions:t,hasMoved:!1})}),[r,o]),p=(0,Q_.I4)((function(e,t){"IDLE"!==r().type&&_L(!1);var n=setTimeout(d,120);o({type:"PENDING",point:t,actions:e,longPressTimerId:n}),c()}),[c,r,o,d]);iR((function(){return l(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),o(IR))}}),[r,l,o]),iR((function(){return bL(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function jR(e){var t=e.contextId,n=e.store,r=e.registry,o=e.customSensors,i=e.enableDefaultSensors,l=[].concat(i?FR:[],o||[]),a=(0,u.useState)((function(){return function(){var e=null;function t(){e||_L(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&_L(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],s=(0,Q_.I4)((function(e,t){e.isDragging&&!t.isDragging&&a.tryAbandon()}),[a]);iR((function(){var e=n.getState();return n.subscribe((function(){var t=n.getState();s(e,t),e=t}))}),[a,n,s]),iR((function(){return a.tryAbandon}),[a.tryAbandon]);for(var c=(0,Q_.I4)((function(e){return OR({lockAPI:a,registry:r,store:n,draggableId:e})}),[a,r,n]),d=(0,Q_.I4)((function(e,o,i){return function(e){var t=e.lockAPI,n=e.contextId,r=e.store,o=e.registry,i=e.draggableId,l=e.forceSensorStop,a=e.sourceEvent;if(!OR({lockAPI:t,store:r,registry:o,draggableId:i}))return null;var s=o.draggable.getById(i),c=function(e,t){var n="["+tR.contextId+'="'+e+'"]',r=UL($L(document.querySelectorAll(n)),(function(e){return e.getAttribute(tR.id)===t}));return r&&cR(r)?r:null}(n,s.descriptor.id);if(!c)return null;if(a&&!s.options.canDragInteractiveElements&&BR(c,a))return null;var u=t.claim(l||vL),d="PRE_DRAG";function p(){return s.options.shouldRespectForcePress}function m(){return t.isActive(u)}var h=function(e,t){MR({expected:e,phase:d,isLockActive:m,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=bL(window,[{eventName:"click",fn:RR,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(i)}n(),r.dispatch(sD({reason:t}))}return"PRE_DRAG"!==d&&(n(),"PRE_DRAG"!==d&&_L(!1)),r.dispatch(function(e){return{type:"LIFT",payload:e}}(e.liftActionArgs)),d="DRAGGING",(0,bo.Z)({isActive:function(){return MR({expected:"DRAGGING",phase:d,isLockActive:m,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 MR({expected:"PRE_DRAG",phase:d,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,fluidLift:function(e){var t=fL((function(e){h((function(){return nD({client:e})}))})),n=f({liftActionArgs:{id:i,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return(0,bo.Z)({},n,{move:t})},snapLift:function(){var e={moveUp:function(){return h(rD)},moveRight:function(){return h(iD)},moveDown:function(){return h(oD)},moveLeft:function(){return h(lD)}};return f({liftActionArgs:{id:i,clientSelection:AR(c),movementMode:"SNAP"},cleanup:vL,actions:e})},abort:function(){MR({expected:"PRE_DRAG",phase:d,isLockActive:m,shouldWarn:!0})&&t.release()}};return g}({lockAPI:a,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:o,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null})}),[t,a,r,n]),p=(0,Q_.I4)((function(e){return function(e,t){var n=function(e,t){var n,r=t.target;if(!((n=r)instanceof sR(n).Element))return null;var o=function(e){return"["+eR.contextId+'="'+e+'"]'}(e),i=DR(r,o);return i&&cR(i)?i:null}(e,t);return n?n.getAttribute(eR.draggableId):null}(t,e)}),[t]),m=(0,Q_.I4)((function(e){var t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),h=(0,Q_.I4)((function(){a.isClaimed()&&(a.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch({type:"FLUSH",payload:null}))}),[a,n]),f=(0,Q_.I4)(a.isClaimed,[a]),g=(0,Q_.Ye)((function(){return{canGetLock:c,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:m,tryReleaseLock:h,isLockClaimed:f}}),[c,d,p,m,h,f]),v=0;v<l.length;v++)l[v](g)}function ZR(e){return e.current||_L(!1),e.current}function zR(e){var t=e.contextId,n=e.setCallbacks,r=e.sensors,o=e.nonce,i=e.dragHandleUsageInstructions,l=(0,u.useRef)(null),a=bR(e),s=(0,Q_.I4)((function(){return function(e){return{onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}}(a.current)}),[a]),c=function(e){var t=(0,Q_.Ye)((function(){return function(e){return"rbd-announcement-"+e}(e)}),[e]),n=(0,u.useRef)(null);return(0,u.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,bo.Z)(e.style,mR),pR().appendChild(e),function(){setTimeout((function(){var t=pR();t.contains(e)&&t.removeChild(e),e===n.current&&(n.current=null)}))}}),[t]),(0,Q_.I4)((function(e){var t=n.current;t&&(t.textContent=e)}),[])}(t),d=function(e){var t=e.contextId,n=e.text,r=gR("hidden-text",{separator:"-"}),o=(0,Q_.Ye)((function(){return"rbd-hidden-text-"+(e={contextId:t,uniqueId:r}).contextId+"-"+e.uniqueId;var e}),[r,t]);return(0,u.useEffect)((function(){var e=document.createElement("div");return e.id=o,e.textContent=n,e.style.display="none",pR().appendChild(e),function(){var t=pR();t.contains(e)&&t.removeChild(e)}}),[o,n]),o}({contextId:t,text:i}),p=function(e,t){var n=(0,Q_.Ye)((function(){return 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(eR.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: "+hD.outOfTheWay+";\n    ",{selector:r(tR.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),o,{selector:r(nR.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:oR(i,"always"),resting:oR(i,"resting"),dragging:oR(i,"dragging"),dropAnimating:oR(i,"dropAnimating"),userCancel:oR(i,"userCancel")}}(e)}),[e]),r=(0,u.useRef)(null),o=(0,u.useRef)(null),i=(0,Q_.I4)((0,hL.default)((function(e){var t=o.current;t||_L(!1),t.textContent=e})),[]),l=(0,Q_.I4)((function(e){var t=r.current;t||_L(!1),t.textContent=e}),[]);iR((function(){(r.current||o.current)&&_L(!1);var a=aR(t),s=aR(t);return r.current=a,o.current=s,a.setAttribute("data-rbd-always",e),s.setAttribute("data-rbd-dynamic",e),lR().appendChild(a),lR().appendChild(s),l(n.always),i(n.resting),function(){var e=function(e){var t=e.current;t||_L(!1),lR().removeChild(t),e.current=null};e(r),e(o)}}),[t,l,i,n.always,n.resting,e]);var a=(0,Q_.I4)((function(){return i(n.dragging)}),[i,n.dragging]),s=(0,Q_.I4)((function(e){i("DROP"!==e?n.userCancel:n.dropAnimating)}),[i,n.dropAnimating,n.userCancel]),c=(0,Q_.I4)((function(){o.current&&i(n.resting)}),[i,n.resting]);return(0,Q_.Ye)((function(){return{dragging:a,dropping:s,resting:c}}),[a,s,c])}(t,o),m=(0,Q_.I4)((function(e){ZR(l).dispatch(e)}),[]),h=(0,Q_.Ye)((function(){return(0,_A.DE)({publishWhileDragging:JP,updateDroppableScroll:QP,updateDroppableIsEnabled:eD,updateDroppableIsCombineEnabled:tD,collectionStarting:XP},m)}),[m]),f=function(){var e=(0,Q_.Ye)(uR,[]);return(0,u.useEffect)((function(){return function(){requestAnimationFrame(e.clean)}}),[e]),e}(),g=(0,Q_.Ye)((function(){return RD(f,h)}),[f,h]),v=(0,Q_.Ye)((function(){return function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,o=function(e){var t=e.scrollDroppable,n=fL(e.scrollWindow),r=fL(t),o=null,i=function(e){o||_L(!1);var t=o,i=t.shouldUseTimeDampening,l=t.dragStartTime;XD({state:e,scrollWindow:n,scrollDroppable:r,dragStartTime:l,shouldUseTimeDampening:i})};return{start:function(e){o&&_L(!1);var t=Date.now(),n=!1,r=function(){n=!0};XD({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=QD({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}}((0,bo.Z)({scrollWindow:OD,scrollDroppable:g.scrollDroppable},(0,_A.DE)({move:nD},m)))}),[g.scrollDroppable,m]),b=function(e){var t=(0,u.useRef)({}),n=(0,u.useRef)(null),r=(0,u.useRef)(null),o=(0,u.useRef)(!1),i=(0,Q_.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]}}),[]),l=(0,Q_.I4)((function(t){var n=function(e,t){var n="["+eR.contextId+'="'+e+'"]',r=$L(document.querySelectorAll(n));if(!r.length)return null;var o=UL(r,(function(e){return e.getAttribute(eR.draggableId)===t}));return o&&cR(o)?o:null}(e,t);n&&n!==document.activeElement&&n.focus()}),[e]),a=(0,Q_.I4)((function(e,t){n.current===e&&(n.current=t)}),[]),s=(0,Q_.I4)((function(){r.current||o.current&&(r.current=requestAnimationFrame((function(){r.current=null;var e=n.current;e&&l(e)})))}),[l]),c=(0,Q_.I4)((function(e){n.current=null;var t=document.activeElement;t&&t.getAttribute(eR.draggableId)===e&&(n.current=e)}),[]);return iR((function(){return o.current=!0,function(){o.current=!1;var e=r.current;e&&cancelAnimationFrame(e)}}),[]),(0,Q_.Ye)((function(){return{register:i,tryRecordFocus:c,tryRestoreFocusRecorded:s,tryShiftRecord:a}}),[i,c,s,a])}(t),y=(0,Q_.Ye)((function(){return function(e){var t,n=e.dimensionMarshal,r=e.focusMarshal,o=e.styleMarshal,i=e.getResponders,l=e.announce,a=e.autoScroller;return(0,_A.MT)(YP,TD((0,_A.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,l=i.id,a=i.clientSelection,s=i.movementMode,c=n();"DROP_ANIMATING"===c.phase&&r(aD({completed:c.completed})),"IDLE"!==n().phase&&_L(!1),r({type:"FLUSH",payload:null}),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:l,movementMode:s}});var u={draggableId:l,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},d=e.startPublishing(u),p=d.critical,m=d.dimensions,h=d.viewport;r({type:"INITIAL_PUBLISH",payload:{critical:p,dimensions:m,clientSelection:a,movementMode:s,viewport:h}})}else t(o)}}}}(n),bD,ED,SD,ID,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&&_L(!1),void e.start(o)}n(r),e.scroll(t.getState())}}}}(a),_D,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),CD(i,l))))}({announce:c,autoScroller:v,dimensionMarshal:g,focusMarshal:b,getResponders:s,styleMarshal:p})}),[c,v,g,b,s,p]);l.current=y;var _=(0,Q_.I4)((function(){var e=ZR(l);"IDLE"!==e.getState().phase&&e.dispatch({type:"FLUSH",payload:null})}),[]),k=(0,Q_.I4)((function(){var e=ZR(l).getState();return e.isDragging||"DROP_ANIMATING"===e.phase}),[]);n((0,Q_.Ye)((function(){return{isDragging:k,tryAbort:_}}),[k,_]));var w=(0,Q_.I4)((function(e){return MD(ZR(l).getState(),e)}),[]),x=(0,Q_.I4)((function(){return RP(ZR(l).getState())}),[]),C=(0,Q_.Ye)((function(){return{marshal:g,focus:b,contextId:t,canLift:w,isMovementAllowed:x,dragHandleUsageInstructionsId:d,registry:f}}),[t,g,d,b,w,x,f]);return jR({contextId:t,store:y,registry:f,customSensors:r,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,u.useEffect)((function(){return _}),[_]),u.createElement(vR.Provider,{value:C},u.createElement(SA,{context:dR,store:y},e.children))}var HR=0;function VR(e){var t=(0,Q_.Ye)((function(){return""+HR++}),[]),n=e.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";return u.createElement(kL,null,(function(r){return u.createElement(zR,{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 WR=function(e){return function(t){return e===t}},UR=WR("scroll"),$R=WR("auto"),GR=(WR("visible"),function(e,t){return t(e.overflowX)||t(e.overflowY)}),qR=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 GR(n,UR)||GR(n,$R)}(t)?t:e(t.parentElement)},KR=function(e){return{x:e.scrollLeft,y:e.scrollTop}},YR=function e(t){return!!t&&("fixed"===window.getComputedStyle(t).position||e(t.parentElement))},JR={passive:!1},XR={passive:!0},QR=function(e){return e.shouldPublishImmediately?JR:XR};function eM(e){var t=(0,u.useContext)(e);return t||_L(!1),t}var tM=function(e){return e&&e.env.closestScrollable||null};function nM(){}var rM={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}},oM=u.memo((function(e){var t=(0,u.useRef)(null),n=(0,Q_.I4)((function(){t.current&&(clearTimeout(t.current),t.current=null)}),[]),r=e.animate,o=e.onTransitionEnd,i=e.onClose,l=e.contextId,a=(0,u.useState)("open"===e.animate),s=a[0],c=a[1];(0,u.useEffect)((function(){return s?"open"!==r?(n(),c(!1),nM):t.current?nM:(t.current=setTimeout((function(){t.current=null,c(!1)})),n):nM}),[r,s,n]);var d=(0,Q_.I4)((function(e){"height"===e.propertyName&&(o(),"close"===r&&i())}),[r,i,o]),p=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?rM:{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?hD.placeholder:null}}({isAnimatingOpenOnMount:s,animate:e.animate,placeholder:e.placeholder});return u.createElement(e.placeholder.tagName,{style:p,"data-rbd-placeholder-context-id":l,onTransitionEnd:d,ref:e.innerRef})})),iM=u.createContext(null),lM=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,yA.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}(u.PureComponent),aM=function(e,t){return t?hD.drop(t.duration):e?hD.snap:hD.fluid},sM=function(e,t){return e?t?uD:dD:null};function cM(e){return"DRAGGING"===e.type?function(e){var t=e.dimension.client,n=e.offset,r=e.combineWith,o=e.dropping,i=Boolean(r),l=function(e){return null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode}(e),a=Boolean(o),s=a?function(e,t){var n=fD(e);return n?t?n+" scale("+pD+")":n:null}(n,i):gD(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:aM(l,o),transform:s,opacity:sM(i,a),zIndex:a?4500:5e3,pointerEvents:"none"}}(e):{transform:gD((t=e).offset),transition:t.shouldAnimateDisplacement?null:"none"};var t}function uM(e){e.preventDefault()}var dM=function(e,t){return e===t},pM=function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null};function mM(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var hM={mapped:{type:"SECONDARY",offset:NL,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:mM(null)}},fM=nL((function(){var e,t,n,r=(e=(0,hL.default)((function(e,t){return{x:e,y:t}})),t=(0,hL.default)((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=(0,hL.default)((function(e,n,r,o,i,l,a){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:l,mode:n,offset:e,dimension:r,forceShouldAnimate:a,snapshot:t(n,o,i,l,null)}}})),function(r,o){if(r.isDragging){if(r.critical.draggable.id!==o.draggableId)return null;var i=r.current.client.offset,l=r.dimensions.draggables[o.draggableId],a=PP(r.impact),s=(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,l,o.isClone,a,s,c)}var u;if("DROP_ANIMATING"===r.phase){var d=r.completed;if(d.result.draggableId!==o.draggableId)return null;var p=o.isClone,m=r.dimensions.draggables[o.draggableId],h=d.result,f=h.mode,g=pM(h),v=function(e){return e.combine?e.combine.draggableId:null}(h),b={duration:r.dropDuration,curve:cD,moveTo:r.newHomeClientOffset,opacity:v?uD:null,scale:v?pD:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:m,dropping:b,draggingOver:g,combineWith:v,mode:f,forceShouldAnimate:null,snapshot:t(f,p,g,v,b)}}}return null}),o=function(){var e=(0,hL.default)((function(e,t){return{x:e,y:t}})),t=(0,hL.default)(mM),n=(0,hL.default)((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(NL,e,!0):null},o=function(t,o,i,l){var a=i.displaced.visible[t],s=Boolean(l.inVirtualList&&l.effected[t]),c=QL(i),u=c&&c.draggableId===t?o:null;if(!a){if(!s)return r(u);if(i.displaced.invisible[t])return null;var d=PL(l.displacedBy.point),p=e(d.x,d.y);return n(p,u,!0)}if(s)return r(u);var m=i.displacedBy.point,h=e(m.x,m.y);return n(h,u,a.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)||hM}}),{dropAnimationFinished:function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}}},null,{context:dR,pure:!0,areStatePropsEqual:dM})((function(e){var t=(0,u.useRef)(null),n=(0,Q_.I4)((function(e){t.current=e}),[]),r=(0,Q_.I4)((function(){return t.current}),[]),o=eM(vR),i=o.contextId,l=o.dragHandleUsageInstructionsId,a=o.registry,s=eM(iM),c=s.type,d=s.droppableId,p=(0,Q_.Ye)((function(){return{id:e.draggableId,index:e.index,type:c,droppableId:d}}),[e.draggableId,e.index,c,d]),m=e.children,h=e.draggableId,f=e.isEnabled,g=e.shouldRespectForcePress,v=e.canDragInteractiveElements,b=e.isClone,y=e.mapped,_=e.dropAnimationFinished;b||function(e){var t=gR("draggable"),n=e.descriptor,r=e.registry,o=e.getDraggableRef,i=e.canDragInteractiveElements,l=e.shouldRespectForcePress,a=e.isEnabled,s=(0,Q_.Ye)((function(){return{canDragInteractiveElements:i,shouldRespectForcePress:l,isEnabled:a}}),[i,a,l]),c=(0,Q_.I4)((function(e){var t=o();return t||_L(!1),function(e,t,n){void 0===n&&(n=NL);var r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=pL(o,r),l=dL(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:l}}(n,t,e)}),[n,o]),d=(0,Q_.Ye)((function(){return{uniqueId:t,descriptor:n,options:s,getDimension:c}}),[n,c,s,t]),p=(0,u.useRef)(d),m=(0,u.useRef)(!0);iR((function(){return r.draggable.register(p.current),function(){return r.draggable.unregister(p.current)}}),[r.draggable]),iR((function(){if(m.current)m.current=!1;else{var e=p.current;p.current=d,r.draggable.update(d,e)}}),[d,r.draggable])}((0,Q_.Ye)((function(){return{descriptor:p,registry:a,getDraggableRef:r,canDragInteractiveElements:v,shouldRespectForcePress:g,isEnabled:f}}),[p,a,r,v,g,f]));var k=(0,Q_.Ye)((function(){return f?{tabIndex:0,role:"button","aria-describedby":l,"data-rbd-drag-handle-draggable-id":h,"data-rbd-drag-handle-context-id":i,draggable:!1,onDragStart:uM}:null}),[i,l,h,f]),w=(0,Q_.I4)((function(e){"DRAGGING"===y.type&&y.dropping&&"transform"===e.propertyName&&_()}),[_,y]),x=(0,Q_.Ye)((function(){var e=cM(y),t="DRAGGING"===y.type&&y.dropping?w:null;return{innerRef:n,draggableProps:{"data-rbd-draggable-context-id":i,"data-rbd-draggable-id":h,style:e,onTransitionEnd:t},dragHandleProps:k}}),[i,k,h,y,w,n]),C=(0,Q_.Ye)((function(){return{draggableId:p.id,type:p.type,source:{index:p.index,droppableId:p.droppableId}}}),[p.droppableId,p.id,p.index,p.type]);return m(x,y.snapshot,C)}));function gM(e){return eM(iM).isUsingCloneFor!==e.draggableId||e.isClone?u.createElement(fM,e):null}function vM(e){var t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return u.createElement(gM,(0,bo.Z)({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}var bM=function(e,t){return e===t.droppable.type},yM=function(e,t){return t.draggables[e.draggable.id]},_M={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||_L(!1),document.body}},kM=nL((function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=(0,bo.Z)({},e,{shouldAnimatePlaceholder:!1}),n=(0,hL.default)((function(e){return{draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}})),r=(0,hL.default)((function(r,o,i,l,a,s){var c=a.descriptor.id;if(a.descriptor.droppableId===r){var u=s?{render:s,dragging:n(a.descriptor)}:null,d={isDraggingOver:i,draggingOverWith:i?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:a.placeholder,shouldAnimatePlaceholder:!1,snapshot:d,useClone:u}}if(!o)return t;if(!l)return e;var p={isDraggingOver:i,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:a.placeholder,shouldAnimatePlaceholder:!0,snapshot:p,useClone:null}}));return function(n,o){var i=o.droppableId,l=o.type,a=!o.isDropDisabled,s=o.renderClone;if(n.isDragging){var c=n.critical;if(!bM(l,c))return t;var u=yM(c,n.dimensions),d=PP(n.impact)===i;return r(i,a,d,d,u,s)}if("DROP_ANIMATING"===n.phase){var p=n.completed;if(!bM(l,p.critical))return t;var m=yM(p.critical,n.dimensions);return r(i,a,pM(p.result)===i,PP(p.impact)===i,m,s)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){var h=n.completed;if(!bM(l,h.critical))return t;var f=PP(h.impact)===i,g=Boolean(h.impact.at&&"COMBINE"===h.impact.at.type),v=h.critical.droppable.id===i;return f?g?e:t:v?e:t}return t}}),{updateViewportMaxScroll:function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}}},null,{context:dR,pure:!0,areStatePropsEqual:dM})((function(e){var t=(0,u.useContext)(vR);t||_L(!1);var n=t.contextId,r=t.isMovementAllowed,o=(0,u.useRef)(null),i=(0,u.useRef)(null),l=e.children,a=e.droppableId,s=e.type,c=e.mode,p=e.direction,m=e.ignoreContainerClipping,h=e.isDropDisabled,f=e.isCombineEnabled,g=e.snapshot,v=e.useClone,b=e.updateViewportMaxScroll,y=e.getContainerForClone,_=(0,Q_.I4)((function(){return o.current}),[]),k=(0,Q_.I4)((function(e){o.current=e}),[]),w=((0,Q_.I4)((function(){return i.current}),[]),(0,Q_.I4)((function(e){i.current=e}),[])),x=(0,Q_.I4)((function(){r()&&b({maxScroll:AD()})}),[r,b]);!function(e){var t=(0,u.useRef)(null),n=eM(vR),r=gR("droppable"),o=n.registry,i=n.marshal,l=bR(e),a=(0,Q_.Ye)((function(){return{id:e.droppableId,type:e.type,mode:e.mode}}),[e.droppableId,e.mode,e.type]),s=(0,u.useRef)(a),c=(0,Q_.Ye)((function(){return(0,hL.default)((function(e,n){t.current||_L(!1);var r={x:e,y:n};i.updateDroppableScroll(a.id,r)}))}),[a.id,i]),d=(0,Q_.I4)((function(){var e=t.current;return e&&e.env.closestScrollable?KR(e.env.closestScrollable):NL}),[]),p=(0,Q_.I4)((function(){var e=d();c(e.x,e.y)}),[d,c]),m=(0,Q_.Ye)((function(){return fL(p)}),[p]),h=(0,Q_.I4)((function(){var e=t.current,n=tM(e);e&&n||_L(!1),e.scrollOptions.shouldPublishImmediately?p():m()}),[m,p]),f=(0,Q_.I4)((function(e,r){t.current&&_L(!1);var o=l.current,i=o.getDroppableRef();i||_L(!1);var s=function(e){return{closestScrollable:qR(e),isFixedOnPage:YR(e)}}(i),c={ref:i,descriptor:a,env:s,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,l=e.isDropDisabled,a=e.isCombineEnabled,s=e.shouldClipSubject,c=r.closestScrollable,u=function(e,t){var n=mL(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,l=o+t.scrollWidth,a=iL({top:r,right:l,bottom:i,left:o},n.border);return sL({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})}(t,c),d=dL(u,o),p=function(){if(!c)return null;var e=mL(c),t={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:e,page:dL(e,o),scroll:KR(c),scrollSize:t,shouldClipSubject:s}}(),m=function(e){var t=e.descriptor,n=e.isEnabled,r=e.isCombineEnabled,o=e.isFixedOnPage,i=e.direction,l=e.client,a=e.page,s=e.closest,c=function(){if(!s)return null;var e=s.scrollSize,t=s.client,n=ND({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:n,diff:{value:NL,displacement:NL}}}}(),u="vertical"===i?sP:cP;return{descriptor:t,isCombineEnabled:r,isFixedOnPage:o,axis:u,isEnabled:n,client:l,page:a,frame:c,subject:zL({page:a,withPlaceholder:null,axis:u,frame:c})}}({descriptor:n,isEnabled:!l,isCombineEnabled:a,isFixedOnPage:r.isFixedOnPage,direction:i,client:u,page:d,closest:p});return m}({ref:i,descriptor:a,env:s,windowScroll:e,direction:o.direction,isDropDisabled:o.isDropDisabled,isCombineEnabled:o.isCombineEnabled,shouldClipSubject:!o.ignoreContainerClipping}),d=s.closestScrollable;return d&&(d.setAttribute(rR,n.contextId),d.addEventListener("scroll",h,QR(c.scrollOptions))),u}),[n.contextId,a,h,l]),g=(0,Q_.I4)((function(){var e=t.current,n=tM(e);return e&&n||_L(!1),KR(n)}),[]),v=(0,Q_.I4)((function(){var e=t.current;e||_L(!1);var n=tM(e);t.current=null,n&&(m.cancel(),n.removeAttribute(rR),n.removeEventListener("scroll",h,QR(e.scrollOptions)))}),[h,m]),b=(0,Q_.I4)((function(e){var n=t.current;n||_L(!1);var r=tM(n);r||_L(!1),r.scrollTop+=e.y,r.scrollLeft+=e.x}),[]),y=(0,Q_.Ye)((function(){return{getDimensionAndWatchScroll:f,getScrollWhileDragging:g,dragStopped:v,scroll:b}}),[v,f,g,b]),_=(0,Q_.Ye)((function(){return{uniqueId:r,descriptor:a,callbacks:y}}),[y,a,r]);iR((function(){return s.current=_.descriptor,o.droppable.register(_),function(){t.current&&v(),o.droppable.unregister(_)}}),[y,a,v,_,i,o.droppable]),iR((function(){t.current&&i.updateDroppableIsEnabled(s.current.id,!e.isDropDisabled)}),[e.isDropDisabled,i]),iR((function(){t.current&&i.updateDroppableIsCombineEnabled(s.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,i])}({droppableId:a,type:s,mode:c,direction:p,isDropDisabled:h,isCombineEnabled:f,ignoreContainerClipping:m,getDroppableRef:_});var C=u.createElement(lM,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(function(e){var t=e.onClose,r=e.data,o=e.animate;return u.createElement(oM,{placeholder:r,onClose:t,innerRef:w,animate:o,contextId:n,onTransitionEnd:x})})),E=(0,Q_.Ye)((function(){return{innerRef:k,placeholder:C,droppableProps:{"data-rbd-droppable-id":a,"data-rbd-droppable-context-id":n}}}),[n,a,C,k]),S=v?v.dragging.draggableId:null,I=(0,Q_.Ye)((function(){return{droppableId:a,type:s,isUsingCloneFor:S}}),[a,S,s]);return u.createElement(iM.Provider,{value:I},l(E,g),function(){if(!v)return null;var e=v.dragging,t=v.render,n=u.createElement(gM,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(function(n,r){return t(n,r,e)}));return d.createPortal(n,y())}())}));function wM(e){let{value:t,remove:n,onUpdate:r,onCheck:o,index:i}=e;return(0,VI.jsxs)("div",{className:"mailpoet-form-segments-settings-list","data-automation-id":"custom_field_value_settings",children:[(0,VI.jsx)("input",{type:"checkbox",defaultChecked:t.isChecked||!1,onChange:e=>o(t.id,e.target.checked)},`check-${t.id}`),(0,VI.jsx)("input",{type:"text",value:t.name,"data-automation-id":"custom_field_value_settings_value",onChange:e=>r(t.id,e.target.value)}),0!==i&&(0,VI.jsx)(bA.Z,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,H.partial)(n,t.id)})]},t.id)}function xM(e){let{values:t,update:n,remove:r,onReorder:o}=e;const[i,l]=(0,u.useState)(t);if((0,u.useEffect)((()=>{l(t)}),[t]),0===i.length)return null;const a=(e,t)=>{const r=i.find((t=>t.id===e));r.name=t,n(r)},s=(e,t)=>{const r=i.find((t=>t.id===e));if(t){const e=i.find((e=>e.isChecked));e&&(delete e.isChecked,n(e)),r.isChecked=!0}else delete r.isChecked;n(r)};return(0,VI.jsx)("div",{className:"mailpoet-dnd-items-list",children:(0,VI.jsx)(VR,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,r=[...i],[a]=r.splice(t,1);r.splice(n,0,a),l(r),o(r)},children:(0,VI.jsx)(kM,{droppableId:"droppable",children:e=>(0,VI.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[i.map(((e,t)=>(0,VI.jsx)(vM,{draggableId:e.id,index:t,children:n=>(0,VI.jsx)("div",{ref:n.innerRef,...n.draggableProps,...n.dragHandleProps,children:(0,VI.jsx)(wM,{index:t,value:e,remove:r,onCheck:s,onUpdate:a},`inner${e.id}`)})},e.id))),e.placeholder]})})})})}function CM(e){let{label:t,mandatory:n,values:r,isSaving:o,onSave:i,isDeleting:l,onCustomFieldDelete:a,onChange:s,useDragAndDrop:c}=e;const[d,p]=(0,u.useState)(t),[m,h]=(0,u.useState)(n),[f,g]=(0,u.useState)(JSON.parse(JSON.stringify(r))),v=(0,u.useMemo)((()=>({label:d,mandatory:m,values:f,isValid:(0,H.reduce)(f,((e,t)=>!(0,H.isEmpty)(t.name)&&e),!0)})),[d,m,f]),b=m!==n||!(0,H.isEqualWith)(r,f)||d!==t;return(0,u.useEffect)((()=>{s&&s(v,b)}),[v,s,b]),(0,VI.jsxs)("div",{className:"custom-field-settings","data-automation-id":"custom_field_settings",children:[(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:d,"data-automation-id":"settings_custom_text_label_input",onChange:p}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("blockMandatory"),checked:m,onChange:h}),(0,VI.jsx)(xM,{remove:e=>{g(f.filter((t=>e!==t.id)))},update:e=>{g(f.map((t=>e.id!==t.id?t:e)))},values:f,onReorder:g,useDragAndDrop:c}),(0,VI.jsx)(Ss.Z,{isLink:!0,onClick:()=>g([...f,{id:`${1e3*Math.random()}-${Date.now()}`,name:`Option ${f.length+1}`}]),className:"button-on-top","data-automation-id":"custom_field_values_add_item",children:jI.x.I18n.t("customFieldAddItem")}),(0,VI.jsx)("br",{}),i?(0,VI.jsx)(Ss.Z,{isPrimary:!0,onClick:()=>i({mandatory:m,values:f,label:d}),isBusy:o,disabled:o||!b,className:"button-on-top","data-automation-id":"custom_field_save",children:jI.x.I18n.t("customFieldSaveCTA")}):null,a?(0,VI.jsx)(UB,{isBusy:o||l,onDelete:a}):null]})}function EM(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldSaving()),[]),i=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,y.Z)("mailpoet-form-editor"),c=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,VI.jsx)(CM,{label:t.label,mandatory:t.mandatory,values:t.values,isSaving:o,onSave:e=>l({customFieldId:t.customFieldId,data:{params:QB("radio",e)},onFinish:()=>n({mandatory:e.mandatory,values:e.values,label:e.label})}),onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayLabel"),checked:!t.hideLabel,onChange:e=>n({hideLabel:!e})})})})]});return(0,VI.jsxs)(XB,{className:t.className,children:[c,(0,VI.jsx)("span",{className:"mailpoet_radio_label","data-automation-id":"editor_custom_field_radio_buttons_block",children:t.hideLabel?null:GB(t)}),Array.isArray(t.values)&&t.values.map((e=>(0,VI.jsx)("div",{children:(0,VI.jsxs)("label",{children:[(0,VI.jsx)("input",{type:"radio",disabled:!0,checked:e.isChecked||!1,className:"mailpoet_radio"}),e.name]})},e.id)))]})}let SM,IM;kM.defaultProps=_M,wM.propTypes={value:HI().shape({name:HI().string.isRequired,id:HI().string.isRequired,isChecked:HI().bool}).isRequired,onUpdate:HI().func.isRequired,onCheck:HI().func.isRequired,index:HI().number.isRequired,remove:HI().func.isRequired},xM.propTypes={values:HI().arrayOf(HI().shape({name:HI().string.isRequired,id:HI().string.isRequired}).isRequired).isRequired,update:HI().func.isRequired,remove:HI().func.isRequired,onReorder:HI().func.isRequired},CM.propTypes={label:HI().string,mandatory:HI().bool,values:HI().arrayOf(HI().shape({name:HI().string.isRequired,id:HI().string.isRequired})),onSave:HI().func,isSaving:HI().bool,isDeleting:HI().bool,onCustomFieldDelete:HI().func,onChange:HI().func,useDragAndDrop:HI().bool},CM.defaultProps={label:"",mandatory:!1,isSaving:!1,values:[],isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null,useDragAndDrop:!0},EM.propTypes={attributes:HI().shape({label:HI().string.isRequired,customFieldId:HI().number.isRequired,values:HI().arrayOf(HI().shape({name:HI().string.isRequired,id:HI().string.isRequired,isChecked:HI().bool})),mandatory:HI().bool.isRequired,hideLabel:HI().bool,className:HI().string}).isRequired,setAttributes:HI().func.isRequired,clientId:HI().string.isRequired},function(e){e.Divider="divider",e.Spacer="spacer"}(SM||(SM={})),function(e){e.Solid="solid",e.Dashed="dashed",e.Dotted="dotted"}(IM||(IM={}));const TM={className:void 0,height:1,type:SM.Divider,style:IM.Solid,dividerHeight:1,dividerWidth:100,color:"black"},NM=()=>`${Math.random().toString()}-${Date.now()}`,BM=e=>e.map((e=>{const t={name:e.value,id:NM()};return(0,H.has)(e,"is_checked")&&e.is_checked&&(t.isChecked=!0),t})),AM=(e,t,n)=>{const r=t.find((t=>t.id===parseInt(e.id,10)));if(!r)return null;const o={...n,name:zB({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,H.has)(e.params,"validate")&&e.params.validate&&(o.attributes.validate=e.params.validate),(0,H.has)(e.params,"hide_label")&&(o.attributes.hideLabel=!!e.params.hide_label),(0,H.has)(e.params,"lines")&&(o.attributes.lines=e.params.lines),(0,H.has)(e.params,"date_type")&&(o.attributes.dateType=e.params.date_type),(0,H.has)(e.params,"date_format")&&(o.attributes.dateFormat=e.params.date_format),(0,H.has)(e.params,"is_default_today")&&(o.attributes.defaultToday=!!e.params.is_default_today),(0,H.has)(e.params,"values")&&Array.isArray(e.params.values)&&(o.attributes.values=BM(e.params.values))),"text"!==r.type&&"textarea"!==r.type||(o.attributes.styles=iA(e.styles)),o},LM=function(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const i=PM(t,n,r,o),l={clientId:NM(),name:`core/${e.type}`,isValid:!0,attributes:{style:{color:{}}},innerBlocks:i(e.body?e.body:[])},a=lA(n,e.params.text_color),s=lA(n,e.params.background_color),c=aA(r,e.params.gradient);return(0,H.has)(e.params,"width")&&(l.attributes.width=Number.isNaN(Number(e.params.width))?e.params.width:`${e.params.width}%`),(0,H.has)(e.params,"vertical_alignment")&&(l.attributes.verticalAlignment=e.params.vertical_alignment),(0,H.has)(e.params,"text_color")&&(l.attributes.textColor=a,l.attributes.style.color.text=a?void 0:e.params.text_color),(0,H.has)(e.params,"background_color")&&(l.attributes.backgroundColor=s,l.attributes.style.color.background=s?void 0:e.params.background_color),(0,H.has)(e.params,"gradient")&&(l.attributes.gradient=c,l.attributes.style.color.gradient=c?void 0:e.params.gradient),(0,H.has)(e.params,"class_name")&&e.params.class_name&&(l.attributes.className=e.params.class_name),(0,H.has)(e.params,"padding")&&(l.attributes.style.spacing={padding:e.params.padding}),(0,H.has)(e.params,"is_stacked_on_mobile")&&(l.attributes.isStackedOnMobile="1"===e.params.is_stacked_on_mobile),"columns"!==e.type||(0,H.has)(e.params,"is_stacked_on_mobile")||(l.attributes.isStackedOnMobile=!0),l},PM=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");const o=o=>{if(!Array.isArray(o))throw new Error("Mapper expects form body to be an array.");return o.map((o=>{var i,l,a,s,c,u,d,p,m,h,f,g,v,b,y,_,k,w,x,C,E,S,I,T,N,B,A,L,P,D;if(["column","columns"].includes(o.type))return LM(o,e,t,n,r);const R={clientId:`${o.id}_${NM()}`,isValid:!0,innerBlocks:[],attributes:{labelWithinInput:!1,mandatory:!1,className:null}};if(["heading","paragraph"].includes(o.type)&&(R.attributes.style={color:{},typography:{fontSize:void 0,lineHeight:void 0}}),o.params&&(0,H.has)(o.params,"class_name")&&(R.attributes.className=o.params.class_name),o.params&&(0,H.has)(o.params,"required")&&(R.attributes.mandatory=!!o.params.required),o.params&&(0,H.has)(o.params,"label_within")&&(R.attributes.labelWithinInput=!!o.params.label_within),o.params&&(R.attributes.label=o.params.label?o.params.label:""),o.params&&(0,H.has)(o.params,"text_color")){const e=lA(t,o.params.text_color);R.attributes.textColor=e,["heading","paragraph"].includes(o.type)&&!e?R.attributes.style.color.text=o.params.text_color:e||(R.attributes.customTextColor=o.params.text_color)}if(o.params&&(0,H.has)(o.params,"background_color")){const e=lA(t,o.params.background_color);R.attributes.backgroundColor=e,["heading","paragraph"].includes(o.type)&&!e?R.attributes.style.color.background=o.params.background_color:e||(R.attributes.customBackgroundColor=o.params.background_color)}if(o.params&&(0,H.has)(o.params,"font_size")){const t=sA(e,o.params.font_size);R.attributes.fontSize=t,R.attributes.style.typography.fontSize=t?void 0:nA(o.params.font_size)}o.params&&(0,H.has)(o.params,"line_height")&&(R.attributes.style.typography.lineHeight=o.params.line_height);let M=2;switch(o.id){case"email":return{...R,name:"mailpoet-form/email-input",attributes:{...R.attributes,styles:iA(o.styles)}};case"heading":return o.params&&(0,H.has)(o.params,"level")&&(M=nA(o.params.level),void 0===M&&(M=2)),{...R,attributes:{...R.attributes,content:(null===(i=o.params)||void 0===i?void 0:i.content)||"",level:M,textAlign:null===(l=o.params)||void 0===l?void 0:l.align,anchor:null===(a=o.params)||void 0===a?void 0:a.anchor,className:null===(s=o.params)||void 0===s?void 0:s.class_name},name:"core/heading"};case"paragraph":return{...R,attributes:{...R.attributes,content:(null===(c=o.params)||void 0===c?void 0:c.content)||"",align:null===(u=o.params)||void 0===u?void 0:u.align,className:null===(d=o.params)||void 0===d?void 0:d.class_name,dropCap:"1"===(null===(p=o.params)||void 0===p?void 0:p.drop_cap)},name:"core/paragraph"};case"image":return{...R,name:"core/image",attributes:{className:(null===(m=o.params)||void 0===m?void 0:m.class_name)||"",align:null===(h=o.params)||void 0===h?void 0:h.align,url:null===(f=o.params)||void 0===f?void 0:f.url,alt:null===(g=o.params)||void 0===g?void 0:g.alt,title:null===(v=o.params)||void 0===v?void 0:v.title,caption:null===(b=o.params)||void 0===b?void 0:b.caption,linkDestination:null===(y=o.params)||void 0===y?void 0:y.link_destination,link:null===(_=o.params)||void 0===_?void 0:_.link,href:null===(k=o.params)||void 0===k?void 0:k.href,linkClass:null===(w=o.params)||void 0===w?void 0:w.link_class,rel:null===(x=o.params)||void 0===x?void 0:x.rel,linkTarget:null===(C=o.params)||void 0===C?void 0:C.link_target,id:null===(E=o.params)||void 0===E?void 0:E.id,sizeSlug:null===(S=o.params)||void 0===S?void 0:S.size_slug,width:null===(I=o.params)||void 0===I?void 0:I.width,height:null===(T=o.params)||void 0===T?void 0:T.height}};case"first_name":return{...R,name:"mailpoet-form/first-name-input",attributes:{...R.attributes,styles:iA(o.styles)}};case"last_name":return{...R,name:"mailpoet-form/last-name-input",attributes:{...R.attributes,styles:iA(o.styles)}};case"segments":return o.params&&(0,H.has)(o.params,"values")&&Array.isArray(o.params.values)?R.attributes.values=o.params.values.map((e=>({id:e.id,isChecked:"1"===e.is_checked||void 0}))):R.attributes.values=[],{...R,name:"mailpoet-form/segment-select"};case"submit":return{...R,name:"mailpoet-form/submit-button",attributes:{...R.attributes,styles:iA(o.styles)}};case"divider":return delete R.attributes.label,{...R,name:"mailpoet-form/divider",attributes:{className:R.attributes.className,height:nA((null===(N=o.params)||void 0===N?void 0:N.height)??TM.height),type:(null===(B=o.params)||void 0===B?void 0:B.type)??TM.type,style:(null===(A=o.params)||void 0===A?void 0:A.style)??TM.style,dividerHeight:nA((null===(L=o.params)||void 0===L?void 0:L.divider_height)??TM.dividerHeight),dividerWidth:nA((null===(P=o.params)||void 0===P?void 0:P.divider_width)??TM.dividerWidth),color:(null===(D=o.params)||void 0===D?void 0:D.color)??TM.color}};case"html":return{...R,name:"mailpoet-form/html",attributes:{className:R.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))?AM(o,r,R):null}})).filter(Boolean)};return o};function DM(e){return{title:e.name,description:"",icon:HB,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?BM(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:EM,save:()=>null}}function RM(e){let{label:t,mandatory:n,isSaving:r,onSave:o,isChecked:i,checkboxLabel:l,isDeleting:a,onCustomFieldDelete:s,onChange:c}=e;const[d,p]=(0,u.useState)(t),[m,h]=(0,u.useState)(n),[f,g]=(0,u.useState)(i),[v,b]=(0,u.useState)(l),y=m!==n||f!==i||d!==t||v!==l,_=(0,u.useMemo)((()=>({mandatory:m,isChecked:f,label:d,checkboxLabel:v,isValid:!(0,H.isEmpty)(v)})),[d,m,f,v]);return(0,u.useEffect)((()=>{c(_,y)}),[_,c,y]),(0,VI.jsxs)("div",{className:"custom-field-settings",children:[(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:d,"data-automation-id":"settings_custom_text_label_input",onChange:p}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("blockMandatory"),checked:m,onChange:h}),(0,VI.jsxs)(rw.ZP,{children:[(0,VI.jsx)("input",{type:"checkbox",checked:f,onChange:e=>g(!!e.target.checked)}),(0,VI.jsx)("input",{value:v,"data-automation-id":"settings_custom_checkbox_value",type:"text",onChange:e=>b(e.target.value)})]}),o?(0,VI.jsx)(Ss.Z,{isPrimary:!0,onClick:()=>o(_),isBusy:r,disabled:r||!y,className:"button-on-top","data-automation-id":"custom_field_save",children:jI.x.I18n.t("customFieldSaveCTA")}):null,s?(0,VI.jsx)(UB,{isBusy:r||a,onDelete:s}):null]})}function MM(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldSaving()),[]),i=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,y.Z)("mailpoet-form-editor"),c=()=>{if(Array.isArray(t.values)){const e=t.values[0];if(e)return e.name}return""},u=()=>{let e=!1;if(Array.isArray(t.values)){const n=t.values[0];n&&n.isChecked&&(e=!0)}return e},d=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,VI.jsx)(RM,{label:t.label,mandatory:t.mandatory,isSaving:o,isChecked:u(),checkboxLabel:c(),onSave:e=>l({customFieldId:t.customFieldId,data:{params:QB("checkbox",e)},onFinish:()=>n({mandatory:e.mandatory,label:e.label,values:[{isChecked:e.isChecked,name:e.checkboxLabel}]})}),onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayLabel"),checked:!t.hideLabel,onChange:e=>n({hideLabel:!e})})})})]});let p=c();return t.mandatory&&(p+=" *"),(0,VI.jsxs)(XB,{className:t.className,children:[d,(0,VI.jsx)("span",{className:"mailpoet_checkbox_label","data-automation-id":"editor_custom_field_checkbox_block",children:t.hideLabel||!t.label?null:t.label}),(0,VI.jsx)("div",{children:(0,VI.jsxs)("label",{children:[(0,VI.jsx)("input",{type:"checkbox",disabled:!0,checked:u(),className:"mailpoet_checkbox"}),(0,VI.jsx)("span",{dangerouslySetInnerHTML:{__html:p}})]})})]})}function OM(e){return{title:e.name,description:"",icon:HB,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},values:{type:"array",default:e.params.values?BM(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:MM,save:()=>null}}function FM(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),i=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldSaving()),[]),l=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldDeleting()),[]),{saveCustomField:a,deleteCustomField:s,customFieldEdited:c}=(0,y.Z)("mailpoet-form-editor"),u=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,VI.jsx)(CM,{label:t.label,mandatory:t.mandatory,values:t.values,isSaving:i,onSave:e=>a({customFieldId:t.customFieldId,data:{params:QB("select",e)},onFinish:()=>n({mandatory:e.mandatory,values:e.values,label:e.label})}),onCustomFieldDelete:()=>s(t.customFieldId,r),isDeleting:l,onChange:(e,t)=>t&&c()})})}),(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})})})]});return(0,VI.jsxs)(XB,{className:t.className,children:[u,(0,VI.jsxs)("div",{className:"mailpoet_custom_select","data-automation-id":"custom_select_block",children:[t.labelWithinInput?null:(0,VI.jsx)("label",{className:"mailpoet_select_label",htmlFor:r,children:GB(t)}),(()=>{let e=t.labelWithinInput?GB(t):"-";const n=[{label:e}];!Array.isArray(t.values)&&t.values.length||t.values.forEach((r=>{n.push({label:r.name}),!t.labelWithinInput&&r.isChecked&&(e=r.name)}));const i={};return void 0!==o.inputPadding&&(i.padding=o.inputPadding),void 0!==o.alignment&&(i.textAlign=o.alignment,i.margin=pA(i.textAlign)),o.fontFamily&&(i.fontFamily=o.fontFamily),(0,VI.jsx)("select",{style:i,className:"mailpoet_select",id:r,value:e,readOnly:!0,children:n.map(((e,t)=>(0,VI.jsx)("option",{value:e.label,disabled:0===t,children:e.label},e.label)))})})()]})]})}function jM(e){return{title:e.name,description:"",icon:HB,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?BM(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:FM,save:()=>null}}function ZM(e){return{date:{name:"mailpoet-form/custom-date",settings:tA(e)},text:{name:"mailpoet-form/custom-text",settings:fA(e)},textarea:{name:"mailpoet-form/custom-textarea",settings:vA(e)},radio:{name:"mailpoet-form/custom-radio",settings:DM(e)},checkbox:{name:"mailpoet-form/custom-checkbox",settings:OM(e)},select:{name:"mailpoet-form/custom-select",settings:jM(e)}}}RM.propTypes={label:HI().string,mandatory:HI().bool,onSave:HI().func,isSaving:HI().bool,isChecked:HI().bool,checkboxLabel:HI().string,isDeleting:HI().bool,onCustomFieldDelete:HI().func,onChange:HI().func},RM.defaultProps={label:"",mandatory:!1,onSave:null,isSaving:!1,isChecked:!1,checkboxLabel:"",isDeleting:!1,onCustomFieldDelete:null,onChange:()=>{}},MM.propTypes={attributes:HI().shape({label:HI().string.isRequired,customFieldId:HI().number.isRequired,mandatory:HI().bool.isRequired,hideLabel:HI().bool,className:HI().string,values:HI().arrayOf(HI().shape({name:HI().string.isRequired,isChecked:HI().bool}))}).isRequired,setAttributes:HI().func.isRequired,clientId:HI().string.isRequired},FM.propTypes={attributes:HI().shape({customFieldId:HI().number.isRequired,labelWithinInput:HI().bool.isRequired,label:HI().string.isRequired,values:HI().arrayOf(HI().shape({name:HI().string.isRequired,isChecked:HI().bool,id:HI().string.isRequired})),mandatory:HI().bool.isRequired,className:HI().string}).isRequired,setAttributes:HI().func.isRequired,clientId:HI().string.isRequired};const zM=(0,VI.jsxs)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,VI.jsx)(zo.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,VI.jsx)(zo.y$,{d:"M19 13H5v-2h14v2z"})]}),HM={title:jI.x.I18n.t("blockDivider"),description:null,icon:zM,category:"design",attributes:{height:{type:"number",default:TM.height},type:{type:"string",default:TM.type},style:{type:"string",default:TM.style},dividerHeight:{type:"number",default:TM.dividerHeight},dividerWidth:{type:"number",default:TM.dividerWidth},color:{type:"string",default:TM.color}},supports:{html:!1,multiple:!0},edit:function(e){let{attributes:t,setAttributes:n}=e;const r=t.dividerHeight??TM.dividerHeight,o=t.dividerWidth??TM.dividerWidth,i=t.height??TM.height,l=(0,VI.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("blockDividerStyle"),"data-automation-id":"settings_divider_style",value:t.style,onChange:e=>n({style:e}),options:[{value:IM.Solid,label:jI.x.I18n.t("blockDividerStyleSolid")},{value:IM.Dashed,label:jI.x.I18n.t("blockDividerStyleDashed")},{value:IM.Dotted,label:jI.x.I18n.t("blockDividerStyleDotted")}]}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("blockDividerDividerHeight"),className:"mailpoet-automation-styles-divider-height",value:r,min:1,max:40,allowReset:!0,onChange:e=>{let t=i;void 0!==e&&(t=Math.max(e,i)),n({dividerHeight:e,height:t})}}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("blockDividerDividerWidth"),className:"mailpoet-automation-styles-divider-width",value:o,min:1,max:100,allowReset:!0,onChange:e=>n({dividerWidth:e})}),(0,VI.jsx)(gT,{title:jI.x.I18n.t("formSettingsColor"),settings:[{label:jI.x.I18n.t("blockDividerBackground"),colorValue:t.color,onColorChange:e=>n({color:e})}]})]}),a={};return t.type===SM.Divider&&(a.borderTopStyle=t.style,a.borderTopWidth=r,a.borderTopColor=t.color,a.height=r,a.width=`${o}%`),(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(lc,{children:(0,VI.jsx)(QI.Z,{children:(0,VI.jsxs)(Qu.Z,{title:jI.x.I18n.t("formSettingsStyles"),initialOpen:!0,children:[(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("blockSpacerHeight"),className:"mailpoet-automation-spacer-height-size",value:i,min:1,max:400,allowReset:!0,onChange:e=>{let t=r;t=void 0!==e?Math.min(e,r):1,n({height:e,dividerHeight:t})}}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("blockSpacerEnableDivider"),className:"mailpoet-automation-divider-togle-enable",checked:t.type===SM.Divider,onChange:e=>n({type:e?SM.Divider:SM.Spacer})}),t.type===SM.Divider&&l]})})}),(0,VI.jsx)("div",{className:g()("mailpoet_spacer",t.className),"data-automation-id":"editor_spacer_block",style:{height:i,display:"flex",flexDirection:"column",alignItems:"center",width:"100%",justifyContent:"center"},children:(0,VI.jsx)("div",{className:"mailpoet_divider","data-automation-id":"editor_divider_block",style:a})})]})},save:()=>null};function VM(e){let{attributes:t,setAttributes:n}=e;const r=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsxs)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_email_label_input",onChange:e=>n({label:e})}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})]})}),(0,VI.jsx)(uA,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,VI.jsxs)(VI.Fragment,{children:[r,(0,VI.jsx)(mA,{className:t.className,name:"email",label:t.label,labelWithinInput:!!t.labelWithinInput,mandatory:!0,styles:t.styles})]})}VM.propTypes={attributes:HI().shape({label:HI().string.isRequired,labelWithinInput:HI().bool.isRequired,className:HI().string,styles:dA.isRequired}).isRequired,setAttributes:HI().func.isRequired};const WM=(0,VI.jsxs)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,VI.jsx)(zo.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,VI.jsx)(zo.G,{children:(0,VI.jsx)(zo.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"})})]}),UM={title:jI.x.I18n.t("blockEmail"),description:jI.x.I18n.t("blockEmailDescription"),icon:WM,category:"obligatory",attributes:{label:{type:"string",default:jI.x.I18n.t("blockEmail")},labelWithinInput:{type:"boolean",default:!0},styles:{type:"object",default:rA}},supports:{html:!1,inserter:!1,multiple:!1},edit:VM,save:()=>null};function $M(e){let{styles:t,onChange:n,formInputPadding:r,formFontFamily:o}=e;const i=(0,u.useRef)(t),l=i.current,a=(e,t)=>{const r={...i.current};r[e]=t,n(r),i.current=r};return(0,VI.jsx)(QI.Z,{className:"mailpoet-automation-input-styles-panel",children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,VI.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("formSettingsDisplayFullWidth"),checked:l.fullWidth,onChange:(0,H.partial)(a,"fullWidth")}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("formSettingsInheritStyleFromTheme"),checked:l.inheritFromTheme,onChange:e=>{if(e)return void a("inheritFromTheme",e);const t={...i.current};t.backgroundColor="#eeeeee",t.bold=!1,t.borderRadius=0,t.borderSize=1,t.borderColor="#313131",t.fontColor="#313131",t.fontSize=void 0,t.padding=r,t.inheritFromTheme=e,n(t),i.current=t},className:"mailpoet-automation-inherit-theme-toggle"}),l.inheritFromTheme?null:(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(gT,{title:jI.x.I18n.t("formSettingsColor"),settings:[{label:jI.x.I18n.t("formSettingsStylesBackground"),colorValue:t.backgroundColor,gradientValue:t.gradient,onColorChange:(0,H.partial)(a,"backgroundColor"),onGradientChange:(0,H.partial)(a,"gradient")},{label:jI.x.I18n.t("formSettingsStylesFont"),colorValue:t.fontColor,onColorChange:(0,H.partial)(a,"fontColor")},{label:jI.x.I18n.t("formSettingsBorder"),colorValue:l.borderColor,onColorChange:(0,H.partial)(a,"borderColor")}]}),(0,VI.jsx)(vT,{value:t.fontSize,onChange:(0,H.partial)(a,"fontSize")}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("formSettingsBold"),checked:l.bold||!1,onChange:(0,H.partial)(a,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,VI.jsx)(LT,{name:jI.x.I18n.t("formSettingsStylesFontFamily"),value:t.fontFamily||o,onChange:(0,H.partial)(a,"fontFamily")}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsInputPadding"),value:void 0!==l.padding?l.padding:r,min:0,max:30,allowReset:!0,onChange:(0,H.partial)(a,"padding")}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsBorderSize"),value:void 0!==l.borderSize?l.borderSize:1,min:0,max:10,allowReset:!0,onChange:(0,H.partial)(a,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,VI.jsx)(_k.Z,{label:jI.x.I18n.t("formSettingsBorderRadius"),value:void 0!==l.borderRadius?l.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,H.partial)(a,"borderRadius")})]})]})})})}const GM=(0,VI.jsxs)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,VI.jsx)(zo.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,VI.jsx)(zo.G,{children:(0,VI.jsx)(zo.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"})})]}),qM={title:jI.x.I18n.t("blockSubmit"),description:jI.x.I18n.t("blockSubmitDescription"),icon:GM,category:"obligatory",attributes:{label:{type:"string",default:jI.x.I18n.t("blockSubmitLabel")},styles:{type:"object",default:{fullWidth:!0,inheritFromTheme:!0}}},supports:{html:!1,inserter:!1,multiple:!1},edit:function(e){let{attributes:t,setAttributes:n}=e;const r=(0,b.Z)((e=>e("mailpoet-form-editor").getFormSettings()),[]),o=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsx)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:t.label,onChange:e=>n({label:e}),"data-automation-id":"settings_submit_label_input"})})}),(0,VI.jsx)($M,{onChange:e=>n({styles:e}),styles:t.styles,formInputPadding:r.inputPadding,formFontFamily:r.fontFamily})]}),i=t.styles.inheritFromTheme?{}:{fontWeight:t.styles.bold?"bold":"inherit",borderRadius:void 0!==t.styles.borderRadius?`${t.styles.borderRadius}px`:0,borderWidth:void 0!==t.styles.borderSize?`${t.styles.borderSize}px`:"1px",borderColor:t.styles.borderColor||"transparent",borderStyle:"solid",fontSize:t.styles.fontSize?`${t.styles.fontSize}px`:"inherit",color:t.styles.fontColor||"inherit"};t.styles.fullWidth&&(i.width="100%"),void 0===t.styles.padding||t.styles.inheritFromTheme?void 0!==r.inputPadding&&(i.padding=r.inputPadding):i.padding=t.styles.padding,t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(i.backgroundColor=t.styles.backgroundColor),t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(i.backgroundColor=t.styles.backgroundColor),t.styles.gradient&&!t.styles.inheritFromTheme&&(i.backgroundColor=void 0,i.background=t.styles.gradient),t.styles.fontFamily&&!t.styles.inheritFromTheme&&(i.fontFamily=t.styles.fontFamily);const l=g()("mailpoet_submit",{button:t.styles.inheritFromTheme});return(0,VI.jsxs)(XB,{className:t.className,children:[o,(0,VI.jsx)("input",{className:l,type:"submit",value:t.label,"data-automation-id":"editor_submit_input",style:i})]})},save:()=>null},KM=(0,VI.jsxs)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,VI.jsx)(zo.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,VI.jsx)(zo.G,{children:(0,VI.jsx)(zo.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 YM(e){let{attributes:t,setAttributes:n}=e;const r=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsxs)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_first_name_label_input",onChange:e=>n({label:e})}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e}),className:"mailpoet-automation-label-within-input-toggle"}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("blockMandatory"),checked:t.mandatory,onChange:e=>n({mandatory:e})})]})}),(0,VI.jsx)(uA,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,VI.jsxs)(VI.Fragment,{children:[r,(0,VI.jsx)(mA,{className:t.className,name:"first_name",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}YM.propTypes={attributes:HI().shape({label:HI().string.isRequired,labelWithinInput:HI().bool.isRequired,mandatory:HI().bool.isRequired,className:HI().string,styles:dA.isRequired}).isRequired,setAttributes:HI().func.isRequired};const JM={title:jI.x.I18n.t("blockFirstName"),description:jI.x.I18n.t("blockFirstNameDescription"),icon:KM,category:"fields",attributes:{label:{type:"string",default:jI.x.I18n.t("blockFirstName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:rA}},supports:{html:!1,multiple:!1},edit:YM,save:()=>null},XM=(0,VI.jsxs)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,VI.jsx)(zo.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,VI.jsx)(zo.G,{children:(0,VI.jsx)(zo.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 QM(e){let{attributes:t,setAttributes:n}=e;const r=(0,VI.jsxs)(lc,{children:[(0,VI.jsx)(QI.Z,{children:(0,VI.jsxs)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_last_name_label_input",onChange:e=>n({label:e})}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("blockMandatory"),checked:t.mandatory,onChange:e=>n({mandatory:e})})]})}),(0,VI.jsx)(uA,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,VI.jsxs)(VI.Fragment,{children:[r,(0,VI.jsx)(mA,{className:t.className,name:"last_name",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}QM.propTypes={attributes:HI().shape({label:HI().string.isRequired,labelWithinInput:HI().bool.isRequired,mandatory:HI().bool.isRequired,className:HI().string,styles:dA.isRequired}).isRequired,setAttributes:HI().func.isRequired};const eO={title:jI.x.I18n.t("blockLastName"),description:jI.x.I18n.t("blockLastNameDescription"),icon:XM,category:"fields",attributes:{label:{type:"string",default:jI.x.I18n.t("blockLastName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:rA}},supports:{html:!1,multiple:!1},edit:QM,save:()=>null},tO=(0,VI.jsx)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,VI.jsx)(zo.G,{children:(0,VI.jsx)(zo.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 nO=n(11345);function rO(e){let{segment:t,removeSegment:n,onCheck:r}=e;return(0,VI.jsxs)("div",{className:"mailpoet-form-segments-settings-list",children:[(0,VI.jsx)(k_.C,{label:t.name,defaultChecked:!!t.isChecked,onChange:(0,H.partial)(r,t.id)},`check-${t.id}`),(0,VI.jsx)(bA.Z,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,H.partial)(n,t.id)})]},t.id)}function oO(e){let{segments:t,updateSegment:n,removeSegment:r,onSegmentsReorder:o}=e;const[i,l]=(0,u.useState)(t);if((0,u.useEffect)((()=>{l(t)}),[t]),0===i.length)return null;const a=(e,t)=>{const r=i.find((t=>t.id===e));r.isChecked=t,n(r)};return(0,VI.jsx)(VR,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,r=[...i],[a]=r.splice(t,1);r.splice(n,0,a),l(r),o(r)},children:(0,VI.jsx)(kM,{droppableId:"droppable",children:e=>(0,VI.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[i.map(((e,t)=>(0,VI.jsx)(vM,{draggableId:e.id,index:t,children:n=>(0,VI.jsx)("div",{ref:n.innerRef,...n.draggableProps,...n.dragHandleProps,children:(0,VI.jsx)(rO,{index:t,segment:e,onCheck:a,removeSegment:r},e.id)})},e.id))),e.placeholder]})})})}rO.propTypes={segment:HI().shape({name:HI().string.isRequired,isChecked:HI().bool,id:HI().string.isRequired}).isRequired,onCheck:HI().func.isRequired,removeSegment:HI().func.isRequired},oO.propTypes={segments:HI().arrayOf(HI().shape({name:HI().string.isRequired,isChecked:HI().bool,id:HI().string.isRequired}).isRequired).isRequired,updateSegment:HI().func.isRequired,removeSegment:HI().func.isRequired,onSegmentsReorder:HI().func.isRequired};const iO=(e,t)=>e.find((e=>e.id===t));function lO(e){let{label:t,onLabelChanged:n,segmentsAddedIntoSelection:r,addSegmentIntoSelection:o,setNewSelection:i}=e;const l=(0,b.Z)((e=>e("mailpoet-form-editor").getAllAvailableSegments()),[]),a=l.map((e=>({label:e.name,value:e.id}))).filter((e=>!iO(r,e.value)));return(0,VI.jsx)(lc,{children:(0,VI.jsx)(QI.Z,{children:(0,VI.jsxs)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,VI.jsx)(nO.Z,{children:(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("label"),value:t,"data-automation-id":"settings_first_name_label_input",onChange:n})}),(0,VI.jsx)(nO.Z,{children:a.length?(0,VI.jsx)(Qv.Z,{label:`${jI.x.I18n.t("blockSegmentSelectListLabel")}:`,"data-automation-id":"select_list_selections_list",options:[{label:jI.x.I18n.t("settingsPleaseSelectList"),value:null},...a],onChange:e=>{const t=iO(l,e);o({name:t.name,isChecked:!1,id:e})}}):null}),(0,VI.jsx)(oO,{segments:r,updateSegment:e=>{i(r.map((t=>e.id!==t?t:e)))},removeSegment:e=>{i(r.filter((t=>e!==t.id)))},onSegmentsReorder:i})]})})})}function aO(e){let{attributes:t,setAttributes:n}=e;const r=(0,b.Z)((e=>e("mailpoet-form-editor").getAllAvailableSegments()),[]),o=(0,u.useMemo)((()=>t.values.map((e=>{const t={...e},n=r.find((t=>parseInt(t.id,10)===parseInt(e.id,10)));return t.name=n?n.name:"",t}))),[t.values,r]),i=e=>e.map((e=>{const t={...e};return delete t.name,t}));return(0,VI.jsxs)(XB,{className:t.className,children:[(0,VI.jsx)(lO,{label:t.label,onLabelChanged:e=>n({label:e}),segmentsAddedIntoSelection:o,setNewSelection:e=>n({values:i(e)}),addSegmentIntoSelection:e=>n({values:i([...t.values,e])})}),(0,VI.jsx)("span",{className:"mailpoet_segment_label","data-automation-id":"mailpoet_list_selection_block",children:t.label}),0===t.values.length?(0,VI.jsx)("p",{className:"mailpoet_error",children:jI.x.I18n.t("blockSegmentSelectNoLists")}):o.map((e=>(0,VI.jsxs)("label",{className:"mailpoet_checkbox_label",children:[(0,VI.jsx)("input",{type:"checkbox",disabled:!0,checked:!!e.isChecked,className:"mailpoet_checkbox"},e.id),e.name]},e.id)))]})}lO.propTypes={label:HI().string.isRequired,onLabelChanged:HI().func.isRequired,addSegmentIntoSelection:HI().func.isRequired,setNewSelection:HI().func.isRequired,segmentsAddedIntoSelection:HI().arrayOf(HI().shape({name:HI().string.isRequired,isChecked:HI().bool,id:HI().string.isRequired}).isRequired).isRequired},aO.propTypes={attributes:HI().shape({label:HI().string.isRequired,className:HI().string,values:HI().arrayOf(HI().shape({isChecked:HI().bool,id:HI().string.isRequired})).isRequired}).isRequired,setAttributes:HI().func.isRequired};const sO={title:jI.x.I18n.t("blockSegmentSelect"),description:jI.x.I18n.t("blockLastNameDescription"),icon:tO,category:"fields",attributes:{label:{type:"string",default:jI.x.I18n.t("blockSegmentSelectLabel")},values:{type:"array",default:[]}},supports:{html:!1,multiple:!1},edit:aO,save:()=>null},cO=(0,VI.jsx)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,VI.jsx)(zo.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 uO=n(48925);function dO(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=Hs("color.palette"),{fontColor:i,fontSize:l,alignment:a,fontFamily:s}=(0,b.Z)((e=>{const t=e("mailpoet-form-editor").getFormSettings(),n=DN(o,e("mailpoet-form-editor").getClosestParentAttribute(r,"backgroundColor"),e("mailpoet-form-editor").getClosestParentAttribute(r,"customBackgroundColor")),i=DN(o,e("mailpoet-form-editor").getClosestParentAttribute(r,"textColor"),e("mailpoet-form-editor").getClosestParentAttribute(r,"customTextColor"));return{backgroundColor:n||t.backgroundColor,fontColor:i||t.fontColor,fontSize:t.fontSize,alignment:t.alignment,fontFamily:t.fontFamily}}),[]),[c,d]=(0,u.useState)(t.content),p=(0,u.useCallback)((0,H.debounce)((e=>{d(e)}),300),[]),m=(0,VI.jsx)(lc,{children:(0,VI.jsx)(QI.Z,{children:(0,VI.jsxs)(Qu.Z,{title:jI.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,VI.jsx)(tT.Z,{label:jI.x.I18n.t("blockCustomHtmlContentLabel"),value:t.content,"data-automation-id":"settings_custom_html_content",rows:4,onChange:e=>{n({content:e}),p(e)}}),(0,VI.jsx)(Is.Z,{label:jI.x.I18n.t("blockCustomHtmlNl2br"),checked:t.nl2br,onChange:e=>n({nl2br:e})})]})})}),h=t.nl2br?["body { white-space: pre-line; }"]:[];h.push(` body {font-family: ${getComputedStyle(document.body).fontFamily};}`),i?h.push(` body {color: ${i};}`):h.push(` body {color: ${getComputedStyle(document.body).color};}`),l?h.push(` body {font-size: ${l}px }`):h.push(` body {font-size: ${getComputedStyle(document.body).fontSize};}`),a&&h.push(` body {text-align: ${a}}`),s&&h.push(` body {font-family: "${s}"}`);const f=`${c}_${h}`;return(0,VI.jsxs)(XB,{className:t.className,children:[m,(0,VI.jsx)("div",{className:"mailpoet-html-block-editor-content-wrapper",children:(0,VI.jsx)(uO.Z,{html:c,styles:h},f)})]})}dO.propTypes={attributes:HI().shape({content:HI().string.isRequired,nl2br:HI().bool.isRequired,className:HI().string}).isRequired,setAttributes:HI().func.isRequired,clientId:HI().string.isRequired};const pO={title:jI.x.I18n.t("blockCustomHtml"),description:jI.x.I18n.t("blockCustomHtmlDescription"),icon:cO,category:"fields",attributes:{content:{type:"string",default:jI.x.I18n.t("blockCustomHtmlDefault")},nl2br:{type:"boolean",default:!0}},supports:{html:!1,multiple:!0},edit:dO,save:()=>null},mO=(0,VI.jsx)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 694 694",children:(0,VI.jsx)(zo.G,{children:(0,VI.jsx)(zo.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"})})}),hO=[{value:"text",label:jI.x.I18n.t("customFieldTypeText")},{value:"textarea",label:jI.x.I18n.t("customFieldTypeTextarea")},{value:"radio",label:jI.x.I18n.t("customFieldTypeRadio")},{value:"checkbox",label:jI.x.I18n.t("customFieldTypeCheckbox")},{value:"select",label:jI.x.I18n.t("customFieldTypeSelect")},{value:"date",label:jI.x.I18n.t("customFieldTypeDate")}];function fO(e){let{dateSettings:t,onSubmit:n}=e;const[r,o]=(0,u.useState)("text"),[i,l]=(0,u.useState)(null),[a,s]=(0,u.useState)({}),c=i&&!(0,H.isEmpty)(a)&&!1!==a.isValid,d=t.dateTypes[0].value,p=t.dateFormats[d][0];return(0,VI.jsxs)("div",{className:"mailpoet_custom_field_add_form","data-automation-id":"create_custom_field_form",children:[(0,VI.jsx)("hr",{}),(0,VI.jsx)(Qv.Z,{label:jI.x.I18n.t("selectCustomFieldType"),options:hO,"data-automation-id":"create_custom_field_type_select",onChange:e=>{s({}),o(e)}}),(0,VI.jsx)(Ju.Z,{label:jI.x.I18n.t("customFieldName"),onChange:l,"data-automation-id":"create_custom_field_name_input"}),(0,VI.jsx)("hr",{}),(()=>{switch(r){case"checkbox":return(0,VI.jsx)(RM,{mandatory:!!a.mandatory&&a.mandatory,isChecked:!!a.isChecked&&a.isChecked,checkboxLabel:a.checkboxLabel?a.checkboxLabel:"",onChange:s});case"date":return(0,VI.jsx)($B,{dateSettings:t,mandatory:!!a.mandatory&&a.mandatory,dateFormat:a.dateFormat?a.dateFormat:p,dateType:a.dateType?a.dateType:d,defaultToday:!!a.defaultToday&&a.defaultToday,onChange:s});case"radio":case"select":return(0,VI.jsx)(CM,{mandatory:!!a.mandatory&&a.mandatory,values:a.values?a.values:[{name:"",id:Math.random().toString()}],onChange:s});default:return(0,VI.jsx)(cA,{mandatory:!!a.mandatory&&a.mandatory,validate:a.validate?a.validate:"",fieldType:r,onChange:s})}})(),(0,VI.jsx)(Ss.Z,{isSecondary:!0,disabled:!c,"data-automation-id":"create_custom_field_submit",onClick:()=>{const e={name:i,type:r,params:QB(r,a)};n(e)},children:jI.x.I18n.t("blockCreateButton")})]})}function gO(e){let{clientId:t}=e;const{createCustomField:n}=(0,y.Z)("mailpoet-form-editor"),r=(0,b.Z)((e=>e("mailpoet-form-editor").getDateSettingsData()),[]),o=(0,b.Z)((e=>e("mailpoet-form-editor").getIsCustomFieldCreating()),[]);return(0,VI.jsx)(vC.Z,{icon:(0,VI.jsx)(pg,{icon:mO,showColors:!0}),label:jI.x.I18n.t("blockAddCustomFieldFormHeading"),className:"mailpoet_custom_field_add_placeholder",children:o?(0,VI.jsx)(ZC.ZP,{}):(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)("p",{children:jI.x.I18n.t("blockAddCustomFieldDescription")}),(0,VI.jsx)(fO,{onSubmit:e=>{n(e,t)},dateSettings:r})]})})}fO.propTypes={dateSettings:HI().shape({dateTypes:HI().arrayOf(HI().shape({label:HI().string,value:HI().string})),dateFormats:HI().objectOf(HI().arrayOf(HI().string)),months:HI().arrayOf(HI().string)}).isRequired,onSubmit:HI().func.isRequired},gO.propTypes={clientId:HI().string.isRequired};const vO={title:jI.x.I18n.t("blockAddCustomField"),description:jI.x.I18n.t("blockAddCustomFieldDescription"),icon:mO,category:"custom-fields",attributes:{},supports:{html:!1,multiple:!1},edit:gO,save:()=>null};var bO=(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"}));function yO(e){let t,{doc:n}=yO;n||(n=document.implementation.createHTMLDocument(""),yO.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 _O=[{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:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...(0,H.omit)(e,["customTextColor","customBackgroundColor"]),style:t,isStackedOnMobile:!0}},save(e){let{attributes:t}=e;const{verticalAlignment:n,backgroundColor:r,customBackgroundColor:o,textColor:i,customTextColor:l}=t,a=Ok("background-color",r),s=Ok("color",i),c=g()({"has-background":r||o,"has-text-color":i||l,[a]:a,[s]:s,[`are-vertically-aligned-${n}`]:n}),d={backgroundColor:a?void 0:o,color:s?void 0:l};return(0,u.createElement)("div",{className:c||void 0,style:d},(0,u.createElement)(dk.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some((e=>/layout-column-\d+/.test(e.originalContent)))&&t.some((e=>void 0!==yO(e.originalContent))),migrate(e,t){const n=t.reduce(((e,t)=>{const{originalContent:n}=t;let r=yO(n);return void 0===r&&(r=0),e[r]||(e[r]=[]),e[r].push(t),e}),[]).map((e=>Ke("core/column",{},e)));return[{...(0,H.omit)(e,["columns"]),isStackedOnMobile:!0},n]},save(e){let{attributes:t}=e;const{columns:n}=t;return(0,u.createElement)("div",{className:`has-${n}-columns`},(0,u.createElement)(dk.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate:(e,t)=>[e={...(0,H.omit)(e,["columns"]),isStackedOnMobile:!0},t],save(e){let{attributes:t}=e;const{verticalAlignment:n,columns:r}=t,o=g()(`has-${r}-columns`,{[`are-vertically-aligned-${n}`]:n});return(0,u.createElement)("div",{className:o},(0,u.createElement)(dk.Content,null))}}];const kO=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function wO(e,t){const{width:n=100/t}=e.attributes;return kO(n)}function xO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>e+wO(n,t)),0)}function CO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>{const r=wO(n,t);return Object.assign(e,{[n.clientId]:r})}),{})}function EO(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;const r=xO(e,n);return(0,H.mapValues)(CO(e,n),(e=>kO(t*e/r)))}function SO(e,t){return e.map((e=>(0,H.merge)({},e,{attributes:{width:`${t[e.clientId]}%`}})))}const IO=["core/column"],TO=(0,dd.Z)(((e,t,n)=>({updateAlignment(r){const{clientId:o,setAttributes:i}=t,{updateBlockAttributes:l}=e(rs),{getBlockOrder:a}=n.select(rs);i({verticalAlignment:r}),a(o).forEach((e=>{l(e,{verticalAlignment:r})}))},updateColumns(r,o){const{clientId:i}=t,{replaceInnerBlocks:l}=e(rs),{getBlocks:a}=n.select(rs);let s=a(i);const c=function(e){return e.every((e=>{var t;const n=e.attributes.width;return Number.isFinite(null!=n&&null!==(t=n.endsWith)&&void 0!==t&&t.call(n,"%")?parseFloat(n):n)}))}(s),u=o>r;if(u&&c){const e=kO(100/o);s=[...SO(s,EO(s,100-e)),...(0,H.times)(o-r,(()=>Ke("core/column",{width:`${e}%`})))]}else u?s=[...s,...(0,H.times)(o-r,(()=>Ke("core/column")))]:(s=s.slice(0,-(r-o)),c&&(s=SO(s,EO(s,100))));l(i,s)}})))((function(e){let{attributes:t,setAttributes:n,updateAlignment:r,updateColumns:o,clientId:i}=e;const{isStackedOnMobile:l,verticalAlignment:a}=t,{count:s}=(0,b.Z)((e=>({count:e(rs).getBlockCount(i)})),[i]),c=uk(Yf({className:g()({[`are-vertically-aligned-${a}`]:a,"is-not-stacked-on-mobile":!l})}),{allowedBlocks:IO,orientation:"horizontal",renderAppender:!1});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(hs,null,(0,u.createElement)(Rc,{onChange:r,value:a})),(0,u.createElement)(lc,null,(0,u.createElement)(Qu.Z,null,(0,u.createElement)(_k.Z,{label:(0,w.__)("Columns"),value:s,onChange:e=>o(s,e),min:1,max:Math.max(6,s)}),s>6&&(0,u.createElement)(gw.Z,{status:"warning",isDismissible:!1},(0,w.__)("This column count exceeds the recommended amount and may cause visual breakage.")),(0,u.createElement)(Is.Z,{label:(0,w.__)("Stack on mobile"),checked:l,onChange:()=>n({isStackedOnMobile:!l})}))),(0,u.createElement)("div",c))}));function NO(e){let{clientId:t,name:n,setAttributes:r}=e;const{blockType:o,defaultVariation:i,variations:l}=(0,b.Z)((e=>{const{getBlockVariations:t,getBlockType:r,getDefaultBlockVariation:o}=e(Rt);return{blockType:r(n),defaultVariation:o(n,"block"),variations:t(n,"block")}}),[n]),{replaceInnerBlocks:a}=(0,y.Z)(rs),s=Yf();return(0,u.createElement)("div",s,(0,u.createElement)(yC,{icon:(0,H.get)(o,["icon","src"]),label:(0,H.get)(o,["title"]),variations:l,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;e.attributes&&r(e.attributes),e.innerBlocks&&a(t,Ye(e.innerBlocks),!0)},allowSkip:!0}))}var BO=[{name:"one-column-full",title:(0,w.__)("100"),description:(0,w.__)("One column"),icon:(0,u.createElement)(zo.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.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,w.__)("50 / 50"),description:(0,w.__)("Two columns; equal split"),icon:(0,u.createElement)(zo.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.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,w.__)("33 / 66"),description:(0,w.__)("Two columns; one-third, two-thirds split"),icon:(0,u.createElement)(zo.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.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,w.__)("66 / 33"),description:(0,w.__)("Two columns; two-thirds, one-third split"),icon:(0,u.createElement)(zo.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.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,w.__)("33 / 33 / 33"),description:(0,w.__)("Three columns; equal split"),icon:(0,u.createElement)(zo.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.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,w.__)("25 / 50 / 25"),description:(0,w.__)("Three columns; wide center column"),icon:(0,u.createElement)(zo.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.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 AO={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2);return Ke("core/columns",{},Ye(e.map((e=>{let{name:n,attributes:r,innerBlocks:o}=e;return["core/column",{width:`${t}%`},[[n,{...r},o]]]}))))},isMatch:e=>{let{length:t}=e;return t&&t<=6}},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:r,textColor:o,style:i,mediaAlt:l,mediaId:a,mediaPosition:s,mediaSizeSlug:c,mediaType:u,mediaUrl:d,mediaWidth:p,verticalAlignment:m}=e;let h;h="image"!==u&&u?["core/video",{id:a,src:d}]:["core/image",{id:a,alt:l,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}%`},[h]],["core/column",{width:100-p+"%"},t]];return"right"===s&&f.reverse(),Ke("core/columns",{align:n,backgroundColor:r,textColor:o,style:i,verticalAlignment:m},Ye(f))}}]};var LO=AO;const PO={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,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}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:{__experimentalDefault:"2em"},margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalLayout:{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}}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:DO}=PO,RO={icon:bO,variations:BO,example:{viewportWidth:600,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,w.__)("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,w.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,w.__)("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,w.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:_O,edit:e=>{const{clientId:t}=e,n=(0,b.Z)((e=>e(rs).getBlocks(t).length>0),[t])?TO:NO;return(0,u.createElement)(n,e)},save:function(e){let{attributes:t}=e;const{isStackedOnMobile:n,verticalAlignment:r}=t,o=g()({[`are-vertically-aligned-${r}`]:r,"is-not-stacked-on-mobile":!n}),i=Yf.save({className:o}),l=uk.save(i);return(0,u.createElement)("div",l)},transforms:LO},MO="core/columns",OO={name:MO,examples:null,deprecated:null,save:()=>null},FO={...PO,...RO,...OO,category:"design",supports:{...PO.supports,anchor:!1}};var jO=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"}));const ZO=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible(e){let{width:t}=e;return isFinite(t)},migrate:e=>({...e,width:`${e.width}%`}),save(e){let{attributes:t}=e;const{verticalAlignment:n,width:r}=t,o=g()({[`is-vertically-aligned-${n}`]:n}),i={flexBasis:r+"%"};return(0,u.createElement)("div",{className:o,style:i},(0,u.createElement)(dk.Content,null))}}];var zO=ZO;const HO={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/column",title:"Column",category:"text",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",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},__experimentalLayout:!0}},{name:VO}=HO,WO={icon:jO,edit:function(e){let{attributes:{verticalAlignment:t,width:n,templateLock:r=!1,allowedBlocks:o},setAttributes:i,clientId:l}=e;const a=g()("block-core-columns",{[`is-vertically-aligned-${t}`]:t}),s=(0,Bs.nj)({availableUnits:Hs("spacing.units")||["%","px","em","rem","vw"]}),{columnsIds:c,hasChildBlocks:d,rootClientId:p}=(0,b.Z)((e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(rs),r=n(l);return{hasChildBlocks:t(l).length>0,rootClientId:r,columnsIds:t(r)}}),[l]),{updateBlockAttributes:m}=(0,y.Z)(rs),h=Number.isFinite(n)?n+"%":n,f=Yf({className:a,style:h?{flexBasis:h}:void 0}),v=c.length,_=c.indexOf(l)+1,k=(0,w.sprintf)((0,w.__)("%1$s (%2$d of %3$d)"),f["aria-label"],_,v),x=uk({...f,"aria-label":k},{templateLock:r,allowedBlocks:o,renderAppender:d?void 0:dk.ButtonBlockAppender});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(hs,null,(0,u.createElement)(Rc,{onChange:e=>{i({verticalAlignment:e}),m(p,{verticalAlignment:null})},value:t})),(0,u.createElement)(lc,null,(0,u.createElement)(Qu.Z,{title:(0,w.__)("Column settings")},(0,u.createElement)(Ls.ZP,{label:(0,w.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:n||"",onChange:e=>{e=0>parseFloat(e)?"0":e,i({width:e})},units:s}))),(0,u.createElement)("div",x))},save:function(e){let{attributes:t}=e;const{verticalAlignment:n,width:r}=t,o=g()({[`is-vertically-aligned-${n}`]:n});let i;if(r&&/\d/.test(r)){let e=Number.isFinite(r)?r+"%":r;if(!Number.isFinite(r)&&null!=r&&r.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(r)*t)/t+"%"}i={flexBasis:e}}const l=Yf.save({className:o,style:i}),a=uk.save(l);return(0,u.createElement)("div",a)},deprecated:zO},UO="core/column",$O={name:UO,examples:null,deprecated:null,save:()=>null},GO={...HO,...WO,...$O,category:"design",supports:{...HO.supports,anchor:!1}};var qO=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"}));const KO={className:!1,anchor:!0},YO={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},JO=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}};return{...(0,H.omit)(e,["customTextColor"]),style:t}},XO=["left","right","center"],QO=e=>{const{align:t,...n}=e;return XO.includes(t)?{...n,textAlign:t}:e};var eF=[{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:YO,isEligible:e=>{let{align:t}=e;return XO.includes(t)},migrate:QO,save(e){let{attributes:t}=e;const{align:n,content:r,level:o}=t,i="h"+o,l=g()({[`has-text-align-${n}`]:n});return(0,u.createElement)(i,Yf.save({className:l}),(0,u.createElement)(WS.Content,{value:r}))}},{supports:KO,attributes:{...YO,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>JO(QO(e)),save(e){let{attributes:t}=e;const{align:n,content:r,customTextColor:o,level:i,textColor:l}=t,a="h"+i,s=Ok("color",l),c=g()({[s]:s,"has-text-color":l||o,[`has-text-align-${n}`]:n});return(0,u.createElement)(WS.Content,{className:c||void 0,tagName:a,style:{color:s?void 0:o},value:r})}},{attributes:{...YO,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>JO(QO(e)),save(e){let{attributes:t}=e;const{align:n,content:r,customTextColor:o,level:i,textColor:l}=t,a="h"+i,s=Ok("color",l),c=g()({[s]:s,[`has-text-align-${n}`]:n});return(0,u.createElement)(WS.Content,{className:c||void 0,tagName:a,style:{color:s?void 0:o},value:r})},supports:KO},{supports:KO,attributes:{...YO,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>JO(QO(e)),save(e){let{attributes:t}=e;const{align:n,level:r,content:o,textColor:i,customTextColor:l}=t,a="h"+r,s=Ok("color",i),c=g()({[s]:s});return(0,u.createElement)(WS.Content,{className:c||void 0,tagName:a,style:{textAlign:n,color:s?void 0:l},value:o})}}];function tF(e){let{level:t,isPressed:n=!1}=e;const r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?(0,u.createElement)(zo.Wj,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:n},(0,u.createElement)(zo.y$,{d:r[t]})):null}const nF=[1,2,3,4,5,6],rF={className:"block-library-heading-level-dropdown"};function oF(e){let{selectedLevel:t,onChange:n}=e;return(0,u.createElement)(fs.Z,{popoverProps:rF,icon:(0,u.createElement)(tF,{level:t}),label:(0,w.__)("Change heading level"),controls:nF.map((e=>{{const r=e===t;return{icon:(0,u.createElement)(tF,{level:e,isPressed:r}),label:(0,w.sprintf)((0,w.__)("Heading %d"),e),isActive:r,onClick(){n(e)},role:"menuitemradio"}}}))})}var iF=n(25454),lF=n.n(iF);const aF={},sF=(e,t)=>{const n=(e=>lF()((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 aF[e];let r=n,o=0;for(;Object.values(aF).includes(r);)o+=1,r=n+"-"+o;return r},cF=(e,t)=>{aF[e]=t};const{name:uF}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,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:!1,color:{link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},dF={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((e=>{let{content:t,anchor:n,align:r}=e;return Ke(uF,{content:t,anchor:n,textAlign:r})}))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;const r={children:t,attributes:n?[]:["style","id"]};return{h1:r,h2:r,h3:r,h4:r,h5:r,h6:r}},transform(e){const t=lr(uF,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),Ke(uF,t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>Ke(uF,{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:t=>Ke(uF,{level:e,content:t})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((e=>{let{content:t,textAlign:n}=e;return Ke("core/paragraph",{content:t,align:n})}))}]};var pF=dF;const mF={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,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:!1,color:{link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:hF}=mF,fF={icon:qO,example:{attributes:{content:(0,w.__)("Code is Poetry"),level:2}},__experimentalLabel(e,t){let{context:n}=t;const{content:r,level:o}=e;return"list-view"===n&&r?r:"accessibility"===n?(0,H.isEmpty)(r)?(0,w.sprintf)((0,w.__)("Level %s. Empty."),o):(0,w.sprintf)((0,w.__)("Level %1$s. %2$s"),o,r):void 0},transforms:pF,deprecated:eF,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function(e){let{attributes:t,setAttributes:n,mergeBlocks:r,onReplace:o,style:i,clientId:l}=e;const{textAlign:a,content:s,level:c,placeholder:d,anchor:p}=t,m="h"+c,h=Yf({className:g()({[`has-text-align-${a}`]:a}),style:i}),{canGenerateAnchors:f}=(0,b.Z)((e=>{const{getGlobalBlockCount:t,getSettings:n}=e(rs);return{canGenerateAnchors:!!n().generateAnchors||t("core/table-of-contents")>0}}),[]),{__unstableMarkNextChangeAsNotPersistent:v}=(0,y.Z)(rs);return(0,u.useEffect)((()=>{if(f)return!p&&s&&(v(),n({anchor:sF(l,s)})),cF(l,p),()=>cF(l,null)}),[p,s,l,f]),(0,u.createElement)(u.Fragment,null,(0,u.createElement)(hs,{group:"block"},(0,u.createElement)(oF,{selectedLevel:c,onChange:e=>n({level:e})}),(0,u.createElement)(gC,{value:a,onChange:e=>{n({textAlign:e})}})),(0,u.createElement)(WS,(0,bo.Z)({identifier:"content",tagName:m,value:s,onChange:e=>{const t={content:e};!f||p&&e&&sF(l,s)!==p||(t.anchor=sF(l,e)),n(t)},onMerge:r,onSplit:(e,n)=>{let r;var o;return r=n||e?Ke("core/heading",{...t,content:e}):Ke(null!==(o=ze())&&void 0!==o?o:"core/heading"),n&&(r.clientId=l),r},onReplace:o,onRemove:()=>o([]),"aria-label":(0,w.__)("Heading text"),placeholder:d||(0,w.__)("Heading"),textAlign:a},Zo.Z.isNative&&{deleteEnter:!0},h)))},save:function(e){let{attributes:t}=e;const{textAlign:n,content:r,level:o}=t,i="h"+o,l=g()({[`has-text-align-${n}`]:n});return(0,u.createElement)(i,Yf.save({className:l}),(0,u.createElement)(WS.Content,{value:r}))}},gF="core/heading",vF={name:gF,examples:null,deprecated:null,save:()=>null},bF={...mF,...fF,...vF,category:"design",supports:{...mF.supports,html:!1}};var yF=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"}));const _F={className:!1},kF={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"}},wF=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};return(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}),{...(0,H.omit)(e,["customTextColor","customBackgroundColor","customFontSize"]),style:t}},xF=[{supports:_F,attributes:{...(0,H.omit)(kF,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:wF,save(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,backgroundColor:i,textColor:l,customBackgroundColor:a,customTextColor:s,fontSize:c,customFontSize:d,direction:p}=t,m=Ok("color",l),h=Ok("background-color",i),f=rx(c),v=g()({"has-text-color":l||s,"has-background":i||a,"has-drop-cap":o,[`has-text-align-${n}`]:n,[f]:f,[m]:m,[h]:h}),b={backgroundColor:h?void 0:a,color:m?void 0:s,fontSize:f?void 0:d};return(0,u.createElement)(WS.Content,{tagName:"p",style:b,className:v||void 0,value:r,dir:p})}},{supports:_F,attributes:{...(0,H.omit)(kF,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:wF,save(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,backgroundColor:i,textColor:l,customBackgroundColor:a,customTextColor:s,fontSize:c,customFontSize:d,direction:p}=t,m=Ok("color",l),h=Ok("background-color",i),f=rx(c),v=g()({"has-text-color":l||s,"has-background":i||a,"has-drop-cap":o,[f]:f,[m]:m,[h]:h}),b={backgroundColor:h?void 0:a,color:m?void 0:s,fontSize:f?void 0:d,textAlign:n};return(0,u.createElement)(WS.Content,{tagName:"p",style:b,className:v||void 0,value:r,dir:p})}},{supports:_F,attributes:{...(0,H.omit)(kF,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:wF,save(e){let{attributes:t}=e;const{width:n,align:r,content:o,dropCap:i,backgroundColor:l,textColor:a,customBackgroundColor:s,customTextColor:c,fontSize:d,customFontSize:p}=t,m=Ok("color",a),h=Ok("background-color",l),f=d&&`is-${d}-text`,v=g()({[`align${n}`]:n,"has-background":l||s,"has-drop-cap":i,[f]:f,[m]:m,[h]:h}),b={backgroundColor:h?void 0:s,color:m?void 0:c,fontSize:f?void 0:p,textAlign:r};return(0,u.createElement)(WS.Content,{tagName:"p",style:b,className:v||void 0,value:o})}},{supports:_F,attributes:(0,H.omit)({...kF,fontSize:{type:"number"}},["style"]),save(e){let{attributes:t}=e;const{width:n,align:r,content:o,dropCap:i,backgroundColor:l,textColor:a,fontSize:s}=t,c=g()({[`align${n}`]:n,"has-background":l,"has-drop-cap":i}),d={backgroundColor:l,color:a,fontSize:s,textAlign:r};return(0,u.createElement)("p",{style:d,className:c||void 0},o)},migrate:e=>wF((0,H.omit)({...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:_F,attributes:{...kF,content:{type:"string",source:"html",default:""}},save(e){let{attributes:t}=e;return(0,u.createElement)(Kt.Z,null,t.content)},migrate:e=>e}];var CF=xF,EF=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,u.createElement)(zo.y$,{d:"M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"}));function SF(e){const{batch:t}=(0,bg.Z)(),{moveBlocksToPosition:n,replaceInnerBlocks:r,duplicateBlocks:o,insertBlock:i}=(0,y.Z)(rs),{getBlockRootClientId:l,getBlockIndex:a,getBlockOrder:s,getBlockName:c,getBlock:d,getNextBlockClientId:p}=(0,b.Z)(rs),m=(0,u.useRef)(e);return m.current=e,(0,Ps.Z)((e=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode!==Uf.ENTER)return;const{content:u,clientId:h}=m.current;if(u.length)return;const f=l(h);if(!Ue(c(f),"__experimentalOnEnter",!1))return;const g=s(f);e.preventDefault();const v=g.indexOf(h);if(v===g.length-1)return void n([h],f,l(f),a(f)+1);const b=d(f);t((()=>{o([f]);const e=a(f);r(f,b.innerBlocks.slice(0,v)),r(p(f),b.innerBlocks.slice(v+1)),i(Ke("core/paragraph"),e+1,l(f),!0)}))}return e.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u)}}),[])}function IF(e){let{direction:t,setDirection:n}=e;return(0,w.isRTL)()&&(0,u.createElement)(By.Z,{icon:EF,title:(0,w._x)("Left to right","editor button"),isActive:"ltr"===t,onClick:()=>{n("ltr"===t?void 0:"ltr")}})}const{name:TF}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",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:{link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},NF={from:[{type:"raw",priority:20,selector:"p",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;return{p:{children:t,attributes:n?[]:["style","id"]}}},transform(e){const t=lr(TF,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),Ke(TF,t)}}]};var BF=NF;const AF={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",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:{link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:LF}=AF,PF={icon:yF,example:{attributes:{content:(0,w.__)("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."),style:{typography:{fontSize:28}},dropCap:!0}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{content:t}=e;return(0,H.isEmpty)(t)?(0,w.__)("Empty"):t}},transforms:BF,deprecated:CF,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function(e){let{attributes:t,mergeBlocks:n,onReplace:r,onRemove:o,setAttributes:i,clientId:l}=e;const{align:a,content:s,direction:c,dropCap:d,placeholder:p}=t,m=Hs("typography.dropCap"),h=Yf({ref:SF({clientId:l,content:s}),className:g()({"has-drop-cap":d,[`has-text-align-${a}`]:a}),style:{direction:c}});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(hs,{group:"block"},(0,u.createElement)(gC,{value:a,onChange:e=>i({align:e})}),(0,u.createElement)(IF,{direction:c,setDirection:e=>i({direction:e})})),m&&(0,u.createElement)(lc,{__experimentalGroup:"typography"},(0,u.createElement)(Vs.Z,{hasValue:()=>!!d,label:(0,w.__)("Drop cap"),onDeselect:()=>i({dropCap:void 0}),resetAllFilter:()=>({dropCap:void 0}),panelId:l},(0,u.createElement)(Is.Z,{label:(0,w.__)("Drop cap"),checked:!!d,onChange:()=>i({dropCap:!d}),help:d?(0,w.__)("Showing large initial letter."):(0,w.__)("Toggle to show a large initial letter.")}))),(0,u.createElement)(WS,(0,bo.Z)({identifier:"content",tagName:"p"},h,{value:s,onChange:e=>i({content:e}),onSplit:(e,n)=>{let r;(n||e)&&(r={...t,content:e});const o=Ke("core/paragraph",r);return n&&(o.clientId=l),o},onMerge:n,onReplace:r,onRemove:o,"aria-label":s?(0,w.__)("Paragraph block"):(0,w.__)("Empty block; start writing or type forward slash to choose a block"),"data-empty":!s,placeholder:p||(0,w.__)("Type / to choose a block"),__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})))},save:function(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,direction:i}=t,l=g()({"has-drop-cap":o,[`has-text-align-${n}`]:n});return(0,u.createElement)("p",Yf.save({className:l,dir:i}),(0,u.createElement)(WS.Content,{value:r}))}},DF="core/paragraph",RF={name:DF,examples:null,deprecated:null,save:()=>null},MF={...AF,...PF,...RF,category:"design",supports:{...AF.supports,html:!1,anchor:!1}};var OF=(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"}));const FF={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"}},jF={anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0,__experimentalDefaultControls:{radius:!0}}},ZF=[{attributes:FF,supports:jF,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:d,id:p,linkTarget:m,sizeSlug:h,title:f}=t,v=(0,H.isEmpty)(a)?void 0:a,b=g()({[`align${i}`]:i,[`size-${h}`]:h,"is-resized":c||d}),y=(0,u.createElement)("img",{src:n,alt:r,className:p?`wp-image-${p}`:null,width:c,height:d,title:f}),_=(0,u.createElement)(u.Fragment,null,l?(0,u.createElement)("a",{className:s,href:l,target:m,rel:v},y):y,!WS.isEmpty(o)&&(0,u.createElement)(WS.Content,{tagName:"figcaption",value:o}));return(0,u.createElement)("figure",Yf.save({className:b}),_)}},{attributes:{...FF,title:{type:"string",source:"attribute",selector:"img",attribute:"title"},sizeSlug:{type:"string"}},supports:jF,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:d,id:p,linkTarget:m,sizeSlug:h,title:f}=t,v=(0,H.isEmpty)(a)?void 0:a,b=g()({[`align${i}`]:i,[`size-${h}`]:h,"is-resized":c||d}),y=(0,u.createElement)("img",{src:n,alt:r,className:p?`wp-image-${p}`:null,width:c,height:d,title:f}),_=(0,u.createElement)(u.Fragment,null,l?(0,u.createElement)("a",{className:s,href:l,target:m,rel:v},y):y,!WS.isEmpty(o)&&(0,u.createElement)(WS.Content,{tagName:"figcaption",value:o}));return"left"===i||"right"===i||"center"===i?(0,u.createElement)("div",Yf.save(),(0,u.createElement)("figure",{className:b},_)):(0,u.createElement)("figure",Yf.save({className:b}),_)}},{attributes:FF,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s,id:c}=t,d=g()({[`align${i}`]:i,"is-resized":a||s}),p=(0,u.createElement)("img",{src:n,alt:r,className:c?`wp-image-${c}`:null,width:a,height:s});return(0,u.createElement)("figure",{className:d},l?(0,u.createElement)("a",{href:l},p):p,!WS.isEmpty(o)&&(0,u.createElement)(WS.Content,{tagName:"figcaption",value:o}))}},{attributes:FF,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s,id:c}=t,d=(0,u.createElement)("img",{src:n,alt:r,className:c?`wp-image-${c}`:null,width:a,height:s});return(0,u.createElement)("figure",{className:i?`align${i}`:null},l?(0,u.createElement)("a",{href:l},d):d,!WS.isEmpty(o)&&(0,u.createElement)(WS.Content,{tagName:"figcaption",value:o}))}},{attributes:FF,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s}=t,c=a||s?{width:a,height:s}:{},d=(0,u.createElement)("img",(0,bo.Z)({src:n,alt:r},c));let p={};return a?p={width:a}:"left"!==i&&"right"!==i||(p={maxWidth:"50%"}),(0,u.createElement)("figure",{className:i?`align${i}`:null,style:p},l?(0,u.createElement)("a",{href:l},d):d,!WS.isEmpty(o)&&(0,u.createElement)(WS.Content,{tagName:"figcaption",value:o}))}}];var zF=ZF,HF=n(20297),VF=n(95322),WF=n(5114),UF=n(75349),$F=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"})),GF=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"}));const qF=[{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"}],KF="wp-embed";var YF=n(41779),JF=n.n(YF);const{name:XF}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,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"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0,__experimentalStyle:{spacing:{margin:"0 0 1em 0"}}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},QF=e=>{var t;return null===(t=Ge(XF))||void 0===t?void 0:t.find((t=>{let{patterns:n}=t;return function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).some((t=>e.match(t)))}(e,n)}))},ej=e=>e&&e.includes('class="wp-embedded-content"'),tj=e=>{if(!e)return e;const t=qF.reduce(((e,t)=>{let{className:n}=t;return e[n]=!1,e}),{"wp-has-aspect-ratio":!1});return JF()(e,t)};function nj(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n)return tj(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<qF.length;n++){const r=qF[n];if(e>=r.ratio)return e-r.ratio>.1?tj(t):JF()(tj(t),r.className,"wp-has-aspect-ratio")}}return t}Yn()((function(e,t,n,r){let o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!e)return{};const i={};let{type:l="rich"}=e;const{html:a,provider_name:s}=e,c=(0,H.kebabCase)((s||t).toLowerCase());return ej(a)&&(l=KF),(a||"photo"===l)&&(i.type=l,i.providerNameSlug=c),i.className=nj(a,n,r&&o),i}));const rj="none",oj="media",ij="attachment",lj="custom",aj=["image"];function sj(e){var t,n;let{temporaryURL:r,attributes:o,setAttributes:i,isSelected:l,insertBlocksAfter:a,onReplace:s,onSelectImage:c,onSelectURL:d,onUploadError:p,containerRef:m,context:h,clientId:f}=e;const{url:g="",alt:_,caption:k,align:x,id:C,href:E,rel:S,linkClass:I,linkDestination:T,title:N,width:B,height:A,linkTarget:L,sizeSlug:P}=o,D=(0,u.useRef)(),R=(0,u.useRef)(),O=(0,WF.Z)(g),{allowResize:F=!0}=h,{getBlock:j}=(0,b.Z)(rs),{image:Z,multiImageSelection:z}=(0,b.Z)((e=>{const{getMedia:t}=e(v.h),{getMultiSelectedBlockClientIds:n,getBlockName:r}=e(rs),o=n();return{image:C&&l?t(C,{context:"view"}):null,multiImageSelection:o.length&&o.every((e=>"core/image"===r(e)))}}),[C,l]),{canInsertCover:V,imageEditing:W,imageSizes:U,maxWidth:$,mediaUpload:G}=(0,b.Z)((e=>{const{getBlockRootClientId:t,getSettings:n,canInsertBlockType:r}=e(rs),o=t(f);return{...(0,H.pick)(n(),["imageEditing","imageSizes","maxWidth","mediaUpload"]),canInsertCover:r("core/cover",o)}}),[f]),{replaceBlocks:q,toggleSelection:K}=(0,y.Z)(rs),{createErrorNotice:Y,createSuccessNotice:J}=(0,y.Z)(tb.h),X=(0,ad.Z)("medium"),Q=(0,H.includes)(["wide","full"],x),[{loadedNaturalWidth:ee,loadedNaturalHeight:te},ne]=(0,u.useState)({}),[re,oe]=(0,u.useState)(!1),[ie,le]=(0,u.useState)(),ae=function(e,t){const[n,r]=(0,u.useState)();function o(){r(e.current.clientWidth)}return(0,u.useEffect)(o,t),(0,u.useEffect)((()=>{const{defaultView:t}=e.current.ownerDocument;return t.addEventListener("resize",o),()=>{t.removeEventListener("resize",o)}}),[]),n}(m,[x]),se=F&&!(Q&&X),ce=(0,H.map)((0,H.filter)(U,(e=>{let{slug:t}=e;return(0,H.get)(Z,["media_details","sizes",t,"source_url"])})),(e=>{let{name:t,slug:n}=e;return{value:n,label:t}}));(0,u.useEffect)((()=>{cj(C,g)&&l&&!ie&&window.fetch(g).then((e=>e.blob())).then((e=>le(e))).catch((()=>{}))}),[C,g,l,ie]),(0,u.useEffect)((()=>{g&&!O&&l&&R.current.focus()}),[g,O]);const{naturalWidth:ue,naturalHeight:de}=(0,u.useMemo)((()=>{var e,t;return{naturalWidth:(null===(e=D.current)||void 0===e?void 0:e.naturalWidth)||ee||void 0,naturalHeight:(null===(t=D.current)||void 0===t?void 0:t.naturalHeight)||te||void 0}}),[ee,te,null===(t=D.current)||void 0===t?void 0:t.complete]);(0,u.useEffect)((()=>{l||oe(!1)}),[l]);const pe=C&&ue&&de&&W,me=!z&&pe&&!re,he=(0,u.createElement)(u.Fragment,null,(0,u.createElement)(hs,{group:"block"},(0,u.createElement)(Uu,{value:x,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};i({...t,align:e})}}),!z&&!re&&(0,u.createElement)(tI,{url:E||"",onChangeUrl:function(e){i(e)},linkDestination:T,mediaUrl:Z&&Z.source_url||g,mediaLink:Z&&Z.link,linkTarget:L,linkClass:I,rel:S}),me&&(0,u.createElement)(By.Z,{onClick:()=>oe(!0),icon:$F,label:(0,w.__)("Crop")}),ie&&(0,u.createElement)(By.Z,{onClick:function(){G({filesList:[ie],onFileChange(e){let[t]=e;c(t),M(t.url)||(le(),J((0,w.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:aj,onError(e){Y(e,{type:"snackbar"})}})},icon:KE.Z,label:(0,w.__)("Upload external image")}),!z&&V&&(0,u.createElement)(By.Z,{icon:GF,label:(0,w.__)("Add text over image"),onClick:function(){q(f,lt(j(f),"core/cover"))}})),!z&&!re&&(0,u.createElement)(hs,{group:"other"},(0,u.createElement)(tS,{mediaId:C,mediaURL:g,allowedTypes:aj,accept:"image/*",onSelect:c,onSelectURL:d,onError:p})),(0,u.createElement)(lc,null,(0,u.createElement)(Qu.Z,{title:(0,w.__)("Settings")},!z&&(0,u.createElement)(tT.Z,{label:(0,w.__)("Alt text (alternative text)"),value:_,onChange:function(e){i({alt:e})},help:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Xu.Z,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,w.__)("Describe the purpose of the image")),(0,w.__)("Leave empty if the image is purely decorative."))}),(0,u.createElement)(rE,{onChangeImage:function(e){const t=(0,H.get)(Z,["media_details","sizes",e,"source_url"]);if(!t)return null;i({url:t,width:void 0,height:void 0,sizeSlug:e})},onChange:e=>i(e),slug:P,width:B,height:A,imageSizeOptions:ce,isResizable:se,imageWidth:ue,imageHeight:de}))),(0,u.createElement)(lc,{__experimentalGroup:"advanced"},(0,u.createElement)(Ju.Z,{label:(0,w.__)("Title attribute"),value:N||"",onChange:function(e){i({title:e})},help:(0,u.createElement)(u.Fragment,null,(0,w.__)("Describe the role of this image on the page."),(0,u.createElement)(Xu.Z,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"},(0,w.__)("(Note: many devices and browsers do not display this text.)")))}))),fe=(0,UF.v)(g);let ge;ge=_||(fe?(0,w.sprintf)((0,w.__)("This image has an empty alt attribute; its file name is %s"),fe):(0,w.__)("This image has an empty alt attribute"));const ve=cC(o),be=null===(n=o.className)||void 0===n?void 0:n.includes("is-style-rounded"),ye=!!ve.className||!(0,H.isEmpty)(ve.style);let _e,ke,we=(0,u.createElement)(u.Fragment,null,(0,u.createElement)("img",{src:r||g,alt:ge,onError:()=>function(){const e=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{preview:r,attributes:o={}}=e,{url:i,providerNameSlug:l,type:a,...s}=o;if(!i||!He(XF))return;const c=QF(i),u="wordpress"===l||a===KF;if(!u&&c&&(c.attributes.providerNameSlug!==l||!l))return Ke(XF,{url:i,...s,...c.attributes});const d=null===(t=Ge(XF))||void 0===t?void 0:t.find((e=>{let{name:t}=e;return"wordpress"===t}));return d&&r&&ej(r.html)&&!u?Ke(XF,{url:i,...d.attributes,...n}):void 0}({attributes:{url:g}});void 0!==e&&s(e)}(),onLoad:e=>{var t,n;ne({loadedNaturalWidth:null===(t=e.target)||void 0===t?void 0:t.naturalWidth,loadedNaturalHeight:null===(n=e.target)||void 0===n?void 0:n.naturalHeight})},ref:D,className:ve.className,style:ve.style}),r&&(0,u.createElement)(ZC.ZP,null));if(ae&&ue&&de){const e=ue>ae,t=de/ue;_e=e?ae:ue,ke=e?ae*t:de}if(pe&&re)we=(0,u.createElement)(eE,{borderProps:be?void 0:ve,url:g,width:B,height:A,clientWidth:ae,naturalHeight:de,naturalWidth:ue});else if(se&&_e){const e=B||_e,t=A||ke,n=ue/de,r=ue<de?20:20*n,o=de<ue?20:20/n,a=2.5*$;let s=!1,c=!1;"center"===x?(s=!0,c=!0):(0,w.isRTL)()?"left"===x?s=!0:c=!0:"right"===x?c=!0:s=!0,we=(0,u.createElement)(VF.Z,{size:{width:null!=B?B:"auto",height:A&&!ye?A:"auto"},showHandle:l,minWidth:r,maxWidth:a,minHeight:o,maxHeight:a/n,lockAspectRatio:!0,enable:{top:!1,right:s,bottom:!0,left:c},onResizeStart:function(){K(!1)},onResizeStop:(n,r,o,l)=>{K(!0),i({width:parseInt(e+l.width,10),height:parseInt(t+l.height,10)})}},we)}else we=(0,u.createElement)("div",{style:{width:B,height:A}},we);return(0,u.createElement)(WC,{id:C,url:g,naturalWidth:ue,naturalHeight:de,clientWidth:ae,onSaveImage:e=>i(e),isEditing:re,onFinishEditing:()=>oe(!1)},!r&&he,we,(!WS.isEmpty(k)||l)&&(0,u.createElement)(WS,{className:OI("caption"),ref:R,tagName:"figcaption","aria-label":(0,w.__)("Image caption text"),placeholder:(0,w.__)("Add caption"),value:k,onChange:e=>i({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>a(Ke(ze()))}))}const cj=(e,t)=>t&&!e&&!M(t);var uj=(0,HF.Z)((function(e){let{attributes:t,setAttributes:n,isSelected:r,className:o,noticeUI:i,insertBlocksAfter:l,noticeOperations:a,onReplace:s,context:c,clientId:d}=e;const{url:p="",alt:m,caption:h,align:f,id:v,width:y,height:_,sizeSlug:k}=t,[x,C]=(0,u.useState)(),E=(0,u.useRef)();(0,u.useEffect)((()=>{E.current=m}),[m]);const S=(0,u.useRef)();(0,u.useEffect)((()=>{S.current=h}),[h]);const I=(0,u.useRef)(),{imageDefaultSize:T,mediaUpload:N}=(0,b.Z)((e=>{const{getSettings:t}=e(rs);return(0,H.pick)(t(),["imageDefaultSize","mediaUpload"])}),[]);function B(e){a.removeAllNotices(),a.createErrorNotice(e),n({src:void 0,id:void 0,url:void 0}),C(void 0)}function A(e){var r,o,i,l,a,s;if(!e||!e.url)return void n({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0});if(M(e.url))return void C(e.url);C();let c,u=((e,t)=>{const n=(0,H.pick)(e,["alt","id","link","caption"]);return n.url=(0,H.get)(e,["sizes",t,"url"])||(0,H.get)(e,["media_details","sizes",t,"source_url"])||e.url,n})(e,T);var d,m;S.current&&!(0,H.get)(u,["caption"])&&(u=(0,H.omit)(u,["caption"])),c=e.id&&e.id===v?{url:p}:{width:void 0,height:void 0,sizeSlug:(d=e,m=T,(0,H.has)(d,["sizes",m,"url"])||(0,H.has)(d,["media_details","sizes",m,"source_url"])?T:"full")};let h,f=t.linkDestination;if(!f)switch((null===(r=window)||void 0===r||null===(o=r.wp)||void 0===o||null===(i=o.media)||void 0===i||null===(l=i.view)||void 0===l||null===(a=l.settings)||void 0===a||null===(s=a.defaultProps)||void 0===s?void 0:s.link)||rj){case"file":case oj:f=oj;break;case"post":case ij:f=ij;break;case lj:f=lj;break;case rj:f=rj}switch(f){case oj:h=e.url;break;case ij:h=e.link}u.href=h,n({...u,...c,linkDestination:f})}function L(e){e!==p&&n({url:e,id:void 0,width:void 0,height:void 0,sizeSlug:T})}let D=((e,t)=>!e&&M(t))(v,p);(0,u.useEffect)((()=>{if(!D)return;const e=function(e){return P[e]}(p);e&&N({filesList:[e],onFileChange:e=>{let[t]=e;A(t)},allowedTypes:aj,onError:e=>{D=!1,B(e)}})}),[]),(0,u.useEffect)((()=>{D?C(p):R(x)}),[D,p]);const O=cj(v,p)?p:void 0,F=!!p&&(0,u.createElement)("img",{alt:(0,w.__)("Edit image"),title:(0,w.__)("Edit image"),className:"edit-image-preview",src:p}),j=cC(t),Z=Yf({ref:I,className:g()(o,{"is-transient":x,"is-resized":!!y||!!_,[`size-${k}`]:k,"has-custom-border":!!j.className||!(0,H.isEmpty)(j.style)})});return(0,u.createElement)("figure",Z,(x||p)&&(0,u.createElement)(sj,{temporaryURL:x,attributes:t,setAttributes:n,isSelected:r,insertBlocksAfter:l,onReplace:s,onSelectImage:A,onSelectURL:L,onUploadError:B,containerRef:I,context:c,clientId:d}),!p&&(0,u.createElement)(hs,{group:"block"},(0,u.createElement)(Uu,{value:f,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};n({...t,align:e})}})),(0,u.createElement)(sS,{icon:(0,u.createElement)(pg,{icon:OF}),onSelect:A,onSelectURL:L,notices:i,onError:B,accept:"image/*",allowedTypes:aj,value:{id:v,src:O},mediaPreview:F,disableMediaButtons:x||p}))}));function dj(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 pj={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},mj={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:e=>{let{phrasingContentSchema:t}=e;return{figure:{require:["img"],children:{...pj,a:{attributes:["href","rel","target"],children:pj},figcaption:{children:t}}}}},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),l=i?Number(i[1]):void 0,a=e.querySelector("a"),s=a&&a.href?"custom":void 0,c=a&&a.href?a.href:void 0,u=a&&a.rel?a.rel:void 0,d=a&&a.className?a.className:void 0;return Ke("core/image",lr("core/image",e.outerHTML,{align:o,id:l,linkDestination:s,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,z.dispatch)(tb.h);e((0,w.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-transform-invalid-file"})}return(0,H.every)(e,(e=>0===e.type.indexOf("image/")))},transform:e=>e.map((e=>Ke("core/image",{url:D(e)})))},{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,t){let{shortcode:n}=t;const{body:r}=document.implementation.createHTMLDocument("");r.innerHTML=n.content;let o=r.querySelector("img");for(;o&&o.parentNode&&o.parentNode!==r;)o=o.parentNode;return o&&o.parentNode.removeChild(o),r.innerHTML.trim()}},href:{shortcode:(e,t)=>{let{shortcode:n}=t;return dj(n.content,"href")}},rel:{shortcode:(e,t)=>{let{shortcode:n}=t;return dj(n.content,"rel")}},linkClass:{shortcode:(e,t)=>{let{shortcode:n}=t;return dj(n.content,"class")}},id:{type:"number",shortcode:e=>{let{named:{id:t}}=e;if(t)return parseInt(t.replace("attachment_",""),10)}},align:{type:"string",shortcode:e=>{let{named:{align:t="alignnone"}}=e;return t.replace("align","")}}}}]};var hj=mj;const fj={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,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"},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:{color:!0,radius:!0,width:!0,__experimentalSelector:"img, .wp-block-image__crop-area",__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},__experimentalStyle:{spacing:{margin:"0 0 1em 0"}}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"},{name:gj}=fj,vj={icon:OF,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,w.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{caption:t,alt:n,url:r}=e;return r?n?n+(t?". "+t:""):t||"":(0,w.__)("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:hj,edit:uj,save:function(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:d,id:p,linkTarget:m,sizeSlug:h,title:f}=t,v=(0,H.isEmpty)(a)?void 0:a,b=sC(t),y=g()({[`align${i}`]:i,[`size-${h}`]:h,"is-resized":c||d,"has-custom-border":!!b.className||!(0,H.isEmpty)(b.style)}),_=g()(b.className,{[`wp-image-${p}`]:!!p}),k=(0,u.createElement)("img",{src:n,alt:r,className:_||void 0,style:b.style,width:c,height:d,title:f}),w=(0,u.createElement)(u.Fragment,null,l?(0,u.createElement)("a",{className:s,href:l,target:m,rel:v},k):k,!WS.isEmpty(o)&&(0,u.createElement)(WS.Content,{className:OI("caption"),tagName:"figcaption",value:o}));return(0,u.createElement)("figure",Yf.save({className:y}),w)},deprecated:zF},bj="core/image",yj={name:bj,examples:null,deprecated:null,save:()=>null},_j={...fj,...vj,...yj,category:"design",supports:{...fj.supports,html:!1,anchor:!1}},kj=e=>{const t=ZM(e);if(!t[e.type])return null;const n=zB(t[e.type].name,e);return Oe(n,t[e.type].settings),n},wj=e=>{let t=null;return Array.isArray(e.errors)&&e.errors.length>0&&(t=e.errors.map((e=>e.message)),t=t.join(", ")),t},xj=(e,t)=>e.map((e=>{const n=t(e);return e.innerBlocks?{...n,innerBlocks:xj(e.innerBlocks,t)}:n})),Cj={async SAVE_FORM(){if((0,z.select)("mailpoet-form-editor").getIsFormSaving())return;if((0,z.dispatch)("mailpoet-form-editor").saveFormStarted(),(0,z.select)("mailpoet-form-editor").getFormErrors().length)return;const e=(0,z.select)("mailpoet-form-editor").getFormData(),t=(0,z.select)("mailpoet-form-editor").getFormBlocks(),n=(0,z.select)("mailpoet-form-editor").getAllAvailableCustomFields(),r=ON(Eo.fontSizes,Eo.colors,Eo.gradients,n),o={...FN(e),body:r(t),editor_version:2};await jI.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"saveEditor",data:o}).done((e=>{(0,z.dispatch)("mailpoet-form-editor").saveFormDone(e.data.id),OB.remove(`popup_form_dismissed_${e.data.id}`,{path:"/"})})).fail((e=>{(0,z.dispatch)("mailpoet-form-editor").saveFormFailed(wj(e))}))},async SAVE_CUSTOM_FIELD(e){(0,z.dispatch)("mailpoet-form-editor").saveCustomFieldStarted();const t=(0,z.select)("mailpoet-form-editor").getAllAvailableCustomFields().find((t=>t.id===e.customFieldId)),n={};(0,H.merge)(n,t,e.data),await jI.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((n=>{(0,z.dispatch)("mailpoet-form-editor").saveCustomFieldDone(t.id,n.data),"function"==typeof e.onFinish&&e.onFinish()})).then((()=>{(0,z.dispatch)("mailpoet-form-editor").saveForm()})).fail((e=>{(0,z.dispatch)("mailpoet-form-editor").saveCustomFieldFailed(wj(e))}))},async CREATE_CUSTOM_FIELD(e){const{clientId:t,data:n}=e;(0,z.select)("mailpoet-form-editor").getIsCustomFieldCreating()||((0,z.dispatch)("mailpoet-form-editor").createCustomFieldStarted(e.data),(0,z.select)("mailpoet-form-editor").getIsCustomFieldCreating()&&await jI.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((e=>{const n=e.data;jI.x.trackEvent("Forms > Add new custom field",{"Field type":n.type});const r=Ke(kj(n));(0,z.dispatch)("core/block-editor").replaceBlock(t,r),(0,z.dispatch)("mailpoet-form-editor").createCustomFieldDone(e.data)})).fail((e=>{(0,z.dispatch)("mailpoet-form-editor").createCustomFieldFailed(wj(e))})))},async DELETE_CUSTOM_FIELD(e){const{customFieldId:t,clientId:n}=e;(0,z.dispatch)("mailpoet-form-editor").deleteCustomFieldStarted();const r=(0,z.select)("mailpoet-form-editor").getAllAvailableCustomFields().find((e=>e.id===t)),o=ZM(r);await jI.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"delete",data:{id:t}}).then((()=>{jI.x.trackEvent("Forms > Delete custom field",{"Field type":r.type}),(0,z.dispatch)("mailpoet-form-editor").deleteCustomFieldDone(t,n);const e=zB(o[r.type].name,r);He(e)&&function(e){const t=(0,z.select)(Rt).getBlockType(e);if(t)return(0,z.dispatch)(Rt).removeBlockTypes(e),t;console.error('Block "'+e+'" is not registered.')}(e),(0,z.dispatch)("core/block-editor").removeBlock(n)})).fail((e=>{(0,z.dispatch)("mailpoet-form-editor").deleteCustomFieldFailed(wj(e))}))},APPLY_STYLES_TO_ALL_TEXT_INPUTS(e){const t=(0,z.select)("mailpoet-form-editor").getFormBlocks(),n=xj(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,z.dispatch)("core/block-editor").resetBlocks(n)},async TUTORIAL_DISMISS(){await jI.x.Ajax.post({api_version:jI.x.apiVersion,endpoint:"user_flags",action:"set",data:{form_editor_tutorial_seen:1}})},BLOCKS_CHANGED_IN_BLOCK_EDITOR(e){const t=e.blocks,n=xB(t,"mailpoet-form/email-input"),r=xB(t,"mailpoet-form/submit-button");if(n&&r)return void(0,z.dispatch)("mailpoet-form-editor").changeFormBlocks(t);const o=(0,z.select)("mailpoet-form-editor").getFormBlocks(),i=[...t];if(!n){let e=xB(o,"mailpoet-form/email-input");e||(e=Ke("mailpoet-form/email-input")),i.unshift(e)}if(!r){let e=xB(o,"mailpoet-form/submit-button");e||(e=Ke("mailpoet-form/submit-button")),i.push(e)}(0,z.dispatch)("core/block-editor").resetBlocks(i)},STORE_LOCALLY(e){const{key:t,value:n}=e;window.localStorage.setItem(t,JSON.stringify(n))},CALL_API:FB.t,ENSURE_BROWSER_URL(e){const{formId:t}=e;let n=(0,z.select)("mailpoet-form-editor").getFormEditorUrl();n=`${n}${t}`,window.location.href!==n&&window.history.replaceState(null,"",n)}};function Ej(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,h,f,g,v,b,y,_,k,w,x,C,E,S,I,T,N,B,A,L,P,D,R,M,O,F,j,Z,z,H,V,W,U,$,G,q,K,Y,J,X,Q,ee,te,ne,re,oe,ie,le,ae,se,ce,ue,de,pe,me,he,fe,ge,ve,be,ye,_e,ke,we,xe,Ce,Ee,Se,Ie,Te,Ne,Be,Ae,Le,Pe,De,Re,Me,Oe,Fe,je,Ze,ze,He,Ve,We,Ue,$e,Ge,qe,Ke,Ye,Je,Xe,Qe,et,tt,nt,rt,ot,it,lt,at,st,ct,ut,dt,pt,mt,ht,ft,gt,vt,bt,yt,_t,kt,wt,xt,Ct,Et,St,It,Tt,Nt,Bt,At,Lt,Pt,Dt,Rt,Mt;const Ot={...e,settings:{...e.settings,formPlacement:{popup:{enabled:"1"===(null===(t=e.settings.form_placement)||void 0===t||null===(n=t.popup)||void 0===n?void 0:n.enabled),exitIntentEnabled:"1"===(null===(r=e.settings.form_placement)||void 0===r||null===(o=r.popup)||void 0===o?void 0:o.exit_intent_enabled),delay:void 0!==(null===(i=e.settings.form_placement)||void 0===i||null===(l=i.popup)||void 0===l?void 0:l.delay)?nA(null===(a=e.settings.form_placement)||void 0===a||null===(s=a.popup)||void 0===s?void 0:s.delay):ST.formDelay,cookieExpiration:void 0!==(null===(c=e.settings.form_placement)||void 0===c||null===(u=c.popup)||void 0===u?void 0:u.cookieExpiration)?nA(null===(d=e.settings.form_placement)||void 0===d||null===(p=d.popup)||void 0===p?void 0:p.cookieExpiration):ST.formCookieExpiration,animation:void 0!==(null===(m=e.settings.form_placement)||void 0===m||null===(h=m.popup)||void 0===h?void 0:h.animation)?null===(f=e.settings.form_placement)||void 0===f||null===(g=f.popup)||void 0===g?void 0:g.animation:ST.animation,styles:{...ST.styles,...null===(v=e.settings.form_placement)||void 0===v||null===(b=v.popup)||void 0===b?void 0:b.styles},categories:(null===(y=e.settings.form_placement)||void 0===y||null===(_=y.popup)||void 0===_?void 0:_.categories)??[],tags:(null===(k=e.settings.form_placement)||void 0===k||null===(w=k.popup)||void 0===w?void 0:w.tags)??[],posts:{all:"1"===(null===(x=e.settings.form_placement)||void 0===x||null===(C=x.popup)||void 0===C||null===(E=C.posts)||void 0===E?void 0:E.all),selected:Array.isArray(null===(S=e.settings.form_placement)||void 0===S||null===(I=S.popup)||void 0===I||null===(T=I.posts)||void 0===T?void 0:T.selected)?null===(N=e.settings.form_placement)||void 0===N||null===(B=N.popup)||void 0===B||null===(A=B.posts)||void 0===A?void 0:A.selected:[]},pages:{all:"1"===(null===(L=e.settings.form_placement)||void 0===L||null===(P=L.popup)||void 0===P||null===(D=P.pages)||void 0===D?void 0:D.all),selected:Array.isArray(null===(R=e.settings.form_placement)||void 0===R||null===(M=R.popup)||void 0===M||null===(O=M.pages)||void 0===O?void 0:O.selected)?null===(F=e.settings.form_placement)||void 0===F||null===(j=F.popup)||void 0===j||null===(Z=j.pages)||void 0===Z?void 0:Z.selected:[]}},fixedBar:{enabled:"1"===(null===(z=e.settings.form_placement)||void 0===z||null===(H=z.fixed_bar)||void 0===H?void 0:H.enabled),delay:void 0!==(null===(V=e.settings.form_placement)||void 0===V||null===(W=V.fixed_bar)||void 0===W?void 0:W.delay)?nA(null===(U=e.settings.form_placement)||void 0===U||null===($=U.fixed_bar)||void 0===$?void 0:$.delay):IT.formDelay,cookieExpiration:void 0!==(null===(G=e.settings.form_placement)||void 0===G||null===(q=G.fixed_bar)||void 0===q?void 0:q.cookieExpiration)?nA(null===(K=e.settings.form_placement)||void 0===K||null===(Y=K.fixed_bar)||void 0===Y?void 0:Y.cookieExpiration):IT.formCookieExpiration,animation:(null===(J=e.settings.form_placement)||void 0===J||null===(X=J.fixed_bar)||void 0===X?void 0:X.animation)??IT.animation,styles:{...IT.styles,...null===(Q=e.settings.form_placement)||void 0===Q||null===(ee=Q.fixed_bar)||void 0===ee?void 0:ee.styles},position:(null===(te=e.settings.form_placement)||void 0===te||null===(ne=te.fixed_bar)||void 0===ne?void 0:ne.position)??IT.position,categories:(null===(re=e.settings.form_placement)||void 0===re||null===(oe=re.fixed_bar)||void 0===oe?void 0:oe.categories)??[],tags:(null===(ie=e.settings.form_placement)||void 0===ie||null===(le=ie.fixed_bar)||void 0===le?void 0:le.tags)??[],posts:{all:"1"===(null===(ae=e.settings.form_placement)||void 0===ae||null===(se=ae.fixed_bar)||void 0===se||null===(ce=se.posts)||void 0===ce?void 0:ce.all),selected:Array.isArray(null===(ue=e.settings.form_placement)||void 0===ue||null===(de=ue.fixed_bar)||void 0===de||null===(pe=de.posts)||void 0===pe?void 0:pe.selected)?null===(me=e.settings.form_placement)||void 0===me||null===(he=me.fixed_bar)||void 0===he||null===(fe=he.posts)||void 0===fe?void 0:fe.selected:[]},pages:{all:"1"===(null===(ge=e.settings.form_placement)||void 0===ge||null===(ve=ge.fixed_bar)||void 0===ve||null===(be=ve.pages)||void 0===be?void 0:be.all),selected:Array.isArray(null===(ye=e.settings.form_placement)||void 0===ye||null===(_e=ye.fixed_bar)||void 0===_e||null===(ke=_e.pages)||void 0===ke?void 0:ke.selected)?null===(we=e.settings.form_placement)||void 0===we||null===(xe=we.fixed_bar)||void 0===xe||null===(Ce=xe.pages)||void 0===Ce?void 0:Ce.selected:[]}},belowPosts:{enabled:"1"===(null===(Ee=e.settings.form_placement)||void 0===Ee||null===(Se=Ee.below_posts)||void 0===Se?void 0:Se.enabled),styles:{...CT,...null===(Ie=e.settings.form_placement)||void 0===Ie||null===(Te=Ie.below_posts)||void 0===Te?void 0:Te.styles},categories:(null===(Ne=e.settings.form_placement)||void 0===Ne||null===(Be=Ne.below_posts)||void 0===Be?void 0:Be.categories)??[],tags:(null===(Ae=e.settings.form_placement)||void 0===Ae||null===(Le=Ae.below_posts)||void 0===Le?void 0:Le.tags)??[],posts:{all:"1"===(null===(Pe=e.settings.form_placement)||void 0===Pe||null===(De=Pe.below_posts)||void 0===De||null===(Re=De.posts)||void 0===Re?void 0:Re.all),selected:Array.isArray(null===(Me=e.settings.form_placement)||void 0===Me||null===(Oe=Me.below_posts)||void 0===Oe||null===(Fe=Oe.posts)||void 0===Fe?void 0:Fe.selected)?null===(je=e.settings.form_placement)||void 0===je||null===(Ze=je.below_posts)||void 0===Ze||null===(ze=Ze.posts)||void 0===ze?void 0:ze.selected:[]},pages:{all:"1"===(null===(He=e.settings.form_placement)||void 0===He||null===(Ve=He.below_posts)||void 0===Ve||null===(We=Ve.pages)||void 0===We?void 0:We.all),selected:Array.isArray(null===(Ue=e.settings.form_placement)||void 0===Ue||null===($e=Ue.below_posts)||void 0===$e||null===(Ge=$e.pages)||void 0===Ge?void 0:Ge.selected)?null===(qe=e.settings.form_placement)||void 0===qe||null===(Ke=qe.below_posts)||void 0===Ke||null===(Ye=Ke.pages)||void 0===Ye?void 0:Ye.selected:[]}},slideIn:{enabled:"1"===(null===(Je=e.settings.form_placement)||void 0===Je||null===(Xe=Je.slide_in)||void 0===Xe?void 0:Xe.enabled),delay:void 0!==(null===(Qe=e.settings.form_placement)||void 0===Qe||null===(et=Qe.slide_in)||void 0===et?void 0:et.delay)?nA(null===(tt=e.settings.form_placement)||void 0===tt||null===(nt=tt.slide_in)||void 0===nt?void 0:nt.delay):NT.formDelay,cookieExpiration:void 0!==(null===(rt=e.settings.form_placement)||void 0===rt||null===(ot=rt.slide_in)||void 0===ot?void 0:ot.cookieExpiration)?nA(null===(it=e.settings.form_placement)||void 0===it||null===(lt=it.slide_in)||void 0===lt?void 0:lt.cookieExpiration):NT.formCookieExpiration,position:(null===(at=e.settings.form_placement)||void 0===at||null===(st=at.slide_in)||void 0===st?void 0:st.position)??NT.position,animation:(null===(ct=e.settings.form_placement)||void 0===ct||null===(ut=ct.slide_in)||void 0===ut?void 0:ut.animation)??NT.animation,styles:{...NT.styles,...null===(dt=e.settings.form_placement)||void 0===dt||null===(pt=dt.slide_in)||void 0===pt?void 0:pt.styles},categories:(null===(mt=e.settings.form_placement)||void 0===mt||null===(ht=mt.slide_in)||void 0===ht?void 0:ht.categories)??[],tags:(null===(ft=e.settings.form_placement)||void 0===ft||null===(gt=ft.slide_in)||void 0===gt?void 0:gt.tags)??[],posts:{all:"1"===(null===(vt=e.settings.form_placement)||void 0===vt||null===(bt=vt.slide_in)||void 0===bt||null===(yt=bt.posts)||void 0===yt?void 0:yt.all),selected:Array.isArray(null===(_t=e.settings.form_placement)||void 0===_t||null===(kt=_t.slide_in)||void 0===kt||null===(wt=kt.posts)||void 0===wt?void 0:wt.selected)?null===(xt=e.settings.form_placement)||void 0===xt||null===(Ct=xt.slide_in)||void 0===Ct||null===(Et=Ct.posts)||void 0===Et?void 0:Et.selected:[]},pages:{all:"1"===(null===(St=e.settings.form_placement)||void 0===St||null===(It=St.slide_in)||void 0===It||null===(Tt=It.pages)||void 0===Tt?void 0:Tt.all),selected:Array.isArray(null===(Nt=e.settings.form_placement)||void 0===Nt||null===(Bt=Nt.slide_in)||void 0===Bt||null===(At=Bt.pages)||void 0===At?void 0:At.selected)?null===(Lt=e.settings.form_placement)||void 0===Lt||null===(Pt=Lt.slide_in)||void 0===Pt||null===(Dt=Pt.pages)||void 0===Dt?void 0:Dt.selected:[]}},others:{styles:{...TT,...null===(Rt=e.settings.form_placement)||void 0===Rt||null===(Mt=Rt.others)||void 0===Mt?void 0:Mt.styles}}},alignment:e.settings.alignment??BT.alignment,borderRadius:void 0!==e.settings.border_radius?nA(e.settings.border_radius):BT.borderRadius,borderSize:void 0!==e.settings.border_size?nA(e.settings.border_size):BT.borderSize,formPadding:void 0!==e.settings.form_padding?nA(e.settings.form_padding):BT.formPadding,inputPadding:void 0!==e.settings.input_padding?nA(e.settings.input_padding):BT.inputPadding,borderColor:e.settings.border_color,fontFamily:e.settings.font_family,fontSize:e.settings.fontSize&&nA(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??BT.closeButton}};return Ot.settings.formPlacement.belowPosts.styles.width.value=nA(Ot.settings.formPlacement.belowPosts.styles.width.value),Ot.settings.formPlacement.slideIn.styles.width.value=nA(Ot.settings.formPlacement.slideIn.styles.width.value),Ot.settings.formPlacement.fixedBar.styles.width.value=nA(Ot.settings.formPlacement.fixedBar.styles.width.value),Ot.settings.formPlacement.popup.styles.width.value=nA(Ot.settings.formPlacement.popup.styles.width.value),Ot.settings.formPlacement.others.styles.width.value=nA(Ot.settings.formPlacement.others.styles.width.value),delete Ot.settings.border_radius,delete Ot.settings.border_size,delete Ot.settings.border_color,delete Ot.settings.input_padding,delete Ot.settings.form_padding,delete Ot.settings.close_button,delete Ot.settings.font_family,delete Ot.settings.background_image_display,delete Ot.settings.background_image_url,Ot}const Sj=(0,pd.Z)((0,ud.Z)(((e,t)=>{if(Ue(t.name,"multiple",!0))return{};const n=e(rs).getBlocks(),r=(0,H.find)(n,(e=>{let{name:n}=e;return t.name===n}));return{originalBlockClientId:r&&r.clientId!==t.clientId&&r.clientId}})),(0,dd.Z)(((e,t)=>{let{originalBlockClientId:n}=t;return{selectFirst:()=>e(rs).selectBlock(n)}}))),Ij=(0,yo.o)((e=>Sj((t=>{let{originalBlockClientId:n,selectFirst:r,...o}=t;if(!n)return(0,u.createElement)(e,o);const i=He(o.name),l=function(e){const t=rt(ot("to",e),(e=>{let{type:t,blocks:n}=e;return"block"===t&&1===n.length}));return t?He(t.blocks[0]):null}(o.name);return[(0,u.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,u.createElement)(e,(0,bo.Z)({key:"block-edit"},o))),(0,u.createElement)(Cd,{key:"multiple-use-warning",actions:[(0,u.createElement)(Ss.Z,{key:"find-original",variant:"secondary",onClick:r},(0,w.__)("Find original")),(0,u.createElement)(Ss.Z,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,w.__)("Remove")),l&&(0,u.createElement)(Ss.Z,{key:"transform",variant:"secondary",onClick:()=>o.onReplace(Ke(l.name,o.attributes))},(0,w.__)("Transform into:")," ",l.title)]},(0,u.createElement)("strong",null,null==i?void 0:i.title,": "),(0,w.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,_e.KJ)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",Ij);var Tj=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"}));const Nj="core/bold",Bj=(0,w.__)("Bold"),Aj={name:Nj,title:Bj,tagName:"strong",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r((0,Vo.h4)(n,{type:Nj,title:Bj}))}return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(US,{type:"primary",character:"b",onUse:i}),(0,u.createElement)($S,{name:"bold",icon:Tj,title:Bj,onClick:function(){r((0,Vo.h4)(n,{type:Nj})),o()},isActive:t,shortcutType:"primary",shortcutCharacter:"b"}),(0,u.createElement)(GS,{inputType:"formatBold",onInput:i}))}};var Lj=(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));const Pj="core/code",Dj=(0,w.__)("Inline code"),Rj={name:Pj,title:Dj,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:n}=e;if("`"!==n.slice(t-1,t))return e;const r=n.slice(0,t-1).lastIndexOf("`");if(-1===r)return e;const o=r,i=t-2;return o===i?e:(e=(0,Vo.Od)(e,o,o+1),e=(0,Vo.Od)(e,i,i+1),e=(0,Vo.HI)(e,{type:Pj},o,i))},edit(e){let{value:t,onChange:n,onFocus:r,isActive:o}=e;function i(){n((0,Vo.h4)(t,{type:Pj,title:Dj})),r()}return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(US,{type:"access",character:"x",onUse:i}),(0,u.createElement)($S,{icon:Lj,title:Dj,onClick:i,isActive:o,role:"menuitemcheckbox"}))}},Mj=["image"],Oj="core/image",Fj=(0,w.__)("Inline image"),jj={name:Oj,title:Fj,keywords:[(0,w.__)("photo"),(0,w.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function(e){let{value:t,onChange:n,onFocus:r,isObjectActive:o,activeObjectAttributes:i,contentRef:l}=e;const[a,s]=(0,u.useState)(!1);function c(){s(!1)}return(0,u.createElement)(XE,null,(0,u.createElement)($S,{icon:(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.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:Fj,onClick:function(){s(!0)},isActive:o}),a&&(0,u.createElement)(JE,{allowedTypes:Mj,onSelect:e=>{let{id:o,url:i,alt:l,width:a}=e;c(),n((0,Vo.Qf)(t,{type:Oj,attributes:{className:`wp-image-${o}`,style:`width: ${Math.min(a,150)}px;`,url:i,alt:l}})),r()},onClose:c,render:e=>{let{open:t}=e;return t(),null}}),o&&(0,u.createElement)(Zj,{value:t,onChange:n,activeObjectAttributes:i,contentRef:l}))}};function Zj(e){let{value:t,onChange:n,activeObjectAttributes:r,contentRef:o}=e;const{style:i}=r,[l,a]=(0,u.useState)(null==i?void 0:i.replace(/\D/g,"")),s=(0,Vo.uT)({ref:o,value:t,settings:jj});return(0,u.createElement)(k.Z,{position:"bottom center",focusOnMount:!1,anchorRef:s,className:"block-editor-format-toolbar__image-popover"},(0,u.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:e=>{const o=t.replacements.slice();o[t.start]={type:Oj,attributes:{...r,style:l?`width: ${l}px;`:""}},n({...t,replacements:o}),e.preventDefault()}},(0,u.createElement)(Ju.Z,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:(0,w.__)("Width"),value:l,min:1,onChange:e=>a(e)}),(0,u.createElement)(Ss.Z,{icon:oE,label:(0,w.__)("Apply"),type:"submit"})))}var zj=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M12.5 5L10 19h1.9l2.5-14z"}));const Hj="core/italic",Vj=(0,w.__)("Italic"),Wj={name:Hj,title:Vj,tagName:"em",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r((0,Vo.h4)(n,{type:Hj,title:Vj}))}return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(US,{type:"primary",character:"i",onUse:i}),(0,u.createElement)($S,{name:"italic",icon:zj,title:Vj,onClick:function(){r((0,Vo.h4)(n,{type:Hj})),o()},isActive:t,shortcutType:"primary",shortcutCharacter:"i"}),(0,u.createElement)(GS,{inputType:"formatItalic",onInput:i}))}};var Uj=n(31301),$j=n(38314),Gj=n(19887),qj=n(90587),Kj=n(41547),Yj=n(22751),Jj=n(10957),Xj=n(69289),Qj=n(31520),eZ=n(36471);function tZ(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,NE.E)(t);if(!(0,$j.M)(e))return!1;if(e.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,Gj.C)(t);if(!(0,qj.x)(n))return!1;const r=(0,Kj.D)(t);if(r&&!(0,Yj.t)(r))return!1;const o=(0,Jj.W)(t);if(o&&!(0,Xj.A)(o))return!1;const i=(0,Qj.S)(t);if(i&&!(0,eZ.Z)(i))return!1}return!(t.startsWith("#")&&!(0,eZ.Z)(t))}function nZ(e,t,n,r,o){let i=t;const l={forwards:1,backwards:-1}[o]||1,a=-1*l;for(;e[i]&&e[i][r]===n;)i+=l;return i+=a,i}const rZ=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e(...r,...n)}},oZ=rZ(nZ,"backwards"),iZ=rZ(nZ,"forwards"),lZ=new WeakMap;let aZ=-1;function sZ(e){return`link-control-instance-${e}`}var cZ=(0,cE.Z)((function(e){let{isActive:t,activeAttributes:n,addingLink:r,value:o,onChange:i,speak:l,stopAddingLink:a,contentRef:s}=e;const c=function(e,t){let n=e.start,r=e.end;if(t){const t=function(e,t){var n,r,o;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const a={start:null,end:null},{formats:s}=e;let c,u;if(null==s||!s.length)return a;const d=s.slice(),p=null===(n=d[i])||void 0===n?void 0:n.find((e=>{let{type:n}=e;return n===t.type})),m=null===(r=d[l])||void 0===r?void 0:r.find((e=>{let{type:n}=e;return n===t.type})),h=null===(o=d[l-1])||void 0===o?void 0:o.find((e=>{let{type:n}=e;return n===t.type}));if(p)c=p,u=i;else if(m)c=m,u=l;else{if(!h)return a;c=h,u=l-1}const f=d[u].indexOf(c),g=[d,u,c,f];return i=oZ(...g),l=iZ(...g),i=i<0?0:i,{start:i,end:l}}(e,{type:"core/link"});n=t.start,r=t.end+1}return(0,Vo.tP)(e,n,r)}(o,t),d=c.text,[p,m]=(0,u.useState)(),{createPageEntity:h,userCanCreatePages:f}=(0,b.Z)((e=>{const{getSettings:t}=e(rs),n=t();return{createPageEntity:n.__experimentalCreatePageEntity,userCanCreatePages:n.__experimentalUserCanCreatePages}}),[]),g={url:n.url,type:n.type,id:n.id,opensInNewTab:"_blank"===n.target,title:d,...p},v=(0,Vo.uT)({ref:s,value:o,settings:pZ}),y=function(e){if(e)return lZ.has(e)?sZ(lZ.get(e)):(aZ+=1,lZ.set(e,aZ),sZ(aZ))}(v),_=(0,u.useRef)(!!r&&"firstElement");return(0,u.createElement)(k.Z,{anchorRef:v,focusOnMount:_.current,onClose:a,position:"bottom center",__unstableShift:!0},(0,u.createElement)($E,{key:y,value:g,onChange:function(e){e={...p,...e};const n=g.opensInNewTab!==e.opensInNewTab&&g.url===e.url,r=n&&void 0===e.url;if(m(r?e:void 0),r)return;const s=(0,BE.u)(e.url),c=function(e){let{url:t,type:n,id:r,opensInNewWindow:o}=e;const i={type:"core/link",attributes:{url:t}};return n&&(i.attributes.type=n),r&&(i.attributes.id=r),o&&(i.attributes.target="_blank",i.attributes.rel="noreferrer noopener"),i}({url:s,type:e.type,id:void 0!==e.id&&null!==e.id?String(e.id):void 0,opensInNewWindow:e.opensInNewTab}),u=e.title||s;if((0,Vo.zb)(o)&&!t){const e=(0,Vo.HI)((0,Vo.Ue)({text:u}),c,0,u.length);i((0,Vo.$T)(o,e))}else{let e;u===d?e=(0,Vo.HI)(o,c):(e=(0,Vo.Ue)({text:u}),e=(0,Vo.HI)(e,c,0,u.length),e=(0,Vo.gx)(o,d,e)),e.start=e.end,e.activeFormats=[],i(e)}n||a(),tZ(s)?l(t?(0,w.__)("Link edited."):(0,w.__)("Link inserted."),"assertive"):l((0,w.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=(0,Vo.Ir)(o,"core/link");i(e),a(),l((0,w.__)("Link removed."),"assertive")},forceIsEditingLink:r,hasRichPreviews:!0,createSuggestion:h&&async function(e){const t=await h({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:f,createSuggestionButtonText:function(e){return(0,lg.Z)((0,w.sprintf)((0,w.__)("Create Page: <mark>%s</mark>"),e),{mark:(0,u.createElement)("mark",null)})},hasTextControl:!0}))}));const uZ="core/link",dZ=(0,w.__)("Link"),pZ={name:uZ,title:dZ,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,t){let{html:n,plainText:r}=t;if((0,Vo.zb)(e))return e;const o=(n||r).replace(/<[^>]+>/g,"").trim();return(0,mE.P)(o)?(window.console.log("Created link:\n\n",o),(0,Vo.HI)(e,{type:uZ,attributes:{url:(0,gn.decodeEntities)(o)}})):e},edit:function(e){let{isActive:t,activeAttributes:n,value:r,onChange:o,onFocus:i,contentRef:l}=e;const[a,s]=(0,u.useState)(!1);function c(){const e=(0,Vo.FB)((0,Vo.tP)(r));e&&(0,mE.P)(e)&&tZ(e)?o((0,Vo.HI)(r,{type:uZ,attributes:{url:e}})):e&&(0,Uj.J)(e)?o((0,Vo.HI)(r,{type:uZ,attributes:{url:`mailto:${e}`}})):s(!0)}function d(){o((0,Vo.Ir)(r,uZ)),(0,$l.D)((0,w.__)("Link removed."),"assertive")}return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(US,{type:"primary",character:"k",onUse:c}),(0,u.createElement)(US,{type:"primaryShift",character:"k",onUse:d}),t&&(0,u.createElement)($S,{name:"link",icon:Nk.Z,title:(0,w.__)("Unlink"),onClick:d,isActive:t,shortcutType:"primaryShift",shortcutCharacter:"k"}),!t&&(0,u.createElement)($S,{name:"link",icon:Tk.Z,title:dZ,onClick:c,isActive:t,shortcutType:"primary",shortcutCharacter:"k"}),(a||t)&&(0,u.createElement)(cZ,{addingLink:a,stopAddingLink:function(){s(!1),i()},isActive:t,activeAttributes:n,value:r,onChange:o,contentRef:l}))}},mZ="core/strikethrough",hZ=(0,w.__)("Strikethrough"),fZ={name:mZ,title:hZ,tagName:"s",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r((0,Vo.h4)(n,{type:mZ,title:hZ})),o()}return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(US,{type:"access",character:"d",onUse:i}),(0,u.createElement)($S,{icon:mx,title:hZ,onClick:i,isActive:t,role:"menuitemcheckbox"}))}},gZ="core/underline",vZ=(0,w.__)("Underline"),bZ={name:gZ,title:vZ,tagName:"span",className:null,attributes:{style:"style"},edit(e){let{value:t,onChange:n}=e;const r=()=>{n((0,Vo.h4)(t,{type:gZ,attributes:{style:"text-decoration: underline;"},title:vZ}))};return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(US,{type:"primary",character:"u",onUse:r}),(0,u.createElement)(GS,{inputType:"formatUnderline",onInput:r}))}};var yZ=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"}));function _Z(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(";").reduce(((e,t)=>{if(t){const[n,r]=t.split(":");"color"===n&&(e.color=r),"background-color"===n&&r!==EZ&&(e.backgroundColor=r)}return e}),{})}function kZ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e.split(" ").reduce(((e,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const r=n.replace(/^has-/,"").replace(/-color$/,""),o=Rk(t,r);e.color=o.color}return e}),{})}function wZ(e,t,n){const r=(0,Vo.Ye)(e,t);return r?{..._Z(r.attributes.style),...kZ(r.attributes.class,n)}:{}}function xZ(e){let{name:t,property:n,value:r,onChange:o}=e;const i=(0,b.Z)((e=>{const{getSettings:t}=e(rs);return(0,H.get)(t(),["colors"],[])}),[]),l=(0,u.useCallback)((e=>{o(function(e,t,n,r){const{color:o,backgroundColor:i}={...wZ(e,t,n),...r};if(!o&&!i)return(0,Vo.Ir)(e,t);const l=[],a=[],s={};if(i?l.push(["background-color",i].join(":")):l.push(["background-color",EZ].join(":")),o){const e=Mk(n,o);e?a.push(Ok("color",e.slug)):l.push(["color",o].join(":"))}return l.length&&(s.style=l.join(";")),a.length&&(s.class=a.join(" ")),(0,Vo.HI)(e,{type:t,attributes:s})}(r,t,i,{[n]:e}))}),[i,o,n]),a=(0,u.useMemo)((()=>wZ(r,t,i)),[t,r,i]);return(0,u.createElement)(_C,{value:a[n],onChange:l})}function CZ(e){let{name:t,value:n,onChange:r,onClose:o,contentRef:i}=e;const l=function(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}((0,Vo.uT)({ref:i,value:n,settings:BZ}));return(0,u.createElement)(k.Z,{onClose:o,className:"components-inline-color-popover",anchorRef:l},(0,u.createElement)(Zb.Z,{tabs:[{name:"color",title:(0,w.__)("Text")},{name:"backgroundColor",title:(0,w.__)("Background")}]},(e=>(0,u.createElement)(xZ,{name:t,property:e.name,value:n,onChange:r}))))}const EZ="rgba(0, 0, 0, 0)",SZ="core/text-color",IZ=(0,w.__)("Highlight"),TZ=[];function NZ(e,t){const{ownerDocument:n}=e,{defaultView:r}=n,o=r.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&o===EZ&&e.parentElement?NZ(e.parentElement,t):o}const BZ={name:SZ,title:IZ,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",EZ].join(":");return t?[n,t].join(";"):n},edit:function(e){let{value:t,onChange:n,isActive:r,activeAttributes:o,contentRef:i}=e;const l=Hs("color.custom"),a=Hs("color.palette")||TZ,[s,c]=(0,u.useState)(!1),d=(0,u.useCallback)((()=>c(!0)),[c]),p=(0,u.useCallback)((()=>c(!1)),[c]),m=(0,u.useMemo)((()=>function(e,t){let{color:n,backgroundColor:r}=t;if(n||r)return{color:n||NZ(e,"color"),backgroundColor:r===EZ?NZ(e,"background-color"):r}}(i.current,wZ(t,SZ,a))),[t,a]),h=!(0,H.isEmpty)(a)||!l;return h||r?(0,u.createElement)(u.Fragment,null,(0,u.createElement)($S,{className:"format-library-text-color-button",isActive:r,icon:(0,u.createElement)(qc.Z,{icon:yZ,style:m}),title:IZ,onClick:h?d:()=>n((0,Vo.Ir)(t,SZ)),role:"menuitemcheckbox"}),s&&(0,u.createElement)(CZ,{name:SZ,onClose:p,activeAttributes:o,value:t,onChange:n,contentRef:i})):null}};var AZ=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"}));const LZ="core/subscript",PZ=(0,w.__)("Subscript"),DZ={name:LZ,title:PZ,tagName:"sub",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,u.createElement)($S,{icon:AZ,title:PZ,onClick:function(){r((0,Vo.h4)(n,{type:LZ,title:PZ})),o()},isActive:t,role:"menuitemcheckbox"})}};var RZ=(0,u.createElement)(zo.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(zo.y$,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"}));const MZ="core/superscript",OZ=(0,w.__)("Superscript"),FZ={name:MZ,title:OZ,tagName:"sup",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,u.createElement)($S,{icon:RZ,title:OZ,onClick:function(){r((0,Vo.h4)(n,{type:MZ,title:OZ})),o()},isActive:t,role:"menuitemcheckbox"})}};var jZ=(0,u.createElement)(zo.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(zo.y$,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"}));const ZZ="core/keyboard",zZ=(0,w.__)("Keyboard input");[Aj,Rj,jj,Wj,pZ,fZ,bZ,BZ,DZ,FZ,{name:ZZ,title:zZ,tagName:"kbd",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,u.createElement)($S,{icon:jZ,title:zZ,onClick:function(){r((0,Vo.h4)(n,{type:ZZ,title:zZ})),o()},isActive:t,role:"menuitemcheckbox"})}}].forEach((e=>{let{name:t,...n}=e;return(0,Vo.Sy)(t,n)}));const HZ="mailpoet-form/font-selection",VZ=["core/paragraph","core/heading"],WZ={name:HZ,title:"Font Selection",tagName:"span",className:"mailpoet-has-font",attributes:{style:"style",font:"data-font"},edit:function(e){let{value:t,onChange:n,activeAttributes:r}=e;const o=(0,b.Z)((e=>e("core/block-editor").getSelectedBlock()),[]);return VZ.includes(o.name)?(0,VI.jsx)(ms,{children:(0,VI.jsx)("div",{className:"mailpoet_toolbar_item",children:(0,VI.jsx)(LT,{value:r.font,onChange:e=>{n((0,Vo.HI)(t,{type:"mailpoet-form/font-selection",attributes:{style:`font-family: ${e}`,font:e}}))},name:jI.x.I18n.t("formSettingsStylesFontFamily"),hideLabelFromVision:!0})})}):null}};var UZ=n(22058),$Z=n(29449),GZ=n(15317),qZ=n(58125),KZ=n(93878),YZ=n(20360);function JZ(){const e=[{name:"popup",label:jI.x.I18n.t("popupCategory")},{name:"slide_in",label:jI.x.I18n.t("slideInCategory")},{name:"fixed_bar",label:jI.x.I18n.t("fixedBarCategory")},{name:"below_posts",label:jI.x.I18n.t("belowPagesCategory")},{name:"others",label:jI.x.I18n.t("othersCategory")}],t=(0,b.Z)((e=>e("mailpoet-form-editor-templates").getSelectedCategory()),[]),n=(0,b.Z)((e=>e("mailpoet-form-editor-templates").getTemplates()),[]),r=(0,b.Z)((e=>e("mailpoet-form-editor-templates").getLoading()),[]),o=(0,b.Z)((e=>e("mailpoet-form-editor-templates").getSelectTemplateFailed()),[]),{selectTemplate:i,selectCategory:l}=(0,y.Z)("mailpoet-form-editor-templates");return(0,VI.jsxs)(VI.Fragment,{children:[e.map((e=>n[e.name].map(((e,t)=>t<4&&(0,VI.jsx)("link",{rel:"preload",href:e.thumbnail,as:"image"},`thumbnail_prefetch_${e.id}`))))),(0,VI.jsxs)("div",{className:"mailpoet-template-selection-header",children:[(0,VI.jsx)(JI.X,{level:4,children:jI.x.I18n.t("selectTemplate")}),(0,VI.jsx)(KZ.Button,{automationId:"create_blank_form",onClick:()=>{i("initial_form","Blank template")},children:jI.x.I18n.t("createBlankTemplate")})]}),o&&(0,VI.jsx)(YZ.q,{type:"error",scroll:!0,renderInPlace:!0,children:(0,VI.jsx)("p",{children:jI.x.I18n.t("createFormError")})}),(0,VI.jsxs)("div",{"data-automation-id":"template_selection_list",children:[(0,VI.jsx)($Z.A,{color:"#fff"}),(0,VI.jsxs)("div",{className:"mailpoet-templates",children:[(0,VI.jsx)(UZ.R,{categories:e,active:t,onSelect:l}),n[t].map((e=>(0,VI.jsx)(qZ.G,{onSelect:()=>{i(e.id,e.name)},label:e.name,automationId:`select_template_${e.id}`,className:"mailpoet-form-template",children:(0,VI.jsx)("div",{className:"mailpoet-template-thumbnail",children:(0,VI.jsx)("img",{src:e.thumbnail,alt:e.name,width:"480",height:"317",loading:"lazy"})})},e.id)))]})]}),r&&(0,VI.jsx)(GZ.g,{})]})}const XZ={getTemplates:e=>e.templates,getFormEditorUrl:e=>e.formEditorUrl,getSelectTemplateFailed:e=>e.selectTemplateFailed,getLoading:e=>e.loading,getSelectedCategory:e=>e.activeCategory},QZ=e=>({...e,selectTemplateFailed:!0,loading:!1}),ez=e=>({...e,selectTemplateFailed:!1,loading:!0}),tz=(e,t)=>({...e,activeCategory:t.category}),nz=e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"SELECT_TEMPLATE_ERROR":return QZ(t);case"SELECT_TEMPLATE_START":return ez(t);case"SELECT_CATEGORY":return tz(t,n);default:return t}};function*rz(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,z.select)("mailpoet-form-editor-templates").getFormEditorUrl();return window.location.href=`${n}${e}`,{}}function oz(e){return{type:"SELECT_CATEGORY",category:e}}async function iz(e){const t=e.name,n=e.data,r=e.timeout??0;return jI.x.trackEvent(t,n),o=r,new Promise((e=>{setTimeout(e,o)}));var o}let lz;function az(){return(0,VI.jsx)(m.k.Provider,{value:(0,m.S)(window),children:(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(h.w,{}),(0,VI.jsx)(JZ,{})]})})}!function(e){e.Popup="popup",e.SlideIn="slide_in",e.FixedBar="fixed_bar",e.BelowPosts="below_posts",e.Others="others"}(lz||(lz={}));const sz=document.querySelector("#mailpoet_form_edit_templates");function cz(){return(0,VI.jsx)(m.k.Provider,{value:(0,m.S)(window),children:(0,VI.jsxs)(VI.Fragment,{children:[(0,VI.jsx)(h.w,{}),(0,VI.jsx)(LN,{})]})})}sz&&((()=>{const e={templates:window.mailpoet_templates,formEditorUrl:window.mailpoet_form_edit_url,selectTemplateFailed:!1,loading:!1,activeCategory:lz.Popup},t={selectors:XZ,actions:s,controls:c,reducer:nz(e),resolvers:{}};(0,z.registerStore)("mailpoet-form-editor-templates",t)})(),d.render((0,VI.jsx)(u.StrictMode,{children:(0,VI.jsx)(az,{})}),sz)),window.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector("#mailpoet_form_edit");e&&(p.default.use(p.default.createRootURLMiddleware(window.wpApiSettings.root)),p.default.use(p.default.createNonceMiddleware(window.wpApiSettings.nonce)),(0,_e.KJ)("editor.MediaUpload","mailpoet/form-editor/replace-media-upload",(()=>B)),(()=>{const e=window.mailpoet_custom_fields.map((e=>({...e,params:e.params||{}}))),t=PM(Eo.fontSizes,Eo.colors,Eo.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,l=null;if(null!==n.id)try{l=JSON.parse(window.localStorage.getItem(`mailpoet_form_preview_settings${n.id}`)),"below_post"===l.formType&&(l.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:Ej(n),dateSettingData:o,sidebarOpened:!0,formExports:window.mailpoet_form_exports,formErrors:CB(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:l,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}},c={reducer:LB(s),actions:a,selectors:DB,controls:Cj,resolvers:{}};(0,z.registerStore)("mailpoet-form-editor",c)})(),(()=>{const e=(0,z.select)("mailpoet-form-editor").getAllAvailableCustomFields();pO.supports.inserter=(0,z.select)("mailpoet-form-editor").isUserAdministrator();const t=[{slug:"obligatory",title:""}];t.push({slug:"design",title:jI.x.I18n.t("layoutBlocksCategory")}),t.push({slug:"fields",title:jI.x.I18n.t("fieldsBlocksCategory")}),t.push({slug:"custom-fields",title:jI.x.I18n.t("customFieldsBlocksCategory")}),function(e){(0,z.dispatch)(Rt).setCategories(e)}(t),Oe("mailpoet-form/divider",HM),Oe("mailpoet-form/email-input",UM),Oe("mailpoet-form/submit-button",qM),Oe("mailpoet-form/first-name-input",JM),Oe("mailpoet-form/last-name-input",eO),Oe("mailpoet-form/segment-select",sO),Oe("mailpoet-form/html",pO),Oe("mailpoet-form/add-custom-field",vO),Oe(MO,FO),Oe(UO,GO),Oe(DF,MF),Oe(gF,bF),Oe(bj,_j),Array.isArray(e)&&e.forEach(kj)})(),(0,Vo.Sy)(HZ,WZ),window.mailpoet_translations.forEach((e=>{var t;const n=JSON.parse(e);n&&null!==(t=n.locale_data)&&void 0!==t&&t.messages&&(0,w.setLocaleData)(n.locale_data.messages)})),d.render((0,VI.jsx)(u.StrictMode,{children:(0,VI.jsx)(cz,{})}),e))}))},41779: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)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 l=[];for(var a in i)i[a]&&l.push(a);return l.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),l=r||o||i,a=l&&(r?document.documentMode||6:+(i||o)[1]),s=!i&&/WebKit\//.test(e),c=s&&/Qt\/\d+\.\d+/.test(e),u=!i&&/Chrome\//.test(e),d=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),f=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),g=/Android/.test(e),v=f||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=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,s=!0);var w=b&&(c||d&&(null==k||k<12.11)),x=n||l&&a>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,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 B(e,t,n,r){var o=N(e,t,n,r);return o.setAttribute("role","presentation"),o}function A(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 L(){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 P(e,t){var n=e.className;C(t).test(n)||(e.className+=(n?" ":"")+t)}function D(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}E=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 R=function(e){e.select()};function M(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,l=o||0;;){var a=e.indexOf("\t",i);if(a<0||a>=t)return l+(t-i);l+=a-i,l+=n-l%n,i=a+1}}f?R=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(R=function(e){try{e.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=M(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={toString:function(){return"CodeMirror.Pass"}},H={scroll:!1},V={origin:"*mouse"},W={origin:"+move"};function U(e,t,n){for(var r=0,o=0;;){var i=e.indexOf("\t",r);-1==i&&(i=e.length);var l=i-r;if(i==e.length||o+l>=t)return r+Math.min(l,t-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=t)return r}}var $=[""];function G(e){for(;$.length<=e;)$.push(q($)+" ");return $[e]}function q(e){return e[e.length-1]}function K(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Y(){}function J(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&O(t,n),n}var X=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||X.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function oe(e,t,n){for(;(n<0?t>0:t<e.length)&&re(e.charAt(t));)t+=n;return t}function ie(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 le=null;function ae(e,t,n){var r;le=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:le=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:le=o)}return null!=r?r:le}var se=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(l,a){var s,c="ltr"==a?"L":"R";if(0==l.length||"ltr"==a&&!e.test(l))return!1;for(var u=l.length,d=[],p=0;p<u;++p)d.push((s=l.charCodeAt(p))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(s):1424<=s&&s<=1524?"R":1536<=s&&s<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(s-1536):1774<=s&&s<=2220?"r":8192<=s&&s<=8203?"w":8204==s?"b":"L");for(var m=0,h=c;m<u;++m){var f=d[m];"m"==f?d[m]=h:h=f}for(var g=0,v=c;g<u;++g){var b=d[g];"1"==b&&"r"==v?d[g]="n":n.test(b)&&(v=b,"r"==b&&(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 x=d[w];if(","==x)d[w]="N";else if("%"==x){var C=void 0;for(C=w+1;C<u&&"%"==d[C];++C);for(var E=w&&"!"==d[w-1]||C<u&&"1"==d[C]?"1":"N",S=w;S<C;++S)d[S]=E;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 B=0;B<u;++B)if(t.test(d[B])){var A=void 0;for(A=B+1;A<u&&t.test(d[A]);++A);for(var L="L"==(B?d[B-1]:c),P=L==("L"==(A<u?d[A]:c))?L?"L":"R":c,D=B;D<A;++D)d[D]=P;B=A-1}for(var R,M=[],O=0;O<u;)if(r.test(d[O])){var F=O;for(++O;O<u&&r.test(d[O]);++O);M.push(new i(0,F,O))}else{var j=O,Z=M.length,z="rtl"==a?1:0;for(++O;O<u&&"L"!=d[O];++O);for(var H=j;H<O;)if(o.test(d[H])){j<H&&(M.splice(Z,0,new i(1,j,H)),Z+=z);var V=H;for(++H;H<O&&o.test(d[H]);++H);M.splice(Z,0,new i(2,V,H)),Z+=z,j=H}else++H;j<O&&M.splice(Z,0,new i(1,j,O))}return"ltr"==a&&(1==M[0].level&&(R=l.match(/^\s+/))&&(M[0].from=R[0].length,M.unshift(new i(0,0,R[0].length))),1==q(M).level&&(R=l.match(/\s+$/))&&(q(M).to-=R[0].length,M.push(new i(0,u-R[0].length,u)))),"rtl"==a?M.reverse():M}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=se(e.text,t)),n}var ue=[],de=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]||ue).concat(n)}};function pe(e,t){return e._handlers&&e._handlers[t]||ue}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 he(e,t){var n=pe(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 fe(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),he(e,n||t.type,e,t),ke(t)||t.codemirrorIgnore}function ge(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 pe(e,t).length>0}function be(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _e(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function we(e){ye(e),_e(e)}function xe(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Ee,Se,Ie=function(){if(l&&a<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Te(e){if(null==Ee){var t=N("span","​");T(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ee=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var n=Ee?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ne(e){if(null!=Se)return Se;var t=T(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return I(e),!(!n||n.left==n.right)&&(Se=r.right-n.right<3)}var Be,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),l=i.indexOf("\r");-1!=l?(n.push(i.slice(0,l)),t+=l+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Le=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)},Pe="oncopy"in(Be=N("div"))||(Be.setAttribute("oncopy","return;"),"function"==typeof Be.oncopy),De=null;var Re={},Me={};function Oe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Re[e]=t}function Fe(e){if("string"==typeof e&&Me.hasOwnProperty(e))e=Me[e];else if(e&&"string"==typeof e.name&&Me.hasOwnProperty(e.name)){var t=Me[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 Fe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function je(e,t){t=Fe(t);var n=Re[t.name];if(!n)return je(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 l in t.modeProps)r[l]=t.modeProps[l];return r}var Ze={};function ze(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 Ve(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 We(e,t,n){return!e.startState||e.startState(t,n)}var Ue=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 $e(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 Ge(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 qe(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ke(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ye(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 l=0;l<e.lines.length;++l){var a=e.lines[l].height;if(t<a)break;t-=a}return n+l}function Xe(e,t){return t>=e.first&&t<e.first+e.size}function Qe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function ot(e,t){return tt(e,t)<0?t:e}function it(e,t){return tt(e,t)<0?e:t}function lt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function at(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,$e(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,$e(e,t.line).text.length)}function st(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=at(e,t[r]);return n}Ue.prototype.eol=function(){return this.pos>=this.string.length},Ue.prototype.sol=function(){return this.pos==this.lineStart},Ue.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ue.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ue.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},Ue.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ue.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ue.prototype.skipToEnd=function(){this.pos=this.string.length},Ue.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ue.prototype.backUp=function(e){this.pos-=e},Ue.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)},Ue.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ue.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},Ue.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ue.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ue.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ue.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=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 dt(e,t,n,r){var o=[e.state.modeGen],i={};_t(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),i,r);for(var l=n.state,a=function(r){n.baseTokens=o;var a=e.state.overlays[r],s=1,c=0;n.state=!0,_t(e,t.text,a.mode,n,(function(e,t){for(var n=s;c<e;){var r=o[s];r>e&&o.splice(s,1,e,o[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(a.opaque)o.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+t}}),i),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function pt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=mt(e,Ye(t)),o=t.text.length>e.options.maxHighlightLength&&He(e.doc.mode,r.state),i=dt(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 ut(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=i.first)return i.first;var s=$e(i,a-1),c=s.stateAfter;if(c&&(!n||a+(c instanceof ct?c.lookAhead:0)<=i.modeFrontier))return a;var u=F(s.text,null,e.options.tabSize);(null==o||r>u)&&(o=a-1,r=u)}return o}(e,t,n),l=i>r.first&&$e(r,i-1).stateAfter,a=l?ut.fromSaved(r,l,i):new ut(r,We(r.mode),i);return r.iter(i,t,(function(n){ht(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function ht(e,t,n,r){var o=e.doc.mode,i=new Ue(t,e.options.tabSize,n);for(i.start=i.pos=r||0,""==t&&ft(o,n.state);!i.eol();)gt(o,i,n.state),i.start=i.pos}function ft(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ve(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function gt(e,t,n,r){for(var o=0;o<10;o++){r&&(r[0]=Ve(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.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.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}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,He(e.mode,t.state),n,t.lookAhead):new ut(e,He(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?He(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(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 bt(e,t,n,r){var o,i,l=e.doc,a=l.mode,s=$e(l,(t=at(l,t)).line),c=mt(e,t.line,n),u=new Ue(s.text,e.options.tabSize,c);for(r&&(i=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=gt(a,u,c.state),r&&i.push(new vt(u,o,He(l.mode,c.state)));return r?i:new vt(u,o,c.state)}function yt(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 _t(e,t,n,r,o,i,l){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,c=0,u=null,d=new Ue(t,e.options.tabSize,r),p=e.options.addModeClass&&[null];for(""==t&&yt(ft(n,r.state),i);!d.eol();){if(d.pos>e.options.maxHighlightLength?(a=!1,l&&ht(e,t,r,d.pos),d.pos=t.length,s=null):s=yt(gt(n,d,r.state,p),i),p){var m=p[0].name;m&&(s="m-"+(s?m+" "+s:m))}if(!a||u!=s){for(;c<d.start;)o(c=Math.min(d.start,c+5e3),u);u=s}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e3);o(h,u),c=h}}var kt=!1,wt=!1;function xt(e,t,n){this.marker=e,this.from=t,this.to=n}function Ct(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Et(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function St(e,t){if(t.full)return null;var n=Xe(e,t.from.line)&&$e(e,t.from.line).markedSpans,r=Xe(e,t.to.line)&&$e(e,t.to.line).markedSpans;if(!n&&!r)return null;var o=t.from.ch,i=t.to.ch,l=0==tt(t.from,t.to),a=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],l=i.marker;if(null==i.from||(l.inclusiveLeft?i.from<=t:i.from<t)||i.from==t&&"bookmark"==l.type&&(!n||!i.marker.insertLeft)){var a=null==i.to||(l.inclusiveRight?i.to>=t:i.to>t);(r||(r=[])).push(new xt(l,i.from,a?null:i.to))}}return r}(n,o,l),s=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],l=i.marker;if(null==i.to||(l.inclusiveRight?i.to>=t:i.to>t)||i.from==t&&"bookmark"==l.type&&(!n||i.marker.insertLeft)){var a=null==i.from||(l.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push(new xt(l,a?null:i.from-t,null==i.to?null:i.to-t))}}return r}(r,i,l),c=1==t.text.length,u=q(t.text).length+(c?o:0);if(a)for(var d=0;d<a.length;++d){var p=a[d];if(null==p.to){var m=Ct(s,p.marker);m?c&&(p.to=null==m.to?null:m.to+u):p.to=o}}if(s)for(var h=0;h<s.length;++h){var f=s[h];null!=f.to&&(f.to+=u),null==f.from?Ct(a,f.marker)||(f.from=u,c&&(a||(a=[])).push(f)):(f.from+=u,c&&(a||(a=[])).push(f))}a&&(a=It(a)),s&&s!=a&&(s=It(s));var g=[a];if(!c){var v,b=t.text.length-2;if(b>0&&a)for(var y=0;y<a.length;++y)null==a[y].to&&(v||(v=[])).push(new xt(a[y].marker,null,null));for(var _=0;_<b;++_)g.push(v);g.push(s)}return g}function It(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 Tt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Nt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Bt(e){return e.inclusiveLeft?-1:0}function At(e){return e.inclusiveRight?1:0}function Lt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),o=t.find(),i=tt(r.from,o.from)||Bt(e)-Bt(t);return i?-i:tt(r.to,o.to)||At(e)-At(t)||t.id-e.id}function Pt(e,t){var n,r=wt&&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||Lt(n,o.marker)<0)&&(n=o.marker);return n}function Dt(e){return Pt(e,!0)}function Rt(e){return Pt(e,!1)}function Mt(e,t){var n,r=wt&&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||Lt(n,i.marker)<0)&&(n=i.marker)}return n}function Ot(e,t,n,r,o){var i=$e(e,t),l=wt&&i.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var c=s.marker.find(0),u=tt(c.from,n)||Bt(s.marker)-Bt(o),d=tt(c.to,r)||At(s.marker)-At(o);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&o.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&o.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function Ft(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function jt(e,t){var n=$e(e,t),r=Ft(n);return n==r?t:Ye(r)}function Zt(e,t){if(t>e.lastLine())return t;var n,r=$e(e,t);if(!zt(e,r))return t;for(;n=Rt(r);)r=n.find(1,!0).line;return Ye(r)+1}function zt(e,t){var n=wt&&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,Ct(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 Vt(e){for(var t=0,n=(e=Ft(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 l=0;l<i.children.length;++l){var a=i.children[l];if(a==n)break;t+=a.height}return t}function Wt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Dt(r);){var o=t.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=e;t=Rt(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 Ut(e){var t=e.display,n=e.doc;t.maxLine=$e(n,n.first),t.maxLineLength=Wt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Wt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var $t=function(e,t,n){this.text=e,Nt(this,t),this.height=n?n(this):1};function Gt(e){e.parent=null,Tt(e)}$t.prototype.lineNo=function(){return Ye(this)},be($t);var qt={},Kt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Kt:qt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Jt(e,t){var n=B("span",null,null,s?"padding-right: .1px":null),r={pre:B("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,l=void 0;r.pos=0,r.addToken=Qt,Ne(e.display.measure)&&(l=ce(i,e.doc.direction))&&(r.addToken=en(r.addToken,l)),r.map=[],nn(i,r,pt(e,i,t!=e.display.externalMeasured&&Ye(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=D(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=D(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Te(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(s){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return he(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=D(r.pre.className,r.textClass||"")),r}function Xt(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,o,i,s){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 m=0;;){d.lastIndex=m;var h=d.exec(t),f=h?h.index-m:t.length-m;if(f){var g=document.createTextNode(u.slice(m,m+f));l&&a<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(!h)break;m+=f+1;var v=void 0;if("\t"==h[0]){var b=e.cm.options.tabSize,y=b-e.col%b;(v=c.appendChild(N("span",G(y),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==h[0]||"\n"==h[0]?((v=c.appendChild(N("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),l&&a<9?c.appendChild(N("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),l&&a<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||o||p||i||s){var _=n||"";r&&(_+=r),o&&(_+=o);var k=N("span",[c],_,i);if(s)for(var w in s)s.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&k.setAttribute(w,s[w]);return e.content.appendChild(k)}e.content.appendChild(c)}}function en(e,t){return function(n,r,o,i,l,a,s){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,l,a,s);e(n,r.slice(0,d.to-c),o,i,null,a,s),i=null,r=r.slice(d.to-c),c=d.to}}}function tn(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 nn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var l,a,s,c,u,d,p,m=o.length,h=0,f=1,g="",v=0;;){if(v==h){s=c=u=a="",p=null,d=null,v=1/0;for(var b=[],y=void 0,_=0;_<r.length;++_){var k=r[_],w=k.marker;if("bookmark"==w.type&&k.from==h&&w.widgetNode)b.push(w);else if(k.from<=h&&(null==k.to||k.to>h||w.collapsed&&k.to==h&&k.from==h)){if(null!=k.to&&k.to!=h&&v>k.to&&(v=k.to,c=""),w.className&&(s+=" "+w.className),w.css&&(a=(a?a+";":"")+w.css),w.startStyle&&k.from==h&&(u+=" "+w.startStyle),w.endStyle&&k.to==v&&(y||(y=[])).push(w.endStyle,k.to),w.title&&((p||(p={})).title=w.title),w.attributes)for(var x in w.attributes)(p||(p={}))[x]=w.attributes[x];w.collapsed&&(!d||Lt(d.marker,w)<0)&&(d=k)}else k.from>h&&v>k.from&&(v=k.from)}if(y)for(var C=0;C<y.length;C+=2)y[C+1]==v&&(c+=" "+y[C]);if(!d||d.from==h)for(var E=0;E<b.length;++E)tn(t,0,b[E]);if(d&&(d.from||0)==h){if(tn(t,(null==d.to?m+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=m)break;for(var S=Math.min(m,v);;){if(g){var I=h+g.length;if(!d){var T=I>S?g.slice(0,S-h):g;t.addToken(t,T,l?l+s:s,u,h+T.length==v?c:"",a,p)}if(I>=S){g=g.slice(S-h),h=S;break}h=I,u=""}g=o.slice(i,i=n[f++]),l=Yt(n[f++],t.cm.options)}}else for(var N=1;N<n.length;N+=2)t.addToken(t,o.slice(i,i=n[N]),Yt(n[N+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Rt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Ye(q(this.rest))-n+1:1,this.node=this.text=null,this.hidden=zt(e,t)}function on(e,t,n){for(var r,o=[],i=t;i<n;i=r){var l=new rn(e.doc,$e(e.doc,i),i);r=i+l.size,o.push(l)}return o}var ln=null;var an=null;function sn(e,t){var n=pe(e,t);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);ln?r=ln.delayedCallbacks:an?r=an:(r=an=[],setTimeout(cn,0));for(var i=function(e){r.push((function(){return n[e].apply(null,o)}))},l=0;l<n.length;++l)i(l)}}function cn(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function un(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?fn(e,t,n,r):"class"==i?hn(e,t):"widget"==i&&gn(e,t,r)}t.changes=null}function dn(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),l&&a<8&&(e.node.style.zIndex=2)),e.node}function pn(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=pn(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,hn(e,t)):n&&(t.text.className=n)}function hn(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=dn(t);t.background=r.insertBefore(N("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}})(e,t),t.line.wrapClass?dn(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 fn(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=dn(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 l=dn(t),a=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(N("div",Qe(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=i.hasOwnProperty(c)&&i[c];u&&a.appendChild(N("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function gn(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);bn(e,t,n)}function vn(e,t,n,r){var o=pn(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),hn(e,t),fn(e,t,n,r),bn(e,t,r),t.node}function bn(e,t,n){if(yn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)yn(e,t.rest[r],t,n,!1)}function yn(e,t,n,r,o){if(t.widgets)for(var i=dn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],c=N("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),_n(s,c,n,r),e.display.input.setUneditable(c),o&&s.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),sn(s,"redraw")}}function _n(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 kn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(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 wn(e,t){for(var n=xe(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 xn(e){return e.lineSpace.offsetTop}function Cn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function En(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 Sn(e){return 50-e.display.nativeBarWidth}function In(e){return e.display.scroller.clientWidth-Sn(e)-e.display.barWidth}function Tn(e){return e.display.scroller.clientHeight-Sn(e)-e.display.barHeight}function Nn(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(Ye(e.rest[o])>n)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function Bn(e,t,n,r){return Pn(e,Ln(e,t),n,r)}function An(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Ln(e,t){var n=Ye(t),r=An(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,ir(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Ye(t=Ft(t)),r=e.display.externalMeasured=new rn(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=Nn(r,t,n);return{line:t,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Pn(e,t,n,r,o){t.before&&(n=-1);var i,s=n+(r||"");return t.cache.hasOwnProperty(s)?i=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,o=r&&In(e);if(!t.measure.heights||r&&t.measure.width!=o){var i=t.measure.heights=[];if(r){t.measure.width=o;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],c=l[a+1];Math.abs(s.bottom-c.bottom)>2&&i.push((s.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=Mn(t.map,n,r),s=i.node,c=i.start,u=i.end,d=i.collapse;if(3==s.nodeType){for(var p=0;p<4;p++){for(;c&&re(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&re(t.line.text.charAt(i.coverStart+u));)++u;if((o=l&&a<9&&0==c&&u==i.coverEnd-i.coverStart?s.parentNode.getBoundingClientRect():On(E(s,c,u).getClientRects(),r)).left||o.right||0==c)break;u=c,c-=1,d="right"}l&&a<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=De)return De;var t=T(e,N("span","x")),n=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return De=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 m;c>0&&(d=r="right"),o=e.options.lineWrapping&&(m=s.getClientRects()).length>1?m["right"==r?m.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!c&&(!o||!o.left&&!o.right)){var h=s.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+or(e.display),top:h.top,bottom:h.bottom}:Rn}for(var f=o.top-t.rect.top,g=o.bottom-t.rect.top,v=(f+g)/2,b=t.view.measure.heights,y=0;y<b.length-1&&!(v<b[y]);y++);var _=y?b[y-1]:0,k=b[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[s]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var Dn,Rn={left:0,right:0,top:0,bottom:0};function Mn(e,t,n){for(var r,o,i,l,a,s,c=0;c<e.length;c+=3)if(a=e[c],s=e[c+1],t<a?(o=0,i=1,l="left"):t<s?i=1+(o=t-a):(c==e.length-3||t==s&&e[c+3]>t)&&(o=(i=s-a)-1,t>=s&&(l="right")),null!=o){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],l="left";if("right"==n&&o==s-a)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],l="right";break}return{node:r,start:o,end:i,collapse:l,coverStart:a,coverEnd:s}}function On(e,t){var n=Rn;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 Fn(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 jn(e){e.display.externalMeasure=null,I(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Fn(e.display.view[t])}function Zn(e){jn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function zn(){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 Vn(e){var t=Ft(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=kn(t[r]));return n}function Wn(e,t,n,r,o){if(!o){var i=Vn(t);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var l=Vt(t);if("local"==r?l+=xn(e.display):l-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+("window"==r?0:Hn());var s=a.left+("window"==r?0:zn());n.left+=s,n.right+=s}return n.top+=l,n.bottom+=l,n}function Un(e,t,n){if("div"==n)return t;var r=t.left,o=t.top;if("page"==n)r-=zn(),o-=Hn();else if("local"==n||!n){var i=e.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:o-l.top}}function $n(e,t,n,r,o){return r||(r=$e(e.doc,t.line)),Wn(e,r,Bn(e,r,t.ch,o),n)}function Gn(e,t,n,r,o,i){function l(t,l){var a=Pn(e,o,t,l?"right":"left",i);return l?a.left=a.right:a.right=a.left,Wn(e,r,a,n)}r=r||$e(e.doc,t.line),o||(o=Ln(e,r));var a=ce(r,e.doc.direction),s=t.ch,c=t.sticky;if(s>=r.text.length?(s=r.text.length,c="before"):s<=0&&(s=0,c="after"),!a)return l("before"==c?s-1:s,"before"==c);function u(e,t,n){return l(n?e-1:e,1==a[t].level!=n)}var d=ae(a,s,c),p=le,m=u(s,d,"before"==c);return null!=p&&(m.other=u(s,p,"before"!=c)),m}function qn(e,t){var n=0;t=at(e.doc,t),e.options.lineWrapping||(n=or(e.display)*t.ch);var r=$e(e.doc,t.line),o=Vt(r)+xn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Kn(e,t,n,r,o){var i=et(e,t,n);return i.xRel=o,r&&(i.outside=r),i}function Yn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Kn(r.first,0,null,-1,-1);var o=Je(r,n),i=r.first+r.size-1;if(o>i)return Kn(r.first+r.size-1,$e(r,i).text.length,null,1,1);t<0&&(t=0);for(var l=$e(r,o);;){var a=er(e,l,o,t,n),s=Mt(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var c=s.find(1);if(c.line==o)return c;l=$e(r,o=c.line)}}function Jn(e,t,n,r){r-=Vn(t);var o=t.text.length,i=ie((function(t){return Pn(e,n,t-1).bottom<=r}),o,0);return{begin:i,end:o=ie((function(t){return Pn(e,n,t).top>r}),i,o)}}function Xn(e,t,n,r){return n||(n=Ln(e,t)),Jn(e,t,n,Wn(e,t,Pn(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,o){o-=Vt(t);var i=Ln(e,t),l=Vn(t),a=0,s=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?nr:tr)(e,t,n,i,u,r,o);a=(c=1!=d.level)?d.from:d.to-1,s=c?d.to:d.from-1}var p,m,h=null,f=null,g=ie((function(t){var n=Pn(e,i,t);return n.top+=l,n.bottom+=l,!!Qn(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,f=n),!0)}),a,s),v=!1;if(f){var b=r-f.left<f.right-r,y=b==c;g=h+(y?0:1),m=y?"after":"before",p=b?f.left:f.right}else{c||g!=s&&g!=a||g++,m=0==g?"after":g==t.text.length?"before":Pn(e,i,g-(c?1:0)).bottom+l<=o==c?"after":"before";var _=Gn(e,et(n,g,m),"line",t,i);p=_.left,v=o<_.top?-1:o>=_.bottom?1:0}return Kn(n,g=oe(t.text,g,1),m,v,r-p)}function tr(e,t,n,r,o,i,l){var a=ie((function(a){var s=o[a],c=1!=s.level;return Qn(Gn(e,et(n,c?s.to:s.from,c?"before":"after"),"line",t,r),i,l,!0)}),0,o.length-1),s=o[a];if(a>0){var c=1!=s.level,u=Gn(e,et(n,c?s.from:s.to,c?"after":"before"),"line",t,r);Qn(u,i,l,!0)&&u.top>l&&(s=o[a-1])}return s}function nr(e,t,n,r,o,i,l){var a=Jn(e,t,r,l),s=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p<o.length;p++){var m=o[p];if(!(m.from>=c||m.to<=s)){var h=Pn(e,r,1!=m.level?Math.min(c,m.to)-1:Math.max(s,m.from)).right,f=h<i?i-h+1e9:h-i;(!u||d>f)&&(u=m,d=f)}}return u||(u=o[o.length-1]),u.from<s&&(u={from:s,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(N("br"));Dn.appendChild(document.createTextNode("x"))}T(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),I(e.measure),n||1}function or(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 ir(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,l=0;i;i=i.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=i.offsetLeft+i.clientLeft+o,r[a]=i.clientWidth}return{fixedPos:lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ar(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/or(e.display)-3);return function(o){if(zt(e.doc,o))return 0;var i=0;if(o.widgets)for(var l=0;l<o.widgets.length;l++)o.widgets[l].height&&(i+=o.widgets[l].height);return n?i+(Math.ceil(o.text.length/r)||1)*t:i+t}}function sr(e){var t=e.doc,n=ar(e);t.iter((function(e){var t=n(e);t!=e.height&&Ke(e,t)}))}function cr(e,t,n,r){var o=e.display;if(!n&&"true"==xe(t).getAttribute("cm-not-content"))return null;var i,l,a=o.lineSpace.getBoundingClientRect();try{i=t.clientX-a.left,l=t.clientY-a.top}catch(e){return null}var s,c=Yn(e,i,l);if(r&&c.xRel>0&&(s=$e(e.doc,c.line).text).length==c.ch){var u=F(s,s.length,e.options.tabSize)-s.length;c=et(c.line,Math.max(0,Math.round((i-En(e.display).left)/or(e.display))-u))}return c}function ur(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 dr(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)wt&&jt(e.doc,t)<o.viewTo&&mr(e);else if(n<=o.viewFrom)wt&&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=hr(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 l=hr(e,t,t,-1);l?(o.view=o.view.slice(0,l.index),o.viewTo=l.lineN):mr(e)}else{var a=hr(e,t,t,-1),s=hr(e,n,n+r,1);a&&s?(o.view=o.view.slice(0,a.index).concat(on(e,a.lineN,s.lineN)).concat(o.view.slice(s.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 pr(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[ur(e,t)];if(null!=i.node){var l=i.changes||(i.changes=[]);-1==Z(l,n)&&l.push(n)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hr(e,t,n,r){var o,i=ur(e,t),l=e.display.view;if(!wt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s<i;s++)a+=l[s].size;if(a!=t){if(r>0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;jt(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function fr(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 gr(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(),l=e.options.$customCursor;l&&(t=!0);for(var a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var c=s.empty();if(l){var u=l(e,s);u&&br(e,u,o)}else(c||e.options.showCursorWhenSelecting)&&br(e,s.head,o);c||_r(e,s,i)}}return r}function br(e,t,n){var r=Gn(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=$n(e,t,"div",null,null),l=i.right-i.left;o.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function yr(e,t){return e.top-t.top||e.left-t.left}function _r(e,t,n){var r=e.display,o=e.doc,i=document.createDocumentFragment(),l=En(e.display),a=l.left,s=Math.max(r.sizerWidth,In(e)-r.sizer.offsetLeft)-l.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?s-e:n)+"px;\n                             height: "+(r-t)+"px"))}function d(t,n,r){var i,l,d=$e(o,t),p=d.text.length;function m(n,r){return $n(e,et(t,n),"div",d,r)}function h(t,n,r){var o=Xn(e,d,null,t),i="ltr"==n==("after"==r)?"left":"right";return m("after"==r?o.begin:o.end-(/\s/.test(d.text.charAt(o.end-1))?2:1),i)[i]}var f=ce(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 l=e[i];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.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,v=m(e,g?"left":"right"),b=m(t-1,g?"right":"left"),y=null==n&&0==e,_=null==r&&t==p,k=0==d,w=!f||d==f.length-1;if(b.top-v.top<=3){var x=(c?_:y)&&w,C=(c?y:_)&&k?a:(g?v:b).left,E=x?s:(g?b:v).right;u(C,v.top,E-C,v.bottom)}else{var S,I,T,N;g?(S=c&&y&&k?a:v.left,I=c?s:h(e,o,"before"),T=c?a:h(t,o,"after"),N=c&&_&&w?s:b.right):(S=c?h(e,o,"before"):a,I=!c&&y&&k?s:v.right,T=!c&&_&&w?a:b.left,N=c?h(t,o,"after"):s),u(S,v.top,I-S,v.bottom),v.bottom<b.top&&u(a,v.bottom,null,b.top),u(T,b.top,N-T,b.bottom)}(!i||yr(v,i)<0)&&(i=v),yr(b,i)<0&&(i=b),(!l||yr(v,l)<0)&&(l=v),yr(b,l)<0&&(l=b)})),{start:i,end:l}}var p=t.from(),m=t.to();if(p.line==m.line)d(p.line,p.ch,m.ch);else{var h=$e(o,p.line),f=$e(o,m.line),g=Ft(h)==Ft(f),v=d(p.line,p.ch,g?h.text.length+1:null).end,b=d(m.line,g?0:null,m.ch).start;g&&(v.top<b.top-2?(u(v.right,v.top,null,v.bottom),u(a,b.top,b.left,b.bottom)):u(v.right,v.top,b.left-v.right,v.bottom)),v.bottom<b.top&&u(a,v.bottom,null,b.top)}n.appendChild(i)}function kr(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()||Er(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function wr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Cr(e))}function xr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Er(e))}),100)}function Cr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(he(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),kr(e))}function Er(e,t){e.state.delayingBlurEvent||(e.state.focused&&(he(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 Sr(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,s=0;s<t.view.length;s++){var c=t.view[s],u=e.options.lineWrapping,d=void 0,p=0;if(!c.hidden){if(o+=c.line.height,l&&a<8){var m=c.node.offsetTop+c.node.offsetHeight;d=m-n,n=m}else{var h=c.node.getBoundingClientRect();d=h.bottom-h.top,!u&&c.text.firstChild&&(p=c.text.firstChild.getBoundingClientRect().right-h.left-1)}var f=c.line.height-d;if((f>.005||f<-.005)&&(o<r&&(i-=f),Ke(c.line,d),Ir(c.line),c.rest))for(var g=0;g<c.rest.length;g++)Ir(c.rest[g]);if(p>e.display.sizerWidth){var v=Math.ceil(p/or(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(t.scroller.scrollTop+=i)}function Ir(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 Tr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-xn(e));var o=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,i=Je(t,r),l=Je(t,o);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<i?(i=a,l=Je(t,Vt($e(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(i=Je(t,Vt($e(t,s))-e.wrapper.clientHeight),l=s)}return{from:i,to:Math.max(l,i+1)}}function Nr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Tn(e),l={};t.bottom-t.top>i&&(t.bottom=t.top+i);var a=e.doc.height+Cn(n),s=t.top<r,c=t.bottom>a-r;if(t.top<o)l.scrollTop=s?0:t.top;else if(t.bottom>o+i){var u=Math.min(t.top,(c?a:t.bottom)-i);u!=o&&(l.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,m=In(e)-n.gutters.offsetWidth,h=t.right-t.left>m;return h&&(t.right=t.left+m),t.left<10?l.scrollLeft=0:t.left<p?l.scrollLeft=Math.max(0,t.left+d-(h?0:10)):t.right>m+p-3&&(l.scrollLeft=t.right+(h?0:10)-m),l}function Br(e,t){null!=t&&(Pr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ar(e){Pr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Lr(e,t,n){null==t&&null==n||Pr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Pr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Dr(e,qn(e,t.from),qn(e,t.to),t.margin))}function Dr(e,t,n,r){var o=Nr(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});Lr(e,o.scrollLeft,o.scrollTop)}function Rr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||so(e,{top:t}),Mr(e,t,!0),n&&so(e),ro(e,100))}function Mr(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 Or(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,po(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Cn(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+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var jr=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),de(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),de(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jr.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}},jr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jr.prototype.zeroWidthHack=function(){var e=b&&!m?"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},jr.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)}))},jr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Zr=function(){};function zr(e,t){t||(t=Fr(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&&Sr(e),Hr(e,Fr(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 Vr={native:jr,null:Zr};function Wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(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?Or(e,t):Rr(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Ur=0;function $r(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:++Ur,markArrays:null},t=e.curOp,ln?ln.ops.push(t):t.ownsGroup=ln={ops:[t],delayedCallbacks:[]}}function Gr(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{ln=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++)qr(t[n]);for(var r=0;r<t.length;r++)Kr(t[r]);for(var o=0;o<t.length;o++)Yr(t[o]);for(var i=0;i<t.length;i++)Jr(t[i]);for(var l=0;l<t.length;l++)Xr(t[l])}(e)}))}function qr(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=Sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Sn(e)+"px",t.scrollbarsClipped=!0)})(t),e.updateMaxLine&&Ut(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 io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Kr(e){e.updatedDisplay=e.mustUpdate&&lo(e.cm,e.update)}function Yr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Sr(t),e.barMeasure=Fr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Bn(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+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-In(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&&Or(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==L();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&zr(t,e.barMeasure),e.updatedDisplay&&uo(t,e.barMeasure),e.selectionChanged&&kr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&wr(e.cm)}function Xr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&ao(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Mr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Or(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!fe(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&&!h){var i=N("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-xn(e.display))+"px;\n                         height: "+(t.bottom-t.top+Sn(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?et(t.line,t.ch+1,"before"):t,t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var l=!1,a=Gn(e,t),s=n&&n!=t?Gn(e,n):a,c=Nr(e,o={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Rr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=c.scrollLeft&&(Or(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(l=!0)),!l)break}return o}(t,at(r,e.scrollToPos.from),at(r,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||he(o[l],"hide");if(i)for(var a=0;a<i.length;++a)i[a].lines.length&&he(i[a],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&he(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Qr(e,t){if(e.curOp)return t();$r(e);try{return t()}finally{Gr(e)}}function eo(e,t){return function(){if(e.curOp)return t.apply(e,arguments);$r(e);try{return t.apply(e,arguments)}finally{Gr(e)}}}function to(e){return function(){if(this.curOp)return e.apply(this,arguments);$r(this);try{return e.apply(this,arguments)}finally{Gr(this)}}}function no(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);$r(t);try{return e.apply(this,arguments)}finally{Gr(t)}}}function ro(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,M(oo,e))}function oo(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 l=i.styles,a=i.text.length>e.options.maxHighlightLength?He(t.mode,r.state):null,s=dt(e,i,r,!0);a&&(r.state=a),i.styles=s.styles;var c=i.styleClasses,u=s.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var d=!l||l.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&p<l.length;++p)d=l[p]!=i.styles[p];d&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=e.options.maxHighlightLength&&ht(e,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ro(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&Qr(e,(function(){for(var t=0;t<o.length;t++)pr(e,o[t],"text")}))}}var io=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Tr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=In(e),this.force=n,this.dims=ir(e),this.events=[]};function lo(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==fr(e))return!1;mo(e)&&(mr(e),t.dims=ir(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=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>l&&n.viewTo-l<20&&(l=Math.min(o,n.viewTo)),wt&&(i=jt(e.doc,i),l=Zt(e.doc,l));var a=i!=n.viewFrom||l!=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=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ur(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(on(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,ur(e,n)))),r.viewTo=n})(e,i,l),n.viewOffset=Vt($e(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=fr(e);if(!a&&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=L();if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&A(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,l=i.firstChild;function a(t){var n=t.nextSibling;return s&&b&&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(;l!=p.node;)l=a(l);var m=o&&null!=t&&t<=u&&p.lineNumber;p.changes&&(Z(p.changes,"gutter")>-1&&(m=!1),un(e,p,u,n)),m&&(I(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(Qe(e.options,u)))),l=p.node.nextSibling}else{var h=vn(e,p,u,n);i.insertBefore(h,l)}u+=p.size}for(;l;)l=a(l)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=L()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(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,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ro(e,400)),n.updateLineNumbers=null,!0}function ao(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=In(e))r&&(t.visible=Tr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Cn(e.display)-Tn(e),n.top)}),t.visible=Tr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!lo(e,t))break;Sr(e);var o=Fr(e);gr(e),zr(e,o),uo(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 so(e,t){var n=new io(e,t);if(lo(e,n)){Sr(e),ao(e,n);var r=Fr(e);gr(e),zr(e,r),uo(e,r),n.finish()}}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",sn(e,"gutterChanged",e)}function uo(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+Sn(e)+"px"}function po(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=i),n[l].gutterBackground&&(n[l].gutterBackground.style.left=i));var a=n[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].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=Qe(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,l=o.offsetWidth-i;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(i,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",co(e.display),!0}return!1}function ho(e,t){for(var n=[],r=!1,o=0;o<e.length;o++){var i=e[o],l=null;if("string"!=typeof i&&(l=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;r=!0}n.push({className:i,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function fo(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,l=o.style,a=t.appendChild(N("div",null,"CodeMirror-gutter "+i));l&&(a.style.cssText=l),"CodeMirror-linenumbers"==i&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",co(e)}function go(e){fo(e.display),dr(e),po(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=B("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=B("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=B("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: 50px; 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"),l&&a<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),s||n&&v||(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=ho(o.gutters,o.lineNumbers),fo(i),r.init(i)}io.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},io.prototype.finish=function(){for(var e=0;e<this.events.length;e++)he.apply(null,this.events[e])};var bo=0,yo=null;function _o(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 ko(e){var t=_o(e);return t.x*=yo,t.y*=yo,t}function wo(e,t){var r=_o(t),o=r.x,i=r.y,l=yo;0===t.deltaMode&&(o=t.deltaX,i=t.deltaY,l=1);var a=e.display,c=a.scroller,u=c.scrollWidth>c.clientWidth,p=c.scrollHeight>c.clientHeight;if(o&&u||i&&p){if(i&&b&&s)e:for(var m=t.target,h=a.view;m!=c;m=m.parentNode)for(var f=0;f<h.length;f++)if(h[f].node==m){e.display.currentWheelTarget=m;break e}if(o&&!n&&!d&&null!=l)return i&&p&&Rr(e,Math.max(0,c.scrollTop+i*l)),Or(e,Math.max(0,c.scrollLeft+o*l)),(!i||i&&p)&&ye(t),void(a.wheelStartX=null);if(i&&null!=l){var g=i*l,v=e.doc.scrollTop,y=v+a.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):y=Math.min(e.doc.height,y+g+50),so(e,{top:v,bottom:y})}bo<20&&0!==t.deltaMode&&(null==a.wheelStartX?(a.wheelStartX=c.scrollLeft,a.wheelStartY=c.scrollTop,a.wheelDX=o,a.wheelDY=i,setTimeout((function(){if(null!=a.wheelStartX){var e=c.scrollLeft-a.wheelStartX,t=c.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(yo=(yo*bo+n)/(bo+1),++bo)}}),200)):(a.wheelDX+=o,a.wheelDY+=i))}}l?yo=-.53:n?yo=15:u?yo=-.7:p&&(yo=-1/3);var xo=function(e,t){this.ranges=e,this.primIndex=t};xo.prototype.primary=function(){return this.ranges[this.primIndex]},xo.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(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},xo.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Co(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new xo(e,this.primIndex)},xo.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},xo.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var Co=function(e,t){this.anchor=e,this.head=t};function Eo(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=Z(t,o);for(var i=1;i<t.length;i++){var l=t[i],a=t[i-1],s=tt(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var c=it(a.from(),l.from()),u=ot(a.to(),l.to()),d=a.empty()?l.from()==l.head:a.from()==a.head;i<=n&&--n,t.splice(--i,2,new Co(d?u:c,d?c:u))}}return new xo(t,n)}function So(e,t){return new xo([new Co(e,t||e)],0)}function Io(e){return e.text?et(e.from.line+e.text.length-1,q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function To(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Io(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+=Io(t).ch-t.to.ch),et(n,r)}function No(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var o=e.sel.ranges[r];n.push(new Co(To(o.anchor,t),To(o.head,t)))}return Eo(e.cm,n,e.sel.primIndex)}function Bo(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Ao(e){e.doc.mode=je(e.options,e.doc.modeOption),Lo(e)}function Lo(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,ro(e,100),e.state.modeGen++,e.curOp&&dr(e)}function Po(e,t){return 0==t.from.ch&&0==t.to.ch&&""==q(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Do(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),Tt(e),Nt(e,n);var o=r?r(e):1;o!=e.height&&Ke(e,o)})(e,n,o,r),sn(e,"change",e,t)}function l(e,t){for(var n=[],i=e;i<t;++i)n.push(new $t(c[i],o(i),r));return n}var a=t.from,s=t.to,c=t.text,u=$e(e,a.line),d=$e(e,s.line),p=q(c),m=o(c.length-1),h=s.line-a.line;if(t.full)e.insert(0,l(0,c.length)),e.remove(c.length,e.size-c.length);else if(Po(e,t)){var f=l(0,c.length-1);i(d,d.text,m),h&&e.remove(a.line,h),f.length&&e.insert(a.line,f)}else if(u==d)if(1==c.length)i(u,u.text.slice(0,a.ch)+p+u.text.slice(s.ch),m);else{var g=l(1,c.length-1);g.push(new $t(p+u.text.slice(s.ch),m,r)),i(u,u.text.slice(0,a.ch)+c[0],o(0)),e.insert(a.line+1,g)}else if(1==c.length)i(u,u.text.slice(0,a.ch)+c[0]+d.text.slice(s.ch),o(0)),e.remove(a.line+1,h);else{i(u,u.text.slice(0,a.ch)+c[0],o(0)),i(d,p+d.text.slice(s.ch),m);var v=l(1,c.length-1);h>1&&e.remove(a.line+1,h-1),e.insert(a.line+1,v)}sn(e,"change",e,t)}function Ro(e,t,n){!function e(r,o,i){if(r.linked)for(var l=0;l<r.linked.length;++l){var a=r.linked[l];if(a.doc!=o){var s=i&&a.sharedHist;n&&!s||(t(a.doc,s),e(a.doc,r,s))}}}(e,null,!0)}function Mo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,sr(e),Ao(e),Oo(e),e.options.direction=t.direction,e.options.lineWrapping||Ut(e),e.options.mode=t.modeOption,dr(e)}function Oo(e){("rtl"==e.doc.direction?P:S)(e.display.lineDiv,"CodeMirror-rtl")}function Fo(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 jo(e,t){var n={from:rt(t.from),to:Io(t),text:Ge(e,t.from,t.to)};return Wo(e,n,t.from.line,t.to.line+1),Ro(e,(function(e){return Wo(e,n,t.from.line,t.to.line+1)}),!0),n}function Zo(e){for(;e.length&&q(e).ranges;)e.pop()}function zo(e,t,n,r){var o=e.history;o.undone.length=0;var i,l,a=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(Zo(e.done),q(e.done)):e.done.length&&!q(e.done).ranges?q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),q(e.done)):void 0}(o,o.lastOp==r)))l=q(i.changes),0==tt(t.from,t.to)&&0==tt(t.from,l.to)?l.to=Io(t):i.changes.push(jo(e,t));else{var s=q(o.done);for(s&&s.ranges||Vo(e.sel,o.done),i={changes:[jo(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=a,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,l||he(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,q(o.done),t))?o.done[o.done.length-1]=t:Vo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&Zo(o.undone)}function Vo(e,t){var n=q(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Wo(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 Uo(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 $o(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(Uo(n[o]));return r}(e,t),r=St(e,t);if(!n)return r;if(!r)return n;for(var o=0;o<n.length;++o){var i=n[o],l=r[o];if(i&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],c=0;c<i.length;++c)if(i[c].marker==s.marker)continue e;i.push(s)}else l&&(n[o]=l)}return n}function Go(e,t,n){for(var r=[],o=0;o<e.length;++o){var i=e[o];if(i.ranges)r.push(n?xo.prototype.deepCopy.call(i):i);else{var l=i.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var c=l[s],u=void 0;if(a.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&&(q(a)[d]=c[d],delete c[d])}}}return r}function qo(e,t,n,r){if(r){var o=e.anchor;if(n){var i=tt(t,o)<0;i!=tt(n,o)<0?(o=t,t=n):i!=tt(t,n)<0&&(t=n)}return new Co(o,t)}return new Co(n||t,t)}function Ko(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ei(e,new xo([qo(e.sel.primary(),t,n,o)],0),r)}function Yo(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]=qo(e.sel.ranges[i],t[i],null,o);ei(e,Eo(e.cm,r,e.sel.primIndex),n)}function Jo(e,t,n,r){var o=e.sel.ranges.slice(0);o[t]=n,ei(e,Eo(e.cm,o,e.sel.primIndex),r)}function Xo(e,t,n,r){ei(e,So(t,n),r)}function Qo(e,t,n){var r=e.history.done,o=q(r);o&&o.ranges?(r[r.length-1]=t,ti(e,t,n)):ei(e,t,n)}function ei(e,t,n){ti(e,t,n),Ho(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ti(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 Co(at(e,t[n].anchor),at(e,t[n].head))},origin:n&&n.origin};return he(e,"beforeSelectionChange",e,r),e.cm&&he(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Eo(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);ni(e,oi(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Ar(e.cm)}function ni(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),sn(e,"cursorActivity",e))}function ri(e){ni(e,oi(e,e.sel,null,!1))}function oi(e,t,n,r){for(var o,i=0;i<t.ranges.length;i++){var l=t.ranges[i],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],s=li(e,l.anchor,a&&a.anchor,n,r),c=li(e,l.head,a&&a.head,n,r);(o||s!=l.anchor||c!=l.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new Co(s,c))}return o?Eo(e.cm,o,t.primIndex):t}function ii(e,t,n,r,o){var i=$e(e,t.line);if(i.markedSpans)for(var l=0;l<i.markedSpans.length;++l){var a=i.markedSpans[l],s=a.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==a.from||(c?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(u?a.to>=t.ch:a.to>t.ch))){if(o&&(he(s,"beforeCursorEnter"),s.explicitlyCleared)){if(i.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),p=void 0;if((r<0?u:c)&&(d=ai(e,d,-r,d&&d.line==t.line?i:null)),d&&d.line==t.line&&(p=tt(d,n))&&(r<0?p<0:p>0))return ii(e,d,t,r,o)}var m=s.find(r<0?-1:1);return(r<0?c:u)&&(m=ai(e,m,r,m.line==t.line?i:null)),m?ii(e,m,t,r,o):null}}return t}function li(e,t,n,r,o){var i=r||1;return ii(e,t,n,i,o)||!o&&ii(e,t,n,i,!0)||ii(e,t,n,-i,o)||!o&&ii(e,t,n,-i,!0)||(e.cantEdit=!0,et(e.first,0))}function ai(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?at(e,et(t.line-1)):null:n>0&&t.ch==(r||$e(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function si(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),H)}function ci(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=at(e,t)),n&&(r.to=at(e,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),he(e,"beforeChange",e,r),e.cm&&he(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 ui(e,t,n){if(e.cm){if(!e.cm.curOp)return eo(e.cm,ui)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=ci(e,t,!0))){var r=kt&&!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 l=r[i],a=l.find(0),s=0;s<o.length;++s){var c=o[s];if(!(tt(c.to,a.from)<0||tt(c.from,a.to)>0)){var u=[s,1],d=tt(c.from,a.from),p=tt(c.to,a.to);(d<0||!l.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(p>0||!l.inclusiveRight&&!p)&&u.push({from:a.to,to:c.to}),o.splice.apply(o,u),s+=u.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)di(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else di(e,t)}}function di(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=No(e,t);zo(e,t,n,e.cm?e.cm.curOp.id:NaN),hi(e,t,n,St(e,t));var r=[];Ro(e,(function(e,n){n||-1!=Z(r,e.history)||(bi(e.history,t),r.push(e.history)),hi(e,t,null,St(e,t))}))}}function pi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,i=e.history,l=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,c=0;c<a.length&&(o=a[c],n?!o.ranges||o.equals(e.sel):o.ranges);c++);if(c!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(!(o=a.pop()).ranges){if(r)return void a.push(o);break}if(Vo(o,s),n&&!o.equals(e.sel))return void ei(e,o,{clearRedo:!1});l=o}var u=[];Vo(l,s),s.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&&!ci(e,r,!1))return a.length=0,{};u.push(jo(e,r));var i=n?No(e,r):q(a);hi(e,r,i,$o(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Io(r)});var l=[];Ro(e,(function(e,t){t||-1!=Z(l,e.history)||(bi(e.history,r),l.push(e.history)),hi(e,r,null,$o(e,r))}))},m=o.changes.length-1;m>=0;--m){var h=p(m);if(h)return h.v}}}}function mi(e,t){if(0!=t&&(e.first+=t,e.sel=new xo(K(e.sel.ranges,(function(e){return new Co(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)pr(e.cm,r,"gutter")}}function hi(e,t,n,r){if(e.cm&&!e.cm.curOp)return eo(e.cm,hi)(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:et(e.first,0),to:et(t.to.line+o,t.to.ch),text:[q(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:et(i,$e(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ge(e,t.from,t.to),n||(n=No(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,l=t.to,a=!1,s=i.line;e.options.lineWrapping||(s=Ye(Ft($e(r,i.line))),r.iter(s,l.line+1,(function(e){if(e==o.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Do(r,t,n,ar(e)),e.options.lineWrapping||(r.iter(s,i.line+t.text.length,(function(e){var t=Wt(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,a=!1)})),a&&(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=$e(e,r).stateAfter;if(o&&(!(o instanceof ct)||r+o.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,i.line),ro(e,400);var c=t.text.length-(l.line-i.line)-1;t.full?dr(e):i.line!=l.line||1!=t.text.length||Po(e.doc,t)?dr(e,i.line,l.line+1,c):pr(e,i.line,"text");var u=ve(e,"changes"),d=ve(e,"change");if(d||u){var p={from:i,to:l,text:t.text,removed:t.removed,origin:t.origin};d&&sn(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}(e.cm,t,r):Do(e,t,r),ti(e,n,H),e.cantEdit&&li(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function fi(e,t,n,r,o){var i;r||(r=n),tt(r,n)<0&&(n=(i=[r,n])[0],r=i[1]),"string"==typeof t&&(t=e.splitLines(t)),ui(e,{from:n,to:r,text:t,origin:o})}function gi(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],l=!0;if(i.ranges){i.copied||((i=e[o]=i.deepCopy()).copied=!0);for(var a=0;a<i.ranges.length;a++)gi(i.ranges[a].anchor,t,n,r),gi(i.ranges[a].head,t,n,r)}else{for(var s=0;s<i.changes.length;++s){var c=i.changes[s];if(n<c.from.line)c.from=et(c.from.line+r,c.from.ch),c.to=et(c.to.line+r,c.to.ch);else if(t<=c.to.line){l=!1;break}}l||(e.splice(0,o+1),o=0)}}}function bi(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 yi(e,t,n,r){var o=t,i=t;return"number"==typeof t?i=$e(e,lt(e,t)):o=Ye(t),null==o?null:(r(i,o)&&e.cm&&pr(e.cm,o,n),i)}function _i(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 ki(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}Co.prototype.from=function(){return it(this.anchor,this.head)},Co.prototype.to=function(){return ot(this.anchor,this.head)},Co.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},_i.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,Gt(o),sn(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}},ki.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),l=r.height;if(r.removeInner(e,i),this.height-=l-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 _i))){var a=[];this.collapse(a),this.children=[new _i(a)],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 l=o.lines.length%25+25,a=l;a<o.lines.length;){var s=new _i(o.lines.slice(a,a+=25));o.height-=s.height,this.children.splice(++r,0,s),s.parent=this}o.lines=o.lines.slice(0,l),this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ki(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 ki(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 l=Math.min(t,i-e);if(o.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=i}}};var wi=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 xi(e,t,n){Vt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Br(e,n)}wi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ye(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=kn(this);Ke(n,Math.max(0,n.height-i)),e&&(Qr(e,(function(){xi(e,n,-i),pr(e,r,"widget")})),sn(e,"lineWidgetCleared",e,this,r))}},wi.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=kn(this)-t;o&&(zt(this.doc,r)||Ke(r,r.height+o),n&&Qr(n,(function(){n.curOp.forceUpdate=!0,xi(n,r,o),sn(n,"lineWidgetChanged",n,e,Ye(r))})))},be(wi);var Ci=0,Ei=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ci};function Si(e,t,n,r,o){if(r&&r.shared)return function(e,t,n,r,o){(r=O(r)).shared=!1;var i=[Si(e,t,n,r,o)],l=i[0],a=r.widgetNode;return Ro(e,(function(e){a&&(r.widgetNode=a.cloneNode(!0)),i.push(Si(e,at(e,t),at(e,n),r,o));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;l=q(i)})),new Ii(i,l)}(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return eo(e.cm,Si)(e,t,n,r,o);var i=new Ei(e,o),l=tt(t,n);if(r&&O(r,i,!1),l>0||0==l&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=B("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Ot(e,t.line,t,n,i)||t.line!=n.line&&Ot(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");wt=!0}i.addToHistory&&zo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,c=e.cm;if(e.iter(s,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&Ft(r)==c.display.maxLine&&(a=!0),i.collapsed&&s!=t.line&&Ke(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 xt(i,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s})),i.collapsed&&e.iter(t.line,n.line+1,(function(t){zt(e,t)&&Ke(t,0)})),i.clearOnEnter&&de(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(kt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++Ci,i.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),i.collapsed)dr(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++)pr(c,u,"text");i.atomic&&ri(c.doc),sn(c,"markerAdded",c,i)}return i}Ei.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&$r(e),ve(this,"clear")){var n=this.find();n&&sn(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;i<this.lines.length;++i){var l=this.lines[i],a=Ct(l.markedSpans,this);e&&!this.collapsed?pr(e,Ye(l),"text"):e&&(null!=a.to&&(o=Ye(l)),null!=a.from&&(r=Ye(l))),l.markedSpans=Et(l.markedSpans,a),null==a.from&&this.collapsed&&!zt(this.doc,l)&&e&&Ke(l,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=Ft(this.lines[s]),u=Wt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&dr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ri(e.doc)),e&&sn(e,"markerCleared",e,this,r,o),t&&Gr(e),this.parent&&this.parent.clear()}},Ei.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],l=Ct(i.markedSpans,this);if(null!=l.from&&(n=et(t?i:Ye(i),l.from),-1==e))return n;if(null!=l.to&&(r=et(t?i:Ye(i),l.to),1==e))return r}return n&&{from:n,to:r}},Ei.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Qr(r,(function(){var o=t.line,i=Ye(t.line),l=An(r,i);if(l&&(Fn(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!zt(n.doc,o)&&null!=n.height){var a=n.height;n.height=null;var s=kn(n)-a;s&&Ke(o,o.height+s)}sn(r,"markerChanged",r,e)}))},Ei.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)},Ei.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)}},be(Ei);var Ii=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ti(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ni(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Ro(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)}Ii.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sn(this,"clear")}},Ii.prototype.find=function(e,t){return this.primary.find(e,t)},be(Ii);var Bi=0,Ai=function(e,t,n,r,o){if(!(this instanceof Ai))return new Ai(e,t,n,r,o);null==n&&(n=0),ki.call(this,[new _i([new $t("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=et(n,0);this.sel=So(i),this.history=new Fo(null),this.id=++Bi,this.modeOption=t,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Do(this,{from:i,to:i,text:e}),ei(this,So(i),H)};Ai.prototype=J(ki.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=qe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:no((function(e){var t=et(this.first,0),n=this.first+this.size-1;ui(this,{from:t,to:et(n,$e(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Lr(this.cm,0,0),ei(this,So(t),H)})),replaceRange:function(e,t,n,r){fi(this,e,t=at(this,t),n=n?at(this,n):t,r)},getRange:function(e,t,n){var r=Ge(this,at(this,e),at(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(Xe(this,e))return $e(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=$e(this,e)),Ft(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return at(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:no((function(e,t,n){Xo(this,at(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:no((function(e,t,n){Xo(this,at(this,e),at(this,t||e),n)})),extendSelection:no((function(e,t,n){Ko(this,at(this,e),t&&at(this,t),n)})),extendSelections:no((function(e,t){Yo(this,st(this,e),t)})),extendSelectionsBy:no((function(e,t){Yo(this,st(this,K(this.sel.ranges,e)),t)})),setSelections:no((function(e,t,n){if(e.length){for(var r=[],o=0;o<e.length;o++)r[o]=new Co(at(this,e[o].anchor),at(this,e[o].head||e[o].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ei(this,Eo(this.cm,r,t),n)}})),addSelection:no((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Co(at(this,e),at(this,t||e))),ei(this,Eo(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=Ge(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=Ge(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:no((function(e,t,n){for(var r=[],o=this.sel,i=0;i<o.ranges.length;i++){var l=o.ranges[i];r[i]={from:l.from(),to:l.to(),text:this.splitLines(e[i]),origin:n}}for(var a=t&&"end"!=t&&function(e,t,n){for(var r=[],o=et(e.first,0),i=o,l=0;l<t.length;l++){var a=t[l],s=Bo(a.from,o,i),c=Bo(Io(a),o,i);if(o=a.to,i=c,"around"==n){var u=e.sel.ranges[l],d=tt(u.head,u.anchor)<0;r[l]=new Co(d?c:s,d?s:c)}else r[l]=new Co(s,s)}return new xo(r,e.sel.primIndex)}(this,r,t),s=r.length-1;s>=0;s--)ui(this,r[s]);a?Qo(this,a):this.cm&&Ar(this.cm)})),undo:no((function(){pi(this,"undo")})),redo:no((function(){pi(this,"redo")})),undoSelection:no((function(){pi(this,"undo",!0)})),redoSelection:no((function(){pi(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 Fo(this.history),Ro(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:Go(this.history.done),undone:Go(this.history.undone)}},setHistory:function(e){var t=this.history=new Fo(this.history);t.done=Go(e.done.slice(0),null,!0),t.undone=Go(e.undone.slice(0),null,!0)},setGutterMarker:no((function(e,t,n){return yi(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:no((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&yi(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Xe(this,e))return null;if(t=e,!(e=$e(this,e)))return null}else if(null==(t=Ye(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:no((function(e,t,n){return yi(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:no((function(e,t,n){return yi(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 l=i.index+i[0].length;e[r]=o.slice(0,i.index)+(i.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0}))})),addLineWidget:no((function(e,t,n){return function(e,t,n,r){var o=new wi(e,n,r),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),yi(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&&!zt(e,t)){var r=Vt(t)<e.scrollTop;Ke(t,t.height+kn(o)),r&&Br(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&sn(i,"lineWidgetAdded",i,o,"number"==typeof t?t:Ye(t)),o}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Si(this,at(this,e),at(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 Si(this,e=at(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=$e(this,(e=at(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=at(this,e),t=at(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var l=i.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];null!=s.to&&o==e.line&&e.ch>=s.to||null==s.from&&o!=e.line||null!=s.from&&o==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.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})),at(this,et(n,t))},indexFromPos:function(e){var t=(e=at(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(qe(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(qe(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),l=e.clipPos(o.to);if(tt(i,l)){var a=Si(e,i,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}(r,Ti(this)),r},unlinkDoc:function(e){if(e instanceof Il&&(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),Ni(Ti(this));break}if(e.history==this.history){var n=[e.id];Ro(e,(function(e){return n.push(e.id)}),!0),e.history=new Fo(null),e.history.done=Go(this.history.done,n),e.history.undone=Go(this.history.undone,n)}},iterLinkedDocs:function(e){Ro(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:no((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Qr(t=this.cm,(function(){Oo(t),dr(t)})))}))}),Ai.prototype.eachLine=Ai.prototype.iter;var Li=0;function Pi(e){var t=this;if(Di(t),!fe(t,e)&&!wn(t.display,e)){ye(e),l&&(Li=+new Date);var n=cr(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),a=0,s=function(){++a==o&&eo(t,(function(){var e={from:n=at(t.doc,n),to:n,text:t.doc.splitLines(i.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ui(t.doc,e),Qo(t.doc,So(at(t.doc,n),at(t.doc,Io(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==Z(t.options.allowDropFileTypes,e.type))s();else{var r=new FileReader;r.onerror=function(){return s()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(i[n]=e),s()},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()),ti(t.doc,So(n,n)),p)for(var m=0;m<p.length;++m)fi(t.doc,"",p[m].anchor,p[m].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Di(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ri(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 Mi=!1;function Oi(){var e;Mi||(de(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ri(Fi)}),100))})),de(window,"blur",(function(){return Ri(Er)})),Mi=!0)}function Fi(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ji={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++)ji[Zi+48]=ji[Zi+96]=String(Zi);for(var zi=65;zi<=90;zi++)ji[zi]=String.fromCharCode(zi);for(var Hi=1;Hi<=12;Hi++)ji[Hi+111]=ji[Hi+63235]="F"+Hi;var Vi={};function Wi(e){var t,n,r,o,i=e.split(/-(?!$)/);e=i[i.length-1];for(var l=0;l<i.length-1;l++){var a=i[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ui(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=K(n.split(" "),Wi),i=0;i<o.length;i++){var l=void 0,a=void 0;i==o.length-1?(a=o.join(" "),l=r):(a=o.slice(0,i+1).join(" "),l="...");var s=t[a];if(s){if(s!=l)throw new Error("Inconsistent bindings for "+a)}else t[a]=l}delete e[n]}for(var c in t)e[c]=t[c];return e}function $i(e,t,n,r){var o=(t=Yi(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 $i(e,t.fallthrough,n,r);for(var i=0;i<t.fallthrough.length;i++){var l=$i(e,t.fallthrough[i],n,r);if(l)return l}}}function Gi(e){var t="string"==typeof e?e:ji[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function qi(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 Ki(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=ji[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),qi(n,e,t))}function Yi(e){return"string"==typeof e?Vi[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&&tt(i.from,q(r).to)<=0;){var l=r.pop();if(tt(l.from,i.from)<0){i.from=l.from;break}}r.push(i)}Qr(e,(function(){for(var t=r.length-1;t>=0;t--)fi(e.doc,"",r[t].from,r[t].to,"+delete");Ar(e)}))}function Xi(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qi(e,t,n){var r=Xi(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function el(e,t,n,r,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ce(n,t.doc.direction);if(i){var l,a=o<0?q(i):i[0],s=o<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=Ln(t,n);l=o<0?n.text.length-1:0;var u=Pn(t,c,l).top;l=ie((function(e){return Pn(t,c,e).top==u}),o<0==(1==a.level)?a.from:a.to-1,l),"before"==s&&(l=Xi(n,l,1))}else l=o<0?a.to:a.from;return new et(r,l,s)}}return new et(r,o<0?n.text.length:0,o<0?"before":"after")}Vi.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"},Vi.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"},Vi.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"},Vi.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"]},Vi.default=b?Vi.macDefault:Vi.pcDefault;var tl={selectAll:si,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=$e(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Ji(e,(function(t){return{from:et(t.from().line,0),to:at(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Ji(e,(function(e){return{from:et(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(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return nl(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return rl(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=$e(e.doc,t),r=function(e){for(var t;t=Rt(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Ye(r)),el(!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")}),W)},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")}),W)},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/)?rl(e,t.head):r}),W)},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(),l=F(e.getLine(i.line),i.ch,r);t.push(G(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var o=t[r].head,i=$e(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new et(o.line,o.ch-1)),o.ch>0)o=new et(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),et(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var l=$e(e.doc,o.line-1).text;l&&(o=new et(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),et(o.line-1,l.length-1),o,"+transpose"))}n.push(new Co(o,o))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qr(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 nl(e,t){var n=$e(e.doc,t),r=Ft(n);return r!=n&&(t=Ye(r)),el(!0,e,r,t,1)}function rl(e,t){var n=nl(e,t.line),r=$e(e.doc,n.line),o=ce(r,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=i&&t.ch;return et(n.line,l?0:i,n.sticky)}return n}function ol(e,t,n){if("string"==typeof t&&!(t=tl[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)!=z}finally{e.display.shift=r,e.state.suppressEdits=!1}return o}var il=new j;function ll(e,t,n,r){var o=e.state.keySeq;if(o){if(Gi(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:il.set(50,(function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())})),al(e,o+" "+t,n,r))return!0}return al(e,t,n,r)}function al(e,t,n,r){var o=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var o=$i(t,e.state.keyMaps[r],n,e);if(o)return o}return e.options.extraKeys&&$i(t,e.options.extraKeys,n,e)||$i(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&sn(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(ye(n),kr(e)),!!o}function sl(e,t){var n=Ki(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ll(e,"Shift-"+n,t,(function(t){return ol(e,t,!0)}))||ll(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ol(e,t)})):ll(e,n,t,(function(t){return ol(e,t)})))}var cl=null;function ul(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=L(),fe(t,e)))){l&&a<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var o=sl(t,e);d&&(cl=o?r:null,o||88!=r||Pe||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!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))}P(t,"CodeMirror-crosshair"),de(document,"keyup",n),de(document,"mouseover",n)}(t)}}function dl(e){16==e.keyCode&&(this.doc.sel.shift=!1),fe(this,e)}function pl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||wn(t.display,e)||fe(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==cl)return cl=null,void ye(e);if(!d||e.which&&!(e.which<10)||!sl(t,e)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(function(e,t,n){return ll(e,"'"+n+"'",t,(function(t){return ol(e,t,!0)}))}(t,e,o)||t.display.input.onKeyPress(e))}}}var ml,hl,fl=function(e,t,n){this.time=e,this.pos=t,this.button=n};function gl(e){var t=this,n=t.display;if(!(fe(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,wn(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!yl(t,e)){var r=cr(t,e),o=Ce(e),i=r?function(e,t){var n=+new Date;return hl&&hl.compare(n,e,t)?(ml=hl=null,"triple"):ml&&ml.compare(n,e,t)?(hl=new fl(n,e,t),ml=null,"double"):(ml=new fl(n,e,t),hl=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),ll(e,qi(i=(1==t?"Left":2==t?"Middle":"Right")+i,o),o,(function(t){if("string"==typeof t&&(t=tl[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=z}finally{e.state.suppressEdits=!1}return r}))}(t,o,r,i,e)||(1==o?r?function(e,t,n,r){l?setTimeout(M(wr,e),0):e.curOp.focus=L();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=b?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(b?n.altKey:n.ctrlKey)),o}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Ie&&!e.isReadOnly()&&"single"==n&&(o=c.contains(t))>-1&&(tt((o=c.ranges[o]).from(),t)<0||t.xRel>0)&&(tt(o.to(),t)>0||t.xRel<0)?function(e,t,n,r){var o=e.display,i=!1,c=eo(e,(function(t){s&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:xr(e)),me(o.wrapper.ownerDocument,"mouseup",c),me(o.wrapper.ownerDocument,"mousemove",u),me(o.scroller,"dragstart",d),me(o.scroller,"drop",c),i||(ye(t),r.addNew||Ko(e.doc,n,null,null,r.extend),s&&!p||l&&9==a?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};s&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,de(o.wrapper.ownerDocument,"mouseup",c),de(o.wrapper.ownerDocument,"mousemove",u),de(o.scroller,"dragstart",d),de(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){l&&xr(e);var o=e.display,i=e.doc;ye(t);var a,s,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(s=i.sel.contains(n),a=s>-1?u[s]:new Co(n,n)):(a=i.sel.primary(),s=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Co(n,n)),n=cr(e,t,!0,!0),s=-1;else{var d=vl(e,n,r.unit);a=r.extend?qo(a,d.anchor,d.head,r.extend):d}r.addNew?-1==s?(s=u.length,ei(i,Eo(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==r.unit&&!r.extend?(ei(i,Eo(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Jo(i,s,a,V):(s=0,ei(i,new xo([a],0),V),c=i.sel);var p=n;function m(t){if(0!=tt(p,t))if(p=t,"rectangle"==r.unit){for(var o=[],l=e.options.tabSize,u=F($e(i,n.line).text,n.ch,l),d=F($e(i,t.line).text,t.ch,l),m=Math.min(u,d),h=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 v=$e(i,f).text,b=U(v,m,l);m==h?o.push(new Co(et(f,b),et(f,b))):v.length>b&&o.push(new Co(et(f,b),et(f,U(v,h,l))))}o.length||o.push(new Co(n,n)),ei(i,Eo(e,c.ranges.slice(0,s).concat(o),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,_=a,k=vl(e,t,r.unit),w=_.anchor;tt(k.anchor,w)>0?(y=k.head,w=it(_.from(),k.anchor)):(y=k.anchor,w=ot(_.to(),k.head));var x=c.ranges.slice(0);x[s]=function(e,t){var n=t.anchor,r=t.head,o=$e(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var i=ce(o);if(!i)return t;var l=ae(i,n.ch,n.sticky),a=i[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s,c=l+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==i.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ae(i,r.ch,r.sticky),d=u-l||(r.ch-n.ch)*(1==a.level?-1:1);s=u==c-1||u==c?d<0:d>0}var p=i[c+(s?-1:0)],m=s==(1==p.level),h=m?p.from:p.to,f=m?"after":"before";return n.ch==h&&n.sticky==f?t:new Co(new et(n.line,h,f),r)}(e,new Co(at(i,w),y)),ei(i,Eo(e,x,s),V)}}var h=o.wrapper.getBoundingClientRect(),f=0;function g(t){var n=++f,l=cr(e,t,!0,"rectangle"==r.unit);if(l)if(0!=tt(l,p)){e.curOp.focus=L(),m(l);var a=Tr(o,i);(l.line>=a.to||l.line<a.from)&&setTimeout(eo(e,(function(){f==n&&g(t)})),150)}else{var s=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;s&&setTimeout(eo(e,(function(){f==n&&(o.scroller.scrollTop+=s,g(t))})),50)}}function v(t){e.state.selectingText=!1,f=1/0,t&&(ye(t),o.input.focus()),me(o.wrapper.ownerDocument,"mousemove",b),me(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var b=eo(e,(function(e){0!==e.buttons&&Ce(e)?g(e):v(e)})),y=eo(e,v);e.state.selectingText=y,de(o.wrapper.ownerDocument,"mousemove",b),de(o.wrapper.ownerDocument,"mouseup",y)}(e,r,t,i)}(t,r,i,e):xe(e)==n.scroller&&ye(e):2==o?(r&&Ko(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(x?t.display.input.onContextMenu(e):xr(t)))}}function vl(e,t,n){if("char"==n)return new Co(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Co(et(t.line,0),at(e.doc,et(t.line+1,0)));var r=n(e,t);return new Co(r.from,r.to)}function bl(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&&ye(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(i>a.bottom||!ve(e,n))return ke(t);i-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=l.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=o)return he(e,n,e,Je(e.doc,i),e.display.gutterSpecs[s].className,t),ke(t)}}function yl(e,t){return bl(e,t,"gutterClick",!0)}function _l(e,t){wn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&bl(e,t,"gutterContextMenu",!1)}(e,t)||fe(e,t,"contextmenu")||x||e.display.input.onContextMenu(t)}function kl(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)}fl.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var wl={toString:function(){return"CodeMirror.Init"}},xl={},Cl={};function El(e,t,n){if(!t!=!(n&&n!=wl)){var r=e.display.dragFunctions,o=t?de: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 Sl(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Ut(e)),sr(e),dr(e),Zn(e),setTimeout((function(){return zr(e)}),100)}function Il(e,t){var n=this;if(!(this instanceof Il))return new Il(e,t);this.options=t=t?O(t):{},O(xl,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 Il.inputStyles[t.inputStyle](this),i=this.display=new vo(e,r,o,t);for(var c in i.wrapper.CodeMirror=this,kl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wr(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&&!v&&i.input.focus(),l&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;de(t.scroller,"mousedown",eo(e,gl)),de(t.scroller,"dblclick",l&&a<11?eo(e,(function(t){if(!fe(e,t)){var n=cr(e,t);if(n&&!yl(e,t)&&!wn(e.display,t)){ye(t);var r=e.findWordAt(n);Ko(e.doc,r.anchor,r.head)}}})):function(t){return fe(e,t)||ye(t)}),de(t.scroller,"contextmenu",(function(t){return _l(e,t)})),de(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||_l(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 s(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}de(t.scroller,"touchstart",(function(o){if(!fe(e,o)&&!i(o)&&!yl(e,o)){t.input.ensurePolled(),clearTimeout(n);var l=+new Date;t.activeTouch={start:l,moved:!1,prev:l-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),de(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),de(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!wn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,l=e.coordsChar(t.activeTouch,"page");i=!r.prev||s(r,r.prev)?new Co(l,l):!r.prev.prev||s(r,r.prev.prev)?e.findWordAt(l):new Co(et(l.line,0),at(e.doc,et(l.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),ye(n)}o()})),de(t.scroller,"touchcancel",o),de(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Rr(e,t.scroller.scrollTop),Or(e,t.scroller.scrollLeft,!0),he(e,"scroll",e))})),de(t.scroller,"mousewheel",(function(t){return wo(e,t)})),de(t.scroller,"DOMMouseScroll",(function(t){return wo(e,t)})),de(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){fe(e,t)||we(t)},over:function(t){fe(e,t)||(function(e,t){var n=cr(e,t);if(n){var r=document.createDocumentFragment();br(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),we(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Li<100))we(t);else if(!fe(e,t)&&!wn(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:eo(e,Pi),leave:function(t){fe(e,t)||Di(e)}};var c=t.input.getField();de(c,"keyup",(function(t){return dl.call(e,t)})),de(c,"keydown",eo(e,ul)),de(c,"keypress",eo(e,pl)),de(c,"focus",(function(t){return Cr(e,t)})),de(c,"blur",(function(t){return Er(e,t)}))}(this),Oi(),$r(this),this.curOp.forceUpdate=!0,Mo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Cr(n)}),20):Er(this),Cl)Cl.hasOwnProperty(c)&&Cl[c](this,t[c],wl);mo(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Tl.length;++u)Tl[u](this);Gr(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}Il.defaults=xl,Il.optionHandlers=Cl;var Tl=[];function Nl(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 l=e.options.tabSize,a=$e(i,t),s=F(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&((c=i.mode.indent(o,a.text.slice(u.length),a.text))==z||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>i.first?F($e(i,t-1).text,null,l):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/l);m;--m)p+=l,d+="\t";if(p<c&&(d+=G(c-p)),d!=u)return fi(i,d,et(t,0),et(t,u.length),"+input"),a.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var f=i.sel.ranges[h];if(f.head.line==t&&f.head.ch<u.length){var g=et(t,u.length);Jo(i,h,new Co(g,g));break}}}Il.defineInitHook=function(e){return Tl.push(e)};var Bl=null;function Al(e){Bl=e}function Ll(e,t,n,r,o){var i=e.doc;e.display.shift=!1,r||(r=i.sel);var l=+new Date-200,a="paste"==o||e.state.pasteIncoming>l,s=Ae(t),c=null;if(a&&r.ranges.length>1)if(Bl&&Bl.text.join("\n")==t){if(r.ranges.length%Bl.text.length==0){c=[];for(var u=0;u<Bl.text.length;u++)c.push(i.splitLines(Bl.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=K(s,(function(e){return[e]})));for(var d=e.curOp.updateInput,p=r.ranges.length-1;p>=0;p--){var m=r.ranges[p],h=m.from(),f=m.to();m.empty()&&(n&&n>0?h=et(h.line,h.ch-n):e.state.overwrite&&!a?f=et(f.line,Math.min($e(i,f.line).text.length,f.ch+q(s).length)):a&&Bl&&Bl.lineWise&&Bl.text.join("\n")==s.join("\n")&&(h=f=et(h.line,0)));var g={from:h,to:f,text:c?c[p%c.length]:s,origin:o||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};ui(e.doc,g),sn(e,"inputRead",e,g)}t&&!a&&Dl(e,t),Ar(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Pl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,(function(){return Ll(t,n,0,null,"paste")})),!0}function Dl(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),l=!1;if(i.electricChars){for(var a=0;a<i.electricChars.length;a++)if(t.indexOf(i.electricChars.charAt(a))>-1){l=Nl(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test($e(e.doc,o.head.line).text.slice(0,o.head.ch))&&(l=Nl(e,o.head.line,"smart"));l&&sn(e,"electricInput",e,o.head.line)}}}function Rl(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:et(o,0),head:et(o+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function Ml(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ol(){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 s?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Ml(e),t}function Fl(e,t,n,r,o){var i=t,l=n,a=$e(e,t.line),s=o&&"rtl"==e.direction?-n:n;function c(i){var l,c;if("codepoint"==r){var u=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))l=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;l=new et(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(d?2:1))),-n)}}else l=o?function(e,t,n,r){var o=ce(t,e.doc.direction);if(!o)return Qi(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=ae(o,n.ch,n.sticky),l=o[i];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return Qi(t,n,r);var a,s=function(e,n){return Xi(t,e instanceof et?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(a=a||Ln(e,t),Xn(e,t,a,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==l.level){var d=1==l.level==r<0,p=s(n,d?1:-1);if(null!=p&&(d?p<=l.to&&p<=u.end:p>=l.from&&p>=u.begin)){var m=d?"before":"after";return new et(n.line,p,m)}}var h=function(e,t,r){for(var i=function(e,t){return t?new et(n.line,s(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<o.length;e+=t){var l=o[e],a=t>0==(1!=l.level),c=a?r.begin:s(r.end,-1);if(l.from<=c&&c<l.to)return i(c,a);if(c=a?l.from:s(l.to,-1),r.begin<=c&&c<r.end)return i(c,a)}},f=h(i+r,r,u);if(f)return f;var g=r>0?u.end:s(u.begin,-1);return null==g||r>0&&g==t.text.length||!(f=h(r>0?0:o.length-1,r,c(g)))?null:f}(e.cm,a,t,n):Qi(a,t,n);if(null==l){if(i||((c=t.line+s)<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(a=$e(e,c)))))return!1;t=el(o,e.cm,a,t.line,s)}else t=l;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"),m=!0;!(n<0)||c(!m);m=!1){var h=a.text.charAt(t.ch)||"\n",f=ee(h,p)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||m||f||(f="s"),u&&u!=f){n<0&&(n=1,c(),t.sticky="after");break}if(f&&(u=f),n>0&&!c(!m))break}var g=li(e,t,i,l,!0);return nt(i,g)&&(g.hitSide=!0),g}function jl(e,t,n,r){var o,i,l=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*rr(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=Yn(e,a,o)).outside;){if(n<0?o<=0:o>=l.height){i.hitSide=!0;break}o+=5*n}return i}var Zl=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 zl(e,t){var n=An(e,t.line);if(!n||n.hidden)return null;var r=$e(e.doc,t.line),o=Nn(n,r,t.line),i=ce(r,e.doc.direction),l="left";i&&(l=ae(i,t.ch)%2?"right":"left");var a=Mn(o.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function Hl(e,t){return t&&(e.bad=!0),e}function Vl(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Hl(e.clipPos(et(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 Wl(i,t,n)}}function Wl(e,t,n){var r=e.text.firstChild,o=!1;if(!t||!A(r,t))return Hl(et(Ye(e.line),0),!0);if(t==r&&(o=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?q(e.rest):e.line;return Hl(et(Ye(i),i.text.length),o)}var l=3==t.nodeType?t:null,a=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var s=e.measure,c=s.maps;function u(t,n,r){for(var o=-1;o<(c?c.length:0);o++)for(var i=o<0?s.map:c[o],l=0;l<i.length;l+=3){var a=i[l+2];if(a==t||a==n){var u=Ye(o<0?e.line:e.rest[o]),d=i[l]+r;return(r<0||a!=t)&&(d=i[l+(r?1:0)]),et(u,d)}}}var d=u(l,a,n);if(d)return Hl(d,o);for(var p=a.nextSibling,m=l?l.nodeValue.length-n:0;p;p=p.nextSibling){if(d=u(p,p.firstChild,0))return Hl(et(d.line,d.ch-m),o);m+=p.textContent.length}for(var h=a.previousSibling,f=n;h;h=h.previousSibling){if(d=u(h,h.firstChild,-1))return Hl(et(d.line,d.ch+f),o);f+=h.textContent.length}}Zl.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 l(e){if(i(e)&&!fe(r,e)){if(r.somethingSelected())Al({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Rl(r);Al({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 l=Bl.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l)return void e.preventDefault()}var a=Ol(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=Bl.text.join("\n");var c=L();R(s),setTimeout((function(){r.display.lineSpace.removeChild(a),c.focus(),c==o&&n.showPrimarySelection()}),50)}}o.contentEditable=!0,Ml(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),de(o,"paste",(function(e){!i(e)||fe(r,e)||Pl(e,r)||a<=11&&setTimeout(eo(r,(function(){return t.updateFromDOM()})),20)})),de(o,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),de(o,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),de(o,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),de(o,"touchstart",(function(){return n.forceCompositionEnd()})),de(o,"input",(function(){t.composing||t.readFromDOMSoon()})),de(o,"copy",l),de(o,"cut",l)},Zl.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Zl.prototype.prepareSelection=function(){var e=vr(this.cm,!1);return e.focus=L()==this.div,e},Zl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Zl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Zl.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 l=Vl(t,e.anchorNode,e.anchorOffset),a=Vl(t,e.focusNode,e.focusOffset);if(!l||l.bad||!a||a.bad||0!=tt(it(l,a),o)||0!=tt(ot(l,a),i)){var s=t.display.view,c=o.line>=t.display.viewFrom&&zl(t,o)||{node:s[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&zl(t,i);if(!u){var d=s[s.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 m,h=e.rangeCount&&e.getRangeAt(0);try{m=E(c.node,c.offset,u.offset,u.node)}catch(e){}m&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),m.collapsed||(e.removeAllRanges(),e.addRange(m))):(e.removeAllRanges(),e.addRange(m)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Zl.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)},Zl.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},Zl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Zl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},Zl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&L()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Zl.prototype.blur=function(){this.div.blur()},Zl.prototype.getField=function(){return this.div},Zl.prototype.supportsTouch=function(){return!0},Zl.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):Qr(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))}))},Zl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Zl.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=Vl(t,e.anchorNode,e.anchorOffset),r=Vl(t,e.focusNode,e.focusOffset);n&&r&&Qr(t,(function(){ei(t.doc,So(n,r),H),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Zl.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(),l=i.from(),a=i.to();if(0==l.ch&&l.line>r.firstLine()&&(l=et(l.line-1,$e(r.doc,l.line-1).length)),a.ch==$e(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=et(a.line+1,0)),l.line<o.viewFrom||a.line>o.viewTo-1)return!1;l.line==o.viewFrom||0==(e=ur(r,l.line))?(t=Ye(o.view[0].line),n=o.view[0].node):(t=Ye(o.view[e].line),n=o.view[e-1].node.nextSibling);var s,c,u=ur(r,a.line);if(u==o.view.length-1?(s=o.viewTo-1,c=o.lineDiv.lastChild):(s=Ye(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="",l=!1,a=e.doc.lineSeparator(),s=!1;function c(){l&&(i+=a,s&&(i+=a),l=s=!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 m=e.findMarks(et(r,0),et(o+1,0),(g=+p,function(e){return e.id==g}));return void(m.length&&(i=m[0].find(0))&&u(Ge(e.doc,i.from,i.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&c();for(var f=0;f<t.childNodes.length;f++)d(t.childNodes[f]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),h&&(l=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;d(t),t!=n;)t=t.nextSibling,s=!1;return i}(r,n,c,t,s)),p=Ge(r.doc,et(t,0),et(s,$e(r.doc,s).text.length));d.length>1&&p.length>1;)if(q(d)==q(p))d.pop(),p.pop(),s--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var m=0,h=0,f=d[0],g=p[0],v=Math.min(f.length,g.length);m<v&&f.charCodeAt(m)==g.charCodeAt(m);)++m;for(var b=q(d),y=q(p),_=Math.min(b.length-(1==d.length?m:0),y.length-(1==p.length?m:0));h<_&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)++h;if(1==d.length&&1==p.length&&t==l.line)for(;m&&m>l.ch&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)m--,h++;d[d.length-1]=b.slice(0,b.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(m).replace(/\u200b+$/,"");var k=et(t,m),w=et(s,p.length?q(p).length-h:0);return d.length>1||d[0]||tt(k,w)?(fi(r.doc,d,k,w,"+input"),!0):void 0},Zl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zl.prototype.reset=function(){this.forceCompositionEnd()},Zl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Zl.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))},Zl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return dr(e.cm)}))},Zl.prototype.setUneditable=function(e){e.contentEditable="false"},Zl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||eo(this.cm,Ll)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Zl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Zl.prototype.onContextMenu=function(){},Zl.prototype.resetPosition=function(){},Zl.prototype.needsContentAttribute=!0;var Ul=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};Ul.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!fe(r,e)){if(r.somethingSelected())Al({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Rl(r);Al({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,H):(n.prevInput="",o.value=t.text.join("\n"),R(o))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(o.style.width="0px"),de(o,"input",(function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),de(o,"paste",(function(e){fe(r,e)||Pl(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),de(o,"cut",i),de(o,"copy",i),de(e.scroller,"paste",(function(t){if(!wn(e,t)&&!fe(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)}})),de(e.lineSpace,"selectstart",(function(t){wn(e,t)||ye(t)})),de(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"})}})),de(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ul.prototype.createField=function(e){this.wrapper=Ol(),this.textarea=this.wrapper.firstChild},Ul.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ul.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var o=Gn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+l.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+l.left-i.left))}return r},Ul.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")},Ul.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&&R(this.textarea),l&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null))}},Ul.prototype.getField=function(){return this.textarea},Ul.prototype.supportsTouch=function(){return!1},Ul.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ul.prototype.blur=function(){this.textarea.blur()},Ul.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ul.prototype.receivedFocus=function(){this.slowPoll()},Ul.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ul.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))}))},Ul.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Le(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(l&&a>=9&&this.hasSelection===o||b&&/[\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 s=0,c=Math.min(r.length,o.length);s<c&&r.charCodeAt(s)==o.charCodeAt(s);)++s;return Qr(t,(function(){Ll(t,o.slice(s),r.length-s,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},Ul.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ul.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},Ul.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=cr(n,e),c=r.scroller.scrollTop;if(i&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&eo(n,ei)(n.doc,So(i),H);var u,p=o.style.cssText,m=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n      z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(u=window.scrollY),r.input.focus(),s&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&a>=9&&g(),x){we(e);var f=function(){me(window,"mouseup",f),setTimeout(v,20)};de(window,"mouseup",f)}else setTimeout(v,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 v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,o.style.cssText=p,l&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!l||l&&a<9)&&g();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?eo(n,si)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},Ul.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Ul.prototype.setUneditable=function(){},Ul.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!=wl&&o(e,t,n)}:o)}e.defineOption=n,e.Init=wl,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){Lo(e),Zn(e),dr(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(et(r,i))}r++}));for(var o=n.length-1;o>=0;o--)fi(e.doc,t,n[o],et(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!=wl&&e.refresh()})),n("specialCharPlaceholder",Xt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"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){kl(e),go(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Yi(t),o=n!=wl&&Yi(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Sl,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=ho(t,e.options.lineNumbers),go(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?lr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return zr(e)}),!0),n("scrollbarStyle","native",(function(e){Wr(e),zr(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=ho(e.options.gutters,t),go(e)}),!0),n("firstLineNumber",1,go,!0),n("lineNumberFormatter",(function(e){return e}),go,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Er(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,El),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Lo,!0),n("addModeClass",!1,Lo,!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,Lo,!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)}(Il),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)&&eo(this,t[e])(this,n,o),he(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"](Yi(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:to((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++,dr(this)})),removeOverlay:to((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 dr(this)}})),indentLine:to((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Xe(this.doc,e)&&Nl(this,e,t,n)})),indentSelection:to((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&&(Nl(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&Ar(this));else{var i=o.from(),l=o.to(),a=Math.max(n,i.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s<n;++s)Nl(this,s,e);var c=this.doc.sel.ranges;0==i.ch&&t.length==c.length&&c[r].from().ch>0&&Jo(this.doc,r,new Co(i,c[r].to()),H)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=at(this.doc,e);var t,n=pt(this,$e(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var l=r+o>>1;if((l?n[2*l-1]:0)>=i)o=l;else{if(!(n[2*l+1]<i)){t=n[2*l+2];break}r=l+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-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 l=0;l<i[t].length;l++){var a=o[i[t][l]];a&&r.push(a)}else i.helperType&&o[i.helperType]?r.push(o[i.helperType]):o[i.name]&&r.push(o[i.name]);for(var s=0;s<o._global.length;s++){var c=o._global[s];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=lt(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Gn(this,null==e?n.head:"object"==typeof e?at(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return $n(this,at(this.doc,e),t||"page")},coordsChar:function(e,t){return Yn(this,(e=Un(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Un(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=$e(this.doc,e)}else r=e;return Wn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Vt(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return or(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i,l,a,s=this.display,c=(e=Gn(this,at(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(s.wrapper.clientHeight,this.doc.height),p=Math.max(s.sizer.clientWidth,s.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=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(i=this,l={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(a=Nr(i,l)).scrollTop&&Rr(i,a.scrollTop),null!=a.scrollLeft&&Or(i,a.scrollLeft))},triggerOnKeyDown:to(ul),triggerOnKeyPress:to(pl),triggerOnKeyUp:dl,triggerOnMouseDown:to(gl),execCommand:function(e){if(tl.hasOwnProperty(e))return tl[e].call(null,this)},triggerElectric:to((function(e){Dl(this,e)})),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=at(this.doc,e),l=0;l<t&&!(i=Fl(this.doc,i,o,n,r)).hitSide;++l);return i},moveH:to((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Fl(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),W)})),deleteH:to((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ji(this,(function(n){var o=Fl(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 l=at(this.doc,e),a=0;a<t;++a){var s=Gn(this,l,"div");if(null==i?i=s.left:s.left=i,(l=jl(this,s,o,n)).hitSide)break}return l},moveV:to((function(e,t){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(l){if(i)return e<0?l.from():l.to();var a=Gn(n,l.head,"div");null!=l.goalColumn&&(a.left=l.goalColumn),o.push(a.left);var s=jl(n,a,e,t);return"page"==t&&l==r.sel.primary()&&Br(n,$n(n,s,"div").top-a.top),s}),W),o.length)for(var l=0;l<r.sel.ranges.length;l++)r.sel.ranges[l].goalColumn=o[l]})),findWordAt:function(e){var t=$e(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),l=ee(i,o)?function(e){return ee(e,o)}:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&l(t.charAt(n-1));)--n;for(;r<t.length&&l(t.charAt(r));)++r}return new Co(et(e.line,n),et(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),he(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==L()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:to((function(e,t){Lr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Sn(this)-this.display.barHeight,width:e.scrollWidth-Sn(this)-this.display.barWidth,clientHeight:Tn(this),clientWidth:In(this)}},scrollIntoView:to((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:et(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){Pr(e),e.curOp.scrollToPos=t}(this,e):Dr(this,e.from,e.to,e.margin)})),setSize:to((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&&jn(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){pr(n,o,"widget");break}++o})),this.curOp.forceUpdate=!0,he(this,"refresh",this)})),operation:function(e){return Qr(this,e)},startOperation:function(){return $r(this)},endOperation:function(){return Gr(this)},refresh:to((function(){var e=this.display.cachedTextHeight;dr(this),this.curOp.forceUpdate=!0,Zn(this),Lr(this,this.doc.scrollLeft,this.doc.scrollTop),co(this.display),(null==e||Math.abs(e-rr(this.display))>.5||this.options.lineWrapping)&&sr(this),he(this,"refresh",this)})),swapDoc:to((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Mo(this,e),Zn(this),this.display.input.reset(),Lr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sn(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}},be(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})}}(Il);var $l="iter insert remove copy getEditor constructor".split(" ");for(var Gl in Ai.prototype)Ai.prototype.hasOwnProperty(Gl)&&Z($l,Gl)<0&&(Il.prototype[Gl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ai.prototype[Gl]));return be(Ai),Il.inputStyles={textarea:Ul,contenteditable:Zl},Il.defineMode=function(e){Il.defaults.mode||"null"==e||(Il.defaults.mode=e),Oe.apply(this,arguments)},Il.defineMIME=function(e,t){Me[e]=t},Il.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Il.defineMIME("text/plain","null"),Il.defineExtension=function(e,t){Il.prototype[e]=t},Il.defineDocExtension=function(e,t){Ai.prototype[e]=t},Il.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=L();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var o;if(e.form&&(de(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var l=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=l}}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 a=Il((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=me,e.on=de,e.wheelEventPixels=ko,e.Doc=Ai,e.splitLines=Ae,e.countColumn=F,e.findColumn=U,e.isWordChar=Q,e.Pass=z,e.signal=he,e.Line=$t,e.changeEnd=Io,e.scrollbarModel=Vr,e.Pos=et,e.cmpPos=tt,e.modes=Re,e.mimeModes=Me,e.resolveMode=Fe,e.getMode=je,e.modeExtensions=Ze,e.extendMode=ze,e.copyState=He,e.startState=We,e.innerMode=Ve,e.commands=tl,e.keyMap=Vi,e.keyName=Ki,e.isModifierKey=Gi,e.lookupKey=$i,e.normalizeKeyMap=Ui,e.StringStream=Ue,e.SharedTextMarker=Ii,e.TextMarker=Ei,e.LineWidget=wi,e.e_preventDefault=ye,e.e_stopPropagation=_e,e.e_stop=we,e.addClass=P,e.contains=A,e.rmClass=S,e.keyNames=ji}(Il),Il.version="5.65.2",Il}()},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,l=t.indentUnit,a=n.tokenHooks,s=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},d=n.mediaValueKeywords||{},p=n.propertyKeywords||{},m=n.nonStandardPropertyKeywords||{},h=n.fontProperties||{},f=n.counterDescriptors||{},g=n.colorKeywords||{},v=n.valueKeywords||{},b=n.allowNested,y=n.lineComment,_=!0===n.supportsAtComponent,k=!1!==t.highlightNonStandardPropertyKeywords;function w(e,t){return o=t,e}function x(e,t){var n=e.next();if(a[n]){var r=a[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=E),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 E(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:l),e.context),n}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function N(e,t,n){return L[n.context.type](e,t,n)}function B(e,t,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return N(e,t,n)}function A(e){var t=e.current().toLowerCase();i=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var L={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(b&&"("==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"):m.hasOwnProperty(r)?(i=k?"string-2":"property","maybeprop"):b?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?L.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&&b)return I(n,t,"propBlock");if("}"==e||"{"==e)return B(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)A(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?B(e,t,n):")"==e?T(n):"("==e?I(n,t,"parens"):"interpolation"==e?I(n,t,"interpolation"):("word"==e&&A(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&&s.hasOwnProperty(t.current())?(i="tag",n.context.type):L.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return I(n,t,"atBlock_parens");if("}"==e||";"==e)return B(e,t,n);if("{"==e)return T(n)&&I(n,t,b?"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":m.hasOwnProperty(r)?k?"string-2":"property":v.hasOwnProperty(r)?"atom":g.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?B(e,t,n):"{"==e?T(n)&&I(n,t,b?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?T(n):"{"==e||"}"==e?B(e,t,n,2):L.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&&!h.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?B(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?T(n):"{"==e||";"==e?B(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||x)(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(t.state=L[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-l)):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),l=["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"],a=t(l),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(s),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"],m=t(p),h=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"],v=t(g),b=["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(b),_=n.concat(o).concat(l).concat(s).concat(u).concat(p).concat(g).concat(b);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:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:h,counterDescriptors:f,colorKeywords:v,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:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:v,valueKeywords:y,fontProperties:h,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:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:v,valueKeywords:y,fontProperties:h,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:a,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:h,counterDescriptors:f,colorKeywords:v,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 l=e[i];Array.isArray(l)?l.forEach((function(e){r(e,o)})):l&&"object"==typeof l&&r(l,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,l=1;function a(e){var t=e.match(/\n/g);t&&(i+=t.length);var n=e.lastIndexOf("\n");l=~n?e.length-n:l+e.length}function s(){var e={line:i,column:l};return function(t){return t.position=new c(e),g(),t}}function c(e){this.start=e,this.end={line:i,column:l},this.source=o.source}c.prototype.content=e;var u=[];function d(t){var n=new Error(o.source+":"+i+":"+l+": "+t);if(n.reason=t,n.filename=o.source,n.line=i,n.column=l,n.source=e,!o.silent)throw n;u.push(n)}function p(){return f(/^{\s*/)}function m(){return f(/^}/)}function h(){var t,n,r,o=[];for(g(),v(o);e.length&&"}"!=e.charAt(0)&&(t=T()||(n=void 0,r=void 0,n=s(),(r=y())?(v(),n({type:"rule",selectors:r,declarations:k()})):d("selector missing")));)!1!==t&&(o.push(t),v(o));return o}function f(t){var n=t.exec(e);if(n){var r=n[0];return a(r),e=e.slice(r.length),n}}function g(){f(/^\s*/)}function v(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=s();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 l+=2,a(r),e=e.slice(n),l+=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=s(),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(v(t);e=_();)!1!==e&&(t.push(e),v(t));return m()?t:d("missing '}'")}function w(){for(var e,t=[],n=s();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 x,C=I("import"),E=I("charset"),S=I("namespace");function I(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=s(),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=s();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=v();r=w();)i.push(r),i=i.concat(v());return m()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):d("@keyframes missing '}'")}}()||function(){var e=s(),t=f(/^@media *([^{]+)/);if(t){var r=n(t[1]);if(!p())return d("@media missing '{'");var o=v().concat(h());return m()?e({type:"media",media:r,rules:o}):d("@media missing '}'")}}()||function(){var e=s(),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=s(),t=f(/^@supports *([^{]+)/);if(t){var r=n(t[1]);if(!p())return d("@supports missing '{'");var o=v().concat(h());return m()?e({type:"supports",supports:r,rules:o}):d("@supports missing '}'")}}()||C()||E()||S()||function(){var e=s(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=n(t[1]),o=n(t[2]);if(!p())return d("@document missing '{'");var i=v().concat(h());return m()?e({type:"document",document:o,vendor:r,rules:i}):d("@document missing '}'")}}()||function(){var e=s();if(f(/^@page */)){var t=y()||[];if(!p())return d("@page missing '{'");for(var n,r=v();n=_();)r.push(n),r=r.concat(v());return m()?e({type:"page",selectors:t,declarations:r}):d("@page missing '}'")}}()||function(){var e=s();if(f(/^@host\s*/)){if(!p())return d("@host missing '{'");var t=v().concat(h());return m()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=s();if(f(/^@font-face\s*/)){if(!p())return d("@font-face missing '{'");for(var t,n=v();t=_();)n.push(t),n=n.concat(v());return m()?e({type:"font-face",declarations:n}):d("@font-face missing '}'")}}()}return r((x=h(),{type:"stylesheet",stylesheet:{source:o.source,rules:x,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 l=i.compile(e);return i.applySourceMaps(),{code:l,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),l=n(37019),a=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 s=function(e){return"\\"===a.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e};t.updatePosition=function(e){var t=e.match(/\n/g);t&&(this.position.line+=t.length);var n=e.lastIndexOf("\n");this.position.column=~n?e.length-n:this.position.column+e.length},t.emit=function(e,t){if(t){var n=s(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,l.readFileSync);if(n){var r=new o(n.map),c=n.sourcesRelativeTo;this.map.applySourceMap(r,e,s(a.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 l=Object.keys(t),a=0;a<l.length;a++){var s=l[a];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}}},22897:function(e,t){"use strict";function n(){}function r(e,t,n,r,o){for(var i=0,l=t.length,a=0,s=0;i<l;i++){var c=t[i];if(c.removed){if(c.value=e.join(r.slice(s,s+c.count)),s+=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(a,a+c.count);d=d.map((function(e,t){var n=r[s+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(s+=c.count)}}var p=t[l-1];return l>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[l-2].value+=p.value,t.pop()),t}function o(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.callback;"function"==typeof n&&(i=n,n={}),this.options=n;var l=this;function a(e){return i?(setTimeout((function(){i(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,c=e.length,u=1,d=s+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=s&&m+1>=c)return a([{value:this.join(t),count:t.length}]);function h(){for(var n=-1*u;n<=u;n+=2){var i=void 0,d=p[n-1],m=p[n+1],h=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var f=d&&d.newPos+1<s,g=m&&0<=h&&h<c;if(f||g){if(!f||g&&d.newPos<m.newPos?(i=o(m),l.pushComponent(i.components,void 0,!0)):((i=d).newPos++,l.pushComponent(i.components,!0,void 0)),h=l.extractCommon(i,t,e,n),i.newPos+1>=s&&h+1>=c)return a(r(l,i.components,t,e,l.useLongestToken));p[n]=i}else p[n]=void 0}u++}if(i)!function e(){setTimeout((function(){if(u>d)return i();h()||e()}),0)}();else for(;u<=d;){var f=h();if(f)return f}},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,l=e.newPos,a=l-r,s=0;l+1<o&&a+1<i&&this.equals(t[l+1],n[a+1]);)l++,a++,s++;return s&&e.components.push({count:s}),e.newPos=l,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},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,l=document.createElement(i);l.innerHTML="&nbsp;","TEXTAREA"===i.toUpperCase()&&l.setAttribute("rows","1");var a=r(e,"font-size");l.style.fontSize=a,l.style.padding="0px",l.style.border="0px";var s=document.body;s.appendChild(l),n=l.offsetHeight,s.removeChild(l)}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,l,a,s,c,u,d,p,m,h,f,g=!1;function v(){if(!g){g=!0;var e=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),b=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),h=/FBAN\/\w+;/i.exec(e),f=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var y=/(?:Trident\/(\d+.\d+))/.exec(e);l=y?parseFloat(y[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,r=v[3]?parseFloat(v[3]):NaN,(o=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),i=v&&v[1]?parseFloat(v[1]):NaN):i=NaN}else t=n=r=i=o=NaN;if(b){if(b[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!_||parseFloat(_[1].replace("_","."))}else a=!1;s=!!b[2],c=!!b[3]}else a=s=c=!1}}var b={ie:function(){return v()||t},ieCompatibilityMode:function(){return v()||l>t},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||r},webkit:function(){return v()||o},safari:function(){return b.webkit()},chrome:function(){return v()||i},windows:function(){return v()||s},osx:function(){return v()||a},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||f},nativeApp:function(){return v()||h},android:function(){return v()||u},ipad:function(){return v()||m}};e.exports=b},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 l=document.createElement("div");l.setAttribute(n,"return;"),i="function"==typeof l[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},74870: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 l,a=2147483647,s=36,c=/^xn--/,u=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,h=String.fromCharCode;function f(e){throw RangeError(p[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function v(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(d,".")).split("."),t).join(".")}function b(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 y(e){return g(e,(function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+h(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,n){var r=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;r+=s)e=m(e/35);return m(r+36*e/(e+38))}function w(e){var t,n,r,o,i,l,c,u,d,p,h,g=[],v=e.length,b=0,_=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&f("not-basic"),g.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<v;){for(i=b,l=1,c=s;o>=v&&f("invalid-input"),((u=(h=e.charCodeAt(o++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:s)>=s||u>m((a-b)/l))&&f("overflow"),b+=u*l,!(u<(d=c<=w?1:c>=w+26?26:c-w));c+=s)l>m(a/(p=s-d))&&f("overflow"),l*=p;w=k(b-i,t=g.length+1,0==i),m(b/t)>a-_&&f("overflow"),_+=m(b/t),b%=t,g.splice(b++,0,_)}return y(g)}function x(e){var t,n,r,o,i,l,c,u,d,p,g,v,y,w,x,C=[];for(v=(e=b(e)).length,t=128,n=0,i=72,l=0;l<v;++l)(g=e[l])<128&&C.push(h(g));for(r=o=C.length,o&&C.push("-");r<v;){for(c=a,l=0;l<v;++l)(g=e[l])>=t&&g<c&&(c=g);for(c-t>m((a-n)/(y=r+1))&&f("overflow"),n+=(c-t)*y,t=c,l=0;l<v;++l)if((g=e[l])<t&&++n>a&&f("overflow"),g==t){for(u=n,d=s;!(u<(p=d<=i?1:d>=i+26?26:d-i));d+=s)x=u-p,w=s-p,C.push(h(_(p+x%w,0))),u=m(x/w);C.push(h(_(u,0))),i=k(n,y,r==o),n=0,++r}++n,++t}return C.join("")}l={version:"1.3.2",ucs2:{decode:b,encode:y},decode:w,encode:x,toASCII:function(e){return v(e,(function(e){return u.test(e)?"xn--"+x(e):e}))},toUnicode:function(e){return v(e,(function(e){return c.test(e)?w(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return l}.call(t,n,t,e))||(e.exports=r)}()},55240:function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,o){n=n||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var l=/\+/g;e=e.split(n);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var c=0;c<s;++c){var u,d,p,m,h=e[c].replace(l,"%20"),f=h.indexOf(r);f>=0?(u=h.substr(0,f),d=h.substr(f+1)):(u=h,d=""),p=decodeURIComponent(u),m=decodeURIComponent(d),t(i,p)?Array.isArray(i[p])?i[p].push(m):i[p]=[i[p],m]:i[p]=m}return i}},3907:function(e){"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,o){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(o){var i=encodeURIComponent(t(o))+r;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(t(e))})).join(n):i+encodeURIComponent(t(e[o]))})).join(n):o?encodeURIComponent(t(o))+r+encodeURIComponent(t(e)):""}},54415:function(e,t,n){"use strict";t.decode=t.parse=n(55240),t.encode=t.stringify=n(3907)},19592: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},l=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 a=n(49231),s=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),s=l(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",i({},s,{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:s.number,maxRows:s.number,onResize:s.func,innerRef:s.any,async:s.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,i({},e,{innerRef:t}))}))},86683:function(e,t,n){"use strict";var r=n(19592);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={},l={},a={},s=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 l=n+" sub-extension "+o+": ",a=e[o];if("object"!=typeof a)return r.valid=!1,r.error=l+"must be an object, but "+typeof a+" given",r;if(!i.helper.isString(a.type))return r.valid=!1,r.error=l+'property "type" must be a string, but '+typeof a.type+" given",r;var s=a.type=a.type.toLowerCase();if("language"===s&&(s=a.type="lang"),"html"===s&&(s=a.type="output"),"lang"!==s&&"output"!==s&&"listener"!==s)return r.valid=!1,r.error=l+"type "+s+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',r;if("listener"===s){if(i.helper.isUndefined(a.listeners))return r.valid=!1,r.error=l+'. Extensions of type "listener" must have a property called "listeners"',r}else if(i.helper.isUndefined(a.filter)&&i.helper.isUndefined(a.regex))return r.valid=!1,r.error=l+s+' extensions must define either a "regex" property or a "filter" method',r;if(a.listeners){if("object"!=typeof a.listeners)return r.valid=!1,r.error=l+'"listeners" property must be an object but '+typeof a.listeners+" given",r;for(var c in a.listeners)if(a.listeners.hasOwnProperty(c)&&"function"!=typeof a.listeners[c])return r.valid=!1,r.error=l+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+c+" must be a function but "+typeof a.listeners[c]+" given",r}if(a.filter){if("function"!=typeof a.filter)return r.valid=!1,r.error=l+'"filter" must be a function, but '+typeof a.filter+" given",r}else if(a.regex){if(i.helper.isString(a.regex)&&(a.regex=new RegExp(a.regex,"g")),!(a.regex instanceof RegExp))return r.valid=!1,r.error=l+'"regex" property must either be a string or a RegExp object, but '+typeof a.regex+" given",r;if(i.helper.isUndefined(a.replace))return r.valid=!1,r.error=l+'"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 s[e]=t,this},i.getOption=function(e){"use strict";return s[e]},i.getOptions=function(){"use strict";return s},i.resetOptions=function(){"use strict";s=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)&&(s[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(l.hasOwnProperty(e))return l[e];throw Error("SubParser named "+e+" not registered!")}l[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(!a.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return a[e]}"function"==typeof t&&(t=t()),i.helper.isArray(t)||(t=[t]);var n=d(t,e);if(!n.valid)throw Error(n.error);a[e]=t},i.getAllExtensions=function(){"use strict";return a},i.removeExtension=function(e){"use strict";delete a[e]},i.resetExtensions=function(){"use strict";a={}},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(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")};var m=function(e,t,n,r){"use strict";var o,i,l,a,s,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,"")),m=[];do{for(o=0;l=d.exec(e);)if(p.test(l[0]))o++||(a=(i=d.lastIndex)-l[0].length);else if(o&&!--o){s=l.index+l[0].length;var h={left:{start:a,end:i},match:{start:i,end:l.index},right:{start:l.index,end:s},wholeMatch:{start:a,end:s}};if(m.push(h),!u)return m}}while(o&&(d.lastIndex=i));return m};i.helper.matchRecursiveRegExp=function(e,t,n,r){"use strict";for(var o=m(e,t,n,r),i=[],l=0;l<o.length;++l)i.push([e.slice(o[l].wholeMatch.start,o[l].wholeMatch.end),e.slice(o[l].match.start,o[l].match.end),e.slice(o[l].left.start,o[l].left.end),e.slice(o[l].right.start,o[l].right.end)]);return i},i.helper.replaceRecursiveRegExp=function(e,t,n,r,o){"use strict";if(!i.helper.isFunction(t)){var l=t;t=function(){return l}}var a=m(e,n,r,o),s=e,c=a.length;if(c>0){var u=[];0!==a[0].wholeMatch.start&&u.push(e.slice(0,a[0].wholeMatch.start));for(var d=0;d<c;++d)u.push(t(e.slice(a[d].wholeMatch.start,a[d].wholeMatch.end),e.slice(a[d].match.start,a[d].match.end),e.slice(a[d].left.start,a[d].left.end),e.slice(a[d].right.start,a[d].right.end))),d<c-1&&u.push(e.slice(a[d].wholeMatch.end,a[d+1].wholeMatch.start));a[c-1].wholeMatch.end<e.length&&u.push(e.slice(a[c-1].wholeMatch.end)),s=u.join("")}return s},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:"⛹️&zwj;♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴&zwj;♀️",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:"👱&zwj;♀️",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:"🙇&zwj;♀️",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:"👷&zwj;♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨&zwj;❤️&zwj;👨",couple_with_heart_woman_woman:"👩&zwj;❤️&zwj;👩",couplekiss_man_man:"👨&zwj;❤️&zwj;💋&zwj;👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩&zwj;❤️&zwj;💋&zwj;👩",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:"👯&zwj;♂️",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:"👁&zwj;🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨&zwj;👦",family_man_boy_boy:"👨&zwj;👦&zwj;👦",family_man_girl:"👨&zwj;👧",family_man_girl_boy:"👨&zwj;👧&zwj;👦",family_man_girl_girl:"👨&zwj;👧&zwj;👧",family_man_man_boy:"👨&zwj;👨&zwj;👦",family_man_man_boy_boy:"👨&zwj;👨&zwj;👦&zwj;👦",family_man_man_girl:"👨&zwj;👨&zwj;👧",family_man_man_girl_boy:"👨&zwj;👨&zwj;👧&zwj;👦",family_man_man_girl_girl:"👨&zwj;👨&zwj;👧&zwj;👧",family_man_woman_boy_boy:"👨&zwj;👩&zwj;👦&zwj;👦",family_man_woman_girl:"👨&zwj;👩&zwj;👧",family_man_woman_girl_boy:"👨&zwj;👩&zwj;👧&zwj;👦",family_man_woman_girl_girl:"👨&zwj;👩&zwj;👧&zwj;👧",family_woman_boy:"👩&zwj;👦",family_woman_boy_boy:"👩&zwj;👦&zwj;👦",family_woman_girl:"👩&zwj;👧",family_woman_girl_boy:"👩&zwj;👧&zwj;👦",family_woman_girl_girl:"👩&zwj;👧&zwj;👧",family_woman_woman_boy:"👩&zwj;👩&zwj;👦",family_woman_woman_boy_boy:"👩&zwj;👩&zwj;👦&zwj;👦",family_woman_woman_girl:"👩&zwj;👩&zwj;👧",family_woman_woman_girl_boy:"👩&zwj;👩&zwj;👧&zwj;👦",family_woman_woman_girl_girl:"👩&zwj;👩&zwj;👧&zwj;👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️&zwj;♀️",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:"🙍&zwj;♂️",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:"🏌️&zwj;♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂&zwj;♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇&zwj;♂️",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:"👨&zwj;🎨",man_astronaut:"👨&zwj;🚀",man_cartwheeling:"🤸&zwj;♂️",man_cook:"👨&zwj;🍳",man_dancing:"🕺",man_facepalming:"🤦&zwj;♂️",man_factory_worker:"👨&zwj;🏭",man_farmer:"👨&zwj;🌾",man_firefighter:"👨&zwj;🚒",man_health_worker:"👨&zwj;⚕️",man_in_tuxedo:"🤵",man_judge:"👨&zwj;⚖️",man_juggling:"🤹&zwj;♂️",man_mechanic:"👨&zwj;🔧",man_office_worker:"👨&zwj;💼",man_pilot:"👨&zwj;✈️",man_playing_handball:"🤾&zwj;♂️",man_playing_water_polo:"🤽&zwj;♂️",man_scientist:"👨&zwj;🔬",man_shrugging:"🤷&zwj;♂️",man_singer:"👨&zwj;🎤",man_student:"👨&zwj;🎓",man_teacher:"👨&zwj;🏫",man_technologist:"👨&zwj;💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆&zwj;♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼&zwj;♂️",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:"🚵&zwj;♀️",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:"🙅&zwj;♂️",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:"🙆&zwj;♂️",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:"👮&zwj;♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎&zwj;♂️",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:"🏳️&zwj;🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋&zwj;♂️",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:"🚣&zwj;♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃&zwj;♀️",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:"🏄&zwj;♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊&zwj;♀️",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:"💁&zwj;♂️",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:"🚶&zwj;♀️",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:"🏋️&zwj;♀️",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:"👩&zwj;🎨",woman_astronaut:"👩&zwj;🚀",woman_cartwheeling:"🤸&zwj;♀️",woman_cook:"👩&zwj;🍳",woman_facepalming:"🤦&zwj;♀️",woman_factory_worker:"👩&zwj;🏭",woman_farmer:"👩&zwj;🌾",woman_firefighter:"👩&zwj;🚒",woman_health_worker:"👩&zwj;⚕️",woman_judge:"👩&zwj;⚖️",woman_juggling:"🤹&zwj;♀️",woman_mechanic:"👩&zwj;🔧",woman_office_worker:"👩&zwj;💼",woman_pilot:"👩&zwj;✈️",woman_playing_handball:"🤾&zwj;♀️",woman_playing_water_polo:"🤽&zwj;♀️",woman_scientist:"👩&zwj;🔬",woman_shrugging:"🤷&zwj;♀️",woman_singer:"👩&zwj;🎤",woman_student:"👩&zwj;🎓",woman_teacher:"👩&zwj;🏫",woman_technologist:"👩&zwj;💻",woman_with_turban:"👳&zwj;♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼&zwj;♀️",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={},l=c,p={parsed:{},raw:"",format:""};function m(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 l=0;l<e.length;++l)switch(e[l].type){case"lang":n.push(e[l]);break;case"output":r.push(e[l]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(i.extensions[e],e);if(i.helper.isUndefined(a[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=a[e]}"function"==typeof e&&(e=e()),i.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var l=0;l<e.length;++l){switch(e[l].type){case"lang":n.push(e[l]);break;case"output":r.push(e[l])}if(e[l].hasOwnProperty("listeners"))for(var s in e[l].listeners)e[l].listeners.hasOwnProperty(s)&&h(s,e[l].listeners[s])}}function h(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||{},s)s.hasOwnProperty(n)&&(t[n]=s[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,m)}(),this._dispatch=function(e,t,n,r){if(o.hasOwnProperty(e))for(var i=0;i<o[e].length;++i){var l=o[e][i](e,t,this,n,r);l&&void 0!==l&&(t=l)}return t},this.listen=function(e,t){return h(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,"&nbsp;"),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(),l=t[r].firstChild.getAttribute("data-language")||"";if(""===l)for(var a=t[r].firstChild.className.split(" "),s=0;s<a.length;++s){var c=a[s].match(/^language-(.+)$/);if(null!==c){l=c[1];break}}o=i.helper.unescapeHTMLEntities(o),n.push(o),t[r].outerHTML='<precode language="'+l+'" 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,l="",a=0;a<o.length;a++)l+=i.subParser("makeMarkdown.node")(o[a],r);return l},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){m(e,t=t||null)},this.useExtension=function(e){m(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=u[e];for(var r in l=e,n)n.hasOwnProperty(r)&&(t[r]=n[r])},this.getFlavor=function(){return l},this.removeExtension=function(e){i.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var o=e[t],l=0;l<n.length;++l)n[l]===o&&n[l].splice(l,1);for(;0<r.length;++l)r[0]===o&&r[0].splice(l,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,l,a,s,c){if(i.helper.isUndefined(c)&&(c=""),o=o.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)l="";else if(!l){if(o||(o=r.toLowerCase().replace(/ ?\n/g," ")),l="#"+o,i.helper.isUndefined(n.gUrls[o]))return e;l=n.gUrls[o],i.helper.isUndefined(n.gTitles[o])||(c=n.gTitles[o])}var u='<a href="'+(l=l.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"';return""!==c&&null!==c&&(u+=' title="'+(c=(c=c.replace(/"/g,"&quot;")).replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(l)&&(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,l){if("\\"===r)return n+o;if(!i.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var a=t.ghMentionsLink.replace(/\{u}/g,l),s="";return t.openLinksInNewWindow&&(s=' rel="noopener noreferrer" target="¨E95Eblank"'),n+'<a href="'+a+'"'+s+">"+o+"</a>"}))),n.converter._dispatch("anchors.after",e,t,n)}));var h=/([*~_]+|\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,v=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,b=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,y=function(e){"use strict";return function(t,n,r,o,l,a,s){var c=r=r.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback),u="",d="",p=n||"",m=s||"";return/^www\./i.test(r)&&(r=r.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&a&&(u=a),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'<a href="'+r+'"'+d+">"+c+"</a>"+u+m}},_=function(e,t){"use strict";return function(n,r,o){var l="mailto:";return r=r||"",o=i.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(l=i.helper.encodeEmailAddress(l+o),o=i.helper.encodeEmailAddress(o)):l+=o,r+'<a href="'+l+'">'+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(b,_(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(h,y(t))).replace(v,_(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 l=r,a=o,s="\n";return l=i.subParser("outdent")(l,t,n),l=i.subParser("encodeCode")(l,t,n),l=(l=(l=i.subParser("detab")(l,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(s=""),l="<pre><code>"+l+s+"</code></pre>",i.subParser("hashBlock")(l,t,n)+a}))).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,l){var a=l;return a=(a=a.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),a=r+"<code>"+(a=i.subParser("encodeCode")(a,t,n))+"</code>",i.subParser("hashHTMLSpans")(a,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="",l='<meta charset="utf-8">\n',a="",s="";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||(l='<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":l="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":a=' lang="'+n.metadata.parsed[c]+'"',s+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n';break;default:s+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n'}return e=o+"<html"+a+">\n<head>\n"+i+l+s+"</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,"&amp;")).replace(/<(?![a-z\/?$!])/gi,"&lt;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").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,l){var a=t.omitExtraWLInCodeBlocks?"":"\n";return l=i.subParser("encodeCode")(l,t,n),l="<pre><code"+(o?' class="'+o+" language-"+o+'"':"")+">"+(l=(l=(l=i.subParser("detab")(l,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+a+"</code></pre>",l=i.subParser("hashBlock")(l,t,n),"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:l})-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,l){var a=o+i.subParser("encodeCode")(r,t,n)+l;return"¨C"+(n.gHtmlSpans.push(a)-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"&lt;"+t+"&gt;"})));for(var l=0;l<r.length;++l)for(var a,s=new RegExp("^ {0,3}(<"+r[l]+"\\b[^>]*>)","im"),c="<"+r[l]+"\\b[^>]*>",u="</"+r[l]+">";-1!==(a=i.helper.regexIndexOf(e,s));){var d=i.helper.splitAtIndex(e,a),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 l=RegExp.$1;if(o=o.replace("¨C"+l+"C",n.gHtmlSpans[l]),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,l){var a=o+i.subParser("encodeCode")(r,t,n)+l;return"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"}),"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),n.converter._dispatch("hashPreCodeTags.after",e,t,n)})),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,l=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,(function(e,o){var l=i.subParser("spanGamut")(o,t,n),a=t.noHeaderId?"":' id="'+s(o)+'"',c="<h"+r+a+">"+l+"</h"+r+">";return i.subParser("hashBlock")(c,t,n)}))).replace(l,(function(e,o){var l=i.subParser("spanGamut")(o,t,n),a=t.noHeaderId?"":' id="'+s(o)+'"',c=r+1,u="<h"+c+a+">"+l+"</h"+c+">";return i.subParser("hashBlock")(u,t,n)}));var a=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function s(e){var r,o;if(t.customizedHeaderId){var l=e.match(/\{([^{]+?)}\s*$/);l&&l[1]&&(e=l[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(/&amp;/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?r.replace(/ /g,"-").replace(/&amp;/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(a,(function(e,o,l){var a=l;t.customizedHeaderId&&(a=l.replace(/\s?\{([^{]+?)}\s*$/,""));var c=i.subParser("spanGamut")(a,t,n),u=t.noHeaderId?"":' id="'+s(l)+'"',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,l,a,s,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])||(l=p[r].width,a=p[r].height)}t=t.replace(/"/g,"&quot;").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback);var m='<img src="'+(o=o.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'" alt="'+t+'"';return c&&i.helper.isString(c)&&(m+=' title="'+(c=c.replace(/"/g,"&quot;").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"'),l&&a&&(m+=' width="'+(l="*"===l?"auto":l)+'"',m+=' height="'+(a="*"===a?"auto":a)+'"'),m+" />"}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,l,a,s){return r(e,t,n,o=o.replace(/\s/g,""),i,l,0,s)}))).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,l=/\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,a,s,c,u){u=u&&""!==u.trim();var d=i.subParser("outdent")(s,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=l?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 l(e,n,i){var l=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,a=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,s="ul"===n?l:a,c="";if(-1!==e.search(s))!function t(u){var d=u.search(s),p=o(e,n);-1!==d?(c+="\n\n<"+n+p+">\n"+r(u.slice(0,d),!!i)+"</"+n+">\n",s="ul"==(n="ul"===n?"ol":"ul")?l:a,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 l(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 l(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,"&amp;").replace(/"/g,"&quot;")).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=[],l=r.length,a=0;a<l;a++){var s=r[a];s.search(/¨(K|G)(\d+)\1/g)>=0?o.push(s):s.search(/\S/)>=0&&(s=(s=i.subParser("spanGamut")(s,t,n)).replace(/^([ \t]*)/g,"<p>"),s+="</p>",o.push(s))}for(l=o.length,a=0;a<l;a++){for(var c="",u=o[a],d=!1;/¨(K|G)(\d+)\1/.test(u);){var p=RegExp.$1,m=RegExp.$2;c=(c="K"===p?n.gHtmlBlocks[m]:d?i.subParser("encodeCode")(n.ghCodeBlocks[m].text,t,n):n.ghCodeBlocks[m].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[a]=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,l,a,s,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),s?s+c:(c&&(n.gTitles[r]=c.replace(/"|'/g,"&quot;")),t.parseImgDimensions&&l&&a&&(n.gDimensions[r]={width:l,height:a}),"")};return(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,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,l=e.split("\n");for(o=0;o<l.length;++o)/^ {0,3}\|/.test(l[o])&&(l[o]=l[o].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(l[o])&&(l[o]=l[o].replace(/\|[ \t]*$/,"")),l[o]=i.subParser("codeSpans")(l[o],t,n);var a,s,c,u,d=l[0].split("|").map((function(e){return e.trim()})),p=l[1].split("|").map((function(e){return e.trim()})),m=[],h=[],f=[],g=[];for(l.shift(),l.shift(),o=0;o<l.length;++o)""!==l[o].trim()&&m.push(l[o].split("|").map((function(e){return e.trim()})));if(d.length<p.length)return e;for(o=0;o<p.length;++o)f.push((a=p[o],/^:[ \t]*--*$/.test(a)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(a)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(a)?' style="text-align:center;"':""));for(o=0;o<d.length;++o)i.helper.isUndefined(f[o])&&(f[o]=""),h.push((s=d[o],c=f[o],u=void 0,u="",s=s.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(u=' id="'+s.replace(/ /g,"_").toLowerCase()+'"'),"<th"+u+c+">"+(s=i.subParser("spanGamut")(s,t,n))+"</th>\n"));for(o=0;o<m.length;++o){for(var v=[],b=0;b<h.length;++b)i.helper.isUndefined(m[o][b]),v.push(r(m[o][b],f[b]));g.push(v)}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"}(h,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,l=0;l<o;++l){var a=i.subParser("makeMarkdown.node")(r[l],t);""!==a&&(n+=a)}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,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],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 l=e.childNodes,a=l.length,s=0;s<a;++s)o+=i.subParser("makeMarkdown.node")(l[s],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.getAttribute("alt")+"](",t+="<"+e.getAttribute("src")+">",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 l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],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,l=o.length,a=e.getAttribute("start")||1,s=0;s<l;++s)void 0!==o[s].tagName&&"li"===o[s].tagName.toLowerCase()&&(r+=("ol"===n?a.toString()+". ":"- ")+i.subParser("makeMarkdown.listItem")(o[s],t),++a);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,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],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,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],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,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],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,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],t);n+="**"}return n})),i.subParser("makeMarkdown.table",(function(e,t){"use strict";var n,r,o="",l=[[],[]],a=e.querySelectorAll("thead>tr>th"),s=e.querySelectorAll("tbody>tr");for(n=0;n<a.length;++n){var c=i.subParser("makeMarkdown.tableCell")(a[n],t),u="---";if(a[n].hasAttribute("style"))switch(a[n].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}l[0][n]=c.trim(),l[1][n]=u}for(n=0;n<s.length;++n){var d=l.push([])-1,p=s[n].getElementsByTagName("td");for(r=0;r<a.length;++r){var m=" ";void 0!==p[r]&&(m=i.subParser("makeMarkdown.tableCell")(p[r],t)),l[d].push(m)}}var h=3;for(n=0;n<l.length;++n)for(r=0;r<l[n].length;++r){var f=l[n][r].length;f>h&&(h=f)}for(n=0;n<l.length;++n){for(r=0;r<l[n].length;++r)1===n?":"===l[n][r].slice(-1)?l[n][r]=i.helper.padEnd(l[n][r].slice(-1),h-1,"-")+":":l[n][r]=i.helper.padEnd(l[n][r],h,"-"):l[n][r]=i.helper.padEnd(l[n][r],h);o+="| "+l[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,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],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)},14471:function(e,t,n){var r=n(89504),o=n(3040),i=n(439),l=n(20242);function a(){return Array.prototype.reduce.call(arguments,(function(e,t){return o.resolve(e,t)}))}function s(e){return"\\"===i.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e}function c(e){return l(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 m=/[#@] sourceMappingURL=([^\s'"]*)/,h=RegExp("(?:/\\*(?:\\s*\r?\n(?://)?)?(?:"+m.source+")\\s*\\*/|//(?:"+m.source+"))\\s*");function f(e,t,n,r){var o;try{o=y(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=y(e,t);return!r||r.map||(r.map=p(n,r.url,r),r.map=d(r.map,r)),r}var v=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/,b=/^(?:application|text)\/json$/;function y(e,t){t=s(t);var n=function(e){var t=e.match(h);return t?t[1]||t[2]||"":null}(e);if(!n)return null;var o=n.match(v);if(o){var i=o[1]||"text/plain",l=o[2]||"",c=o[3]||"",u={sourceMappingURL:n,url:null,sourcesRelativeTo:t,map:c};if(!b.test(i)){var p=new Error("Unuseful data uri mime type: "+i);throw p.sourceMapData=u,p}try{u.map=d(";base64"===l?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("utf-8",{fatal:!0}).decode(t)}(c):decodeURIComponent(c),u)}catch(p){throw p.sourceMapData=u,p}return u}var m=a(t,n);return{sourceMappingURL:n,url:m,sourcesRelativeTo:m,map:null}}function _(e,t,n,r,o){"function"==typeof r&&(o=r,r={});var i=e.sources?e.sources.length:0,l={sourcesResolved:[],sourcesContent:[]};if(0!==i){var a=function(){0==--i&&o(null,l)};x(e,t,r,(function(e,t,r){if(l.sourcesResolved[r]=e,"string"==typeof t)l.sourcesContent[r]=t,u(a,null);else{var o=c(e);n(o,(function(e,t){l.sourcesContent[r]=e||String(t),a()}))}}))}else u(o,null,l)}function k(e,t,n,r){var o={sourcesResolved:[],sourcesContent:[]};return e.sources&&0!==e.sources.length?(x(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 w=/\/?$/;function x(e,t,n,r){var o;n=n||{},t=s(t);for(var i=0,l=e.sources.length;i<l;i++)o=null,"string"==typeof n.sourceRoot?o=n.sourceRoot:"string"==typeof e.sourceRoot&&!1!==n.sourceRoot&&(o=e.sourceRoot),r(null===o||""===o?a(t,e.sources[i]):a(t,o.replace(w,"/"),e.sources[i]),(e.sourcesContent||[])[i],i)}e.exports={resolveSourceMap:f,resolveSourceMapSync:g,resolveSources:_,resolveSourcesSync:k,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},l=c(t);n(l,(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)}a(i)}))}else f(e,t,n,(function(e,t){return e?o(e):t?void a(t):o(null,null)}));function a(e){_(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=k(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 l(){this._array=[],this._set=i?new Map:Object.create(null)}l.fromArray=function(e,t){for(var n=new l,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},l.prototype.size=function(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length},l.prototype.add=function(e,t){var n=i?e:r.toSetString(e),l=i?this.has(e):o.call(this._set,n),a=this._array.length;l&&!t||this._array.push(e),l||(i?this._set.set(e,a):this._set[n]=a)},l.prototype.has=function(e){if(i)return this._set.has(e);var t=r.toSetString(e);return o.call(this._set,t)},l.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.')},l.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},l.prototype.toArray=function(){return this._array.slice()},t.I=l},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,l,a,s=e.length,c=0,u=0;do{if(t>=s)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=(a=(l=c)>>1,1==(1&l)?-a:a),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,l,a){var s=Math.floor((r-e)/2)+e,c=l(o,i[s],!0);return 0===c?s:c>0?r-s>1?n(s,r,o,i,l,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:s:s-e>1?n(e,s,o,i,l,a):a==t.LEAST_UPPER_BOUND?s: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 l=n(-1,r.length,e,r,o,i||t.GREATEST_LOWER_BOUND);if(l<0)return-1;for(;l-1>=0&&0===o(r[l],r[l-1],!0);)--l;return l}},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,l,a;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,l=t.generatedColumn,a=n.generatedColumn,i>o||i==o&&a>=l||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 l=o-1;n(e,(u=o,d=i,Math.round(u+Math.random()*(d-u))),i);for(var a=e[i],s=o;s<i;s++)t(e[s],a)<=0&&n(e,l+=1,s);n(e,l+1,s);var c=l+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,l=n(93719),a=n(90384).U;function s(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"),l=r.getArg(n,"sources"),a=r.getArg(n,"names",[]),s=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);s&&(s=r.normalize(s)),l=l.map(String).map(r.normalize).map((function(e){return s&&r.isAbsolute(s)&&r.isAbsolute(e)?r.relative(s,e):e})),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(l,!0),this._absoluteSources=this._sources.toArray().map((function(e){return r.computeSourceURL(s,e,t)})),this.sourceRoot=s,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"),l=r.getArg(n,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=l.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<a.line||o===a.line&&i<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=n,{generatedOffset:{generatedLine:o+1,generatedColumn:i+1},consumer:new s(r.getArg(e,"map"),t)}}))}s.fromSourceMap=function(e,t){return c.fromSourceMap(e,t)},s.prototype._version=3,s.prototype.__generatedMappings=null,Object.defineProperty(s.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),s.prototype.__originalMappings=null,Object.defineProperty(s.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),s.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},s.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},s.GENERATED_ORDER=1,s.ORIGINAL_ORDER=2,s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.prototype.eachMapping=function(e,t,n){var o,i=t||null;switch(n||s.GENERATED_ORDER){case s.GENERATED_ORDER:o=this._generatedMappings;break;case s.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;o.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return{source:t=r.computeSourceURL(l,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)},s.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=[],l=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(l>=0){var a=this._originalMappings[l];if(void 0===e.column)for(var s=a.originalLine;a&&a.originalLine===s;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++l];else for(var c=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==c;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++l]}return i},t.SourceMapConsumer=s,c.prototype=Object.create(s.prototype),c.prototype.consumer=s,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),l=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 s=e._mappings.toArray().slice(),d=n.__generatedMappings=[],p=n.__originalMappings=[],m=0,h=s.length;m<h;m++){var f=s[m],g=new u;g.generatedLine=f.generatedLine,g.generatedColumn=f.generatedColumn,f.source&&(g.source=l.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 a(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,s,c,d=1,p=0,m=0,h=0,f=0,g=0,v=e.length,b=0,y={},_={},k=[],w=[];b<v;)if(";"===e.charAt(b))d++,b++,p=0;else if(","===e.charAt(b))b++;else{for((n=new u).generatedLine=d,s=b;s<v&&!this._charIsMappingSeparator(e,s);s++);if(i=y[o=e.slice(b,s)])b+=o.length;else{for(i=[];b<s;)l.decode(e,b,_),c=_.value,b=_.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=m+i[2],m=n.originalLine,n.originalLine+=1,n.originalColumn=h+i[3],h=n.originalColumn,i.length>4&&(n.name=g+i[4],g+=i[4])),w.push(n),"number"==typeof n.originalLine&&k.push(n)}a(w,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,a(k,r.compareByOriginalPositions),this.__originalMappings=k},c.prototype._findMapping=function(e,t,n,r,i,l){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,l)},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",s.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 l=r.getArg(o,"name",null);return null!==l&&(l=this._names.at(l)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:l}}}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 l=i.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(l))return this.sourcesContent[this._sources.indexOf(l)];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",s.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(s.prototype),d.prototype.constructor=s,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,l=0;l<i.length;l++){var s=i[l],c=o.consumer._sources.at(s.source);c=r.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;s.name&&(u=o.consumer._names.at(s.name),this._names.add(u),u=this._names.indexOf(u));var d={source:c,generatedLine:s.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(o.generatedOffset.generatedLine===s.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:u};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}a(this.__generatedMappings,r.compareByGeneratedPositionsDeflated),a(this.__originalMappings,r.compareByOriginalPositions)}},67819:function(e,t,n){var r=n(93719),o=n(23114),i=n(7402).I,l=n(3307).H;function a(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 l,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e){var t=e.sourceRoot,n=new a({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var 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 l=e.sourceContentFor(r);null!=l&&n.setSourceContent(r,l)})),n},a.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})},a.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))},a.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 l=this._sourceRoot;null!=l&&(r=o.relative(l,r));var a=new i,s=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!=l&&(t.source=o.relative(l,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var c=t.source;null==c||a.has(c)||a.add(c);var u=t.name;null==u||s.has(u)||s.add(u)}),this),this._sources=a,this._names=s,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=l&&(t=o.relative(l,t)),this.setSourceContent(t,r))}),this)},a.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}))},a.prototype._serializeMappings=function(){for(var e,t,n,i,l=0,a=1,s=0,c=0,u=0,d=0,p="",m=this._mappings.toArray(),h=0,f=m.length;h<f;h++){if(e="",(t=m[h]).generatedLine!==a)for(l=0;t.generatedLine!==a;)e+=";",a++;else if(h>0){if(!o.compareByGeneratedPositionsInflated(t,m[h-1]))continue;e+=","}e+=r.encode(t.generatedColumn-l),l=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-s),s=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-u),u=n)),p+=e}return p},a.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)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=a},25421:function(e,t,n){var r=n(67819).SourceMapGenerator,o=n(23114),i=/(\r?\n)/,l="$$$isSourceNode$$$";function a(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[l]=!0,null!=r&&this.add(r)}a.fromStringWithSourceMap=function(e,t,n){var r=new a,l=e.split(i),s=0,c=function(){return e()+(e()||"");function e(){return s<l.length?l[s++]:void 0}},u=1,d=0,p=null;return t.eachMapping((function(e){if(null!==p){if(!(u<e.generatedLine)){var t=(n=l[s]||"").substr(0,e.generatedColumn-d);return l[s]=n.substr(e.generatedColumn-d),d=e.generatedColumn,m(p,t),void(p=e)}m(p,c()),u++,d=0}for(;u<e.generatedLine;)r.add(c()),u++;if(d<e.generatedColumn){var n=l[s]||"";r.add(n.substr(0,e.generatedColumn)),l[s]=n.substr(e.generatedColumn),d=e.generatedColumn}p=e}),this),s<l.length&&(p&&m(p,c()),r.add(l.splice(s).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 m(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 a(e.originalLine,e.originalColumn,i,t,e.name))}}},a.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[l]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},a.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[l]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},a.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)(t=this.children[n])[l]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},a.prototype.join=function(e){var t,n,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},a.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[l]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},a.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},a.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][l]&&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]])},a.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},a.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new r(e),o=!1,i=null,l=null,a=null,s=null;return this.walk((function(e,r){t.code+=e,null!==r.source&&null!==r.line&&null!==r.column?(i===r.source&&l===r.line&&a===r.column&&s===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,l=r.line,a=r.column,s=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 l(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var l,a=t.isAbsolute(n),s=n.split(/\/+/),c=0,u=s.length-1;u>=0;u--)"."===(l=s[u])?s.splice(u,1):".."===l?c++:c>0&&(""===l?(s.splice(u+1,c),c=0):(s.splice(u,2),c--));return""===(n=s.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var s="/"===t.charAt(0)?t:l(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=s,i(a)):s}t.urlParse=o,t.urlGenerate=i,t.normalize=l,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var 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 s=!("__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=s?c:function(e){return u(e)?"$"+e:e},t.fromSetString=s?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 s=r.path.lastIndexOf("/");s>=0&&(r.path=r.path.substring(0,s+1))}t=a(i(r),t)}return l(t)}},20065:function(e,t,n){t.SourceMapGenerator=n(67819).SourceMapGenerator,t.SourceMapConsumer=n(22799).SourceMapConsumer,n(25421)},73645:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function r(e,t,n){var r=[],l=[],u=!0;return function e(d){var p=n?o(d):d,m={},h=!0,f={node:p,node_:d,path:[].concat(r),parent:l[l.length-1],parents:l,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(h=!1)},delete:function(e){delete f.parent.node[f.key],e&&(h=!1)},remove:function(e){a(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(h=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){h=!1}};if(!u)return f;function g(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=i(f.node)),f.isLeaf=0==f.keys.length;for(var e=0;e<l.length;e++)if(l[e].node_===d){f.circular=l[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}g();var v=t.call(f,f.node);return void 0!==v&&f.update&&f.update(v),m.before&&m.before.call(f,f.node),h?("object"!=typeof f.node||null===f.node||f.circular||(l.push(f),g(),s(f.keys,(function(t,o){r.push(t),m.pre&&m.pre.call(f,f.node[t],t);var i=e(f.node[t]);n&&c.call(f.node,t)&&(f.node[t]=i.node),i.isLast=o==f.keys.length-1,i.isFirst=0==o,m.post&&m.post.call(f,i),r.pop()})),l.pop()),m.after&&m.after.call(f,f.node),f):f}(e).node}function o(e){if("object"==typeof e&&null!==e){var t;if(a(e))t=[];else if("[object Date]"===l(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===l(e))t=new RegExp(e);else if(function(e){return"[object Error]"===l(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===l(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===l(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===l(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return s(i(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!c.call(t,r)){t=void 0;break}t=t[r]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!c.call(t,r))return!1;t=t[r]}return!0},n.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];c.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},n.prototype.map=function(e){return r(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=r(this.value,e,!1),this.value},n.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},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(r){for(var l=0;l<e.length;l++)if(e[l]===r)return t[l];if("object"==typeof r&&null!==r){var a=o(r);return e.push(r),t.push(a),s(i(r),(function(e){a[e]=n(r[e])})),e.pop(),t.pop(),a}return r}(this.value)};var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function l(e){return Object.prototype.toString.call(e)}var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};s(i(n.prototype),(function(e){t[e]=function(t){var r=[].slice.call(arguments,1),o=new n(t);return o[e].apply(o,r)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},3040:function(e,t,n){"use strict";var r=n(74870),o=n(54783);function i(){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}t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){return o.isString(e)&&(e=y(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var l=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),d=["%","/","?",";","#"].concat(u),p=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(54415);function y(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),a=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\/g,"/");var y=e=c.join(a);if(y=y.trim(),!n&&1===e.split("#").length){var _=s.exec(y);if(_)return this.path=y,this.href=y,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var k=l.exec(y);if(k){var w=(k=k[0]).toLowerCase();this.protocol=w,y=y.substr(k.length)}if(n||k||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var x="//"===y.substr(0,2);!x||k&&g[k]||(y=y.substr(2),this.slashes=!0)}if(!g[k]&&(x||k&&!v[k])){for(var C,E,S=-1,I=0;I<p.length;I++)-1!==(T=y.indexOf(p[I]))&&(-1===S||T<S)&&(S=T);for(-1!==(E=-1===S?y.lastIndexOf("@"):y.lastIndexOf("@",S))&&(C=y.slice(0,E),y=y.slice(E+1),this.auth=decodeURIComponent(C)),S=-1,I=0;I<d.length;I++){var T;-1!==(T=y.indexOf(d[I]))&&(-1===S||T<S)&&(S=T)}-1===S&&(S=y.length),this.host=y.slice(0,S),y=y.slice(S),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var B=this.hostname.split(/\./),A=(I=0,B.length);I<A;I++){var L=B[I];if(L&&!L.match(m)){for(var P="",D=0,R=L.length;D<R;D++)L.charCodeAt(D)>127?P+="x":P+=L[D];if(!P.match(m)){var M=B.slice(0,I),O=B.slice(I+1),F=L.match(h);F&&(M.push(F[1]),O.unshift(F[2])),O.length&&(y="/"+O.join(".")+y),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var j=this.port?":"+this.port:"",Z=this.hostname||"";this.host=Z+j,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!f[w])for(I=0,A=u.length;I<A;I++){var z=u[I];if(-1!==y.indexOf(z)){var H=encodeURIComponent(z);H===z&&(H=escape(z)),y=y.split(z).join(H)}}var V=y.indexOf("#");-1!==V&&(this.hash=y.substr(V),y=y.slice(0,V));var W=y.indexOf("?");if(-1!==W?(this.search=y.substr(W),this.query=y.substr(W+1),t&&(this.query=b.parse(this.query)),y=y.slice(0,W)):t&&(this.search="",this.query={}),y&&(this.pathname=y),v[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){j=this.pathname||"";var U=this.search||"";this.path=j+U}return this.href=this.format(),this},i.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||"",i=!1,l="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(l=b.stringify(this.query));var a=this.search||l&&"?"+l||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+i+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(y(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),l=0;l<r.length;l++){var a=r[l];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),c=0;c<s.length;c++){var u=s[c];"protocol"!==u&&(n[u]=e[u])}return v[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!v[e.protocol]){for(var d=Object.keys(e),p=0;p<d.length;p++){var m=d[p];n[m]=e[m]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||g[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 f=n.pathname||"",b=n.search||"";n.path=f+b}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),k=_||y||n.host&&e.pathname,w=k,x=n.pathname&&n.pathname.split("/")||[],C=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!v[n.protocol]);if(C&&(n.hostname="",n.port=null,n.host&&(""===x[0]?x[0]=n.host:x.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),k=k&&(""===h[0]||""===x[0])),_)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,x=h;else if(h.length)x||(x=[]),x.pop(),x=x.concat(h),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search))return C&&(n.hostname=n.host=x.shift(),(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift())),n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=x.slice(-1)[0],S=(n.host||e.host||x.length>1)&&("."===E||".."===E)||""===E,I=0,T=x.length;T>=0;T--)"."===(E=x[T])?x.splice(T,1):".."===E?(x.splice(T,1),I++):I&&(x.splice(T,1),I--);if(!k&&!w)for(;I--;I)x.unshift("..");!k||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),S&&"/"!==x.join("/").substr(-1)&&x.push("");var N,B=""===x[0]||x[0]&&"/"===x[0].charAt(0);return C&&(n.hostname=n.host=B?"":x.length?x.shift():"",(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift())),(k=k||n.host&&x.length)&&!B&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(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},i.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)}},54783:function(e){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},65311:function(e){"use strict";e.exports=jQuery},37019:function(){},96344:function(){},439:function(){}},function(e){e.O(0,[351],(function(){return 87776,e(e.s=87776)})),e.O()}]);