var du=Object.defineProperty;var fu=(M,$,I)=>$ in M?du(M,$,{enumerable:!0,configurable:!0,writable:!0,value:I}):M[$]=I;var Wl=(M,$,I)=>(fu(M,typeof $!="symbol"?$+"":$,I),I);const scriptRel="modulepreload",assetsURL=function(M,$){return new URL(M,$).href},seen={},__vitePreload=function($,I,N){if(!I||I.length===0)return $();const B=document.getElementsByTagName("link");return Promise.all(I.map(j=>{if(j=assetsURL(j,N),j in seen)return;seen[j]=!0;const U=j.endsWith(".css"),q=U?'[rel="stylesheet"]':"";if(!!N)for(let G=B.length-1;G>=0;G--){const J=B[G];if(J.href===j&&(!U||J.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${j}"]${q}`))return;const K=document.createElement("link");if(K.rel=U?"stylesheet":scriptRel,U||(K.as="script",K.crossOrigin=""),K.href=j,document.head.appendChild(K),U)return new Promise((G,J)=>{K.addEventListener("load",G),K.addEventListener("error",()=>J(new Error(`Unable to preload CSS for ${j}`)))})})).then(()=>$()).catch(j=>{const U=new Event("vite:preloadError",{cancelable:!0});if(U.payload=j,window.dispatchEvent(U),!U.defaultPrevented)throw j})};/*! * Vue.js v2.7.14 * (c) 2014-2022 Evan You * Released under the MIT License. */var emptyObject=Object.freeze({}),isArray$9=Array.isArray;function isUndef(M){return M==null}function isDef(M){return M!=null}function isTrue(M){return M===!0}function isFalse(M){return M===!1}function isPrimitive(M){return typeof M=="string"||typeof M=="number"||typeof M=="symbol"||typeof M=="boolean"}function isFunction$6(M){return typeof M=="function"}function isObject$6(M){return M!==null&&typeof M=="object"}var _toString=Object.prototype.toString;function toRawType$1(M){return _toString.call(M).slice(8,-1)}function isPlainObject$2(M){return _toString.call(M)==="[object Object]"}function isRegExp$5(M){return _toString.call(M)==="[object RegExp]"}function isValidArrayIndex(M){var $=parseFloat(String(M));return $>=0&&Math.floor($)===$&&isFinite(M)}function isPromise$1(M){return isDef(M)&&typeof M.then=="function"&&typeof M.catch=="function"}function toString$4(M){return M==null?"":Array.isArray(M)||isPlainObject$2(M)&&M.toString===_toString?JSON.stringify(M,null,2):String(M)}function toNumber(M){var $=parseFloat(M);return isNaN($)?M:$}function makeMap$1(M,$){for(var I=Object.create(null),N=M.split(","),B=0;B-1)return M.splice(N,1)}}var hasOwnProperty$3=Object.prototype.hasOwnProperty;function hasOwn$4(M,$){return hasOwnProperty$3.call(M,$)}function cached(M){var $=Object.create(null);return function(N){var B=$[N];return B||($[N]=M(N))}}var camelizeRE=/-(\w)/g,camelize=cached(function(M){return M.replace(camelizeRE,function($,I){return I?I.toUpperCase():""})}),capitalize$1=cached(function(M){return M.charAt(0).toUpperCase()+M.slice(1)}),hyphenateRE=/\B([A-Z])/g,hyphenate=cached(function(M){return M.replace(hyphenateRE,"-$1").toLowerCase()});function polyfillBind(M,$){function I(N){var B=arguments.length;return B?B>1?M.apply($,arguments):M.call($,N):M.call($)}return I._length=M.length,I}function nativeBind(M,$){return M.bind($)}var bind$1$1=Function.prototype.bind?nativeBind:polyfillBind;function toArray$3(M,$){$=$||0;for(var I=M.length-$,N=new Array(I);I--;)N[I]=M[I+$];return N}function extend$6(M,$){for(var I in $)M[I]=$[I];return M}function toObject$1(M){for(var $={},I=0;I0,isEdge=UA&&UA.indexOf("edge/")>0;UA&&UA.indexOf("android")>0;var isIOS$1=UA&&/iphone|ipad|ipod|ios/.test(UA),isFF=UA&&UA.match(/firefox\/(\d+)/),nativeWatch={}.watch,supportsPassive$1=!1;if(inBrowser)try{var opts={};Object.defineProperty(opts,"passive",{get:function(){supportsPassive$1=!0}}),window.addEventListener("test-passive",null,opts)}catch{}var _isServer,isServerRendering=function(){return _isServer===void 0&&(!inBrowser&&typeof global<"u"?_isServer=global.process&&global.process.env.VUE_ENV==="server":_isServer=!1),_isServer},devtools=inBrowser&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function isNative(M){return typeof M=="function"&&/native code/.test(M.toString())}var hasSymbol=typeof Symbol<"u"&&isNative(Symbol)&&typeof Reflect<"u"&&isNative(Reflect.ownKeys),_Set;typeof Set<"u"&&isNative(Set)?_Set=Set:_Set=function(){function M(){this.set=Object.create(null)}return M.prototype.has=function($){return this.set[$]===!0},M.prototype.add=function($){this.set[$]=!0},M.prototype.clear=function(){this.set=Object.create(null)},M}();var currentInstance=null;function getCurrentInstance(){return currentInstance&&{proxy:currentInstance}}function setCurrentInstance(M){M===void 0&&(M=null),M||currentInstance&¤tInstance._scope.off(),currentInstance=M,M&&M._scope.on()}var VNode=function(){function M($,I,N,B,j,U,q,Y){this.tag=$,this.data=I,this.children=N,this.text=B,this.elm=j,this.ns=void 0,this.context=U,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=I&&I.key,this.componentOptions=q,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=Y,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(M.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),M}(),createEmptyVNode=function(M){M===void 0&&(M="");var $=new VNode;return $.text=M,$.isComment=!0,$};function createTextVNode(M){return new VNode(void 0,void 0,void 0,String(M))}function cloneVNode(M){var $=new VNode(M.tag,M.data,M.children&&M.children.slice(),M.text,M.elm,M.context,M.componentOptions,M.asyncFactory);return $.ns=M.ns,$.isStatic=M.isStatic,$.key=M.key,$.isComment=M.isComment,$.fnContext=M.fnContext,$.fnOptions=M.fnOptions,$.fnScopeId=M.fnScopeId,$.asyncMeta=M.asyncMeta,$.isCloned=!0,$}var uid$2=0,pendingCleanupDeps=[],cleanupDeps=function(){for(var M=0;M0&&(B=normalizeArrayChildren(B,"".concat($||"","_").concat(N)),isTextNode(B[0])&&isTextNode(U)&&(I[j]=createTextVNode(U.text+B[0].text),B.shift()),I.push.apply(I,B)):isPrimitive(B)?isTextNode(U)?I[j]=createTextVNode(U.text+B):B!==""&&I.push(createTextVNode(B)):isTextNode(B)&&isTextNode(U)?I[j]=createTextVNode(U.text+B.text):(isTrue(M._isVList)&&isDef(B.tag)&&isUndef(B.key)&&isDef($)&&(B.key="__vlist".concat($,"_").concat(N,"__")),I.push(B)));return I}var SIMPLE_NORMALIZE=1,ALWAYS_NORMALIZE=2;function createElement$1(M,$,I,N,B,j){return(isArray$9(I)||isPrimitive(I))&&(B=N,N=I,I=void 0),isTrue(j)&&(B=ALWAYS_NORMALIZE),_createElement(M,$,I,N,B)}function _createElement(M,$,I,N,B){if(isDef(I)&&isDef(I.__ob__)||(isDef(I)&&isDef(I.is)&&($=I.is),!$))return createEmptyVNode();isArray$9(N)&&isFunction$6(N[0])&&(I=I||{},I.scopedSlots={default:N[0]},N.length=0),B===ALWAYS_NORMALIZE?N=normalizeChildren(N):B===SIMPLE_NORMALIZE&&(N=simpleNormalizeChildren(N));var j,U;if(typeof $=="string"){var q=void 0;U=M.$vnode&&M.$vnode.ns||config$1.getTagNamespace($),config$1.isReservedTag($)?j=new VNode(config$1.parsePlatformTagName($),I,N,void 0,void 0,M):(!I||!I.pre)&&isDef(q=resolveAsset(M.$options,"components",$))?j=createComponent(q,I,M,N,$):j=new VNode($,I,N,void 0,void 0,M)}else j=createComponent($,I,M,N);return isArray$9(j)?j:isDef(j)?(isDef(U)&&applyNS(j,U),isDef(I)&®isterDeepBindings(I),j):createEmptyVNode()}function applyNS(M,$,I){if(M.ns=$,M.tag==="foreignObject"&&($=void 0,I=!0),isDef(M.children))for(var N=0,B=M.children.length;N0,U=$?!!$.$stable:!j,q=$&&$.$key;if(!$)B={};else{if($._normalized)return $._normalized;if(U&&N&&N!==emptyObject&&q===N.$key&&!j&&!N.$hasNormal)return N;B={};for(var Y in $)$[Y]&&Y[0]!=="$"&&(B[Y]=normalizeScopedSlot(M,I,Y,$[Y]))}for(var K in I)K in B||(B[K]=proxyNormalSlot(I,K));return $&&Object.isExtensible($)&&($._normalized=B),def(B,"$stable",U),def(B,"$key",q),def(B,"$hasNormal",j),B}function normalizeScopedSlot(M,$,I,N){var B=function(){var j=currentInstance;setCurrentInstance(M);var U=arguments.length?N.apply(null,arguments):N({});U=U&&typeof U=="object"&&!isArray$9(U)?[U]:normalizeChildren(U);var q=U&&U[0];return setCurrentInstance(j),U&&(!q||U.length===1&&q.isComment&&!isAsyncPlaceholder(q))?void 0:U};return N.proxy&&Object.defineProperty($,I,{get:B,enumerable:!0,configurable:!0}),B}function proxyNormalSlot(M,$){return function(){return M[$]}}function initSetup(M){var $=M.$options,I=$.setup;if(I){var N=M._setupContext=createSetupContext(M);setCurrentInstance(M),pushTarget();var B=invokeWithErrorHandling(I,null,[M._props||shallowReactive({}),N],M,"setup");if(popTarget(),setCurrentInstance(),isFunction$6(B))$.render=B;else if(isObject$6(B))if(M._setupState=B,B.__sfc){var U=M._setupProxy={};for(var j in B)j!=="__sfc"&&proxyWithRefUnwrap(U,B,j)}else for(var j in B)isReserved(j)||proxyWithRefUnwrap(M,B,j)}}function createSetupContext(M){return{get attrs(){if(!M._attrsProxy){var $=M._attrsProxy={};def($,"_v_attr_proxy",!0),syncSetupProxy($,M.$attrs,emptyObject,M,"$attrs")}return M._attrsProxy},get listeners(){if(!M._listenersProxy){var $=M._listenersProxy={};syncSetupProxy($,M.$listeners,emptyObject,M,"$listeners")}return M._listenersProxy},get slots(){return initSlotsProxy(M)},emit:bind$1$1(M.$emit,M),expose:function($){$&&Object.keys($).forEach(function(I){return proxyWithRefUnwrap(M,$,I)})}}}function syncSetupProxy(M,$,I,N,B){var j=!1;for(var U in $)U in M?$[U]!==I[U]&&(j=!0):(j=!0,defineProxyAttr(M,U,N,B));for(var U in M)U in $||(j=!0,delete M[U]);return j}function defineProxyAttr(M,$,I,N){Object.defineProperty(M,$,{enumerable:!0,configurable:!0,get:function(){return I[N][$]}})}function initSlotsProxy(M){return M._slotsProxy||syncSetupSlots(M._slotsProxy={},M.$scopedSlots),M._slotsProxy}function syncSetupSlots(M,$){for(var I in $)M[I]=$[I];for(var I in M)I in $||delete M[I]}function useSlots(){return getContext().slots}function useAttrs(){return getContext().attrs}function useListeners(){return getContext().listeners}function getContext(){var M=currentInstance;return M._setupContext||(M._setupContext=createSetupContext(M))}function mergeDefaults(M,$){var I=isArray$9(M)?M.reduce(function(j,U){return j[U]={},j},{}):M;for(var N in $){var B=I[N];B?isArray$9(B)||isFunction$6(B)?I[N]={type:B,default:$[N]}:B.default=$[N]:B===null&&(I[N]={default:$[N]})}return I}function initRender(M){M._vnode=null,M._staticTrees=null;var $=M.$options,I=M.$vnode=$._parentVnode,N=I&&I.context;M.$slots=resolveSlots($._renderChildren,N),M.$scopedSlots=I?normalizeScopedSlots(M.$parent,I.data.scopedSlots,M.$slots):emptyObject,M._c=function(j,U,q,Y){return createElement$1(M,j,U,q,Y,!1)},M.$createElement=function(j,U,q,Y){return createElement$1(M,j,U,q,Y,!0)};var B=I&&I.data;defineReactive(M,"$attrs",B&&B.attrs||emptyObject,null,!0),defineReactive(M,"$listeners",$._parentListeners||emptyObject,null,!0)}var currentRenderingInstance=null;function renderMixin(M){installRenderHelpers(M.prototype),M.prototype.$nextTick=function($){return nextTick$1($,this)},M.prototype._render=function(){var $=this,I=$.$options,N=I.render,B=I._parentVnode;B&&$._isMounted&&($.$scopedSlots=normalizeScopedSlots($.$parent,B.data.scopedSlots,$.$slots,$.$scopedSlots),$._slotsProxy&&syncSetupSlots($._slotsProxy,$.$scopedSlots)),$.$vnode=B;var j;try{setCurrentInstance($),currentRenderingInstance=$,j=N.call($._renderProxy,$.$createElement)}catch(U){handleError$1(U,$,"render"),j=$._vnode}finally{currentRenderingInstance=null,setCurrentInstance()}return isArray$9(j)&&j.length===1&&(j=j[0]),j instanceof VNode||(j=createEmptyVNode()),j.parent=B,j}}function ensureCtor(M,$){return(M.__esModule||hasSymbol&&M[Symbol.toStringTag]==="Module")&&(M=M.default),isObject$6(M)?$.extend(M):M}function createAsyncPlaceholder(M,$,I,N,B){var j=createEmptyVNode();return j.asyncFactory=M,j.asyncMeta={data:$,context:I,children:N,tag:B},j}function resolveAsyncComponent(M,$){if(isTrue(M.error)&&isDef(M.errorComp))return M.errorComp;if(isDef(M.resolved))return M.resolved;var I=currentRenderingInstance;if(I&&isDef(M.owners)&&M.owners.indexOf(I)===-1&&M.owners.push(I),isTrue(M.loading)&&isDef(M.loadingComp))return M.loadingComp;if(I&&!isDef(M.owners)){var N=M.owners=[I],B=!0,j=null,U=null;I.$on("hook:destroyed",function(){return remove$2(N,I)});var q=function(J){for(var Z=0,ee=N.length;Z1?toArray$3(B):B;for(var j=toArray$3(arguments,1),U='event handler for "'.concat(I,'"'),q=0,Y=B.length;qdocument.createEvent("Event").timeStamp&&(getNow=function(){return performance_1.now()})}var sortCompareFn=function(M,$){if(M.post){if(!$.post)return 1}else if($.post)return-1;return M.id-$.id};function flushSchedulerQueue(){currentFlushTimestamp=getNow(),flushing$1=!0;var M,$;for(queue$1.sort(sortCompareFn),index$1$1=0;index$1$1index$1$1&&queue$1[I].id>M.id;)I--;queue$1.splice(I+1,0,M)}waiting||(waiting=!0,nextTick$1(flushSchedulerQueue))}}var WATCHER="watcher",WATCHER_CB="".concat(WATCHER," callback"),WATCHER_GETTER="".concat(WATCHER," getter"),WATCHER_CLEANUP="".concat(WATCHER," cleanup");function watchEffect(M,$){return doWatch(M,null,$)}function watchPostEffect(M,$){return doWatch(M,null,{flush:"post"})}function watchSyncEffect(M,$){return doWatch(M,null,{flush:"sync"})}var INITIAL_WATCHER_VALUE={};function watch(M,$,I){return doWatch(M,$,I)}function doWatch(M,$,I){var N=I===void 0?emptyObject:I,B=N.immediate,j=N.deep,U=N.flush,q=U===void 0?"pre":U;N.onTrack,N.onTrigger;var Y=currentInstance,K=function(le,ge,ue){return ue===void 0&&(ue=null),invokeWithErrorHandling(le,null,ue,Y,ge)},G,J=!1,Z=!1;if(isRef$1(M)?(G=function(){return M.value},J=isShallow(M)):isReactive$1(M)?(G=function(){return M.__ob__.dep.depend(),M},j=!0):isArray$9(M)?(Z=!0,J=M.some(function(le){return isReactive$1(le)||isShallow(le)}),G=function(){return M.map(function(le){if(isRef$1(le))return le.value;if(isReactive$1(le))return traverse(le);if(isFunction$6(le))return K(le,WATCHER_GETTER)})}):isFunction$6(M)?$?G=function(){return K(M,WATCHER_GETTER)}:G=function(){if(!(Y&&Y._isDestroyed))return te&&te(),K(M,WATCHER,[re])}:G=noop$2,$&&j){var ee=G;G=function(){return traverse(ee())}}var te,re=function(le){te=se.onStop=function(){K(le,WATCHER_CLEANUP)}};if(isServerRendering())return re=noop$2,$?B&&K($,WATCHER_CB,[G(),Z?[]:void 0,re]):G(),noop$2;var se=new Watcher(currentInstance,G,noop$2,{lazy:!0});se.noRecurse=!$;var ne=Z?[]:INITIAL_WATCHER_VALUE;return se.run=function(){if(se.active)if($){var le=se.get();(j||J||(Z?le.some(function(ge,ue){return hasChanged$1(ge,ne[ue])}):hasChanged$1(le,ne)))&&(te&&te(),K($,WATCHER_CB,[le,ne===INITIAL_WATCHER_VALUE?void 0:ne,re]),ne=le)}else se.get()},q==="sync"?se.update=se.run:q==="post"?(se.post=!0,se.update=function(){return queueWatcher(se)}):se.update=function(){if(Y&&Y===currentInstance&&!Y._isMounted){var le=Y._preWatchers||(Y._preWatchers=[]);le.indexOf(se)<0&&le.push(se)}else queueWatcher(se)},$?B?se.run():ne=se.get():q==="post"&&Y?Y.$once("hook:mounted",function(){return se.get()}):se.get(),function(){se.teardown()}}var activeEffectScope,EffectScope=function(){function M($){$===void 0&&($=!1),this.detached=$,this.active=!0,this.effects=[],this.cleanups=[],this.parent=activeEffectScope,!$&&activeEffectScope&&(this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1)}return M.prototype.run=function($){if(this.active){var I=activeEffectScope;try{return activeEffectScope=this,$()}finally{activeEffectScope=I}}},M.prototype.on=function(){activeEffectScope=this},M.prototype.off=function(){activeEffectScope=this.parent},M.prototype.stop=function($){if(this.active){var I=void 0,N=void 0;for(I=0,N=this.effects.length;I1)return I&&isFunction$6($)?$.call(N):$}}function h$2(M,$,I){return createElement$1(currentInstance,M,$,I,2,!0)}function handleError$1(M,$,I){pushTarget();try{if($)for(var N=$;N=N.$parent;){var B=N.$options.errorCaptured;if(B)for(var j=0;j-1){if(j&&!hasOwn$4(B,"default"))U=!1;else if(U===""||U===hyphenate(M)){var Y=getTypeIndex(String,B.type);(Y<0||q-1)return this;var N=toArray$3(arguments,1);return N.unshift(this),isFunction$6($.install)?$.install.apply($,N):isFunction$6($)&&$.apply(null,N),I.push($),this}}function initMixin(M){M.mixin=function($){return this.options=mergeOptions(this.options,$),this}}function initExtend(M){M.cid=0;var $=1;M.extend=function(I){I=I||{};var N=this,B=N.cid,j=I._Ctor||(I._Ctor={});if(j[B])return j[B];var U=getComponentName(I)||getComponentName(N.options),q=function(K){this._init(K)};return q.prototype=Object.create(N.prototype),q.prototype.constructor=q,q.cid=$++,q.options=mergeOptions(N.options,I),q.super=N,q.options.props&&initProps(q),q.options.computed&&initComputed(q),q.extend=N.extend,q.mixin=N.mixin,q.use=N.use,ASSET_TYPES.forEach(function(Y){q[Y]=N[Y]}),U&&(q.options.components[U]=q),q.superOptions=N.options,q.extendOptions=I,q.sealedOptions=extend$6({},q.options),j[B]=q,q}}function initProps(M){var $=M.options.props;for(var I in $)proxy(M.prototype,"_props",I)}function initComputed(M){var $=M.options.computed;for(var I in $)defineComputed(M.prototype,I,$[I])}function initAssetRegisters(M){ASSET_TYPES.forEach(function($){M[$]=function(I,N){return N?($==="component"&&isPlainObject$2(N)&&(N.name=N.name||I,N=this.options._base.extend(N)),$==="directive"&&isFunction$6(N)&&(N={bind:N,update:N}),this.options[$+"s"][I]=N,N):this.options[$+"s"][I]}})}function _getComponentName(M){return M&&(getComponentName(M.Ctor.options)||M.tag)}function matches$1(M,$){return isArray$9(M)?M.indexOf($)>-1:typeof M=="string"?M.split(",").indexOf($)>-1:isRegExp$5(M)?M.test($):!1}function pruneCache(M,$){var I=M.cache,N=M.keys,B=M._vnode;for(var j in I){var U=I[j];if(U){var q=U.name;q&&!$(q)&&pruneCacheEntry(I,j,N,B)}}}function pruneCacheEntry(M,$,I,N){var B=M[$];B&&(!N||B.tag!==N.tag)&&B.componentInstance.$destroy(),M[$]=null,remove$2(I,$)}var patternTypes=[String,RegExp,Array],KeepAlive={name:"keep-alive",abstract:!0,props:{include:patternTypes,exclude:patternTypes,max:[String,Number]},methods:{cacheVNode:function(){var M=this,$=M.cache,I=M.keys,N=M.vnodeToCache,B=M.keyToCache;if(N){var j=N.tag,U=N.componentInstance,q=N.componentOptions;$[B]={name:_getComponentName(q),tag:j,componentInstance:U},I.push(B),this.max&&I.length>parseInt(this.max)&&pruneCacheEntry($,I[0],I,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var M in this.cache)pruneCacheEntry(this.cache,M,this.keys)},mounted:function(){var M=this;this.cacheVNode(),this.$watch("include",function($){pruneCache(M,function(I){return matches$1($,I)})}),this.$watch("exclude",function($){pruneCache(M,function(I){return!matches$1($,I)})})},updated:function(){this.cacheVNode()},render:function(){var M=this.$slots.default,$=getFirstComponentChild(M),I=$&&$.componentOptions;if(I){var N=_getComponentName(I),B=this,j=B.include,U=B.exclude;if(j&&(!N||!matches$1(j,N))||U&&N&&matches$1(U,N))return $;var q=this,Y=q.cache,K=q.keys,G=$.key==null?I.Ctor.cid+(I.tag?"::".concat(I.tag):""):$.key;Y[G]?($.componentInstance=Y[G].componentInstance,remove$2(K,G),K.push(G)):(this.vnodeToCache=$,this.keyToCache=G),$.data.keepAlive=!0}return $||M&&M[0]}},builtInComponents={KeepAlive};function initGlobalAPI(M){var $={};$.get=function(){return config$1},Object.defineProperty(M,"config",$),M.util={warn:warn$2$1,extend:extend$6,mergeOptions,defineReactive},M.set=set$3,M.delete=del,M.nextTick=nextTick$1,M.observable=function(I){return observe(I),I},M.options=Object.create(null),ASSET_TYPES.forEach(function(I){M.options[I+"s"]=Object.create(null)}),M.options._base=M,extend$6(M.options.components,builtInComponents),initUse(M),initMixin(M),initExtend(M),initAssetRegisters(M)}initGlobalAPI(Vue$3);Object.defineProperty(Vue$3.prototype,"$isServer",{get:isServerRendering});Object.defineProperty(Vue$3.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}});Object.defineProperty(Vue$3,"FunctionalRenderContext",{value:FunctionalRenderContext});Vue$3.version=version$3;var isReservedAttr=makeMap$1("style,class"),acceptValue=makeMap$1("input,textarea,option,select,progress"),mustUseProp=function(M,$,I){return I==="value"&&acceptValue(M)&&$!=="button"||I==="selected"&&M==="option"||I==="checked"&&M==="input"||I==="muted"&&M==="video"},isEnumeratedAttr=makeMap$1("contenteditable,draggable,spellcheck"),isValidContentEditableValue=makeMap$1("events,caret,typing,plaintext-only"),convertEnumeratedValue=function(M,$){return isFalsyAttrValue($)||$==="false"?"false":M==="contenteditable"&&isValidContentEditableValue($)?$:"true"},isBooleanAttr$1=makeMap$1("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),xlinkNS="http://www.w3.org/1999/xlink",isXlink=function(M){return M.charAt(5)===":"&&M.slice(0,5)==="xlink"},getXlinkProp=function(M){return isXlink(M)?M.slice(6,M.length):""},isFalsyAttrValue=function(M){return M==null||M===!1};function genClassForVnode(M){for(var $=M.data,I=M,N=M;isDef(N.componentInstance);)N=N.componentInstance._vnode,N&&N.data&&($=mergeClassData(N.data,$));for(;isDef(I=I.parent);)I&&I.data&&($=mergeClassData($,I.data));return renderClass($.staticClass,$.class)}function mergeClassData(M,$){return{staticClass:concat$3(M.staticClass,$.staticClass),class:isDef(M.class)?[M.class,$.class]:$.class}}function renderClass(M,$){return isDef(M)||isDef($)?concat$3(M,stringifyClass($)):""}function concat$3(M,$){return M?$?M+" "+$:M:$||""}function stringifyClass(M){return Array.isArray(M)?stringifyArray(M):isObject$6(M)?stringifyObject(M):typeof M=="string"?M:""}function stringifyArray(M){for(var $="",I,N=0,B=M.length;N-1?unknownElementCache[M]=$.constructor===window.HTMLUnknownElement||$.constructor===window.HTMLElement:unknownElementCache[M]=/HTMLUnknownElement/.test($.toString())}var isTextInputType=makeMap$1("text,number,password,search,email,tel,url");function query(M){if(typeof M=="string"){var $=document.querySelector(M);return $||document.createElement("div")}else return M}function createElement(M,$){var I=document.createElement(M);return M!=="select"||$.data&&$.data.attrs&&$.data.attrs.multiple!==void 0&&I.setAttribute("multiple","multiple"),I}function createElementNS(M,$){return document.createElementNS(namespaceMap[M],$)}function createTextNode(M){return document.createTextNode(M)}function createComment(M){return document.createComment(M)}function insertBefore$1(M,$,I){M.insertBefore($,I)}function removeChild(M,$){M.removeChild($)}function appendChild(M,$){M.appendChild($)}function parentNode$1(M){return M.parentNode}function nextSibling(M){return M.nextSibling}function tagName(M){return M.tagName}function setTextContent(M,$){M.textContent=$}function setStyleScope(M,$){M.setAttribute($,"")}var nodeOps=Object.freeze({__proto__:null,createElement,createElementNS,createTextNode,createComment,insertBefore:insertBefore$1,removeChild,appendChild,parentNode:parentNode$1,nextSibling,tagName,setTextContent,setStyleScope}),ref={create:function(M,$){registerRef($)},update:function(M,$){M.data.ref!==$.data.ref&&(registerRef(M,!0),registerRef($))},destroy:function(M){registerRef(M,!0)}};function registerRef(M,$){var I=M.data.ref;if(isDef(I)){var N=M.context,B=M.componentInstance||M.elm,j=$?null:B,U=$?void 0:B;if(isFunction$6(I)){invokeWithErrorHandling(I,N,[j],N,"template ref function");return}var q=M.data.refInFor,Y=typeof I=="string"||typeof I=="number",K=isRef$1(I),G=N.$refs;if(Y||K){if(q){var J=Y?G[I]:I.value;$?isArray$9(J)&&remove$2(J,B):isArray$9(J)?J.includes(B)||J.push(B):Y?(G[I]=[B],setSetupRef(N,I,G[I])):I.value=[B]}else if(Y){if($&&G[I]!==B)return;G[I]=U,setSetupRef(N,I,j)}else if(K){if($&&I.value!==B)return;I.value=j}}}}function setSetupRef(M,$,I){var N=M._setupState;N&&hasOwn$4(N,$)&&(isRef$1(N[$])?N[$].value=I:N[$]=I)}var emptyNode=new VNode("",{},[]),hooks$2=["create","activate","update","remove","destroy"];function sameVnode(M,$){return M.key===$.key&&M.asyncFactory===$.asyncFactory&&(M.tag===$.tag&&M.isComment===$.isComment&&isDef(M.data)===isDef($.data)&&sameInputType(M,$)||isTrue(M.isAsyncPlaceholder)&&isUndef($.asyncFactory.error))}function sameInputType(M,$){if(M.tag!=="input")return!0;var I,N=isDef(I=M.data)&&isDef(I=I.attrs)&&I.type,B=isDef(I=$.data)&&isDef(I=I.attrs)&&I.type;return N===B||isTextInputType(N)&&isTextInputType(B)}function createKeyToOldIdx(M,$,I){var N,B,j={};for(N=$;N<=I;++N)B=M[N].key,isDef(B)&&(j[B]=N);return j}function createPatchFunction(M){var $,I,N={},B=M.modules,j=M.nodeOps;for($=0;$Fe?(qt=isUndef(Ae[qe+1])?null:Ae[qe+1].elm,le(be,qt,Ae,ze,qe,ke)):ze>qe&&ue(we,Me,Fe)}function me(be,we,Ae,ke){for(var Oe=Ae;Oe-1?baseSetAttr(M,$,I):isBooleanAttr$1($)?isFalsyAttrValue(I)?M.removeAttribute($):(I=$==="allowfullscreen"&&M.tagName==="EMBED"?"true":$,M.setAttribute($,I)):isEnumeratedAttr($)?M.setAttribute($,convertEnumeratedValue($,I)):isXlink($)?isFalsyAttrValue(I)?M.removeAttributeNS(xlinkNS,getXlinkProp($)):M.setAttributeNS(xlinkNS,$,I):baseSetAttr(M,$,I)}function baseSetAttr(M,$,I){if(isFalsyAttrValue(I))M.removeAttribute($);else{if(isIE$1&&!isIE9&&M.tagName==="TEXTAREA"&&$==="placeholder"&&I!==""&&!M.__ieph){var N=function(B){B.stopImmediatePropagation(),M.removeEventListener("input",N)};M.addEventListener("input",N),M.__ieph=!0}M.setAttribute($,I)}}var attrs={create:updateAttrs,update:updateAttrs};function updateClass(M,$){var I=$.elm,N=$.data,B=M.data;if(!(isUndef(N.staticClass)&&isUndef(N.class)&&(isUndef(B)||isUndef(B.staticClass)&&isUndef(B.class)))){var j=genClassForVnode($),U=I._transitionClasses;isDef(U)&&(j=concat$3(j,stringifyClass(U))),j!==I._prevClass&&(I.setAttribute("class",j),I._prevClass=j)}}var klass$1={create:updateClass,update:updateClass},validDivisionCharRE=/[\w).+\-_$\]]/;function parseFilters(M){var $=!1,I=!1,N=!1,B=!1,j=0,U=0,q=0,Y=0,K,G,J,Z,ee;for(J=0;J=0&&(re=M.charAt(te),re===" ");te--);(!re||!validDivisionCharRE.test(re))&&(B=!0)}}Z===void 0?Z=M.slice(0,J).trim():Y!==0&&se();function se(){(ee||(ee=[])).push(M.slice(Y,J).trim()),Y=J+1}if(ee)for(J=0;J-1?{exp:M.slice(0,index$2),key:'"'+M.slice(index$2+1)+'"'}:{exp:M,key:null};for(str=M,index$2=expressionPos=expressionEndPos=0;!eof();)chr=next(),isStringStart(chr)?parseString(chr):chr===91&&parseBracket(chr);return{exp:M.slice(0,expressionPos),key:M.slice(expressionPos+1,expressionEndPos)}}function next(){return str.charCodeAt(++index$2)}function eof(){return index$2>=len}function isStringStart(M){return M===34||M===39}function parseBracket(M){var $=1;for(expressionPos=index$2;!eof();){if(M=next(),isStringStart(M)){parseString(M);continue}if(M===91&&$++,M===93&&$--,$===0){expressionEndPos=index$2;break}}}function parseString(M){for(var $=M;!eof()&&(M=next(),M!==$););}var RANGE_TOKEN="__r",CHECKBOX_RADIO_TOKEN="__c";function model$1(M,$,I){var N=$.value,B=$.modifiers,j=M.tag,U=M.attrsMap.type;if(M.component)return genComponentModel(M,N,B),!1;if(j==="select")genSelect(M,N,B);else if(j==="input"&&U==="checkbox")genCheckboxModel(M,N,B);else if(j==="input"&&U==="radio")genRadioModel(M,N,B);else if(j==="input"||j==="textarea")genDefaultModel(M,N,B);else if(!config$1.isReservedTag(j))return genComponentModel(M,N,B),!1;return!0}function genCheckboxModel(M,$,I){var N=I&&I.number,B=getBindingAttr(M,"value")||"null",j=getBindingAttr(M,"true-value")||"true",U=getBindingAttr(M,"false-value")||"false";addProp(M,"checked","Array.isArray(".concat($,")")+"?_i(".concat($,",").concat(B,")>-1")+(j==="true"?":(".concat($,")"):":_q(".concat($,",").concat(j,")"))),addHandler(M,"change","var $$a=".concat($,",")+"$$el=$event.target,"+"$$c=$$el.checked?(".concat(j,"):(").concat(U,");")+"if(Array.isArray($$a)){"+"var $$v=".concat(N?"_n("+B+")":B,",")+"$$i=_i($$a,$$v);"+"if($$el.checked){$$i<0&&(".concat(genAssignmentCode($,"$$a.concat([$$v])"),")}")+"else{$$i>-1&&(".concat(genAssignmentCode($,"$$a.slice(0,$$i).concat($$a.slice($$i+1))"),")}")+"}else{".concat(genAssignmentCode($,"$$c"),"}"),null,!0)}function genRadioModel(M,$,I){var N=I&&I.number,B=getBindingAttr(M,"value")||"null";B=N?"_n(".concat(B,")"):B,addProp(M,"checked","_q(".concat($,",").concat(B,")")),addHandler(M,"change",genAssignmentCode($,B),null,!0)}function genSelect(M,$,I){var N=I&&I.number,B='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;'+"return ".concat(N?"_n(val)":"val","})"),j="$event.target.multiple ? $$selectedVal : $$selectedVal[0]",U="var $$selectedVal = ".concat(B,";");U="".concat(U," ").concat(genAssignmentCode($,j)),addHandler(M,"change",U,null,!0)}function genDefaultModel(M,$,I){var N=M.attrsMap.type,B=I||{},j=B.lazy,U=B.number,q=B.trim,Y=!j&&N!=="range",K=j?"change":N==="range"?RANGE_TOKEN:"input",G="$event.target.value";q&&(G="$event.target.value.trim()"),U&&(G="_n(".concat(G,")"));var J=genAssignmentCode($,G);Y&&(J="if($event.target.composing)return;".concat(J)),addProp(M,"value","(".concat($,")")),addHandler(M,K,J,null,!0),(q||U)&&addHandler(M,"blur","$forceUpdate()")}function normalizeEvents(M){if(isDef(M[RANGE_TOKEN])){var $=isIE$1?"change":"input";M[$]=[].concat(M[RANGE_TOKEN],M[$]||[]),delete M[RANGE_TOKEN]}isDef(M[CHECKBOX_RADIO_TOKEN])&&(M.change=[].concat(M[CHECKBOX_RADIO_TOKEN],M.change||[]),delete M[CHECKBOX_RADIO_TOKEN])}var target$2;function createOnceHandler(M,$,I){var N=target$2;return function B(){var j=$.apply(null,arguments);j!==null&&remove(M,B,I,N)}}var useMicrotaskFix=isUsingMicroTask&&!(isFF&&Number(isFF[1])<=53);function add$3(M,$,I,N){if(useMicrotaskFix){var B=currentFlushTimestamp,j=$;$=j._wrapper=function(U){if(U.target===U.currentTarget||U.timeStamp>=B||U.timeStamp<=0||U.target.ownerDocument!==document)return j.apply(this,arguments)}}target$2.addEventListener(M,$,supportsPassive$1?{capture:I,passive:N}:I)}function remove(M,$,I,N){(N||target$2).removeEventListener(M,$._wrapper||$,I)}function updateDOMListeners(M,$){if(!(isUndef(M.data.on)&&isUndef($.data.on))){var I=$.data.on||{},N=M.data.on||{};target$2=$.elm||M.elm,normalizeEvents(I),updateListeners(I,N,add$3,remove,createOnceHandler,$.context),target$2=void 0}}var events={create:updateDOMListeners,update:updateDOMListeners,destroy:function(M){return updateDOMListeners(M,emptyNode)}},svgContainer;function updateDOMProps(M,$){if(!(isUndef(M.data.domProps)&&isUndef($.data.domProps))){var I,N,B=$.elm,j=M.data.domProps||{},U=$.data.domProps||{};(isDef(U.__ob__)||isTrue(U._v_attr_proxy))&&(U=$.data.domProps=extend$6({},U));for(I in j)I in U||(B[I]="");for(I in U){if(N=U[I],I==="textContent"||I==="innerHTML"){if($.children&&($.children.length=0),N===j[I])continue;B.childNodes.length===1&&B.removeChild(B.childNodes[0])}if(I==="value"&&B.tagName!=="PROGRESS"){B._value=N;var q=isUndef(N)?"":String(N);shouldUpdateValue(B,q)&&(B.value=q)}else if(I==="innerHTML"&&isSVG(B.tagName)&&isUndef(B.innerHTML)){svgContainer=svgContainer||document.createElement("div"),svgContainer.innerHTML="".concat(N,"");for(var Y=svgContainer.firstChild;B.firstChild;)B.removeChild(B.firstChild);for(;Y.firstChild;)B.appendChild(Y.firstChild)}else if(N!==j[I])try{B[I]=N}catch{}}}}function shouldUpdateValue(M,$){return!M.composing&&(M.tagName==="OPTION"||isNotInFocusAndDirty(M,$)||isDirtyWithModifiers(M,$))}function isNotInFocusAndDirty(M,$){var I=!0;try{I=document.activeElement!==M}catch{}return I&&M.value!==$}function isDirtyWithModifiers(M,$){var I=M.value,N=M._vModifiers;if(isDef(N)){if(N.number)return toNumber(I)!==toNumber($);if(N.trim)return I.trim()!==$.trim()}return I!==$}var domProps={create:updateDOMProps,update:updateDOMProps},parseStyleText=cached(function(M){var $={},I=/;(?![^(]*\))/g,N=/:(.+)/;return M.split(I).forEach(function(B){if(B){var j=B.split(N);j.length>1&&($[j[0].trim()]=j[1].trim())}}),$});function normalizeStyleData(M){var $=normalizeStyleBinding(M.style);return M.staticStyle?extend$6(M.staticStyle,$):$}function normalizeStyleBinding(M){return Array.isArray(M)?toObject$1(M):typeof M=="string"?parseStyleText(M):M}function getStyle(M,$){var I={},N;if($)for(var B=M;B.componentInstance;)B=B.componentInstance._vnode,B&&B.data&&(N=normalizeStyleData(B.data))&&extend$6(I,N);(N=normalizeStyleData(M.data))&&extend$6(I,N);for(var j=M;j=j.parent;)j.data&&(N=normalizeStyleData(j.data))&&extend$6(I,N);return I}var cssVarRE=/^--/,importantRE=/\s*!important$/,setProp=function(M,$,I){if(cssVarRE.test($))M.style.setProperty($,I);else if(importantRE.test(I))M.style.setProperty(hyphenate($),I.replace(importantRE,""),"important");else{var N=normalize$1($);if(Array.isArray(I))for(var B=0,j=I.length;B-1?$.split(whitespaceRE$1).forEach(function(N){return M.classList.add(N)}):M.classList.add($);else{var I=" ".concat(M.getAttribute("class")||""," ");I.indexOf(" "+$+" ")<0&&M.setAttribute("class",(I+$).trim())}}function removeClass(M,$){if(!(!$||!($=$.trim())))if(M.classList)$.indexOf(" ")>-1?$.split(whitespaceRE$1).forEach(function(B){return M.classList.remove(B)}):M.classList.remove($),M.classList.length||M.removeAttribute("class");else{for(var I=" ".concat(M.getAttribute("class")||""," "),N=" "+$+" ";I.indexOf(N)>=0;)I=I.replace(N," ");I=I.trim(),I?M.setAttribute("class",I):M.removeAttribute("class")}}function resolveTransition(M){if(M){if(typeof M=="object"){var $={};return M.css!==!1&&extend$6($,autoCssTransition(M.name||"v")),extend$6($,M),$}else if(typeof M=="string")return autoCssTransition(M)}}var autoCssTransition=cached(function(M){return{enterClass:"".concat(M,"-enter"),enterToClass:"".concat(M,"-enter-to"),enterActiveClass:"".concat(M,"-enter-active"),leaveClass:"".concat(M,"-leave"),leaveToClass:"".concat(M,"-leave-to"),leaveActiveClass:"".concat(M,"-leave-active")}}),hasTransition=inBrowser&&!isIE9,TRANSITION="transition",ANIMATION="animation",transitionProp="transition",transitionEndEvent="transitionend",animationProp="animation",animationEndEvent="animationend";hasTransition&&(window.ontransitionend===void 0&&window.onwebkittransitionend!==void 0&&(transitionProp="WebkitTransition",transitionEndEvent="webkitTransitionEnd"),window.onanimationend===void 0&&window.onwebkitanimationend!==void 0&&(animationProp="WebkitAnimation",animationEndEvent="webkitAnimationEnd"));var raf=inBrowser?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(M){return M()};function nextFrame$1(M){raf(function(){raf(M)})}function addTransitionClass(M,$){var I=M._transitionClasses||(M._transitionClasses=[]);I.indexOf($)<0&&(I.push($),addClass(M,$))}function removeTransitionClass(M,$){M._transitionClasses&&remove$2(M._transitionClasses,$),removeClass(M,$)}function whenTransitionEnds(M,$,I){var N=getTransitionInfo(M,$),B=N.type,j=N.timeout,U=N.propCount;if(!B)return I();var q=B===TRANSITION?transitionEndEvent:animationEndEvent,Y=0,K=function(){M.removeEventListener(q,G),I()},G=function(J){J.target===M&&++Y>=U&&K()};setTimeout(function(){Y0&&(K=TRANSITION,G=j,J=B.length):$===ANIMATION?Y>0&&(K=ANIMATION,G=Y,J=q.length):(G=Math.max(j,Y),K=G>0?j>Y?TRANSITION:ANIMATION:null,J=K?K===TRANSITION?B.length:q.length:0);var Z=K===TRANSITION&&transformRE.test(I[transitionProp+"Property"]);return{type:K,timeout:G,propCount:J,hasTransform:Z}}function getTimeout(M,$){for(;M.length<$.length;)M=M.concat(M);return Math.max.apply(null,$.map(function(I,N){return toMs(I)+toMs(M[N])}))}function toMs(M){return Number(M.slice(0,-1).replace(",","."))*1e3}function enter$1(M,$){var I=M.elm;isDef(I._leaveCb)&&(I._leaveCb.cancelled=!0,I._leaveCb());var N=resolveTransition(M.data.transition);if(!isUndef(N)&&!(isDef(I._enterCb)||I.nodeType!==1)){for(var B=N.css,j=N.type,U=N.enterClass,q=N.enterToClass,Y=N.enterActiveClass,K=N.appearClass,G=N.appearToClass,J=N.appearActiveClass,Z=N.beforeEnter,ee=N.enter,te=N.afterEnter,re=N.enterCancelled,se=N.beforeAppear,ne=N.appear,le=N.afterAppear,ge=N.appearCancelled,ue=N.duration,_e=activeInstance,fe=activeInstance.$vnode;fe&&fe.parent;)_e=fe.context,fe=fe.parent;var me=!_e._isMounted||!M.isRootInsert;if(!(me&&!ne&&ne!=="")){var ve=me&&K?K:U,xe=me&&J?J:Y,oe=me&&G?G:q,ye=me&&se||Z,be=me&&isFunction$6(ne)?ne:ee,we=me&&le||te,Ae=me&&ge||re,ke=toNumber(isObject$6(ue)?ue.enter:ue),Oe=B!==!1&&!isIE9,Me=getHookArgumentsLength(be),ze=I._enterCb=once$2(function(){Oe&&(removeTransitionClass(I,oe),removeTransitionClass(I,xe)),ze.cancelled?(Oe&&removeTransitionClass(I,ve),Ae&&Ae(I)):we&&we(I),I._enterCb=null});M.data.show||mergeVNodeHook(M,"insert",function(){var Fe=I.parentNode,Ze=Fe&&Fe._pending&&Fe._pending[M.key];Ze&&Ze.tag===M.tag&&Ze.elm._leaveCb&&Ze.elm._leaveCb(),be&&be(I,ze)}),ye&&ye(I),Oe&&(addTransitionClass(I,ve),addTransitionClass(I,xe),nextFrame$1(function(){removeTransitionClass(I,ve),ze.cancelled||(addTransitionClass(I,oe),Me||(isValidDuration(ke)?setTimeout(ze,ke):whenTransitionEnds(I,j,ze)))})),M.data.show&&($&&$(),be&&be(I,ze)),!Oe&&!Me&&ze()}}}function leave(M,$){var I=M.elm;isDef(I._enterCb)&&(I._enterCb.cancelled=!0,I._enterCb());var N=resolveTransition(M.data.transition);if(isUndef(N)||I.nodeType!==1)return $();if(isDef(I._leaveCb))return;var B=N.css,j=N.type,U=N.leaveClass,q=N.leaveToClass,Y=N.leaveActiveClass,K=N.beforeLeave,G=N.leave,J=N.afterLeave,Z=N.leaveCancelled,ee=N.delayLeave,te=N.duration,re=B!==!1&&!isIE9,se=getHookArgumentsLength(G),ne=toNumber(isObject$6(te)?te.leave:te),le=I._leaveCb=once$2(function(){I.parentNode&&I.parentNode._pending&&(I.parentNode._pending[M.key]=null),re&&(removeTransitionClass(I,q),removeTransitionClass(I,Y)),le.cancelled?(re&&removeTransitionClass(I,U),Z&&Z(I)):($(),J&&J(I)),I._leaveCb=null});ee?ee(ge):ge();function ge(){le.cancelled||(!M.data.show&&I.parentNode&&((I.parentNode._pending||(I.parentNode._pending={}))[M.key]=M),K&&K(I),re&&(addTransitionClass(I,U),addTransitionClass(I,Y),nextFrame$1(function(){removeTransitionClass(I,U),le.cancelled||(addTransitionClass(I,q),se||(isValidDuration(ne)?setTimeout(le,ne):whenTransitionEnds(I,j,le)))})),G&&G(I,le),!re&&!se&&le())}}function isValidDuration(M){return typeof M=="number"&&!isNaN(M)}function getHookArgumentsLength(M){if(isUndef(M))return!1;var $=M.fns;return isDef($)?getHookArgumentsLength(Array.isArray($)?$[0]:$):(M._length||M.length)>1}function _enter(M,$){$.data.show!==!0&&enter$1($)}var transition$1=inBrowser?{create:_enter,activate:_enter,remove:function(M,$){M.data.show!==!0?leave(M,$):$()}}:{},platformModules=[attrs,klass$1,events,domProps,style$1$1,transition$1],modules$1=platformModules.concat(baseModules),patch=createPatchFunction({nodeOps,modules:modules$1});isIE9&&document.addEventListener("selectionchange",function(){var M=document.activeElement;M&&M.vmodel&&trigger$1(M,"input")});var directive$2={inserted:function(M,$,I,N){I.tag==="select"?(N.elm&&!N.elm._vOptions?mergeVNodeHook(I,"postpatch",function(){directive$2.componentUpdated(M,$,I)}):setSelected(M,$,I.context),M._vOptions=[].map.call(M.options,getValue)):(I.tag==="textarea"||isTextInputType(M.type))&&(M._vModifiers=$.modifiers,$.modifiers.lazy||(M.addEventListener("compositionstart",onCompositionStart),M.addEventListener("compositionend",onCompositionEnd),M.addEventListener("change",onCompositionEnd),isIE9&&(M.vmodel=!0)))},componentUpdated:function(M,$,I){if(I.tag==="select"){setSelected(M,$,I.context);var N=M._vOptions,B=M._vOptions=[].map.call(M.options,getValue);if(B.some(function(U,q){return!looseEqual(U,N[q])})){var j=M.multiple?$.value.some(function(U){return hasNoMatchingOption(U,B)}):$.value!==$.oldValue&&hasNoMatchingOption($.value,B);j&&trigger$1(M,"change")}}}};function setSelected(M,$,I){actuallySetSelected(M,$),(isIE$1||isEdge)&&setTimeout(function(){actuallySetSelected(M,$)},0)}function actuallySetSelected(M,$,I){var N=$.value,B=M.multiple;if(!(B&&!Array.isArray(N))){for(var j,U,q=0,Y=M.options.length;q-1,U.selected!==j&&(U.selected=j);else if(looseEqual(getValue(U),N)){M.selectedIndex!==q&&(M.selectedIndex=q);return}B||(M.selectedIndex=-1)}}function hasNoMatchingOption(M,$){return $.every(function(I){return!looseEqual(I,M)})}function getValue(M){return"_value"in M?M._value:M.value}function onCompositionStart(M){M.target.composing=!0}function onCompositionEnd(M){M.target.composing&&(M.target.composing=!1,trigger$1(M.target,"input"))}function trigger$1(M,$){var I=document.createEvent("HTMLEvents");I.initEvent($,!0,!0),M.dispatchEvent(I)}function locateNode(M){return M.componentInstance&&(!M.data||!M.data.transition)?locateNode(M.componentInstance._vnode):M}var show={bind:function(M,$,I){var N=$.value;I=locateNode(I);var B=I.data&&I.data.transition,j=M.__vOriginalDisplay=M.style.display==="none"?"":M.style.display;N&&B?(I.data.show=!0,enter$1(I,function(){M.style.display=j})):M.style.display=N?j:"none"},update:function(M,$,I){var N=$.value,B=$.oldValue;if(!N!=!B){I=locateNode(I);var j=I.data&&I.data.transition;j?(I.data.show=!0,N?enter$1(I,function(){M.style.display=M.__vOriginalDisplay}):leave(I,function(){M.style.display="none"})):M.style.display=N?M.__vOriginalDisplay:"none"}},unbind:function(M,$,I,N,B){B||(M.style.display=M.__vOriginalDisplay)}},platformDirectives={model:directive$2,show},transitionProps={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function getRealChild(M){var $=M&&M.componentOptions;return $&&$.Ctor.options.abstract?getRealChild(getFirstComponentChild($.children)):M}function extractTransitionData(M){var $={},I=M.$options;for(var N in I.propsData)$[N]=M[N];var B=I._parentListeners;for(var N in B)$[camelize(N)]=B[N];return $}function placeholder(M,$){if(/\d-keep-alive$/.test($.tag))return M("keep-alive",{props:$.componentOptions.propsData})}function hasParentTransition(M){for(;M=M.parent;)if(M.data.transition)return!0}function isSameChild(M,$){return $.key===M.key&&$.tag===M.tag}var isNotTextNode=function(M){return M.tag||isAsyncPlaceholder(M)},isVShowDirective=function(M){return M.name==="show"},Transition={name:"transition",props:transitionProps,abstract:!0,render:function(M){var $=this,I=this.$slots.default;if(I&&(I=I.filter(isNotTextNode),!!I.length)){var N=this.mode,B=I[0];if(hasParentTransition(this.$vnode))return B;var j=getRealChild(B);if(!j)return B;if(this._leaving)return placeholder(M,B);var U="__transition-".concat(this._uid,"-");j.key=j.key==null?j.isComment?U+"comment":U+j.tag:isPrimitive(j.key)?String(j.key).indexOf(U)===0?j.key:U+j.key:j.key;var q=(j.data||(j.data={})).transition=extractTransitionData(this),Y=this._vnode,K=getRealChild(Y);if(j.data.directives&&j.data.directives.some(isVShowDirective)&&(j.data.show=!0),K&&K.data&&!isSameChild(j,K)&&!isAsyncPlaceholder(K)&&!(K.componentInstance&&K.componentInstance._vnode.isComment)){var G=K.data.transition=extend$6({},q);if(N==="out-in")return this._leaving=!0,mergeVNodeHook(G,"afterLeave",function(){$._leaving=!1,$.$forceUpdate()}),placeholder(M,B);if(N==="in-out"){if(isAsyncPlaceholder(j))return Y;var J,Z=function(){J()};mergeVNodeHook(q,"afterEnter",Z),mergeVNodeHook(q,"enterCancelled",Z),mergeVNodeHook(G,"delayLeave",function(ee){J=ee})}}return B}}},props=extend$6({tag:String,moveClass:String},transitionProps);delete props.mode;var TransitionGroup={props,beforeMount:function(){var M=this,$=this._update;this._update=function(I,N){var B=setActiveInstance(M);M.__patch__(M._vnode,M.kept,!1,!0),M._vnode=M.kept,B(),$.call(M,I,N)}},render:function(M){for(var $=this.tag||this.$vnode.data.tag||"span",I=Object.create(null),N=this.prevChildren=this.children,B=this.$slots.default||[],j=this.children=[],U=extractTransitionData(this),q=0;qj&&(B.push(Y=M.slice(j,q)),N.push(JSON.stringify(Y)));var K=parseFilters(U[1].trim());N.push("_s(".concat(K,")")),B.push({"@binding":K}),j=q+U[0].length}return j\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,dynamicArgAttribute=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ncname="[a-zA-Z_][\\-\\.0-9_a-zA-Z".concat(unicodeRegExp.source,"]*"),qnameCapture="((?:".concat(ncname,"\\:)?").concat(ncname,")"),startTagOpen=new RegExp("^<".concat(qnameCapture)),startTagClose=/^\s*(\/?)>/,endTag=new RegExp("^<\\/".concat(qnameCapture,"[^>]*>")),doctype=/^]+>/i,comment=/^",""":'"',"&":"&"," ":` `," ":" ","'":"'"},encodedAttr=/&(?:lt|gt|quot|amp|#39);/g,encodedAttrWithNewLines=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,isIgnoreNewlineTag=makeMap$1("pre,textarea",!0),shouldIgnoreFirstNewline=function(M,$){return M&&isIgnoreNewlineTag(M)&&$[0]===` `};function decodeAttr(M,$){var I=$?encodedAttrWithNewLines:encodedAttr;return M.replace(I,function(N){return decodingMap[N]})}function parseHTML(M,$){for(var I=[],N=$.expectHTML,B=$.isUnaryTag||no,j=$.canBeLeftOpenTag||no,U=0,q,Y,K=function(){if(q=M,!Y||!isPlainTextElement(Y)){var re=M.indexOf("<");if(re===0){if(comment.test(M)){var se=M.indexOf("-->");if(se>=0)return $.shouldKeepComment&&$.comment&&$.comment(M.substring(4,se),U,U+se+3),J(se+3),"continue"}if(conditionalComment.test(M)){var ne=M.indexOf("]>");if(ne>=0)return J(ne+2),"continue"}var le=M.match(doctype);if(le)return J(le[0].length),"continue";var ge=M.match(endTag);if(ge){var ue=U;return J(ge[0].length),te(ge[1],ue,U),"continue"}var _e=Z();if(_e)return ee(_e),shouldIgnoreFirstNewline(_e.tagName,M)&&J(1),"continue"}var fe=void 0,me=void 0,ve=void 0;if(re>=0){for(me=M.slice(re);!endTag.test(me)&&!startTagOpen.test(me)&&!comment.test(me)&&!conditionalComment.test(me)&&(ve=me.indexOf("<",1),!(ve<0));)re+=ve,me=M.slice(re);fe=M.substring(0,re)}re<0&&(fe=M),fe&&J(fe.length),$.chars&&fe&&$.chars(fe,U-fe.length,U)}else{var xe=0,oe=Y.toLowerCase(),ye=reCache[oe]||(reCache[oe]=new RegExp("([\\s\\S]*?)(]*>)","i")),me=M.replace(ye,function(we,Ae,ke){return xe=ke.length,!isPlainTextElement(oe)&&oe!=="noscript"&&(Ae=Ae.replace(//g,"$1").replace(//g,"$1")),shouldIgnoreFirstNewline(oe,Ae)&&(Ae=Ae.slice(1)),$.chars&&$.chars(Ae),""});U+=M.length-me.length,M=me,te(oe,U-xe,U)}if(M===q)return $.chars&&$.chars(M),"break"};M;){var G=K();if(G==="break")break}te();function J(re){U+=re,M=M.substring(re)}function Z(){var re=M.match(startTagOpen);if(re){var se={tagName:re[1],attrs:[],start:U};J(re[0].length);for(var ne=void 0,le=void 0;!(ne=M.match(startTagClose))&&(le=M.match(dynamicArgAttribute)||M.match(attribute));)le.start=U,J(le[0].length),le.end=U,se.attrs.push(le);if(ne)return se.unarySlash=ne[1],J(ne[0].length),se.end=U,se}}function ee(re){var se=re.tagName,ne=re.unarySlash;N&&(Y==="p"&&isNonPhrasingTag(se)&&te(Y),j(se)&&Y===se&&te(se));for(var le=B(se)||!!ne,ge=re.attrs.length,ue=new Array(ge),_e=0;_e=0&&I[le].lowerCasedTag!==ge;le--);else le=0;if(le>=0){for(var ue=I.length-1;ue>=le;ue--)$.end&&$.end(I[ue].tag,se,ne);I.length=le,Y=le&&I[le-1].tag}else ge==="br"?$.start&&$.start(re,[],!0,se,ne):ge==="p"&&($.start&&$.start(re,[],!1,se,ne),$.end&&$.end(re,se,ne))}}var onRE=/^@|^v-on:/,dirRE=/^v-|^@|^:|^#/,forAliasRE=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,forIteratorRE=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,stripParensRE=/^\(|\)$/g,dynamicArgRE=/^\[.*\]$/,argRE=/:(.*)$/,bindRE=/^:|^\.|^v-bind:/,modifierRE=/\.[^.\]]+(?=[^\]]*$)/g,slotRE=/^v-slot(:|$)|^#/,lineBreakRE=/[\r\n]/,whitespaceRE=/[ \f\t\r\n]+/g,decodeHTMLCached=cached(he.decode),emptySlotScopeToken="_empty_",warn$4,delimiters,transforms,preTransforms,postTransforms,platformIsPreTag,platformMustUseProp,platformGetTagNamespace;function createASTElement(M,$,I){return{type:1,tag:M,attrsList:$,attrsMap:makeAttrsMap($),rawAttrsMap:{},parent:I,children:[]}}function parse$3(M,$){warn$4=$.warn||baseWarn,platformIsPreTag=$.isPreTag||no,platformMustUseProp=$.mustUseProp||no,platformGetTagNamespace=$.getTagNamespace||no,$.isReservedTag,transforms=pluckModuleFunction($.modules,"transformNode"),preTransforms=pluckModuleFunction($.modules,"preTransformNode"),postTransforms=pluckModuleFunction($.modules,"postTransformNode"),delimiters=$.delimiters;var I=[],N=$.preserveWhitespace!==!1,B=$.whitespace,j,U,q=!1,Y=!1;function K(J){if(G(J),!q&&!J.processed&&(J=processElement(J,$)),!I.length&&J!==j&&j.if&&(J.elseif||J.else)&&addIfCondition(j,{exp:J.elseif,block:J}),U&&!J.forbidden)if(J.elseif||J.else)processIfConditions(J,U);else{if(J.slotScope){var Z=J.slotTarget||'"default"';(U.scopedSlots||(U.scopedSlots={}))[Z]=J}U.children.push(J),J.parent=U}J.children=J.children.filter(function(te){return!te.slotScope}),G(J),J.pre&&(q=!1),platformIsPreTag(J.tag)&&(Y=!1);for(var ee=0;ee|^function(?:\s+[\w$]+)?\s*\(/,fnInvokeRE=/\([^)]*?\);*$/,simplePathRE=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,keyCodes={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},keyNames={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},genGuard=function(M){return"if(".concat(M,")return null;")},modifierCode={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:genGuard("$event.target !== $event.currentTarget"),ctrl:genGuard("!$event.ctrlKey"),shift:genGuard("!$event.shiftKey"),alt:genGuard("!$event.altKey"),meta:genGuard("!$event.metaKey"),left:genGuard("'button' in $event && $event.button !== 0"),middle:genGuard("'button' in $event && $event.button !== 1"),right:genGuard("'button' in $event && $event.button !== 2")};function genHandlers(M,$){var I=$?"nativeOn:":"on:",N="",B="";for(var j in M){var U=genHandler(M[j]);M[j]&&M[j].dynamic?B+="".concat(j,",").concat(U,","):N+='"'.concat(j,'":').concat(U,",")}return N="{".concat(N.slice(0,-1),"}"),B?I+"_d(".concat(N,",[").concat(B.slice(0,-1),"])"):I+N}function genHandler(M){if(!M)return"function(){}";if(Array.isArray(M))return"[".concat(M.map(function(G){return genHandler(G)}).join(","),"]");var $=simplePathRE.test(M.value),I=fnExpRE.test(M.value),N=simplePathRE.test(M.value.replace(fnInvokeRE,""));if(M.modifiers){var B="",j="",U=[],q=function(G){if(modifierCode[G])j+=modifierCode[G],keyCodes[G]&&U.push(G);else if(G==="exact"){var J=M.modifiers;j+=genGuard(["ctrl","shift","alt","meta"].filter(function(Z){return!J[Z]}).map(function(Z){return"$event.".concat(Z,"Key")}).join("||"))}else U.push(G)};for(var Y in M.modifiers)q(Y);U.length&&(B+=genKeyFilter(U)),j&&(B+=j);var K=$?"return ".concat(M.value,".apply(null, arguments)"):I?"return (".concat(M.value,").apply(null, arguments)"):N?"return ".concat(M.value):M.value;return"function($event){".concat(B).concat(K,"}")}else return $||I?M.value:"function($event){".concat(N?"return ".concat(M.value):M.value,"}")}function genKeyFilter(M){return"if(!$event.type.indexOf('key')&&"+"".concat(M.map(genFilterCode).join("&&"),")return null;")}function genFilterCode(M){var $=parseInt(M,10);if($)return"$event.keyCode!==".concat($);var I=keyCodes[M],N=keyNames[M];return"_k($event.keyCode,"+"".concat(JSON.stringify(M),",")+"".concat(JSON.stringify(I),",")+"$event.key,"+"".concat(JSON.stringify(N))+")"}function on$1(M,$){M.wrapListeners=function(I){return"_g(".concat(I,",").concat($.value,")")}}function bind$8(M,$){M.wrapData=function(I){return"_b(".concat(I,",'").concat(M.tag,"',").concat($.value,",").concat($.modifiers&&$.modifiers.prop?"true":"false").concat($.modifiers&&$.modifiers.sync?",true":"",")")}}var baseDirectives={on:on$1,bind:bind$8,cloak:noop$2},CodegenState=function(){function M($){this.options=$,this.warn=$.warn||baseWarn,this.transforms=pluckModuleFunction($.modules,"transformCode"),this.dataGenFns=pluckModuleFunction($.modules,"genData"),this.directives=extend$6(extend$6({},baseDirectives),$.directives);var I=$.isReservedTag||no;this.maybeComponent=function(N){return!!N.component||!I(N.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1}return M}();function generate(M,$){var I=new CodegenState($),N=M?M.tag==="script"?"null":genElement(M,I):'_c("div")';return{render:"with(this){return ".concat(N,"}"),staticRenderFns:I.staticRenderFns}}function genElement(M,$){if(M.parent&&(M.pre=M.pre||M.parent.pre),M.staticRoot&&!M.staticProcessed)return genStatic(M,$);if(M.once&&!M.onceProcessed)return genOnce(M,$);if(M.for&&!M.forProcessed)return genFor(M,$);if(M.if&&!M.ifProcessed)return genIf(M,$);if(M.tag==="template"&&!M.slotTarget&&!$.pre)return genChildren(M,$)||"void 0";if(M.tag==="slot")return genSlot(M,$);var I=void 0;if(M.component)I=genComponent(M.component,M,$);else{var N=void 0,B=$.maybeComponent(M);(!M.plain||M.pre&&B)&&(N=genData(M,$));var j=void 0,U=$.options.bindings;B&&U&&U.__isScriptSetup!==!1&&(j=checkBindingType(U,M.tag)),j||(j="'".concat(M.tag,"'"));var q=M.inlineTemplate?null:genChildren(M,$,!0);I="_c(".concat(j).concat(N?",".concat(N):"").concat(q?",".concat(q):"",")")}for(var Y=0;Y<$.transforms.length;Y++)I=$.transforms[Y](M,I);return I}function checkBindingType(M,$){var I=camelize($),N=capitalize$1(I),B=function(q){if(M[$]===q)return $;if(M[I]===q)return I;if(M[N]===q)return N},j=B("setup-const")||B("setup-reactive-const");if(j)return j;var U=B("setup-let")||B("setup-ref")||B("setup-maybe-ref");if(U)return U}function genStatic(M,$){M.staticProcessed=!0;var I=$.pre;return M.pre&&($.pre=M.pre),$.staticRenderFns.push("with(this){return ".concat(genElement(M,$),"}")),$.pre=I,"_m(".concat($.staticRenderFns.length-1).concat(M.staticInFor?",true":"",")")}function genOnce(M,$){if(M.onceProcessed=!0,M.if&&!M.ifProcessed)return genIf(M,$);if(M.staticInFor){for(var I="",N=M.parent;N;){if(N.for){I=N.key;break}N=N.parent}return I?"_o(".concat(genElement(M,$),",").concat($.onceId++,",").concat(I,")"):genElement(M,$)}else return genStatic(M,$)}function genIf(M,$,I,N){return M.ifProcessed=!0,genIfConditions(M.ifConditions.slice(),$,I,N)}function genIfConditions(M,$,I,N){if(!M.length)return N||"_e()";var B=M.shift();if(B.exp)return"(".concat(B.exp,")?").concat(j(B.block),":").concat(genIfConditions(M,$,I,N));return"".concat(j(B.block));function j(U){return I?I(U,$):U.once?genOnce(U,$):genElement(U,$)}}function genFor(M,$,I,N){var B=M.for,j=M.alias,U=M.iterator1?",".concat(M.iterator1):"",q=M.iterator2?",".concat(M.iterator2):"";return M.forProcessed=!0,"".concat(N||"_l","((").concat(B,"),")+"function(".concat(j).concat(U).concat(q,"){")+"return ".concat((I||genElement)(M,$))+"})"}function genData(M,$){var I="{",N=genDirectives(M,$);N&&(I+=N+","),M.key&&(I+="key:".concat(M.key,",")),M.ref&&(I+="ref:".concat(M.ref,",")),M.refInFor&&(I+="refInFor:true,"),M.pre&&(I+="pre:true,"),M.component&&(I+='tag:"'.concat(M.tag,'",'));for(var B=0;B<$.dataGenFns.length;B++)I+=$.dataGenFns[B](M);if(M.attrs&&(I+="attrs:".concat(genProps(M.attrs),",")),M.props&&(I+="domProps:".concat(genProps(M.props),",")),M.events&&(I+="".concat(genHandlers(M.events,!1),",")),M.nativeEvents&&(I+="".concat(genHandlers(M.nativeEvents,!0),",")),M.slotTarget&&!M.slotScope&&(I+="slot:".concat(M.slotTarget,",")),M.scopedSlots&&(I+="".concat(genScopedSlots(M,M.scopedSlots,$),",")),M.model&&(I+="model:{value:".concat(M.model.value,",callback:").concat(M.model.callback,",expression:").concat(M.model.expression,"},")),M.inlineTemplate){var j=genInlineTemplate(M,$);j&&(I+="".concat(j,","))}return I=I.replace(/,$/,"")+"}",M.dynamicAttrs&&(I="_b(".concat(I,',"').concat(M.tag,'",').concat(genProps(M.dynamicAttrs),")")),M.wrapData&&(I=M.wrapData(I)),M.wrapListeners&&(I=M.wrapListeners(I)),I}function genDirectives(M,$){var I=M.directives;if(I){var N="directives:[",B=!1,j,U,q,Y;for(j=0,U=I.length;j>>0}function containsSlotChild(M){return M.type===1?M.tag==="slot"?!0:M.children.some(containsSlotChild):!1}function genScopedSlot(M,$){var I=M.attrsMap["slot-scope"];if(M.if&&!M.ifProcessed&&!I)return genIf(M,$,genScopedSlot,"null");if(M.for&&!M.forProcessed)return genFor(M,$,genScopedSlot);var N=M.slotScope===emptySlotScopeToken?"":String(M.slotScope),B="function(".concat(N,"){")+"return ".concat(M.tag==="template"?M.if&&I?"(".concat(M.if,")?").concat(genChildren(M,$)||"undefined",":undefined"):genChildren(M,$)||"undefined":genElement(M,$),"}"),j=N?"":",proxy:true";return"{key:".concat(M.slotTarget||'"default"',",fn:").concat(B).concat(j,"}")}function genChildren(M,$,I,N,B){var j=M.children;if(j.length){var U=j[0];if(j.length===1&&U.for&&U.tag!=="template"&&U.tag!=="slot"){var q=I?$.maybeComponent(U)?",1":",0":"";return"".concat((N||genElement)(U,$)).concat(q)}var Y=I?getNormalizationType(j,$.maybeComponent):0,K=B||genNode;return"[".concat(j.map(function(G){return K(G,$)}).join(","),"]").concat(Y?",".concat(Y):"")}}function getNormalizationType(M,$){for(var I=0,N=0;N`:`
`,div$1.innerHTML.indexOf(" ")>0}var shouldDecodeNewlines=inBrowser?getShouldDecode(!1):!1,shouldDecodeNewlinesForHref=inBrowser?getShouldDecode(!0):!1,idToTemplate=cached(function(M){var $=query(M);return $&&$.innerHTML}),mount=Vue$3.prototype.$mount;Vue$3.prototype.$mount=function(M,$){if(M=M&&query(M),M===document.body||M===document.documentElement)return this;var I=this.$options;if(!I.render){var N=I.template;if(N)if(typeof N=="string")N.charAt(0)==="#"&&(N=idToTemplate(N));else if(N.nodeType)N=N.innerHTML;else return this;else M&&(N=getOuterHTML(M));if(N){var B=compileToFunctions(N,{outputSourceRange:!1,shouldDecodeNewlines,shouldDecodeNewlinesForHref,delimiters:I.delimiters,comments:I.comments},this),j=B.render,U=B.staticRenderFns;I.render=j,I.staticRenderFns=U}}return mount.call(this,M,$)};function getOuterHTML(M){if(M.outerHTML)return M.outerHTML;var $=document.createElement("div");return $.appendChild(M.cloneNode(!0)),$.innerHTML}Vue$3.compile=compileToFunctions;const vue_esm=Object.freeze(Object.defineProperty({__proto__:null,EffectScope,computed,customRef,default:Vue$3,defineAsyncComponent,defineComponent,del,effectScope,getCurrentInstance,getCurrentScope,h:h$2,inject,isProxy,isReactive:isReactive$1,isReadonly,isRef:isRef$1,isShallow,markRaw,mergeDefaults,nextTick:nextTick$1,onActivated,onBeforeMount,onBeforeUnmount,onBeforeUpdate,onDeactivated,onErrorCaptured,onMounted,onRenderTracked,onRenderTriggered,onScopeDispose,onServerPrefetch,onUnmounted,onUpdated,provide,proxyRefs,reactive:reactive$1,readonly:readonly$1,ref:ref$1,set:set$3,shallowReactive,shallowReadonly,shallowRef,toRaw:toRaw$1,toRef,toRefs,triggerRef,unref,useAttrs,useCssModule,useCssVars,useListeners,useSlots,version:version$3,watch,watchEffect,watchPostEffect,watchSyncEffect},Symbol.toStringTag,{value:"Module"}));var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(M){return M&&M.__esModule&&Object.prototype.hasOwnProperty.call(M,"default")?M.default:M}function getAugmentedNamespace(M){if(M.__esModule)return M;var $=M.default;if(typeof $=="function"){var I=function N(){return this instanceof N?Reflect.construct($,arguments,this.constructor):$.apply(this,arguments)};I.prototype=$.prototype}else I={};return Object.defineProperty(I,"__esModule",{value:!0}),Object.keys(M).forEach(function(N){var B=Object.getOwnPropertyDescriptor(M,N);Object.defineProperty(I,N,B.get?B:{enumerable:!0,get:function(){return M[N]}})}),I}var vueToasted_min={exports:{}};(function(M,$){(function(I,N){M.exports=N()})(commonjsGlobal,function(){return function(I){function N(j){if(B[j])return B[j].exports;var U=B[j]={i:j,l:!1,exports:{}};return I[j].call(U.exports,U,U.exports,N),U.l=!0,U.exports}var B={};return N.m=I,N.c=B,N.i=function(j){return j},N.d=function(j,U,q){N.o(j,U)||Object.defineProperty(j,U,{configurable:!1,enumerable:!0,get:q})},N.n=function(j){var U=j&&j.__esModule?function(){return j.default}:function(){return j};return N.d(U,"a",U),U},N.o=function(j,U){return Object.prototype.hasOwnProperty.call(j,U)},N.p="/dist/",N(N.s=6)}([function(I,N,B){function j(){re=!1}function U(le){if(!le)return void(ee!==ne&&(ee=ne,j()));if(le!==ee){if(le.length!==ne.length)throw new Error("Custom alphabet for shortid must be "+ne.length+" unique characters. You submitted "+le.length+" characters: "+le);var ge=le.split("").filter(function(ue,_e,fe){return _e!==fe.lastIndexOf(ue)});if(ge.length)throw new Error("Custom alphabet for shortid must be "+ne.length+" unique characters. These characters were not unique: "+ge.join(", "));ee=le,j()}}function q(le){return U(le),ee}function Y(le){se.seed(le),te!==le&&(j(),te=le)}function K(){ee||U(ne);for(var le,ge=ee.split(""),ue=[],_e=se.nextValue();ge.length>0;)_e=se.nextValue(),le=Math.floor(_e*ge.length),ue.push(ge.splice(le,1)[0]);return ue.join("")}function G(){return re||(re=K())}function J(le){return G()[le]}function Z(){return ee||ne}var ee,te,re,se=B(19),ne="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";I.exports={get:Z,characters:q,seed:Y,lookup:J,shuffled:G}},function(I,N,B){var j=B(5),U=B.n(j);N.a={animateIn:function(q){U()({targets:q,translateY:"-35px",opacity:1,duration:300,easing:"easeOutCubic"})},animateOut:function(q,Y){U()({targets:q,opacity:0,marginTop:"-40px",duration:300,easing:"easeOutExpo",complete:Y})},animateOutBottom:function(q,Y){U()({targets:q,opacity:0,marginBottom:"-40px",duration:300,easing:"easeOutExpo",complete:Y})},animateReset:function(q){U()({targets:q,left:0,opacity:1,duration:300,easing:"easeOutExpo"})},animatePanning:function(q,Y,K){U()({targets:q,duration:10,easing:"easeOutQuad",left:Y,opacity:K})},animatePanEnd:function(q,Y){U()({targets:q,opacity:0,duration:300,easing:"easeOutExpo",complete:Y})},clearAnimation:function(q){var Y=U.a.timeline();q.forEach(function(K){Y.add({targets:K.el,opacity:0,right:"-40px",duration:300,offset:"-=150",easing:"easeOutExpo",complete:function(){K.remove()}})})}}},function(I,N,B){I.exports=B(16)},function(I,N,B){B.d(N,"a",function(){return K});var j=B(8),U=B(1),q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},Y=B(2);B(11).polyfill();var K=function te(re){var se=this;return this.id=Y.generate(),this.options=re,this.cached_options={},this.global={},this.groups=[],this.toasts=[],this.container=null,Z(this),J(this),this.group=function(ne){ne||(ne={}),ne.globalToasts||(ne.globalToasts={}),Object.assign(ne.globalToasts,se.global);var le=new te(ne);return se.groups.push(le),le},this.register=function(ne,le,ge){return ge=ge||{},ee(se,ne,le,ge)},this.show=function(ne,le){return G(se,ne,le)},this.success=function(ne,le){return le=le||{},le.type="success",G(se,ne,le)},this.info=function(ne,le){return le=le||{},le.type="info",G(se,ne,le)},this.error=function(ne,le){return le=le||{},le.type="error",G(se,ne,le)},this.remove=function(ne){se.toasts=se.toasts.filter(function(le){return le.el.hash!==ne.hash}),ne.parentNode&&ne.parentNode.removeChild(ne)},this.clear=function(ne){return U.a.clearAnimation(se.toasts,function(){ne&&ne()}),se.toasts=[],!0},this},G=function(te,re,se){se=se||{};var ne=null;if((se===void 0?"undefined":q(se))!=="object")return console.error("Options should be a type of object. given : "+se),null;te.options.singleton&&te.toasts.length>0&&(te.cached_options=se,te.toasts[te.toasts.length-1].goAway(0));var le=Object.assign({},te.options);return Object.assign(le,se),ne=B.i(j.a)(te,re,le),te.toasts.push(ne),ne},J=function(te){var re=te.options.globalToasts,se=function(ne,le){return typeof le=="string"&&te[le]?te[le].apply(te,[ne,{}]):G(te,ne,le)};re&&(te.global={},Object.keys(re).forEach(function(ne){te.global[ne]=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return re[ne].apply(null,[le,se])}}))},Z=function(te){var re=document.createElement("div");re.id=te.id,re.setAttribute("role","status"),re.setAttribute("aria-live","polite"),re.setAttribute("aria-atomic","false"),document.body.appendChild(re),te.container=re},ee=function(te,re,se,ne){te.options.globalToasts||(te.options.globalToasts={}),te.options.globalToasts[re]=function(le,ge){var ue=null;return typeof se=="string"&&(ue=se),typeof se=="function"&&(ue=se(le)),ge(ue,ne)},J(te)}},function(I,N,B){B(22);var j=B(21)(null,null,null,null);I.exports=j.exports},function(I,N,B){(function(j){var U,q,Y,K={scope:{}};K.defineProperty=typeof Object.defineProperties=="function"?Object.defineProperty:function(J,Z,ee){if(ee.get||ee.set)throw new TypeError("ES3 does not support getters and setters.");J!=Array.prototype&&J!=Object.prototype&&(J[Z]=ee.value)},K.getGlobal=function(J){return typeof window<"u"&&window===J?J:j!==void 0&&j!=null?j:J},K.global=K.getGlobal(this),K.SYMBOL_PREFIX="jscomp_symbol_",K.initSymbol=function(){K.initSymbol=function(){},K.global.Symbol||(K.global.Symbol=K.Symbol)},K.symbolCounter_=0,K.Symbol=function(J){return K.SYMBOL_PREFIX+(J||"")+K.symbolCounter_++},K.initSymbolIterator=function(){K.initSymbol();var J=K.global.Symbol.iterator;J||(J=K.global.Symbol.iterator=K.global.Symbol("iterator")),typeof Array.prototype[J]!="function"&&K.defineProperty(Array.prototype,J,{configurable:!0,writable:!0,value:function(){return K.arrayIterator(this)}}),K.initSymbolIterator=function(){}},K.arrayIterator=function(J){var Z=0;return K.iteratorPrototype(function(){return Zht&&(ht+=1),1ht?mt:ht<2/3?Qe+(mt-Qe)*(2/3-ht)*6:Qe}var Se=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(Ye)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(Ye);Ye=parseInt(Se[1])/360;var We=parseInt(Se[2])/100,Pe=parseInt(Se[3])/100,Se=Se[4]||1;if(We==0)Pe=We=Ye=Pe;else{var $e=.5>Pe?Pe*(1+We):Pe+We-Pe*We,Ue=2*Pe-$e,Pe=_t(Ue,$e,Ye+1/3),We=_t(Ue,$e,Ye);Ye=_t(Ue,$e,Ye-1/3)}return"rgba("+255*Pe+","+255*We+","+255*Ye+","+Se+")"}function _e(Ye){if(Ye=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(Ye))return Ye[2]}function fe(Ye){return-1=Rt.currentTime)for(var gn=0;gn=xn||!Bn)&&(Rt.began||(Rt.began=!0,Se("begin")),Se("run")),Ot>en&&Ot=Bn&&ot!==Bn||!Bn)&&(Pe(Bn),dt||$e())),Se("update"),fn>=Bn&&(Rt.remaining?(mt=Qe,Rt.direction==="alternate"&&(Rt.reversed=!Rt.reversed)):(Rt.pause(),Rt.completed||(Rt.completed=!0,Se("complete"),"Promise"in window&&(at(),ut=_t()))),ht=0)}Ye=Ye===void 0?{}:Ye;var Qe,mt,ht=0,at=null,ut=_t(),Rt=zt(Ye);return Rt.reset=function(){var fn=Rt.direction,Bn=Rt.loop;for(Rt.currentTime=0,Rt.progress=0,Rt.paused=!0,Rt.began=!1,Rt.completed=!1,Rt.reversed=fn==="reverse",Rt.remaining=fn==="alternate"&&Bn===1?2:Bn,Pe(0),fn=Rt.children.length;fn--;)Rt.children[fn].reset()},Rt.tick=function(fn){Qe=fn,mt||(mt=Qe),Ue((ht+Qe-mt)*Ht.speed)},Rt.seek=function(fn){Ue(We(fn))},Rt.pause=function(){var fn=In.indexOf(Rt);-1=_t&&0<=Pe&&1>=Pe){var $e=new Float32Array(11);if(_t!==We||Pe!==Se)for(var Ue=0;11>Ue;++Ue)$e[Ue]=Ye(.1*Ue,_t,Pe);return function(Qe){if(_t===We&&Pe===Se)return Qe;if(Qe===0)return 0;if(Qe===1)return 1;for(var mt=0,ht=1;ht!==10&&$e[ht]<=Qe;++ht)mt+=.1;--ht;var ht=mt+(Qe-$e[ht])/($e[ht+1]-$e[ht])*.1,at=3*(1-3*Pe+3*_t)*ht*ht+2*(3*Pe-6*_t)*ht+3*_t;if(.001<=at){for(mt=0;4>mt&&(at=3*(1-3*Pe+3*_t)*ht*ht+2*(3*Pe-6*_t)*ht+3*_t)!==0;++mt)var ut=Ye(ht,_t,Pe)-Qe,ht=ht-ut/at;Qe=ht}else if(at===0)Qe=ht;else{var ht=mt,mt=mt+.1,Rt=0;do ut=ht+(mt-ht)/2,at=Ye(ut,_t,Pe)-Qe,0++Rt);Qe=ut}return Ye(Qe,We,Se)}}}}(),On=function(){function Ye(Ue,Qe){return Ue===0||Ue===1?Ue:-Math.pow(2,10*(Ue-1))*Math.sin(2*(Ue-1-Qe/(2*Math.PI)*Math.asin(1))*Math.PI/Qe)}var _t,We="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),Pe={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],Ye],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(Ue,Qe){return 1-Ye(1-Ue,Qe)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(Ue,Qe){return .5>Ue?Ye(2*Ue,Qe)/2:1-Ye(-2*Ue+2,Qe)/2}]},Se={linear:Hn(.25,.25,.75,.75)},$e={};for(_t in Pe)$e.type=_t,Pe[$e.type].forEach(function(Ue){return function(Qe,mt){Se["ease"+Ue.type+We[mt]]=_n.fnc(Qe)?Qe:Hn.apply(G,Qe)}}($e)),$e={type:$e.type};return Se}(),Fn={css:function(Ye,_t,We){return Ye.style[_t]=We},attribute:function(Ye,_t,We){return Ye.setAttribute(_t,We)},object:function(Ye,_t,We){return Ye[_t]=We},transform:function(Ye,_t,We,Pe,Se){Pe[Se]||(Pe[Se]=[]),Pe[Se].push(_t+"("+We+")")}},In=[],dn=0,kt=function(){function Ye(){dn=requestAnimationFrame(_t)}function _t(We){var Pe=In.length;if(Pe){for(var Se=0;SePe&&(_t.duration=Se.duration),_t.children.push(Se)}),_t.seek(0),_t.reset(),_t.autoplay&&_t.restart(),_t},_t},Ht.random=function(Ye,_t){return Math.floor(Math.random()*(_t-Ye+1))+Ye},Ht})}).call(N,B(25))},function(I,N,B){Object.defineProperty(N,"__esModule",{value:!0});var j=B(3),U=B(4),q=B.n(U),Y={install:function(K,G){G||(G={});var J=new j.a(G);K.component("toasted",q.a),K.toasted=K.prototype.$toasted=J}};typeof window<"u"&&window.Vue&&(window.Toasted=Y),N.default=Y},function(I,N,B){B.d(N,"a",function(){return G});var j=B(1),U=this,q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},Y=function(J,Z,ee){return setTimeout(function(){if(ee.cached_options.position&&ee.cached_options.position.includes("bottom"))return void j.a.animateOutBottom(J,function(){ee.remove(J)});j.a.animateOut(J,function(){ee.remove(J)})},Z),!0},K=function(J,Z){return((typeof HTMLElement>"u"?"undefined":q(HTMLElement))==="object"?Z instanceof HTMLElement:Z&&(Z===void 0?"undefined":q(Z))==="object"&&Z!==null&&Z.nodeType===1&&typeof Z.nodeName=="string")?J.appendChild(Z):J.innerHTML=Z,U},G=function(J,Z){var ee=!1;return{el:J,text:function(te){return K(J,te),this},goAway:function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:800;return ee=!0,Y(J,te,Z)},remove:function(){Z.remove(J)},disposed:function(){return ee}}}},function(I,N,B){var j=B(12),U=B.n(j),q=B(1),Y=B(7),K=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},G=B(2);String.prototype.includes||Object.defineProperty(String.prototype,"includes",{value:function(le,ge){return typeof ge!="number"&&(ge=0),!(ge+le.length>this.length)&&this.indexOf(le,ge)!==-1}});var J={},Z=null,ee=function(le){return le.className=le.className||null,le.onComplete=le.onComplete||null,le.position=le.position||"top-right",le.duration=le.duration||null,le.keepOnHover=le.keepOnHover||!1,le.theme=le.theme||"toasted-primary",le.type=le.type||"default",le.containerClass=le.containerClass||null,le.fullWidth=le.fullWidth||!1,le.icon=le.icon||null,le.action=le.action||null,le.fitToScreen=le.fitToScreen||null,le.closeOnSwipe=le.closeOnSwipe===void 0||le.closeOnSwipe,le.iconPack=le.iconPack||"material",le.className&&typeof le.className=="string"&&(le.className=le.className.split(" ")),le.className||(le.className=[]),le.theme&&le.className.push(le.theme.trim()),le.type&&le.className.push(le.type),le.containerClass&&typeof le.containerClass=="string"&&(le.containerClass=le.containerClass.split(" ")),le.containerClass||(le.containerClass=[]),le.position&&le.containerClass.push(le.position.trim()),le.fullWidth&&le.containerClass.push("full-width"),le.fitToScreen&&le.containerClass.push("fit-to-screen"),J=le,le},te=function(le,ge){var ue=document.createElement("div");if(ue.classList.add("toasted"),ue.hash=G.generate(),ge.className&&ge.className.forEach(function(me){ue.classList.add(me)}),((typeof HTMLElement>"u"?"undefined":K(HTMLElement))==="object"?le instanceof HTMLElement:le&&(le===void 0?"undefined":K(le))==="object"&&le!==null&&le.nodeType===1&&typeof le.nodeName=="string")?ue.appendChild(le):ue.innerHTML=le,re(ge,ue),ge.closeOnSwipe){var _e=new U.a(ue,{prevent_default:!1});_e.on("pan",function(me){var ve=me.deltaX;ue.classList.contains("panning")||ue.classList.add("panning");var xe=1-Math.abs(ve/80);xe<0&&(xe=0),q.a.animatePanning(ue,ve,xe)}),_e.on("panend",function(me){var ve=me.deltaX;Math.abs(ve)>80?q.a.animatePanEnd(ue,function(){typeof ge.onComplete=="function"&&ge.onComplete(),ue.parentNode&&Z.remove(ue)}):(ue.classList.remove("panning"),q.a.animateReset(ue))})}if(Array.isArray(ge.action))ge.action.forEach(function(me){var ve=ne(me,B.i(Y.a)(ue,Z));ve&&ue.appendChild(ve)});else if(K(ge.action)==="object"){var fe=ne(ge.action,B.i(Y.a)(ue,Z));fe&&ue.appendChild(fe)}return ue},re=function(le,ge){if(le.icon){var ue=document.createElement("i");switch(ue.setAttribute("aria-hidden","true"),le.iconPack){case"fontawesome":ue.classList.add("fa");var _e=le.icon.name?le.icon.name:le.icon;_e.includes("fa-")?ue.classList.add(_e.trim()):ue.classList.add("fa-"+_e.trim());break;case"mdi":ue.classList.add("mdi");var fe=le.icon.name?le.icon.name:le.icon;fe.includes("mdi-")?ue.classList.add(fe.trim()):ue.classList.add("mdi-"+fe.trim());break;case"custom-class":var me=le.icon.name?le.icon.name:le.icon;typeof me=="string"?me.split(" ").forEach(function(xe){ue.classList.add(xe)}):Array.isArray(me)&&me.forEach(function(xe){ue.classList.add(xe.trim())});break;case"callback":var ve=le.icon&&le.icon instanceof Function?le.icon:null;ve&&(ue=ve(ue));break;default:ue.classList.add("material-icons"),ue.textContent=le.icon.name?le.icon.name:le.icon}le.icon.after&&ue.classList.add("after"),se(le,ue,ge)}},se=function(le,ge,ue){le.icon&&(le.icon.after&&le.icon.name?ue.appendChild(ge):(le.icon.name,ue.insertBefore(ge,ue.firstChild)))},ne=function(le,ge){if(!le)return null;var ue=document.createElement("a");if(ue.classList.add("action"),ue.classList.add("ripple"),le.text&&(ue.text=le.text),le.href&&(ue.href=le.href),le.target&&(ue.target=le.target),le.icon){ue.classList.add("icon");var _e=document.createElement("i");switch(J.iconPack){case"fontawesome":_e.classList.add("fa"),le.icon.includes("fa-")?_e.classList.add(le.icon.trim()):_e.classList.add("fa-"+le.icon.trim());break;case"mdi":_e.classList.add("mdi"),le.icon.includes("mdi-")?_e.classList.add(le.icon.trim()):_e.classList.add("mdi-"+le.icon.trim());break;case"custom-class":typeof le.icon=="string"?le.icon.split(" ").forEach(function(fe){ue.classList.add(fe)}):Array.isArray(le.icon)&&le.icon.forEach(function(fe){ue.classList.add(fe.trim())});break;default:_e.classList.add("material-icons"),_e.textContent=le.icon}ue.appendChild(_e)}return le.class&&(typeof le.class=="string"?le.class.split(" ").forEach(function(fe){ue.classList.add(fe)}):Array.isArray(le.class)&&le.class.forEach(function(fe){ue.classList.add(fe.trim())})),le.push&&ue.addEventListener("click",function(fe){if(fe.preventDefault(),!J.router)return void console.warn("[vue-toasted] : Vue Router instance is not attached. please check the docs");J.router.push(le.push),le.push.dontClose||ge.goAway(0)}),le.onClick&&typeof le.onClick=="function"&&ue.addEventListener("click",function(fe){le.onClick&&(fe.preventDefault(),le.onClick(fe,ge))}),ue};N.a=function(le,ge,ue){Z=le,ue=ee(ue);var _e=Z.container;ue.containerClass.unshift("toasted-container"),_e.className!==ue.containerClass.join(" ")&&(_e.className="",ue.containerClass.forEach(function(oe){_e.classList.add(oe)}));var fe=te(ge,ue);ge&&_e.appendChild(fe),fe.style.opacity=0,q.a.animateIn(fe);var me=ue.duration,ve=void 0;if(me!==null){var xe=function(){return setInterval(function(){fe.parentNode===null&&window.clearInterval(ve),fe.classList.contains("panning")||(me-=20),me<=0&&(q.a.animateOut(fe,function(){typeof ue.onComplete=="function"&&ue.onComplete(),fe.parentNode&&Z.remove(fe)}),window.clearInterval(ve))},20)};ve=xe(),ue.keepOnHover&&(fe.addEventListener("mouseover",function(){window.clearInterval(ve)}),fe.addEventListener("mouseout",function(){ve=xe()}))}return B.i(Y.a)(fe,Z)}},function(I,N,B){N=I.exports=B(10)(),N.push([I.i,".toasted{padding:0 20px}.toasted.rounded{border-radius:24px}.toasted .primary,.toasted.toasted-primary{border-radius:2px;min-height:38px;line-height:1.1em;background-color:#353535;padding:6px 20px;font-size:15px;font-weight:300;color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.toasted .primary.success,.toasted.toasted-primary.success{background:#4caf50}.toasted .primary.error,.toasted.toasted-primary.error{background:#f44336}.toasted .primary.info,.toasted.toasted-primary.info{background:#3f51b5}.toasted .primary .action,.toasted.toasted-primary .action{color:#a1c2fa}.toasted.bubble{border-radius:30px;min-height:38px;line-height:1.1em;background-color:#ff7043;padding:0 20px;font-size:15px;font-weight:300;color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.toasted.bubble.success{background:#4caf50}.toasted.bubble.error{background:#f44336}.toasted.bubble.info{background:#3f51b5}.toasted.bubble .action{color:#8e2b0c}.toasted.outline{border-radius:30px;min-height:38px;line-height:1.1em;background-color:#fff;border:1px solid #676767;padding:0 20px;font-size:15px;color:#676767;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);font-weight:700}.toasted.outline.success{color:#4caf50;border-color:#4caf50}.toasted.outline.error{color:#f44336;border-color:#f44336}.toasted.outline.info{color:#3f51b5;border-color:#3f51b5}.toasted.outline .action{color:#607d8b}.toasted-container{position:fixed;z-index:10000}.toasted-container,.toasted-container.full-width{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.toasted-container.full-width{max-width:86%;width:100%}.toasted-container.full-width.fit-to-screen{min-width:100%}.toasted-container.full-width.fit-to-screen .toasted:first-child{margin-top:0}.toasted-container.full-width.fit-to-screen.top-right{top:0;right:0}.toasted-container.full-width.fit-to-screen.top-left{top:0;left:0}.toasted-container.full-width.fit-to-screen.top-center{top:0;left:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.full-width.fit-to-screen.bottom-right{right:0;bottom:0}.toasted-container.full-width.fit-to-screen.bottom-left{left:0;bottom:0}.toasted-container.full-width.fit-to-screen.bottom-center{left:0;bottom:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.top-right{top:10%;right:7%}.toasted-container.top-left{top:10%;left:7%}.toasted-container.top-center{top:10%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.toasted-container.bottom-right{right:5%;bottom:7%}.toasted-container.bottom-left{left:5%;bottom:7%}.toasted-container.bottom-center{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:7%}.toasted-container.bottom-left .toasted,.toasted-container.top-left .toasted{float:left}.toasted-container.bottom-right .toasted,.toasted-container.top-right .toasted{float:right}.toasted-container .toasted{top:35px;width:auto;clear:both;margin-top:10px;position:relative;max-width:100%;height:auto;word-break:normal;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;box-sizing:inherit}.toasted-container .toasted .fa,.toasted-container .toasted .fab,.toasted-container .toasted .far,.toasted-container .toasted .fas,.toasted-container .toasted .material-icons,.toasted-container .toasted .mdi{margin-right:.5rem;margin-left:-.4rem}.toasted-container .toasted .fa.after,.toasted-container .toasted .fab.after,.toasted-container .toasted .far.after,.toasted-container .toasted .fas.after,.toasted-container .toasted .material-icons.after,.toasted-container .toasted .mdi.after{margin-left:.5rem;margin-right:-.4rem}.toasted-container .toasted .action{text-decoration:none;font-size:.8rem;padding:8px;margin:5px -7px 5px 7px;border-radius:3px;text-transform:uppercase;letter-spacing:.03em;font-weight:600;cursor:pointer}.toasted-container .toasted .action.icon{padding:4px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.toasted-container .toasted .action.icon .fa,.toasted-container .toasted .action.icon .material-icons,.toasted-container .toasted .action.icon .mdi{margin-right:0;margin-left:4px}.toasted-container .toasted .action.icon:hover{text-decoration:none}.toasted-container .toasted .action:hover{text-decoration:underline}@media only screen and (max-width:600px){.toasted-container{min-width:100%}.toasted-container .toasted:first-child{margin-top:0}.toasted-container.top-right{top:0;right:0}.toasted-container.top-left{top:0;left:0}.toasted-container.top-center{top:0;left:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.bottom-right{right:0;bottom:0}.toasted-container.bottom-left{left:0;bottom:0}.toasted-container.bottom-center{left:0;bottom:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.bottom-center,.toasted-container.top-center{-ms-flex-align:stretch!important;align-items:stretch!important}.toasted-container.bottom-left .toasted,.toasted-container.bottom-right .toasted,.toasted-container.top-left .toasted,.toasted-container.top-right .toasted{float:none}.toasted-container .toasted{border-radius:0}}",""])},function(I,N){I.exports=function(){var B=[];return B.toString=function(){for(var j=[],U=0;U\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Jn=U.console&&(U.console.warn||U.console.log);return Jn&&Jn.call(U.console,nn,Un),rt.apply(this,arguments)}}function te(rt,gt,tt){var nn,kn=gt.prototype;nn=rt.prototype=Object.create(kn),nn.constructor=rt,nn._super=kn,tt&&en(nn,tt)}function re(rt,gt){return function(){return rt.apply(gt,arguments)}}function se(rt,gt){return typeof rt==dt?rt.apply(gt&>[0]||K,gt):rt}function ne(rt,gt){return rt===K?gt:rt}function le(rt,gt,tt){Z(fe(gt),function(nn){rt.addEventListener(nn,tt,!1)})}function ge(rt,gt,tt){Z(fe(gt),function(nn){rt.removeEventListener(nn,tt,!1)})}function ue(rt,gt){for(;rt;){if(rt==gt)return!0;rt=rt.parentNode}return!1}function _e(rt,gt){return rt.indexOf(gt)>-1}function fe(rt){return rt.trim().split(/\s+/g)}function me(rt,gt,tt){if(rt.indexOf&&!tt)return rt.indexOf(gt);for(var nn=0;nnxr[gt]}):nn.sort()),nn}function oe(rt,gt){for(var tt,nn,kn=gt[0].toUpperCase()+gt.slice(1),Un=0;Un1&&!tt.firstMultiple?tt.firstMultiple=Fe(gt):kn===1&&(tt.firstMultiple=!1);var Un=tt.firstInput,Jn=tt.firstMultiple,_r=Jn?Jn.center:Un.center,xr=gt.center=Ze(nn);gt.timeStamp=Wt(),gt.deltaTime=gt.timeStamp-Un.timeStamp,gt.angle=At(_r,xr),gt.distance=Ve(_r,xr),Me(tt,gt),gt.offsetDirection=qe(gt.deltaX,gt.deltaY);var Nr=lt(gt.deltaTime,gt.deltaX,gt.deltaY);gt.overallVelocityX=Nr.x,gt.overallVelocityY=Nr.y,gt.overallVelocity=Yt(Nr.x)>Yt(Nr.y)?Nr.x:Nr.y,gt.scale=Jn?zt(Jn.pointers,nn):1,gt.rotation=Jn?Nt(Jn.pointers,nn):0,gt.maxPointers=tt.prevInput?gt.pointers.length>tt.prevInput.maxPointers?gt.pointers.length:tt.prevInput.maxPointers:gt.pointers.length,ze(tt,gt);var Mr=rt.element;ue(gt.srcEvent.target,Mr)&&(Mr=gt.srcEvent.target),gt.target=Mr}function Me(rt,gt){var tt=gt.center,nn=rt.offsetDelta||{},kn=rt.prevDelta||{},Un=rt.prevInput||{};gt.eventType!==En&&Un.eventType!==jn||(kn=rt.prevDelta={x:Un.deltaX||0,y:Un.deltaY||0},nn=rt.offsetDelta={x:tt.x,y:tt.y}),gt.deltaX=kn.x+(tt.x-nn.x),gt.deltaY=kn.y+(tt.y-nn.y)}function ze(rt,gt){var tt,nn,kn,Un,Jn=rt.lastInterval||gt,_r=gt.timeStamp-Jn.timeStamp;if(gt.eventType!=ir&&(_r>mn||Jn.velocity===K)){var xr=gt.deltaX-Jn.deltaX,Nr=gt.deltaY-Jn.deltaY,Mr=lt(_r,xr,Nr);nn=Mr.x,kn=Mr.y,tt=Yt(Mr.x)>Yt(Mr.y)?Mr.x:Mr.y,Un=qe(xr,Nr),rt.lastInterval=gt}else tt=Jn.velocity,nn=Jn.velocityX,kn=Jn.velocityY,Un=Jn.direction;gt.velocity=tt,gt.velocityX=nn,gt.velocityY=kn,gt.direction=Un}function Fe(rt){for(var gt=[],tt=0;tt=Yt(gt)?rt<0?Er:Dr:gt<0?Vr:Ge}function Ve(rt,gt,tt){tt||(tt=vt);var nn=gt[tt[0]]-rt[tt[0]],kn=gt[tt[1]]-rt[tt[1]];return Math.sqrt(nn*nn+kn*kn)}function At(rt,gt,tt){tt||(tt=vt);var nn=gt[tt[0]]-rt[tt[0]],kn=gt[tt[1]]-rt[tt[1]];return 180*Math.atan2(kn,nn)/Math.PI}function Nt(rt,gt){return At(gt[1],gt[0],Xt)+At(rt[1],rt[0],Xt)}function zt(rt,gt){return Ve(gt[0],gt[1],Xt)/Ve(rt[0],rt[1],Xt)}function Ht(){this.evEl=Pn,this.evWin=Nn,this.pressed=!1,we.apply(this,arguments)}function qt(){this.evEl=Rr,this.evWin=tr,we.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Qt(){this.evTarget=Sr,this.evWin=sr,this.started=!1,we.apply(this,arguments)}function Jt(rt,gt){var tt=ve(rt.touches),nn=ve(rt.changedTouches);return gt&(jn|ir)&&(tt=xe(tt.concat(nn),"identifier",!0)),[tt,nn]}function yn(){this.evTarget=mr,this.targetIds={},we.apply(this,arguments)}function _n(rt,gt){var tt=ve(rt.touches),nn=this.targetIds;if(gt&(En|cr)&&tt.length===1)return nn[tt[0].identifier]=!0,[tt,tt];var kn,Un,Jn=ve(rt.changedTouches),_r=[],xr=this.target;if(Un=tt.filter(function(Nr){return ue(Nr.target,xr)}),gt===En)for(kn=0;kn-1&&nn.splice(Un,1)};setTimeout(kn,br)}}function In(rt){for(var gt=rt.srcEvent.clientX,tt=rt.srcEvent.clientY,nn=0;nn-1&&this.requireFail.splice(gt,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(rt){return!!this.simultaneous[rt.id]},emit:function(rt){function gt(kn){tt.manager.emit(kn,rt)}var tt=this,nn=this.state;nn=cn&>(tt.options.event+_t(nn))},tryEmit:function(rt){if(this.canEmit())return this.emit(rt);this.state=32},canEmit:function(){for(var rt=0;rtgt.threshold&&kn>.direction},attrTest:function(rt){return Se.prototype.attrTest.call(this,rt)&&(this.state&hn||!(this.state&hn)&&this.directionTest(rt))},emit:function(rt){this.pX=rt.deltaX,this.pY=rt.deltaY;var gt=We(rt.direction);gt&&(rt.additionalEvent=this.options.event+gt),this._super.emit.call(this,rt)}}),te(Ue,Se,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[wt]},attrTest:function(rt){return this._super.attrTest.call(this,rt)&&(Math.abs(rt.scale-1)>this.options.threshold||this.state&hn)},emit:function(rt){if(rt.scale!==1){var gt=rt.scale<1?"in":"out";rt.additionalEvent=this.options.event+gt}this._super.emit.call(this,rt)}}),te(Qe,Ye,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[et]},process:function(rt){var gt=this.options,tt=rt.pointers.length===gt.pointers,nn=rt.distancegt.time;if(this._input=rt,!nn||!tt||rt.eventType&(jn|ir)&&!kn)this.reset();else if(rt.eventType&En)this.reset(),this._timer=G(function(){this.state=ur,this.tryEmit()},gt.time,this);else if(rt.eventType&jn)return ur;return 32},reset:function(){clearTimeout(this._timer)},emit:function(rt){this.state===ur&&(rt&&rt.eventType&jn?this.manager.emit(this.options.event+"up",rt):(this._input.timeStamp=Wt(),this.manager.emit(this.options.event,this._input)))}}),te(mt,Se,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[wt]},attrTest:function(rt){return this._super.attrTest.call(this,rt)&&(Math.abs(rt.rotation)>this.options.threshold||this.state&hn)}}),te(ht,Se,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:pt|ct,pointers:1},getTouchAction:function(){return $e.prototype.getTouchAction.call(this)},attrTest:function(rt){var gt,tt=this.options.direction;return tt&(pt|ct)?gt=rt.overallVelocity:tt&pt?gt=rt.overallVelocityX:tt&ct&&(gt=rt.overallVelocityY),this._super.attrTest.call(this,rt)&&tt&rt.offsetDirection&&rt.distance>this.options.threshold&&rt.maxPointers==this.options.pointers&&Yt(gt)>this.options.velocity&&rt.eventType&jn},emit:function(rt){var gt=We(rt.offsetDirection);gt&&this.manager.emit(this.options.event+gt,rt),this.manager.emit(this.options.event,rt)}}),te(at,Ye,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[yt]},process:function(rt){var gt=this.options,tt=rt.pointers.length===gt.pointers,nn=rt.distance0&&(Z+=Y(U)),Z+=Y(ee)}var U,q,Y=B(15),K=(B(0),1567752802062),G=7;I.exports=j},function(I,N,B){function j(K){for(var G,J=0,Z="";!G;)Z+=Y(q,U.get(),1),G=Kve.parts.length&&(xe.parts.length=ve.parts.length)}else{for(var ye=[],oe=0;oe{$.goAway(0)}}});const Toast={data:{toast:null,flash:null,initialToasts:null},created(){this.flash=Statamic.$config.get("flash"),this.initialToasts=Statamic.$config.get("toasts"),this.$events.$on("toast.success",this.setFlashSuccess),this.$events.$on("toast.error",this.setFlashError),this.$events.$on("toast.info",this.setFlashInfo)},mounted(){this.flashMessages(this.flash),this.flashMessages(this.initialToasts)},methods:{flashMessages(M){M.forEach(({type:$,message:I,duration:N})=>{const B={duration:N};switch($){case"error":this.$toast.error(I,B);break;case"success":this.$toast.success(I,B);break;default:this.$toast.info(I,B)}})},setFlashInfo(M,$){$={iconPack:"callback",icon:I=>(I.innerHTML='',I),...$},this.$toasted.show(M,this.normalizeToastOptions($))},setFlashSuccess(M,$){$={iconPack:"callback",icon:I=>(I.innerHTML='',I),...$},this.$toasted.success(M,this.normalizeToastOptions($))},setFlashError(M,$){$={iconPack:"callback",icon:I=>(I.innerHTML='',I),...$},this.$toasted.error(M,this.normalizeToastOptions($))},normalizeToastOptions(M){return M.duration||delete M.duration,M}}};function _typeof$2(M){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},_typeof$2(M)}function _classCallCheck(M,$){if(!(M instanceof $))throw new TypeError("Cannot call a class as a function")}function _defineProperties(M,$){for(var I=0;I<$.length;I++){var N=$[I];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(M,N.key,N)}}function _createClass(M,$,I){return $&&_defineProperties(M.prototype,$),I&&_defineProperties(M,I),Object.defineProperty(M,"prototype",{writable:!1}),M}function _extends(){return _extends=Object.assign||function(M){for(var $=1;$"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _assertThisInitialized(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}function _possibleConstructorReturn(M,$){if($&&(typeof $=="object"||typeof $=="function"))return $;if($!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(M)}function _createSuper(M){var $=_isNativeReflectConstruct();return function(){var N=_getPrototypeOf(M),B;if($){var j=_getPrototypeOf(this).constructor;B=Reflect.construct(N,arguments,j)}else B=N.apply(this,arguments);return _possibleConstructorReturn(this,B)}}var Channel=function(){function M(){_classCallCheck(this,M)}return _createClass(M,[{key:"listenForWhisper",value:function(I,N){return this.listen(".client-"+I,N)}},{key:"notification",value:function(I){return this.listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",I)}},{key:"stopListeningForWhisper",value:function(I,N){return this.stopListening(".client-"+I,N)}}]),M}(),EventFormatter=function(){function M($){_classCallCheck(this,M),this.setNamespace($)}return _createClass(M,[{key:"format",value:function(I){return I.charAt(0)==="."||I.charAt(0)==="\\"?I.substr(1):(this.namespace&&(I=this.namespace+"."+I),I.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(I){this.namespace=I}}]),M}(),PusherChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(N,B,j){var U;return _classCallCheck(this,I),U=$.call(this),U.name=B,U.pusher=N,U.options=j,U.eventFormatter=new EventFormatter(U.options.namespace),U.subscribe(),U}return _createClass(I,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(B,j){return this.on(this.eventFormatter.format(B),j),this}},{key:"listenToAll",value:function(B){var j=this;return this.subscription.bind_global(function(U,q){if(!U.startsWith("pusher:")){var Y=j.options.namespace.replace(/\./g,"\\"),K=U.startsWith(Y)?U.substring(Y.length+1):"."+U;B(K,q)}}),this}},{key:"stopListening",value:function(B,j){return j?this.subscription.unbind(this.eventFormatter.format(B),j):this.subscription.unbind(this.eventFormatter.format(B)),this}},{key:"stopListeningToAll",value:function(B){return B?this.subscription.unbind_global(B):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(B){return this.on("pusher:subscription_succeeded",function(){B()}),this}},{key:"error",value:function(B){return this.on("pusher:subscription_error",function(j){B(j)}),this}},{key:"on",value:function(B,j){return this.subscription.bind(B,j),this}}]),I}(Channel),PusherPrivateChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(){return _classCallCheck(this,I),$.apply(this,arguments)}return _createClass(I,[{key:"whisper",value:function(B,j){return this.pusher.channels.channels[this.name].trigger("client-".concat(B),j),this}}]),I}(PusherChannel),PusherEncryptedPrivateChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(){return _classCallCheck(this,I),$.apply(this,arguments)}return _createClass(I,[{key:"whisper",value:function(B,j){return this.pusher.channels.channels[this.name].trigger("client-".concat(B),j),this}}]),I}(PusherChannel),PusherPresenceChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(){return _classCallCheck(this,I),$.apply(this,arguments)}return _createClass(I,[{key:"here",value:function(B){return this.on("pusher:subscription_succeeded",function(j){B(Object.keys(j.members).map(function(U){return j.members[U]}))}),this}},{key:"joining",value:function(B){return this.on("pusher:member_added",function(j){B(j.info)}),this}},{key:"leaving",value:function(B){return this.on("pusher:member_removed",function(j){B(j.info)}),this}},{key:"whisper",value:function(B,j){return this.pusher.channels.channels[this.name].trigger("client-".concat(B),j),this}}]),I}(PusherChannel),SocketIoChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(N,B,j){var U;return _classCallCheck(this,I),U=$.call(this),U.events={},U.listeners={},U.name=B,U.socket=N,U.options=j,U.eventFormatter=new EventFormatter(U.options.namespace),U.subscribe(),U}return _createClass(I,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(B,j){return this.on(this.eventFormatter.format(B),j),this}},{key:"stopListening",value:function(B,j){return this.unbindEvent(this.eventFormatter.format(B),j),this}},{key:"subscribed",value:function(B){return this.on("connect",function(j){B(j)}),this}},{key:"error",value:function(B){return this}},{key:"on",value:function(B,j){var U=this;return this.listeners[B]=this.listeners[B]||[],this.events[B]||(this.events[B]=function(q,Y){U.name===q&&U.listeners[B]&&U.listeners[B].forEach(function(K){return K(Y)})},this.socket.on(B,this.events[B])),this.listeners[B].push(j),this}},{key:"unbind",value:function(){var B=this;Object.keys(this.events).forEach(function(j){B.unbindEvent(j)})}},{key:"unbindEvent",value:function(B,j){this.listeners[B]=this.listeners[B]||[],j&&(this.listeners[B]=this.listeners[B].filter(function(U){return U!==j})),(!j||this.listeners[B].length===0)&&(this.events[B]&&(this.socket.removeListener(B,this.events[B]),delete this.events[B]),delete this.listeners[B])}}]),I}(Channel),SocketIoPrivateChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(){return _classCallCheck(this,I),$.apply(this,arguments)}return _createClass(I,[{key:"whisper",value:function(B,j){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(B),data:j}),this}}]),I}(SocketIoChannel),SocketIoPresenceChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(){return _classCallCheck(this,I),$.apply(this,arguments)}return _createClass(I,[{key:"here",value:function(B){return this.on("presence:subscribed",function(j){B(j.map(function(U){return U.user_info}))}),this}},{key:"joining",value:function(B){return this.on("presence:joining",function(j){return B(j.user_info)}),this}},{key:"leaving",value:function(B){return this.on("presence:leaving",function(j){return B(j.user_info)}),this}}]),I}(SocketIoPrivateChannel),NullChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(){return _classCallCheck(this,I),$.apply(this,arguments)}return _createClass(I,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(B,j){return this}},{key:"listenToAll",value:function(B){return this}},{key:"stopListening",value:function(B,j){return this}},{key:"subscribed",value:function(B){return this}},{key:"error",value:function(B){return this}},{key:"on",value:function(B,j){return this}}]),I}(Channel),NullPrivateChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(){return _classCallCheck(this,I),$.apply(this,arguments)}return _createClass(I,[{key:"whisper",value:function(B,j){return this}}]),I}(NullChannel),NullPresenceChannel=function(M){_inherits(I,M);var $=_createSuper(I);function I(){return _classCallCheck(this,I),$.apply(this,arguments)}return _createClass(I,[{key:"here",value:function(B){return this}},{key:"joining",value:function(B){return this}},{key:"leaving",value:function(B){return this}},{key:"whisper",value:function(B,j){return this}}]),I}(NullChannel),Connector=function(){function M($){_classCallCheck(this,M),this._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},broadcaster:"pusher",csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"},this.setOptions($),this.connect()}return _createClass(M,[{key:"setOptions",value:function(I){this.options=_extends(this._defaultOptions,I);var N=this.csrfToken();return N&&(this.options.auth.headers["X-CSRF-TOKEN"]=N,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=N),N=this.options.bearerToken,N&&(this.options.auth.headers.Authorization="Bearer "+N,this.options.userAuthentication.headers.Authorization="Bearer "+N),I}},{key:"csrfToken",value:function(){var I;return typeof window<"u"&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"&&(I=document.querySelector('meta[name="csrf-token"]'))?I.getAttribute("content"):null}}]),M}(),PusherConnector=function(M){_inherits(I,M);var $=_createSuper(I);function I(){var N;return _classCallCheck(this,I),N=$.apply(this,arguments),N.channels={},N}return _createClass(I,[{key:"connect",value:function(){typeof this.options.client<"u"?this.pusher=this.options.client:this.options.Pusher?this.pusher=new this.options.Pusher(this.options.key,this.options):this.pusher=new Pusher(this.options.key,this.options)}},{key:"signin",value:function(){this.pusher.signin()}},{key:"listen",value:function(B,j,U){return this.channel(B).listen(j,U)}},{key:"channel",value:function(B){return this.channels[B]||(this.channels[B]=new PusherChannel(this.pusher,B,this.options)),this.channels[B]}},{key:"privateChannel",value:function(B){return this.channels["private-"+B]||(this.channels["private-"+B]=new PusherPrivateChannel(this.pusher,"private-"+B,this.options)),this.channels["private-"+B]}},{key:"encryptedPrivateChannel",value:function(B){return this.channels["private-encrypted-"+B]||(this.channels["private-encrypted-"+B]=new PusherEncryptedPrivateChannel(this.pusher,"private-encrypted-"+B,this.options)),this.channels["private-encrypted-"+B]}},{key:"presenceChannel",value:function(B){return this.channels["presence-"+B]||(this.channels["presence-"+B]=new PusherPresenceChannel(this.pusher,"presence-"+B,this.options)),this.channels["presence-"+B]}},{key:"leave",value:function(B){var j=this,U=[B,"private-"+B,"private-encrypted-"+B,"presence-"+B];U.forEach(function(q,Y){j.leaveChannel(q)})}},{key:"leaveChannel",value:function(B){this.channels[B]&&(this.channels[B].unsubscribe(),delete this.channels[B])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"disconnect",value:function(){this.pusher.disconnect()}}]),I}(Connector),SocketIoConnector=function(M){_inherits(I,M);var $=_createSuper(I);function I(){var N;return _classCallCheck(this,I),N=$.apply(this,arguments),N.channels={},N}return _createClass(I,[{key:"connect",value:function(){var B=this,j=this.getSocketIO();return this.socket=j(this.options.host,this.options),this.socket.on("reconnect",function(){Object.values(B.channels).forEach(function(U){U.subscribe()})}),this.socket}},{key:"getSocketIO",value:function(){if(typeof this.options.client<"u")return this.options.client;if(typeof io<"u")return io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(B,j,U){return this.channel(B).listen(j,U)}},{key:"channel",value:function(B){return this.channels[B]||(this.channels[B]=new SocketIoChannel(this.socket,B,this.options)),this.channels[B]}},{key:"privateChannel",value:function(B){return this.channels["private-"+B]||(this.channels["private-"+B]=new SocketIoPrivateChannel(this.socket,"private-"+B,this.options)),this.channels["private-"+B]}},{key:"presenceChannel",value:function(B){return this.channels["presence-"+B]||(this.channels["presence-"+B]=new SocketIoPresenceChannel(this.socket,"presence-"+B,this.options)),this.channels["presence-"+B]}},{key:"leave",value:function(B){var j=this,U=[B,"private-"+B,"presence-"+B];U.forEach(function(q){j.leaveChannel(q)})}},{key:"leaveChannel",value:function(B){this.channels[B]&&(this.channels[B].unsubscribe(),delete this.channels[B])}},{key:"socketId",value:function(){return this.socket.id}},{key:"disconnect",value:function(){this.socket.disconnect()}}]),I}(Connector),NullConnector=function(M){_inherits(I,M);var $=_createSuper(I);function I(){var N;return _classCallCheck(this,I),N=$.apply(this,arguments),N.channels={},N}return _createClass(I,[{key:"connect",value:function(){}},{key:"listen",value:function(B,j,U){return new NullChannel}},{key:"channel",value:function(B){return new NullChannel}},{key:"privateChannel",value:function(B){return new NullPrivateChannel}},{key:"encryptedPrivateChannel",value:function(B){return new NullPrivateChannel}},{key:"presenceChannel",value:function(B){return new NullPresenceChannel}},{key:"leave",value:function(B){}},{key:"leaveChannel",value:function(B){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"disconnect",value:function(){}}]),I}(Connector),Echo$1=function(){function M($){_classCallCheck(this,M),this.options=$,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return _createClass(M,[{key:"channel",value:function(I){return this.connector.channel(I)}},{key:"connect",value:function(){this.options.broadcaster=="pusher"?this.connector=new PusherConnector(this.options):this.options.broadcaster=="socket.io"?this.connector=new SocketIoConnector(this.options):this.options.broadcaster=="null"?this.connector=new NullConnector(this.options):typeof this.options.broadcaster=="function"&&(this.connector=new this.options.broadcaster(this.options))}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(I){return this.connector.presenceChannel(I)}},{key:"leave",value:function(I){this.connector.leave(I)}},{key:"leaveChannel",value:function(I){this.connector.leaveChannel(I)}},{key:"leaveAllChannels",value:function(){for(var I in this.connector.channels)this.leaveChannel(I)}},{key:"listen",value:function(I,N,B){return this.connector.listen(I,N,B)}},{key:"private",value:function(I){return this.connector.privateChannel(I)}},{key:"encryptedPrivate",value:function(I){return this.connector.encryptedPrivateChannel(I)}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"registerInterceptors",value:function(){typeof Vue=="function"&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),(typeof Turbo>"u"?"undefined":_typeof$2(Turbo))==="object"&&this.registerTurboRequestInterceptor()}},{key:"registerVueRequestInterceptor",value:function(){var I=this;Vue.http.interceptors.push(function(N,B){I.socketId()&&N.headers.set("X-Socket-ID",I.socketId()),B()})}},{key:"registerAxiosRequestInterceptor",value:function(){var I=this;axios.interceptors.request.use(function(N){return I.socketId()&&(N.headers["X-Socket-Id"]=I.socketId()),N})}},{key:"registerjQueryAjaxSetup",value:function(){var I=this;typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter(function(N,B,j){I.socketId()&&j.setRequestHeader("X-Socket-Id",I.socketId())})}},{key:"registerTurboRequestInterceptor",value:function(){var I=this;document.addEventListener("turbo:before-fetch-request",function(N){N.detail.fetchOptions.headers["X-Socket-Id"]=I.socketId()})}}]),M}(),pusher={exports:{}};/*! * Pusher JavaScript Library v4.4.0 * https://pusher.com/ * * Copyright 2017, Pusher * Released under the MIT licence. */(function(M,$){(function(N,B){M.exports=B()})(commonjsGlobal,function(){return function(I){var N={};function B(j){if(N[j])return N[j].exports;var U=N[j]={exports:{},id:j,loaded:!1};return I[j].call(U.exports,U,U.exports,B),U.loaded=!0,U.exports}return B.m=I,B.c=N,B.p="",B(0)}([function(I,N,B){var j=B(1);I.exports=j.default},function(I,N,B){var j=B(2),U=B(9),q=B(24),Y=B(39),K=B(40),G=B(41),J=B(12),Z=B(5),ee=B(71),te=B(8),re=B(43),se=B(14),ne=function(){function ge(ue,_e){var fe=this;if(le(ue),_e=_e||{},!_e.cluster&&!(_e.wsHost||_e.httpHost)){var me=se.default.buildLogSuffix("javascriptQuickStart");te.default.warn("You should always specify a cluster when connecting. "+me)}this.key=ue,this.config=U.extend(ee.getGlobalConfig(),_e.cluster?ee.getClusterConfig(_e.cluster):{},_e),this.channels=re.default.createChannels(),this.global_emitter=new q.default,this.sessionID=Math.floor(Math.random()*1e9),this.timeline=new Y.default(this.key,this.sessionID,{cluster:this.config.cluster,features:ge.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:K.default.INFO,version:Z.default.VERSION}),this.config.disableStats||(this.timelineSender=re.default.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+j.default.TimelineTransport.name}));var ve=function(xe){var oe=U.extend({},fe.config,xe);return G.build(j.default.getDefaultStrategy(oe),oe)};this.connection=re.default.createConnectionManager(this.key,U.extend({getStrategy:ve,timeline:this.timeline,activityTimeout:this.config.activity_timeout,pongTimeout:this.config.pong_timeout,unavailableTimeout:this.config.unavailable_timeout},this.config,{useTLS:this.shouldUseTLS()})),this.connection.bind("connected",function(){fe.subscribeAll(),fe.timelineSender&&fe.timelineSender.send(fe.connection.isUsingTLS())}),this.connection.bind("message",function(xe){var oe=xe.event,ye=oe.indexOf("pusher_internal:")===0;if(xe.channel){var be=fe.channel(xe.channel);be&&be.handleEvent(xe)}ye||fe.global_emitter.emit(xe.event,xe.data)}),this.connection.bind("connecting",function(){fe.channels.disconnect()}),this.connection.bind("disconnected",function(){fe.channels.disconnect()}),this.connection.bind("error",function(xe){te.default.warn("Error",xe)}),ge.instances.push(this),this.timeline.info({instances:ge.instances.length}),ge.isReady&&this.connect()}return ge.ready=function(){ge.isReady=!0;for(var ue=0,_e=ge.instances.length;ue<_e;ue++)ge.instances[ue].connect()},ge.log=function(ue){ge.logToConsole&&window.console&&window.console.log&&window.console.log(ue)},ge.getClientFeatures=function(){return U.keys(U.filterObject({ws:j.default.Transports.ws},function(ue){return ue.isSupported({})}))},ge.prototype.channel=function(ue){return this.channels.find(ue)},ge.prototype.allChannels=function(){return this.channels.all()},ge.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var ue=this.connection.isUsingTLS(),_e=this.timelineSender;this.timelineSenderTimer=new J.PeriodicTimer(6e4,function(){_e.send(ue)})}},ge.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},ge.prototype.bind=function(ue,_e,fe){return this.global_emitter.bind(ue,_e,fe),this},ge.prototype.unbind=function(ue,_e,fe){return this.global_emitter.unbind(ue,_e,fe),this},ge.prototype.bind_global=function(ue){return this.global_emitter.bind_global(ue),this},ge.prototype.unbind_global=function(ue){return this.global_emitter.unbind_global(ue),this},ge.prototype.unbind_all=function(ue){return this.global_emitter.unbind_all(),this},ge.prototype.subscribeAll=function(){var ue;for(ue in this.channels.channels)this.channels.channels.hasOwnProperty(ue)&&this.subscribe(ue)},ge.prototype.subscribe=function(ue){var _e=this.channels.add(ue,this);return _e.subscriptionPending&&_e.subscriptionCancelled?_e.reinstateSubscription():!_e.subscriptionPending&&this.connection.state==="connected"&&_e.subscribe(),_e},ge.prototype.unsubscribe=function(ue){var _e=this.channels.find(ue);_e&&_e.subscriptionPending?_e.cancelSubscription():(_e=this.channels.remove(ue),_e&&this.connection.state==="connected"&&_e.unsubscribe())},ge.prototype.send_event=function(ue,_e,fe){return this.connection.send_event(ue,_e,fe)},ge.prototype.shouldUseTLS=function(){return j.default.getProtocol()==="https:"||this.config.forceTLS===!0?!0:!!this.config.encrypted},ge.instances=[],ge.isReady=!1,ge.logToConsole=!1,ge.Runtime=j.default,ge.ScriptReceivers=j.default.ScriptReceivers,ge.DependenciesReceivers=j.default.DependenciesReceivers,ge.auth_callbacks=j.default.auth_callbacks,ge}();N.__esModule=!0,N.default=ne;function le(ge){if(ge==null)throw"You must pass your app key when you instantiate Pusher."}j.default.setup(ne)},function(I,N,B){var j=B(3),U=B(7),q=B(15),Y=B(16),K=B(17),G=B(4),J=B(18),Z=B(19),ee=B(26),te=B(27),re=B(28),se=B(29),ne={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:G.ScriptReceivers,DependenciesReceivers:j.DependenciesReceivers,getDefaultStrategy:te.default,Transports:Z.default,transportConnectionInitializer:re.default,HTTPFactory:se.default,TimelineTransport:J.default,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(le){var ge=this;window.Pusher=le;var ue=function(){ge.onDocumentBody(le.ready)};window.JSON?ue():j.Dependencies.load("json2",{},ue)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:U.default,jsonp:q.default}},onDocumentBody:function(le){var ge=this;document.body?le():setTimeout(function(){ge.onDocumentBody(le)},0)},createJSONPRequest:function(le,ge){return new K.default(le,ge)},createScriptRequest:function(le){return new Y.default(le)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var le=this.getXHRAPI();return new le},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return ee.Network},createWebSocket:function(le){var ge=this.getWebSocketAPI();return new ge(le)},createSocketRequest:function(le,ge){if(this.isXHRSupported())return this.HTTPFactory.createXHR(le,ge);if(this.isXDRSupported(ge.indexOf("https:")===0))return this.HTTPFactory.createXDR(le,ge);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var le=this.getXHRAPI();return!!le&&new le().withCredentials!==void 0},isXDRSupported:function(le){var ge=le?"https:":"http:",ue=this.getProtocol();return!!window.XDomainRequest&&ue===ge},addUnloadListener:function(le){window.addEventListener!==void 0?window.addEventListener("unload",le,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",le)},removeUnloadListener:function(le){window.addEventListener!==void 0?window.removeEventListener("unload",le,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",le)}};N.__esModule=!0,N.default=ne},function(I,N,B){var j=B(4),U=B(5),q=B(6);N.DependenciesReceivers=new j.ScriptReceiverFactory("_pusher_dependencies","Pusher.DependenciesReceivers"),N.Dependencies=new q.default({cdn_http:U.default.cdn_http,cdn_https:U.default.cdn_https,version:U.default.VERSION,suffix:U.default.dependency_suffix,receivers:N.DependenciesReceivers})},function(I,N){var B=function(){function j(U,q){this.lastId=0,this.prefix=U,this.name=q}return j.prototype.create=function(U){this.lastId++;var q=this.lastId,Y=this.prefix+q,K=this.name+"["+q+"]",G=!1,J=function(){G||(U.apply(null,arguments),G=!0)};return this[q]=J,{number:q,id:Y,name:K,callback:J}},j.prototype.remove=function(U){delete this[U.number]},j}();N.ScriptReceiverFactory=B,N.ScriptReceivers=new B("_pusher_script_","Pusher.ScriptReceivers")},function(I,N){var B={VERSION:"4.4.0",PROTOCOL:7,host:"ws.pusherapp.com",ws_port:80,wss_port:443,ws_path:"",sockjs_host:"sockjs.pusher.com",sockjs_http_port:80,sockjs_https_port:443,sockjs_path:"/pusher",stats_host:"stats.pusher.com",channel_auth_endpoint:"/pusher/auth",channel_auth_transport:"ajax",activity_timeout:12e4,pong_timeout:3e4,unavailable_timeout:1e4,cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""};N.__esModule=!0,N.default=B},function(I,N,B){var j=B(4),U=B(2),q=function(){function Y(K){this.options=K,this.receivers=K.receivers||j.ScriptReceivers,this.loading={}}return Y.prototype.load=function(K,G,J){var Z=this;if(Z.loading[K]&&Z.loading[K].length>0)Z.loading[K].push(J);else{Z.loading[K]=[J];var ee=U.default.createScriptRequest(Z.getPath(K,G)),te=Z.receivers.create(function(re){if(Z.receivers.remove(te),Z.loading[K]){var se=Z.loading[K];delete Z.loading[K];for(var ne=function(ge){ge||ee.cleanup()},le=0;le>>6)+U(128|ee&63):U(224|ee>>>12&15)+U(128|ee>>>6&63)+U(128|ee&63)},K=function(Z){return Z.replace(/[^\x00-\x7F]/g,Y)},G=function(Z){var ee=[0,2,1][Z.length%3],te=Z.charCodeAt(0)<<16|(Z.length>1?Z.charCodeAt(1):0)<<8|(Z.length>2?Z.charCodeAt(2):0),re=[q.charAt(te>>>18),q.charAt(te>>>12&63),ee>=2?"=":q.charAt(te>>>6&63),ee>=1?"=":q.charAt(te&63)];return re.join("")},J=window.btoa||function(Z){return Z.replace(/[\s\S]{1,3}/g,G)}},function(I,N,B){var j=B(12),U={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(q){return new j.OneOffTimer(0,q)},method:function(q){var Y=Array.prototype.slice.call(arguments,1);return function(K){return K[q].apply(K,Y.concat(arguments))}}};N.__esModule=!0,N.default=U},function(I,N,B){var j=this&&this.__extends||function(J,Z){for(var ee in Z)Z.hasOwnProperty(ee)&&(J[ee]=Z[ee]);function te(){this.constructor=J}J.prototype=Z===null?Object.create(Z):(te.prototype=Z.prototype,new te)},U=B(13);function q(J){window.clearTimeout(J)}function Y(J){window.clearInterval(J)}var K=function(J){j(Z,J);function Z(ee,te){J.call(this,setTimeout,q,ee,function(re){return te(),null})}return Z}(U.default);N.OneOffTimer=K;var G=function(J){j(Z,J);function Z(ee,te){J.call(this,setInterval,Y,ee,function(re){return te(),re})}return Z}(U.default);N.PeriodicTimer=G},function(I,N){var B=function(){function j(U,q,Y,K){var G=this;this.clear=q,this.timer=U(function(){G.timer&&(G.timer=K(G.timer))},Y)}return j.prototype.isRunning=function(){return this.timer!==null},j.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},j}();N.__esModule=!0,N.default=B},function(I,N){var B={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"}}},j=function(U){var q="See:",Y=B.urls[U];if(!Y)return"";var K;return Y.fullUrl?K=Y.fullUrl:Y.path&&(K=B.baseUrl+Y.path),K?q+" "+K:""};N.__esModule=!0,N.default={buildLogSuffix:j}},function(I,N,B){var j=B(8),U=function(q,Y,K){this.authOptions.headers!==void 0&&j.default.warn("Warn","To send headers with the auth request, you must use AJAX, rather than JSONP.");var G=q.nextAuthCallbackID.toString();q.nextAuthCallbackID++;var J=q.getDocument(),Z=J.createElement("script");q.auth_callbacks[G]=function(re){K(!1,re)};var ee="Pusher.auth_callbacks['"+G+"']";Z.src=this.options.authEndpoint+"?callback="+encodeURIComponent(ee)+"&"+this.composeQuery(Y);var te=J.getElementsByTagName("head")[0]||J.documentElement;te.insertBefore(Z,te.firstChild)};N.__esModule=!0,N.default=U},function(I,N){var B=function(){function j(U){this.src=U}return j.prototype.send=function(U){var q=this,Y="Error loading "+q.src;q.script=document.createElement("script"),q.script.id=U.id,q.script.src=q.src,q.script.type="text/javascript",q.script.charset="UTF-8",q.script.addEventListener?(q.script.onerror=function(){U.callback(Y)},q.script.onload=function(){U.callback(null)}):q.script.onreadystatechange=function(){(q.script.readyState==="loaded"||q.script.readyState==="complete")&&U.callback(null)},q.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(q.errorScript=document.createElement("script"),q.errorScript.id=U.id+"_error",q.errorScript.text=U.name+"('"+Y+"');",q.script.async=q.errorScript.async=!1):q.script.async=!0;var K=document.getElementsByTagName("head")[0];K.insertBefore(q.script,K.firstChild),q.errorScript&&K.insertBefore(q.errorScript,q.script.nextSibling)},j.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},j}();N.__esModule=!0,N.default=B},function(I,N,B){var j=B(9),U=B(2),q=function(){function Y(K,G){this.url=K,this.data=G}return Y.prototype.send=function(K){if(!this.request){var G=j.buildQueryString(this.data),J=this.url+"/"+K.number+"?"+G;this.request=U.default.createScriptRequest(J),this.request.send(K)}},Y.prototype.cleanup=function(){this.request&&this.request.cleanup()},Y}();N.__esModule=!0,N.default=q},function(I,N,B){var j=B(2),U=B(4),q=function(K,G){return function(J,Z){var ee="http"+(G?"s":"")+"://",te=ee+(K.host||K.options.host)+K.options.path,re=j.default.createJSONPRequest(te,J),se=j.default.ScriptReceivers.create(function(ne,le){U.ScriptReceivers.remove(se),re.cleanup(),le&&le.host&&(K.host=le.host),Z&&Z(ne,le)});re.send(se)}},Y={name:"jsonp",getAgent:q};N.__esModule=!0,N.default=Y},function(I,N,B){var j=B(20),U=B(22),q=B(21),Y=B(2),K=B(3),G=B(9),J=new U.default({file:"sockjs",urls:q.sockjs,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(re,se){return new window.SockJS(re,null,{js_path:K.Dependencies.getPath("sockjs",{useTLS:se.useTLS}),ignore_null_origin:se.ignoreNullOrigin})},beforeOpen:function(re,se){re.send(JSON.stringify({path:se}))}}),Z={isSupported:function(re){var se=Y.default.isXDRSupported(re.useTLS);return se}},ee=new U.default(G.extend({},j.streamingConfiguration,Z)),te=new U.default(G.extend({},j.pollingConfiguration,Z));j.default.xdr_streaming=ee,j.default.xdr_polling=te,j.default.sockjs=J,N.__esModule=!0,N.default=j.default},function(I,N,B){var j=B(21),U=B(22),q=B(9),Y=B(2),K=new U.default({urls:j.ws,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Y.default.getWebSocketAPI()},isSupported:function(){return!!Y.default.getWebSocketAPI()},getSocket:function(re){return Y.default.createWebSocket(re)}}),G={urls:j.http,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}};N.streamingConfiguration=q.extend({getSocket:function(re){return Y.default.HTTPFactory.createStreamingSocket(re)}},G),N.pollingConfiguration=q.extend({getSocket:function(re){return Y.default.HTTPFactory.createPollingSocket(re)}},G);var J={isSupported:function(){return Y.default.isXHRSupported()}},Z=new U.default(q.extend({},N.streamingConfiguration,J)),ee=new U.default(q.extend({},N.pollingConfiguration,J)),te={ws:K,xhr_streaming:Z,xhr_polling:ee};N.__esModule=!0,N.default=te},function(I,N,B){var j=B(5);function U(Y,K,G){var J=Y+(K.useTLS?"s":""),Z=K.useTLS?K.hostTLS:K.hostNonTLS;return J+"://"+Z+G}function q(Y,K){var G="/app/"+Y,J="?protocol="+j.default.PROTOCOL+"&client=js&version="+j.default.VERSION+(K?"&"+K:"");return G+J}N.ws={getInitial:function(Y,K){var G=(K.httpPath||"")+q(Y,"flash=false");return U("ws",K,G)}},N.http={getInitial:function(Y,K){var G=(K.httpPath||"/pusher")+q(Y);return U("http",K,G)}},N.sockjs={getInitial:function(Y,K){return U("http",K,K.httpPath||"/pusher")},getPath:function(Y,K){return q(Y)}}},function(I,N,B){var j=B(23),U=function(){function q(Y){this.hooks=Y}return q.prototype.isSupported=function(Y){return this.hooks.isSupported(Y)},q.prototype.createConnection=function(Y,K,G,J){return new j.default(this.hooks,Y,K,G,J)},q}();N.__esModule=!0,N.default=U},function(I,N,B){var j=this&&this.__extends||function(Z,ee){for(var te in ee)ee.hasOwnProperty(te)&&(Z[te]=ee[te]);function re(){this.constructor=Z}Z.prototype=ee===null?Object.create(ee):(re.prototype=ee.prototype,new re)},U=B(11),q=B(9),Y=B(24),K=B(8),G=B(2),J=function(Z){j(ee,Z);function ee(te,re,se,ne,le){Z.call(this),this.initialize=G.default.transportConnectionInitializer,this.hooks=te,this.name=re,this.priority=se,this.key=ne,this.options=le,this.state="new",this.timeline=le.timeline,this.activityTimeout=le.activityTimeout,this.id=this.timeline.generateUniqueID()}return ee.prototype.handlesActivityChecks=function(){return!!this.hooks.handlesActivityChecks},ee.prototype.supportsPing=function(){return!!this.hooks.supportsPing},ee.prototype.connect=function(){var te=this;if(this.socket||this.state!=="initialized")return!1;var re=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(re,this.options)}catch(se){return U.default.defer(function(){te.onError(se),te.changeState("closed")}),!1}return this.bindListeners(),K.default.debug("Connecting",{transport:this.name,url:re}),this.changeState("connecting"),!0},ee.prototype.close=function(){return this.socket?(this.socket.close(),!0):!1},ee.prototype.send=function(te){var re=this;return this.state==="open"?(U.default.defer(function(){re.socket&&re.socket.send(te)}),!0):!1},ee.prototype.ping=function(){this.state==="open"&&this.supportsPing()&&this.socket.ping()},ee.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},ee.prototype.onError=function(te){this.emit("error",{type:"WebSocketError",error:te}),this.timeline.error(this.buildTimelineMessage({error:te.toString()}))},ee.prototype.onClose=function(te){te?this.changeState("closed",{code:te.code,reason:te.reason,wasClean:te.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},ee.prototype.onMessage=function(te){this.emit("message",te)},ee.prototype.onActivity=function(){this.emit("activity")},ee.prototype.bindListeners=function(){var te=this;this.socket.onopen=function(){te.onOpen()},this.socket.onerror=function(re){te.onError(re)},this.socket.onclose=function(re){te.onClose(re)},this.socket.onmessage=function(re){te.onMessage(re)},this.supportsPing()&&(this.socket.onactivity=function(){te.onActivity()})},ee.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},ee.prototype.changeState=function(te,re){this.state=te,this.timeline.info(this.buildTimelineMessage({state:te,params:re})),this.emit(te,re)},ee.prototype.buildTimelineMessage=function(te){return q.extend({cid:this.id},te)},ee}(Y.default);N.__esModule=!0,N.default=J},function(I,N,B){var j=B(9),U=B(25),q=function(){function Y(K){this.callbacks=new U.default,this.global_callbacks=[],this.failThrough=K}return Y.prototype.bind=function(K,G,J){return this.callbacks.add(K,G,J),this},Y.prototype.bind_global=function(K){return this.global_callbacks.push(K),this},Y.prototype.unbind=function(K,G,J){return this.callbacks.remove(K,G,J),this},Y.prototype.unbind_global=function(K){return K?(this.global_callbacks=j.filter(this.global_callbacks||[],function(G){return G!==K}),this):(this.global_callbacks=[],this)},Y.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},Y.prototype.emit=function(K,G,J){for(var Z=0;Z0)for(var Z=0;Z0&&q.onChunk(200,Y.responseText)},Y.onload=function(){Y.responseText&&Y.responseText.length>0&&q.onChunk(200,Y.responseText),q.emit("finished",200),q.close()},Y},abortRequest:function(q){q.ontimeout=q.onerror=q.onprogress=q.onload=null,q.abort()}};N.__esModule=!0,N.default=U},function(I,N){var B=this&&this.__extends||function(Z,ee){for(var te in ee)ee.hasOwnProperty(te)&&(Z[te]=ee[te]);function re(){this.constructor=Z}Z.prototype=ee===null?Object.create(ee):(re.prototype=ee.prototype,new re)},j=function(Z){B(ee,Z);function ee(){Z.apply(this,arguments)}return ee}(Error);N.BadEventName=j;var U=function(Z){B(ee,Z);function ee(){Z.apply(this,arguments)}return ee}(Error);N.RequestTimedOut=U;var q=function(Z){B(ee,Z);function ee(){Z.apply(this,arguments)}return ee}(Error);N.TransportPriorityTooLow=q;var Y=function(Z){B(ee,Z);function ee(){Z.apply(this,arguments)}return ee}(Error);N.TransportClosed=Y;var K=function(Z){B(ee,Z);function ee(){Z.apply(this,arguments)}return ee}(Error);N.UnsupportedFeature=K;var G=function(Z){B(ee,Z);function ee(){Z.apply(this,arguments)}return ee}(Error);N.UnsupportedTransport=G;var J=function(Z){B(ee,Z);function ee(){Z.apply(this,arguments)}return ee}(Error);N.UnsupportedStrategy=J},function(I,N,B){var j=B(33),U=B(34),q=B(36),Y=B(37),K=B(38),G={createStreamingSocket:function(J){return this.createSocket(q.default,J)},createPollingSocket:function(J){return this.createSocket(Y.default,J)},createSocket:function(J,Z){return new U.default(J,Z)},createXHR:function(J,Z){return this.createRequest(K.default,J,Z)},createRequest:function(J,Z,ee){return new j.default(J,Z,ee)}};N.__esModule=!0,N.default=G},function(I,N,B){var j=this&&this.__extends||function(G,J){for(var Z in J)J.hasOwnProperty(Z)&&(G[Z]=J[Z]);function ee(){this.constructor=G}G.prototype=J===null?Object.create(J):(ee.prototype=J.prototype,new ee)},U=B(2),q=B(24),Y=256*1024,K=function(G){j(J,G);function J(Z,ee,te){G.call(this),this.hooks=Z,this.method=ee,this.url=te}return J.prototype.start=function(Z){var ee=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){ee.close()},U.default.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(Z)},J.prototype.close=function(){this.unloader&&(U.default.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},J.prototype.onChunk=function(Z,ee){for(;;){var te=this.advanceBuffer(ee);if(te)this.emit("chunk",{status:Z,data:te});else break}this.isBufferTooLong(ee)&&this.emit("buffer_too_long")},J.prototype.advanceBuffer=function(Z){var ee=Z.slice(this.position),te=ee.indexOf(` `);return te!==-1?(this.position+=te+1,ee.slice(0,te)):null},J.prototype.isBufferTooLong=function(Z){return this.position===Z.length&&Z.length>Y},J}(q.default);N.__esModule=!0,N.default=K},function(I,N,B){var j=B(35),U=B(11),q=B(2),Y=1,K=function(){function se(ne,le){this.hooks=ne,this.session=te(1e3)+"/"+re(8),this.location=G(le),this.readyState=j.default.CONNECTING,this.openStream()}return se.prototype.send=function(ne){return this.sendRaw(JSON.stringify([ne]))},se.prototype.ping=function(){this.hooks.sendHeartbeat(this)},se.prototype.close=function(ne,le){this.onClose(ne,le,!0)},se.prototype.sendRaw=function(ne){if(this.readyState===j.default.OPEN)try{return q.default.createSocketRequest("POST",Z(J(this.location,this.session))).start(ne),!0}catch{return!1}else return!1},se.prototype.reconnect=function(){this.closeStream(),this.openStream()},se.prototype.onClose=function(ne,le,ge){this.closeStream(),this.readyState=j.default.CLOSED,this.onclose&&this.onclose({code:ne,reason:le,wasClean:ge})},se.prototype.onChunk=function(ne){if(ne.status===200){this.readyState===j.default.OPEN&&this.onActivity();var le,ge=ne.data.slice(0,1);switch(ge){case"o":le=JSON.parse(ne.data.slice(1)||"{}"),this.onOpen(le);break;case"a":le=JSON.parse(ne.data.slice(1)||"[]");for(var ue=0;ue0&&q.onChunk(K.status,K.responseText);break;case 4:K.responseText&&K.responseText.length>0&&q.onChunk(K.status,K.responseText),q.emit("finished",K.status),q.close();break}},K},abortRequest:function(q){q.onreadystatechange=null,q.abort()}};N.__esModule=!0,N.default=U},function(I,N,B){var j=B(9),U=B(11),q=B(40),Y=function(){function K(G,J,Z){this.key=G,this.session=J,this.events=[],this.options=Z||{},this.sent=0,this.uniqueID=0}return K.prototype.log=function(G,J){G<=this.options.level&&(this.events.push(j.extend({},J,{timestamp:U.default.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},K.prototype.error=function(G){this.log(q.default.ERROR,G)},K.prototype.info=function(G){this.log(q.default.INFO,G)},K.prototype.debug=function(G){this.log(q.default.DEBUG,G)},K.prototype.isEmpty=function(){return this.events.length===0},K.prototype.send=function(G,J){var Z=this,ee=j.extend({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],G(ee,function(te,re){te||Z.sent++,J&&J(te,re)}),!0},K.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},K}();N.__esModule=!0,N.default=Y},function(I,N){var B;(function(j){j[j.ERROR=3]="ERROR",j[j.INFO=6]="INFO",j[j.DEBUG=7]="DEBUG"})(B||(B={})),N.__esModule=!0,N.default=B},function(I,N,B){var j=B(9),U=B(11),q=B(42),Y=B(31),K=B(64),G=B(65),J=B(66),Z=B(67),ee=B(68),te=B(69),re=B(70),se=B(2),ne=se.default.Transports;N.build=function(ye,be){var we=j.extend({},ue,be);return oe(ye,we)[1].strategy};var le={isSupported:function(){return!1},connect:function(ye,be){var we=U.default.defer(function(){be(new Y.UnsupportedStrategy)});return{abort:function(){we.ensureAborted()},forceMinPriority:function(){}}}};function ge(ye){return function(be){return[ye.apply(this,arguments),be]}}var ue={extend:function(ye,be,we){return[j.extend({},be,we),ye]},def:function(ye,be,we){if(ye[be]!==void 0)throw"Redefining symbol "+be;return ye[be]=we,[void 0,ye]},def_transport:function(ye,be,we,Ae,ke,Oe){var Me=ne[we];if(!Me)throw new Y.UnsupportedTransport(we);var ze=(!ye.enabledTransports||j.arrayIndexOf(ye.enabledTransports,be)!==-1)&&(!ye.disabledTransports||j.arrayIndexOf(ye.disabledTransports,be)===-1),Fe;ze?Fe=new K.default(be,Ae,Oe?Oe.getAssistant(Me):Me,j.extend({key:ye.key,useTLS:ye.useTLS,timeline:ye.timeline,ignoreNullOrigin:ye.ignoreNullOrigin},ke)):Fe=le;var Ze=ye.def(ye,be,Fe)[1];return Ze.Transports=ye.Transports||{},Ze.Transports[be]=Fe,[void 0,Ze]},transport_manager:ge(function(ye,be){return new q.default(be)}),sequential:ge(function(ye,be){var we=Array.prototype.slice.call(arguments,2);return new G.default(we,be)}),cached:ge(function(ye,be,we){return new Z.default(we,ye.Transports,{ttl:be,timeline:ye.timeline,useTLS:ye.useTLS})}),first_connected:ge(function(ye,be){return new re.default(be)}),best_connected_ever:ge(function(){var ye=Array.prototype.slice.call(arguments,1);return new J.default(ye)}),delayed:ge(function(ye,be,we){return new ee.default(we,{delay:be})}),if:ge(function(ye,be,we,Ae){return new te.default(be,we,Ae)}),is_supported:ge(function(ye,be){return function(){return be.isSupported()}})};function _e(ye){return typeof ye=="string"&&ye.charAt(0)===":"}function fe(ye,be){return be[ye.slice(1)]}function me(ye,be){if(ye.length===0)return[[],be];var we=oe(ye[0],be),Ae=me(ye.slice(1),we[1]);return[[we[0]].concat(Ae[0]),Ae[1]]}function ve(ye,be){if(!_e(ye))return[ye,be];var we=fe(ye,be);if(we===void 0)throw"Undefined symbol "+ye;return[we,be]}function xe(ye,be){if(_e(ye[0])){var we=fe(ye[0],be);if(ye.length>1){if(typeof we!="function")throw"Calling non-function "+ye[0];var Ae=[j.extend({},be)].concat(j.map(ye.slice(1),function(ke){return oe(ke,j.extend({},be))[0]}));return we.apply(this,Ae)}else return[we,be]}else return me(ye,be)}function oe(ye,be){return typeof ye=="string"?ve(ye,be):typeof ye=="object"&&ye instanceof Array&&ye.length>0?xe(ye,be):[ye,be]}},function(I,N,B){var j=B(43),U=function(){function q(Y){this.options=Y||{},this.livesLeft=this.options.lives||1/0}return q.prototype.getAssistant=function(Y){return j.default.createAssistantToTheTransportManager(this,Y,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},q.prototype.isAlive=function(){return this.livesLeft>0},q.prototype.reportDeath=function(){this.livesLeft-=1},q}();N.__esModule=!0,N.default=U},function(I,N,B){var j=B(44),U=B(45),q=B(48),Y=B(49),K=B(50),G=B(51),J=B(54),Z=B(52),ee=B(62),te=B(63),re={createChannels:function(){return new te.default},createConnectionManager:function(se,ne){return new ee.default(se,ne)},createChannel:function(se,ne){return new Z.default(se,ne)},createPrivateChannel:function(se,ne){return new G.default(se,ne)},createPresenceChannel:function(se,ne){return new K.default(se,ne)},createEncryptedChannel:function(se,ne){return new J.default(se,ne)},createTimelineSender:function(se,ne){return new Y.default(se,ne)},createAuthorizer:function(se,ne){return ne.authorizer?ne.authorizer(se,ne):new q.default(se,ne)},createHandshake:function(se,ne){return new U.default(se,ne)},createAssistantToTheTransportManager:function(se,ne,le){return new j.default(se,ne,le)}};N.__esModule=!0,N.default=re},function(I,N,B){var j=B(11),U=B(9),q=function(){function Y(K,G,J){this.manager=K,this.transport=G,this.minPingDelay=J.minPingDelay,this.maxPingDelay=J.maxPingDelay,this.pingDelay=void 0}return Y.prototype.createConnection=function(K,G,J,Z){var ee=this;Z=U.extend({},Z,{activityTimeout:this.pingDelay});var te=this.transport.createConnection(K,G,J,Z),re=null,se=function(){te.unbind("open",se),te.bind("closed",ne),re=j.default.now()},ne=function(le){if(te.unbind("closed",ne),le.code===1002||le.code===1003)ee.manager.reportDeath();else if(!le.wasClean&&re){var ge=j.default.now()-re;ge<2*ee.maxPingDelay&&(ee.manager.reportDeath(),ee.pingDelay=Math.max(ge/2,ee.minPingDelay))}};return te.bind("open",se),te},Y.prototype.isSupported=function(K){return this.manager.isAlive()&&this.transport.isSupported(K)},Y}();N.__esModule=!0,N.default=q},function(I,N,B){var j=B(9),U=B(46),q=B(47),Y=function(){function K(G,J){this.transport=G,this.callback=J,this.bindListeners()}return K.prototype.close=function(){this.unbindListeners(),this.transport.close()},K.prototype.bindListeners=function(){var G=this;this.onMessage=function(J){G.unbindListeners();var Z;try{Z=U.processHandshake(J)}catch(ee){G.finish("error",{error:ee}),G.transport.close();return}Z.action==="connected"?G.finish("connected",{connection:new q.default(Z.id,G.transport),activityTimeout:Z.activityTimeout}):(G.finish(Z.action,{error:Z.error}),G.transport.close())},this.onClosed=function(J){G.unbindListeners();var Z=U.getCloseAction(J)||"backoff",ee=U.getCloseError(J);G.finish(Z,{error:ee})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},K.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},K.prototype.finish=function(G,J){this.callback(j.extend({transport:this.transport,action:G},J))},K}();N.__esModule=!0,N.default=Y},function(I,N){N.decodeMessage=function(B){try{var j=JSON.parse(B.data),U=j.data;if(typeof U=="string")try{U=JSON.parse(j.data)}catch{}var q={event:j.event,channel:j.channel,data:U};return j.user_id&&(q.user_id=j.user_id),q}catch(Y){throw{type:"MessageParseError",error:Y,data:B.data}}},N.encodeMessage=function(B){return JSON.stringify(B)},N.processHandshake=function(B){var j=N.decodeMessage(B);if(j.event==="pusher:connection_established"){if(!j.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:j.data.socket_id,activityTimeout:j.data.activity_timeout*1e3}}else{if(j.event==="pusher:error")return{action:this.getCloseAction(j.data),error:this.getCloseError(j.data)};throw"Invalid handshake"}},N.getCloseAction=function(B){return B.code<4e3?B.code>=1002&&B.code<=1004?"backoff":null:B.code===4e3?"tls_only":B.code<4100?"refused":B.code<4200?"backoff":B.code<4300?"retry":"refused"},N.getCloseError=function(B){return B.code!==1e3&&B.code!==1001?{type:"PusherError",data:{code:B.code,message:B.reason||B.message}}:null}},function(I,N,B){var j=this&&this.__extends||function(J,Z){for(var ee in Z)Z.hasOwnProperty(ee)&&(J[ee]=Z[ee]);function te(){this.constructor=J}J.prototype=Z===null?Object.create(Z):(te.prototype=Z.prototype,new te)},U=B(9),q=B(24),Y=B(46),K=B(8),G=function(J){j(Z,J);function Z(ee,te){J.call(this),this.id=ee,this.transport=te,this.activityTimeout=te.activityTimeout,this.bindListeners()}return Z.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},Z.prototype.send=function(ee){return this.transport.send(ee)},Z.prototype.send_event=function(ee,te,re){var se={event:ee,data:te};return re&&(se.channel=re),K.default.debug("Event sent",se),this.send(Y.encodeMessage(se))},Z.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},Z.prototype.close=function(){this.transport.close()},Z.prototype.bindListeners=function(){var ee=this,te={message:function(se){var ne;try{ne=Y.decodeMessage(se)}catch(le){ee.emit("error",{type:"MessageParseError",error:le,data:se.data})}if(ne!==void 0){switch(K.default.debug("Event recd",ne),ne.event){case"pusher:error":ee.emit("error",{type:"PusherError",data:ne.data});break;case"pusher:ping":ee.emit("ping");break;case"pusher:pong":ee.emit("pong");break}ee.emit("message",ne)}},activity:function(){ee.emit("activity")},error:function(se){ee.emit("error",{type:"WebSocketError",error:se})},closed:function(se){re(),se&&se.code&&ee.handleCloseEvent(se),ee.transport=null,ee.emit("closed")}},re=function(){U.objectApply(te,function(se,ne){ee.transport.unbind(ne,se)})};U.objectApply(te,function(se,ne){ee.transport.bind(ne,se)})},Z.prototype.handleCloseEvent=function(ee){var te=Y.getCloseAction(ee),re=Y.getCloseError(ee);re&&this.emit("error",re),te&&this.emit(te,{action:te,error:re})},Z}(q.default);N.__esModule=!0,N.default=G},function(I,N,B){var j=B(2),U=function(){function q(Y,K){this.channel=Y;var G=K.authTransport;if(typeof j.default.getAuthorizers()[G]>"u")throw"'"+G+"' is not a recognized auth transport";this.type=G,this.options=K,this.authOptions=(K||{}).auth||{}}return q.prototype.composeQuery=function(Y){var K="socket_id="+encodeURIComponent(Y)+"&channel_name="+encodeURIComponent(this.channel.name);for(var G in this.authOptions.params)K+="&"+encodeURIComponent(G)+"="+encodeURIComponent(this.authOptions.params[G]);return K},q.prototype.authorize=function(Y,K){return q.authorizers=q.authorizers||j.default.getAuthorizers(),q.authorizers[this.type].call(this,j.default,Y,K)},q}();N.__esModule=!0,N.default=U},function(I,N,B){var j=B(2),U=function(){function q(Y,K){this.timeline=Y,this.options=K||{}}return q.prototype.send=function(Y,K){this.timeline.isEmpty()||this.timeline.send(j.default.TimelineTransport.getAgent(this,Y),K)},q}();N.__esModule=!0,N.default=U},function(I,N,B){var j=this&&this.__extends||function(J,Z){for(var ee in Z)Z.hasOwnProperty(ee)&&(J[ee]=Z[ee]);function te(){this.constructor=J}J.prototype=Z===null?Object.create(Z):(te.prototype=Z.prototype,new te)},U=B(51),q=B(8),Y=B(53),K=B(14),G=function(J){j(Z,J);function Z(ee,te){J.call(this,ee,te),this.members=new Y.default}return Z.prototype.authorize=function(ee,te){var re=this;J.prototype.authorize.call(this,ee,function(se,ne){if(!se){if(ne.channel_data===void 0){var le=K.default.buildLogSuffix("authenticationEndpoint");q.default.warn("Invalid auth response for channel '"+re.name+"',"+("expected 'channel_data' field. "+le)),te("Invalid auth response");return}var ge=JSON.parse(ne.channel_data);re.members.setMyID(ge.user_id)}te(se,ne)})},Z.prototype.handleEvent=function(ee){var te=ee.event;if(te.indexOf("pusher_internal:")===0)this.handleInternalEvent(ee);else{var re=ee.data,se={};ee.user_id&&(se.user_id=ee.user_id),this.emit(te,re,se)}},Z.prototype.handleInternalEvent=function(ee){var te=ee.event,re=ee.data;switch(te){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(ee);break;case"pusher_internal:member_added":var se=this.members.addMember(re);this.emit("pusher:member_added",se);break;case"pusher_internal:member_removed":var ne=this.members.removeMember(re);ne&&this.emit("pusher:member_removed",ne);break}},Z.prototype.handleSubscriptionSucceededEvent=function(ee){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(ee.data),this.emit("pusher:subscription_succeeded",this.members))},Z.prototype.disconnect=function(){this.members.reset(),J.prototype.disconnect.call(this)},Z}(U.default);N.__esModule=!0,N.default=G},function(I,N,B){var j=this&&this.__extends||function(K,G){for(var J in G)G.hasOwnProperty(J)&&(K[J]=G[J]);function Z(){this.constructor=K}K.prototype=G===null?Object.create(G):(Z.prototype=G.prototype,new Z)},U=B(43),q=B(52),Y=function(K){j(G,K);function G(){K.apply(this,arguments)}return G.prototype.authorize=function(J,Z){var ee=U.default.createAuthorizer(this,this.pusher.config);return ee.authorize(J,Z)},G}(q.default);N.__esModule=!0,N.default=Y},function(I,N,B){var j=this&&this.__extends||function(J,Z){for(var ee in Z)Z.hasOwnProperty(ee)&&(J[ee]=Z[ee]);function te(){this.constructor=J}J.prototype=Z===null?Object.create(Z):(te.prototype=Z.prototype,new te)},U=B(24),q=B(31),Y=B(8),K=B(14),G=function(J){j(Z,J);function Z(ee,te){J.call(this,function(re,se){Y.default.debug("No callbacks on "+ee+" for "+re)}),this.name=ee,this.pusher=te,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}return Z.prototype.authorize=function(ee,te){return te(!1,{})},Z.prototype.trigger=function(ee,te){if(ee.indexOf("client-")!==0)throw new q.BadEventName("Event '"+ee+"' does not start with 'client-'");if(!this.subscribed){var re=K.default.buildLogSuffix("triggeringClientEvents");Y.default.warn("Client event triggered before channel 'subscription_succeeded' event . "+re)}return this.pusher.send_event(ee,te,this.name)},Z.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},Z.prototype.handleEvent=function(ee){var te=ee.event,re=ee.data;if(te==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(ee);else if(te.indexOf("pusher_internal:")!==0){var se={};this.emit(te,re,se)}},Z.prototype.handleSubscriptionSucceededEvent=function(ee){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",ee.data)},Z.prototype.subscribe=function(){var ee=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(te,re){te?ee.emit("pusher:subscription_error",re):ee.pusher.send_event("pusher:subscribe",{auth:re.auth,channel_data:re.channel_data,channel:ee.name})}))},Z.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},Z.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},Z.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},Z}(U.default);N.__esModule=!0,N.default=G},function(I,N,B){var j=B(9),U=function(){function q(){this.reset()}return q.prototype.get=function(Y){return Object.prototype.hasOwnProperty.call(this.members,Y)?{id:Y,info:this.members[Y]}:null},q.prototype.each=function(Y){var K=this;j.objectApply(this.members,function(G,J){Y(K.get(J))})},q.prototype.setMyID=function(Y){this.myID=Y},q.prototype.onSubscription=function(Y){this.members=Y.presence.hash,this.count=Y.presence.count,this.me=this.get(this.myID)},q.prototype.addMember=function(Y){return this.get(Y.user_id)===null&&this.count++,this.members[Y.user_id]=Y.user_info,this.get(Y.user_id)},q.prototype.removeMember=function(Y){var K=this.get(Y.user_id);return K&&(delete this.members[Y.user_id],this.count--),K},q.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},q}();N.__esModule=!0,N.default=U},function(I,N,B){var j=this&&this.__extends||function(Z,ee){for(var te in ee)ee.hasOwnProperty(te)&&(Z[te]=ee[te]);function re(){this.constructor=Z}Z.prototype=ee===null?Object.create(ee):(re.prototype=ee.prototype,new re)},U=B(51),q=B(31),Y=B(8),K=B(55),G=B(57),J=function(Z){j(ee,Z);function ee(){Z.apply(this,arguments),this.key=null}return ee.prototype.authorize=function(te,re){var se=this;Z.prototype.authorize.call(this,te,function(ne,le){if(ne){re(!0,le);return}var ge=le.shared_secret;if(!ge){var ue="No shared_secret key in auth payload for encrypted channel: "+se.name;re(!0,ue),Y.default.warn("Error: "+ue);return}se.key=G.decodeBase64(ge),delete le.shared_secret,re(!1,le)})},ee.prototype.trigger=function(te,re){throw new q.UnsupportedFeature("Client events are not currently supported for encrypted channels")},ee.prototype.handleEvent=function(te){var re=te.event,se=te.data;if(re.indexOf("pusher_internal:")===0||re.indexOf("pusher:")===0){Z.prototype.handleEvent.call(this,te);return}this.handleEncryptedEvent(re,se)},ee.prototype.handleEncryptedEvent=function(te,re){var se=this;if(!this.key){Y.default.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!re.ciphertext||!re.nonce){Y.default.warn("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+re);return}var ne=G.decodeBase64(re.ciphertext);if(ne.length>24&255,Ge[pt+1]=ct>>16&255,Ge[pt+2]=ct>>8&255,Ge[pt+3]=ct&255,Ge[pt+4]=Ne>>24&255,Ge[pt+5]=Ne>>16&255,Ge[pt+6]=Ne>>8&255,Ge[pt+7]=Ne&255}function ge(Ge,pt,ct,Ne,vt){var Xt,sn=0;for(Xt=0;Xt>>8)-1}function ue(Ge,pt,ct,Ne){return ge(Ge,pt,ct,Ne,16)}function _e(Ge,pt,ct,Ne){return ge(Ge,pt,ct,Ne,32)}function fe(Ge,pt,ct,Ne){for(var vt=Ne[0]&255|(Ne[1]&255)<<8|(Ne[2]&255)<<16|(Ne[3]&255)<<24,Xt=ct[0]&255|(ct[1]&255)<<8|(ct[2]&255)<<16|(ct[3]&255)<<24,sn=ct[4]&255|(ct[5]&255)<<8|(ct[6]&255)<<16|(ct[7]&255)<<24,Pn=ct[8]&255|(ct[9]&255)<<8|(ct[10]&255)<<16|(ct[11]&255)<<24,Nn=ct[12]&255|(ct[13]&255)<<8|(ct[14]&255)<<16|(ct[15]&255)<<24,Qn=Ne[4]&255|(Ne[5]&255)<<8|(Ne[6]&255)<<16|(Ne[7]&255)<<24,Xn=pt[0]&255|(pt[1]&255)<<8|(pt[2]&255)<<16|(pt[3]&255)<<24,Rr=pt[4]&255|(pt[5]&255)<<8|(pt[6]&255)<<16|(pt[7]&255)<<24,tr=pt[8]&255|(pt[9]&255)<<8|(pt[10]&255)<<16|(pt[11]&255)<<24,fr=pt[12]&255|(pt[13]&255)<<8|(pt[14]&255)<<16|(pt[15]&255)<<24,Sr=Ne[8]&255|(Ne[9]&255)<<8|(Ne[10]&255)<<16|(Ne[11]&255)<<24,sr=ct[16]&255|(ct[17]&255)<<8|(ct[18]&255)<<16|(ct[19]&255)<<24,Rn=ct[20]&255|(ct[21]&255)<<8|(ct[22]&255)<<16|(ct[23]&255)<<24,mr=ct[24]&255|(ct[25]&255)<<8|(ct[26]&255)<<16|(ct[27]&255)<<24,br=ct[28]&255|(ct[29]&255)<<8|(ct[30]&255)<<16|(ct[31]&255)<<24,hr=Ne[12]&255|(Ne[13]&255)<<8|(Ne[14]&255)<<16|(Ne[15]&255)<<24,zn=vt,er=Xt,et=sn,yt=Pn,wt=Nn,Bt=Qn,Kt=Xn,Mt=Rr,tn=tr,hn=fr,Cn=Sr,cn=sr,ur=Rn,or=mr,rt=br,gt=hr,tt,nn=0;nn<20;nn+=2)tt=zn+ur|0,wt^=tt<<7|tt>>>32-7,tt=wt+zn|0,tn^=tt<<9|tt>>>32-9,tt=tn+wt|0,ur^=tt<<13|tt>>>32-13,tt=ur+tn|0,zn^=tt<<18|tt>>>32-18,tt=Bt+er|0,hn^=tt<<7|tt>>>32-7,tt=hn+Bt|0,or^=tt<<9|tt>>>32-9,tt=or+hn|0,er^=tt<<13|tt>>>32-13,tt=er+or|0,Bt^=tt<<18|tt>>>32-18,tt=Cn+Kt|0,rt^=tt<<7|tt>>>32-7,tt=rt+Cn|0,et^=tt<<9|tt>>>32-9,tt=et+rt|0,Kt^=tt<<13|tt>>>32-13,tt=Kt+et|0,Cn^=tt<<18|tt>>>32-18,tt=gt+cn|0,yt^=tt<<7|tt>>>32-7,tt=yt+gt|0,Mt^=tt<<9|tt>>>32-9,tt=Mt+yt|0,cn^=tt<<13|tt>>>32-13,tt=cn+Mt|0,gt^=tt<<18|tt>>>32-18,tt=zn+yt|0,er^=tt<<7|tt>>>32-7,tt=er+zn|0,et^=tt<<9|tt>>>32-9,tt=et+er|0,yt^=tt<<13|tt>>>32-13,tt=yt+et|0,zn^=tt<<18|tt>>>32-18,tt=Bt+wt|0,Kt^=tt<<7|tt>>>32-7,tt=Kt+Bt|0,Mt^=tt<<9|tt>>>32-9,tt=Mt+Kt|0,wt^=tt<<13|tt>>>32-13,tt=wt+Mt|0,Bt^=tt<<18|tt>>>32-18,tt=Cn+hn|0,cn^=tt<<7|tt>>>32-7,tt=cn+Cn|0,tn^=tt<<9|tt>>>32-9,tt=tn+cn|0,hn^=tt<<13|tt>>>32-13,tt=hn+tn|0,Cn^=tt<<18|tt>>>32-18,tt=gt+rt|0,ur^=tt<<7|tt>>>32-7,tt=ur+gt|0,or^=tt<<9|tt>>>32-9,tt=or+ur|0,rt^=tt<<13|tt>>>32-13,tt=rt+or|0,gt^=tt<<18|tt>>>32-18;zn=zn+vt|0,er=er+Xt|0,et=et+sn|0,yt=yt+Pn|0,wt=wt+Nn|0,Bt=Bt+Qn|0,Kt=Kt+Xn|0,Mt=Mt+Rr|0,tn=tn+tr|0,hn=hn+fr|0,Cn=Cn+Sr|0,cn=cn+sr|0,ur=ur+Rn|0,or=or+mr|0,rt=rt+br|0,gt=gt+hr|0,Ge[0]=zn>>>0&255,Ge[1]=zn>>>8&255,Ge[2]=zn>>>16&255,Ge[3]=zn>>>24&255,Ge[4]=er>>>0&255,Ge[5]=er>>>8&255,Ge[6]=er>>>16&255,Ge[7]=er>>>24&255,Ge[8]=et>>>0&255,Ge[9]=et>>>8&255,Ge[10]=et>>>16&255,Ge[11]=et>>>24&255,Ge[12]=yt>>>0&255,Ge[13]=yt>>>8&255,Ge[14]=yt>>>16&255,Ge[15]=yt>>>24&255,Ge[16]=wt>>>0&255,Ge[17]=wt>>>8&255,Ge[18]=wt>>>16&255,Ge[19]=wt>>>24&255,Ge[20]=Bt>>>0&255,Ge[21]=Bt>>>8&255,Ge[22]=Bt>>>16&255,Ge[23]=Bt>>>24&255,Ge[24]=Kt>>>0&255,Ge[25]=Kt>>>8&255,Ge[26]=Kt>>>16&255,Ge[27]=Kt>>>24&255,Ge[28]=Mt>>>0&255,Ge[29]=Mt>>>8&255,Ge[30]=Mt>>>16&255,Ge[31]=Mt>>>24&255,Ge[32]=tn>>>0&255,Ge[33]=tn>>>8&255,Ge[34]=tn>>>16&255,Ge[35]=tn>>>24&255,Ge[36]=hn>>>0&255,Ge[37]=hn>>>8&255,Ge[38]=hn>>>16&255,Ge[39]=hn>>>24&255,Ge[40]=Cn>>>0&255,Ge[41]=Cn>>>8&255,Ge[42]=Cn>>>16&255,Ge[43]=Cn>>>24&255,Ge[44]=cn>>>0&255,Ge[45]=cn>>>8&255,Ge[46]=cn>>>16&255,Ge[47]=cn>>>24&255,Ge[48]=ur>>>0&255,Ge[49]=ur>>>8&255,Ge[50]=ur>>>16&255,Ge[51]=ur>>>24&255,Ge[52]=or>>>0&255,Ge[53]=or>>>8&255,Ge[54]=or>>>16&255,Ge[55]=or>>>24&255,Ge[56]=rt>>>0&255,Ge[57]=rt>>>8&255,Ge[58]=rt>>>16&255,Ge[59]=rt>>>24&255,Ge[60]=gt>>>0&255,Ge[61]=gt>>>8&255,Ge[62]=gt>>>16&255,Ge[63]=gt>>>24&255}function me(Ge,pt,ct,Ne){for(var vt=Ne[0]&255|(Ne[1]&255)<<8|(Ne[2]&255)<<16|(Ne[3]&255)<<24,Xt=ct[0]&255|(ct[1]&255)<<8|(ct[2]&255)<<16|(ct[3]&255)<<24,sn=ct[4]&255|(ct[5]&255)<<8|(ct[6]&255)<<16|(ct[7]&255)<<24,Pn=ct[8]&255|(ct[9]&255)<<8|(ct[10]&255)<<16|(ct[11]&255)<<24,Nn=ct[12]&255|(ct[13]&255)<<8|(ct[14]&255)<<16|(ct[15]&255)<<24,Qn=Ne[4]&255|(Ne[5]&255)<<8|(Ne[6]&255)<<16|(Ne[7]&255)<<24,Xn=pt[0]&255|(pt[1]&255)<<8|(pt[2]&255)<<16|(pt[3]&255)<<24,Rr=pt[4]&255|(pt[5]&255)<<8|(pt[6]&255)<<16|(pt[7]&255)<<24,tr=pt[8]&255|(pt[9]&255)<<8|(pt[10]&255)<<16|(pt[11]&255)<<24,fr=pt[12]&255|(pt[13]&255)<<8|(pt[14]&255)<<16|(pt[15]&255)<<24,Sr=Ne[8]&255|(Ne[9]&255)<<8|(Ne[10]&255)<<16|(Ne[11]&255)<<24,sr=ct[16]&255|(ct[17]&255)<<8|(ct[18]&255)<<16|(ct[19]&255)<<24,Rn=ct[20]&255|(ct[21]&255)<<8|(ct[22]&255)<<16|(ct[23]&255)<<24,mr=ct[24]&255|(ct[25]&255)<<8|(ct[26]&255)<<16|(ct[27]&255)<<24,br=ct[28]&255|(ct[29]&255)<<8|(ct[30]&255)<<16|(ct[31]&255)<<24,hr=Ne[12]&255|(Ne[13]&255)<<8|(Ne[14]&255)<<16|(Ne[15]&255)<<24,zn=vt,er=Xt,et=sn,yt=Pn,wt=Nn,Bt=Qn,Kt=Xn,Mt=Rr,tn=tr,hn=fr,Cn=Sr,cn=sr,ur=Rn,or=mr,rt=br,gt=hr,tt,nn=0;nn<20;nn+=2)tt=zn+ur|0,wt^=tt<<7|tt>>>32-7,tt=wt+zn|0,tn^=tt<<9|tt>>>32-9,tt=tn+wt|0,ur^=tt<<13|tt>>>32-13,tt=ur+tn|0,zn^=tt<<18|tt>>>32-18,tt=Bt+er|0,hn^=tt<<7|tt>>>32-7,tt=hn+Bt|0,or^=tt<<9|tt>>>32-9,tt=or+hn|0,er^=tt<<13|tt>>>32-13,tt=er+or|0,Bt^=tt<<18|tt>>>32-18,tt=Cn+Kt|0,rt^=tt<<7|tt>>>32-7,tt=rt+Cn|0,et^=tt<<9|tt>>>32-9,tt=et+rt|0,Kt^=tt<<13|tt>>>32-13,tt=Kt+et|0,Cn^=tt<<18|tt>>>32-18,tt=gt+cn|0,yt^=tt<<7|tt>>>32-7,tt=yt+gt|0,Mt^=tt<<9|tt>>>32-9,tt=Mt+yt|0,cn^=tt<<13|tt>>>32-13,tt=cn+Mt|0,gt^=tt<<18|tt>>>32-18,tt=zn+yt|0,er^=tt<<7|tt>>>32-7,tt=er+zn|0,et^=tt<<9|tt>>>32-9,tt=et+er|0,yt^=tt<<13|tt>>>32-13,tt=yt+et|0,zn^=tt<<18|tt>>>32-18,tt=Bt+wt|0,Kt^=tt<<7|tt>>>32-7,tt=Kt+Bt|0,Mt^=tt<<9|tt>>>32-9,tt=Mt+Kt|0,wt^=tt<<13|tt>>>32-13,tt=wt+Mt|0,Bt^=tt<<18|tt>>>32-18,tt=Cn+hn|0,cn^=tt<<7|tt>>>32-7,tt=cn+Cn|0,tn^=tt<<9|tt>>>32-9,tt=tn+cn|0,hn^=tt<<13|tt>>>32-13,tt=hn+tn|0,Cn^=tt<<18|tt>>>32-18,tt=gt+rt|0,ur^=tt<<7|tt>>>32-7,tt=ur+gt|0,or^=tt<<9|tt>>>32-9,tt=or+ur|0,rt^=tt<<13|tt>>>32-13,tt=rt+or|0,gt^=tt<<18|tt>>>32-18;Ge[0]=zn>>>0&255,Ge[1]=zn>>>8&255,Ge[2]=zn>>>16&255,Ge[3]=zn>>>24&255,Ge[4]=Bt>>>0&255,Ge[5]=Bt>>>8&255,Ge[6]=Bt>>>16&255,Ge[7]=Bt>>>24&255,Ge[8]=Cn>>>0&255,Ge[9]=Cn>>>8&255,Ge[10]=Cn>>>16&255,Ge[11]=Cn>>>24&255,Ge[12]=gt>>>0&255,Ge[13]=gt>>>8&255,Ge[14]=gt>>>16&255,Ge[15]=gt>>>24&255,Ge[16]=Kt>>>0&255,Ge[17]=Kt>>>8&255,Ge[18]=Kt>>>16&255,Ge[19]=Kt>>>24&255,Ge[20]=Mt>>>0&255,Ge[21]=Mt>>>8&255,Ge[22]=Mt>>>16&255,Ge[23]=Mt>>>24&255,Ge[24]=tn>>>0&255,Ge[25]=tn>>>8&255,Ge[26]=tn>>>16&255,Ge[27]=tn>>>24&255,Ge[28]=hn>>>0&255,Ge[29]=hn>>>8&255,Ge[30]=hn>>>16&255,Ge[31]=hn>>>24&255}function ve(Ge,pt,ct,Ne){fe(Ge,pt,ct,Ne)}function xe(Ge,pt,ct,Ne){me(Ge,pt,ct,Ne)}var oe=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function ye(Ge,pt,ct,Ne,vt,Xt,sn){var Pn=new Uint8Array(16),Nn=new Uint8Array(64),Qn,Xn;for(Xn=0;Xn<16;Xn++)Pn[Xn]=0;for(Xn=0;Xn<8;Xn++)Pn[Xn]=Xt[Xn];for(;vt>=64;){for(ve(Nn,Pn,sn,oe),Xn=0;Xn<64;Xn++)Ge[pt+Xn]=ct[Ne+Xn]^Nn[Xn];for(Qn=1,Xn=8;Xn<16;Xn++)Qn=Qn+(Pn[Xn]&255)|0,Pn[Xn]=Qn&255,Qn>>>=8;vt-=64,pt+=64,Ne+=64}if(vt>0)for(ve(Nn,Pn,sn,oe),Xn=0;Xn=64;){for(ve(sn,Xt,vt,oe),Nn=0;Nn<64;Nn++)Ge[pt+Nn]=sn[Nn];for(Pn=1,Nn=8;Nn<16;Nn++)Pn=Pn+(Xt[Nn]&255)|0,Xt[Nn]=Pn&255,Pn>>>=8;ct-=64,pt+=64}if(ct>0)for(ve(sn,Xt,vt,oe),Nn=0;Nn>>13|ct<<3)&8191,Ne=Ge[4]&255|(Ge[5]&255)<<8,this.r[2]=(ct>>>10|Ne<<6)&7939,vt=Ge[6]&255|(Ge[7]&255)<<8,this.r[3]=(Ne>>>7|vt<<9)&8191,Xt=Ge[8]&255|(Ge[9]&255)<<8,this.r[4]=(vt>>>4|Xt<<12)&255,this.r[5]=Xt>>>1&8190,sn=Ge[10]&255|(Ge[11]&255)<<8,this.r[6]=(Xt>>>14|sn<<2)&8191,Pn=Ge[12]&255|(Ge[13]&255)<<8,this.r[7]=(sn>>>11|Pn<<5)&8065,Nn=Ge[14]&255|(Ge[15]&255)<<8,this.r[8]=(Pn>>>8|Nn<<8)&8191,this.r[9]=Nn>>>5&127,this.pad[0]=Ge[16]&255|(Ge[17]&255)<<8,this.pad[1]=Ge[18]&255|(Ge[19]&255)<<8,this.pad[2]=Ge[20]&255|(Ge[21]&255)<<8,this.pad[3]=Ge[22]&255|(Ge[23]&255)<<8,this.pad[4]=Ge[24]&255|(Ge[25]&255)<<8,this.pad[5]=Ge[26]&255|(Ge[27]&255)<<8,this.pad[6]=Ge[28]&255|(Ge[29]&255)<<8,this.pad[7]=Ge[30]&255|(Ge[31]&255)<<8};ke.prototype.blocks=function(Ge,pt,ct){for(var Ne=this.fin?0:2048,vt,Xt,sn,Pn,Nn,Qn,Xn,Rr,tr,fr,Sr,sr,Rn,mr,br,hr,zn,er,et,yt=this.h[0],wt=this.h[1],Bt=this.h[2],Kt=this.h[3],Mt=this.h[4],tn=this.h[5],hn=this.h[6],Cn=this.h[7],cn=this.h[8],ur=this.h[9],or=this.r[0],rt=this.r[1],gt=this.r[2],tt=this.r[3],nn=this.r[4],kn=this.r[5],Un=this.r[6],Jn=this.r[7],_r=this.r[8],xr=this.r[9];ct>=16;)vt=Ge[pt+0]&255|(Ge[pt+1]&255)<<8,yt+=vt&8191,Xt=Ge[pt+2]&255|(Ge[pt+3]&255)<<8,wt+=(vt>>>13|Xt<<3)&8191,sn=Ge[pt+4]&255|(Ge[pt+5]&255)<<8,Bt+=(Xt>>>10|sn<<6)&8191,Pn=Ge[pt+6]&255|(Ge[pt+7]&255)<<8,Kt+=(sn>>>7|Pn<<9)&8191,Nn=Ge[pt+8]&255|(Ge[pt+9]&255)<<8,Mt+=(Pn>>>4|Nn<<12)&8191,tn+=Nn>>>1&8191,Qn=Ge[pt+10]&255|(Ge[pt+11]&255)<<8,hn+=(Nn>>>14|Qn<<2)&8191,Xn=Ge[pt+12]&255|(Ge[pt+13]&255)<<8,Cn+=(Qn>>>11|Xn<<5)&8191,Rr=Ge[pt+14]&255|(Ge[pt+15]&255)<<8,cn+=(Xn>>>8|Rr<<8)&8191,ur+=Rr>>>5|Ne,tr=0,fr=tr,fr+=yt*or,fr+=wt*(5*xr),fr+=Bt*(5*_r),fr+=Kt*(5*Jn),fr+=Mt*(5*Un),tr=fr>>>13,fr&=8191,fr+=tn*(5*kn),fr+=hn*(5*nn),fr+=Cn*(5*tt),fr+=cn*(5*gt),fr+=ur*(5*rt),tr+=fr>>>13,fr&=8191,Sr=tr,Sr+=yt*rt,Sr+=wt*or,Sr+=Bt*(5*xr),Sr+=Kt*(5*_r),Sr+=Mt*(5*Jn),tr=Sr>>>13,Sr&=8191,Sr+=tn*(5*Un),Sr+=hn*(5*kn),Sr+=Cn*(5*nn),Sr+=cn*(5*tt),Sr+=ur*(5*gt),tr+=Sr>>>13,Sr&=8191,sr=tr,sr+=yt*gt,sr+=wt*rt,sr+=Bt*or,sr+=Kt*(5*xr),sr+=Mt*(5*_r),tr=sr>>>13,sr&=8191,sr+=tn*(5*Jn),sr+=hn*(5*Un),sr+=Cn*(5*kn),sr+=cn*(5*nn),sr+=ur*(5*tt),tr+=sr>>>13,sr&=8191,Rn=tr,Rn+=yt*tt,Rn+=wt*gt,Rn+=Bt*rt,Rn+=Kt*or,Rn+=Mt*(5*xr),tr=Rn>>>13,Rn&=8191,Rn+=tn*(5*_r),Rn+=hn*(5*Jn),Rn+=Cn*(5*Un),Rn+=cn*(5*kn),Rn+=ur*(5*nn),tr+=Rn>>>13,Rn&=8191,mr=tr,mr+=yt*nn,mr+=wt*tt,mr+=Bt*gt,mr+=Kt*rt,mr+=Mt*or,tr=mr>>>13,mr&=8191,mr+=tn*(5*xr),mr+=hn*(5*_r),mr+=Cn*(5*Jn),mr+=cn*(5*Un),mr+=ur*(5*kn),tr+=mr>>>13,mr&=8191,br=tr,br+=yt*kn,br+=wt*nn,br+=Bt*tt,br+=Kt*gt,br+=Mt*rt,tr=br>>>13,br&=8191,br+=tn*or,br+=hn*(5*xr),br+=Cn*(5*_r),br+=cn*(5*Jn),br+=ur*(5*Un),tr+=br>>>13,br&=8191,hr=tr,hr+=yt*Un,hr+=wt*kn,hr+=Bt*nn,hr+=Kt*tt,hr+=Mt*gt,tr=hr>>>13,hr&=8191,hr+=tn*rt,hr+=hn*or,hr+=Cn*(5*xr),hr+=cn*(5*_r),hr+=ur*(5*Jn),tr+=hr>>>13,hr&=8191,zn=tr,zn+=yt*Jn,zn+=wt*Un,zn+=Bt*kn,zn+=Kt*nn,zn+=Mt*tt,tr=zn>>>13,zn&=8191,zn+=tn*gt,zn+=hn*rt,zn+=Cn*or,zn+=cn*(5*xr),zn+=ur*(5*_r),tr+=zn>>>13,zn&=8191,er=tr,er+=yt*_r,er+=wt*Jn,er+=Bt*Un,er+=Kt*kn,er+=Mt*nn,tr=er>>>13,er&=8191,er+=tn*tt,er+=hn*gt,er+=Cn*rt,er+=cn*or,er+=ur*(5*xr),tr+=er>>>13,er&=8191,et=tr,et+=yt*xr,et+=wt*_r,et+=Bt*Jn,et+=Kt*Un,et+=Mt*kn,tr=et>>>13,et&=8191,et+=tn*nn,et+=hn*tt,et+=Cn*gt,et+=cn*rt,et+=ur*or,tr+=et>>>13,et&=8191,tr=(tr<<2)+tr|0,tr=tr+fr|0,fr=tr&8191,tr=tr>>>13,Sr+=tr,yt=fr,wt=Sr,Bt=sr,Kt=Rn,Mt=mr,tn=br,hn=hr,Cn=zn,cn=er,ur=et,pt+=16,ct-=16;this.h[0]=yt,this.h[1]=wt,this.h[2]=Bt,this.h[3]=Kt,this.h[4]=Mt,this.h[5]=tn,this.h[6]=hn,this.h[7]=Cn,this.h[8]=cn,this.h[9]=ur},ke.prototype.finish=function(Ge,pt){var ct=new Uint16Array(10),Ne,vt,Xt,sn;if(this.leftover){for(sn=this.leftover,this.buffer[sn++]=1;sn<16;sn++)this.buffer[sn]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(Ne=this.h[1]>>>13,this.h[1]&=8191,sn=2;sn<10;sn++)this.h[sn]+=Ne,Ne=this.h[sn]>>>13,this.h[sn]&=8191;for(this.h[0]+=Ne*5,Ne=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=Ne,Ne=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=Ne,ct[0]=this.h[0]+5,Ne=ct[0]>>>13,ct[0]&=8191,sn=1;sn<10;sn++)ct[sn]=this.h[sn]+Ne,Ne=ct[sn]>>>13,ct[sn]&=8191;for(ct[9]-=8192,vt=(Ne^1)-1,sn=0;sn<10;sn++)ct[sn]&=vt;for(vt=~vt,sn=0;sn<10;sn++)this.h[sn]=this.h[sn]&vt|ct[sn];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Xt=this.h[0]+this.pad[0],this.h[0]=Xt&65535,sn=1;sn<8;sn++)Xt=(this.h[sn]+this.pad[sn]|0)+(Xt>>>16)|0,this.h[sn]=Xt&65535;Ge[pt+0]=this.h[0]>>>0&255,Ge[pt+1]=this.h[0]>>>8&255,Ge[pt+2]=this.h[1]>>>0&255,Ge[pt+3]=this.h[1]>>>8&255,Ge[pt+4]=this.h[2]>>>0&255,Ge[pt+5]=this.h[2]>>>8&255,Ge[pt+6]=this.h[3]>>>0&255,Ge[pt+7]=this.h[3]>>>8&255,Ge[pt+8]=this.h[4]>>>0&255,Ge[pt+9]=this.h[4]>>>8&255,Ge[pt+10]=this.h[5]>>>0&255,Ge[pt+11]=this.h[5]>>>8&255,Ge[pt+12]=this.h[6]>>>0&255,Ge[pt+13]=this.h[6]>>>8&255,Ge[pt+14]=this.h[7]>>>0&255,Ge[pt+15]=this.h[7]>>>8&255},ke.prototype.update=function(Ge,pt,ct){var Ne,vt;if(this.leftover){for(vt=16-this.leftover,vt>ct&&(vt=ct),Ne=0;Ne=16&&(vt=ct-ct%16,this.blocks(Ge,pt,vt),pt+=vt,ct-=vt),ct){for(Ne=0;Ne>16&1),Xt[ct-1]&=65535;Xt[15]=sn[15]-32767-(Xt[14]>>16&1),vt=Xt[15]>>16&1,Xt[14]&=65535,qe(sn,Xt,1-vt)}for(ct=0;ct<16;ct++)Ge[2*ct]=sn[ct]&255,Ge[2*ct+1]=sn[ct]>>8}function At(Ge,pt){var ct=new Uint8Array(32),Ne=new Uint8Array(32);return Ve(ct,Ge),Ve(Ne,pt),_e(ct,0,Ne,0)}function Nt(Ge){var pt=new Uint8Array(32);return Ve(pt,Ge),pt[0]&1}function zt(Ge,pt){var ct;for(ct=0;ct<16;ct++)Ge[ct]=pt[2*ct]+(pt[2*ct+1]<<8);Ge[15]&=32767}function Ht(Ge,pt,ct){for(var Ne=0;Ne<16;Ne++)Ge[Ne]=pt[Ne]+ct[Ne]}function qt(Ge,pt,ct){for(var Ne=0;Ne<16;Ne++)Ge[Ne]=pt[Ne]-ct[Ne]}function Qt(Ge,pt,ct){var Ne,vt,Xt=0,sn=0,Pn=0,Nn=0,Qn=0,Xn=0,Rr=0,tr=0,fr=0,Sr=0,sr=0,Rn=0,mr=0,br=0,hr=0,zn=0,er=0,et=0,yt=0,wt=0,Bt=0,Kt=0,Mt=0,tn=0,hn=0,Cn=0,cn=0,ur=0,or=0,rt=0,gt=0,tt=ct[0],nn=ct[1],kn=ct[2],Un=ct[3],Jn=ct[4],_r=ct[5],xr=ct[6],Nr=ct[7],Mr=ct[8],Zr=ct[9],ti=ct[10],Xr=ct[11],ni=ct[12],qr=ct[13],ei=ct[14],mi=ct[15];Ne=pt[0],Xt+=Ne*tt,sn+=Ne*nn,Pn+=Ne*kn,Nn+=Ne*Un,Qn+=Ne*Jn,Xn+=Ne*_r,Rr+=Ne*xr,tr+=Ne*Nr,fr+=Ne*Mr,Sr+=Ne*Zr,sr+=Ne*ti,Rn+=Ne*Xr,mr+=Ne*ni,br+=Ne*qr,hr+=Ne*ei,zn+=Ne*mi,Ne=pt[1],sn+=Ne*tt,Pn+=Ne*nn,Nn+=Ne*kn,Qn+=Ne*Un,Xn+=Ne*Jn,Rr+=Ne*_r,tr+=Ne*xr,fr+=Ne*Nr,Sr+=Ne*Mr,sr+=Ne*Zr,Rn+=Ne*ti,mr+=Ne*Xr,br+=Ne*ni,hr+=Ne*qr,zn+=Ne*ei,er+=Ne*mi,Ne=pt[2],Pn+=Ne*tt,Nn+=Ne*nn,Qn+=Ne*kn,Xn+=Ne*Un,Rr+=Ne*Jn,tr+=Ne*_r,fr+=Ne*xr,Sr+=Ne*Nr,sr+=Ne*Mr,Rn+=Ne*Zr,mr+=Ne*ti,br+=Ne*Xr,hr+=Ne*ni,zn+=Ne*qr,er+=Ne*ei,et+=Ne*mi,Ne=pt[3],Nn+=Ne*tt,Qn+=Ne*nn,Xn+=Ne*kn,Rr+=Ne*Un,tr+=Ne*Jn,fr+=Ne*_r,Sr+=Ne*xr,sr+=Ne*Nr,Rn+=Ne*Mr,mr+=Ne*Zr,br+=Ne*ti,hr+=Ne*Xr,zn+=Ne*ni,er+=Ne*qr,et+=Ne*ei,yt+=Ne*mi,Ne=pt[4],Qn+=Ne*tt,Xn+=Ne*nn,Rr+=Ne*kn,tr+=Ne*Un,fr+=Ne*Jn,Sr+=Ne*_r,sr+=Ne*xr,Rn+=Ne*Nr,mr+=Ne*Mr,br+=Ne*Zr,hr+=Ne*ti,zn+=Ne*Xr,er+=Ne*ni,et+=Ne*qr,yt+=Ne*ei,wt+=Ne*mi,Ne=pt[5],Xn+=Ne*tt,Rr+=Ne*nn,tr+=Ne*kn,fr+=Ne*Un,Sr+=Ne*Jn,sr+=Ne*_r,Rn+=Ne*xr,mr+=Ne*Nr,br+=Ne*Mr,hr+=Ne*Zr,zn+=Ne*ti,er+=Ne*Xr,et+=Ne*ni,yt+=Ne*qr,wt+=Ne*ei,Bt+=Ne*mi,Ne=pt[6],Rr+=Ne*tt,tr+=Ne*nn,fr+=Ne*kn,Sr+=Ne*Un,sr+=Ne*Jn,Rn+=Ne*_r,mr+=Ne*xr,br+=Ne*Nr,hr+=Ne*Mr,zn+=Ne*Zr,er+=Ne*ti,et+=Ne*Xr,yt+=Ne*ni,wt+=Ne*qr,Bt+=Ne*ei,Kt+=Ne*mi,Ne=pt[7],tr+=Ne*tt,fr+=Ne*nn,Sr+=Ne*kn,sr+=Ne*Un,Rn+=Ne*Jn,mr+=Ne*_r,br+=Ne*xr,hr+=Ne*Nr,zn+=Ne*Mr,er+=Ne*Zr,et+=Ne*ti,yt+=Ne*Xr,wt+=Ne*ni,Bt+=Ne*qr,Kt+=Ne*ei,Mt+=Ne*mi,Ne=pt[8],fr+=Ne*tt,Sr+=Ne*nn,sr+=Ne*kn,Rn+=Ne*Un,mr+=Ne*Jn,br+=Ne*_r,hr+=Ne*xr,zn+=Ne*Nr,er+=Ne*Mr,et+=Ne*Zr,yt+=Ne*ti,wt+=Ne*Xr,Bt+=Ne*ni,Kt+=Ne*qr,Mt+=Ne*ei,tn+=Ne*mi,Ne=pt[9],Sr+=Ne*tt,sr+=Ne*nn,Rn+=Ne*kn,mr+=Ne*Un,br+=Ne*Jn,hr+=Ne*_r,zn+=Ne*xr,er+=Ne*Nr,et+=Ne*Mr,yt+=Ne*Zr,wt+=Ne*ti,Bt+=Ne*Xr,Kt+=Ne*ni,Mt+=Ne*qr,tn+=Ne*ei,hn+=Ne*mi,Ne=pt[10],sr+=Ne*tt,Rn+=Ne*nn,mr+=Ne*kn,br+=Ne*Un,hr+=Ne*Jn,zn+=Ne*_r,er+=Ne*xr,et+=Ne*Nr,yt+=Ne*Mr,wt+=Ne*Zr,Bt+=Ne*ti,Kt+=Ne*Xr,Mt+=Ne*ni,tn+=Ne*qr,hn+=Ne*ei,Cn+=Ne*mi,Ne=pt[11],Rn+=Ne*tt,mr+=Ne*nn,br+=Ne*kn,hr+=Ne*Un,zn+=Ne*Jn,er+=Ne*_r,et+=Ne*xr,yt+=Ne*Nr,wt+=Ne*Mr,Bt+=Ne*Zr,Kt+=Ne*ti,Mt+=Ne*Xr,tn+=Ne*ni,hn+=Ne*qr,Cn+=Ne*ei,cn+=Ne*mi,Ne=pt[12],mr+=Ne*tt,br+=Ne*nn,hr+=Ne*kn,zn+=Ne*Un,er+=Ne*Jn,et+=Ne*_r,yt+=Ne*xr,wt+=Ne*Nr,Bt+=Ne*Mr,Kt+=Ne*Zr,Mt+=Ne*ti,tn+=Ne*Xr,hn+=Ne*ni,Cn+=Ne*qr,cn+=Ne*ei,ur+=Ne*mi,Ne=pt[13],br+=Ne*tt,hr+=Ne*nn,zn+=Ne*kn,er+=Ne*Un,et+=Ne*Jn,yt+=Ne*_r,wt+=Ne*xr,Bt+=Ne*Nr,Kt+=Ne*Mr,Mt+=Ne*Zr,tn+=Ne*ti,hn+=Ne*Xr,Cn+=Ne*ni,cn+=Ne*qr,ur+=Ne*ei,or+=Ne*mi,Ne=pt[14],hr+=Ne*tt,zn+=Ne*nn,er+=Ne*kn,et+=Ne*Un,yt+=Ne*Jn,wt+=Ne*_r,Bt+=Ne*xr,Kt+=Ne*Nr,Mt+=Ne*Mr,tn+=Ne*Zr,hn+=Ne*ti,Cn+=Ne*Xr,cn+=Ne*ni,ur+=Ne*qr,or+=Ne*ei,rt+=Ne*mi,Ne=pt[15],zn+=Ne*tt,er+=Ne*nn,et+=Ne*kn,yt+=Ne*Un,wt+=Ne*Jn,Bt+=Ne*_r,Kt+=Ne*xr,Mt+=Ne*Nr,tn+=Ne*Mr,hn+=Ne*Zr,Cn+=Ne*ti,cn+=Ne*Xr,ur+=Ne*ni,or+=Ne*qr,rt+=Ne*ei,gt+=Ne*mi,Xt+=38*er,sn+=38*et,Pn+=38*yt,Nn+=38*wt,Qn+=38*Bt,Xn+=38*Kt,Rr+=38*Mt,tr+=38*tn,fr+=38*hn,Sr+=38*Cn,sr+=38*cn,Rn+=38*ur,mr+=38*or,br+=38*rt,hr+=38*gt,vt=1,Ne=Xt+vt+65535,vt=Math.floor(Ne/65536),Xt=Ne-vt*65536,Ne=sn+vt+65535,vt=Math.floor(Ne/65536),sn=Ne-vt*65536,Ne=Pn+vt+65535,vt=Math.floor(Ne/65536),Pn=Ne-vt*65536,Ne=Nn+vt+65535,vt=Math.floor(Ne/65536),Nn=Ne-vt*65536,Ne=Qn+vt+65535,vt=Math.floor(Ne/65536),Qn=Ne-vt*65536,Ne=Xn+vt+65535,vt=Math.floor(Ne/65536),Xn=Ne-vt*65536,Ne=Rr+vt+65535,vt=Math.floor(Ne/65536),Rr=Ne-vt*65536,Ne=tr+vt+65535,vt=Math.floor(Ne/65536),tr=Ne-vt*65536,Ne=fr+vt+65535,vt=Math.floor(Ne/65536),fr=Ne-vt*65536,Ne=Sr+vt+65535,vt=Math.floor(Ne/65536),Sr=Ne-vt*65536,Ne=sr+vt+65535,vt=Math.floor(Ne/65536),sr=Ne-vt*65536,Ne=Rn+vt+65535,vt=Math.floor(Ne/65536),Rn=Ne-vt*65536,Ne=mr+vt+65535,vt=Math.floor(Ne/65536),mr=Ne-vt*65536,Ne=br+vt+65535,vt=Math.floor(Ne/65536),br=Ne-vt*65536,Ne=hr+vt+65535,vt=Math.floor(Ne/65536),hr=Ne-vt*65536,Ne=zn+vt+65535,vt=Math.floor(Ne/65536),zn=Ne-vt*65536,Xt+=vt-1+37*(vt-1),vt=1,Ne=Xt+vt+65535,vt=Math.floor(Ne/65536),Xt=Ne-vt*65536,Ne=sn+vt+65535,vt=Math.floor(Ne/65536),sn=Ne-vt*65536,Ne=Pn+vt+65535,vt=Math.floor(Ne/65536),Pn=Ne-vt*65536,Ne=Nn+vt+65535,vt=Math.floor(Ne/65536),Nn=Ne-vt*65536,Ne=Qn+vt+65535,vt=Math.floor(Ne/65536),Qn=Ne-vt*65536,Ne=Xn+vt+65535,vt=Math.floor(Ne/65536),Xn=Ne-vt*65536,Ne=Rr+vt+65535,vt=Math.floor(Ne/65536),Rr=Ne-vt*65536,Ne=tr+vt+65535,vt=Math.floor(Ne/65536),tr=Ne-vt*65536,Ne=fr+vt+65535,vt=Math.floor(Ne/65536),fr=Ne-vt*65536,Ne=Sr+vt+65535,vt=Math.floor(Ne/65536),Sr=Ne-vt*65536,Ne=sr+vt+65535,vt=Math.floor(Ne/65536),sr=Ne-vt*65536,Ne=Rn+vt+65535,vt=Math.floor(Ne/65536),Rn=Ne-vt*65536,Ne=mr+vt+65535,vt=Math.floor(Ne/65536),mr=Ne-vt*65536,Ne=br+vt+65535,vt=Math.floor(Ne/65536),br=Ne-vt*65536,Ne=hr+vt+65535,vt=Math.floor(Ne/65536),hr=Ne-vt*65536,Ne=zn+vt+65535,vt=Math.floor(Ne/65536),zn=Ne-vt*65536,Xt+=vt-1+37*(vt-1),Ge[0]=Xt,Ge[1]=sn,Ge[2]=Pn,Ge[3]=Nn,Ge[4]=Qn,Ge[5]=Xn,Ge[6]=Rr,Ge[7]=tr,Ge[8]=fr,Ge[9]=Sr,Ge[10]=sr,Ge[11]=Rn,Ge[12]=mr,Ge[13]=br,Ge[14]=hr,Ge[15]=zn}function Jt(Ge,pt){Qt(Ge,pt,pt)}function yn(Ge,pt){var ct=U(),Ne;for(Ne=0;Ne<16;Ne++)ct[Ne]=pt[Ne];for(Ne=253;Ne>=0;Ne--)Jt(ct,ct),Ne!==2&&Ne!==4&&Qt(ct,ct,pt);for(Ne=0;Ne<16;Ne++)Ge[Ne]=ct[Ne]}function _n(Ge,pt){var ct=U(),Ne;for(Ne=0;Ne<16;Ne++)ct[Ne]=pt[Ne];for(Ne=250;Ne>=0;Ne--)Jt(ct,ct),Ne!==1&&Qt(ct,ct,pt);for(Ne=0;Ne<16;Ne++)Ge[Ne]=ct[Ne]}function Hn(Ge,pt,ct){var Ne=new Uint8Array(32),vt=new Float64Array(80),Xt,sn,Pn=U(),Nn=U(),Qn=U(),Xn=U(),Rr=U(),tr=U();for(sn=0;sn<31;sn++)Ne[sn]=pt[sn];for(Ne[31]=pt[31]&127|64,Ne[0]&=248,zt(vt,ct),sn=0;sn<16;sn++)Nn[sn]=vt[sn],Xn[sn]=Pn[sn]=Qn[sn]=0;for(Pn[0]=Xn[0]=1,sn=254;sn>=0;--sn)Xt=Ne[sn>>>3]>>>(sn&7)&1,qe(Pn,Nn,Xt),qe(Qn,Xn,Xt),Ht(Rr,Pn,Qn),qt(Pn,Pn,Qn),Ht(Qn,Nn,Xn),qt(Nn,Nn,Xn),Jt(Xn,Rr),Jt(tr,Pn),Qt(Pn,Qn,Pn),Qt(Qn,Nn,Rr),Ht(Rr,Pn,Qn),qt(Pn,Pn,Qn),Jt(Nn,Pn),qt(Qn,Xn,tr),Qt(Pn,Qn,Z),Ht(Pn,Pn,Xn),Qt(Qn,Qn,Pn),Qt(Pn,Xn,tr),Qt(Xn,Nn,vt),Jt(Nn,Rr),qe(Pn,Nn,Xt),qe(Qn,Xn,Xt);for(sn=0;sn<16;sn++)vt[sn+16]=Pn[sn],vt[sn+32]=Qn[sn],vt[sn+48]=Nn[sn],vt[sn+64]=Xn[sn];var fr=vt.subarray(32),Sr=vt.subarray(16);return yn(fr,fr),Qt(Sr,Sr,fr),Ve(Ge,Sr),0}function On(Ge,pt){return Hn(Ge,pt,K)}function Fn(Ge,pt){return q(pt,32),On(Ge,pt)}function In(Ge,pt,ct){var Ne=new Uint8Array(32);return Hn(Ne,ct,pt),xe(Ge,Y,Ne,oe)}var dn=ze,kt=Fe;function Ye(Ge,pt,ct,Ne,vt,Xt){var sn=new Uint8Array(32);return In(sn,vt,Xt),dn(Ge,pt,ct,Ne,sn)}function _t(Ge,pt,ct,Ne,vt,Xt){var sn=new Uint8Array(32);return In(sn,vt,Xt),kt(Ge,pt,ct,Ne,sn)}var We=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Pe(Ge,pt,ct,Ne){for(var vt=new Int32Array(16),Xt=new Int32Array(16),sn,Pn,Nn,Qn,Xn,Rr,tr,fr,Sr,sr,Rn,mr,br,hr,zn,er,et,yt,wt,Bt,Kt,Mt,tn,hn,Cn,cn,ur=Ge[0],or=Ge[1],rt=Ge[2],gt=Ge[3],tt=Ge[4],nn=Ge[5],kn=Ge[6],Un=Ge[7],Jn=pt[0],_r=pt[1],xr=pt[2],Nr=pt[3],Mr=pt[4],Zr=pt[5],ti=pt[6],Xr=pt[7],ni=0;Ne>=128;){for(wt=0;wt<16;wt++)Bt=8*wt+ni,vt[wt]=ct[Bt+0]<<24|ct[Bt+1]<<16|ct[Bt+2]<<8|ct[Bt+3],Xt[wt]=ct[Bt+4]<<24|ct[Bt+5]<<16|ct[Bt+6]<<8|ct[Bt+7];for(wt=0;wt<80;wt++)if(sn=ur,Pn=or,Nn=rt,Qn=gt,Xn=tt,Rr=nn,tr=kn,fr=Un,Sr=Jn,sr=_r,Rn=xr,mr=Nr,br=Mr,hr=Zr,zn=ti,er=Xr,Kt=Un,Mt=Xr,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=(tt>>>14|Mr<<32-14)^(tt>>>18|Mr<<32-18)^(Mr>>>41-32|tt<<32-(41-32)),Mt=(Mr>>>14|tt<<32-14)^(Mr>>>18|tt<<32-18)^(tt>>>41-32|Mr<<32-(41-32)),tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,Kt=tt&nn^~tt&kn,Mt=Mr&Zr^~Mr&ti,tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,Kt=We[wt*2],Mt=We[wt*2+1],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,Kt=vt[wt%16],Mt=Xt[wt%16],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,et=Cn&65535|cn<<16,yt=tn&65535|hn<<16,Kt=et,Mt=yt,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=(ur>>>28|Jn<<32-28)^(Jn>>>34-32|ur<<32-(34-32))^(Jn>>>39-32|ur<<32-(39-32)),Mt=(Jn>>>28|ur<<32-28)^(ur>>>34-32|Jn<<32-(34-32))^(ur>>>39-32|Jn<<32-(39-32)),tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,Kt=ur&or^ur&rt^or&rt,Mt=Jn&_r^Jn&xr^_r&xr,tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,fr=Cn&65535|cn<<16,er=tn&65535|hn<<16,Kt=Qn,Mt=mr,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=et,Mt=yt,tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Qn=Cn&65535|cn<<16,mr=tn&65535|hn<<16,or=sn,rt=Pn,gt=Nn,tt=Qn,nn=Xn,kn=Rr,Un=tr,ur=fr,_r=Sr,xr=sr,Nr=Rn,Mr=mr,Zr=br,ti=hr,Xr=zn,Jn=er,wt%16===15)for(Bt=0;Bt<16;Bt++)Kt=vt[Bt],Mt=Xt[Bt],tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=vt[(Bt+9)%16],Mt=Xt[(Bt+9)%16],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,et=vt[(Bt+1)%16],yt=Xt[(Bt+1)%16],Kt=(et>>>1|yt<<32-1)^(et>>>8|yt<<32-8)^et>>>7,Mt=(yt>>>1|et<<32-1)^(yt>>>8|et<<32-8)^(yt>>>7|et<<32-7),tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,et=vt[(Bt+14)%16],yt=Xt[(Bt+14)%16],Kt=(et>>>19|yt<<32-19)^(yt>>>61-32|et<<32-(61-32))^et>>>6,Mt=(yt>>>19|et<<32-19)^(et>>>61-32|yt<<32-(61-32))^(yt>>>6|et<<32-6),tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,vt[Bt]=Cn&65535|cn<<16,Xt[Bt]=tn&65535|hn<<16;Kt=ur,Mt=Jn,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=Ge[0],Mt=pt[0],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Ge[0]=ur=Cn&65535|cn<<16,pt[0]=Jn=tn&65535|hn<<16,Kt=or,Mt=_r,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=Ge[1],Mt=pt[1],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Ge[1]=or=Cn&65535|cn<<16,pt[1]=_r=tn&65535|hn<<16,Kt=rt,Mt=xr,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=Ge[2],Mt=pt[2],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Ge[2]=rt=Cn&65535|cn<<16,pt[2]=xr=tn&65535|hn<<16,Kt=gt,Mt=Nr,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=Ge[3],Mt=pt[3],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Ge[3]=gt=Cn&65535|cn<<16,pt[3]=Nr=tn&65535|hn<<16,Kt=tt,Mt=Mr,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=Ge[4],Mt=pt[4],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Ge[4]=tt=Cn&65535|cn<<16,pt[4]=Mr=tn&65535|hn<<16,Kt=nn,Mt=Zr,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=Ge[5],Mt=pt[5],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Ge[5]=nn=Cn&65535|cn<<16,pt[5]=Zr=tn&65535|hn<<16,Kt=kn,Mt=ti,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=Ge[6],Mt=pt[6],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Ge[6]=kn=Cn&65535|cn<<16,pt[6]=ti=tn&65535|hn<<16,Kt=Un,Mt=Xr,tn=Mt&65535,hn=Mt>>>16,Cn=Kt&65535,cn=Kt>>>16,Kt=Ge[7],Mt=pt[7],tn+=Mt&65535,hn+=Mt>>>16,Cn+=Kt&65535,cn+=Kt>>>16,hn+=tn>>>16,Cn+=hn>>>16,cn+=Cn>>>16,Ge[7]=Un=Cn&65535|cn<<16,pt[7]=Xr=tn&65535|hn<<16,ni+=128,Ne-=128}return Ne}function Se(Ge,pt,ct){var Ne=new Int32Array(8),vt=new Int32Array(8),Xt=new Uint8Array(256),sn,Pn=ct;for(Ne[0]=1779033703,Ne[1]=3144134277,Ne[2]=1013904242,Ne[3]=2773480762,Ne[4]=1359893119,Ne[5]=2600822924,Ne[6]=528734635,Ne[7]=1541459225,vt[0]=4089235720,vt[1]=2227873595,vt[2]=4271175723,vt[3]=1595750129,vt[4]=2917565137,vt[5]=725511199,vt[6]=4215389547,vt[7]=327033209,Pe(Ne,vt,pt,ct),ct%=128,sn=0;sn=0;--vt)Ne=ct[vt/8|0]>>(vt&7)&1,Ue(Ge,pt,Ne),$e(pt,Ge),$e(Ge,Ge),Ue(Ge,pt,Ne)}function ht(Ge,pt){var ct=[U(),U(),U(),U()];Ze(ct[0],re),Ze(ct[1],se),Ze(ct[2],J),Qt(ct[3],re,se),mt(Ge,ct,pt)}function at(Ge,pt,ct){var Ne=new Uint8Array(64),vt=[U(),U(),U(),U()],Xt;for(ct||q(pt,32),Se(Ne,pt,32),Ne[0]&=248,Ne[31]&=127,Ne[31]|=64,ht(vt,Ne),Qe(Ge,vt),Xt=0;Xt<32;Xt++)pt[Xt+32]=Ge[Xt];return 0}var ut=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Rt(Ge,pt){var ct,Ne,vt,Xt;for(Ne=63;Ne>=32;--Ne){for(ct=0,vt=Ne-32,Xt=Ne-12;vt>8,pt[vt]-=ct*256;pt[vt]+=ct,pt[Ne]=0}for(ct=0,vt=0;vt<32;vt++)pt[vt]+=ct-(pt[31]>>4)*ut[vt],ct=pt[vt]>>8,pt[vt]&=255;for(vt=0;vt<32;vt++)pt[vt]-=ct*ut[vt];for(Ne=0;Ne<32;Ne++)pt[Ne+1]+=pt[Ne]>>8,Ge[Ne]=pt[Ne]&255}function fn(Ge){var pt=new Float64Array(64),ct;for(ct=0;ct<64;ct++)pt[ct]=Ge[ct];for(ct=0;ct<64;ct++)Ge[ct]=0;Rt(Ge,pt)}function Bn(Ge,pt,ct,Ne){var vt=new Uint8Array(64),Xt=new Uint8Array(64),sn=new Uint8Array(64),Pn,Nn,Qn=new Float64Array(64),Xn=[U(),U(),U(),U()];Se(vt,Ne,32),vt[0]&=248,vt[31]&=127,vt[31]|=64;var Rr=ct+64;for(Pn=0;Pn>7&&qt(Ge[0],G,Ge[0]),Qt(Ge[3],Ge[0],Ge[1]),0)}function xn(Ge,pt,ct,Ne){var vt,Xt,sn=new Uint8Array(32),Pn=new Uint8Array(64),Nn=[U(),U(),U(),U()],Qn=[U(),U(),U(),U()];if(Xt=-1,ct<64||en(Qn,Ne))return-1;for(vt=0;vt=0},j.sign.keyPair=function(){var Ge=new Uint8Array(En),pt=new Uint8Array(cr);return at(Ge,pt),{publicKey:Ge,secretKey:pt}},j.sign.keyPair.fromSecretKey=function(Ge){if(Dr(Ge),Ge.length!==cr)throw new Error("bad secret key size");for(var pt=new Uint8Array(En),ct=0;ct"u"?typeof j.from<"u"?(U.encodeBase64=function(Y){return j.from(Y).toString("base64")},U.decodeBase64=function(Y){return q(Y),new Uint8Array(Array.prototype.slice.call(j.from(Y,"base64"),0))}):(U.encodeBase64=function(Y){return new j(Y).toString("base64")},U.decodeBase64=function(Y){return q(Y),new Uint8Array(Array.prototype.slice.call(new j(Y,"base64"),0))}):(U.encodeBase64=function(Y){var K,G=[],J=Y.length;for(K=0;K=K())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K().toString(16)+" bytes");return Pe|0}function _e(Pe){return+Pe!=Pe&&(Pe=0),J.alloc(+Pe)}J.isBuffer=function(Se){return!!(Se!=null&&Se._isBuffer)},J.compare=function(Se,$e){if(!J.isBuffer(Se)||!J.isBuffer($e))throw new TypeError("Arguments must be Buffers");if(Se===$e)return 0;for(var Ue=Se.length,Qe=$e.length,mt=0,ht=Math.min(Ue,Qe);mt>>1;case"base64":return Ye(Pe).length;default:if(Ue)return In(Pe).length;Se=(""+Se).toLowerCase(),Ue=!0}}J.byteLength=fe;function me(Pe,Se,$e){var Ue=!1;if((Se===void 0||Se<0)&&(Se=0),Se>this.length||(($e===void 0||$e>this.length)&&($e=this.length),$e<=0)||($e>>>=0,Se>>>=0,$e<=Se))return"";for(Pe||(Pe="utf8");;)switch(Pe){case"hex":return Ve(this,Se,$e);case"utf8":case"utf-8":return ze(this,Se,$e);case"ascii":return lt(this,Se,$e);case"latin1":case"binary":return qe(this,Se,$e);case"base64":return Me(this,Se,$e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return At(this,Se,$e);default:if(Ue)throw new TypeError("Unknown encoding: "+Pe);Pe=(Pe+"").toLowerCase(),Ue=!0}}J.prototype._isBuffer=!0;function ve(Pe,Se,$e){var Ue=Pe[Se];Pe[Se]=Pe[$e],Pe[$e]=Ue}J.prototype.swap16=function(){var Se=this.length;if(Se%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var $e=0;$e0&&(Se=this.toString("hex",0,$e).match(/.{2}/g).join(" "),this.length>$e&&(Se+=" ... ")),""},J.prototype.compare=function(Se,$e,Ue,Qe,mt){if(!J.isBuffer(Se))throw new TypeError("Argument must be a Buffer");if($e===void 0&&($e=0),Ue===void 0&&(Ue=Se?Se.length:0),Qe===void 0&&(Qe=0),mt===void 0&&(mt=this.length),$e<0||Ue>Se.length||Qe<0||mt>this.length)throw new RangeError("out of range index");if(Qe>=mt&&$e>=Ue)return 0;if(Qe>=mt)return-1;if($e>=Ue)return 1;if($e>>>=0,Ue>>>=0,Qe>>>=0,mt>>>=0,this===Se)return 0;for(var ht=mt-Qe,at=Ue-$e,ut=Math.min(ht,at),Rt=this.slice(Qe,mt),fn=Se.slice($e,Ue),Bn=0;Bn2147483647?$e=2147483647:$e<-2147483648&&($e=-2147483648),$e=+$e,isNaN($e)&&($e=Qe?0:Pe.length-1),$e<0&&($e=Pe.length+$e),$e>=Pe.length){if(Qe)return-1;$e=Pe.length-1}else if($e<0)if(Qe)$e=0;else return-1;if(typeof Se=="string"&&(Se=J.from(Se,Ue)),J.isBuffer(Se))return Se.length===0?-1:oe(Pe,Se,$e,Ue,Qe);if(typeof Se=="number")return Se=Se&255,J.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Qe?Uint8Array.prototype.indexOf.call(Pe,Se,$e):Uint8Array.prototype.lastIndexOf.call(Pe,Se,$e):oe(Pe,[Se],$e,Ue,Qe);throw new TypeError("val must be string, number or Buffer")}function oe(Pe,Se,$e,Ue,Qe){var mt=1,ht=Pe.length,at=Se.length;if(Ue!==void 0&&(Ue=String(Ue).toLowerCase(),Ue==="ucs2"||Ue==="ucs-2"||Ue==="utf16le"||Ue==="utf-16le")){if(Pe.length<2||Se.length<2)return-1;mt=2,ht/=2,at/=2,$e/=2}function ut(xn,ot){return mt===1?xn[ot]:xn.readUInt16BE(ot*mt)}var Rt;if(Qe){var fn=-1;for(Rt=$e;Rtht&&($e=ht-at),Rt=$e;Rt>=0;Rt--){for(var Bn=!0,en=0;enQe&&(Ue=Qe)):Ue=Qe;var mt=Se.length;if(mt%2!==0)throw new TypeError("Invalid hex string");Ue>mt/2&&(Ue=mt/2);for(var ht=0;htmt)&&(Ue=mt),Se.length>0&&(Ue<0||$e<0)||$e>this.length)throw new RangeError("Attempt to write outside buffer bounds");Qe||(Qe="utf8");for(var ht=!1;;)switch(Qe){case"hex":return ye(this,Se,$e,Ue);case"utf8":case"utf-8":return be(this,Se,$e,Ue);case"ascii":return we(this,Se,$e,Ue);case"latin1":case"binary":return Ae(this,Se,$e,Ue);case"base64":return ke(this,Se,$e,Ue);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oe(this,Se,$e,Ue);default:if(ht)throw new TypeError("Unknown encoding: "+Qe);Qe=(""+Qe).toLowerCase(),ht=!0}},J.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Me(Pe,Se,$e){return Se===0&&$e===Pe.length?j.fromByteArray(Pe):j.fromByteArray(Pe.slice(Se,$e))}function ze(Pe,Se,$e){$e=Math.min(Pe.length,$e);for(var Ue=[],Qe=Se;Qe<$e;){var mt=Pe[Qe],ht=null,at=mt>239?4:mt>223?3:mt>191?2:1;if(Qe+at<=$e){var ut,Rt,fn,Bn;switch(at){case 1:mt<128&&(ht=mt);break;case 2:ut=Pe[Qe+1],(ut&192)===128&&(Bn=(mt&31)<<6|ut&63,Bn>127&&(ht=Bn));break;case 3:ut=Pe[Qe+1],Rt=Pe[Qe+2],(ut&192)===128&&(Rt&192)===128&&(Bn=(mt&15)<<12|(ut&63)<<6|Rt&63,Bn>2047&&(Bn<55296||Bn>57343)&&(ht=Bn));break;case 4:ut=Pe[Qe+1],Rt=Pe[Qe+2],fn=Pe[Qe+3],(ut&192)===128&&(Rt&192)===128&&(fn&192)===128&&(Bn=(mt&15)<<18|(ut&63)<<12|(Rt&63)<<6|fn&63,Bn>65535&&Bn<1114112&&(ht=Bn))}}ht===null?(ht=65533,at=1):ht>65535&&(ht-=65536,Ue.push(ht>>>10&1023|55296),ht=56320|ht&1023),Ue.push(ht),Qe+=at}return Ze(Ue)}var Fe=4096;function Ze(Pe){var Se=Pe.length;if(Se<=Fe)return String.fromCharCode.apply(String,Pe);for(var $e="",Ue=0;UeUe)&&($e=Ue);for(var Qe="",mt=Se;mt<$e;++mt)Qe+=Fn(Pe[mt]);return Qe}function At(Pe,Se,$e){for(var Ue=Pe.slice(Se,$e),Qe="",mt=0;mtUe&&(Se=Ue),$e<0?($e+=Ue,$e<0&&($e=0)):$e>Ue&&($e=Ue),$e$e)throw new RangeError("Trying to access beyond buffer length")}J.prototype.readUIntLE=function(Se,$e,Ue){Se=Se|0,$e=$e|0,Ue||Nt(Se,$e,this.length);for(var Qe=this[Se],mt=1,ht=0;++ht<$e&&(mt*=256);)Qe+=this[Se+ht]*mt;return Qe},J.prototype.readUIntBE=function(Se,$e,Ue){Se=Se|0,$e=$e|0,Ue||Nt(Se,$e,this.length);for(var Qe=this[Se+--$e],mt=1;$e>0&&(mt*=256);)Qe+=this[Se+--$e]*mt;return Qe},J.prototype.readUInt8=function(Se,$e){return $e||Nt(Se,1,this.length),this[Se]},J.prototype.readUInt16LE=function(Se,$e){return $e||Nt(Se,2,this.length),this[Se]|this[Se+1]<<8},J.prototype.readUInt16BE=function(Se,$e){return $e||Nt(Se,2,this.length),this[Se]<<8|this[Se+1]},J.prototype.readUInt32LE=function(Se,$e){return $e||Nt(Se,4,this.length),(this[Se]|this[Se+1]<<8|this[Se+2]<<16)+this[Se+3]*16777216},J.prototype.readUInt32BE=function(Se,$e){return $e||Nt(Se,4,this.length),this[Se]*16777216+(this[Se+1]<<16|this[Se+2]<<8|this[Se+3])},J.prototype.readIntLE=function(Se,$e,Ue){Se=Se|0,$e=$e|0,Ue||Nt(Se,$e,this.length);for(var Qe=this[Se],mt=1,ht=0;++ht<$e&&(mt*=256);)Qe+=this[Se+ht]*mt;return mt*=128,Qe>=mt&&(Qe-=Math.pow(2,8*$e)),Qe},J.prototype.readIntBE=function(Se,$e,Ue){Se=Se|0,$e=$e|0,Ue||Nt(Se,$e,this.length);for(var Qe=$e,mt=1,ht=this[Se+--Qe];Qe>0&&(mt*=256);)ht+=this[Se+--Qe]*mt;return mt*=128,ht>=mt&&(ht-=Math.pow(2,8*$e)),ht},J.prototype.readInt8=function(Se,$e){return $e||Nt(Se,1,this.length),this[Se]&128?(255-this[Se]+1)*-1:this[Se]},J.prototype.readInt16LE=function(Se,$e){$e||Nt(Se,2,this.length);var Ue=this[Se]|this[Se+1]<<8;return Ue&32768?Ue|4294901760:Ue},J.prototype.readInt16BE=function(Se,$e){$e||Nt(Se,2,this.length);var Ue=this[Se+1]|this[Se]<<8;return Ue&32768?Ue|4294901760:Ue},J.prototype.readInt32LE=function(Se,$e){return $e||Nt(Se,4,this.length),this[Se]|this[Se+1]<<8|this[Se+2]<<16|this[Se+3]<<24},J.prototype.readInt32BE=function(Se,$e){return $e||Nt(Se,4,this.length),this[Se]<<24|this[Se+1]<<16|this[Se+2]<<8|this[Se+3]},J.prototype.readFloatLE=function(Se,$e){return $e||Nt(Se,4,this.length),U.read(this,Se,!0,23,4)},J.prototype.readFloatBE=function(Se,$e){return $e||Nt(Se,4,this.length),U.read(this,Se,!1,23,4)},J.prototype.readDoubleLE=function(Se,$e){return $e||Nt(Se,8,this.length),U.read(this,Se,!0,52,8)},J.prototype.readDoubleBE=function(Se,$e){return $e||Nt(Se,8,this.length),U.read(this,Se,!1,52,8)};function zt(Pe,Se,$e,Ue,Qe,mt){if(!J.isBuffer(Pe))throw new TypeError('"buffer" argument must be a Buffer instance');if(Se>Qe||SePe.length)throw new RangeError("Index out of range")}J.prototype.writeUIntLE=function(Se,$e,Ue,Qe){if(Se=+Se,$e=$e|0,Ue=Ue|0,!Qe){var mt=Math.pow(2,8*Ue)-1;zt(this,Se,$e,Ue,mt,0)}var ht=1,at=0;for(this[$e]=Se&255;++at=0&&(at*=256);)this[$e+ht]=Se/at&255;return $e+Ue},J.prototype.writeUInt8=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,1,255,0),J.TYPED_ARRAY_SUPPORT||(Se=Math.floor(Se)),this[$e]=Se&255,$e+1};function Ht(Pe,Se,$e,Ue){Se<0&&(Se=65535+Se+1);for(var Qe=0,mt=Math.min(Pe.length-$e,2);Qe>>(Ue?Qe:1-Qe)*8}J.prototype.writeUInt16LE=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,2,65535,0),J.TYPED_ARRAY_SUPPORT?(this[$e]=Se&255,this[$e+1]=Se>>>8):Ht(this,Se,$e,!0),$e+2},J.prototype.writeUInt16BE=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,2,65535,0),J.TYPED_ARRAY_SUPPORT?(this[$e]=Se>>>8,this[$e+1]=Se&255):Ht(this,Se,$e,!1),$e+2};function qt(Pe,Se,$e,Ue){Se<0&&(Se=4294967295+Se+1);for(var Qe=0,mt=Math.min(Pe.length-$e,4);Qe>>(Ue?Qe:3-Qe)*8&255}J.prototype.writeUInt32LE=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,4,4294967295,0),J.TYPED_ARRAY_SUPPORT?(this[$e+3]=Se>>>24,this[$e+2]=Se>>>16,this[$e+1]=Se>>>8,this[$e]=Se&255):qt(this,Se,$e,!0),$e+4},J.prototype.writeUInt32BE=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,4,4294967295,0),J.TYPED_ARRAY_SUPPORT?(this[$e]=Se>>>24,this[$e+1]=Se>>>16,this[$e+2]=Se>>>8,this[$e+3]=Se&255):qt(this,Se,$e,!1),$e+4},J.prototype.writeIntLE=function(Se,$e,Ue,Qe){if(Se=+Se,$e=$e|0,!Qe){var mt=Math.pow(2,8*Ue-1);zt(this,Se,$e,Ue,mt-1,-mt)}var ht=0,at=1,ut=0;for(this[$e]=Se&255;++ht>0)-ut&255;return $e+Ue},J.prototype.writeIntBE=function(Se,$e,Ue,Qe){if(Se=+Se,$e=$e|0,!Qe){var mt=Math.pow(2,8*Ue-1);zt(this,Se,$e,Ue,mt-1,-mt)}var ht=Ue-1,at=1,ut=0;for(this[$e+ht]=Se&255;--ht>=0&&(at*=256);)Se<0&&ut===0&&this[$e+ht+1]!==0&&(ut=1),this[$e+ht]=(Se/at>>0)-ut&255;return $e+Ue},J.prototype.writeInt8=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,1,127,-128),J.TYPED_ARRAY_SUPPORT||(Se=Math.floor(Se)),Se<0&&(Se=255+Se+1),this[$e]=Se&255,$e+1},J.prototype.writeInt16LE=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,2,32767,-32768),J.TYPED_ARRAY_SUPPORT?(this[$e]=Se&255,this[$e+1]=Se>>>8):Ht(this,Se,$e,!0),$e+2},J.prototype.writeInt16BE=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,2,32767,-32768),J.TYPED_ARRAY_SUPPORT?(this[$e]=Se>>>8,this[$e+1]=Se&255):Ht(this,Se,$e,!1),$e+2},J.prototype.writeInt32LE=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,4,2147483647,-2147483648),J.TYPED_ARRAY_SUPPORT?(this[$e]=Se&255,this[$e+1]=Se>>>8,this[$e+2]=Se>>>16,this[$e+3]=Se>>>24):qt(this,Se,$e,!0),$e+4},J.prototype.writeInt32BE=function(Se,$e,Ue){return Se=+Se,$e=$e|0,Ue||zt(this,Se,$e,4,2147483647,-2147483648),Se<0&&(Se=4294967295+Se+1),J.TYPED_ARRAY_SUPPORT?(this[$e]=Se>>>24,this[$e+1]=Se>>>16,this[$e+2]=Se>>>8,this[$e+3]=Se&255):qt(this,Se,$e,!1),$e+4};function Qt(Pe,Se,$e,Ue,Qe,mt){if($e+Ue>Pe.length)throw new RangeError("Index out of range");if($e<0)throw new RangeError("Index out of range")}function Jt(Pe,Se,$e,Ue,Qe){return Qe||Qt(Pe,Se,$e,4),U.write(Pe,Se,$e,Ue,23,4),$e+4}J.prototype.writeFloatLE=function(Se,$e,Ue){return Jt(this,Se,$e,!0,Ue)},J.prototype.writeFloatBE=function(Se,$e,Ue){return Jt(this,Se,$e,!1,Ue)};function yn(Pe,Se,$e,Ue,Qe){return Qe||Qt(Pe,Se,$e,8),U.write(Pe,Se,$e,Ue,52,8),$e+8}J.prototype.writeDoubleLE=function(Se,$e,Ue){return yn(this,Se,$e,!0,Ue)},J.prototype.writeDoubleBE=function(Se,$e,Ue){return yn(this,Se,$e,!1,Ue)},J.prototype.copy=function(Se,$e,Ue,Qe){if(Ue||(Ue=0),!Qe&&Qe!==0&&(Qe=this.length),$e>=Se.length&&($e=Se.length),$e||($e=0),Qe>0&&Qe=this.length)throw new RangeError("sourceStart out of bounds");if(Qe<0)throw new RangeError("sourceEnd out of bounds");Qe>this.length&&(Qe=this.length),Se.length-$e=0;--ht)Se[ht+$e]=this[ht+Ue];else if(mt<1e3||!J.TYPED_ARRAY_SUPPORT)for(ht=0;ht>>0,Ue=Ue===void 0?this.length:Ue>>>0,Se||(Se=0);var ht;if(typeof Se=="number")for(ht=$e;ht55295&&$e<57344){if(!Qe){if($e>56319){(Se-=3)>-1&&mt.push(239,191,189);continue}else if(ht+1===Ue){(Se-=3)>-1&&mt.push(239,191,189);continue}Qe=$e;continue}if($e<56320){(Se-=3)>-1&&mt.push(239,191,189),Qe=$e;continue}$e=(Qe-55296<<10|$e-56320)+65536}else Qe&&(Se-=3)>-1&&mt.push(239,191,189);if(Qe=null,$e<128){if((Se-=1)<0)break;mt.push($e)}else if($e<2048){if((Se-=2)<0)break;mt.push($e>>6|192,$e&63|128)}else if($e<65536){if((Se-=3)<0)break;mt.push($e>>12|224,$e>>6&63|128,$e&63|128)}else if($e<1114112){if((Se-=4)<0)break;mt.push($e>>18|240,$e>>12&63|128,$e>>6&63|128,$e&63|128)}else throw new Error("Invalid code point")}return mt}function dn(Pe){for(var Se=[],$e=0;$e>8,Qe=$e%256,mt.push(Qe),mt.push(Ue);return mt}function Ye(Pe){return j.toByteArray(Hn(Pe))}function _t(Pe,Se,$e,Ue){for(var Qe=0;Qe=Se.length||Qe>=Pe.length);++Qe)Se[Qe+$e]=Pe[Qe];return Qe}function We(Pe){return Pe!==Pe}},function(I,N){N.byteLength=J,N.toByteArray=ee,N.fromByteArray=se;for(var B=[],j=[],U=typeof Uint8Array<"u"?Uint8Array:Array,q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y=0,K=q.length;Y0)throw new Error("Invalid string. Length must be a multiple of 4");var ge=ne.indexOf("=");ge===-1&&(ge=le);var ue=ge===le?0:4-ge%4;return[ge,ue]}function J(ne){var le=G(ne),ge=le[0],ue=le[1];return(ge+ue)*3/4-ue}function Z(ne,le,ge){return(le+ge)*3/4-ge}function ee(ne){for(var le,ge=G(ne),ue=ge[0],_e=ge[1],fe=new U(Z(ne,ue,_e)),me=0,ve=_e>0?ue-4:ue,xe=0;xe>16&255,fe[me++]=le>>8&255,fe[me++]=le&255;return _e===2&&(le=j[ne.charCodeAt(xe)]<<2|j[ne.charCodeAt(xe+1)]>>4,fe[me++]=le&255),_e===1&&(le=j[ne.charCodeAt(xe)]<<10|j[ne.charCodeAt(xe+1)]<<4|j[ne.charCodeAt(xe+2)]>>2,fe[me++]=le>>8&255,fe[me++]=le&255),fe}function te(ne){return B[ne>>18&63]+B[ne>>12&63]+B[ne>>6&63]+B[ne&63]}function re(ne,le,ge){for(var ue,_e=[],fe=le;feve?ve:me+fe));return ue===1?(le=ne[ge-1],_e.push(B[le>>2]+B[le<<4&63]+"==")):ue===2&&(le=(ne[ge-2]<<8)+ne[ge-1],_e.push(B[le>>10]+B[le>>4&63]+B[le<<2&63]+"=")),_e.join("")}},function(I,N){N.read=function(B,j,U,q,Y){var K,G,J=Y*8-q-1,Z=(1<>1,te=-7,re=U?Y-1:0,se=U?-1:1,ne=B[j+re];for(re+=se,K=ne&(1<<-te)-1,ne>>=-te,te+=J;te>0;K=K*256+B[j+re],re+=se,te-=8);for(G=K&(1<<-te)-1,K>>=-te,te+=q;te>0;G=G*256+B[j+re],re+=se,te-=8);if(K===0)K=1-ee;else{if(K===Z)return G?NaN:(ne?-1:1)*(1/0);G=G+Math.pow(2,q),K=K-ee}return(ne?-1:1)*G*Math.pow(2,K-q)},N.write=function(B,j,U,q,Y,K){var G,J,Z,ee=K*8-Y-1,te=(1<>1,se=Y===23?Math.pow(2,-24)-Math.pow(2,-77):0,ne=q?0:K-1,le=q?1:-1,ge=j<0||j===0&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(J=isNaN(j)?1:0,G=te):(G=Math.floor(Math.log(j)/Math.LN2),j*(Z=Math.pow(2,-G))<1&&(G--,Z*=2),G+re>=1?j+=se/Z:j+=se*Math.pow(2,1-re),j*Z>=2&&(G++,Z/=2),G+re>=te?(J=0,G=te):G+re>=1?(J=(j*Z-1)*Math.pow(2,Y),G=G+re):(J=j*Math.pow(2,re-1)*Math.pow(2,Y),G=0));Y>=8;B[U+ne]=J&255,ne+=le,J/=256,Y-=8);for(G=G<0;B[U+ne]=G&255,ne+=le,G/=256,ee-=8);B[U+ne-le]|=ge*128}},function(I,N){var B={}.toString;I.exports=Array.isArray||function(j){return B.call(j)=="[object Array]"}},function(I,N,B){var j=this&&this.__extends||function(Z,ee){for(var te in ee)ee.hasOwnProperty(te)&&(Z[te]=ee[te]);function re(){this.constructor=Z}Z.prototype=ee===null?Object.create(ee):(re.prototype=ee.prototype,new re)},U=B(24),q=B(12),Y=B(8),K=B(9),G=B(2),J=function(Z){j(ee,Z);function ee(te,re){var se=this;Z.call(this),this.key=te,this.options=re||{},this.state="initialized",this.connection=null,this.usingTLS=!!re.useTLS,this.timeline=this.options.timeline,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var ne=G.default.getNetwork();ne.bind("online",function(){se.timeline.info({netinfo:"online"}),(se.state==="connecting"||se.state==="unavailable")&&se.retryIn(0)}),ne.bind("offline",function(){se.timeline.info({netinfo:"offline"}),se.connection&&se.sendActivityCheck()}),this.updateStrategy()}return ee.prototype.connect=function(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}},ee.prototype.send=function(te){return this.connection?this.connection.send(te):!1},ee.prototype.send_event=function(te,re,se){return this.connection?this.connection.send_event(te,re,se):!1},ee.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},ee.prototype.isUsingTLS=function(){return this.usingTLS},ee.prototype.startConnecting=function(){var te=this,re=function(se,ne){se?te.runner=te.strategy.connect(0,re):ne.action==="error"?(te.emit("error",{type:"HandshakeError",error:ne.error}),te.timeline.error({handshakeError:ne.error})):(te.abortConnecting(),te.handshakeCallbacks[ne.action](ne))};this.runner=this.strategy.connect(0,re)},ee.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},ee.prototype.disconnectInternally=function(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var te=this.abandonConnection();te.close()}},ee.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},ee.prototype.retryIn=function(te){var re=this;this.timeline.info({action:"retry",delay:te}),te>0&&this.emit("connecting_in",Math.round(te/1e3)),this.retryTimer=new q.OneOffTimer(te||0,function(){re.disconnectInternally(),re.connect()})},ee.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},ee.prototype.setUnavailableTimer=function(){var te=this;this.unavailableTimer=new q.OneOffTimer(this.options.unavailableTimeout,function(){te.updateState("unavailable")})},ee.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},ee.prototype.sendActivityCheck=function(){var te=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new q.OneOffTimer(this.options.pongTimeout,function(){te.timeline.error({pong_timed_out:te.options.pongTimeout}),te.retryIn(0)})},ee.prototype.resetActivityCheck=function(){var te=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new q.OneOffTimer(this.activityTimeout,function(){te.sendActivityCheck()}))},ee.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},ee.prototype.buildConnectionCallbacks=function(te){var re=this;return K.extend({},te,{message:function(se){re.resetActivityCheck(),re.emit("message",se)},ping:function(){re.send_event("pusher:pong",{})},activity:function(){re.resetActivityCheck()},error:function(se){re.emit("error",{type:"WebSocketError",error:se})},closed:function(){re.abandonConnection(),re.shouldRetry()&&re.retryIn(1e3)}})},ee.prototype.buildHandshakeCallbacks=function(te){var re=this;return K.extend({},te,{connected:function(se){re.activityTimeout=Math.min(re.options.activityTimeout,se.activityTimeout,se.connection.activityTimeout||1/0),re.clearUnavailableTimer(),re.setConnection(se.connection),re.socket_id=re.connection.id,re.updateState("connected",{socket_id:re.socket_id})}})},ee.prototype.buildErrorCallbacks=function(){var te=this,re=function(se){return function(ne){ne.error&&te.emit("error",{type:"WebSocketError",error:ne.error}),se(ne)}};return{tls_only:re(function(){te.usingTLS=!0,te.updateStrategy(),te.retryIn(0)}),refused:re(function(){te.disconnect()}),backoff:re(function(){te.retryIn(1e3)}),retry:re(function(){te.retryIn(0)})}},ee.prototype.setConnection=function(te){this.connection=te;for(var re in this.connectionCallbacks)this.connection.bind(re,this.connectionCallbacks[re]);this.resetActivityCheck()},ee.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var te in this.connectionCallbacks)this.connection.unbind(te,this.connectionCallbacks[te]);var re=this.connection;return this.connection=null,re}},ee.prototype.updateState=function(te,re){var se=this.state;if(this.state=te,se!==te){var ne=te;ne==="connected"&&(ne+=" with new socket ID "+re.socket_id),Y.default.debug("State changed",se+" -> "+ne),this.timeline.info({state:te,params:re}),this.emit("state_change",{previous:se,current:te}),this.emit(te,re)}},ee.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},ee}(U.default);N.__esModule=!0,N.default=J},function(I,N,B){var j=B(9),U=B(43),q=B(31),Y=function(){function G(){this.channels={}}return G.prototype.add=function(J,Z){return this.channels[J]||(this.channels[J]=K(J,Z)),this.channels[J]},G.prototype.all=function(){return j.values(this.channels)},G.prototype.find=function(J){return this.channels[J]},G.prototype.remove=function(J){var Z=this.channels[J];return delete this.channels[J],Z},G.prototype.disconnect=function(){j.objectApply(this.channels,function(J){J.disconnect()})},G}();N.__esModule=!0,N.default=Y;function K(G,J){if(G.indexOf("private-encrypted-")===0){if(navigator.product=="ReactNative"){var Z="Encrypted channels are not yet supported when using React Native builds.";throw new q.UnsupportedFeature(Z)}return U.default.createEncryptedChannel(G,J)}else return G.indexOf("private-")===0?U.default.createPrivateChannel(G,J):G.indexOf("presence-")===0?U.default.createPresenceChannel(G,J):U.default.createChannel(G,J)}},function(I,N,B){var j=B(43),U=B(11),q=B(31),Y=B(9),K=function(){function J(Z,ee,te,re){this.name=Z,this.priority=ee,this.transport=te,this.options=re||{}}return J.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},J.prototype.connect=function(Z,ee){var te=this;if(this.isSupported()){if(this.priority0&&(te=new q.OneOffTimer(Z.timeout,function(){re.abort(),ee(!0)})),re=G.connect(J,function(se,ne){se&&te&&te.isRunning()&&!Z.failFast||(te&&te.ensureAborted(),ee(se,ne))}),{abort:function(){te&&te.ensureAborted(),re.abort()},forceMinPriority:function(se){re.forceMinPriority(se)}}},K}();N.__esModule=!0,N.default=Y},function(I,N,B){var j=B(9),U=B(11),q=function(){function J(Z){this.strategies=Z}return J.prototype.isSupported=function(){return j.any(this.strategies,U.default.method("isSupported"))},J.prototype.connect=function(Z,ee){return Y(this.strategies,Z,function(te,re){return function(se,ne){if(re[te].error=se,se){K(re)&&ee(!0);return}j.apply(re,function(le){le.forceMinPriority(ne.transport.priority)}),ee(null,ne)}})},J}();N.__esModule=!0,N.default=q;function Y(J,Z,ee){var te=j.map(J,function(re,se,ne,le){return re.connect(Z,ee(se,le))});return{abort:function(){j.apply(te,G)},forceMinPriority:function(re){j.apply(te,function(se){se.forceMinPriority(re)})}}}function K(J){return j.all(J,function(Z){return!!Z.error})}function G(J){!J.error&&!J.aborted&&(J.abort(),J.aborted=!0)}},function(I,N,B){var j=B(11),U=B(2),q=B(65),Y=B(9),K=function(){function te(re,se,ne){this.strategy=re,this.transports=se,this.ttl=ne.ttl||1800*1e3,this.usingTLS=ne.useTLS,this.timeline=ne.timeline}return te.prototype.isSupported=function(){return this.strategy.isSupported()},te.prototype.connect=function(re,se){var ne=this.usingTLS,le=J(ne),ge=[this.strategy];if(le&&le.timestamp+this.ttl>=j.default.now()){var ue=this.transports[le.transport];ue&&(this.timeline.info({cached:!0,transport:le.transport,latency:le.latency}),ge.push(new q.default([ue],{timeout:le.latency*2+1e3,failFast:!0})))}var _e=j.default.now(),fe=ge.pop().connect(re,function me(ve,xe){ve?(ee(ne),ge.length>0?(_e=j.default.now(),fe=ge.pop().connect(re,me)):se(ve)):(Z(ne,xe.transport.name,j.default.now()-_e),se(null,xe))});return{abort:function(){fe.abort()},forceMinPriority:function(me){re=me,fe&&fe.forceMinPriority(me)}}},te}();N.__esModule=!0,N.default=K;function G(te){return"pusherTransport"+(te?"TLS":"NonTLS")}function J(te){var re=U.default.getLocalStorage();if(re)try{var se=re[G(te)];if(se)return JSON.parse(se)}catch{ee(te)}return null}function Z(te,re,se){var ne=U.default.getLocalStorage();if(ne)try{ne[G(te)]=Y.safeJSONStringify({timestamp:j.default.now(),transport:re,latency:se})}catch{}}function ee(te){var re=U.default.getLocalStorage();if(re)try{delete re[G(te)]}catch{}}},function(I,N,B){var j=B(12),U=function(){function q(Y,K){var G=K.delay;this.strategy=Y,this.options={delay:G}}return q.prototype.isSupported=function(){return this.strategy.isSupported()},q.prototype.connect=function(Y,K){var G=this.strategy,J,Z=new j.OneOffTimer(this.options.delay,function(){J=G.connect(Y,K)});return{abort:function(){Z.ensureAborted(),J&&J.abort()},forceMinPriority:function(ee){Y=ee,J&&J.forceMinPriority(ee)}}},q}();N.__esModule=!0,N.default=U},function(I,N){var B=function(){function j(U,q,Y){this.test=U,this.trueBranch=q,this.falseBranch=Y}return j.prototype.isSupported=function(){var U=this.test()?this.trueBranch:this.falseBranch;return U.isSupported()},j.prototype.connect=function(U,q){var Y=this.test()?this.trueBranch:this.falseBranch;return Y.connect(U,q)},j}();N.__esModule=!0,N.default=B},function(I,N){var B=function(){function j(U){this.strategy=U}return j.prototype.isSupported=function(){return this.strategy.isSupported()},j.prototype.connect=function(U,q){var Y=this.strategy.connect(U,function(K,G){G&&Y.abort(),q(K,G)});return Y},j}();N.__esModule=!0,N.default=B},function(I,N,B){var j=B(5);N.getGlobalConfig=function(){return{wsHost:j.default.host,wsPort:j.default.ws_port,wssPort:j.default.wss_port,wsPath:j.default.ws_path,httpHost:j.default.sockjs_host,httpPort:j.default.sockjs_http_port,httpsPort:j.default.sockjs_https_port,httpPath:j.default.sockjs_path,statsHost:j.default.stats_host,authEndpoint:j.default.channel_auth_endpoint,authTransport:j.default.channel_auth_transport,activity_timeout:j.default.activity_timeout,pong_timeout:j.default.pong_timeout,unavailable_timeout:j.default.unavailable_timeout}},N.getClusterConfig=function(U){return{wsHost:"ws-"+U+".pusher.com",httpHost:"sockjs-"+U+".pusher.com"}}}])})})(pusher);var pusherExports=pusher.exports;const Pusher$1=getDefaultExportFromCjs(pusherExports);window.Pusher=Pusher$1;class Echo{constructor(){this.configCallbacks=[],this.bootedCallbacks=[]}config($){this.configCallbacks.push($)}booted($){this.bootedCallbacks.push($)}start(){let $={broadcaster:"pusher",key:Statamic.$config.get("broadcasting.pusher.key"),cluster:Statamic.$config.get("broadcasting.pusher.cluster"),encrypted:Statamic.$config.get("broadcasting.pusher.encrypted"),csrfToken:Statamic.$config.get("csrfToken"),authEndpoint:Statamic.$config.get("broadcasting.endpoint")};this.configCallbacks.forEach(I=>$=I($)),this.echo=new Echo$1($),this.bootedCallbacks.forEach(I=>I(this)),this.bootedCallbacks=[]}}["channel","connect","disconnect","join","leave","leaveChannel","listen","private","socketId","registerInterceptors","registerVueRequestInterceptor","registerAxiosRequestInterceptor","registerjQueryAjaxSetup"].forEach(M=>{Echo.prototype[M]=function(...$){return this.echo[M](...$)}});function OrderedMap(M){this.content=M}OrderedMap.prototype={constructor:OrderedMap,find:function(M){for(var $=0;$>1}};OrderedMap.from=function(M){if(M instanceof OrderedMap)return M;var $=[];if(M)for(var I in M)$.push(I,M[I]);return new OrderedMap($)};function findDiffStart(M,$,I){for(let N=0;;N++){if(N==M.childCount||N==$.childCount)return M.childCount==$.childCount?null:I;let B=M.child(N),j=$.child(N);if(B==j){I+=B.nodeSize;continue}if(!B.sameMarkup(j))return I;if(B.isText&&B.text!=j.text){for(let U=0;B.text[U]==j.text[U];U++)I++;return I}if(B.content.size||j.content.size){let U=findDiffStart(B.content,j.content,I+1);if(U!=null)return U}I+=B.nodeSize}}function findDiffEnd(M,$,I,N){for(let B=M.childCount,j=$.childCount;;){if(B==0||j==0)return B==j?null:{a:I,b:N};let U=M.child(--B),q=$.child(--j),Y=U.nodeSize;if(U==q){I-=Y,N-=Y;continue}if(!U.sameMarkup(q))return{a:I,b:N};if(U.isText&&U.text!=q.text){let K=0,G=Math.min(U.text.length,q.text.length);for(;K$&&N(Y,B+q,j||null,U)!==!1&&Y.content.size){let G=q+1;Y.nodesBetween(Math.max(0,$-G),Math.min(Y.content.size,I-G),N,B+G)}q=K}}descendants($){this.nodesBetween(0,this.size,$)}textBetween($,I,N,B){let j="",U=!0;return this.nodesBetween($,I,(q,Y)=>{q.isText?(j+=q.text.slice(Math.max($,Y)-Y,I-Y),U=!N):q.isLeaf?(B?j+=typeof B=="function"?B(q):B:q.type.spec.leafText&&(j+=q.type.spec.leafText(q)),U=!N):!U&&q.isBlock&&(j+=N,U=!0)},0),j}append($){if(!$.size)return this;if(!this.size)return $;let I=this.lastChild,N=$.firstChild,B=this.content.slice(),j=0;for(I.isText&&I.sameMarkup(N)&&(B[B.length-1]=I.withText(I.text+N.text),j=1);j<$.content.length;j++)B.push($.content[j]);return new Fragment(B,this.size+$.size)}cut($,I=this.size){if($==0&&I==this.size)return this;let N=[],B=0;if(I>$)for(let j=0,U=0;U$&&((U<$||Y>I)&&(q.isText?q=q.cut(Math.max(0,$-U),Math.min(q.text.length,I-U)):q=q.cut(Math.max(0,$-U-1),Math.min(q.content.size,I-U-1))),N.push(q),B+=q.nodeSize),U=Y}return new Fragment(N,B)}cutByIndex($,I){return $==I?Fragment.empty:$==0&&I==this.content.length?this:new Fragment(this.content.slice($,I))}replaceChild($,I){let N=this.content[$];if(N==I)return this;let B=this.content.slice(),j=this.size+I.nodeSize-N.nodeSize;return B[$]=I,new Fragment(B,j)}addToStart($){return new Fragment([$].concat(this.content),this.size+$.nodeSize)}addToEnd($){return new Fragment(this.content.concat($),this.size+$.nodeSize)}eq($){if(this.content.length!=$.content.length)return!1;for(let I=0;Ithis.size||$<0)throw new RangeError(`Position ${$} outside of fragment (${this})`);for(let N=0,B=0;;N++){let j=this.child(N),U=B+j.nodeSize;if(U>=$)return U==$||I>0?retIndex(N+1,U):retIndex(N,B);B=U}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map($=>$.toJSON()):null}static fromJSON($,I){if(!I)return Fragment.empty;if(!Array.isArray(I))throw new RangeError("Invalid input for Fragment.fromJSON");return new Fragment(I.map($.nodeFromJSON))}static fromArray($){if(!$.length)return Fragment.empty;let I,N=0;for(let B=0;B<$.length;B++){let j=$[B];N+=j.nodeSize,B&&j.isText&&$[B-1].sameMarkup(j)?(I||(I=$.slice(0,B)),I[I.length-1]=j.withText(I[I.length-1].text+j.text)):I&&I.push(j)}return new Fragment(I||$,N)}static from($){if(!$)return Fragment.empty;if($ instanceof Fragment)return $;if(Array.isArray($))return this.fromArray($);if($.attrs)return new Fragment([$],$.nodeSize);throw new RangeError("Can not convert "+$+" to a Fragment"+($.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Fragment.empty=new Fragment([],0);const found={index:0,offset:0};function retIndex(M,$){return found.index=M,found.offset=$,found}function compareDeep(M,$){if(M===$)return!0;if(!(M&&typeof M=="object")||!($&&typeof $=="object"))return!1;let I=Array.isArray(M);if(Array.isArray($)!=I)return!1;if(I){if(M.length!=$.length)return!1;for(let N=0;Nthis.type.rank&&(I||(I=$.slice(0,B)),I.push(this),N=!0),I&&I.push(j)}}return I||(I=$.slice()),N||I.push(this),I}removeFromSet($){for(let I=0;I<$.length;I++)if(this.eq($[I]))return $.slice(0,I).concat($.slice(I+1));return $}isInSet($){for(let I=0;I<$.length;I++)if(this.eq($[I]))return!0;return!1}eq($){return this==$||this.type==$.type&&compareDeep(this.attrs,$.attrs)}toJSON(){let $={type:this.type.name};for(let I in this.attrs){$.attrs=this.attrs;break}return $}static fromJSON($,I){if(!I)throw new RangeError("Invalid input for Mark.fromJSON");let N=$.marks[I.type];if(!N)throw new RangeError(`There is no mark type ${I.type} in this schema`);return N.create(I.attrs)}static sameSet($,I){if($==I)return!0;if($.length!=I.length)return!1;for(let N=0;N<$.length;N++)if(!$[N].eq(I[N]))return!1;return!0}static setFrom($){if(!$||Array.isArray($)&&$.length==0)return ql.none;if($ instanceof ql)return[$];let I=$.slice();return I.sort((N,B)=>N.type.rank-B.type.rank),I}};Mark$1.none=[];class ReplaceError extends Error{}class Slice{constructor($,I,N){this.content=$,this.openStart=I,this.openEnd=N}get size(){return this.content.size-this.openStart-this.openEnd}insertAt($,I){let N=insertInto(this.content,$+this.openStart,I);return N&&new Slice(N,this.openStart,this.openEnd)}removeBetween($,I){return new Slice(removeRange(this.content,$+this.openStart,I+this.openStart),this.openStart,this.openEnd)}eq($){return this.content.eq($.content)&&this.openStart==$.openStart&&this.openEnd==$.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let $={content:this.content.toJSON()};return this.openStart>0&&($.openStart=this.openStart),this.openEnd>0&&($.openEnd=this.openEnd),$}static fromJSON($,I){if(!I)return Slice.empty;let N=I.openStart||0,B=I.openEnd||0;if(typeof N!="number"||typeof B!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Slice(Fragment.fromJSON($,I.content),N,B)}static maxOpen($,I=!0){let N=0,B=0;for(let j=$.firstChild;j&&!j.isLeaf&&(I||!j.type.spec.isolating);j=j.firstChild)N++;for(let j=$.lastChild;j&&!j.isLeaf&&(I||!j.type.spec.isolating);j=j.lastChild)B++;return new Slice($,N,B)}}Slice.empty=new Slice(Fragment.empty,0,0);function removeRange(M,$,I){let{index:N,offset:B}=M.findIndex($),j=M.maybeChild(N),{index:U,offset:q}=M.findIndex(I);if(B==$||j.isText){if(q!=I&&!M.child(U).isText)throw new RangeError("Removing non-flat range");return M.cut(0,$).append(M.cut(I))}if(N!=U)throw new RangeError("Removing non-flat range");return M.replaceChild(N,j.copy(removeRange(j.content,$-B-1,I-B-1)))}function insertInto(M,$,I,N){let{index:B,offset:j}=M.findIndex($),U=M.maybeChild(B);if(j==$||U.isText)return N&&!N.canReplace(B,B,I)?null:M.cut(0,$).append(I).append(M.cut($));let q=insertInto(U.content,$-j-1,I);return q&&M.replaceChild(B,U.copy(q))}function replace$1(M,$,I){if(I.openStart>M.depth)throw new ReplaceError("Inserted content deeper than insertion position");if(M.depth-I.openStart!=$.depth-I.openEnd)throw new ReplaceError("Inconsistent open depths");return replaceOuter(M,$,I,0)}function replaceOuter(M,$,I,N){let B=M.index(N),j=M.node(N);if(B==$.index(N)&&N=0&&M.isText&&M.sameMarkup($[I])?$[I]=M.withText($[I].text+M.text):$.push(M)}function addRange(M,$,I,N){let B=($||M).node(I),j=0,U=$?$.index(I):B.childCount;M&&(j=M.index(I),M.depth>I?j++:M.textOffset&&(addNode(M.nodeAfter,N),j++));for(let q=j;qB&&joinable$1(M,$,B+1),U=N.depth>B&&joinable$1(I,N,B+1),q=[];return addRange(null,M,B,q),j&&U&&$.index(B)==I.index(B)?(checkJoin(j,U),addNode(close(j,replaceThreeWay(M,$,I,N,B+1)),q)):(j&&addNode(close(j,replaceTwoWay(M,$,B+1)),q),addRange($,I,B,q),U&&addNode(close(U,replaceTwoWay(I,N,B+1)),q)),addRange(N,null,B,q),new Fragment(q)}function replaceTwoWay(M,$,I){let N=[];if(addRange(null,M,I,N),M.depth>I){let B=joinable$1(M,$,I+1);addNode(close(B,replaceTwoWay(M,$,I+1)),N)}return addRange($,null,I,N),new Fragment(N)}function prepareSliceForReplace(M,$){let I=$.depth-M.openStart,B=$.node(I).copy(M.content);for(let j=I-1;j>=0;j--)B=$.node(j).copy(Fragment.from(B));return{start:B.resolveNoCache(M.openStart+I),end:B.resolveNoCache(B.content.size-M.openEnd-I)}}class ResolvedPos{constructor($,I,N){this.pos=$,this.path=I,this.parentOffset=N,this.depth=I.length/3-1}resolveDepth($){return $==null?this.depth:$<0?this.depth+$:$}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node($){return this.path[this.resolveDepth($)*3]}index($){return this.path[this.resolveDepth($)*3+1]}indexAfter($){return $=this.resolveDepth($),this.index($)+($==this.depth&&!this.textOffset?0:1)}start($){return $=this.resolveDepth($),$==0?0:this.path[$*3-1]+1}end($){return $=this.resolveDepth($),this.start($)+this.node($).content.size}before($){if($=this.resolveDepth($),!$)throw new RangeError("There is no position before the top-level node");return $==this.depth+1?this.pos:this.path[$*3-1]}after($){if($=this.resolveDepth($),!$)throw new RangeError("There is no position after the top-level node");return $==this.depth+1?this.pos:this.path[$*3-1]+this.path[$*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let $=this.parent,I=this.index(this.depth);if(I==$.childCount)return null;let N=this.pos-this.path[this.path.length-1],B=$.child(I);return N?$.child(I).cut(N):B}get nodeBefore(){let $=this.index(this.depth),I=this.pos-this.path[this.path.length-1];return I?this.parent.child($).cut(0,I):$==0?null:this.parent.child($-1)}posAtIndex($,I){I=this.resolveDepth(I);let N=this.path[I*3],B=I==0?0:this.path[I*3-1]+1;for(let j=0;j<$;j++)B+=N.child(j).nodeSize;return B}marks(){let $=this.parent,I=this.index();if($.content.size==0)return Mark$1.none;if(this.textOffset)return $.child(I).marks;let N=$.maybeChild(I-1),B=$.maybeChild(I);if(!N){let q=N;N=B,B=q}let j=N.marks;for(var U=0;U0;I--)if(this.start(I)<=$&&this.end(I)>=$)return I;return 0}blockRange($=this,I){if($.pos=0;N--)if($.pos<=this.end(N)&&(!I||I(this.node(N))))return new NodeRange(this,$,N);return null}sameParent($){return this.pos-this.parentOffset==$.pos-$.parentOffset}max($){return $.pos>this.pos?$:this}min($){return $.pos=0&&I<=$.content.size))throw new RangeError("Position "+I+" out of range");let N=[],B=0,j=I;for(let U=$;;){let{index:q,offset:Y}=U.content.findIndex(j),K=j-Y;if(N.push(U,q,B+Y),!K||(U=U.child(q),U.isText))break;j=K-1,B+=Y+1}return new ResolvedPos(I,N,j)}static resolveCached($,I){for(let B=0;B$&&this.nodesBetween($,I,j=>(N.isInSet(j.marks)&&(B=!0),!B)),B}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let $=this.type.name;return this.content.size&&($+="("+this.content.toStringInner()+")"),wrapMarks(this.marks,$)}contentMatchAt($){let I=this.type.contentMatch.matchFragment(this.content,0,$);if(!I)throw new Error("Called contentMatchAt on a node with invalid content");return I}canReplace($,I,N=Fragment.empty,B=0,j=N.childCount){let U=this.contentMatchAt($).matchFragment(N,B,j),q=U&&U.matchFragment(this.content,I);if(!q||!q.validEnd)return!1;for(let Y=B;YI.type.name)}`);this.content.forEach(I=>I.check())}toJSON(){let $={type:this.type.name};for(let I in this.attrs){$.attrs=this.attrs;break}return this.content.size&&($.content=this.content.toJSON()),this.marks.length&&($.marks=this.marks.map(I=>I.toJSON())),$}static fromJSON($,I){if(!I)throw new RangeError("Invalid input for Node.fromJSON");let N=null;if(I.marks){if(!Array.isArray(I.marks))throw new RangeError("Invalid mark data for Node.fromJSON");N=I.marks.map($.markFromJSON)}if(I.type=="text"){if(typeof I.text!="string")throw new RangeError("Invalid text node in JSON");return $.text(I.text,N)}let B=Fragment.fromJSON($,I.content);return $.nodeType(I.type).create(I.attrs,B,N)}};Node$2.prototype.text=void 0;class TextNode extends Node$2{constructor($,I,N,B){if(super($,I,null,B),!N)throw new RangeError("Empty text nodes are not allowed");this.text=N}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wrapMarks(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween($,I){return this.text.slice($,I)}get nodeSize(){return this.text.length}mark($){return $==this.marks?this:new TextNode(this.type,this.attrs,this.text,$)}withText($){return $==this.text?this:new TextNode(this.type,this.attrs,$,this.marks)}cut($=0,I=this.text.length){return $==0&&I==this.text.length?this:this.withText(this.text.slice($,I))}eq($){return this.sameMarkup($)&&this.text==$.text}toJSON(){let $=super.toJSON();return $.text=this.text,$}}function wrapMarks(M,$){for(let I=M.length-1;I>=0;I--)$=M[I].type.name+"("+$+")";return $}class ContentMatch{constructor($){this.validEnd=$,this.next=[],this.wrapCache=[]}static parse($,I){let N=new TokenStream($,I);if(N.next==null)return ContentMatch.empty;let B=parseExpr(N);N.next&&N.err("Unexpected trailing text");let j=dfa(nfa(B));return checkForDeadEnds(j,N),j}matchType($){for(let I=0;IK.createAndFill()));for(let K=0;K=this.next.length)throw new RangeError(`There's no ${$}th edge in this content match`);return this.next[$]}toString(){let $=[];function I(N){$.push(N);for(let B=0;B{let j=B+(N.validEnd?"*":" ")+" ";for(let U=0;U"+$.indexOf(N.next[U].next);return j}).join(` `)}}ContentMatch.empty=new ContentMatch(!0);class TokenStream{constructor($,I){this.string=$,this.nodeTypes=I,this.inline=null,this.pos=0,this.tokens=$.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat($){return this.next==$&&(this.pos++||!0)}err($){throw new SyntaxError($+" (in content expression '"+this.string+"')")}}function parseExpr(M){let $=[];do $.push(parseExprSeq(M));while(M.eat("|"));return $.length==1?$[0]:{type:"choice",exprs:$}}function parseExprSeq(M){let $=[];do $.push(parseExprSubscript(M));while(M.next&&M.next!=")"&&M.next!="|");return $.length==1?$[0]:{type:"seq",exprs:$}}function parseExprSubscript(M){let $=parseExprAtom(M);for(;;)if(M.eat("+"))$={type:"plus",expr:$};else if(M.eat("*"))$={type:"star",expr:$};else if(M.eat("?"))$={type:"opt",expr:$};else if(M.eat("{"))$=parseExprRange(M,$);else break;return $}function parseNum(M){/\D/.test(M.next)&&M.err("Expected number, got '"+M.next+"'");let $=Number(M.next);return M.pos++,$}function parseExprRange(M,$){let I=parseNum(M),N=I;return M.eat(",")&&(M.next!="}"?N=parseNum(M):N=-1),M.eat("}")||M.err("Unclosed braced range"),{type:"range",min:I,max:N,expr:$}}function resolveName(M,$){let I=M.nodeTypes,N=I[$];if(N)return[N];let B=[];for(let j in I){let U=I[j];U.groups.indexOf($)>-1&&B.push(U)}return B.length==0&&M.err("No node type or group '"+$+"' found"),B}function parseExprAtom(M){if(M.eat("(")){let $=parseExpr(M);return M.eat(")")||M.err("Missing closing paren"),$}else if(/\W/.test(M.next))M.err("Unexpected token '"+M.next+"'");else{let $=resolveName(M,M.next).map(I=>(M.inline==null?M.inline=I.isInline:M.inline!=I.isInline&&M.err("Mixing inline and block content"),{type:"name",value:I}));return M.pos++,$.length==1?$[0]:{type:"choice",exprs:$}}}function nfa(M){let $=[[]];return B(j(M,0),I()),$;function I(){return $.push([])-1}function N(U,q,Y){let K={term:Y,to:q};return $[U].push(K),K}function B(U,q){U.forEach(Y=>Y.to=q)}function j(U,q){if(U.type=="choice")return U.exprs.reduce((Y,K)=>Y.concat(j(K,q)),[]);if(U.type=="seq")for(let Y=0;;Y++){let K=j(U.exprs[Y],q);if(Y==U.exprs.length-1)return K;B(K,q=I())}else if(U.type=="star"){let Y=I();return N(q,Y),B(j(U.expr,Y),Y),[N(Y)]}else if(U.type=="plus"){let Y=I();return B(j(U.expr,q),Y),B(j(U.expr,Y),Y),[N(Y)]}else{if(U.type=="opt")return[N(q)].concat(j(U.expr,q));if(U.type=="range"){let Y=q;for(let K=0;K{M[U].forEach(({term:q,to:Y})=>{if(!q)return;let K;for(let G=0;G{K||B.push([q,K=[]]),K.indexOf(G)==-1&&K.push(G)})})});let j=$[N.join(",")]=new ContentMatch(N.indexOf(M.length-1)>-1);for(let U=0;U-1}allowsMarks($){if(this.markSet==null)return!0;for(let I=0;I<$.length;I++)if(!this.allowsMarkType($[I].type))return!1;return!0}allowedMarks($){if(this.markSet==null)return $;let I;for(let N=0;N<$.length;N++)this.allowsMarkType($[N].type)?I&&I.push($[N]):I||(I=$.slice(0,N));return I?I.length?I:Mark$1.none:$}static compile($,I){let N=Object.create(null);$.forEach((j,U)=>N[j]=new kc(j,I,U));let B=I.spec.topNode||"doc";if(!N[B])throw new RangeError("Schema is missing its top node type ('"+B+"')");if(!N.text)throw new RangeError("Every schema needs a 'text' type");for(let j in N.text.attrs)throw new RangeError("The text node type should not have attributes");return N}};class Attribute{constructor($){this.hasDefault=Object.prototype.hasOwnProperty.call($,"default"),this.default=$.default}get isRequired(){return!this.hasDefault}}class MarkType{constructor($,I,N,B){this.name=$,this.rank=I,this.schema=N,this.spec=B,this.attrs=initAttrs(B.attrs),this.excluded=null;let j=defaultAttrs(this.attrs);this.instance=j?new Mark$1(this,j):null}create($=null){return!$&&this.instance?this.instance:new Mark$1(this,computeAttrs(this.attrs,$))}static compile($,I){let N=Object.create(null),B=0;return $.forEach((j,U)=>N[j]=new MarkType(j,B++,I,U)),N}removeFromSet($){for(var I=0;I<$.length;I++)$[I].type==this&&($=$.slice(0,I).concat($.slice(I+1)),I--);return $}isInSet($){for(let I=0;I<$.length;I++)if($[I].type==this)return $[I]}excludes($){return this.excluded.indexOf($)>-1}}class Schema{constructor($){this.cached=Object.create(null);let I=this.spec={};for(let B in $)I[B]=$[B];I.nodes=OrderedMap.from($.nodes),I.marks=OrderedMap.from($.marks||{}),this.nodes=NodeType$1.compile(this.spec.nodes,this),this.marks=MarkType.compile(this.spec.marks,this);let N=Object.create(null);for(let B in this.nodes){if(B in this.marks)throw new RangeError(B+" can not be both a node and a mark");let j=this.nodes[B],U=j.spec.content||"",q=j.spec.marks;j.contentMatch=N[U]||(N[U]=ContentMatch.parse(U,this.nodes)),j.inlineContent=j.contentMatch.inlineContent,j.markSet=q=="_"?null:q?gatherMarks(this,q.split(" ")):q==""||!j.inlineContent?[]:null}for(let B in this.marks){let j=this.marks[B],U=j.spec.excludes;j.excluded=U==null?[j]:U==""?[]:gatherMarks(this,U.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node($,I=null,N,B){if(typeof $=="string")$=this.nodeType($);else if($ instanceof NodeType$1){if($.schema!=this)throw new RangeError("Node type from different schema used ("+$.name+")")}else throw new RangeError("Invalid node type: "+$);return $.createChecked(I,N,B)}text($,I){let N=this.nodes.text;return new TextNode(N,N.defaultAttrs,$,Mark$1.setFrom(I))}mark($,I){return typeof $=="string"&&($=this.marks[$]),$.create(I)}nodeFromJSON($){return Node$2.fromJSON(this,$)}markFromJSON($){return Mark$1.fromJSON(this,$)}nodeType($){let I=this.nodes[$];if(!I)throw new RangeError("Unknown node type: "+$);return I}}function gatherMarks(M,$){let I=[];for(let N=0;N<$.length;N++){let B=$[N],j=M.marks[B],U=j;if(j)I.push(j);else for(let q in M.marks){let Y=M.marks[q];(B=="_"||Y.spec.group&&Y.spec.group.split(" ").indexOf(B)>-1)&&I.push(U=Y)}if(!U)throw new SyntaxError("Unknown mark type: '"+$[N]+"'")}return I}class DOMParser{constructor($,I){this.schema=$,this.rules=I,this.tags=[],this.styles=[],I.forEach(N=>{N.tag?this.tags.push(N):N.style&&this.styles.push(N)}),this.normalizeLists=!this.tags.some(N=>{if(!/^(ul|ol)\b/.test(N.tag)||!N.node)return!1;let B=$.nodes[N.node];return B.contentMatch.matchType(B)})}parse($,I={}){let N=new ParseContext(this,I,!1);return N.addAll($,I.from,I.to),N.finish()}parseSlice($,I={}){let N=new ParseContext(this,I,!0);return N.addAll($,I.from,I.to),Slice.maxOpen(N.finish())}matchTag($,I,N){for(let B=N?this.tags.indexOf(N)+1:0;B$.length&&(q.charCodeAt($.length)!=61||q.slice($.length+1)!=I))){if(U.getAttrs){let Y=U.getAttrs(I);if(Y===!1)continue;U.attrs=Y||void 0}return U}}}static schemaRules($){let I=[];function N(B){let j=B.priority==null?50:B.priority,U=0;for(;U{N(U=copy(U)),U.mark||U.ignore||U.clearMark||(U.mark=B)})}for(let B in $.nodes){let j=$.nodes[B].spec.parseDOM;j&&j.forEach(U=>{N(U=copy(U)),U.node||U.ignore||U.mark||(U.node=B)})}return I}static fromSchema($){return $.cached.domParser||($.cached.domParser=new DOMParser($,DOMParser.schemaRules($)))}}const blockTags={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ignoreTags={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},listTags={ol:!0,ul:!0},OPT_PRESERVE_WS=1,OPT_PRESERVE_WS_FULL=2,OPT_OPEN_LEFT=4;function wsOptionsFor(M,$,I){return $!=null?($?OPT_PRESERVE_WS:0)|($==="full"?OPT_PRESERVE_WS_FULL:0):M&&M.whitespace=="pre"?OPT_PRESERVE_WS|OPT_PRESERVE_WS_FULL:I&~OPT_OPEN_LEFT}class NodeContext{constructor($,I,N,B,j,U,q){this.type=$,this.attrs=I,this.marks=N,this.pendingMarks=B,this.solid=j,this.options=q,this.content=[],this.activeMarks=Mark$1.none,this.stashMarks=[],this.match=U||(q&OPT_OPEN_LEFT?null:$.contentMatch)}findWrapping($){if(!this.match){if(!this.type)return[];let I=this.type.contentMatch.fillBefore(Fragment.from($));if(I)this.match=this.type.contentMatch.matchFragment(I);else{let N=this.type.contentMatch,B;return(B=N.findWrapping($.type))?(this.match=N,B):null}}return this.match.findWrapping($.type)}finish($){if(!(this.options&OPT_PRESERVE_WS)){let N=this.content[this.content.length-1],B;if(N&&N.isText&&(B=/[ \t\r\n\u000c]+$/.exec(N.text))){let j=N;N.text.length==B[0].length?this.content.pop():this.content[this.content.length-1]=j.withText(j.text.slice(0,j.text.length-B[0].length))}}let I=Fragment.from(this.content);return!$&&this.match&&(I=I.append(this.match.fillBefore(Fragment.empty,!0))),this.type?this.type.create(this.attrs,I,this.marks):I}popFromStashMark($){for(let I=this.stashMarks.length-1;I>=0;I--)if($.eq(this.stashMarks[I]))return this.stashMarks.splice(I,1)[0]}applyPending($){for(let I=0,N=this.pendingMarks;I{U.clearMark(q)&&(N=q.addToSet(N))}):I=this.parser.schema.marks[U.mark].create(U.attrs).addToSet(I),U.consuming===!1)j=U;else break}return[I,N]}addElementByRule($,I,N){let B,j,U;I.node?(j=this.parser.schema.nodes[I.node],j.isLeaf?this.insertNode(j.create(I.attrs))||this.leafFallback($):B=this.enter(j,I.attrs||null,I.preserveWhitespace)):(U=this.parser.schema.marks[I.mark].create(I.attrs),this.addPendingMark(U));let q=this.top;if(j&&j.isLeaf)this.findInside($);else if(N)this.addElement($,N);else if(I.getContent)this.findInside($),I.getContent($,this.parser.schema).forEach(Y=>this.insertNode(Y));else{let Y=$;typeof I.contentElement=="string"?Y=$.querySelector(I.contentElement):typeof I.contentElement=="function"?Y=I.contentElement($):I.contentElement&&(Y=I.contentElement),this.findAround($,Y,!0),this.addAll(Y)}B&&this.sync(q)&&this.open--,U&&this.removePendingMark(U,q)}addAll($,I,N){let B=I||0;for(let j=I?$.childNodes[I]:$.firstChild,U=N==null?null:$.childNodes[N];j!=U;j=j.nextSibling,++B)this.findAtPoint($,B),this.addDOM(j);this.findAtPoint($,B)}findPlace($){let I,N;for(let B=this.open;B>=0;B--){let j=this.nodes[B],U=j.findWrapping($);if(U&&(!I||I.length>U.length)&&(I=U,N=j,!U.length)||j.solid)break}if(!I)return!1;this.sync(N);for(let B=0;Bthis.open){for(;I>this.open;I--)this.nodes[I-1].content.push(this.nodes[I].finish($));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync($){for(let I=this.open;I>=0;I--)if(this.nodes[I]==$)return this.open=I,!0;return!1}get currentPos(){this.closeExtra();let $=0;for(let I=this.open;I>=0;I--){let N=this.nodes[I].content;for(let B=N.length-1;B>=0;B--)$+=N[B].nodeSize;I&&$++}return $}findAtPoint($,I){if(this.find)for(let N=0;N-1)return $.split(/\s*\|\s*/).some(this.matchesContext,this);let I=$.split("/"),N=this.options.context,B=!this.isOpen&&(!N||N.parent.type==this.nodes[0].type),j=-(N?N.depth+1:0)+(B?0:1),U=(q,Y)=>{for(;q>=0;q--){let K=I[q];if(K==""){if(q==I.length-1||q==0)continue;for(;Y>=j;Y--)if(U(q-1,Y))return!0;return!1}else{let G=Y>0||Y==0&&B?this.nodes[Y].type:N&&Y>=j?N.node(Y-j).type:null;if(!G||G.name!=K&&G.groups.indexOf(K)==-1)return!1;Y--}}return!0};return U(I.length-1,this.open)}textblockFromContext(){let $=this.options.context;if($)for(let I=$.depth;I>=0;I--){let N=$.node(I).contentMatchAt($.indexAfter(I)).defaultType;if(N&&N.isTextblock&&N.defaultAttrs)return N}for(let I in this.parser.schema.nodes){let N=this.parser.schema.nodes[I];if(N.isTextblock&&N.defaultAttrs)return N}}addPendingMark($){let I=findSameMarkInSet($,this.top.pendingMarks);I&&this.top.stashMarks.push(I),this.top.pendingMarks=$.addToSet(this.top.pendingMarks)}removePendingMark($,I){for(let N=this.open;N>=0;N--){let B=this.nodes[N];if(B.pendingMarks.lastIndexOf($)>-1)B.pendingMarks=$.removeFromSet(B.pendingMarks);else{B.activeMarks=$.removeFromSet(B.activeMarks);let U=B.popFromStashMark($);U&&B.type&&B.type.allowsMarkType(U.type)&&(B.activeMarks=U.addToSet(B.activeMarks))}if(B==I)break}}}function normalizeList(M){for(let $=M.firstChild,I=null;$;$=$.nextSibling){let N=$.nodeType==1?$.nodeName.toLowerCase():null;N&&listTags.hasOwnProperty(N)&&I?(I.appendChild($),$=I):N=="li"?I=$:N&&(I=null)}}function matches(M,$){return(M.matches||M.msMatchesSelector||M.webkitMatchesSelector||M.mozMatchesSelector).call(M,$)}function parseStyles(M){let $=/\s*([\w-]+)\s*:\s*([^;]+)/g,I,N=[];for(;I=$.exec(M);)N.push(I[1],I[2].trim());return N}function copy(M){let $={};for(let I in M)$[I]=M[I];return $}function markMayApply(M,$){let I=$.schema.nodes;for(let N in I){let B=I[N];if(!B.allowsMarkType(M))continue;let j=[],U=q=>{j.push(q);for(let Y=0;Y{if(j.length||U.marks.length){let q=0,Y=0;for(;q=0;B--){let j=this.serializeMark($.marks[B],$.isInline,I);j&&((j.contentDOM||j.dom).appendChild(N),N=j.dom)}return N}serializeMark($,I,N={}){let B=this.marks[$.type.name];return B&&DOMSerializer.renderSpec(doc$1(N),B($,I))}static renderSpec($,I,N=null){if(typeof I=="string")return{dom:$.createTextNode(I)};if(I.nodeType!=null)return{dom:I};if(I.dom&&I.dom.nodeType!=null)return I;let B=I[0],j=B.indexOf(" ");j>0&&(N=B.slice(0,j),B=B.slice(j+1));let U,q=N?$.createElementNS(N,B):$.createElement(B),Y=I[1],K=1;if(Y&&typeof Y=="object"&&Y.nodeType==null&&!Array.isArray(Y)){K=2;for(let G in Y)if(Y[G]!=null){let J=G.indexOf(" ");J>0?q.setAttributeNS(G.slice(0,J),G.slice(J+1),Y[G]):q.setAttribute(G,Y[G])}}for(let G=K;GK)throw new RangeError("Content hole must be the only child of its parent node");return{dom:q,contentDOM:q}}else{let{dom:Z,contentDOM:ee}=DOMSerializer.renderSpec($,J,N);if(q.appendChild(Z),ee){if(U)throw new RangeError("Multiple content holes");U=ee}}}return{dom:q,contentDOM:U}}static fromSchema($){return $.cached.domSerializer||($.cached.domSerializer=new DOMSerializer(this.nodesFromSchema($),this.marksFromSchema($)))}static nodesFromSchema($){let I=gatherToDOM($.nodes);return I.text||(I.text=N=>N.text),I}static marksFromSchema($){return gatherToDOM($.marks)}}function gatherToDOM(M){let $={};for(let I in M){let N=M[I].spec.toDOM;N&&($[I]=N)}return $}function doc$1(M){return M.document||window.document}const lower16=65535,factor16=Math.pow(2,16);function makeRecover(M,$){return M+$*factor16}function recoverIndex(M){return M&lower16}function recoverOffset(M){return(M-(M&lower16))/factor16}const DEL_BEFORE=1,DEL_AFTER=2,DEL_ACROSS=4,DEL_SIDE=8;class MapResult{constructor($,I,N){this.pos=$,this.delInfo=I,this.recover=N}get deleted(){return(this.delInfo&DEL_SIDE)>0}get deletedBefore(){return(this.delInfo&(DEL_BEFORE|DEL_ACROSS))>0}get deletedAfter(){return(this.delInfo&(DEL_AFTER|DEL_ACROSS))>0}get deletedAcross(){return(this.delInfo&DEL_ACROSS)>0}}class StepMap{constructor($,I=!1){if(this.ranges=$,this.inverted=I,!$.length&&StepMap.empty)return StepMap.empty}recover($){let I=0,N=recoverIndex($);if(!this.inverted)for(let B=0;B$)break;let K=this.ranges[q+j],G=this.ranges[q+U],J=Y+K;if($<=J){let Z=K?$==Y?-1:$==J?1:I:I,ee=Y+B+(Z<0?0:G);if(N)return ee;let te=$==(I<0?Y:J)?null:makeRecover(q/3,$-Y),re=$==Y?DEL_AFTER:$==J?DEL_BEFORE:DEL_ACROSS;return(I<0?$!=Y:$!=J)&&(re|=DEL_SIDE),new MapResult(ee,re,te)}B+=G-K}return N?$+B:new MapResult($+B,0,null)}touches($,I){let N=0,B=recoverIndex(I),j=this.inverted?2:1,U=this.inverted?1:2;for(let q=0;q$)break;let K=this.ranges[q+j],G=Y+K;if($<=G&&q==B*3)return!0;N+=this.ranges[q+U]-K}return!1}forEach($){let I=this.inverted?2:1,N=this.inverted?1:2;for(let B=0,j=0;B=0;I--){let B=$.getMirror(I);this.appendMap($.maps[I].invert(),B!=null&&B>I?N-B-1:void 0)}}invert(){let $=new Mapping;return $.appendMappingInverted(this),$}map($,I=1){if(this.mirror)return this._map($,I,!0);for(let N=this.from;Nj&&Y!U.isAtom||!q.type.allowsMarkType(this.mark.type)?U:U.mark(this.mark.addToSet(U.marks)),B),I.openStart,I.openEnd);return StepResult.fromReplace($,this.from,this.to,j)}invert(){return new RemoveMarkStep(this.from,this.to,this.mark)}map($){let I=$.mapResult(this.from,1),N=$.mapResult(this.to,-1);return I.deleted&&N.deleted||I.pos>=N.pos?null:new AddMarkStep(I.pos,N.pos,this.mark)}merge($){return $ instanceof AddMarkStep&&$.mark.eq(this.mark)&&this.from<=$.to&&this.to>=$.from?new AddMarkStep(Math.min(this.from,$.from),Math.max(this.to,$.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON($,I){if(typeof I.from!="number"||typeof I.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new AddMarkStep(I.from,I.to,$.markFromJSON(I.mark))}}Step.jsonID("addMark",AddMarkStep);class RemoveMarkStep extends Step{constructor($,I,N){super(),this.from=$,this.to=I,this.mark=N}apply($){let I=$.slice(this.from,this.to),N=new Slice(mapFragment(I.content,B=>B.mark(this.mark.removeFromSet(B.marks)),$),I.openStart,I.openEnd);return StepResult.fromReplace($,this.from,this.to,N)}invert(){return new AddMarkStep(this.from,this.to,this.mark)}map($){let I=$.mapResult(this.from,1),N=$.mapResult(this.to,-1);return I.deleted&&N.deleted||I.pos>=N.pos?null:new RemoveMarkStep(I.pos,N.pos,this.mark)}merge($){return $ instanceof RemoveMarkStep&&$.mark.eq(this.mark)&&this.from<=$.to&&this.to>=$.from?new RemoveMarkStep(Math.min(this.from,$.from),Math.max(this.to,$.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON($,I){if(typeof I.from!="number"||typeof I.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new RemoveMarkStep(I.from,I.to,$.markFromJSON(I.mark))}}Step.jsonID("removeMark",RemoveMarkStep);class AddNodeMarkStep extends Step{constructor($,I){super(),this.pos=$,this.mark=I}apply($){let I=$.nodeAt(this.pos);if(!I)return StepResult.fail("No node at mark step's position");let N=I.type.create(I.attrs,null,this.mark.addToSet(I.marks));return StepResult.fromReplace($,this.pos,this.pos+1,new Slice(Fragment.from(N),0,I.isLeaf?0:1))}invert($){let I=$.nodeAt(this.pos);if(I){let N=this.mark.addToSet(I.marks);if(N.length==I.marks.length){for(let B=0;BN.pos?null:new ReplaceAroundStep(I.pos,N.pos,B,j,this.slice,this.insert,this.structure)}toJSON(){let $={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&($.slice=this.slice.toJSON()),this.structure&&($.structure=!0),$}static fromJSON($,I){if(typeof I.from!="number"||typeof I.to!="number"||typeof I.gapFrom!="number"||typeof I.gapTo!="number"||typeof I.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ReplaceAroundStep(I.from,I.to,I.gapFrom,I.gapTo,Slice.fromJSON($,I.slice),I.insert,!!I.structure)}}Step.jsonID("replaceAround",ReplaceAroundStep);function contentBetween(M,$,I){let N=M.resolve($),B=I-$,j=N.depth;for(;B>0&&j>0&&N.indexAfter(j)==N.node(j).childCount;)j--,B--;if(B>0){let U=N.node(j).maybeChild(N.indexAfter(j));for(;B>0;){if(!U||U.isLeaf)return!0;U=U.firstChild,B--}}return!1}function addMark(M,$,I,N){let B=[],j=[],U,q;M.doc.nodesBetween($,I,(Y,K,G)=>{if(!Y.isInline)return;let J=Y.marks;if(!N.isInSet(J)&&G.type.allowsMarkType(N.type)){let Z=Math.max(K,$),ee=Math.min(K+Y.nodeSize,I),te=N.addToSet(J);for(let re=0;reM.step(Y)),j.forEach(Y=>M.step(Y))}function removeMark(M,$,I,N){let B=[],j=0;M.doc.nodesBetween($,I,(U,q)=>{if(!U.isInline)return;j++;let Y=null;if(N instanceof MarkType){let K=U.marks,G;for(;G=N.isInSet(K);)(Y||(Y=[])).push(G),K=G.removeFromSet(K)}else N?N.isInSet(U.marks)&&(Y=[N]):Y=U.marks;if(Y&&Y.length){let K=Math.min(q+U.nodeSize,I);for(let G=0;GM.step(new RemoveMarkStep(U.from,U.to,U.style)))}function clearIncompatible(M,$,I,N=I.contentMatch){let B=M.doc.nodeAt($),j=[],U=$+1;for(let q=0;q=0;q--)M.step(j[q])}function canCut(M,$,I){return($==0||M.canReplace($,M.childCount))&&(I==M.childCount||M.canReplace(0,I))}function liftTarget(M){let I=M.parent.content.cutByIndex(M.startIndex,M.endIndex);for(let N=M.depth;;--N){let B=M.$from.node(N),j=M.$from.index(N),U=M.$to.indexAfter(N);if(NI;te--)re||N.index(te)>0?(re=!0,G=Fragment.from(N.node(te).copy(G)),J++):Y--;let Z=Fragment.empty,ee=0;for(let te=j,re=!1;te>I;te--)re||B.after(te+1)=0;U--){if(N.size){let q=I[U].type.contentMatch.matchFragment(N);if(!q||!q.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}N=Fragment.from(I[U].type.create(I[U].attrs,N))}let B=$.start,j=$.end;M.step(new ReplaceAroundStep(B,j,B,j,new Slice(N,0,0),I.length,!0))}function setBlockType$1(M,$,I,N,B){if(!N.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let j=M.steps.length;M.doc.nodesBetween($,I,(U,q)=>{if(U.isTextblock&&!U.hasMarkup(N,B)&&canChangeType(M.doc,M.mapping.slice(j).map(q),N)){M.clearIncompatible(M.mapping.slice(j).map(q,1),N);let Y=M.mapping.slice(j),K=Y.map(q,1),G=Y.map(q+U.nodeSize,1);return M.step(new ReplaceAroundStep(K,G,K+1,G-1,new Slice(Fragment.from(N.create(B,null,U.marks)),0,0),1,!0)),!1}})}function canChangeType(M,$,I){let N=M.resolve($),B=N.index();return N.parent.canReplaceWith(B,B+1,I)}function setNodeMarkup(M,$,I,N,B){let j=M.doc.nodeAt($);if(!j)throw new RangeError("No node at given position");I||(I=j.type);let U=I.create(N,null,B||j.marks);if(j.isLeaf)return M.replaceWith($,$+j.nodeSize,U);if(!I.validContent(j.content))throw new RangeError("Invalid content for node type "+I.name);M.step(new ReplaceAroundStep($,$+j.nodeSize,$+1,$+j.nodeSize-1,new Slice(Fragment.from(U),0,0),1,!0))}function canSplit(M,$,I=1,N){let B=M.resolve($),j=B.depth-I,U=N&&N[N.length-1]||B.parent;if(j<0||B.parent.type.spec.isolating||!B.parent.canReplace(B.index(),B.parent.childCount)||!U.type.validContent(B.parent.content.cutByIndex(B.index(),B.parent.childCount)))return!1;for(let K=B.depth-1,G=I-2;K>j;K--,G--){let J=B.node(K),Z=B.index(K);if(J.type.spec.isolating)return!1;let ee=J.content.cutByIndex(Z,J.childCount),te=N&&N[G]||J;if(te!=J&&(ee=ee.replaceChild(0,te.type.create(te.attrs))),!J.canReplace(Z+1,J.childCount)||!te.type.validContent(ee))return!1}let q=B.indexAfter(j),Y=N&&N[0];return B.node(j).canReplaceWith(q,q,Y?Y.type:B.node(j+1).type)}function split(M,$,I=1,N){let B=M.doc.resolve($),j=Fragment.empty,U=Fragment.empty;for(let q=B.depth,Y=B.depth-I,K=I-1;q>Y;q--,K--){j=Fragment.from(B.node(q).copy(j));let G=N&&N[K];U=Fragment.from(G?G.type.create(G.attrs,U):B.node(q).copy(U))}M.step(new ReplaceStep($,$,new Slice(j.append(U),I,I),!0))}function canJoin(M,$){let I=M.resolve($),N=I.index();return joinable(I.nodeBefore,I.nodeAfter)&&I.parent.canReplace(N,N+1)}function joinable(M,$){return!!(M&&$&&!M.isLeaf&&M.canAppend($))}function joinPoint(M,$,I=-1){let N=M.resolve($);for(let B=N.depth;;B--){let j,U,q=N.index(B);if(B==N.depth?(j=N.nodeBefore,U=N.nodeAfter):I>0?(j=N.node(B+1),q++,U=N.node(B).maybeChild(q)):(j=N.node(B).maybeChild(q-1),U=N.node(B+1)),j&&!j.isTextblock&&joinable(j,U)&&N.node(B).canReplace(q,q+1))return $;if(B==0)break;$=I<0?N.before(B):N.after(B)}}function join(M,$,I){let N=new ReplaceStep($-I,$+I,Slice.empty,!0);M.step(N)}function insertPoint(M,$,I){let N=M.resolve($);if(N.parent.canReplaceWith(N.index(),N.index(),I))return $;if(N.parentOffset==0)for(let B=N.depth-1;B>=0;B--){let j=N.index(B);if(N.node(B).canReplaceWith(j,j,I))return N.before(B+1);if(j>0)return null}if(N.parentOffset==N.parent.content.size)for(let B=N.depth-1;B>=0;B--){let j=N.indexAfter(B);if(N.node(B).canReplaceWith(j,j,I))return N.after(B+1);if(j=0;U--){let q=U==N.depth?0:N.pos<=(N.start(U+1)+N.end(U+1))/2?-1:1,Y=N.index(U)+(q>0?1:0),K=N.node(U),G=!1;if(j==1)G=K.canReplace(Y,Y,B);else{let J=K.contentMatchAt(Y).findWrapping(B.firstChild.type);G=J&&K.canReplaceWith(Y,Y,J[0])}if(G)return q==0?N.pos:q<0?N.before(U+1):N.after(U+1)}return null}function replaceStep(M,$,I=$,N=Slice.empty){if($==I&&!N.size)return null;let B=M.resolve($),j=M.resolve(I);return fitsTrivially(B,j,N)?new ReplaceStep($,I,N):new Fitter(B,j,N).fit()}function fitsTrivially(M,$,I){return!I.openStart&&!I.openEnd&&M.start()==$.start()&&M.parent.canReplace(M.index(),$.index(),I.content)}class Fitter{constructor($,I,N){this.$from=$,this.$to=I,this.unplaced=N,this.frontier=[],this.placed=Fragment.empty;for(let B=0;B<=$.depth;B++){let j=$.node(B);this.frontier.push({type:j.type,match:j.contentMatchAt($.indexAfter(B))})}for(let B=$.depth;B>0;B--)this.placed=Fragment.from($.node(B).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let K=this.findFittable();K?this.placeNodes(K):this.openMore()||this.dropNode()}let $=this.mustMoveInline(),I=this.placed.size-this.depth-this.$from.depth,N=this.$from,B=this.close($<0?this.$to:N.doc.resolve($));if(!B)return null;let j=this.placed,U=N.depth,q=B.depth;for(;U&&q&&j.childCount==1;)j=j.firstChild.content,U--,q--;let Y=new Slice(j,U,q);return $>-1?new ReplaceAroundStep(N.pos,$,this.$to.pos,this.$to.end(),Y,I):Y.size||N.pos!=this.$to.pos?new ReplaceStep(N.pos,B.pos,Y):null}findFittable(){let $=this.unplaced.openStart;for(let I=this.unplaced.content,N=0,B=this.unplaced.openEnd;N<$;N++){let j=I.firstChild;if(I.childCount>1&&(B=0),j.type.spec.isolating&&B<=N){$=N;break}I=j.content}for(let I=1;I<=2;I++)for(let N=I==1?$:this.unplaced.openStart;N>=0;N--){let B,j=null;N?(j=contentAt(this.unplaced.content,N-1).firstChild,B=j.content):B=this.unplaced.content;let U=B.firstChild;for(let q=this.depth;q>=0;q--){let{type:Y,match:K}=this.frontier[q],G,J=null;if(I==1&&(U?K.matchType(U.type)||(J=K.fillBefore(Fragment.from(U),!1)):j&&Y.compatibleContent(j.type)))return{sliceDepth:N,frontierDepth:q,parent:j,inject:J};if(I==2&&U&&(G=K.findWrapping(U.type)))return{sliceDepth:N,frontierDepth:q,parent:j,wrap:G};if(j&&K.matchType(j.type))break}}}openMore(){let{content:$,openStart:I,openEnd:N}=this.unplaced,B=contentAt($,I);return!B.childCount||B.firstChild.isLeaf?!1:(this.unplaced=new Slice($,I+1,Math.max(N,B.size+I>=$.size-N?I+1:0)),!0)}dropNode(){let{content:$,openStart:I,openEnd:N}=this.unplaced,B=contentAt($,I);if(B.childCount<=1&&I>0){let j=$.size-I<=I+B.size;this.unplaced=new Slice(dropFromFragment($,I-1,1),I-1,j?I-1:N)}else this.unplaced=new Slice(dropFromFragment($,I,1),I,N)}placeNodes({sliceDepth:$,frontierDepth:I,parent:N,inject:B,wrap:j}){for(;this.depth>I;)this.closeFrontierNode();if(j)for(let re=0;re1||Y==0||re.content.size)&&(J=se,G.push(closeNodeStart(re.mark(Z.allowedMarks(re.marks)),K==1?Y:0,K==q.childCount?ee:-1)))}let te=K==q.childCount;te||(ee=-1),this.placed=addToFragment(this.placed,I,Fragment.from(G)),this.frontier[I].match=J,te&&ee<0&&N&&N.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let re=0,se=q;re1&&B==this.$to.end(--N);)++B;return B}findCloseLevel($){e:for(let I=Math.min(this.depth,$.depth);I>=0;I--){let{match:N,type:B}=this.frontier[I],j=I<$.depth&&$.end(I+1)==$.pos+($.depth-(I+1)),U=contentAfterFits($,I,B,N,j);if(U){for(let q=I-1;q>=0;q--){let{match:Y,type:K}=this.frontier[q],G=contentAfterFits($,q,K,Y,!0);if(!G||G.childCount)continue e}return{depth:I,fit:U,move:j?$.doc.resolve($.after(I+1)):$}}}}close($){let I=this.findCloseLevel($);if(!I)return null;for(;this.depth>I.depth;)this.closeFrontierNode();I.fit.childCount&&(this.placed=addToFragment(this.placed,I.depth,I.fit)),$=I.move;for(let N=I.depth+1;N<=$.depth;N++){let B=$.node(N),j=B.type.contentMatch.fillBefore(B.content,!0,$.index(N));this.openFrontierNode(B.type,B.attrs,j)}return $}openFrontierNode($,I=null,N){let B=this.frontier[this.depth];B.match=B.match.matchType($),this.placed=addToFragment(this.placed,this.depth,Fragment.from($.create(I,N))),this.frontier.push({type:$,match:$.contentMatch})}closeFrontierNode(){let I=this.frontier.pop().match.fillBefore(Fragment.empty,!0);I.childCount&&(this.placed=addToFragment(this.placed,this.frontier.length,I))}}function dropFromFragment(M,$,I){return $==0?M.cutByIndex(I,M.childCount):M.replaceChild(0,M.firstChild.copy(dropFromFragment(M.firstChild.content,$-1,I)))}function addToFragment(M,$,I){return $==0?M.append(I):M.replaceChild(M.childCount-1,M.lastChild.copy(addToFragment(M.lastChild.content,$-1,I)))}function contentAt(M,$){for(let I=0;I<$;I++)M=M.firstChild.content;return M}function closeNodeStart(M,$,I){if($<=0)return M;let N=M.content;return $>1&&(N=N.replaceChild(0,closeNodeStart(N.firstChild,$-1,N.childCount==1?I-1:0))),$>0&&(N=M.type.contentMatch.fillBefore(N).append(N),I<=0&&(N=N.append(M.type.contentMatch.matchFragment(N).fillBefore(Fragment.empty,!0)))),M.copy(N)}function contentAfterFits(M,$,I,N,B){let j=M.node($),U=B?M.indexAfter($):M.index($);if(U==j.childCount&&!I.compatibleContent(j.type))return null;let q=N.fillBefore(j.content,!0,U);return q&&!invalidMarks(I,j.content,U)?q:null}function invalidMarks(M,$,I){for(let N=I;N<$.childCount;N++)if(!M.allowsMarks($.child(N).marks))return!0;return!1}function definesContent(M){return M.spec.defining||M.spec.definingForContent}function replaceRange(M,$,I,N){if(!N.size)return M.deleteRange($,I);let B=M.doc.resolve($),j=M.doc.resolve(I);if(fitsTrivially(B,j,N))return M.step(new ReplaceStep($,I,N));let U=coveredDepths(B,M.doc.resolve(I));U[U.length-1]==0&&U.pop();let q=-(B.depth+1);U.unshift(q);for(let Z=B.depth,ee=B.pos-1;Z>0;Z--,ee--){let te=B.node(Z).type.spec;if(te.defining||te.definingAsContext||te.isolating)break;U.indexOf(Z)>-1?q=Z:B.before(Z)==ee&&U.splice(1,0,-Z)}let Y=U.indexOf(q),K=[],G=N.openStart;for(let Z=N.content,ee=0;;ee++){let te=Z.firstChild;if(K.push(te),ee==N.openStart)break;Z=te.content}for(let Z=G-1;Z>=0;Z--){let ee=K[Z].type,te=definesContent(ee);if(te&&B.node(Y).type!=ee)G=Z;else if(te||!ee.isTextblock)break}for(let Z=N.openStart;Z>=0;Z--){let ee=(Z+G+1)%(N.openStart+1),te=K[ee];if(te)for(let re=0;re=0&&(M.replace($,I,N),!(M.steps.length>J));Z--){let ee=U[Z];ee<0||($=B.before(ee),I=j.after(ee))}}function closeFragment(M,$,I,N,B){if($N){let j=B.contentMatchAt(0),U=j.fillBefore(M).append(M);M=U.append(j.matchFragment(U).fillBefore(Fragment.empty,!0))}return M}function replaceRangeWith(M,$,I,N){if(!N.isInline&&$==I&&M.doc.resolve($).parent.content.size){let B=insertPoint(M.doc,$,N.type);B!=null&&($=I=B)}M.replaceRange($,I,new Slice(Fragment.from(N),0,0))}function deleteRange$1(M,$,I){let N=M.doc.resolve($),B=M.doc.resolve(I),j=coveredDepths(N,B);for(let U=0;U0&&(Y||N.node(q-1).canReplace(N.index(q-1),B.indexAfter(q-1))))return M.delete(N.before(q),B.after(q))}for(let U=1;U<=N.depth&&U<=B.depth;U++)if($-N.start(U)==N.depth-U&&I>N.end(U)&&B.end(U)-I!=B.depth-U)return M.delete(N.before(U),I);M.delete($,I)}function coveredDepths(M,$){let I=[],N=Math.min(M.depth,$.depth);for(let B=N;B>=0;B--){let j=M.start(B);if(j$.pos+($.depth-B)||M.node(B).type.spec.isolating||$.node(B).type.spec.isolating)break;(j==$.start(B)||B==M.depth&&B==$.depth&&M.parent.inlineContent&&$.parent.inlineContent&&B&&$.start(B-1)==j-1)&&I.push(B)}return I}class AttrStep extends Step{constructor($,I,N){super(),this.pos=$,this.attr=I,this.value=N}apply($){let I=$.nodeAt(this.pos);if(!I)return StepResult.fail("No node at attribute step's position");let N=Object.create(null);for(let j in I.attrs)N[j]=I.attrs[j];N[this.attr]=this.value;let B=I.type.create(N,null,I.marks);return StepResult.fromReplace($,this.pos,this.pos+1,new Slice(Fragment.from(B),0,I.isLeaf?0:1))}getMap(){return StepMap.empty}invert($){return new AttrStep(this.pos,this.attr,$.nodeAt(this.pos).attrs[this.attr])}map($){let I=$.mapResult(this.pos,1);return I.deletedAfter?null:new AttrStep(I.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON($,I){if(typeof I.pos!="number"||typeof I.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new AttrStep(I.pos,I.attr,I.value)}}Step.jsonID("attr",AttrStep);let TransformError=class extends Error{};TransformError=function M($){let I=Error.call(this,$);return I.__proto__=M.prototype,I};TransformError.prototype=Object.create(Error.prototype);TransformError.prototype.constructor=TransformError;TransformError.prototype.name="TransformError";class Transform{constructor($){this.doc=$,this.steps=[],this.docs=[],this.mapping=new Mapping}get before(){return this.docs.length?this.docs[0]:this.doc}step($){let I=this.maybeStep($);if(I.failed)throw new TransformError(I.failed);return this}maybeStep($){let I=$.apply(this.doc);return I.failed||this.addStep($,I.doc),I}get docChanged(){return this.steps.length>0}addStep($,I){this.docs.push(this.doc),this.steps.push($),this.mapping.appendMap($.getMap()),this.doc=I}replace($,I=$,N=Slice.empty){let B=replaceStep(this.doc,$,I,N);return B&&this.step(B),this}replaceWith($,I,N){return this.replace($,I,new Slice(Fragment.from(N),0,0))}delete($,I){return this.replace($,I,Slice.empty)}insert($,I){return this.replaceWith($,$,I)}replaceRange($,I,N){return replaceRange(this,$,I,N),this}replaceRangeWith($,I,N){return replaceRangeWith(this,$,I,N),this}deleteRange($,I){return deleteRange$1(this,$,I),this}lift($,I){return lift$2(this,$,I),this}join($,I=1){return join(this,$,I),this}wrap($,I){return wrap$1(this,$,I),this}setBlockType($,I=$,N,B=null){return setBlockType$1(this,$,I,N,B),this}setNodeMarkup($,I,N=null,B){return setNodeMarkup(this,$,I,N,B),this}setNodeAttribute($,I,N){return this.step(new AttrStep($,I,N)),this}addNodeMark($,I){return this.step(new AddNodeMarkStep($,I)),this}removeNodeMark($,I){if(!(I instanceof Mark$1)){let N=this.doc.nodeAt($);if(!N)throw new RangeError("No node at position "+$);if(I=I.isInSet(N.marks),!I)return this}return this.step(new RemoveNodeMarkStep($,I)),this}split($,I=1,N){return split(this,$,I,N),this}addMark($,I,N){return addMark(this,$,I,N),this}removeMark($,I,N){return removeMark(this,$,I,N),this}clearIncompatible($,I,N){return clearIncompatible(this,$,I,N),this}}const classesById=Object.create(null);class Selection{constructor($,I,N){this.$anchor=$,this.$head=I,this.ranges=N||[new SelectionRange($.min(I),$.max(I))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let $=this.ranges;for(let I=0;I<$.length;I++)if($[I].$from.pos!=$[I].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace($,I=Slice.empty){let N=I.content.lastChild,B=null;for(let q=0;q=0;j--){let U=I<0?findSelectionIn($.node(0),$.node(j),$.before(j+1),$.index(j),I,N):findSelectionIn($.node(0),$.node(j),$.after(j+1),$.index(j)+1,I,N);if(U)return U}return null}static near($,I=1){return this.findFrom($,I)||this.findFrom($,-I)||new AllSelection($.node(0))}static atStart($){return findSelectionIn($,$,0,0,1)||new AllSelection($)}static atEnd($){return findSelectionIn($,$,$.content.size,$.childCount,-1)||new AllSelection($)}static fromJSON($,I){if(!I||!I.type)throw new RangeError("Invalid input for Selection.fromJSON");let N=classesById[I.type];if(!N)throw new RangeError(`No selection type ${I.type} defined`);return N.fromJSON($,I)}static jsonID($,I){if($ in classesById)throw new RangeError("Duplicate use of selection JSON ID "+$);return classesById[$]=I,I.prototype.jsonID=$,I}getBookmark(){return TextSelection.between(this.$anchor,this.$head).getBookmark()}}Selection.prototype.visible=!0;class SelectionRange{constructor($,I){this.$from=$,this.$to=I}}let warnedAboutTextSelection=!1;function checkTextSelection(M){!warnedAboutTextSelection&&!M.parent.inlineContent&&(warnedAboutTextSelection=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+M.parent.type.name+")"))}class TextSelection extends Selection{constructor($,I=$){checkTextSelection($),checkTextSelection(I),super($,I)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map($,I){let N=$.resolve(I.map(this.head));if(!N.parent.inlineContent)return Selection.near(N);let B=$.resolve(I.map(this.anchor));return new TextSelection(B.parent.inlineContent?B:N,N)}replace($,I=Slice.empty){if(super.replace($,I),I==Slice.empty){let N=this.$from.marksAcross(this.$to);N&&$.ensureMarks(N)}}eq($){return $ instanceof TextSelection&&$.anchor==this.anchor&&$.head==this.head}getBookmark(){return new TextBookmark(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON($,I){if(typeof I.anchor!="number"||typeof I.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new TextSelection($.resolve(I.anchor),$.resolve(I.head))}static create($,I,N=I){let B=$.resolve(I);return new this(B,N==I?B:$.resolve(N))}static between($,I,N){let B=$.pos-I.pos;if((!N||B)&&(N=B>=0?1:-1),!I.parent.inlineContent){let j=Selection.findFrom(I,N,!0)||Selection.findFrom(I,-N,!0);if(j)I=j.$head;else return Selection.near(I,N)}return $.parent.inlineContent||(B==0?$=I:($=(Selection.findFrom($,-N,!0)||Selection.findFrom($,N,!0)).$anchor,$.pos0?0:1);B>0?U<$.childCount:U>=0;U+=B){let q=$.child(U);if(q.isAtom){if(!j&&NodeSelection.isSelectable(q))return NodeSelection.create(M,I-(B<0?q.nodeSize:0))}else{let Y=findSelectionIn(M,q,I+B,B<0?q.childCount:0,B,j);if(Y)return Y}I+=q.nodeSize*B}return null}function selectionToInsertionEnd$1(M,$,I){let N=M.steps.length-1;if(N<$)return;let B=M.steps[N];if(!(B instanceof ReplaceStep||B instanceof ReplaceAroundStep))return;let j=M.mapping.maps[N],U;j.forEach((q,Y,K,G)=>{U==null&&(U=G)}),M.setSelection(Selection.near(M.doc.resolve(U),I))}const UPDATED_SEL=1,UPDATED_MARKS=2,UPDATED_SCROLL=4;class Transaction extends Transform{constructor($){super($.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=$.selection,this.storedMarks=$.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks($){return this.storedMarks=$,this.updated|=UPDATED_MARKS,this}ensureMarks($){return Mark$1.sameSet(this.storedMarks||this.selection.$from.marks(),$)||this.setStoredMarks($),this}addStoredMark($){return this.ensureMarks($.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark($){return this.ensureMarks($.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&UPDATED_MARKS)>0}addStep($,I){super.addStep($,I),this.updated=this.updated&~UPDATED_MARKS,this.storedMarks=null}setTime($){return this.time=$,this}replaceSelection($){return this.selection.replace(this,$),this}replaceSelectionWith($,I=!0){let N=this.selection;return I&&($=$.mark(this.storedMarks||(N.empty?N.$from.marks():N.$from.marksAcross(N.$to)||Mark$1.none))),N.replaceWith(this,$),this}deleteSelection(){return this.selection.replace(this),this}insertText($,I,N){let B=this.doc.type.schema;if(I==null)return $?this.replaceSelectionWith(B.text($),!0):this.deleteSelection();{if(N==null&&(N=I),N=N??I,!$)return this.deleteRange(I,N);let j=this.storedMarks;if(!j){let U=this.doc.resolve(I);j=N==I?U.marks():U.marksAcross(this.doc.resolve(N))}return this.replaceRangeWith(I,N,B.text($,j)),this.selection.empty||this.setSelection(Selection.near(this.selection.$to)),this}}setMeta($,I){return this.meta[typeof $=="string"?$:$.key]=I,this}getMeta($){return this.meta[typeof $=="string"?$:$.key]}get isGeneric(){for(let $ in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=UPDATED_SCROLL,this}get scrolledIntoView(){return(this.updated&UPDATED_SCROLL)>0}}function bind$7(M,$){return!$||!M?M:M.bind($)}class FieldDesc{constructor($,I,N){this.name=$,this.init=bind$7(I.init,N),this.apply=bind$7(I.apply,N)}}const baseFields=[new FieldDesc("doc",{init(M){return M.doc||M.schema.topNodeType.createAndFill()},apply(M){return M.doc}}),new FieldDesc("selection",{init(M,$){return M.selection||Selection.atStart($.doc)},apply(M){return M.selection}}),new FieldDesc("storedMarks",{init(M){return M.storedMarks||null},apply(M,$,I,N){return N.selection.$cursor?M.storedMarks:null}}),new FieldDesc("scrollToSelection",{init(){return 0},apply(M,$){return M.scrolledIntoView?$+1:$}})];class Configuration{constructor($,I){this.schema=$,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=baseFields.slice(),I&&I.forEach(N=>{if(this.pluginsByKey[N.key])throw new RangeError("Adding different instances of a keyed plugin ("+N.key+")");this.plugins.push(N),this.pluginsByKey[N.key]=N,N.spec.state&&this.fields.push(new FieldDesc(N.key,N.spec.state,N))})}}class EditorState{constructor($){this.config=$}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply($){return this.applyTransaction($).state}filterTransaction($,I=-1){for(let N=0;NN.toJSON())),$&&typeof $=="object")for(let N in $){if(N=="doc"||N=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let B=$[N],j=B.spec.state;j&&j.toJSON&&(I[N]=j.toJSON.call(B,this[B.key]))}return I}static fromJSON($,I,N){if(!I)throw new RangeError("Invalid input for EditorState.fromJSON");if(!$.schema)throw new RangeError("Required config field 'schema' missing");let B=new Configuration($.schema,$.plugins),j=new EditorState(B);return B.fields.forEach(U=>{if(U.name=="doc")j.doc=Node$2.fromJSON($.schema,I.doc);else if(U.name=="selection")j.selection=Selection.fromJSON(j.doc,I.selection);else if(U.name=="storedMarks")I.storedMarks&&(j.storedMarks=I.storedMarks.map($.schema.markFromJSON));else{if(N)for(let q in N){let Y=N[q],K=Y.spec.state;if(Y.key==U.name&&K&&K.fromJSON&&Object.prototype.hasOwnProperty.call(I,q)){j[U.name]=K.fromJSON.call(Y,$,I[q],j);return}}j[U.name]=U.init($,j)}}),j}}function bindProps(M,$,I){for(let N in M){let B=M[N];B instanceof Function?B=B.bind($):N=="handleDOMEvents"&&(B=bindProps(B,$,{})),I[N]=B}return I}class Plugin{constructor($){this.spec=$,this.props={},$.props&&bindProps($.props,this,this.props),this.key=$.key?$.key.key:createKey("plugin")}getState($){return $[this.key]}}const keys$3=Object.create(null);function createKey(M){return M in keys$3?M+"$"+ ++keys$3[M]:(keys$3[M]=0,M+"$")}class PluginKey{constructor($="key"){this.key=createKey($)}get($){return $.config.pluginsByKey[this.key]}getState($){return $[this.key]}}const state=Object.freeze(Object.defineProperty({__proto__:null,AllSelection,EditorState,NodeSelection,Plugin,PluginKey,Selection,SelectionRange,TextSelection,Transaction},Symbol.toStringTag,{value:"Module"})),domIndex=function(M){for(var $=0;;$++)if(M=M.previousSibling,!M)return $},parentNode=function(M){let $=M.assignedSlot||M.parentNode;return $&&$.nodeType==11?$.host:$};let reusedRange=null;const textRange=function(M,$,I){let N=reusedRange||(reusedRange=document.createRange());return N.setEnd(M,I??M.nodeValue.length),N.setStart(M,$||0),N},isEquivalentPosition=function(M,$,I,N){return I&&(scanFor(M,$,I,N,-1)||scanFor(M,$,I,N,1))},atomElements=/^(img|br|input|textarea|hr)$/i;function scanFor(M,$,I,N,B){for(;;){if(M==I&&$==N)return!0;if($==(B<0?0:nodeSize(M))){let j=M.parentNode;if(!j||j.nodeType!=1||hasBlockDesc(M)||atomElements.test(M.nodeName)||M.contentEditable=="false")return!1;$=domIndex(M)+(B<0?0:1),M=j}else if(M.nodeType==1){if(M=M.childNodes[$+(B<0?-1:0)],M.contentEditable=="false")return!1;$=B<0?nodeSize(M):0}else return!1}}function nodeSize(M){return M.nodeType==3?M.nodeValue.length:M.childNodes.length}function isOnEdge(M,$,I){for(let N=$==0,B=$==nodeSize(M);N||B;){if(M==I)return!0;let j=domIndex(M);if(M=M.parentNode,!M)return!1;N=N&&j==0,B=B&&j==nodeSize(M)}}function hasBlockDesc(M){let $;for(let I=M;I&&!($=I.pmViewDesc);I=I.parentNode);return $&&$.node&&$.node.isBlock&&($.dom==M||$.contentDOM==M)}const selectionCollapsed=function(M){return M.focusNode&&isEquivalentPosition(M.focusNode,M.focusOffset,M.anchorNode,M.anchorOffset)};function keyEvent(M,$){let I=document.createEvent("Event");return I.initEvent("keydown",!0,!0),I.keyCode=M,I.key=I.code=$,I}function deepActiveElement(M){let $=M.activeElement;for(;$&&$.shadowRoot;)$=$.shadowRoot.activeElement;return $}const nav=typeof navigator<"u"?navigator:null,doc=typeof document<"u"?document:null,agent=nav&&nav.userAgent||"",ie_edge=/Edge\/(\d+)/.exec(agent),ie_upto10=/MSIE \d/.exec(agent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(agent),ie$1=!!(ie_upto10||ie_11up||ie_edge),ie_version=ie_upto10?document.documentMode:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko=!ie$1&&/gecko\/(\d+)/i.test(agent);gecko&&+(/Firefox\/(\d+)/.exec(agent)||[0,0])[1];const _chrome=!ie$1&&/Chrome\/(\d+)/.exec(agent),chrome$1=!!_chrome,chrome_version=_chrome?+_chrome[1]:0,safari=!ie$1&&!!nav&&/Apple Computer/.test(nav.vendor),ios=safari&&(/Mobile\/\w+/.test(agent)||!!nav&&nav.maxTouchPoints>2),mac$3=ios||(nav?/Mac/.test(nav.platform):!1),android=/Android \d/.test(agent),webkit=!!doc&&"webkitFontSmoothing"in doc.documentElement.style,webkit_version=webkit?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function windowRect(M){return{left:0,right:M.documentElement.clientWidth,top:0,bottom:M.documentElement.clientHeight}}function getSide(M,$){return typeof M=="number"?M:M[$]}function clientRect(M){let $=M.getBoundingClientRect(),I=$.width/M.offsetWidth||1,N=$.height/M.offsetHeight||1;return{left:$.left,right:$.left+M.clientWidth*I,top:$.top,bottom:$.top+M.clientHeight*N}}function scrollRectIntoView(M,$,I){let N=M.someProp("scrollThreshold")||0,B=M.someProp("scrollMargin")||5,j=M.dom.ownerDocument;for(let U=I||M.dom;U;U=parentNode(U)){if(U.nodeType!=1)continue;let q=U,Y=q==j.body,K=Y?windowRect(j):clientRect(q),G=0,J=0;if($.topK.bottom-getSide(N,"bottom")&&(J=$.bottom-K.bottom+getSide(B,"bottom")),$.leftK.right-getSide(N,"right")&&(G=$.right-K.right+getSide(B,"right")),G||J)if(Y)j.defaultView.scrollBy(G,J);else{let Z=q.scrollLeft,ee=q.scrollTop;J&&(q.scrollTop+=J),G&&(q.scrollLeft+=G);let te=q.scrollLeft-Z,re=q.scrollTop-ee;$={left:$.left-te,top:$.top-re,right:$.right-te,bottom:$.bottom-re}}if(Y)break}}function storeScrollPos(M){let $=M.dom.getBoundingClientRect(),I=Math.max(0,$.top),N,B;for(let j=($.left+$.right)/2,U=I+1;U=I-20){N=q,B=Y.top;break}}return{refDOM:N,refTop:B,stack:scrollStack(M.dom)}}function scrollStack(M){let $=[],I=M.ownerDocument;for(let N=M;N&&($.push({dom:N,top:N.scrollTop,left:N.scrollLeft}),M!=I);N=parentNode(N));return $}function resetScrollPos({refDOM:M,refTop:$,stack:I}){let N=M?M.getBoundingClientRect().top:0;restoreScrollStack(I,N==0?0:N-$)}function restoreScrollStack(M,$){for(let I=0;I=q){U=Math.max(Z.bottom,U),q=Math.min(Z.top,q);let ee=Z.left>$.left?Z.left-$.left:Z.right<$.left?$.left-Z.right:0;if(ee=(Z.left+Z.right)/2?1:0));continue}}!I&&($.left>=Z.right&&$.top>=Z.top||$.left>=Z.left&&$.top>=Z.bottom)&&(j=K+1)}}return I&&I.nodeType==3?findOffsetInText(I,B):!I||N&&I.nodeType==1?{node:M,offset:j}:findOffsetInNode(I,B)}function findOffsetInText(M,$){let I=M.nodeValue.length,N=document.createRange();for(let B=0;B=(j.left+j.right)/2?1:0)}}return{node:M,offset:0}}function inRect(M,$){return M.left>=$.left-1&&M.left<=$.right+1&&M.top>=$.top-1&&M.top<=$.bottom+1}function targetKludge(M,$){let I=M.parentNode;return I&&/^li$/i.test(I.nodeName)&&$.left(U.left+U.right)/2?1:-1}return M.docView.posFromDOM(N,B,j)}function posFromCaret(M,$,I,N){let B=-1;for(let j=$,U=!1;j!=M.dom;){let q=M.docView.nearestDesc(j,!0);if(!q)return null;if(q.dom.nodeType==1&&(q.node.isBlock&&q.parent&&!U||!q.contentDOM)){let Y=q.dom.getBoundingClientRect();if(q.node.isBlock&&q.parent&&!U&&(U=!0,Y.left>N.left||Y.top>N.top?B=q.posBefore:(Y.right-1?B:M.docView.posFromDOM($,I,-1)}function elementFromPoint(M,$,I){let N=M.childNodes.length;if(N&&I.top$.top&&B++}N==M.dom&&B==N.childNodes.length-1&&N.lastChild.nodeType==1&&$.top>N.lastChild.getBoundingClientRect().bottom?U=M.state.doc.content.size:(B==0||N.nodeType!=1||N.childNodes[B-1].nodeName!="BR")&&(U=posFromCaret(M,N,B,$))}U==null&&(U=posFromElement(M,j,$));let q=M.docView.nearestDesc(j,!0);return{pos:U,inside:q?q.posAtStart-q.border:-1}}function singleRect(M,$){let I=M.getClientRects();return I.length?I[$<0?0:I.length-1]:M.getBoundingClientRect()}const BIDI=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function coordsAtPos(M,$,I){let{node:N,offset:B,atom:j}=M.docView.domFromPos($,I<0?-1:1),U=webkit||gecko;if(N.nodeType==3)if(U&&(BIDI.test(N.nodeValue)||(I<0?!B:B==N.nodeValue.length))){let Y=singleRect(textRange(N,B,B),I);if(gecko&&B&&/\s/.test(N.nodeValue[B-1])&&B=0&&B==N.nodeValue.length?(Y--,G=1):I<0?Y--:K++,flattenV(singleRect(textRange(N,Y,K),1),G<0)}if(!M.state.doc.resolve($-(j||0)).parent.inlineContent){if(j==null&&B&&(I<0||B==nodeSize(N))){let Y=N.childNodes[B-1];if(Y.nodeType==1)return flattenH(Y.getBoundingClientRect(),!1)}if(j==null&&B=0)}if(j==null&&B&&(I<0||B==nodeSize(N))){let Y=N.childNodes[B-1],K=Y.nodeType==3?textRange(Y,nodeSize(Y)-(U?0:1)):Y.nodeType==1&&(Y.nodeName!="BR"||!Y.nextSibling)?Y:null;if(K)return flattenV(singleRect(K,1),!1)}if(j==null&&B=0)}function flattenV(M,$){if(M.width==0)return M;let I=$?M.left:M.right;return{top:M.top,bottom:M.bottom,left:I,right:I}}function flattenH(M,$){if(M.height==0)return M;let I=$?M.top:M.bottom;return{top:I,bottom:I,left:M.left,right:M.right}}function withFlushedState(M,$,I){let N=M.state,B=M.root.activeElement;N!=$&&M.updateState($),B!=M.dom&&M.focus();try{return I()}finally{N!=$&&M.updateState(N),B!=M.dom&&B&&B.focus()}}function endOfTextblockVertical(M,$,I){let N=$.selection,B=I=="up"?N.$from:N.$to;return withFlushedState(M,$,()=>{let{node:j}=M.docView.domFromPos(B.pos,I=="up"?-1:1);for(;;){let q=M.docView.nearestDesc(j,!0);if(!q)break;if(q.node.isBlock){j=q.contentDOM||q.dom;break}j=q.dom.parentNode}let U=coordsAtPos(M,B.pos,1);for(let q=j.firstChild;q;q=q.nextSibling){let Y;if(q.nodeType==1)Y=q.getClientRects();else if(q.nodeType==3)Y=textRange(q,0,q.nodeValue.length).getClientRects();else continue;for(let K=0;KG.top+1&&(I=="up"?U.top-G.top>(G.bottom-U.top)*2:G.bottom-U.bottom>(U.bottom-G.top)*2))return!1}}return!0})}const maybeRTL=/[\u0590-\u08ac]/;function endOfTextblockHorizontal(M,$,I){let{$head:N}=$.selection;if(!N.parent.isTextblock)return!1;let B=N.parentOffset,j=!B,U=B==N.parent.content.size,q=M.domSelection();return!maybeRTL.test(N.parent.textContent)||!q.modify?I=="left"||I=="backward"?j:U:withFlushedState(M,$,()=>{let{focusNode:Y,focusOffset:K,anchorNode:G,anchorOffset:J}=M.domSelectionRange(),Z=q.caretBidiLevel;q.modify("move",I,"character");let ee=N.depth?M.docView.domAfterPos(N.before()):M.dom,{focusNode:te,focusOffset:re}=M.domSelectionRange(),se=te&&!ee.contains(te.nodeType==1?te:te.parentNode)||Y==te&&K==re;try{q.collapse(G,J),Y&&(Y!=G||K!=J)&&q.extend&&q.extend(Y,K)}catch{}return Z!=null&&(q.caretBidiLevel=Z),se})}let cachedState=null,cachedDir=null,cachedResult=!1;function endOfTextblock(M,$,I){return cachedState==$&&cachedDir==I?cachedResult:(cachedState=$,cachedDir=I,cachedResult=I=="up"||I=="down"?endOfTextblockVertical(M,$,I):endOfTextblockHorizontal(M,$,I))}const NOT_DIRTY=0,CHILD_DIRTY=1,CONTENT_DIRTY=2,NODE_DIRTY=3;class ViewDesc{constructor($,I,N,B){this.parent=$,this.children=I,this.dom=N,this.contentDOM=B,this.dirty=NOT_DIRTY,N.pmViewDesc=this}matchesWidget($){return!1}matchesMark($){return!1}matchesNode($,I,N){return!1}matchesHack($){return!1}parseRule(){return null}stopEvent($){return!1}get size(){let $=0;for(let I=0;IdomIndex(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))B=$.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(I==0)for(let j=$;;j=j.parentNode){if(j==this.dom){B=!1;break}if(j.previousSibling)break}if(B==null&&I==$.childNodes.length)for(let j=$;;j=j.parentNode){if(j==this.dom){B=!0;break}if(j.nextSibling)break}}return B??N>0?this.posAtEnd:this.posAtStart}nearestDesc($,I=!1){for(let N=!0,B=$;B;B=B.parentNode){let j=this.getDesc(B),U;if(j&&(!I||j.node))if(N&&(U=j.nodeDOM)&&!(U.nodeType==1?U.contains($.nodeType==1?$:$.parentNode):U==$))N=!1;else return j}}getDesc($){let I=$.pmViewDesc;for(let N=I;N;N=N.parent)if(N==this)return I}posFromDOM($,I,N){for(let B=$;B;B=B.parentNode){let j=this.getDesc(B);if(j)return j.localPosFromDOM($,I,N)}return-1}descAt($){for(let I=0,N=0;I$||U instanceof TrailingHackViewDesc){B=$-j;break}j=q}if(B)return this.children[N].domFromPos(B-this.children[N].border,I);for(let j;N&&!(j=this.children[N-1]).size&&j instanceof WidgetViewDesc&&j.side>=0;N--);if(I<=0){let j,U=!0;for(;j=N?this.children[N-1]:null,!(!j||j.dom.parentNode==this.contentDOM);N--,U=!1);return j&&I&&U&&!j.border&&!j.domAtom?j.domFromPos(j.size,I):{node:this.contentDOM,offset:j?domIndex(j.dom)+1:0}}else{let j,U=!0;for(;j=N=G&&I<=K-Y.border&&Y.node&&Y.contentDOM&&this.contentDOM.contains(Y.contentDOM))return Y.parseRange($,I,G);$=U;for(let J=q;J>0;J--){let Z=this.children[J-1];if(Z.size&&Z.dom.parentNode==this.contentDOM&&!Z.emptyChildAt(1)){B=domIndex(Z.dom)+1;break}$-=Z.size}B==-1&&(B=0)}if(B>-1&&(K>I||q==this.children.length-1)){I=K;for(let G=q+1;Gee&&UI){let ee=q;q=Y,Y=ee}let Z=document.createRange();Z.setEnd(Y.node,Y.offset),Z.setStart(q.node,q.offset),K.removeAllRanges(),K.addRange(Z)}}ignoreMutation($){return!this.contentDOM&&$.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty($,I){for(let N=0,B=0;B=N:$N){let q=N+j.border,Y=U-j.border;if($>=q&&I<=Y){this.dirty=$==N||I==U?CONTENT_DIRTY:CHILD_DIRTY,$==q&&I==Y&&(j.contentLost||j.dom.parentNode!=this.contentDOM)?j.dirty=NODE_DIRTY:j.markDirty($-q,I-q);return}else j.dirty=j.dom==j.contentDOM&&j.dom.parentNode==this.contentDOM&&!j.children.length?CONTENT_DIRTY:NODE_DIRTY}N=U}this.dirty=CONTENT_DIRTY}markParentsDirty(){let $=1;for(let I=this.parent;I;I=I.parent,$++){let N=$==1?CONTENT_DIRTY:CHILD_DIRTY;I.dirty{if(!j)return B;if(j.parent)return j.parent.posBeforeChild(j)})),!I.type.spec.raw){if(U.nodeType!=1){let q=document.createElement("span");q.appendChild(U),U=q}U.contentEditable="false",U.classList.add("ProseMirror-widget")}super($,[],U,null),this.widget=I,this.widget=I,j=this}matchesWidget($){return this.dirty==NOT_DIRTY&&$.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent($){let I=this.widget.spec.stopEvent;return I?I($):!1}ignoreMutation($){return $.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class CompositionViewDesc extends ViewDesc{constructor($,I,N,B){super($,[],I,null),this.textDOM=N,this.text=B}get size(){return this.text.length}localPosFromDOM($,I){return $!=this.textDOM?this.posAtStart+(I?this.size:0):this.posAtStart+I}domFromPos($){return{node:this.textDOM,offset:$}}ignoreMutation($){return $.type==="characterData"&&$.target.nodeValue==$.oldValue}}class MarkViewDesc extends ViewDesc{constructor($,I,N,B){super($,[],N,B),this.mark=I}static create($,I,N,B){let j=B.nodeViews[I.type.name],U=j&&j(I,B,N);return(!U||!U.dom)&&(U=DOMSerializer.renderSpec(document,I.type.spec.toDOM(I,N))),new MarkViewDesc($,I,U.dom,U.contentDOM||U.dom)}parseRule(){return this.dirty&NODE_DIRTY||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark($){return this.dirty!=NODE_DIRTY&&this.mark.eq($)}markDirty($,I){if(super.markDirty($,I),this.dirty!=NOT_DIRTY){let N=this.parent;for(;!N.node;)N=N.parent;N.dirty0&&(j=replaceNodes(j,0,$,N));for(let q=0;q{if(!Y)return U;if(Y.parent)return Y.parent.posBeforeChild(Y)},N,B),G=K&&K.dom,J=K&&K.contentDOM;if(I.isText){if(!G)G=document.createTextNode(I.text);else if(G.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else G||({dom:G,contentDOM:J}=DOMSerializer.renderSpec(document,I.type.spec.toDOM(I)));!J&&!I.isText&&G.nodeName!="BR"&&(G.hasAttribute("contenteditable")||(G.contentEditable="false"),I.type.spec.draggable&&(G.draggable=!0));let Z=G;return G=applyOuterDeco(G,N,I),K?Y=new CustomNodeViewDesc($,I,N,B,G,J||null,Z,K,j,U+1):I.isText?new TextViewDesc($,I,N,B,G,Z,j):new NodeViewDesc($,I,N,B,G,J||null,Z,j,U+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let $={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&($.preserveWhitespace="full"),!this.contentDOM)$.getContent=()=>this.node.content;else if(!this.contentLost)$.contentElement=this.contentDOM;else{for(let I=this.children.length-1;I>=0;I--){let N=this.children[I];if(this.dom.contains(N.dom.parentNode)){$.contentElement=N.dom.parentNode;break}}$.contentElement||($.getContent=()=>Fragment.empty)}return $}matchesNode($,I,N){return this.dirty==NOT_DIRTY&&$.eq(this.node)&&sameOuterDeco(I,this.outerDeco)&&N.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren($,I){let N=this.node.inlineContent,B=I,j=$.composing?this.localCompositionInfo($,I):null,U=j&&j.pos>-1?j:null,q=j&&j.pos<0,Y=new ViewTreeUpdater(this,U&&U.node,$);iterDeco(this.node,this.innerDeco,(K,G,J)=>{K.spec.marks?Y.syncToMarks(K.spec.marks,N,$):K.type.side>=0&&!J&&Y.syncToMarks(G==this.node.childCount?Mark$1.none:this.node.child(G).marks,N,$),Y.placeWidget(K,$,B)},(K,G,J,Z)=>{Y.syncToMarks(K.marks,N,$);let ee;Y.findNodeMatch(K,G,J,Z)||q&&$.state.selection.from>B&&$.state.selection.to-1&&Y.updateNodeAt(K,G,J,ee,$)||Y.updateNextNode(K,G,J,$,Z)||Y.addNode(K,G,J,$,B),B+=K.nodeSize}),Y.syncToMarks([],N,$),this.node.isTextblock&&Y.addTextblockHacks(),Y.destroyRest(),(Y.changed||this.dirty==CONTENT_DIRTY)&&(U&&this.protectLocalComposition($,U),renderDescs(this.contentDOM,this.children,$),ios&&iosHacks(this.dom))}localCompositionInfo($,I){let{from:N,to:B}=$.state.selection;if(!($.state.selection instanceof TextSelection)||NI+this.node.content.size)return null;let j=$.domSelectionRange(),U=nearbyTextNode(j.focusNode,j.focusOffset);if(!U||!this.dom.contains(U.parentNode))return null;if(this.node.inlineContent){let q=U.nodeValue,Y=findTextInFragment(this.node.content,q,N-I,B-I);return Y<0?null:{node:U,pos:Y,text:q}}else return{node:U,pos:-1,text:""}}protectLocalComposition($,{node:I,pos:N,text:B}){if(this.getDesc(I))return;let j=I;for(;j.parentNode!=this.contentDOM;j=j.parentNode){for(;j.previousSibling;)j.parentNode.removeChild(j.previousSibling);for(;j.nextSibling;)j.parentNode.removeChild(j.nextSibling);j.pmViewDesc&&(j.pmViewDesc=void 0)}let U=new CompositionViewDesc(this,j,I,B);$.input.compositionNodes.push(U),this.children=replaceNodes(this.children,N,N+B.length,$,U)}update($,I,N,B){return this.dirty==NODE_DIRTY||!$.sameMarkup(this.node)?!1:(this.updateInner($,I,N,B),!0)}updateInner($,I,N,B){this.updateOuterDeco(I),this.node=$,this.innerDeco=N,this.contentDOM&&this.updateChildren(B,this.posAtStart),this.dirty=NOT_DIRTY}updateOuterDeco($){if(sameOuterDeco($,this.outerDeco))return;let I=this.nodeDOM.nodeType!=1,N=this.dom;this.dom=patchOuterDeco(this.dom,this.nodeDOM,computeOuterDeco(this.outerDeco,this.node,I),computeOuterDeco($,this.node,I)),this.dom!=N&&(N.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=$}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function docViewDesc(M,$,I,N,B){return applyOuterDeco(N,$,M),new NodeViewDesc(void 0,M,$,I,N,N,N,B,0)}class TextViewDesc extends NodeViewDesc{constructor($,I,N,B,j,U,q){super($,I,N,B,j,null,U,q,0)}parseRule(){let $=this.nodeDOM.parentNode;for(;$&&$!=this.dom&&!$.pmIsDeco;)$=$.parentNode;return{skip:$||!0}}update($,I,N,B){return this.dirty==NODE_DIRTY||this.dirty!=NOT_DIRTY&&!this.inParent()||!$.sameMarkup(this.node)?!1:(this.updateOuterDeco(I),(this.dirty!=NOT_DIRTY||$.text!=this.node.text)&&$.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=$.text,B.trackWrites==this.nodeDOM&&(B.trackWrites=null)),this.node=$,this.dirty=NOT_DIRTY,!0)}inParent(){let $=this.parent.contentDOM;for(let I=this.nodeDOM;I;I=I.parentNode)if(I==$)return!0;return!1}domFromPos($){return{node:this.nodeDOM,offset:$}}localPosFromDOM($,I,N){return $==this.nodeDOM?this.posAtStart+Math.min(I,this.node.text.length):super.localPosFromDOM($,I,N)}ignoreMutation($){return $.type!="characterData"&&$.type!="selection"}slice($,I,N){let B=this.node.cut($,I),j=document.createTextNode(B.text);return new TextViewDesc(this.parent,B,this.outerDeco,this.innerDeco,j,j,N)}markDirty($,I){super.markDirty($,I),this.dom!=this.nodeDOM&&($==0||I==this.nodeDOM.nodeValue.length)&&(this.dirty=NODE_DIRTY)}get domAtom(){return!1}}class TrailingHackViewDesc extends ViewDesc{parseRule(){return{ignore:!0}}matchesHack($){return this.dirty==NOT_DIRTY&&this.dom.nodeName==$}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class CustomNodeViewDesc extends NodeViewDesc{constructor($,I,N,B,j,U,q,Y,K,G){super($,I,N,B,j,U,q,K,G),this.spec=Y}update($,I,N,B){if(this.dirty==NODE_DIRTY)return!1;if(this.spec.update){let j=this.spec.update($,I,N);return j&&this.updateInner($,I,N,B),j}else return!this.contentDOM&&!$.isLeaf?!1:super.update($,I,N,B)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection($,I,N,B){this.spec.setSelection?this.spec.setSelection($,I,N):super.setSelection($,I,N,B)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent($){return this.spec.stopEvent?this.spec.stopEvent($):!1}ignoreMutation($){return this.spec.ignoreMutation?this.spec.ignoreMutation($):super.ignoreMutation($)}}function renderDescs(M,$,I){let N=M.firstChild,B=!1;for(let j=0;j<$.length;j++){let U=$[j],q=U.dom;if(q.parentNode==M){for(;q!=N;)N=rm(N),B=!0;N=N.nextSibling}else B=!0,M.insertBefore(q,N);if(U instanceof MarkViewDesc){let Y=N?N.previousSibling:M.lastChild;renderDescs(U.contentDOM,U.children,I),N=Y?Y.nextSibling:M.firstChild}}for(;N;)N=rm(N),B=!0;B&&I.trackWrites==M&&(I.trackWrites=null)}const OuterDecoLevel=function(M){M&&(this.nodeName=M)};OuterDecoLevel.prototype=Object.create(null);const noDeco=[new OuterDecoLevel];function computeOuterDeco(M,$,I){if(M.length==0)return noDeco;let N=I?noDeco[0]:new OuterDecoLevel,B=[N];for(let j=0;j>1,U=Math.min(j,$.length);for(;B-1)q>this.index&&(this.changed=!0,this.destroyBetween(this.index,q)),this.top=this.top.children[this.index];else{let Y=MarkViewDesc.create(this.top,$[j],I,N);this.top.children.splice(this.index,0,Y),this.top=Y,this.changed=!0}this.index=0,j++}}findNodeMatch($,I,N,B){let j=-1,U;if(B>=this.preMatch.index&&(U=this.preMatch.matches[B-this.preMatch.index]).parent==this.top&&U.matchesNode($,I,N))j=this.top.children.indexOf(U,this.index);else for(let q=this.index,Y=Math.min(this.top.children.length,q+5);q0;){let q;for(;;)if(N){let K=I.children[N-1];if(K instanceof MarkViewDesc)I=K,N=K.children.length;else{q=K,N--;break}}else{if(I==$)break e;N=I.parent.children.indexOf(I),I=I.parent}let Y=q.node;if(Y){if(Y!=M.child(B-1))break;--B,j.set(q,B),U.push(q)}}return{index:B,matched:j,matches:U.reverse()}}function compareSide(M,$){return M.type.side-$.type.side}function iterDeco(M,$,I,N){let B=$.locals(M),j=0;if(B.length==0){for(let K=0;Kj;)q.push(B[U++]);let Z=j+G.nodeSize;if(G.isText){let te=Z;U!te.inline):q.slice();N(G,ee,$.forChild(j,G),J),j=Z}}function iosHacks(M){if(M.nodeName=="UL"||M.nodeName=="OL"){let $=M.style.cssText;M.style.cssText=$+"; list-style: square !important",window.getComputedStyle(M).listStyle,M.style.cssText=$}}function nearbyTextNode(M,$){for(;;){if(M.nodeType==3)return M;if(M.nodeType==1&&$>0){if(M.childNodes.length>$&&M.childNodes[$].nodeType==3)return M.childNodes[$];M=M.childNodes[$-1],$=nodeSize(M)}else if(M.nodeType==1&&$=I){let K=q=0&&K+$.length+q>=I)return q+K;if(I==N&&Y.length>=N+$.length-q&&Y.slice(N-q,N-q+$.length)==$)return N}}return-1}function replaceNodes(M,$,I,N,B){let j=[];for(let U=0,q=0;U=I||G<=$?j.push(Y):(K<$&&j.push(Y.slice(0,$-K,N)),B&&(j.push(B),B=void 0),G>I&&j.push(Y.slice(I-K,Y.size,N)))}return j}function selectionFromDOM(M,$=null){let I=M.domSelectionRange(),N=M.state.doc;if(!I.focusNode)return null;let B=M.docView.nearestDesc(I.focusNode),j=B&&B.size==0,U=M.docView.posFromDOM(I.focusNode,I.focusOffset,1);if(U<0)return null;let q=N.resolve(U),Y,K;if(selectionCollapsed(I)){for(Y=q;B&&!B.node;)B=B.parent;let G=B.node;if(B&&G.isAtom&&NodeSelection.isSelectable(G)&&B.parent&&!(G.isInline&&isOnEdge(I.focusNode,I.focusOffset,B.dom))){let J=B.posBefore;K=new NodeSelection(U==J?q:N.resolve(J))}}else{let G=M.docView.posFromDOM(I.anchorNode,I.anchorOffset,1);if(G<0)return null;Y=N.resolve(G)}if(!K){let G=$=="pointer"||M.state.selection.head{(I.anchorNode!=N||I.anchorOffset!=B)&&($.removeEventListener("selectionchange",M.input.hideSelectionGuard),setTimeout(()=>{(!editorOwnsSelection(M)||M.state.selection.visible)&&M.dom.classList.remove("ProseMirror-hideselection")},20))})}function selectCursorWrapper(M){let $=M.domSelection(),I=document.createRange(),N=M.cursorWrapper.dom,B=N.nodeName=="IMG";B?I.setEnd(N.parentNode,domIndex(N)+1):I.setEnd(N,0),I.collapse(!1),$.removeAllRanges(),$.addRange(I),!B&&!M.state.selection.visible&&ie$1&&ie_version<=11&&(N.disabled=!0,N.disabled=!1)}function syncNodeSelection(M,$){if($ instanceof NodeSelection){let I=M.docView.descAt($.from);I!=M.lastSelectedViewDesc&&(clearNodeSelection(M),I&&I.selectNode(),M.lastSelectedViewDesc=I)}else clearNodeSelection(M)}function clearNodeSelection(M){M.lastSelectedViewDesc&&(M.lastSelectedViewDesc.parent&&M.lastSelectedViewDesc.deselectNode(),M.lastSelectedViewDesc=void 0)}function selectionBetween(M,$,I,N){return M.someProp("createSelectionBetween",B=>B(M,$,I))||TextSelection.between($,I,N)}function hasFocusAndSelection(M){return M.editable&&!M.hasFocus()?!1:hasSelection(M)}function hasSelection(M){let $=M.domSelectionRange();if(!$.anchorNode)return!1;try{return M.dom.contains($.anchorNode.nodeType==3?$.anchorNode.parentNode:$.anchorNode)&&(M.editable||M.dom.contains($.focusNode.nodeType==3?$.focusNode.parentNode:$.focusNode))}catch{return!1}}function anchorInRightPlace(M){let $=M.docView.domFromPos(M.state.selection.anchor,0),I=M.domSelectionRange();return isEquivalentPosition($.node,$.offset,I.anchorNode,I.anchorOffset)}function moveSelectionBlock(M,$){let{$anchor:I,$head:N}=M.selection,B=$>0?I.max(N):I.min(N),j=B.parent.inlineContent?B.depth?M.doc.resolve($>0?B.after():B.before()):null:B;return j&&Selection.findFrom(j,$)}function apply(M,$){return M.dispatch(M.state.tr.setSelection($).scrollIntoView()),!0}function selectHorizontally(M,$,I){let N=M.state.selection;if(N instanceof TextSelection){if(!N.empty||I.indexOf("s")>-1)return!1;if(M.endOfTextblock($>0?"right":"left")){let B=moveSelectionBlock(M.state,$);return B&&B instanceof NodeSelection?apply(M,B):!1}else if(!(mac$3&&I.indexOf("m")>-1)){let B=N.$head,j=B.textOffset?null:$<0?B.nodeBefore:B.nodeAfter,U;if(!j||j.isText)return!1;let q=$<0?B.pos-j.nodeSize:B.pos;return j.isAtom||(U=M.docView.descAt(q))&&!U.contentDOM?NodeSelection.isSelectable(j)?apply(M,new NodeSelection($<0?M.state.doc.resolve(B.pos-j.nodeSize):B)):webkit?apply(M,new TextSelection(M.state.doc.resolve($<0?q:q+j.nodeSize))):!1:!1}}else{if(N instanceof NodeSelection&&N.node.isInline)return apply(M,new TextSelection($>0?N.$to:N.$from));{let B=moveSelectionBlock(M.state,$);return B?apply(M,B):!1}}}function nodeLen(M){return M.nodeType==3?M.nodeValue.length:M.childNodes.length}function isIgnorable(M){let $=M.pmViewDesc;return $&&$.size==0&&(M.nextSibling||M.nodeName!="BR")}function skipIgnoredNodesLeft(M){let $=M.domSelectionRange(),I=$.focusNode,N=$.focusOffset;if(!I)return;let B,j,U=!1;for(gecko&&I.nodeType==1&&N0){if(I.nodeType!=1)break;{let q=I.childNodes[N-1];if(isIgnorable(q))B=I,j=--N;else if(q.nodeType==3)I=q,N=I.nodeValue.length;else break}}else{if(isBlockNode(I))break;{let q=I.previousSibling;for(;q&&isIgnorable(q);)B=I.parentNode,j=domIndex(q),q=q.previousSibling;if(q)I=q,N=nodeLen(I);else{if(I=I.parentNode,I==M.dom)break;N=0}}}U?setSelFocus(M,I,N):B&&setSelFocus(M,B,j)}function skipIgnoredNodesRight(M){let $=M.domSelectionRange(),I=$.focusNode,N=$.focusOffset;if(!I)return;let B=nodeLen(I),j,U;for(;;)if(N{M.state==B&&selectionToDOM(M)},50)}function selectVertically(M,$,I){let N=M.state.selection;if(N instanceof TextSelection&&!N.empty||I.indexOf("s")>-1||mac$3&&I.indexOf("m")>-1)return!1;let{$from:B,$to:j}=N;if(!B.parent.inlineContent||M.endOfTextblock($<0?"up":"down")){let U=moveSelectionBlock(M.state,$);if(U&&U instanceof NodeSelection)return apply(M,U)}if(!B.parent.inlineContent){let U=$<0?B:j,q=N instanceof AllSelection?Selection.near(U,$):Selection.findFrom(U,$);return q?apply(M,q):!1}return!1}function stopNativeHorizontalDelete(M,$){if(!(M.state.selection instanceof TextSelection))return!0;let{$head:I,$anchor:N,empty:B}=M.state.selection;if(!I.sameParent(N))return!0;if(!B)return!1;if(M.endOfTextblock($>0?"forward":"backward"))return!0;let j=!I.textOffset&&($<0?I.nodeBefore:I.nodeAfter);if(j&&!j.isText){let U=M.state.tr;return $<0?U.delete(I.pos-j.nodeSize,I.pos):U.delete(I.pos,I.pos+j.nodeSize),M.dispatch(U),!0}return!1}function switchEditable(M,$,I){M.domObserver.stop(),$.contentEditable=I,M.domObserver.start()}function safariDownArrowBug(M){if(!safari||M.state.selection.$head.parentOffset>0)return!1;let{focusNode:$,focusOffset:I}=M.domSelectionRange();if($&&$.nodeType==1&&I==0&&$.firstChild&&$.firstChild.contentEditable=="false"){let N=$.firstChild;switchEditable(M,N,"true"),setTimeout(()=>switchEditable(M,N,"false"),20)}return!1}function getMods(M){let $="";return M.ctrlKey&&($+="c"),M.metaKey&&($+="m"),M.altKey&&($+="a"),M.shiftKey&&($+="s"),$}function captureKeyDown(M,$){let I=$.keyCode,N=getMods($);return I==8||mac$3&&I==72&&N=="c"?stopNativeHorizontalDelete(M,-1)||skipIgnoredNodesLeft(M):I==46||mac$3&&I==68&&N=="c"?stopNativeHorizontalDelete(M,1)||skipIgnoredNodesRight(M):I==13||I==27?!0:I==37||mac$3&&I==66&&N=="c"?selectHorizontally(M,-1,N)||skipIgnoredNodesLeft(M):I==39||mac$3&&I==70&&N=="c"?selectHorizontally(M,1,N)||skipIgnoredNodesRight(M):I==38||mac$3&&I==80&&N=="c"?selectVertically(M,-1,N)||skipIgnoredNodesLeft(M):I==40||mac$3&&I==78&&N=="c"?safariDownArrowBug(M)||selectVertically(M,1,N)||skipIgnoredNodesRight(M):N==(mac$3?"m":"c")&&(I==66||I==73||I==89||I==90)}function serializeForClipboard(M,$){M.someProp("transformCopied",ee=>{$=ee($,M)});let I=[],{content:N,openStart:B,openEnd:j}=$;for(;B>1&&j>1&&N.childCount==1&&N.firstChild.childCount==1;){B--,j--;let ee=N.firstChild;I.push(ee.type.name,ee.attrs!=ee.type.defaultAttrs?ee.attrs:null),N=ee.content}let U=M.someProp("clipboardSerializer")||DOMSerializer.fromSchema(M.state.schema),q=detachedDoc(),Y=q.createElement("div");Y.appendChild(U.serializeFragment(N,{document:q}));let K=Y.firstChild,G,J=0;for(;K&&K.nodeType==1&&(G=wrapMap[K.nodeName.toLowerCase()]);){for(let ee=G.length-1;ee>=0;ee--){let te=q.createElement(G[ee]);for(;Y.firstChild;)te.appendChild(Y.firstChild);Y.appendChild(te),J++}K=Y.firstChild}K&&K.nodeType==1&&K.setAttribute("data-pm-slice",`${B} ${j}${J?` -${J}`:""} ${JSON.stringify(I)}`);let Z=M.someProp("clipboardTextSerializer",ee=>ee($,M))||$.content.textBetween(0,$.content.size,` `);return{dom:Y,text:Z}}function parseFromClipboard(M,$,I,N,B){let j=B.parent.type.spec.code,U,q;if(!I&&!$)return null;let Y=$&&(N||j||!I);if(Y){if(M.someProp("transformPastedText",Z=>{$=Z($,j||N,M)}),j)return $?new Slice(Fragment.from(M.state.schema.text($.replace(/\r\n?/g,` `))),0,0):Slice.empty;let J=M.someProp("clipboardTextParser",Z=>Z($,B,N,M));if(J)q=J;else{let Z=B.marks(),{schema:ee}=M.state,te=DOMSerializer.fromSchema(ee);U=document.createElement("div"),$.split(/(?:\r\n?|\n)+/).forEach(re=>{let se=U.appendChild(document.createElement("p"));re&&se.appendChild(te.serializeNode(ee.text(re,Z)))})}}else M.someProp("transformPastedHTML",J=>{I=J(I,M)}),U=readHTML(I),webkit&&restoreReplacedSpaces(U);let K=U&&U.querySelector("[data-pm-slice]"),G=K&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(K.getAttribute("data-pm-slice")||"");if(G&&G[3])for(let J=+G[3];J>0;J--){let Z=U.firstChild;for(;Z&&Z.nodeType!=1;)Z=Z.nextSibling;if(!Z)break;U=Z}if(q||(q=(M.someProp("clipboardParser")||M.someProp("domParser")||DOMParser.fromSchema(M.state.schema)).parseSlice(U,{preserveWhitespace:!!(Y||G),context:B,ruleFromNode(Z){return Z.nodeName=="BR"&&!Z.nextSibling&&Z.parentNode&&!inlineParents.test(Z.parentNode.nodeName)?{ignore:!0}:null}})),G)q=addContext(closeSlice(q,+G[1],+G[2]),G[4]);else if(q=Slice.maxOpen(normalizeSiblings(q.content,B),!0),q.openStart||q.openEnd){let J=0,Z=0;for(let ee=q.content.firstChild;J{q=J(q,M)}),q}const inlineParents=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function normalizeSiblings(M,$){if(M.childCount<2)return M;for(let I=$.depth;I>=0;I--){let B=$.node(I).contentMatchAt($.index(I)),j,U=[];if(M.forEach(q=>{if(!U)return;let Y=B.findWrapping(q.type),K;if(!Y)return U=null;if(K=U.length&&j.length&&addToSibling(Y,j,q,U[U.length-1],0))U[U.length-1]=K;else{U.length&&(U[U.length-1]=closeRight(U[U.length-1],j.length));let G=withWrappers(q,Y);U.push(G),B=B.matchType(G.type),j=Y}}),U)return Fragment.from(U)}return M}function withWrappers(M,$,I=0){for(let N=$.length-1;N>=I;N--)M=$[N].create(null,Fragment.from(M));return M}function addToSibling(M,$,I,N,B){if(B=I&&(q=$<0?U.contentMatchAt(0).fillBefore(q,M.childCount>1||j<=B).append(q):q.append(U.contentMatchAt(U.childCount).fillBefore(Fragment.empty,!0))),M.replaceChild($<0?0:M.childCount-1,U.copy(q))}function closeSlice(M,$,I){return $]*>)*/.exec(M);$&&(M=M.slice($[0].length));let I=detachedDoc().createElement("div"),N=/<([a-z][^>\s]+)/i.exec(M),B;if((B=N&&wrapMap[N[1].toLowerCase()])&&(M=B.map(j=>"<"+j+">").join("")+M+B.map(j=>"").reverse().join("")),I.innerHTML=M,B)for(let j=0;j=0;q-=2){let Y=I.nodes[N[q]];if(!Y||Y.hasRequiredAttrs())break;B=Fragment.from(Y.create(N[q+1],B)),j++,U++}return new Slice(B,j,U)}const handlers={},editHandlers={},passiveHandlers={touchstart:!0,touchmove:!0};class InputState{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function initInput(M){for(let $ in handlers){let I=handlers[$];M.dom.addEventListener($,M.input.eventHandlers[$]=N=>{eventBelongsToView(M,N)&&!runCustomHandler(M,N)&&(M.editable||!(N.type in editHandlers))&&I(M,N)},passiveHandlers[$]?{passive:!0}:void 0)}safari&&M.dom.addEventListener("input",()=>null),ensureListeners(M)}function setSelectionOrigin(M,$){M.input.lastSelectionOrigin=$,M.input.lastSelectionTime=Date.now()}function destroyInput(M){M.domObserver.stop();for(let $ in M.input.eventHandlers)M.dom.removeEventListener($,M.input.eventHandlers[$]);clearTimeout(M.input.composingTimeout),clearTimeout(M.input.lastIOSEnterFallbackTimeout)}function ensureListeners(M){M.someProp("handleDOMEvents",$=>{for(let I in $)M.input.eventHandlers[I]||M.dom.addEventListener(I,M.input.eventHandlers[I]=N=>runCustomHandler(M,N))})}function runCustomHandler(M,$){return M.someProp("handleDOMEvents",I=>{let N=I[$.type];return N?N(M,$)||$.defaultPrevented:!1})}function eventBelongsToView(M,$){if(!$.bubbles)return!0;if($.defaultPrevented)return!1;for(let I=$.target;I!=M.dom;I=I.parentNode)if(!I||I.nodeType==11||I.pmViewDesc&&I.pmViewDesc.stopEvent($))return!1;return!0}function dispatchEvent(M,$){!runCustomHandler(M,$)&&handlers[$.type]&&(M.editable||!($.type in editHandlers))&&handlers[$.type](M,$)}editHandlers.keydown=(M,$)=>{let I=$;if(M.input.shiftKey=I.keyCode==16||I.shiftKey,!inOrNearComposition(M,I)&&(M.input.lastKeyCode=I.keyCode,M.input.lastKeyCodeTime=Date.now(),!(android&&chrome$1&&I.keyCode==13)))if(I.keyCode!=229&&M.domObserver.forceFlush(),ios&&I.keyCode==13&&!I.ctrlKey&&!I.altKey&&!I.metaKey){let N=Date.now();M.input.lastIOSEnter=N,M.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{M.input.lastIOSEnter==N&&(M.someProp("handleKeyDown",B=>B(M,keyEvent(13,"Enter"))),M.input.lastIOSEnter=0)},200)}else M.someProp("handleKeyDown",N=>N(M,I))||captureKeyDown(M,I)?I.preventDefault():setSelectionOrigin(M,"key")};editHandlers.keyup=(M,$)=>{$.keyCode==16&&(M.input.shiftKey=!1)};editHandlers.keypress=(M,$)=>{let I=$;if(inOrNearComposition(M,I)||!I.charCode||I.ctrlKey&&!I.altKey||mac$3&&I.metaKey)return;if(M.someProp("handleKeyPress",B=>B(M,I))){I.preventDefault();return}let N=M.state.selection;if(!(N instanceof TextSelection)||!N.$from.sameParent(N.$to)){let B=String.fromCharCode(I.charCode);!/[\r\n]/.test(B)&&!M.someProp("handleTextInput",j=>j(M,N.$from.pos,N.$to.pos,B))&&M.dispatch(M.state.tr.insertText(B).scrollIntoView()),I.preventDefault()}};function eventCoords(M){return{left:M.clientX,top:M.clientY}}function isNear(M,$){let I=$.x-M.clientX,N=$.y-M.clientY;return I*I+N*N<100}function runHandlerOnContext(M,$,I,N,B){if(N==-1)return!1;let j=M.state.doc.resolve(N);for(let U=j.depth+1;U>0;U--)if(M.someProp($,q=>U>j.depth?q(M,I,j.nodeAfter,j.before(U),B,!0):q(M,I,j.node(U),j.before(U),B,!1)))return!0;return!1}function updateSelection(M,$,I){M.focused||M.focus();let N=M.state.tr.setSelection($);I=="pointer"&&N.setMeta("pointer",!0),M.dispatch(N)}function selectClickedLeaf(M,$){if($==-1)return!1;let I=M.state.doc.resolve($),N=I.nodeAfter;return N&&N.isAtom&&NodeSelection.isSelectable(N)?(updateSelection(M,new NodeSelection(I),"pointer"),!0):!1}function selectClickedNode(M,$){if($==-1)return!1;let I=M.state.selection,N,B;I instanceof NodeSelection&&(N=I.node);let j=M.state.doc.resolve($);for(let U=j.depth+1;U>0;U--){let q=U>j.depth?j.nodeAfter:j.node(U);if(NodeSelection.isSelectable(q)){N&&I.$from.depth>0&&U>=I.$from.depth&&j.before(I.$from.depth+1)==I.$from.pos?B=j.before(I.$from.depth):B=j.before(U);break}}return B!=null?(updateSelection(M,NodeSelection.create(M.state.doc,B),"pointer"),!0):!1}function handleSingleClick(M,$,I,N,B){return runHandlerOnContext(M,"handleClickOn",$,I,N)||M.someProp("handleClick",j=>j(M,$,N))||(B?selectClickedNode(M,I):selectClickedLeaf(M,I))}function handleDoubleClick(M,$,I,N){return runHandlerOnContext(M,"handleDoubleClickOn",$,I,N)||M.someProp("handleDoubleClick",B=>B(M,$,N))}function handleTripleClick$1(M,$,I,N){return runHandlerOnContext(M,"handleTripleClickOn",$,I,N)||M.someProp("handleTripleClick",B=>B(M,$,N))||defaultTripleClick(M,I,N)}function defaultTripleClick(M,$,I){if(I.button!=0)return!1;let N=M.state.doc;if($==-1)return N.inlineContent?(updateSelection(M,TextSelection.create(N,0,N.content.size),"pointer"),!0):!1;let B=N.resolve($);for(let j=B.depth+1;j>0;j--){let U=j>B.depth?B.nodeAfter:B.node(j),q=B.before(j);if(U.inlineContent)updateSelection(M,TextSelection.create(N,q+1,q+1+U.content.size),"pointer");else if(NodeSelection.isSelectable(U))updateSelection(M,NodeSelection.create(N,q),"pointer");else continue;return!0}}function forceDOMFlush(M){return endComposition(M)}const selectNodeModifier=mac$3?"metaKey":"ctrlKey";handlers.mousedown=(M,$)=>{let I=$;M.input.shiftKey=I.shiftKey;let N=forceDOMFlush(M),B=Date.now(),j="singleClick";B-M.input.lastClick.time<500&&isNear(I,M.input.lastClick)&&!I[selectNodeModifier]&&(M.input.lastClick.type=="singleClick"?j="doubleClick":M.input.lastClick.type=="doubleClick"&&(j="tripleClick")),M.input.lastClick={time:B,x:I.clientX,y:I.clientY,type:j};let U=M.posAtCoords(eventCoords(I));U&&(j=="singleClick"?(M.input.mouseDown&&M.input.mouseDown.done(),M.input.mouseDown=new MouseDown(M,U,I,!!N)):(j=="doubleClick"?handleDoubleClick:handleTripleClick$1)(M,U.pos,U.inside,I)?I.preventDefault():setSelectionOrigin(M,"pointer"))};class MouseDown{constructor($,I,N,B){this.view=$,this.pos=I,this.event=N,this.flushed=B,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=$.state.doc,this.selectNode=!!N[selectNodeModifier],this.allowDefault=N.shiftKey;let j,U;if(I.inside>-1)j=$.state.doc.nodeAt(I.inside),U=I.inside;else{let G=$.state.doc.resolve(I.pos);j=G.parent,U=G.depth?G.before():0}const q=B?null:N.target,Y=q?$.docView.nearestDesc(q,!0):null;this.target=Y?Y.dom:null;let{selection:K}=$.state;(N.button==0&&j.type.spec.draggable&&j.type.spec.selectable!==!1||K instanceof NodeSelection&&K.from<=U&&K.to>U)&&(this.mightDrag={node:j,pos:U,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&gecko&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),$.root.addEventListener("mouseup",this.up=this.up.bind(this)),$.root.addEventListener("mousemove",this.move=this.move.bind(this)),setSelectionOrigin($,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>selectionToDOM(this.view)),this.view.input.mouseDown=null}up($){if(this.done(),!this.view.dom.contains($.target))return;let I=this.pos;this.view.state.doc!=this.startDoc&&(I=this.view.posAtCoords(eventCoords($))),this.updateAllowDefault($),this.allowDefault||!I?setSelectionOrigin(this.view,"pointer"):handleSingleClick(this.view,I.pos,I.inside,$,this.selectNode)?$.preventDefault():$.button==0&&(this.flushed||safari&&this.mightDrag&&!this.mightDrag.node.isAtom||chrome$1&&!this.view.state.selection.visible&&Math.min(Math.abs(I.pos-this.view.state.selection.from),Math.abs(I.pos-this.view.state.selection.to))<=2)?(updateSelection(this.view,Selection.near(this.view.state.doc.resolve(I.pos)),"pointer"),$.preventDefault()):setSelectionOrigin(this.view,"pointer")}move($){this.updateAllowDefault($),setSelectionOrigin(this.view,"pointer"),$.buttons==0&&this.done()}updateAllowDefault($){!this.allowDefault&&(Math.abs(this.event.x-$.clientX)>4||Math.abs(this.event.y-$.clientY)>4)&&(this.allowDefault=!0)}}handlers.touchstart=M=>{M.input.lastTouch=Date.now(),forceDOMFlush(M),setSelectionOrigin(M,"pointer")};handlers.touchmove=M=>{M.input.lastTouch=Date.now(),setSelectionOrigin(M,"pointer")};handlers.contextmenu=M=>forceDOMFlush(M);function inOrNearComposition(M,$){return M.composing?!0:safari&&Math.abs($.timeStamp-M.input.compositionEndedAt)<500?(M.input.compositionEndedAt=-2e8,!0):!1}const timeoutComposition=android?5e3:-1;editHandlers.compositionstart=editHandlers.compositionupdate=M=>{if(!M.composing){M.domObserver.flush();let{state:$}=M,I=$.selection.$from;if($.selection.empty&&($.storedMarks||!I.textOffset&&I.parentOffset&&I.nodeBefore.marks.some(N=>N.type.spec.inclusive===!1)))M.markCursor=M.state.storedMarks||I.marks(),endComposition(M,!0),M.markCursor=null;else if(endComposition(M),gecko&&$.selection.empty&&I.parentOffset&&!I.textOffset&&I.nodeBefore.marks.length){let N=M.domSelectionRange();for(let B=N.focusNode,j=N.focusOffset;B&&B.nodeType==1&&j!=0;){let U=j<0?B.lastChild:B.childNodes[j-1];if(!U)break;if(U.nodeType==3){M.domSelection().collapse(U,U.nodeValue.length);break}else B=U,j=-1}}M.input.composing=!0}scheduleComposeEnd(M,timeoutComposition)};editHandlers.compositionend=(M,$)=>{M.composing&&(M.input.composing=!1,M.input.compositionEndedAt=$.timeStamp,scheduleComposeEnd(M,20))};function scheduleComposeEnd(M,$){clearTimeout(M.input.composingTimeout),$>-1&&(M.input.composingTimeout=setTimeout(()=>endComposition(M),$))}function clearComposition(M){for(M.composing&&(M.input.composing=!1,M.input.compositionEndedAt=timestampFromCustomEvent());M.input.compositionNodes.length>0;)M.input.compositionNodes.pop().markParentsDirty()}function timestampFromCustomEvent(){let M=document.createEvent("Event");return M.initEvent("event",!0,!0),M.timeStamp}function endComposition(M,$=!1){if(!(android&&M.domObserver.flushingSoon>=0)){if(M.domObserver.forceFlush(),clearComposition(M),$||M.docView&&M.docView.dirty){let I=selectionFromDOM(M);return I&&!I.eq(M.state.selection)?M.dispatch(M.state.tr.setSelection(I)):M.updateState(M.state),!0}return!1}}function captureCopy(M,$){if(!M.dom.parentNode)return;let I=M.dom.parentNode.appendChild(document.createElement("div"));I.appendChild($),I.style.cssText="position: fixed; left: -10000px; top: 10px";let N=getSelection(),B=document.createRange();B.selectNodeContents($),M.dom.blur(),N.removeAllRanges(),N.addRange(B),setTimeout(()=>{I.parentNode&&I.parentNode.removeChild(I),M.focus()},50)}const brokenClipboardAPI=ie$1&&ie_version<15||ios&&webkit_version<604;handlers.copy=editHandlers.cut=(M,$)=>{let I=$,N=M.state.selection,B=I.type=="cut";if(N.empty)return;let j=brokenClipboardAPI?null:I.clipboardData,U=N.content(),{dom:q,text:Y}=serializeForClipboard(M,U);j?(I.preventDefault(),j.clearData(),j.setData("text/html",q.innerHTML),j.setData("text/plain",Y)):captureCopy(M,q),B&&M.dispatch(M.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function sliceSingleNode(M){return M.openStart==0&&M.openEnd==0&&M.content.childCount==1?M.content.firstChild:null}function capturePaste(M,$){if(!M.dom.parentNode)return;let I=M.input.shiftKey||M.state.selection.$from.parent.type.spec.code,N=M.dom.parentNode.appendChild(document.createElement(I?"textarea":"div"));I||(N.contentEditable="true"),N.style.cssText="position: fixed; left: -10000px; top: 10px",N.focus(),setTimeout(()=>{M.focus(),N.parentNode&&N.parentNode.removeChild(N),I?doPaste(M,N.value,null,M.input.shiftKey,$):doPaste(M,N.textContent,N.innerHTML,M.input.shiftKey,$)},50)}function doPaste(M,$,I,N,B){let j=parseFromClipboard(M,$,I,N,M.state.selection.$from);if(M.someProp("handlePaste",Y=>Y(M,B,j||Slice.empty)))return!0;if(!j)return!1;let U=sliceSingleNode(j),q=U?M.state.tr.replaceSelectionWith(U,M.input.shiftKey):M.state.tr.replaceSelection(j);return M.dispatch(q.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}editHandlers.paste=(M,$)=>{let I=$;if(M.composing&&!android)return;let N=brokenClipboardAPI?null:I.clipboardData;N&&doPaste(M,N.getData("text/plain"),N.getData("text/html"),M.input.shiftKey,I)?I.preventDefault():capturePaste(M,I)};class Dragging{constructor($,I){this.slice=$,this.move=I}}const dragCopyModifier=mac$3?"altKey":"ctrlKey";handlers.dragstart=(M,$)=>{let I=$,N=M.input.mouseDown;if(N&&N.done(),!I.dataTransfer)return;let B=M.state.selection,j=B.empty?null:M.posAtCoords(eventCoords(I));if(!(j&&j.pos>=B.from&&j.pos<=(B instanceof NodeSelection?B.to-1:B.to))){if(N&&N.mightDrag)M.dispatch(M.state.tr.setSelection(NodeSelection.create(M.state.doc,N.mightDrag.pos)));else if(I.target&&I.target.nodeType==1){let K=M.docView.nearestDesc(I.target,!0);K&&K.node.type.spec.draggable&&K!=M.docView&&M.dispatch(M.state.tr.setSelection(NodeSelection.create(M.state.doc,K.posBefore)))}}let U=M.state.selection.content(),{dom:q,text:Y}=serializeForClipboard(M,U);I.dataTransfer.clearData(),I.dataTransfer.setData(brokenClipboardAPI?"Text":"text/html",q.innerHTML),I.dataTransfer.effectAllowed="copyMove",brokenClipboardAPI||I.dataTransfer.setData("text/plain",Y),M.dragging=new Dragging(U,!I[dragCopyModifier])};handlers.dragend=M=>{let $=M.dragging;window.setTimeout(()=>{M.dragging==$&&(M.dragging=null)},50)};editHandlers.dragover=editHandlers.dragenter=(M,$)=>$.preventDefault();editHandlers.drop=(M,$)=>{let I=$,N=M.dragging;if(M.dragging=null,!I.dataTransfer)return;let B=M.posAtCoords(eventCoords(I));if(!B)return;let j=M.state.doc.resolve(B.pos),U=N&&N.slice;U?M.someProp("transformPasted",te=>{U=te(U,M)}):U=parseFromClipboard(M,I.dataTransfer.getData(brokenClipboardAPI?"Text":"text/plain"),brokenClipboardAPI?null:I.dataTransfer.getData("text/html"),!1,j);let q=!!(N&&!I[dragCopyModifier]);if(M.someProp("handleDrop",te=>te(M,I,U||Slice.empty,q))){I.preventDefault();return}if(!U)return;I.preventDefault();let Y=U?dropPoint(M.state.doc,j.pos,U):j.pos;Y==null&&(Y=j.pos);let K=M.state.tr;q&&K.deleteSelection();let G=K.mapping.map(Y),J=U.openStart==0&&U.openEnd==0&&U.content.childCount==1,Z=K.doc;if(J?K.replaceRangeWith(G,G,U.content.firstChild):K.replaceRange(G,G,U),K.doc.eq(Z))return;let ee=K.doc.resolve(G);if(J&&NodeSelection.isSelectable(U.content.firstChild)&&ee.nodeAfter&&ee.nodeAfter.sameMarkup(U.content.firstChild))K.setSelection(new NodeSelection(ee));else{let te=K.mapping.map(Y);K.mapping.maps[K.mapping.maps.length-1].forEach((re,se,ne,le)=>te=le),K.setSelection(selectionBetween(M,ee,K.doc.resolve(te)))}M.focus(),M.dispatch(K.setMeta("uiEvent","drop"))};handlers.focus=M=>{M.input.lastFocus=Date.now(),M.focused||(M.domObserver.stop(),M.dom.classList.add("ProseMirror-focused"),M.domObserver.start(),M.focused=!0,setTimeout(()=>{M.docView&&M.hasFocus()&&!M.domObserver.currentSelection.eq(M.domSelectionRange())&&selectionToDOM(M)},20))};handlers.blur=(M,$)=>{let I=$;M.focused&&(M.domObserver.stop(),M.dom.classList.remove("ProseMirror-focused"),M.domObserver.start(),I.relatedTarget&&M.dom.contains(I.relatedTarget)&&M.domObserver.currentSelection.clear(),M.focused=!1)};handlers.beforeinput=(M,$)=>{if(chrome$1&&android&&$.inputType=="deleteContentBackward"){M.domObserver.flushSoon();let{domChangeCount:N}=M.input;setTimeout(()=>{if(M.input.domChangeCount!=N||(M.dom.blur(),M.focus(),M.someProp("handleKeyDown",j=>j(M,keyEvent(8,"Backspace")))))return;let{$cursor:B}=M.state.selection;B&&B.pos>0&&M.dispatch(M.state.tr.delete(B.pos-1,B.pos).scrollIntoView())},50)}};for(let M in editHandlers)handlers[M]=editHandlers[M];function compareObjs(M,$){if(M==$)return!0;for(let I in M)if(M[I]!==$[I])return!1;for(let I in $)if(!(I in M))return!1;return!0}class WidgetType{constructor($,I){this.toDOM=$,this.spec=I||noSpec,this.side=this.spec.side||0}map($,I,N,B){let{pos:j,deleted:U}=$.mapResult(I.from+B,this.side<0?-1:1);return U?null:new Decoration(j-N,j-N,this)}valid(){return!0}eq($){return this==$||$ instanceof WidgetType&&(this.spec.key&&this.spec.key==$.spec.key||this.toDOM==$.toDOM&&compareObjs(this.spec,$.spec))}destroy($){this.spec.destroy&&this.spec.destroy($)}}class InlineType{constructor($,I){this.attrs=$,this.spec=I||noSpec}map($,I,N,B){let j=$.map(I.from+B,this.spec.inclusiveStart?-1:1)-N,U=$.map(I.to+B,this.spec.inclusiveEnd?1:-1)-N;return j>=U?null:new Decoration(j,U,this)}valid($,I){return I.from=$&&(!j||j(q.spec))&&N.push(q.copy(q.from+B,q.to+B))}for(let U=0;U$){let q=this.children[U]+1;this.children[U+2].findInner($-q,I-q,N,B+q,j)}}map($,I,N){return this==empty||$.maps.length==0?this:this.mapInner($,I,0,0,N||noSpec)}mapInner($,I,N,B,j){let U;for(let q=0;q{let K=Y+N,G;if(G=takeSpansForNode(I,q,K)){for(B||(B=this.children.slice());jq&&J.to=$){this.children[q]==$&&(N=this.children[q+2]);break}let j=$+1,U=j+I.content.size;for(let q=0;qj&&Y.type instanceof InlineType){let K=Math.max(j,Y.from)-j,G=Math.min(U,Y.to)-j;KB.map($,I,noSpec));return DecorationGroup.from(N)}forChild($,I){if(I.isLeaf)return DecorationSet.empty;let N=[];for(let B=0;BI instanceof DecorationSet)?$:$.reduce((I,N)=>I.concat(N instanceof DecorationSet?N:N.members),[]))}}}function mapChildren(M,$,I,N,B,j,U){let q=M.slice();for(let K=0,G=j;K{let se=re-te-(ee-Z);for(let ne=0;nele+G-J)continue;let ge=q[ne]+G-J;ee>=ge?q[ne+1]=Z<=ge?-2:-1:te>=B&&se&&(q[ne]+=se,q[ne+1]+=se)}J+=se}),G=I.maps[K].map(G,-1)}let Y=!1;for(let K=0;K=N.content.size){Y=!0;continue}let Z=I.map(M[K+1]+j,-1),ee=Z-B,{index:te,offset:re}=N.content.findIndex(J),se=N.maybeChild(te);if(se&&re==J&&re+se.nodeSize==ee){let ne=q[K+2].mapInner(I,se,G+1,M[K]+j+1,U);ne!=empty?(q[K]=J,q[K+1]=ee,q[K+2]=ne):(q[K+1]=-2,Y=!0)}else Y=!0}if(Y){let K=mapAndGatherRemainingDecorations(q,M,$,I,B,j,U),G=buildTree(K,N,0,U);$=G.local;for(let J=0;JI&&U.to{let K=takeSpansForNode(M,q,Y+I);if(K){j=!0;let G=buildTree(K,q,I+Y+1,N);G!=empty&&B.push(Y,Y+q.nodeSize,G)}});let U=moveSpans(j?withoutNulls(M):M,-I).sort(byPos);for(let q=0;q0;)$++;M.splice($,0,I)}function viewDecorations(M){let $=[];return M.someProp("decorations",I=>{let N=I(M.state);N&&N!=empty&&$.push(N)}),M.cursorWrapper&&$.push(DecorationSet.create(M.state.doc,[M.cursorWrapper.deco])),DecorationGroup.from($)}const observeOptions={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},useCharData=ie$1&&ie_version<=11;class SelectionState{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set($){this.anchorNode=$.anchorNode,this.anchorOffset=$.anchorOffset,this.focusNode=$.focusNode,this.focusOffset=$.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq($){return $.anchorNode==this.anchorNode&&$.anchorOffset==this.anchorOffset&&$.focusNode==this.focusNode&&$.focusOffset==this.focusOffset}}class DOMObserver{constructor($,I){this.view=$,this.handleDOMChange=I,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new SelectionState,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(N=>{for(let B=0;BB.type=="childList"&&B.removedNodes.length||B.type=="characterData"&&B.oldValue.length>B.target.nodeValue.length)?this.flushSoon():this.flush()}),useCharData&&(this.onCharData=N=>{this.queue.push({target:N.target,type:"characterData",oldValue:N.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,observeOptions)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let $=this.observer.takeRecords();if($.length){for(let I=0;I<$.length;I++)this.queue.push($[I]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(hasFocusAndSelection(this.view)){if(this.suppressingSelectionUpdates)return selectionToDOM(this.view);if(ie$1&&ie_version<=11&&!this.view.state.selection.empty){let $=this.view.domSelectionRange();if($.focusNode&&isEquivalentPosition($.focusNode,$.focusOffset,$.anchorNode,$.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange($){if(!$.focusNode)return!0;let I=new Set,N;for(let j=$.focusNode;j;j=parentNode(j))I.add(j);for(let j=$.anchorNode;j;j=parentNode(j))if(I.has(j)){N=j;break}let B=N&&this.view.docView.nearestDesc(N);if(B&&B.ignoreMutation({type:"selection",target:N.nodeType==3?N.parentNode:N}))return this.setCurSelection(),!0}flush(){let{view:$}=this;if(!$.docView||this.flushingSoon>-1)return;let I=this.observer?this.observer.takeRecords():[];this.queue.length&&(I=this.queue.concat(I),this.queue.length=0);let N=$.domSelectionRange(),B=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(N)&&hasFocusAndSelection($)&&!this.ignoreSelectionChange(N),j=-1,U=-1,q=!1,Y=[];if($.editable)for(let G=0;G1){let G=Y.filter(J=>J.nodeName=="BR");if(G.length==2){let J=G[0],Z=G[1];J.parentNode&&J.parentNode.parentNode==Z.parentNode?Z.remove():J.remove()}}let K=null;j<0&&B&&$.input.lastFocus>Date.now()-200&&Math.max($.input.lastTouch,$.input.lastClick.time)-1||B)&&(j>-1&&($.docView.markDirty(j,U),checkCSS($)),this.handleDOMChange(j,U,q,Y),$.docView&&$.docView.dirty?$.updateState($.state):this.currentSelection.eq(N)||selectionToDOM($),this.currentSelection.set(N))}registerMutation($,I){if(I.indexOf($.target)>-1)return null;let N=this.view.docView.nearestDesc($.target);if($.type=="attributes"&&(N==this.view.docView||$.attributeName=="contenteditable"||$.attributeName=="style"&&!$.oldValue&&!$.target.getAttribute("style"))||!N||N.ignoreMutation($))return null;if($.type=="childList"){for(let G=0;G<$.addedNodes.length;G++)I.push($.addedNodes[G]);if(N.contentDOM&&N.contentDOM!=N.dom&&!N.contentDOM.contains($.target))return{from:N.posBefore,to:N.posAfter};let B=$.previousSibling,j=$.nextSibling;if(ie$1&&ie_version<=11&&$.addedNodes.length)for(let G=0;G<$.addedNodes.length;G++){let{previousSibling:J,nextSibling:Z}=$.addedNodes[G];(!J||Array.prototype.indexOf.call($.addedNodes,J)<0)&&(B=J),(!Z||Array.prototype.indexOf.call($.addedNodes,Z)<0)&&(j=Z)}let U=B&&B.parentNode==$.target?domIndex(B)+1:0,q=N.localPosFromDOM($.target,U,-1),Y=j&&j.parentNode==$.target?domIndex(j):$.target.childNodes.length,K=N.localPosFromDOM($.target,Y,1);return{from:q,to:K}}else return $.type=="attributes"?{from:N.posAtStart-N.border,to:N.posAtEnd+N.border}:{from:N.posAtStart,to:N.posAtEnd,typeOver:$.target.nodeValue==$.oldValue}}}let cssChecked=new WeakMap,cssCheckWarned=!1;function checkCSS(M){if(!cssChecked.has(M)&&(cssChecked.set(M,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(M.dom).whiteSpace)!==-1)){if(M.requiresGeckoHackNode=gecko,cssCheckWarned)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),cssCheckWarned=!0}}function safariShadowSelectionRange(M){let $;function I(Y){Y.preventDefault(),Y.stopImmediatePropagation(),$=Y.getTargetRanges()[0]}M.dom.addEventListener("beforeinput",I,!0),document.execCommand("indent"),M.dom.removeEventListener("beforeinput",I,!0);let N=$.startContainer,B=$.startOffset,j=$.endContainer,U=$.endOffset,q=M.domAtPos(M.state.selection.anchor);return isEquivalentPosition(q.node,q.offset,j,U)&&([N,B,j,U]=[j,U,N,B]),{anchorNode:N,anchorOffset:B,focusNode:j,focusOffset:U}}function parseBetween(M,$,I){let{node:N,fromOffset:B,toOffset:j,from:U,to:q}=M.docView.parseRange($,I),Y=M.domSelectionRange(),K,G=Y.anchorNode;if(G&&M.dom.contains(G.nodeType==1?G:G.parentNode)&&(K=[{node:G,offset:Y.anchorOffset}],selectionCollapsed(Y)||K.push({node:Y.focusNode,offset:Y.focusOffset})),chrome$1&&M.input.lastKeyCode===8)for(let se=j;se>B;se--){let ne=N.childNodes[se-1],le=ne.pmViewDesc;if(ne.nodeName=="BR"&&!le){j=se;break}if(!le||le.size)break}let J=M.state.doc,Z=M.someProp("domParser")||DOMParser.fromSchema(M.state.schema),ee=J.resolve(U),te=null,re=Z.parse(N,{topNode:ee.parent,topMatch:ee.parent.contentMatchAt(ee.index()),topOpen:!0,from:B,to:j,preserveWhitespace:ee.parent.type.whitespace=="pre"?"full":!0,findPositions:K,ruleFromNode,context:ee});if(K&&K[0].pos!=null){let se=K[0].pos,ne=K[1]&&K[1].pos;ne==null&&(ne=se),te={anchor:se+U,head:ne+U}}return{doc:re,sel:te,from:U,to:q}}function ruleFromNode(M){let $=M.pmViewDesc;if($)return $.parseRule();if(M.nodeName=="BR"&&M.parentNode){if(safari&&/^(ul|ol)$/i.test(M.parentNode.nodeName)){let I=document.createElement("div");return I.appendChild(document.createElement("li")),{skip:I}}else if(M.parentNode.lastChild==M||safari&&/^(tr|table)$/i.test(M.parentNode.nodeName))return{ignore:!0}}else if(M.nodeName=="IMG"&&M.getAttribute("mark-placeholder"))return{ignore:!0};return null}const isInline=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function readDOMChange(M,$,I,N,B){if($<0){let ve=M.input.lastSelectionTime>Date.now()-50?M.input.lastSelectionOrigin:null,xe=selectionFromDOM(M,ve);if(xe&&!M.state.selection.eq(xe)){if(chrome$1&&android&&M.input.lastKeyCode===13&&Date.now()-100ye(M,keyEvent(13,"Enter"))))return;let oe=M.state.tr.setSelection(xe);ve=="pointer"?oe.setMeta("pointer",!0):ve=="key"&&oe.scrollIntoView(),M.dispatch(oe)}return}let j=M.state.doc.resolve($),U=j.sharedDepth(I);$=j.before(U+1),I=M.state.doc.resolve(I).after(U+1);let q=M.state.selection,Y=parseBetween(M,$,I),K=M.state.doc,G=K.slice(Y.from,Y.to),J,Z;M.input.lastKeyCode===8&&Date.now()-100Date.now()-225||android)&&B.some(ve=>ve.nodeType==1&&!isInline.test(ve.nodeName))&&(!ee||ee.endA>=ee.endB)&&M.someProp("handleKeyDown",ve=>ve(M,keyEvent(13,"Enter")))){M.input.lastIOSEnter=0;return}if(!ee)if(N&&q instanceof TextSelection&&!q.empty&&q.$head.sameParent(q.$anchor)&&!M.composing&&!(Y.sel&&Y.sel.anchor!=Y.sel.head))ee={start:q.from,endA:q.to,endB:q.to};else{if(Y.sel){let ve=resolveSelection(M,M.state.doc,Y.sel);ve&&!ve.eq(M.state.selection)&&M.dispatch(M.state.tr.setSelection(ve))}return}if(chrome$1&&M.cursorWrapper&&Y.sel&&Y.sel.anchor==M.cursorWrapper.deco.from&&Y.sel.head==Y.sel.anchor){let ve=ee.endB-ee.start;Y.sel={anchor:Y.sel.anchor+ve,head:Y.sel.anchor+ve}}M.input.domChangeCount++,M.state.selection.fromM.state.selection.from&&ee.start<=M.state.selection.from+2&&M.state.selection.from>=Y.from?ee.start=M.state.selection.from:ee.endA=M.state.selection.to-2&&M.state.selection.to<=Y.to&&(ee.endB+=M.state.selection.to-ee.endA,ee.endA=M.state.selection.to)),ie$1&&ie_version<=11&&ee.endB==ee.start+1&&ee.endA==ee.start&&ee.start>Y.from&&Y.doc.textBetween(ee.start-Y.from-1,ee.start-Y.from+1)=="  "&&(ee.start--,ee.endA--,ee.endB--);let te=Y.doc.resolveNoCache(ee.start-Y.from),re=Y.doc.resolveNoCache(ee.endB-Y.from),se=K.resolve(ee.start),ne=te.sameParent(re)&&te.parent.inlineContent&&se.end()>=ee.endA,le;if((ios&&M.input.lastIOSEnter>Date.now()-225&&(!ne||B.some(ve=>ve.nodeName=="DIV"||ve.nodeName=="P"))||!ne&&te.posve(M,keyEvent(13,"Enter")))){M.input.lastIOSEnter=0;return}if(M.state.selection.anchor>ee.start&&looksLikeJoin(K,ee.start,ee.endA,te,re)&&M.someProp("handleKeyDown",ve=>ve(M,keyEvent(8,"Backspace")))){android&&chrome$1&&M.domObserver.suppressSelectionUpdates();return}chrome$1&&android&&ee.endB==ee.start&&(M.input.lastAndroidDelete=Date.now()),android&&!ne&&te.start()!=re.start()&&re.parentOffset==0&&te.depth==re.depth&&Y.sel&&Y.sel.anchor==Y.sel.head&&Y.sel.head==ee.endA&&(ee.endB-=2,re=Y.doc.resolveNoCache(ee.endB-Y.from),setTimeout(()=>{M.someProp("handleKeyDown",function(ve){return ve(M,keyEvent(13,"Enter"))})},20));let ge=ee.start,ue=ee.endA,_e,fe,me;if(ne){if(te.pos==re.pos)ie$1&&ie_version<=11&&te.parentOffset==0&&(M.domObserver.suppressSelectionUpdates(),setTimeout(()=>selectionToDOM(M),20)),_e=M.state.tr.delete(ge,ue),fe=K.resolve(ee.start).marksAcross(K.resolve(ee.endA));else if(ee.endA==ee.endB&&(me=isMarkChange(te.parent.content.cut(te.parentOffset,re.parentOffset),se.parent.content.cut(se.parentOffset,ee.endA-se.start()))))_e=M.state.tr,me.type=="add"?_e.addMark(ge,ue,me.mark):_e.removeMark(ge,ue,me.mark);else if(te.parent.child(te.index()).isText&&te.index()==re.index()-(re.textOffset?0:1)){let ve=te.parent.textBetween(te.parentOffset,re.parentOffset);if(M.someProp("handleTextInput",xe=>xe(M,ge,ue,ve)))return;_e=M.state.tr.insertText(ve,ge,ue)}}if(_e||(_e=M.state.tr.replace(ge,ue,Y.doc.slice(ee.start-Y.from,ee.endB-Y.from))),Y.sel){let ve=resolveSelection(M,_e.doc,Y.sel);ve&&!(chrome$1&&android&&M.composing&&ve.empty&&(ee.start!=ee.endB||M.input.lastAndroidDelete$.content.size?null:selectionBetween(M,$.resolve(I.anchor),$.resolve(I.head))}function isMarkChange(M,$){let I=M.firstChild.marks,N=$.firstChild.marks,B=I,j=N,U,q,Y;for(let G=0;GG.mark(q.addToSet(G.marks));else if(B.length==0&&j.length==1)q=j[0],U="remove",Y=G=>G.mark(q.removeFromSet(G.marks));else return null;let K=[];for(let G=0;G<$.childCount;G++)K.push(Y($.child(G)));if(Fragment.from(K).eq(M))return{mark:q,type:U}}function looksLikeJoin(M,$,I,N,B){if(!N.parent.isTextblock||I-$<=B.pos-N.pos||skipClosingAndOpening(N,!0,!1)I||skipClosingAndOpening(U,!0,!1)0&&($||M.indexAfter(N)==M.node(N).childCount);)N--,B++,$=!1;if(I){let j=M.node(N).maybeChild(M.indexAfter(N));for(;j&&!j.isLeaf;)j=j.firstChild,B++}return B}function findDiff(M,$,I,N,B){let j=M.findDiffStart($,I);if(j==null)return null;let{a:U,b:q}=M.findDiffEnd($,I+M.size,I+$.size);if(B=="end"){let Y=Math.max(0,j-Math.min(U,q));N-=U+Y-j}if(U=U?j-N:0;j-=Y,q=j+(q-U),U=j}else if(q=q?j-N:0;j-=Y,U=j+(U-q),q=j}return{start:j,endA:U,endB:q}}const __serializeForClipboard=serializeForClipboard,__parseFromClipboard=parseFromClipboard,__endComposition=endComposition;class EditorView{constructor($,I){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new InputState,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=I,this.state=I.state,this.directPlugins=I.plugins||[],this.directPlugins.forEach(checkStateComponent),this.dispatch=this.dispatch.bind(this),this.dom=$&&$.mount||document.createElement("div"),$&&($.appendChild?$.appendChild(this.dom):typeof $=="function"?$(this.dom):$.mount&&(this.mounted=!0)),this.editable=getEditable(this),updateCursorWrapper(this),this.nodeViews=buildNodeViews(this),this.docView=docViewDesc(this.state.doc,computeDocDeco(this),viewDecorations(this),this.dom,this),this.domObserver=new DOMObserver(this,(N,B,j,U)=>readDOMChange(this,N,B,j,U)),this.domObserver.start(),initInput(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let $=this._props;this._props={};for(let I in $)this._props[I]=$[I];this._props.state=this.state}return this._props}update($){$.handleDOMEvents!=this._props.handleDOMEvents&&ensureListeners(this);let I=this._props;this._props=$,$.plugins&&($.plugins.forEach(checkStateComponent),this.directPlugins=$.plugins),this.updateStateInner($.state,I)}setProps($){let I={};for(let N in this._props)I[N]=this._props[N];I.state=this.state;for(let N in $)I[N]=$[N];this.update(I)}updateState($){this.updateStateInner($,this._props)}updateStateInner($,I){let N=this.state,B=!1,j=!1;$.storedMarks&&this.composing&&(clearComposition(this),j=!0),this.state=$;let U=N.plugins!=$.plugins||this._props.plugins!=I.plugins;if(U||this._props.plugins!=I.plugins||this._props.nodeViews!=I.nodeViews){let Z=buildNodeViews(this);changedNodeViews(Z,this.nodeViews)&&(this.nodeViews=Z,B=!0)}(U||I.handleDOMEvents!=this._props.handleDOMEvents)&&ensureListeners(this),this.editable=getEditable(this),updateCursorWrapper(this);let q=viewDecorations(this),Y=computeDocDeco(this),K=N.plugins!=$.plugins&&!N.doc.eq($.doc)?"reset":$.scrollToSelection>N.scrollToSelection?"to selection":"preserve",G=B||!this.docView.matchesNode($.doc,Y,q);(G||!$.selection.eq(N.selection))&&(j=!0);let J=K=="preserve"&&j&&this.dom.style.overflowAnchor==null&&storeScrollPos(this);if(j){this.domObserver.stop();let Z=G&&(ie$1||chrome$1)&&!this.composing&&!N.selection.empty&&!$.selection.empty&&selectionContextChanged(N.selection,$.selection);if(G){let ee=chrome$1?this.trackWrites=this.domSelectionRange().focusNode:null;(B||!this.docView.update($.doc,Y,q,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=docViewDesc($.doc,Y,q,this.dom,this)),ee&&!this.trackWrites&&(Z=!0)}Z||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&anchorInRightPlace(this))?selectionToDOM(this,Z):(syncNodeSelection(this,$.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(N),K=="reset"?this.dom.scrollTop=0:K=="to selection"?this.scrollToSelection():J&&resetScrollPos(J)}scrollToSelection(){let $=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",I=>I(this)))if(this.state.selection instanceof NodeSelection){let I=this.docView.domAfterPos(this.state.selection.from);I.nodeType==1&&scrollRectIntoView(this,I.getBoundingClientRect(),$)}else scrollRectIntoView(this,this.coordsAtPos(this.state.selection.head,1),$)}destroyPluginViews(){let $;for(;$=this.pluginViews.pop();)$.destroy&&$.destroy()}updatePluginViews($){if(!$||$.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let I=0;II.ownerDocument.getSelection()),this._root=I}return $||document}posAtCoords($){return posAtCoords(this,$)}coordsAtPos($,I=1){return coordsAtPos(this,$,I)}domAtPos($,I=0){return this.docView.domFromPos($,I)}nodeDOM($){let I=this.docView.descAt($);return I?I.nodeDOM:null}posAtDOM($,I,N=-1){let B=this.docView.posFromDOM($,I,N);if(B==null)throw new RangeError("DOM position not inside the editor");return B}endOfTextblock($,I){return endOfTextblock(this,I||this.state,$)}pasteHTML($,I){return doPaste(this,"",$,!1,I||new ClipboardEvent("paste"))}pasteText($,I){return doPaste(this,$,null,!0,I||new ClipboardEvent("paste"))}destroy(){this.docView&&(destroyInput(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],viewDecorations(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent($){return dispatchEvent(this,$)}dispatch($){let I=this._props.dispatchTransaction;I?I.call(this,$):this.updateState(this.state.apply($))}domSelectionRange(){return safari&&this.root.nodeType===11&&deepActiveElement(this.dom.ownerDocument)==this.dom?safariShadowSelectionRange(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function computeDocDeco(M){let $=Object.create(null);return $.class="ProseMirror",$.contenteditable=String(M.editable),$.translate="no",M.someProp("attributes",I=>{if(typeof I=="function"&&(I=I(M.state)),I)for(let N in I)N=="class"&&($.class+=" "+I[N]),N=="style"?$.style=($.style?$.style+";":"")+I[N]:!$[N]&&N!="contenteditable"&&N!="nodeName"&&($[N]=String(I[N]))}),[Decoration.node(0,M.state.doc.content.size,$)]}function updateCursorWrapper(M){if(M.markCursor){let $=document.createElement("img");$.className="ProseMirror-separator",$.setAttribute("mark-placeholder","true"),$.setAttribute("alt",""),M.cursorWrapper={dom:$,deco:Decoration.widget(M.state.selection.head,$,{raw:!0,marks:M.markCursor})}}else M.cursorWrapper=null}function getEditable(M){return!M.someProp("editable",$=>$(M.state)===!1)}function selectionContextChanged(M,$){let I=Math.min(M.$anchor.sharedDepth(M.head),$.$anchor.sharedDepth($.head));return M.$anchor.start(I)!=$.$anchor.start(I)}function buildNodeViews(M){let $=Object.create(null);function I(N){for(let B in N)Object.prototype.hasOwnProperty.call($,B)||($[B]=N[B])}return M.someProp("nodeViews",I),M.someProp("markViews",I),$}function changedNodeViews(M,$){let I=0,N=0;for(let B in M){if(M[B]!=$[B])return!0;I++}for(let B in $)N++;return I!=N}function checkStateComponent(M){if(M.spec.state||M.spec.filterTransaction||M.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const view=Object.freeze(Object.defineProperty({__proto__:null,Decoration,DecorationSet,EditorView,__endComposition,__parseFromClipboard,__serializeForClipboard},Symbol.toStringTag,{value:"Module"}));var base={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shift$1={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},chrome=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),mac$2=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),brokenModifierNames=mac$2||chrome&&+chrome[1]<57;for(var i$3=0;i$3<10;i$3++)base[48+i$3]=base[96+i$3]=String(i$3);for(var i$3=1;i$3<=24;i$3++)base[i$3+111]="F"+i$3;for(var i$3=65;i$3<=90;i$3++)base[i$3]=String.fromCharCode(i$3+32),shift$1[i$3]=String.fromCharCode(i$3);for(var code in base)shift$1.hasOwnProperty(code)||(shift$1[code]=base[code]);function keyName(M){var $=brokenModifierNames&&(M.ctrlKey||M.altKey||M.metaKey)||ie&&M.shiftKey&&M.key&&M.key.length==1||M.key=="Unidentified",I=!$&&M.key||(M.shiftKey?shift$1:base)[M.keyCode]||M.key||"Unidentified";return I=="Esc"&&(I="Escape"),I=="Del"&&(I="Delete"),I=="Left"&&(I="ArrowLeft"),I=="Up"&&(I="ArrowUp"),I=="Right"&&(I="ArrowRight"),I=="Down"&&(I="ArrowDown"),I}const mac$1=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function normalizeKeyName$1(M){let $=M.split(/-(?!$)/),I=$[$.length-1];I=="Space"&&(I=" ");let N,B,j,U;for(let q=0;q<$.length-1;q++){let Y=$[q];if(/^(cmd|meta|m)$/i.test(Y))U=!0;else if(/^a(lt)?$/i.test(Y))N=!0;else if(/^(c|ctrl|control)$/i.test(Y))B=!0;else if(/^s(hift)?$/i.test(Y))j=!0;else if(/^mod$/i.test(Y))mac$1?U=!0:B=!0;else throw new Error("Unrecognized modifier name: "+Y)}return N&&(I="Alt-"+I),B&&(I="Ctrl-"+I),U&&(I="Meta-"+I),j&&(I="Shift-"+I),I}function normalize(M){let $=Object.create(null);for(let I in M)$[normalizeKeyName$1(I)]=M[I];return $}function modifiers(M,$,I=!0){return $.altKey&&(M="Alt-"+M),$.ctrlKey&&(M="Ctrl-"+M),$.metaKey&&(M="Meta-"+M),I&&$.shiftKey&&(M="Shift-"+M),M}function keymap(M){return new Plugin({props:{handleKeyDown:keydownHandler(M)}})}function keydownHandler(M){let $=normalize(M);return function(I,N){let B=keyName(N),j,U=$[modifiers(B,N)];if(U&&U(I.state,I.dispatch,I))return!0;if(B.length==1&&B!=" "){if(N.shiftKey){let q=$[modifiers(B,N,!1)];if(q&&q(I.state,I.dispatch,I))return!0}if((N.shiftKey||N.altKey||N.metaKey||B.charCodeAt(0)>127)&&(j=base[N.keyCode])&&j!=B){let q=$[modifiers(j,N)];if(q&&q(I.state,I.dispatch,I))return!0}}return!1}}const model=Object.freeze(Object.defineProperty({__proto__:null,ContentMatch,DOMParser,DOMSerializer,Fragment,Mark:Mark$1,MarkType,Node:Node$2,NodeRange,NodeType:NodeType$1,ReplaceError,ResolvedPos,Schema,Slice},Symbol.toStringTag,{value:"Module"})),deleteSelection$1=(M,$)=>M.selection.empty?!1:($&&$(M.tr.deleteSelection().scrollIntoView()),!0);function atBlockStart(M,$){let{$cursor:I}=M.selection;return!I||($?!$.endOfTextblock("backward",M):I.parentOffset>0)?null:I}const joinBackward$1=(M,$,I)=>{let N=atBlockStart(M,I);if(!N)return!1;let B=findCutBefore(N);if(!B){let U=N.blockRange(),q=U&&liftTarget(U);return q==null?!1:($&&$(M.tr.lift(U,q).scrollIntoView()),!0)}let j=B.nodeBefore;if(!j.type.spec.isolating&&deleteBarrier(M,B,$))return!0;if(N.parent.content.size==0&&(textblockAt(j,"end")||NodeSelection.isSelectable(j))){let U=replaceStep(M.doc,N.before(),N.after(),Slice.empty);if(U&&U.slice.size{let{$head:N,empty:B}=M.selection,j=N;if(!B)return!1;if(N.parent.isTextblock){if(I?!I.endOfTextblock("backward",M):N.parentOffset>0)return!1;j=findCutBefore(N)}let U=j&&j.nodeBefore;return!U||!NodeSelection.isSelectable(U)?!1:($&&$(M.tr.setSelection(NodeSelection.create(M.doc,j.pos-U.nodeSize)).scrollIntoView()),!0)};function findCutBefore(M){if(!M.parent.type.spec.isolating)for(let $=M.depth-1;$>=0;$--){if(M.index($)>0)return M.doc.resolve(M.before($+1));if(M.node($).type.spec.isolating)break}return null}function atBlockEnd(M,$){let{$cursor:I}=M.selection;return!I||($?!$.endOfTextblock("forward",M):I.parentOffset{let N=atBlockEnd(M,I);if(!N)return!1;let B=findCutAfter(N);if(!B)return!1;let j=B.nodeAfter;if(deleteBarrier(M,B,$))return!0;if(N.parent.content.size==0&&(textblockAt(j,"start")||NodeSelection.isSelectable(j))){let U=replaceStep(M.doc,N.before(),N.after(),Slice.empty);if(U&&U.slice.size{let{$head:N,empty:B}=M.selection,j=N;if(!B)return!1;if(N.parent.isTextblock){if(I?!I.endOfTextblock("forward",M):N.parentOffset=0;$--){let I=M.node($);if(M.index($)+1{let I=M.selection,N=I instanceof NodeSelection,B;if(N){if(I.node.isTextblock||!canJoin(M.doc,I.from))return!1;B=I.from}else if(B=joinPoint(M.doc,I.from,-1),B==null)return!1;if($){let j=M.tr.join(B);N&&j.setSelection(NodeSelection.create(j.doc,B-M.doc.resolve(B).nodeBefore.nodeSize)),$(j.scrollIntoView())}return!0},joinDown$1=(M,$)=>{let I=M.selection,N;if(I instanceof NodeSelection){if(I.node.isTextblock||!canJoin(M.doc,I.to))return!1;N=I.to}else if(N=joinPoint(M.doc,I.to,1),N==null)return!1;return $&&$(M.tr.join(N).scrollIntoView()),!0},lift$1=(M,$)=>{let{$from:I,$to:N}=M.selection,B=I.blockRange(N),j=B&&liftTarget(B);return j==null?!1:($&&$(M.tr.lift(B,j).scrollIntoView()),!0)},newlineInCode$1=(M,$)=>{let{$head:I,$anchor:N}=M.selection;return!I.parent.type.spec.code||!I.sameParent(N)?!1:($&&$(M.tr.insertText(` `).scrollIntoView()),!0)};function defaultBlockAt$1(M){for(let $=0;${let{$head:I,$anchor:N}=M.selection;if(!I.parent.type.spec.code||!I.sameParent(N))return!1;let B=I.node(-1),j=I.indexAfter(-1),U=defaultBlockAt$1(B.contentMatchAt(j));if(!U||!B.canReplaceWith(j,j,U))return!1;if($){let q=I.after(),Y=M.tr.replaceWith(q,q,U.createAndFill());Y.setSelection(Selection.near(Y.doc.resolve(q),1)),$(Y.scrollIntoView())}return!0},createParagraphNear$1=(M,$)=>{let I=M.selection,{$from:N,$to:B}=I;if(I instanceof AllSelection||N.parent.inlineContent||B.parent.inlineContent)return!1;let j=defaultBlockAt$1(B.parent.contentMatchAt(B.indexAfter()));if(!j||!j.isTextblock)return!1;if($){let U=(!N.parentOffset&&B.index(){let{$cursor:I}=M.selection;if(!I||I.parent.content.size)return!1;if(I.depth>1&&I.after()!=I.end(-1)){let j=I.before();if(canSplit(M.doc,j))return $&&$(M.tr.split(j).scrollIntoView()),!0}let N=I.blockRange(),B=N&&liftTarget(N);return B==null?!1:($&&$(M.tr.lift(N,B).scrollIntoView()),!0)},selectParentNode$1=(M,$)=>{let{$from:I,to:N}=M.selection,B,j=I.sharedDepth(N);return j==0?!1:(B=I.before(j),$&&$(M.tr.setSelection(NodeSelection.create(M.doc,B))),!0)};function joinMaybeClear(M,$,I){let N=$.nodeBefore,B=$.nodeAfter,j=$.index();return!N||!B||!N.type.compatibleContent(B.type)?!1:!N.content.size&&$.parent.canReplace(j-1,j)?(I&&I(M.tr.delete($.pos-N.nodeSize,$.pos).scrollIntoView()),!0):!$.parent.canReplace(j,j+1)||!(B.isTextblock||canJoin(M.doc,$.pos))?!1:(I&&I(M.tr.clearIncompatible($.pos,N.type,N.contentMatchAt(N.childCount)).join($.pos).scrollIntoView()),!0)}function deleteBarrier(M,$,I){let N=$.nodeBefore,B=$.nodeAfter,j,U;if(N.type.spec.isolating||B.type.spec.isolating)return!1;if(joinMaybeClear(M,$,I))return!0;let q=$.parent.canReplace($.index(),$.index()+1);if(q&&(j=(U=N.contentMatchAt(N.childCount)).findWrapping(B.type))&&U.matchType(j[0]||B.type).validEnd){if(I){let J=$.pos+B.nodeSize,Z=Fragment.empty;for(let re=j.length-1;re>=0;re--)Z=Fragment.from(j[re].create(null,Z));Z=Fragment.from(N.copy(Z));let ee=M.tr.step(new ReplaceAroundStep($.pos-1,J,$.pos,J,new Slice(Z,1,0),j.length,!0)),te=J+2*j.length;canJoin(ee.doc,te)&&ee.join(te),I(ee.scrollIntoView())}return!0}let Y=Selection.findFrom($,1),K=Y&&Y.$from.blockRange(Y.$to),G=K&&liftTarget(K);if(G!=null&&G>=$.depth)return I&&I(M.tr.lift(K,G).scrollIntoView()),!0;if(q&&textblockAt(B,"start",!0)&&textblockAt(N,"end")){let J=N,Z=[];for(;Z.push(J),!J.isTextblock;)J=J.lastChild;let ee=B,te=1;for(;!ee.isTextblock;ee=ee.firstChild)te++;if(J.canReplace(J.childCount,J.childCount,ee.content)){if(I){let re=Fragment.empty;for(let ne=Z.length-1;ne>=0;ne--)re=Fragment.from(Z[ne].copy(re));let se=M.tr.step(new ReplaceAroundStep($.pos-Z.length,$.pos+B.nodeSize,$.pos+te,$.pos+B.nodeSize-te,new Slice(re,Z.length,0),0,!0));I(se.scrollIntoView())}return!0}}return!1}function selectTextblockSide(M){return function($,I){let N=$.selection,B=M<0?N.$from:N.$to,j=B.depth;for(;B.node(j).isInline;){if(!j)return!1;j--}return B.node(j).isTextblock?(I&&I($.tr.setSelection(TextSelection.create($.doc,M<0?B.start(j):B.end(j)))),!0):!1}}const selectTextblockStart$1=selectTextblockSide(-1),selectTextblockEnd$1=selectTextblockSide(1);function wrapIn$1(M,$=null){return function(I,N){let{$from:B,$to:j}=I.selection,U=B.blockRange(j),q=U&&findWrapping(U,M,$);return q?(N&&N(I.tr.wrap(U,q).scrollIntoView()),!0):!1}}function setBlockType(M,$=null){return function(I,N){let B=!1;for(let j=0;j{if(B)return!1;if(!(!Y.isTextblock||Y.hasMarkup(M,$)))if(Y.type==M)B=!0;else{let G=I.doc.resolve(K),J=G.index();B=G.parent.canReplaceWith(J,J+1,M)}})}if(!B)return!1;if(N){let j=I.tr;for(let U=0;U=2&&B.node(U.depth-1).type.compatibleContent(M)&&U.startIndex==0){if(B.index(U.depth-1)==0)return!1;let G=I.doc.resolve(U.start-2);Y=new NodeRange(G,G,U.depth),U.endIndex=0;G--)j=Fragment.from(I[G].type.create(I[G].attrs,j));M.step(new ReplaceAroundStep($.start-(N?2:0),$.end,$.start,$.end,new Slice(j,0,0),I.length,!0));let U=0;for(let G=0;GU.childCount>0&&U.firstChild.type==M);return j?I?N.node(j.depth-1).type==M?liftToOuterList($,I,M,j):liftOutOfList($,I,j):!0:!1}}function liftToOuterList(M,$,I,N){let B=M.tr,j=N.end,U=N.$to.end(N.depth);jre;te--)ee-=B.child(te).nodeSize,N.delete(ee-1,ee+1);let j=N.doc.resolve(I.start),U=j.nodeAfter;if(N.mapping.map(I.end)!=I.start+j.nodeAfter.nodeSize)return!1;let q=I.startIndex==0,Y=I.endIndex==B.childCount,K=j.node(-1),G=j.index(-1);if(!K.canReplace(G+(q?0:1),G+1,U.content.append(Y?Fragment.empty:Fragment.from(B))))return!1;let J=j.pos,Z=J+U.nodeSize;return N.step(new ReplaceAroundStep(J-(q?1:0),Z+(Y?1:0),J+1,Z-1,new Slice((q?Fragment.empty:Fragment.from(B.copy(Fragment.empty))).append(Y?Fragment.empty:Fragment.from(B.copy(Fragment.empty))),q?0:1,Y?0:1),q?0:1)),$(N.scrollIntoView()),!0}function sinkListItem$1(M){return function($,I){let{$from:N,$to:B}=$.selection,j=N.blockRange(B,K=>K.childCount>0&&K.firstChild.type==M);if(!j)return!1;let U=j.startIndex;if(U==0)return!1;let q=j.parent,Y=q.child(U-1);if(Y.type!=M)return!1;if(I){let K=Y.lastChild&&Y.lastChild.type==q.type,G=Fragment.from(K?M.create():null),J=new Slice(Fragment.from(M.create(null,Fragment.from(q.type.create(null,G)))),K?3:1,0),Z=j.start,ee=j.end;I($.tr.step(new ReplaceAroundStep(Z-(K?3:1),ee,Z,ee,J,1,!0)).scrollIntoView())}return!0}}function createChainableState(M){const{state:$,transaction:I}=M;let{selection:N}=I,{doc:B}=I,{storedMarks:j}=I;return{...$,apply:$.apply.bind($),applyTransaction:$.applyTransaction.bind($),filterTransaction:$.filterTransaction,plugins:$.plugins,schema:$.schema,reconfigure:$.reconfigure.bind($),toJSON:$.toJSON.bind($),get storedMarks(){return j},get selection(){return N},get doc(){return B},get tr(){return N=I.selection,B=I.doc,j=I.storedMarks,I}}}class CommandManager{constructor($){this.editor=$.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=$.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:$,editor:I,state:N}=this,{view:B}=I,{tr:j}=N,U=this.buildProps(j);return Object.fromEntries(Object.entries($).map(([q,Y])=>[q,(...G)=>{const J=Y(...G)(U);return!j.getMeta("preventDispatch")&&!this.hasCustomState&&B.dispatch(j),J}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain($,I=!0){const{rawCommands:N,editor:B,state:j}=this,{view:U}=B,q=[],Y=!!$,K=$||j.tr,G=()=>(!Y&&I&&!K.getMeta("preventDispatch")&&!this.hasCustomState&&U.dispatch(K),q.every(Z=>Z===!0)),J={...Object.fromEntries(Object.entries(N).map(([Z,ee])=>[Z,(...re)=>{const se=this.buildProps(K,I),ne=ee(...re)(se);return q.push(ne),J}])),run:G};return J}createCan($){const{rawCommands:I,state:N}=this,B=!1,j=$||N.tr,U=this.buildProps(j,B);return{...Object.fromEntries(Object.entries(I).map(([Y,K])=>[Y,(...G)=>K(...G)({...U,dispatch:void 0})])),chain:()=>this.createChain(j,B)}}buildProps($,I=!0){const{rawCommands:N,editor:B,state:j}=this,{view:U}=B;j.storedMarks&&$.setStoredMarks(j.storedMarks);const q={tr:$,editor:B,view:U,state:createChainableState({state:j,transaction:$}),dispatch:I?()=>{}:void 0,chain:()=>this.createChain($),can:()=>this.createCan($),get commands(){return Object.fromEntries(Object.entries(N).map(([Y,K])=>[Y,(...G)=>K(...G)(q)]))}};return q}}class EventEmitter{constructor(){this.callbacks={}}on($,I){return this.callbacks[$]||(this.callbacks[$]=[]),this.callbacks[$].push(I),this}emit($,...I){const N=this.callbacks[$];return N&&N.forEach(B=>B.apply(this,I)),this}off($,I){const N=this.callbacks[$];return N&&(I?this.callbacks[$]=N.filter(B=>B!==I):delete this.callbacks[$]),this}removeAllListeners(){this.callbacks={}}}function getExtensionField(M,$,I){return M.config[$]===void 0&&M.parent?getExtensionField(M.parent,$,I):typeof M.config[$]=="function"?M.config[$].bind({...I,parent:M.parent?getExtensionField(M.parent,$,I):null}):M.config[$]}function splitExtensions(M){const $=M.filter(B=>B.type==="extension"),I=M.filter(B=>B.type==="node"),N=M.filter(B=>B.type==="mark");return{baseExtensions:$,nodeExtensions:I,markExtensions:N}}function getAttributesFromExtensions(M){const $=[],{nodeExtensions:I,markExtensions:N}=splitExtensions(M),B=[...I,...N],j={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return M.forEach(U=>{const q={name:U.name,options:U.options,storage:U.storage},Y=getExtensionField(U,"addGlobalAttributes",q);if(!Y)return;Y().forEach(G=>{G.types.forEach(J=>{Object.entries(G.attributes).forEach(([Z,ee])=>{$.push({type:J,name:Z,attribute:{...j,...ee}})})})})}),B.forEach(U=>{const q={name:U.name,options:U.options,storage:U.storage},Y=getExtensionField(U,"addAttributes",q);if(!Y)return;const K=Y();Object.entries(K).forEach(([G,J])=>{const Z={...j,...J};typeof(Z==null?void 0:Z.default)=="function"&&(Z.default=Z.default()),Z!=null&&Z.isRequired&&(Z==null?void 0:Z.default)===void 0&&delete Z.default,$.push({type:U.name,name:G,attribute:Z})})}),$}function getNodeType(M,$){if(typeof M=="string"){if(!$.nodes[M])throw Error(`There is no node type named '${M}'. Maybe you forgot to add the extension?`);return $.nodes[M]}return M}function mergeAttributes(...M){return M.filter($=>!!$).reduce(($,I)=>{const N={...$};return Object.entries(I).forEach(([B,j])=>{if(!N[B]){N[B]=j;return}B==="class"?N[B]=[N[B],j].join(" "):B==="style"?N[B]=[N[B],j].join("; "):N[B]=j}),N},{})}function getRenderedAttributes(M,$){return $.filter(I=>I.attribute.rendered).map(I=>I.attribute.renderHTML?I.attribute.renderHTML(M.attrs)||{}:{[I.name]:M.attrs[I.name]}).reduce((I,N)=>mergeAttributes(I,N),{})}function isFunction$5(M){return typeof M=="function"}function callOrReturn(M,$=void 0,...I){return isFunction$5(M)?$?M.bind($)(...I):M(...I):M}function isEmptyObject(M={}){return Object.keys(M).length===0&&M.constructor===Object}function fromString(M){return typeof M!="string"?M:M.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(M):M==="true"?!0:M==="false"?!1:M}function injectExtensionAttributesToParseRule(M,$){return M.style?M:{...M,getAttrs:I=>{const N=M.getAttrs?M.getAttrs(I):M.attrs;if(N===!1)return!1;const B=$.reduce((j,U)=>{const q=U.attribute.parseHTML?U.attribute.parseHTML(I):fromString(I.getAttribute(U.name));return q==null?j:{...j,[U.name]:q}},{});return{...N,...B}}}}function cleanUpSchemaItem(M){return Object.fromEntries(Object.entries(M).filter(([$,I])=>$==="attrs"&&isEmptyObject(I)?!1:I!=null))}function getSchemaByResolvedExtensions(M,$){var I;const N=getAttributesFromExtensions(M),{nodeExtensions:B,markExtensions:j}=splitExtensions(M),U=(I=B.find(K=>getExtensionField(K,"topNode")))===null||I===void 0?void 0:I.name,q=Object.fromEntries(B.map(K=>{const G=N.filter(ne=>ne.type===K.name),J={name:K.name,options:K.options,storage:K.storage,editor:$},Z=M.reduce((ne,le)=>{const ge=getExtensionField(le,"extendNodeSchema",J);return{...ne,...ge?ge(K):{}}},{}),ee=cleanUpSchemaItem({...Z,content:callOrReturn(getExtensionField(K,"content",J)),marks:callOrReturn(getExtensionField(K,"marks",J)),group:callOrReturn(getExtensionField(K,"group",J)),inline:callOrReturn(getExtensionField(K,"inline",J)),atom:callOrReturn(getExtensionField(K,"atom",J)),selectable:callOrReturn(getExtensionField(K,"selectable",J)),draggable:callOrReturn(getExtensionField(K,"draggable",J)),code:callOrReturn(getExtensionField(K,"code",J)),defining:callOrReturn(getExtensionField(K,"defining",J)),isolating:callOrReturn(getExtensionField(K,"isolating",J)),attrs:Object.fromEntries(G.map(ne=>{var le;return[ne.name,{default:(le=ne==null?void 0:ne.attribute)===null||le===void 0?void 0:le.default}]}))}),te=callOrReturn(getExtensionField(K,"parseHTML",J));te&&(ee.parseDOM=te.map(ne=>injectExtensionAttributesToParseRule(ne,G)));const re=getExtensionField(K,"renderHTML",J);re&&(ee.toDOM=ne=>re({node:ne,HTMLAttributes:getRenderedAttributes(ne,G)}));const se=getExtensionField(K,"renderText",J);return se&&(ee.toText=se),[K.name,ee]})),Y=Object.fromEntries(j.map(K=>{const G=N.filter(se=>se.type===K.name),J={name:K.name,options:K.options,storage:K.storage,editor:$},Z=M.reduce((se,ne)=>{const le=getExtensionField(ne,"extendMarkSchema",J);return{...se,...le?le(K):{}}},{}),ee=cleanUpSchemaItem({...Z,inclusive:callOrReturn(getExtensionField(K,"inclusive",J)),excludes:callOrReturn(getExtensionField(K,"excludes",J)),group:callOrReturn(getExtensionField(K,"group",J)),spanning:callOrReturn(getExtensionField(K,"spanning",J)),code:callOrReturn(getExtensionField(K,"code",J)),attrs:Object.fromEntries(G.map(se=>{var ne;return[se.name,{default:(ne=se==null?void 0:se.attribute)===null||ne===void 0?void 0:ne.default}]}))}),te=callOrReturn(getExtensionField(K,"parseHTML",J));te&&(ee.parseDOM=te.map(se=>injectExtensionAttributesToParseRule(se,G)));const re=getExtensionField(K,"renderHTML",J);return re&&(ee.toDOM=se=>re({mark:se,HTMLAttributes:getRenderedAttributes(se,G)})),[K.name,ee]}));return new Schema({topNode:U,nodes:q,marks:Y})}function getSchemaTypeByName(M,$){return $.nodes[M]||$.marks[M]||null}function isExtensionRulesEnabled(M,$){return Array.isArray($)?$.some(I=>(typeof I=="string"?I:I.name)===M.name):$}const getTextContentFromNodes=(M,$=500)=>{let I="";const N=M.parentOffset;return M.parent.nodesBetween(Math.max(0,N-$),N,(B,j,U,q)=>{var Y,K;const G=((K=(Y=B.type.spec).toText)===null||K===void 0?void 0:K.call(Y,{node:B,pos:j,parent:U,index:q}))||B.textContent||"%leaf%";I+=G.slice(0,Math.max(0,N-j))}),I};function isRegExp$4(M){return Object.prototype.toString.call(M)==="[object RegExp]"}class InputRule{constructor($){this.find=$.find,this.handler=$.handler}}const inputRuleMatcherHandler=(M,$)=>{if(isRegExp$4($))return $.exec(M);const I=$(M);if(!I)return null;const N=[I.text];return N.index=I.index,N.input=M,N.data=I.data,I.replaceWith&&(I.text.includes(I.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),N.push(I.replaceWith)),N};function run$1(M){var $;const{editor:I,from:N,to:B,text:j,rules:U,plugin:q}=M,{view:Y}=I;if(Y.composing)return!1;const K=Y.state.doc.resolve(N);if(K.parent.type.spec.code||!(($=K.nodeBefore||K.nodeAfter)===null||$===void 0)&&$.marks.find(Z=>Z.type.spec.code))return!1;let G=!1;const J=getTextContentFromNodes(K)+j;return U.forEach(Z=>{if(G)return;const ee=inputRuleMatcherHandler(J,Z.find);if(!ee)return;const te=Y.state.tr,re=createChainableState({state:Y.state,transaction:te}),se={from:N-(ee[0].length-j.length),to:B},{commands:ne,chain:le,can:ge}=new CommandManager({editor:I,state:re});Z.handler({state:re,range:se,match:ee,commands:ne,chain:le,can:ge})===null||!te.steps.length||(te.setMeta(q,{transform:te,from:N,to:B,text:j}),Y.dispatch(te),G=!0)}),G}function inputRulesPlugin(M){const{editor:$,rules:I}=M,N=new Plugin({state:{init(){return null},apply(B,j){const U=B.getMeta(N);return U||(B.selectionSet||B.docChanged?null:j)}},props:{handleTextInput(B,j,U,q){return run$1({editor:$,from:j,to:U,text:q,rules:I,plugin:N})},handleDOMEvents:{compositionend:B=>(setTimeout(()=>{const{$cursor:j}=B.state.selection;j&&run$1({editor:$,from:j.pos,to:j.pos,text:"",rules:I,plugin:N})}),!1)},handleKeyDown(B,j){if(j.key!=="Enter")return!1;const{$cursor:U}=B.state.selection;return U?run$1({editor:$,from:U.pos,to:U.pos,text:` `,rules:I,plugin:N}):!1}},isInputRules:!0});return N}function isNumber$4(M){return typeof M=="number"}class PasteRule{constructor($){this.find=$.find,this.handler=$.handler}}const pasteRuleMatcherHandler=(M,$)=>{if(isRegExp$4($))return[...M.matchAll($)];const I=$(M);return I?I.map(N=>{const B=[N.text];return B.index=N.index,B.input=M,B.data=N.data,N.replaceWith&&(N.text.includes(N.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),B.push(N.replaceWith)),B}):[]};function run(M){const{editor:$,state:I,from:N,to:B,rule:j}=M,{commands:U,chain:q,can:Y}=new CommandManager({editor:$,state:I}),K=[];return I.doc.nodesBetween(N,B,(J,Z)=>{if(!J.isTextblock||J.type.spec.code)return;const ee=Math.max(N,Z),te=Math.min(B,Z+J.content.size),re=J.textBetween(ee-Z,te-Z,void 0,"");pasteRuleMatcherHandler(re,j.find).forEach(ne=>{if(ne.index===void 0)return;const le=ee+ne.index+1,ge=le+ne[0].length,ue={from:I.tr.mapping.map(le),to:I.tr.mapping.map(ge)},_e=j.handler({state:I,range:ue,match:ne,commands:U,chain:q,can:Y});K.push(_e)})}),K.every(J=>J!==null)}function pasteRulesPlugin(M){const{editor:$,rules:I}=M;let N=null,B=!1,j=!1;return I.map(q=>new Plugin({view(Y){const K=G=>{var J;N=!((J=Y.dom.parentElement)===null||J===void 0)&&J.contains(G.target)?Y.dom.parentElement:null};return window.addEventListener("dragstart",K),{destroy(){window.removeEventListener("dragstart",K)}}},props:{handleDOMEvents:{drop:Y=>(j=N===Y.dom.parentElement,!1),paste:(Y,K)=>{var G;const J=(G=K.clipboardData)===null||G===void 0?void 0:G.getData("text/html");return B=!!(J!=null&&J.includes("data-pm-slice")),!1}}},appendTransaction:(Y,K,G)=>{const J=Y[0],Z=J.getMeta("uiEvent")==="paste"&&!B,ee=J.getMeta("uiEvent")==="drop"&&!j;if(!Z&&!ee)return;const te=K.doc.content.findDiffStart(G.doc.content),re=K.doc.content.findDiffEnd(G.doc.content);if(!isNumber$4(te)||!re||te===re.b)return;const se=G.tr,ne=createChainableState({state:G,transaction:se});if(!(!run({editor:$,state:ne,from:Math.max(te-1,0),to:re.b-1,rule:q})||!se.steps.length))return se}}))}function findDuplicates(M){const $=M.filter((I,N)=>M.indexOf(I)!==N);return[...new Set($)]}class ExtensionManager{constructor($,I){this.splittableMarks=[],this.editor=I,this.extensions=ExtensionManager.resolve($),this.schema=getSchemaByResolvedExtensions(this.extensions,I),this.extensions.forEach(N=>{var B;this.editor.extensionStorage[N.name]=N.storage;const j={name:N.name,options:N.options,storage:N.storage,editor:this.editor,type:getSchemaTypeByName(N.name,this.schema)};N.type==="mark"&&(!((B=callOrReturn(getExtensionField(N,"keepOnSplit",j)))!==null&&B!==void 0)||B)&&this.splittableMarks.push(N.name);const U=getExtensionField(N,"onBeforeCreate",j);U&&this.editor.on("beforeCreate",U);const q=getExtensionField(N,"onCreate",j);q&&this.editor.on("create",q);const Y=getExtensionField(N,"onUpdate",j);Y&&this.editor.on("update",Y);const K=getExtensionField(N,"onSelectionUpdate",j);K&&this.editor.on("selectionUpdate",K);const G=getExtensionField(N,"onTransaction",j);G&&this.editor.on("transaction",G);const J=getExtensionField(N,"onFocus",j);J&&this.editor.on("focus",J);const Z=getExtensionField(N,"onBlur",j);Z&&this.editor.on("blur",Z);const ee=getExtensionField(N,"onDestroy",j);ee&&this.editor.on("destroy",ee)})}static resolve($){const I=ExtensionManager.sort(ExtensionManager.flatten($)),N=findDuplicates(I.map(B=>B.name));return N.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${N.map(B=>`'${B}'`).join(", ")}]. This can lead to issues.`),I}static flatten($){return $.map(I=>{const N={name:I.name,options:I.options,storage:I.storage},B=getExtensionField(I,"addExtensions",N);return B?[I,...this.flatten(B())]:I}).flat(10)}static sort($){return $.sort((N,B)=>{const j=getExtensionField(N,"priority")||100,U=getExtensionField(B,"priority")||100;return j>U?-1:j{const N={name:I.name,options:I.options,storage:I.storage,editor:this.editor,type:getSchemaTypeByName(I.name,this.schema)},B=getExtensionField(I,"addCommands",N);return B?{...$,...B()}:$},{})}get plugins(){const{editor:$}=this,I=ExtensionManager.sort([...this.extensions].reverse()),N=[],B=[],j=I.map(U=>{const q={name:U.name,options:U.options,storage:U.storage,editor:$,type:getSchemaTypeByName(U.name,this.schema)},Y=[],K=getExtensionField(U,"addKeyboardShortcuts",q);let G={};if(U.type==="mark"&&U.config.exitable&&(G.ArrowRight=()=>Mark.handleExit({editor:$,mark:U})),K){const re=Object.fromEntries(Object.entries(K()).map(([se,ne])=>[se,()=>ne({editor:$})]));G={...G,...re}}const J=keymap(G);Y.push(J);const Z=getExtensionField(U,"addInputRules",q);isExtensionRulesEnabled(U,$.options.enableInputRules)&&Z&&N.push(...Z());const ee=getExtensionField(U,"addPasteRules",q);isExtensionRulesEnabled(U,$.options.enablePasteRules)&&ee&&B.push(...ee());const te=getExtensionField(U,"addProseMirrorPlugins",q);if(te){const re=te();Y.push(...re)}return Y}).flat();return[inputRulesPlugin({editor:$,rules:N}),...pasteRulesPlugin({editor:$,rules:B}),...j]}get attributes(){return getAttributesFromExtensions(this.extensions)}get nodeViews(){const{editor:$}=this,{nodeExtensions:I}=splitExtensions(this.extensions);return Object.fromEntries(I.filter(N=>!!getExtensionField(N,"addNodeView")).map(N=>{const B=this.attributes.filter(Y=>Y.type===N.name),j={name:N.name,options:N.options,storage:N.storage,editor:$,type:getNodeType(N.name,this.schema)},U=getExtensionField(N,"addNodeView",j);if(!U)return[];const q=(Y,K,G,J)=>{const Z=getRenderedAttributes(Y,B);return U()({editor:$,node:Y,getPos:G,decorations:J,HTMLAttributes:Z,extension:N})};return[N.name,q]}))}}function getType(M){return Object.prototype.toString.call(M).slice(8,-1)}function isPlainObject$1(M){return getType(M)!=="Object"?!1:M.constructor===Object&&Object.getPrototypeOf(M)===Object.prototype}function mergeDeep(M,$){const I={...M};return isPlainObject$1(M)&&isPlainObject$1($)&&Object.keys($).forEach(N=>{isPlainObject$1($[N])?N in M?I[N]=mergeDeep(M[N],$[N]):Object.assign(I,{[N]:$[N]}):Object.assign(I,{[N]:$[N]})}),I}class Extension{constructor($={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...$},this.name=this.config.name,$.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=callOrReturn(getExtensionField(this,"addOptions",{name:this.name}))),this.storage=callOrReturn(getExtensionField(this,"addStorage",{name:this.name,options:this.options}))||{}}static create($={}){return new Extension($)}configure($={}){const I=this.extend();return I.options=mergeDeep(this.options,$),I.storage=callOrReturn(getExtensionField(I,"addStorage",{name:I.name,options:I.options})),I}extend($={}){const I=new Extension($);return I.parent=this,this.child=I,I.name=$.name?$.name:I.parent.name,$.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${I.name}".`),I.options=callOrReturn(getExtensionField(I,"addOptions",{name:I.name})),I.storage=callOrReturn(getExtensionField(I,"addStorage",{name:I.name,options:I.options})),I}}function getTextBetween(M,$,I){const{from:N,to:B}=$,{blockSeparator:j=` `,textSerializers:U={}}=I||{};let q="",Y=!0;return M.nodesBetween(N,B,(K,G,J,Z)=>{var ee;const te=U==null?void 0:U[K.type.name];te?(K.isBlock&&!Y&&(q+=j,Y=!0),J&&(q+=te({node:K,pos:G,parent:J,index:Z,range:$}))):K.isText?(q+=(ee=K==null?void 0:K.text)===null||ee===void 0?void 0:ee.slice(Math.max(N,G)-G,B-G),Y=!1):K.isBlock&&!Y&&(q+=j,Y=!0)}),q}function getTextSerializersFromSchema(M){return Object.fromEntries(Object.entries(M.nodes).filter(([,$])=>$.spec.toText).map(([$,I])=>[$,I.spec.toText]))}const ClipboardTextSerializer=Extension.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:M}=this,{state:$,schema:I}=M,{doc:N,selection:B}=$,{ranges:j}=B,U=Math.min(...j.map(G=>G.$from.pos)),q=Math.max(...j.map(G=>G.$to.pos)),Y=getTextSerializersFromSchema(I);return getTextBetween(N,{from:U,to:q},{textSerializers:Y})}}})]}}),blur=()=>({editor:M,view:$})=>(requestAnimationFrame(()=>{var I;M.isDestroyed||($.dom.blur(),(I=window==null?void 0:window.getSelection())===null||I===void 0||I.removeAllRanges())}),!0),clearContent=(M=!1)=>({commands:$})=>$.setContent("",M),clearNodes=()=>({state:M,tr:$,dispatch:I})=>{const{selection:N}=$,{ranges:B}=N;return I&&B.forEach(({$from:j,$to:U})=>{M.doc.nodesBetween(j.pos,U.pos,(q,Y)=>{if(q.type.isText)return;const{doc:K,mapping:G}=$,J=K.resolve(G.map(Y)),Z=K.resolve(G.map(Y+q.nodeSize)),ee=J.blockRange(Z);if(!ee)return;const te=liftTarget(ee);if(q.type.isTextblock){const{defaultType:re}=J.parent.contentMatchAt(J.index());$.setNodeMarkup(ee.start,re)}(te||te===0)&&$.lift(ee,te)})}),!0},command=M=>$=>M($),createParagraphNear=()=>({state:M,dispatch:$})=>createParagraphNear$1(M,$),deleteCurrentNode=()=>({tr:M,dispatch:$})=>{const{selection:I}=M,N=I.$anchor.node();if(N.content.size>0)return!1;const B=M.selection.$anchor;for(let j=B.depth;j>0;j-=1)if(B.node(j).type===N.type){if($){const q=B.before(j),Y=B.after(j);M.delete(q,Y).scrollIntoView()}return!0}return!1},deleteNode=M=>({tr:$,state:I,dispatch:N})=>{const B=getNodeType(M,I.schema),j=$.selection.$anchor;for(let U=j.depth;U>0;U-=1)if(j.node(U).type===B){if(N){const Y=j.before(U),K=j.after(U);$.delete(Y,K).scrollIntoView()}return!0}return!1},deleteRange=M=>({tr:$,dispatch:I})=>{const{from:N,to:B}=M;return I&&$.delete(N,B),!0},deleteSelection=()=>({state:M,dispatch:$})=>deleteSelection$1(M,$),enter=()=>({commands:M})=>M.keyboardShortcut("Enter"),exitCode=()=>({state:M,dispatch:$})=>exitCode$1(M,$);function objectIncludes$1(M,$,I={strict:!0}){const N=Object.keys($);return N.length?N.every(B=>I.strict?$[B]===M[B]:isRegExp$4($[B])?$[B].test(M[B]):$[B]===M[B]):!0}function findMarkInSet(M,$,I={}){return M.find(N=>N.type===$&&objectIncludes$1(N.attrs,I))}function isMarkInSet(M,$,I={}){return!!findMarkInSet(M,$,I)}function getMarkRange(M,$,I={}){if(!M||!$)return;let N=M.parent.childAfter(M.parentOffset);if(M.parentOffset===N.offset&&N.offset!==0&&(N=M.parent.childBefore(M.parentOffset)),!N.node)return;const B=findMarkInSet([...N.node.marks],$,I);if(!B)return;let j=N.index,U=M.start()+N.offset,q=j+1,Y=U+N.node.nodeSize;for(findMarkInSet([...N.node.marks],$,I);j>0&&B.isInSet(M.parent.child(j-1).marks);)j-=1,U-=M.parent.child(j).nodeSize;for(;q({tr:I,state:N,dispatch:B})=>{const j=getMarkType(M,N.schema),{doc:U,selection:q}=I,{$from:Y,from:K,to:G}=q;if(B){const J=getMarkRange(Y,j,$);if(J&&J.from<=K&&J.to>=G){const Z=TextSelection.create(U,J.from,J.to);I.setSelection(Z)}}return!0},first$1=M=>$=>{const I=typeof M=="function"?M($):M;for(let N=0;N({editor:I,view:N,tr:B,dispatch:j})=>{$={scrollIntoView:!0,...$};const U=()=>{isiOS()&&N.dom.focus(),requestAnimationFrame(()=>{I.isDestroyed||(N.focus(),$!=null&&$.scrollIntoView&&I.commands.scrollIntoView())})};if(N.hasFocus()&&M===null||M===!1)return!0;if(j&&M===null&&!isTextSelection(I.state.selection))return U(),!0;const q=resolveFocusPosition(B.doc,M)||I.state.selection,Y=I.state.selection.eq(q);return j&&(Y||B.setSelection(q),Y&&B.storedMarks&&B.setStoredMarks(B.storedMarks),U()),!0},forEach$1=(M,$)=>I=>M.every((N,B)=>$(N,{...I,index:B})),insertContent=(M,$)=>({tr:I,commands:N})=>N.insertContentAt({from:I.selection.from,to:I.selection.to},M,$);function elementFromString(M){const $=`${M}`;return new window.DOMParser().parseFromString($,"text/html").body}function createNodeFromContent(M,$,I){if(I={slice:!0,parseOptions:{},...I},typeof M=="object"&&M!==null)try{return Array.isArray(M)&&M.length>0?Fragment.fromArray(M.map(N=>$.nodeFromJSON(N))):$.nodeFromJSON(M)}catch(N){return console.warn("[tiptap warn]: Invalid content.","Passed value:",M,"Error:",N),createNodeFromContent("",$,I)}if(typeof M=="string"){const N=DOMParser.fromSchema($);return I.slice?N.parseSlice(elementFromString(M),I.parseOptions).content:N.parse(elementFromString(M),I.parseOptions)}return createNodeFromContent("",$,I)}function selectionToInsertionEnd(M,$,I){const N=M.steps.length-1;if(N<$)return;const B=M.steps[N];if(!(B instanceof ReplaceStep||B instanceof ReplaceAroundStep))return;const j=M.mapping.maps[N];let U=0;j.forEach((q,Y,K,G)=>{U===0&&(U=G)}),M.setSelection(Selection.near(M.doc.resolve(U),I))}const isFragment=M=>M.toString().startsWith("<"),insertContentAt=(M,$,I)=>({tr:N,dispatch:B,editor:j})=>{if(B){I={parseOptions:{},updateSelection:!0,...I};const U=createNodeFromContent($,j.schema,{parseOptions:{preserveWhitespace:"full",...I.parseOptions}});if(U.toString()==="<>")return!0;let{from:q,to:Y}=typeof M=="number"?{from:M,to:M}:M,K=!0,G=!0;if((isFragment(U)?U:[U]).forEach(Z=>{Z.check(),K=K?Z.isText&&Z.marks.length===0:!1,G=G?Z.isBlock:!1}),q===Y&&G){const{parent:Z}=N.doc.resolve(q);Z.isTextblock&&!Z.type.spec.code&&!Z.childCount&&(q-=1,Y+=1)}K?Array.isArray($)?N.insertText($.map(Z=>Z.text||"").join(""),q,Y):typeof $=="object"&&$&&$.text?N.insertText($.text,q,Y):N.insertText($,q,Y):N.replaceWith(q,Y,U),I.updateSelection&&selectionToInsertionEnd(N,N.steps.length-1,-1)}return!0},joinUp=()=>({state:M,dispatch:$})=>joinUp$1(M,$),joinDown=()=>({state:M,dispatch:$})=>joinDown$1(M,$),joinBackward=()=>({state:M,dispatch:$})=>joinBackward$1(M,$),joinForward=()=>({state:M,dispatch:$})=>joinForward$1(M,$);function isMacOS(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function normalizeKeyName(M){const $=M.split(/-(?!$)/);let I=$[$.length-1];I==="Space"&&(I=" ");let N,B,j,U;for(let q=0;q<$.length-1;q+=1){const Y=$[q];if(/^(cmd|meta|m)$/i.test(Y))U=!0;else if(/^a(lt)?$/i.test(Y))N=!0;else if(/^(c|ctrl|control)$/i.test(Y))B=!0;else if(/^s(hift)?$/i.test(Y))j=!0;else if(/^mod$/i.test(Y))isiOS()||isMacOS()?U=!0:B=!0;else throw new Error(`Unrecognized modifier name: ${Y}`)}return N&&(I=`Alt-${I}`),B&&(I=`Ctrl-${I}`),U&&(I=`Meta-${I}`),j&&(I=`Shift-${I}`),I}const keyboardShortcut=M=>({editor:$,view:I,tr:N,dispatch:B})=>{const j=normalizeKeyName(M).split(/-(?!$)/),U=j.find(K=>!["Alt","Ctrl","Meta","Shift"].includes(K)),q=new KeyboardEvent("keydown",{key:U==="Space"?" ":U,altKey:j.includes("Alt"),ctrlKey:j.includes("Ctrl"),metaKey:j.includes("Meta"),shiftKey:j.includes("Shift"),bubbles:!0,cancelable:!0}),Y=$.captureTransaction(()=>{I.someProp("handleKeyDown",K=>K(I,q))});return Y==null||Y.steps.forEach(K=>{const G=K.map(N.mapping);G&&B&&N.maybeStep(G)}),!0};function isNodeActive(M,$,I={}){const{from:N,to:B,empty:j}=M.selection,U=$?getNodeType($,M.schema):null,q=[];M.doc.nodesBetween(N,B,(J,Z)=>{if(J.isText)return;const ee=Math.max(N,Z),te=Math.min(B,Z+J.nodeSize);q.push({node:J,from:ee,to:te})});const Y=B-N,K=q.filter(J=>U?U.name===J.node.type.name:!0).filter(J=>objectIncludes$1(J.node.attrs,I,{strict:!1}));return j?!!K.length:K.reduce((J,Z)=>J+Z.to-Z.from,0)>=Y}const lift=(M,$={})=>({state:I,dispatch:N})=>{const B=getNodeType(M,I.schema);return isNodeActive(I,B,$)?lift$1(I,N):!1},liftEmptyBlock=()=>({state:M,dispatch:$})=>liftEmptyBlock$1(M,$),liftListItem=M=>({state:$,dispatch:I})=>{const N=getNodeType(M,$.schema);return liftListItem$1(N)($,I)},newlineInCode=()=>({state:M,dispatch:$})=>newlineInCode$1(M,$);function getSchemaTypeNameByName(M,$){return $.nodes[M]?"node":$.marks[M]?"mark":null}function deleteProps(M,$){const I=typeof $=="string"?[$]:$;return Object.keys(M).reduce((N,B)=>(I.includes(B)||(N[B]=M[B]),N),{})}const resetAttributes=(M,$)=>({tr:I,state:N,dispatch:B})=>{let j=null,U=null;const q=getSchemaTypeNameByName(typeof M=="string"?M:M.name,N.schema);return q?(q==="node"&&(j=getNodeType(M,N.schema)),q==="mark"&&(U=getMarkType(M,N.schema)),B&&I.selection.ranges.forEach(Y=>{N.doc.nodesBetween(Y.$from.pos,Y.$to.pos,(K,G)=>{j&&j===K.type&&I.setNodeMarkup(G,void 0,deleteProps(K.attrs,$)),U&&K.marks.length&&K.marks.forEach(J=>{U===J.type&&I.addMark(G,G+K.nodeSize,U.create(deleteProps(J.attrs,$)))})})}),!0):!1},scrollIntoView=()=>({tr:M,dispatch:$})=>($&&M.scrollIntoView(),!0),selectAll=()=>({tr:M,commands:$})=>$.setTextSelection({from:0,to:M.doc.content.size}),selectNodeBackward=()=>({state:M,dispatch:$})=>selectNodeBackward$1(M,$),selectNodeForward=()=>({state:M,dispatch:$})=>selectNodeForward$1(M,$),selectParentNode=()=>({state:M,dispatch:$})=>selectParentNode$1(M,$),selectTextblockEnd=()=>({state:M,dispatch:$})=>selectTextblockEnd$1(M,$),selectTextblockStart=()=>({state:M,dispatch:$})=>selectTextblockStart$1(M,$);function createDocument(M,$,I={}){return createNodeFromContent(M,$,{slice:!1,parseOptions:I})}const setContent$1=(M,$=!1,I={})=>({tr:N,editor:B,dispatch:j})=>{const{doc:U}=N,q=createDocument(M,B.schema,I);return j&&N.replaceWith(0,U.content.size,q).setMeta("preventUpdate",!$),!0};function combineTransactionSteps(M,$){const I=new Transform(M);return $.forEach(N=>{N.steps.forEach(B=>{I.step(B)})}),I}function defaultBlockAt(M){for(let $=0;${$(N)&&I.push({node:N,pos:B})}),I}function findChildrenInRange(M,$,I){const N=[];return M.nodesBetween($.from,$.to,(B,j)=>{I(B)&&N.push({node:B,pos:j})}),N}function findParentNodeClosestToPos(M,$){for(let I=M.depth;I>0;I-=1){const N=M.node(I);if($(N))return{pos:I>0?M.before(I):0,start:M.start(I),depth:I,node:N}}}function findParentNode(M){return $=>findParentNodeClosestToPos($.$from,M)}function getHTMLFromFragment(M,$){const I=DOMSerializer.fromSchema($).serializeFragment(M),B=document.implementation.createHTMLDocument().createElement("div");return B.appendChild(I),B.innerHTML}function getSchema(M,$){const I=ExtensionManager.resolve(M);return getSchemaByResolvedExtensions(I,$)}function generateHTML(M,$){const I=getSchema($),N=Node$2.fromJSON(I,M);return getHTMLFromFragment(N.content,I)}function generateJSON(M,$){const I=getSchema($),N=elementFromString(M);return DOMParser.fromSchema(I).parse(N).toJSON()}function getText(M,$){const I={from:0,to:M.content.size};return getTextBetween(M,I,$)}function generateText(M,$,I){const{blockSeparator:N=` `,textSerializers:B={}}=I||{},j=getSchema($),U=Node$2.fromJSON(j,M);return getText(U,{blockSeparator:N,textSerializers:{...getTextSerializersFromSchema(j),...B}})}function getMarkAttributes(M,$){const I=getMarkType($,M.schema),{from:N,to:B,empty:j}=M.selection,U=[];j?(M.storedMarks&&U.push(...M.storedMarks),U.push(...M.selection.$head.marks())):M.doc.nodesBetween(N,B,Y=>{U.push(...Y.marks)});const q=U.find(Y=>Y.type.name===I.name);return q?{...q.attrs}:{}}function getNodeAttributes(M,$){const I=getNodeType($,M.schema),{from:N,to:B}=M.selection,j=[];M.doc.nodesBetween(N,B,q=>{j.push(q)});const U=j.reverse().find(q=>q.type.name===I.name);return U?{...U.attrs}:{}}function getAttributes(M,$){const I=getSchemaTypeNameByName(typeof $=="string"?$:$.name,M.schema);return I==="node"?getNodeAttributes(M,$):I==="mark"?getMarkAttributes(M,$):{}}function removeDuplicates(M,$=JSON.stringify){const I={};return M.filter(N=>{const B=$(N);return Object.prototype.hasOwnProperty.call(I,B)?!1:I[B]=!0})}function simplifyChangedRanges(M){const $=removeDuplicates(M);return $.length===1?$:$.filter((I,N)=>!$.filter((j,U)=>U!==N).some(j=>I.oldRange.from>=j.oldRange.from&&I.oldRange.to<=j.oldRange.to&&I.newRange.from>=j.newRange.from&&I.newRange.to<=j.newRange.to))}function getChangedRanges(M){const{mapping:$,steps:I}=M,N=[];return $.maps.forEach((B,j)=>{const U=[];if(B.ranges.length)B.forEach((q,Y)=>{U.push({from:q,to:Y})});else{const{from:q,to:Y}=I[j];if(q===void 0||Y===void 0)return;U.push({from:q,to:Y})}U.forEach(({from:q,to:Y})=>{const K=$.slice(j).map(q,-1),G=$.slice(j).map(Y),J=$.invert().map(K,-1),Z=$.invert().map(G);N.push({oldRange:{from:J,to:Z},newRange:{from:K,to:G}})})}),simplifyChangedRanges(N)}function getDebugJSON(M,$=0){const N=M.type===M.type.schema.topNodeType?0:1,B=$,j=B+M.nodeSize,U=M.marks.map(K=>{const G={type:K.type.name};return Object.keys(K.attrs).length&&(G.attrs={...K.attrs}),G}),q={...M.attrs},Y={type:M.type.name,from:B,to:j};return Object.keys(q).length&&(Y.attrs=q),U.length&&(Y.marks=U),M.content.childCount&&(Y.content=[],M.forEach((K,G)=>{var J;(J=Y.content)===null||J===void 0||J.push(getDebugJSON(K,$+G+N))})),M.text&&(Y.text=M.text),Y}function getMarksBetween(M,$,I){const N=[];return M===$?I.resolve(M).marks().forEach(B=>{const j=I.resolve(M-1),U=getMarkRange(j,B.type);U&&N.push({mark:B,...U})}):I.nodesBetween(M,$,(B,j)=>{N.push(...B.marks.map(U=>({from:j,to:j+B.nodeSize,mark:U})))}),N}function getSplittedAttributes(M,$,I){return Object.fromEntries(Object.entries(I).filter(([N])=>{const B=M.find(j=>j.type===$&&j.name===N);return B?B.attribute.keepOnSplit:!1}))}function isMarkActive(M,$,I={}){const{empty:N,ranges:B}=M.selection,j=$?getMarkType($,M.schema):null;if(N)return!!(M.storedMarks||M.selection.$from.marks()).filter(J=>j?j.name===J.type.name:!0).find(J=>objectIncludes$1(J.attrs,I,{strict:!1}));let U=0;const q=[];if(B.forEach(({$from:J,$to:Z})=>{const ee=J.pos,te=Z.pos;M.doc.nodesBetween(ee,te,(re,se)=>{if(!re.isText&&!re.marks.length)return;const ne=Math.max(ee,se),le=Math.min(te,se+re.nodeSize),ge=le-ne;U+=ge,q.push(...re.marks.map(ue=>({mark:ue,from:ne,to:le})))})}),U===0)return!1;const Y=q.filter(J=>j?j.name===J.mark.type.name:!0).filter(J=>objectIncludes$1(J.mark.attrs,I,{strict:!1})).reduce((J,Z)=>J+Z.to-Z.from,0),K=q.filter(J=>j?J.mark.type!==j&&J.mark.type.excludes(j):!0).reduce((J,Z)=>J+Z.to-Z.from,0);return(Y>0?Y+K:Y)>=U}function isActive(M,$,I={}){if(!$)return isNodeActive(M,null,I)||isMarkActive(M,null,I);const N=getSchemaTypeNameByName($,M.schema);return N==="node"?isNodeActive(M,$,I):N==="mark"?isMarkActive(M,$,I):!1}function isList(M,$){const{nodeExtensions:I}=splitExtensions($),N=I.find(U=>U.name===M);if(!N)return!1;const B={name:N.name,options:N.options,storage:N.storage},j=callOrReturn(getExtensionField(N,"group",B));return typeof j!="string"?!1:j.split(" ").includes("list")}function isNodeEmpty(M){var $;const I=($=M.type.createAndFill())===null||$===void 0?void 0:$.toJSON(),N=M.toJSON();return JSON.stringify(I)===JSON.stringify(N)}function isNodeSelection(M){return M instanceof NodeSelection}function posToDOMRect(M,$,I){const B=M.state.doc.content.size,j=minMax($,0,B),U=minMax(I,0,B),q=M.coordsAtPos(j),Y=M.coordsAtPos(U,-1),K=Math.min(q.top,Y.top),G=Math.max(q.bottom,Y.bottom),J=Math.min(q.left,Y.left),Z=Math.max(q.right,Y.right),ee=Z-J,te=G-K,ne={top:K,bottom:G,left:J,right:Z,width:ee,height:te,x:J,y:K};return{...ne,toJSON:()=>ne}}function canSetMark(M,$,I){var N;const{selection:B}=$;let j=null;if(isTextSelection(B)&&(j=B.$cursor),j){const q=(N=M.storedMarks)!==null&&N!==void 0?N:j.marks();return!!I.isInSet(q)||!q.some(Y=>Y.type.excludes(I))}const{ranges:U}=B;return U.some(({$from:q,$to:Y})=>{let K=q.depth===0?M.doc.inlineContent&&M.doc.type.allowsMarkType(I):!1;return M.doc.nodesBetween(q.pos,Y.pos,(G,J,Z)=>{if(K)return!1;if(G.isInline){const ee=!Z||Z.type.allowsMarkType(I),te=!!I.isInSet(G.marks)||!G.marks.some(re=>re.type.excludes(I));K=ee&&te}return!K}),K})}const setMark=(M,$={})=>({tr:I,state:N,dispatch:B})=>{const{selection:j}=I,{empty:U,ranges:q}=j,Y=getMarkType(M,N.schema);if(B)if(U){const K=getMarkAttributes(N,Y);I.addStoredMark(Y.create({...K,...$}))}else q.forEach(K=>{const G=K.$from.pos,J=K.$to.pos;N.doc.nodesBetween(G,J,(Z,ee)=>{const te=Math.max(ee,G),re=Math.min(ee+Z.nodeSize,J);Z.marks.find(ne=>ne.type===Y)?Z.marks.forEach(ne=>{Y===ne.type&&I.addMark(te,re,Y.create({...ne.attrs,...$}))}):I.addMark(te,re,Y.create($))})});return canSetMark(N,I,Y)},setMeta=(M,$)=>({tr:I})=>(I.setMeta(M,$),!0),setNode=(M,$={})=>({state:I,dispatch:N,chain:B})=>{const j=getNodeType(M,I.schema);return j.isTextblock?B().command(({commands:U})=>setBlockType(j,$)(I)?!0:U.clearNodes()).command(({state:U})=>setBlockType(j,$)(U,N)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection=M=>({tr:$,dispatch:I})=>{if(I){const{doc:N}=$,B=minMax(M,0,N.content.size),j=NodeSelection.create(N,B);$.setSelection(j)}return!0},setTextSelection=M=>({tr:$,dispatch:I})=>{if(I){const{doc:N}=$,{from:B,to:j}=typeof M=="number"?{from:M,to:M}:M,U=TextSelection.atStart(N).from,q=TextSelection.atEnd(N).to,Y=minMax(B,U,q),K=minMax(j,U,q),G=TextSelection.create(N,Y,K);$.setSelection(G)}return!0},sinkListItem=M=>({state:$,dispatch:I})=>{const N=getNodeType(M,$.schema);return sinkListItem$1(N)($,I)};function ensureMarks(M,$){const I=M.storedMarks||M.selection.$to.parentOffset&&M.selection.$from.marks();if(I){const N=I.filter(B=>$==null?void 0:$.includes(B.type.name));M.tr.ensureMarks(N)}}const splitBlock=({keepMarks:M=!0}={})=>({tr:$,state:I,dispatch:N,editor:B})=>{const{selection:j,doc:U}=$,{$from:q,$to:Y}=j,K=B.extensionManager.attributes,G=getSplittedAttributes(K,q.node().type.name,q.node().attrs);if(j instanceof NodeSelection&&j.node.isBlock)return!q.parentOffset||!canSplit(U,q.pos)?!1:(N&&(M&&ensureMarks(I,B.extensionManager.splittableMarks),$.split(q.pos).scrollIntoView()),!0);if(!q.parent.isBlock)return!1;if(N){const J=Y.parentOffset===Y.parent.content.size;j instanceof TextSelection&&$.deleteSelection();const Z=q.depth===0?void 0:defaultBlockAt(q.node(-1).contentMatchAt(q.indexAfter(-1)));let ee=J&&Z?[{type:Z,attrs:G}]:void 0,te=canSplit($.doc,$.mapping.map(q.pos),1,ee);if(!ee&&!te&&canSplit($.doc,$.mapping.map(q.pos),1,Z?[{type:Z}]:void 0)&&(te=!0,ee=Z?[{type:Z,attrs:G}]:void 0),te&&($.split($.mapping.map(q.pos),1,ee),Z&&!J&&!q.parentOffset&&q.parent.type!==Z)){const re=$.mapping.map(q.before()),se=$.doc.resolve(re);q.node(-1).canReplaceWith(se.index(),se.index()+1,Z)&&$.setNodeMarkup($.mapping.map(q.before()),Z)}M&&ensureMarks(I,B.extensionManager.splittableMarks),$.scrollIntoView()}return!0},splitListItem=M=>({tr:$,state:I,dispatch:N,editor:B})=>{var j;const U=getNodeType(M,I.schema),{$from:q,$to:Y}=I.selection,K=I.selection.node;if(K&&K.isBlock||q.depth<2||!q.sameParent(Y))return!1;const G=q.node(-1);if(G.type!==U)return!1;const J=B.extensionManager.attributes;if(q.parent.content.size===0&&q.node(-1).childCount===q.indexAfter(-1)){if(q.depth===2||q.node(-3).type!==U||q.index(-2)!==q.node(-2).childCount-1)return!1;if(N){let se=Fragment.empty;const ne=q.index(-1)?1:q.index(-2)?2:3;for(let me=q.depth-ne;me>=q.depth-3;me-=1)se=Fragment.from(q.node(me).copy(se));const le=q.indexAfter(-1){if(fe>-1)return!1;me.isTextblock&&me.content.size===0&&(fe=ve+1)}),fe>-1&&$.setSelection(TextSelection.near($.doc.resolve(fe))),$.scrollIntoView()}return!0}const Z=Y.pos===q.end()?G.contentMatchAt(0).defaultType:null,ee=getSplittedAttributes(J,G.type.name,G.attrs),te=getSplittedAttributes(J,q.node().type.name,q.node().attrs);$.delete(q.pos,Y.pos);const re=Z?[{type:U,attrs:ee},{type:Z,attrs:te}]:[{type:U,attrs:ee}];if(!canSplit($.doc,q.pos,2))return!1;if(N){const{selection:se,storedMarks:ne}=I,{splittableMarks:le}=B.extensionManager,ge=ne||se.$to.parentOffset&&se.$from.marks();if($.split(q.pos,2,re).scrollIntoView(),!ge||!N)return!0;const ue=ge.filter(_e=>le.includes(_e.type.name));$.ensureMarks(ue)}return!0},joinListBackwards=(M,$)=>{const I=findParentNode(U=>U.type===$)(M.selection);if(!I)return!0;const N=M.doc.resolve(Math.max(0,I.pos-1)).before(I.depth);if(N===void 0)return!0;const B=M.doc.nodeAt(N);return I.node.type===(B==null?void 0:B.type)&&canJoin(M.doc,I.pos)&&M.join(I.pos),!0},joinListForwards=(M,$)=>{const I=findParentNode(U=>U.type===$)(M.selection);if(!I)return!0;const N=M.doc.resolve(I.start).after(I.depth);if(N===void 0)return!0;const B=M.doc.nodeAt(N);return I.node.type===(B==null?void 0:B.type)&&canJoin(M.doc,N)&&M.join(N),!0},toggleList=(M,$,I,N={})=>({editor:B,tr:j,state:U,dispatch:q,chain:Y,commands:K,can:G})=>{const{extensions:J,splittableMarks:Z}=B.extensionManager,ee=getNodeType(M,U.schema),te=getNodeType($,U.schema),{selection:re,storedMarks:se}=U,{$from:ne,$to:le}=re,ge=ne.blockRange(le),ue=se||re.$to.parentOffset&&re.$from.marks();if(!ge)return!1;const _e=findParentNode(fe=>isList(fe.type.name,J))(re);if(ge.depth>=1&&_e&&ge.depth-_e.depth<=1){if(_e.node.type===ee)return K.liftListItem(te);if(isList(_e.node.type.name,J)&&ee.validContent(_e.node.content)&&q)return Y().command(()=>(j.setNodeMarkup(_e.pos,ee),!0)).command(()=>joinListBackwards(j,ee)).command(()=>joinListForwards(j,ee)).run()}return!I||!ue||!q?Y().command(()=>G().wrapInList(ee,N)?!0:K.clearNodes()).wrapInList(ee,N).command(()=>joinListBackwards(j,ee)).command(()=>joinListForwards(j,ee)).run():Y().command(()=>{const fe=G().wrapInList(ee,N),me=ue.filter(ve=>Z.includes(ve.type.name));return j.ensureMarks(me),fe?!0:K.clearNodes()}).wrapInList(ee,N).command(()=>joinListBackwards(j,ee)).command(()=>joinListForwards(j,ee)).run()},toggleMark=(M,$={},I={})=>({state:N,commands:B})=>{const{extendEmptyMarkRange:j=!1}=I,U=getMarkType(M,N.schema);return isMarkActive(N,U,$)?B.unsetMark(U,{extendEmptyMarkRange:j}):B.setMark(U,$)},toggleNode=(M,$,I={})=>({state:N,commands:B})=>{const j=getNodeType(M,N.schema),U=getNodeType($,N.schema);return isNodeActive(N,j,I)?B.setNode(U):B.setNode(j,I)},toggleWrap=(M,$={})=>({state:I,commands:N})=>{const B=getNodeType(M,I.schema);return isNodeActive(I,B,$)?N.lift(B):N.wrapIn(B,$)},undoInputRule=()=>({state:M,dispatch:$})=>{const I=M.plugins;for(let N=0;N=0;Y-=1)U.step(q.steps[Y].invert(q.docs[Y]));if(j.text){const Y=U.doc.resolve(j.from).marks();U.replaceWith(j.from,j.to,M.schema.text(j.text,Y))}else U.delete(j.from,j.to)}return!0}}return!1},unsetAllMarks=()=>({tr:M,dispatch:$})=>{const{selection:I}=M,{empty:N,ranges:B}=I;return N||$&&B.forEach(j=>{M.removeMark(j.$from.pos,j.$to.pos)}),!0},unsetMark=(M,$={})=>({tr:I,state:N,dispatch:B})=>{var j;const{extendEmptyMarkRange:U=!1}=$,{selection:q}=I,Y=getMarkType(M,N.schema),{$from:K,empty:G,ranges:J}=q;if(!B)return!0;if(G&&U){let{from:Z,to:ee}=q;const te=(j=K.marks().find(se=>se.type===Y))===null||j===void 0?void 0:j.attrs,re=getMarkRange(K,Y,te);re&&(Z=re.from,ee=re.to),I.removeMark(Z,ee,Y)}else J.forEach(Z=>{I.removeMark(Z.$from.pos,Z.$to.pos,Y)});return I.removeStoredMark(Y),!0},updateAttributes=(M,$={})=>({tr:I,state:N,dispatch:B})=>{let j=null,U=null;const q=getSchemaTypeNameByName(typeof M=="string"?M:M.name,N.schema);return q?(q==="node"&&(j=getNodeType(M,N.schema)),q==="mark"&&(U=getMarkType(M,N.schema)),B&&I.selection.ranges.forEach(Y=>{const K=Y.$from.pos,G=Y.$to.pos;N.doc.nodesBetween(K,G,(J,Z)=>{j&&j===J.type&&I.setNodeMarkup(Z,void 0,{...J.attrs,...$}),U&&J.marks.length&&J.marks.forEach(ee=>{if(U===ee.type){const te=Math.max(Z,K),re=Math.min(Z+J.nodeSize,G);I.addMark(te,re,U.create({...ee.attrs,...$}))}})})}),!0):!1},wrapIn=(M,$={})=>({state:I,dispatch:N})=>{const B=getNodeType(M,I.schema);return wrapIn$1(B,$)(I,N)},wrapInList=(M,$={})=>({state:I,dispatch:N})=>{const B=getNodeType(M,I.schema);return wrapInList$1(B,$)(I,N)};var commands=Object.freeze({__proto__:null,blur,clearContent,clearNodes,command,createParagraphNear,deleteCurrentNode,deleteNode,deleteRange,deleteSelection,enter,exitCode,extendMarkRange,first:first$1,focus,forEach:forEach$1,insertContent,insertContentAt,joinUp,joinDown,joinBackward,joinForward,keyboardShortcut,lift,liftEmptyBlock,liftListItem,newlineInCode,resetAttributes,scrollIntoView,selectAll,selectNodeBackward,selectNodeForward,selectParentNode,selectTextblockEnd,selectTextblockStart,setContent:setContent$1,setMark,setMeta,setNode,setNodeSelection,setTextSelection,sinkListItem,splitBlock,splitListItem,toggleList,toggleMark,toggleNode,toggleWrap,undoInputRule,unsetAllMarks,unsetMark,updateAttributes,wrapIn,wrapInList});const Commands=Extension.create({name:"commands",addCommands(){return{...commands}}}),Editable=Extension.create({name:"editable",addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("editable"),props:{editable:()=>this.editor.options.editable}})]}}),FocusEvents=Extension.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:M}=this;return[new Plugin({key:new PluginKey("focusEvents"),props:{handleDOMEvents:{focus:($,I)=>{M.isFocused=!0;const N=M.state.tr.setMeta("focus",{event:I}).setMeta("addToHistory",!1);return $.dispatch(N),!1},blur:($,I)=>{M.isFocused=!1;const N=M.state.tr.setMeta("blur",{event:I}).setMeta("addToHistory",!1);return $.dispatch(N),!1}}}})]}}),Keymap=Extension.create({name:"keymap",addKeyboardShortcuts(){const M=()=>this.editor.commands.first(({commands:U})=>[()=>U.undoInputRule(),()=>U.command(({tr:q})=>{const{selection:Y,doc:K}=q,{empty:G,$anchor:J}=Y,{pos:Z,parent:ee}=J,te=Selection.atStart(K).from===Z;return!G||!te||!ee.type.isTextblock||ee.textContent.length?!1:U.clearNodes()}),()=>U.deleteSelection(),()=>U.joinBackward(),()=>U.selectNodeBackward()]),$=()=>this.editor.commands.first(({commands:U})=>[()=>U.deleteSelection(),()=>U.deleteCurrentNode(),()=>U.joinForward(),()=>U.selectNodeForward()]),N={Enter:()=>this.editor.commands.first(({commands:U})=>[()=>U.newlineInCode(),()=>U.createParagraphNear(),()=>U.liftEmptyBlock(),()=>U.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:M,"Mod-Backspace":M,"Shift-Backspace":M,Delete:$,"Mod-Delete":$,"Mod-a":()=>this.editor.commands.selectAll()},B={...N},j={...N,"Ctrl-h":M,"Alt-Backspace":M,"Ctrl-d":$,"Ctrl-Alt-Backspace":$,"Alt-Delete":$,"Alt-d":$,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return isiOS()||isMacOS()?j:B},addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("clearDocument"),appendTransaction:(M,$,I)=>{if(!(M.some(te=>te.docChanged)&&!$.doc.eq(I.doc)))return;const{empty:B,from:j,to:U}=$.selection,q=Selection.atStart($.doc).from,Y=Selection.atEnd($.doc).to;if(B||!(j===q&&U===Y)||!(I.doc.textBetween(0,I.doc.content.size," "," ").length===0))return;const J=I.tr,Z=createChainableState({state:I,transaction:J}),{commands:ee}=new CommandManager({editor:this.editor,state:Z});if(ee.clearNodes(),!!J.steps.length)return J}})]}}),Tabindex=Extension.create({name:"tabindex",addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var extensions=Object.freeze({__proto__:null,ClipboardTextSerializer,Commands,Editable,FocusEvents,Keymap,Tabindex});const style$1=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 1px !important; height: 1px !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; } .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 }`;function createStyleTag(M,$){const I=document.querySelector("style[data-tiptap-style]");if(I!==null)return I;const N=document.createElement("style");return $&&N.setAttribute("nonce",$),N.setAttribute("data-tiptap-style",""),N.innerHTML=M,document.getElementsByTagName("head")[0].appendChild(N),N}let Editor$1=class extends EventEmitter{constructor($={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions($),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=createStyleTag(style$1,this.options.injectNonce))}setOptions($={}){this.options={...this.options,...$},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable($,I=!0){this.setOptions({editable:$}),I&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin($,I){const N=isFunction$5(I)?I($,[...this.state.plugins]):[...this.state.plugins,$],B=this.state.reconfigure({plugins:N});this.view.updateState(B)}unregisterPlugin($){if(this.isDestroyed)return;const I=typeof $=="string"?`${$}$`:$.key,N=this.state.reconfigure({plugins:this.state.plugins.filter(B=>!B.key.startsWith(I))});this.view.updateState(N)}createExtensionManager(){const I=[...this.options.enableCoreExtensions?Object.values(extensions):[],...this.options.extensions].filter(N=>["extension","node","mark"].includes(N==null?void 0:N.type));this.extensionManager=new ExtensionManager(I,this)}createCommandManager(){this.commandManager=new CommandManager({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const $=createDocument(this.options.content,this.schema,this.options.parseOptions),I=resolveFocusPosition($,this.options.autofocus);this.view=new EditorView(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:EditorState.create({doc:$,selection:I||void 0})});const N=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(N),this.createNodeViews();const B=this.view.dom;B.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction($){this.isCapturingTransaction=!0,$(),this.isCapturingTransaction=!1;const I=this.capturedTransaction;return this.capturedTransaction=null,I}dispatchTransaction($){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=$;return}$.steps.forEach(U=>{var q;return(q=this.capturedTransaction)===null||q===void 0?void 0:q.step(U)});return}const I=this.state.apply($),N=!this.state.selection.eq(I.selection);this.view.updateState(I),this.emit("transaction",{editor:this,transaction:$}),N&&this.emit("selectionUpdate",{editor:this,transaction:$});const B=$.getMeta("focus"),j=$.getMeta("blur");B&&this.emit("focus",{editor:this,event:B.event,transaction:$}),j&&this.emit("blur",{editor:this,event:j.event,transaction:$}),!(!$.docChanged||$.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:$})}getAttributes($){return getAttributes(this.state,$)}isActive($,I){const N=typeof $=="string"?$:null,B=typeof $=="string"?I:$;return isActive(this.state,N,B)}getJSON(){return this.state.doc.toJSON()}getHTML(){return getHTMLFromFragment(this.state.doc.content,this.schema)}getText($){const{blockSeparator:I=` `,textSerializers:N={}}=$||{};return getText(this.state.doc,{blockSeparator:I,textSerializers:{...getTextSerializersFromSchema(this.schema),...N}})}get isEmpty(){return isNodeEmpty(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var $;return!(!(($=this.view)===null||$===void 0)&&$.docView)}};function markInputRule(M){return new InputRule({find:M.find,handler:({state:$,range:I,match:N})=>{const B=callOrReturn(M.getAttributes,void 0,N);if(B===!1||B===null)return null;const{tr:j}=$,U=N[N.length-1],q=N[0];let Y=I.to;if(U){const K=q.search(/\S/),G=I.from+q.indexOf(U),J=G+U.length;if(getMarksBetween(I.from,I.to,$.doc).filter(ee=>ee.mark.type.excluded.find(re=>re===M.type&&re!==ee.mark.type)).filter(ee=>ee.to>G).length)return null;JI.from&&j.delete(I.from+K,G),Y=I.from+K+U.length,j.addMark(I.from+K,Y,M.type.create(B||{})),j.removeStoredMark(M.type)}}})}function nodeInputRule(M){return new InputRule({find:M.find,handler:({state:$,range:I,match:N})=>{const B=callOrReturn(M.getAttributes,void 0,N)||{},{tr:j}=$,U=I.from;let q=I.to;if(N[1]){const Y=N[0].lastIndexOf(N[1]);let K=U+Y;K>q?K=q:q=K+N[1].length;const G=N[0][N[0].length-1];j.insertText(G,U+N[0].length-1),j.replaceWith(K,q,M.type.create(B))}else N[0]&&j.replaceWith(U,q,M.type.create(B))}})}function textblockTypeInputRule(M){return new InputRule({find:M.find,handler:({state:$,range:I,match:N})=>{const B=$.doc.resolve(I.from),j=callOrReturn(M.getAttributes,void 0,N)||{};if(!B.node(-1).canReplaceWith(B.index(-1),B.indexAfter(-1),M.type))return null;$.tr.delete(I.from,I.to).setBlockType(I.from,I.from,M.type,j)}})}function textInputRule(M){return new InputRule({find:M.find,handler:({state:$,range:I,match:N})=>{let B=M.replace,j=I.from;const U=I.to;if(N[1]){const q=N[0].lastIndexOf(N[1]);B+=N[0].slice(q+N[1].length),j+=q;const Y=j-U;Y>0&&(B=N[0].slice(q-Y,q)+B,j=U)}$.tr.insertText(B,j,U)}})}function wrappingInputRule(M){return new InputRule({find:M.find,handler:({state:$,range:I,match:N,chain:B})=>{const j=callOrReturn(M.getAttributes,void 0,N)||{},U=$.tr.delete(I.from,I.to),Y=U.doc.resolve(I.from).blockRange(),K=Y&&findWrapping(Y,M.type,j);if(!K)return null;if(U.wrap(Y,K),M.keepMarks&&M.editor){const{selection:J,storedMarks:Z}=$,{splittableMarks:ee}=M.editor.extensionManager,te=Z||J.$to.parentOffset&&J.$from.marks();if(te){const re=te.filter(se=>ee.includes(se.type.name));U.ensureMarks(re)}}if(M.keepAttributes){const J=M.type.name==="bulletList"||M.type.name==="orderedList"?"listItem":"taskList";B().updateAttributes(J,j).run()}const G=U.doc.resolve(I.from-1).nodeBefore;G&&G.type===M.type&&canJoin(U.doc,I.from-1)&&(!M.joinPredicate||M.joinPredicate(N,G))&&U.join(I.from-1)}})}class Mark{constructor($={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...$},this.name=this.config.name,$.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=callOrReturn(getExtensionField(this,"addOptions",{name:this.name}))),this.storage=callOrReturn(getExtensionField(this,"addStorage",{name:this.name,options:this.options}))||{}}static create($={}){return new Mark($)}configure($={}){const I=this.extend();return I.options=mergeDeep(this.options,$),I.storage=callOrReturn(getExtensionField(I,"addStorage",{name:I.name,options:I.options})),I}extend($={}){const I=new Mark($);return I.parent=this,this.child=I,I.name=$.name?$.name:I.parent.name,$.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${I.name}".`),I.options=callOrReturn(getExtensionField(I,"addOptions",{name:I.name})),I.storage=callOrReturn(getExtensionField(I,"addStorage",{name:I.name,options:I.options})),I}static handleExit({editor:$,mark:I}){const{tr:N}=$.state,B=$.state.selection.$from;if(B.pos===B.end()){const U=B.marks();if(!!!U.find(K=>(K==null?void 0:K.type.name)===I.name))return!1;const Y=U.find(K=>(K==null?void 0:K.type.name)===I.name);return Y&&N.removeStoredMark(Y),N.insertText(" ",B.pos),$.view.dispatch(N),!0}return!1}}let Node$1=class Kl{constructor($={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...$},this.name=this.config.name,$.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=callOrReturn(getExtensionField(this,"addOptions",{name:this.name}))),this.storage=callOrReturn(getExtensionField(this,"addStorage",{name:this.name,options:this.options}))||{}}static create($={}){return new Kl($)}configure($={}){const I=this.extend();return I.options=mergeDeep(this.options,$),I.storage=callOrReturn(getExtensionField(I,"addStorage",{name:I.name,options:I.options})),I}extend($={}){const I=new Kl($);return I.parent=this,this.child=I,I.name=$.name?$.name:I.parent.name,$.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${I.name}".`),I.options=callOrReturn(getExtensionField(I,"addOptions",{name:I.name})),I.storage=callOrReturn(getExtensionField(I,"addStorage",{name:I.name,options:I.options})),I}};class NodeView{constructor($,I,N){this.isDragging=!1,this.component=$,this.editor=I.editor,this.options={stopEvent:null,ignoreMutation:null,...N},this.extension=I.extension,this.node=I.node,this.decorations=I.decorations,this.getPos=I.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart($){var I,N,B,j,U,q,Y;const{view:K}=this.editor,G=$.target,J=G.nodeType===3?(I=G.parentElement)===null||I===void 0?void 0:I.closest("[data-drag-handle]"):G.closest("[data-drag-handle]");if(!this.dom||!((N=this.contentDOM)===null||N===void 0)&&N.contains(G)||!J)return;let Z=0,ee=0;if(this.dom!==J){const se=this.dom.getBoundingClientRect(),ne=J.getBoundingClientRect(),le=(B=$.offsetX)!==null&&B!==void 0?B:(j=$.nativeEvent)===null||j===void 0?void 0:j.offsetX,ge=(U=$.offsetY)!==null&&U!==void 0?U:(q=$.nativeEvent)===null||q===void 0?void 0:q.offsetY;Z=ne.x-se.x+le,ee=ne.y-se.y+ge}(Y=$.dataTransfer)===null||Y===void 0||Y.setDragImage(this.dom,Z,ee);const te=NodeSelection.create(K.state.doc,this.getPos()),re=K.state.tr.setSelection(te);K.dispatch(re)}stopEvent($){var I;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:$});const N=$.target;if(!(this.dom.contains(N)&&!(!((I=this.contentDOM)===null||I===void 0)&&I.contains(N))))return!1;const j=$.type.startsWith("drag"),U=$.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(N.tagName)||N.isContentEditable)&&!U&&!j)return!0;const{isEditable:Y}=this.editor,{isDragging:K}=this,G=!!this.node.type.spec.draggable,J=NodeSelection.isSelectable(this.node),Z=$.type==="copy",ee=$.type==="paste",te=$.type==="cut",re=$.type==="mousedown";if(!G&&J&&j&&$.preventDefault(),G&&j&&!K)return $.preventDefault(),!1;if(G&&Y&&!K&&re){const se=N.closest("[data-drag-handle]");se&&(this.dom===se||this.dom.contains(se))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(K||U||Z||ee||te||re&&J)}ignoreMutation($){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:$}):this.node.isLeaf||this.node.isAtom?!0:$.type==="selection"||this.dom.contains($.target)&&$.type==="childList"&&isiOS()&&this.editor.isFocused&&[...Array.from($.addedNodes),...Array.from($.removedNodes)].every(N=>N.isContentEditable)?!1:this.contentDOM===$.target&&$.type==="attributes"?!0:!this.contentDOM.contains($.target)}updateAttributes($){this.editor.commands.command(({tr:I})=>{const N=this.getPos();return I.setNodeMarkup(N,void 0,{...this.node.attrs,...$}),!0})}deleteNode(){const $=this.getPos(),I=$+this.node.nodeSize;this.editor.commands.deleteRange({from:$,to:I})}}function markPasteRule(M){return new PasteRule({find:M.find,handler:({state:$,range:I,match:N})=>{const B=callOrReturn(M.getAttributes,void 0,N);if(B===!1||B===null)return null;const{tr:j}=$,U=N[N.length-1],q=N[0];let Y=I.to;if(U){const K=q.search(/\S/),G=I.from+q.indexOf(U),J=G+U.length;if(getMarksBetween(I.from,I.to,$.doc).filter(ee=>ee.mark.type.excluded.find(re=>re===M.type&&re!==ee.mark.type)).filter(ee=>ee.to>G).length)return null;JI.from&&j.delete(I.from+K,G),Y=I.from+K+U.length,j.addMark(I.from+K,Y,M.type.create(B||{})),j.removeStoredMark(M.type)}}})}function escapeForRegEx(M){return M.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function isString$6(M){return typeof M=="string"}function nodePasteRule(M){return new PasteRule({find:M.find,handler({match:$,chain:I,range:N}){const B=callOrReturn(M.getAttributes,void 0,$);if(B===!1||B===null)return null;$.input&&I().deleteRange(N).insertContentAt(N.from,{type:M.type.name,attrs:B})}})}function textPasteRule(M){return new PasteRule({find:M.find,handler:({state:$,range:I,match:N})=>{let B=M.replace,j=I.from;const U=I.to;if(N[1]){const q=N[0].lastIndexOf(N[1]);B+=N[0].slice(q+N[1].length),j+=q;const Y=j-U;Y>0&&(B=N[0].slice(q-Y,q)+B,j=U)}$.tr.insertText(B,j,U)}})}class Tracker{constructor($){this.transaction=$,this.currentStep=this.transaction.steps.length}map($){let I=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((B,j)=>{const U=j.getMap().mapResult(B);return U.deleted&&(I=!0),U.pos},$),deleted:I}}}const core$2=Object.freeze(Object.defineProperty({__proto__:null,CommandManager,Editor:Editor$1,Extension,InputRule,Mark,Node:Node$1,NodeView,PasteRule,Tracker,callOrReturn,combineTransactionSteps,createChainableState,createDocument,createNodeFromContent,createStyleTag,defaultBlockAt,deleteProps,elementFromString,escapeForRegEx,extensions,findChildren,findChildrenInRange,findDuplicates,findParentNode,findParentNodeClosestToPos,fromString,generateHTML,generateJSON,generateText,getAttributes,getAttributesFromExtensions,getChangedRanges,getDebugJSON,getExtensionField,getHTMLFromFragment,getMarkAttributes,getMarkRange,getMarkType,getMarksBetween,getNodeAttributes,getNodeType,getRenderedAttributes,getSchema,getSchemaByResolvedExtensions,getSchemaTypeByName,getSchemaTypeNameByName,getSplittedAttributes,getText,getTextBetween,getTextContentFromNodes,getTextSerializersFromSchema,injectExtensionAttributesToParseRule,inputRulesPlugin,isActive,isEmptyObject,isExtensionRulesEnabled,isFunction:isFunction$5,isList,isMacOS,isMarkActive,isNodeActive,isNodeEmpty,isNodeSelection,isNumber:isNumber$4,isPlainObject:isPlainObject$1,isRegExp:isRegExp$4,isString:isString$6,isTextSelection,isiOS,markInputRule,markPasteRule,mergeAttributes,mergeDeep,minMax,nodeInputRule,nodePasteRule,objectIncludes:objectIncludes$1,pasteRulesPlugin,posToDOMRect,removeDuplicates,resolveFocusPosition,selectionToInsertionEnd,splitExtensions,textInputRule,textPasteRule,textblockTypeInputRule,wrappingInputRule},Symbol.toStringTag,{value:"Module"}));var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements$1=[top,bottom,right,left],start$1="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements$1.reduce(function(M,$){return M.concat([$+"-"+start$1,$+"-"+end])},[]),placements$1=[].concat(basePlacements$1,[auto]).reduce(function(M,$){return M.concat([$,$+"-"+start$1,$+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName$1(M){return M?(M.nodeName||"").toLowerCase():null}function getWindow$1(M){if(M==null)return window;if(M.toString()!=="[object Window]"){var $=M.ownerDocument;return $&&$.defaultView||window}return M}function isElement$4(M){var $=getWindow$1(M).Element;return M instanceof $||M instanceof Element}function isHTMLElement$1(M){var $=getWindow$1(M).HTMLElement;return M instanceof $||M instanceof HTMLElement}function isShadowRoot$1(M){if(typeof ShadowRoot>"u")return!1;var $=getWindow$1(M).ShadowRoot;return M instanceof $||M instanceof ShadowRoot}function applyStyles(M){var $=M.state;Object.keys($.elements).forEach(function(I){var N=$.styles[I]||{},B=$.attributes[I]||{},j=$.elements[I];!isHTMLElement$1(j)||!getNodeName$1(j)||(Object.assign(j.style,N),Object.keys(B).forEach(function(U){var q=B[U];q===!1?j.removeAttribute(U):j.setAttribute(U,q===!0?"":q)}))})}function effect$3(M){var $=M.state,I={popper:{position:$.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign($.elements.popper.style,I.popper),$.styles=I,$.elements.arrow&&Object.assign($.elements.arrow.style,I.arrow),function(){Object.keys($.elements).forEach(function(N){var B=$.elements[N],j=$.attributes[N]||{},U=Object.keys($.styles.hasOwnProperty(N)?$.styles[N]:I[N]),q=U.reduce(function(Y,K){return Y[K]="",Y},{});!isHTMLElement$1(B)||!getNodeName$1(B)||(Object.assign(B.style,q),Object.keys(j).forEach(function(Y){B.removeAttribute(Y)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$3,requires:["computeStyles"]};function getBasePlacement$2(M){return M.split("-")[0]}var max$4=Math.max,min$4=Math.min,round$2=Math.round;function getUAString(){var M=navigator.userAgentData;return M!=null&&M.brands&&Array.isArray(M.brands)?M.brands.map(function($){return $.brand+"/"+$.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect$1(M,$,I){$===void 0&&($=!1),I===void 0&&(I=!1);var N=M.getBoundingClientRect(),B=1,j=1;$&&isHTMLElement$1(M)&&(B=M.offsetWidth>0&&round$2(N.width)/M.offsetWidth||1,j=M.offsetHeight>0&&round$2(N.height)/M.offsetHeight||1);var U=isElement$4(M)?getWindow$1(M):window,q=U.visualViewport,Y=!isLayoutViewport()&&I,K=(N.left+(Y&&q?q.offsetLeft:0))/B,G=(N.top+(Y&&q?q.offsetTop:0))/j,J=N.width/B,Z=N.height/j;return{width:J,height:Z,top:G,right:K+J,bottom:G+Z,left:K,x:K,y:G}}function getLayoutRect(M){var $=getBoundingClientRect$1(M),I=M.offsetWidth,N=M.offsetHeight;return Math.abs($.width-I)<=1&&(I=$.width),Math.abs($.height-N)<=1&&(N=$.height),{x:M.offsetLeft,y:M.offsetTop,width:I,height:N}}function contains$2(M,$){var I=$.getRootNode&&$.getRootNode();if(M.contains($))return!0;if(I&&isShadowRoot$1(I)){var N=$;do{if(N&&M.isSameNode(N))return!0;N=N.parentNode||N.host}while(N)}return!1}function getComputedStyle$2(M){return getWindow$1(M).getComputedStyle(M)}function isTableElement$1(M){return["table","td","th"].indexOf(getNodeName$1(M))>=0}function getDocumentElement$1(M){return((isElement$4(M)?M.ownerDocument:M.document)||window.document).documentElement}function getParentNode$1(M){return getNodeName$1(M)==="html"?M:M.assignedSlot||M.parentNode||(isShadowRoot$1(M)?M.host:null)||getDocumentElement$1(M)}function getTrueOffsetParent$1(M){return!isHTMLElement$1(M)||getComputedStyle$2(M).position==="fixed"?null:M.offsetParent}function getContainingBlock$1(M){var $=/firefox/i.test(getUAString()),I=/Trident/i.test(getUAString());if(I&&isHTMLElement$1(M)){var N=getComputedStyle$2(M);if(N.position==="fixed")return null}var B=getParentNode$1(M);for(isShadowRoot$1(B)&&(B=B.host);isHTMLElement$1(B)&&["html","body"].indexOf(getNodeName$1(B))<0;){var j=getComputedStyle$2(B);if(j.transform!=="none"||j.perspective!=="none"||j.contain==="paint"||["transform","perspective"].indexOf(j.willChange)!==-1||$&&j.willChange==="filter"||$&&j.filter&&j.filter!=="none")return B;B=B.parentNode}return null}function getOffsetParent$1(M){for(var $=getWindow$1(M),I=getTrueOffsetParent$1(M);I&&isTableElement$1(I)&&getComputedStyle$2(I).position==="static";)I=getTrueOffsetParent$1(I);return I&&(getNodeName$1(I)==="html"||getNodeName$1(I)==="body"&&getComputedStyle$2(I).position==="static")?$:I||getContainingBlock$1(M)||$}function getMainAxisFromPlacement$1(M){return["top","bottom"].indexOf(M)>=0?"x":"y"}function within$1(M,$,I){return max$4(M,min$4($,I))}function withinMaxClamp(M,$,I){var N=within$1(M,$,I);return N>I?I:N}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(M){return Object.assign({},getFreshSideObject(),M)}function expandToHashMap(M,$){return $.reduce(function(I,N){return I[N]=M,I},{})}var toPaddingObject=function($,I){return $=typeof $=="function"?$(Object.assign({},I.rects,{placement:I.placement})):$,mergePaddingObject(typeof $!="number"?$:expandToHashMap($,basePlacements$1))};function arrow$3(M){var $,I=M.state,N=M.name,B=M.options,j=I.elements.arrow,U=I.modifiersData.popperOffsets,q=getBasePlacement$2(I.placement),Y=getMainAxisFromPlacement$1(q),K=[left,right].indexOf(q)>=0,G=K?"height":"width";if(!(!j||!U)){var J=toPaddingObject(B.padding,I),Z=getLayoutRect(j),ee=Y==="y"?top:left,te=Y==="y"?bottom:right,re=I.rects.reference[G]+I.rects.reference[Y]-U[Y]-I.rects.popper[G],se=U[Y]-I.rects.reference[Y],ne=getOffsetParent$1(j),le=ne?Y==="y"?ne.clientHeight||0:ne.clientWidth||0:0,ge=re/2-se/2,ue=J[ee],_e=le-Z[G]-J[te],fe=le/2-Z[G]/2+ge,me=within$1(ue,fe,_e),ve=Y;I.modifiersData[N]=($={},$[ve]=me,$.centerOffset=me-fe,$)}}function effect$2(M){var $=M.state,I=M.options,N=I.element,B=N===void 0?"[data-popper-arrow]":N;B!=null&&(typeof B=="string"&&(B=$.elements.popper.querySelector(B),!B)||contains$2($.elements.popper,B)&&($.elements.arrow=B))}const arrow$4={name:"arrow",enabled:!0,phase:"main",fn:arrow$3,effect:effect$2,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(M){return M.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(M,$){var I=M.x,N=M.y,B=$.devicePixelRatio||1;return{x:round$2(I*B)/B||0,y:round$2(N*B)/B||0}}function mapToStyles(M){var $,I=M.popper,N=M.popperRect,B=M.placement,j=M.variation,U=M.offsets,q=M.position,Y=M.gpuAcceleration,K=M.adaptive,G=M.roundOffsets,J=M.isFixed,Z=U.x,ee=Z===void 0?0:Z,te=U.y,re=te===void 0?0:te,se=typeof G=="function"?G({x:ee,y:re}):{x:ee,y:re};ee=se.x,re=se.y;var ne=U.hasOwnProperty("x"),le=U.hasOwnProperty("y"),ge=left,ue=top,_e=window;if(K){var fe=getOffsetParent$1(I),me="clientHeight",ve="clientWidth";if(fe===getWindow$1(I)&&(fe=getDocumentElement$1(I),getComputedStyle$2(fe).position!=="static"&&q==="absolute"&&(me="scrollHeight",ve="scrollWidth")),fe=fe,B===top||(B===left||B===right)&&j===end){ue=bottom;var xe=J&&fe===_e&&_e.visualViewport?_e.visualViewport.height:fe[me];re-=xe-N.height,re*=Y?1:-1}if(B===left||(B===top||B===bottom)&&j===end){ge=right;var oe=J&&fe===_e&&_e.visualViewport?_e.visualViewport.width:fe[ve];ee-=oe-N.width,ee*=Y?1:-1}}var ye=Object.assign({position:q},K&&unsetSides),be=G===!0?roundOffsetsByDPR({x:ee,y:re},getWindow$1(I)):{x:ee,y:re};if(ee=be.x,re=be.y,Y){var we;return Object.assign({},ye,(we={},we[ue]=le?"0":"",we[ge]=ne?"0":"",we.transform=(_e.devicePixelRatio||1)<=1?"translate("+ee+"px, "+re+"px)":"translate3d("+ee+"px, "+re+"px, 0)",we))}return Object.assign({},ye,($={},$[ue]=le?re+"px":"",$[ge]=ne?ee+"px":"",$.transform="",$))}function computeStyles(M){var $=M.state,I=M.options,N=I.gpuAcceleration,B=N===void 0?!0:N,j=I.adaptive,U=j===void 0?!0:j,q=I.roundOffsets,Y=q===void 0?!0:q,K={placement:getBasePlacement$2($.placement),variation:getVariation($.placement),popper:$.elements.popper,popperRect:$.rects.popper,gpuAcceleration:B,isFixed:$.options.strategy==="fixed"};$.modifiersData.popperOffsets!=null&&($.styles.popper=Object.assign({},$.styles.popper,mapToStyles(Object.assign({},K,{offsets:$.modifiersData.popperOffsets,position:$.options.strategy,adaptive:U,roundOffsets:Y})))),$.modifiersData.arrow!=null&&($.styles.arrow=Object.assign({},$.styles.arrow,mapToStyles(Object.assign({},K,{offsets:$.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:Y})))),$.attributes.popper=Object.assign({},$.attributes.popper,{"data-popper-placement":$.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect$1(M){var $=M.state,I=M.instance,N=M.options,B=N.scroll,j=B===void 0?!0:B,U=N.resize,q=U===void 0?!0:U,Y=getWindow$1($.elements.popper),K=[].concat($.scrollParents.reference,$.scrollParents.popper);return j&&K.forEach(function(G){G.addEventListener("scroll",I.update,passive)}),q&&Y.addEventListener("resize",I.update,passive),function(){j&&K.forEach(function(G){G.removeEventListener("scroll",I.update,passive)}),q&&Y.removeEventListener("resize",I.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:effect$1,data:{}};var hash$3={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement$1(M){return M.replace(/left|right|bottom|top/g,function($){return hash$3[$]})}var hash$2={start:"end",end:"start"};function getOppositeVariationPlacement(M){return M.replace(/start|end/g,function($){return hash$2[$]})}function getWindowScroll(M){var $=getWindow$1(M),I=$.pageXOffset,N=$.pageYOffset;return{scrollLeft:I,scrollTop:N}}function getWindowScrollBarX$1(M){return getBoundingClientRect$1(getDocumentElement$1(M)).left+getWindowScroll(M).scrollLeft}function getViewportRect$1(M,$){var I=getWindow$1(M),N=getDocumentElement$1(M),B=I.visualViewport,j=N.clientWidth,U=N.clientHeight,q=0,Y=0;if(B){j=B.width,U=B.height;var K=isLayoutViewport();(K||!K&&$==="fixed")&&(q=B.offsetLeft,Y=B.offsetTop)}return{width:j,height:U,x:q+getWindowScrollBarX$1(M),y:Y}}function getDocumentRect$1(M){var $,I=getDocumentElement$1(M),N=getWindowScroll(M),B=($=M.ownerDocument)==null?void 0:$.body,j=max$4(I.scrollWidth,I.clientWidth,B?B.scrollWidth:0,B?B.clientWidth:0),U=max$4(I.scrollHeight,I.clientHeight,B?B.scrollHeight:0,B?B.clientHeight:0),q=-N.scrollLeft+getWindowScrollBarX$1(M),Y=-N.scrollTop;return getComputedStyle$2(B||I).direction==="rtl"&&(q+=max$4(I.clientWidth,B?B.clientWidth:0)-j),{width:j,height:U,x:q,y:Y}}function isScrollParent$1(M){var $=getComputedStyle$2(M),I=$.overflow,N=$.overflowX,B=$.overflowY;return/auto|scroll|overlay|hidden/.test(I+B+N)}function getScrollParent$1(M){return["html","body","#document"].indexOf(getNodeName$1(M))>=0?M.ownerDocument.body:isHTMLElement$1(M)&&isScrollParent$1(M)?M:getScrollParent$1(getParentNode$1(M))}function listScrollParents(M,$){var I;$===void 0&&($=[]);var N=getScrollParent$1(M),B=N===((I=M.ownerDocument)==null?void 0:I.body),j=getWindow$1(N),U=B?[j].concat(j.visualViewport||[],isScrollParent$1(N)?N:[]):N,q=$.concat(U);return B?q:q.concat(listScrollParents(getParentNode$1(U)))}function rectToClientRect$1(M){return Object.assign({},M,{left:M.x,top:M.y,right:M.x+M.width,bottom:M.y+M.height})}function getInnerBoundingClientRect$1(M,$){var I=getBoundingClientRect$1(M,!1,$==="fixed");return I.top=I.top+M.clientTop,I.left=I.left+M.clientLeft,I.bottom=I.top+M.clientHeight,I.right=I.left+M.clientWidth,I.width=M.clientWidth,I.height=M.clientHeight,I.x=I.left,I.y=I.top,I}function getClientRectFromMixedType(M,$,I){return $===viewport?rectToClientRect$1(getViewportRect$1(M,I)):isElement$4($)?getInnerBoundingClientRect$1($,I):rectToClientRect$1(getDocumentRect$1(getDocumentElement$1(M)))}function getClippingParents$1(M){var $=listScrollParents(getParentNode$1(M)),I=["absolute","fixed"].indexOf(getComputedStyle$2(M).position)>=0,N=I&&isHTMLElement$1(M)?getOffsetParent$1(M):M;return isElement$4(N)?$.filter(function(B){return isElement$4(B)&&contains$2(B,N)&&getNodeName$1(B)!=="body"}):[]}function getClippingRect(M,$,I,N){var B=$==="clippingParents"?getClippingParents$1(M):[].concat($),j=[].concat(B,[I]),U=j[0],q=j.reduce(function(Y,K){var G=getClientRectFromMixedType(M,K,N);return Y.top=max$4(G.top,Y.top),Y.right=min$4(G.right,Y.right),Y.bottom=min$4(G.bottom,Y.bottom),Y.left=max$4(G.left,Y.left),Y},getClientRectFromMixedType(M,U,N));return q.width=q.right-q.left,q.height=q.bottom-q.top,q.x=q.left,q.y=q.top,q}function computeOffsets(M){var $=M.reference,I=M.element,N=M.placement,B=N?getBasePlacement$2(N):null,j=N?getVariation(N):null,U=$.x+$.width/2-I.width/2,q=$.y+$.height/2-I.height/2,Y;switch(B){case top:Y={x:U,y:$.y-I.height};break;case bottom:Y={x:U,y:$.y+$.height};break;case right:Y={x:$.x+$.width,y:q};break;case left:Y={x:$.x-I.width,y:q};break;default:Y={x:$.x,y:$.y}}var K=B?getMainAxisFromPlacement$1(B):null;if(K!=null){var G=K==="y"?"height":"width";switch(j){case start$1:Y[K]=Y[K]-($[G]/2-I[G]/2);break;case end:Y[K]=Y[K]+($[G]/2-I[G]/2);break}}return Y}function detectOverflow$1(M,$){$===void 0&&($={});var I=$,N=I.placement,B=N===void 0?M.placement:N,j=I.strategy,U=j===void 0?M.strategy:j,q=I.boundary,Y=q===void 0?clippingParents:q,K=I.rootBoundary,G=K===void 0?viewport:K,J=I.elementContext,Z=J===void 0?popper:J,ee=I.altBoundary,te=ee===void 0?!1:ee,re=I.padding,se=re===void 0?0:re,ne=mergePaddingObject(typeof se!="number"?se:expandToHashMap(se,basePlacements$1)),le=Z===popper?reference:popper,ge=M.rects.popper,ue=M.elements[te?le:Z],_e=getClippingRect(isElement$4(ue)?ue:ue.contextElement||getDocumentElement$1(M.elements.popper),Y,G,U),fe=getBoundingClientRect$1(M.elements.reference),me=computeOffsets({reference:fe,element:ge,strategy:"absolute",placement:B}),ve=rectToClientRect$1(Object.assign({},ge,me)),xe=Z===popper?ve:fe,oe={top:_e.top-xe.top+ne.top,bottom:xe.bottom-_e.bottom+ne.bottom,left:_e.left-xe.left+ne.left,right:xe.right-_e.right+ne.right},ye=M.modifiersData.offset;if(Z===popper&&ye){var be=ye[B];Object.keys(oe).forEach(function(we){var Ae=[right,bottom].indexOf(we)>=0?1:-1,ke=[top,bottom].indexOf(we)>=0?"y":"x";oe[we]+=be[ke]*Ae})}return oe}function computeAutoPlacement(M,$){$===void 0&&($={});var I=$,N=I.placement,B=I.boundary,j=I.rootBoundary,U=I.padding,q=I.flipVariations,Y=I.allowedAutoPlacements,K=Y===void 0?placements$1:Y,G=getVariation(N),J=G?q?variationPlacements:variationPlacements.filter(function(te){return getVariation(te)===G}):basePlacements$1,Z=J.filter(function(te){return K.indexOf(te)>=0});Z.length===0&&(Z=J);var ee=Z.reduce(function(te,re){return te[re]=detectOverflow$1(M,{placement:re,boundary:B,rootBoundary:j,padding:U})[getBasePlacement$2(re)],te},{});return Object.keys(ee).sort(function(te,re){return ee[te]-ee[re]})}function getExpandedFallbackPlacements(M){if(getBasePlacement$2(M)===auto)return[];var $=getOppositePlacement$1(M);return[getOppositeVariationPlacement(M),$,getOppositeVariationPlacement($)]}function flip$1(M){var $=M.state,I=M.options,N=M.name;if(!$.modifiersData[N]._skip){for(var B=I.mainAxis,j=B===void 0?!0:B,U=I.altAxis,q=U===void 0?!0:U,Y=I.fallbackPlacements,K=I.padding,G=I.boundary,J=I.rootBoundary,Z=I.altBoundary,ee=I.flipVariations,te=ee===void 0?!0:ee,re=I.allowedAutoPlacements,se=$.options.placement,ne=getBasePlacement$2(se),le=ne===se,ge=Y||(le||!te?[getOppositePlacement$1(se)]:getExpandedFallbackPlacements(se)),ue=[se].concat(ge).reduce(function(At,Nt){return At.concat(getBasePlacement$2(Nt)===auto?computeAutoPlacement($,{placement:Nt,boundary:G,rootBoundary:J,padding:K,flipVariations:te,allowedAutoPlacements:re}):Nt)},[]),_e=$.rects.reference,fe=$.rects.popper,me=new Map,ve=!0,xe=ue[0],oe=0;oe=0,ke=Ae?"width":"height",Oe=detectOverflow$1($,{placement:ye,boundary:G,rootBoundary:J,altBoundary:Z,padding:K}),Me=Ae?we?right:left:we?bottom:top;_e[ke]>fe[ke]&&(Me=getOppositePlacement$1(Me));var ze=getOppositePlacement$1(Me),Fe=[];if(j&&Fe.push(Oe[be]<=0),q&&Fe.push(Oe[Me]<=0,Oe[ze]<=0),Fe.every(function(At){return At})){xe=ye,ve=!1;break}me.set(ye,Fe)}if(ve)for(var Ze=te?3:1,lt=function(Nt){var zt=ue.find(function(Ht){var qt=me.get(Ht);if(qt)return qt.slice(0,Nt).every(function(Qt){return Qt})});if(zt)return xe=zt,"break"},qe=Ze;qe>0;qe--){var Ve=lt(qe);if(Ve==="break")break}$.placement!==xe&&($.modifiersData[N]._skip=!0,$.placement=xe,$.reset=!0)}}const flip$2={name:"flip",enabled:!0,phase:"main",fn:flip$1,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(M,$,I){return I===void 0&&(I={x:0,y:0}),{top:M.top-$.height-I.y,right:M.right-$.width+I.x,bottom:M.bottom-$.height+I.y,left:M.left-$.width-I.x}}function isAnySideFullyClipped(M){return[top,right,bottom,left].some(function($){return M[$]>=0})}function hide(M){var $=M.state,I=M.name,N=$.rects.reference,B=$.rects.popper,j=$.modifiersData.preventOverflow,U=detectOverflow$1($,{elementContext:"reference"}),q=detectOverflow$1($,{altBoundary:!0}),Y=getSideOffsets(U,N),K=getSideOffsets(q,B,j),G=isAnySideFullyClipped(Y),J=isAnySideFullyClipped(K);$.modifiersData[I]={referenceClippingOffsets:Y,popperEscapeOffsets:K,isReferenceHidden:G,hasPopperEscaped:J},$.attributes.popper=Object.assign({},$.attributes.popper,{"data-popper-reference-hidden":G,"data-popper-escaped":J})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(M,$,I){var N=getBasePlacement$2(M),B=[left,top].indexOf(N)>=0?-1:1,j=typeof I=="function"?I(Object.assign({},$,{placement:M})):I,U=j[0],q=j[1];return U=U||0,q=(q||0)*B,[left,right].indexOf(N)>=0?{x:q,y:U}:{x:U,y:q}}function offset$2(M){var $=M.state,I=M.options,N=M.name,B=I.offset,j=B===void 0?[0,0]:B,U=placements$1.reduce(function(G,J){return G[J]=distanceAndSkiddingToXY(J,$.rects,j),G},{}),q=U[$.placement],Y=q.x,K=q.y;$.modifiersData.popperOffsets!=null&&($.modifiersData.popperOffsets.x+=Y,$.modifiersData.popperOffsets.y+=K),$.modifiersData[N]=U}const offset$3={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset$2};function popperOffsets(M){var $=M.state,I=M.name;$.modifiersData[I]=computeOffsets({reference:$.rects.reference,element:$.rects.popper,strategy:"absolute",placement:$.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(M){return M==="x"?"y":"x"}function preventOverflow(M){var $=M.state,I=M.options,N=M.name,B=I.mainAxis,j=B===void 0?!0:B,U=I.altAxis,q=U===void 0?!1:U,Y=I.boundary,K=I.rootBoundary,G=I.altBoundary,J=I.padding,Z=I.tether,ee=Z===void 0?!0:Z,te=I.tetherOffset,re=te===void 0?0:te,se=detectOverflow$1($,{boundary:Y,rootBoundary:K,padding:J,altBoundary:G}),ne=getBasePlacement$2($.placement),le=getVariation($.placement),ge=!le,ue=getMainAxisFromPlacement$1(ne),_e=getAltAxis(ue),fe=$.modifiersData.popperOffsets,me=$.rects.reference,ve=$.rects.popper,xe=typeof re=="function"?re(Object.assign({},$.rects,{placement:$.placement})):re,oe=typeof xe=="number"?{mainAxis:xe,altAxis:xe}:Object.assign({mainAxis:0,altAxis:0},xe),ye=$.modifiersData.offset?$.modifiersData.offset[$.placement]:null,be={x:0,y:0};if(fe){if(j){var we,Ae=ue==="y"?top:left,ke=ue==="y"?bottom:right,Oe=ue==="y"?"height":"width",Me=fe[ue],ze=Me+se[Ae],Fe=Me-se[ke],Ze=ee?-ve[Oe]/2:0,lt=le===start$1?me[Oe]:ve[Oe],qe=le===start$1?-ve[Oe]:-me[Oe],Ve=$.elements.arrow,At=ee&&Ve?getLayoutRect(Ve):{width:0,height:0},Nt=$.modifiersData["arrow#persistent"]?$.modifiersData["arrow#persistent"].padding:getFreshSideObject(),zt=Nt[Ae],Ht=Nt[ke],qt=within$1(0,me[Oe],At[Oe]),Qt=ge?me[Oe]/2-Ze-qt-zt-oe.mainAxis:lt-qt-zt-oe.mainAxis,Jt=ge?-me[Oe]/2+Ze+qt+Ht+oe.mainAxis:qe+qt+Ht+oe.mainAxis,yn=$.elements.arrow&&getOffsetParent$1($.elements.arrow),_n=yn?ue==="y"?yn.clientTop||0:yn.clientLeft||0:0,Hn=(we=ye==null?void 0:ye[ue])!=null?we:0,On=Me+Qt-Hn-_n,Fn=Me+Jt-Hn,In=within$1(ee?min$4(ze,On):ze,Me,ee?max$4(Fe,Fn):Fe);fe[ue]=In,be[ue]=In-Me}if(q){var dn,kt=ue==="x"?top:left,Ye=ue==="x"?bottom:right,_t=fe[_e],We=_e==="y"?"height":"width",Pe=_t+se[kt],Se=_t-se[Ye],$e=[top,left].indexOf(ne)!==-1,Ue=(dn=ye==null?void 0:ye[_e])!=null?dn:0,Qe=$e?Pe:_t-me[We]-ve[We]-Ue+oe.altAxis,mt=$e?_t+me[We]+ve[We]-Ue-oe.altAxis:Se,ht=ee&&$e?withinMaxClamp(Qe,_t,mt):within$1(ee?Qe:Pe,_t,ee?mt:Se);fe[_e]=ht,be[_e]=ht-_t}$.modifiersData[N]=be}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(M){return{scrollLeft:M.scrollLeft,scrollTop:M.scrollTop}}function getNodeScroll$1(M){return M===getWindow$1(M)||!isHTMLElement$1(M)?getWindowScroll(M):getHTMLElementScroll(M)}function isElementScaled(M){var $=M.getBoundingClientRect(),I=round$2($.width)/M.offsetWidth||1,N=round$2($.height)/M.offsetHeight||1;return I!==1||N!==1}function getCompositeRect(M,$,I){I===void 0&&(I=!1);var N=isHTMLElement$1($),B=isHTMLElement$1($)&&isElementScaled($),j=getDocumentElement$1($),U=getBoundingClientRect$1(M,B,I),q={scrollLeft:0,scrollTop:0},Y={x:0,y:0};return(N||!N&&!I)&&((getNodeName$1($)!=="body"||isScrollParent$1(j))&&(q=getNodeScroll$1($)),isHTMLElement$1($)?(Y=getBoundingClientRect$1($,!0),Y.x+=$.clientLeft,Y.y+=$.clientTop):j&&(Y.x=getWindowScrollBarX$1(j))),{x:U.left+q.scrollLeft-Y.x,y:U.top+q.scrollTop-Y.y,width:U.width,height:U.height}}function order(M){var $=new Map,I=new Set,N=[];M.forEach(function(j){$.set(j.name,j)});function B(j){I.add(j.name);var U=[].concat(j.requires||[],j.requiresIfExists||[]);U.forEach(function(q){if(!I.has(q)){var Y=$.get(q);Y&&B(Y)}}),N.push(j)}return M.forEach(function(j){I.has(j.name)||B(j)}),N}function orderModifiers(M){var $=order(M);return modifierPhases.reduce(function(I,N){return I.concat($.filter(function(B){return B.phase===N}))},[])}function debounce$3(M){var $;return function(){return $||($=new Promise(function(I){Promise.resolve().then(function(){$=void 0,I(M())})})),$}}function mergeByName(M){var $=M.reduce(function(I,N){var B=I[N.name];return I[N.name]=B?Object.assign({},B,N,{options:Object.assign({},B.options,N.options),data:Object.assign({},B.data,N.data)}):N,I},{});return Object.keys($).map(function(I){return $[I]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var M=arguments.length,$=new Array(M),I=0;I-1}function invokeWithArgsOrReturn(M,$){return typeof M=="function"?M.apply(void 0,$):M}function debounce$2(M,$){if($===0)return M;var I;return function(N){clearTimeout(I),I=setTimeout(function(){M(N)},$)}}function splitBySpaces(M){return M.split(/\s+/).filter(Boolean)}function normalizeToArray(M){return[].concat(M)}function pushIfUnique(M,$){M.indexOf($)===-1&&M.push($)}function unique(M){return M.filter(function($,I){return M.indexOf($)===I})}function getBasePlacement$1(M){return M.split("-")[0]}function arrayFrom(M){return[].slice.call(M)}function removeUndefinedProps(M){return Object.keys(M).reduce(function($,I){return M[I]!==void 0&&($[I]=M[I]),$},{})}function div(){return document.createElement("div")}function isElement$3(M){return["Element","Fragment"].some(function($){return isType(M,$)})}function isNodeList(M){return isType(M,"NodeList")}function isMouseEvent(M){return isType(M,"MouseEvent")}function isReferenceElement(M){return!!(M&&M._tippy&&M._tippy.reference===M)}function getArrayOfElements(M){return isElement$3(M)?[M]:isNodeList(M)?arrayFrom(M):Array.isArray(M)?M:arrayFrom(document.querySelectorAll(M))}function setTransitionDuration(M,$){M.forEach(function(I){I&&(I.style.transitionDuration=$+"ms")})}function setVisibilityState(M,$){M.forEach(function(I){I&&I.setAttribute("data-state",$)})}function getOwnerDocument(M){var $,I=normalizeToArray(M),N=I[0];return N!=null&&($=N.ownerDocument)!=null&&$.body?N.ownerDocument:document}function isCursorOutsideInteractiveBorder(M,$){var I=$.clientX,N=$.clientY;return M.every(function(B){var j=B.popperRect,U=B.popperState,q=B.props,Y=q.interactiveBorder,K=getBasePlacement$1(U.placement),G=U.modifiersData.offset;if(!G)return!0;var J=K==="bottom"?G.top.y:0,Z=K==="top"?G.bottom.y:0,ee=K==="right"?G.left.x:0,te=K==="left"?G.right.x:0,re=j.top-N+J>Y,se=N-j.bottom-Z>Y,ne=j.left-I+ee>Y,le=I-j.right-te>Y;return re||se||ne||le})}function updateTransitionEndListener(M,$,I){var N=$+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(B){M[N](B,I)})}function actualContains(M,$){for(var I=$;I;){var N;if(M.contains(I))return!0;I=I.getRootNode==null||(N=I.getRootNode())==null?void 0:N.host}return!1}var currentInput={isTouch:!1},lastMouseMoveTime=0;function onDocumentTouchStart(){currentInput.isTouch||(currentInput.isTouch=!0,window.performance&&document.addEventListener("mousemove",onDocumentMouseMove))}function onDocumentMouseMove(){var M=performance.now();M-lastMouseMoveTime<20&&(currentInput.isTouch=!1,document.removeEventListener("mousemove",onDocumentMouseMove)),lastMouseMoveTime=M}function onWindowBlur(){var M=document.activeElement;if(isReferenceElement(M)){var $=M._tippy;M.blur&&!$.state.isVisible&&M.blur()}}function bindGlobalEventListeners(){document.addEventListener("touchstart",onDocumentTouchStart,TOUCH_OPTIONS),window.addEventListener("blur",onWindowBlur)}var isBrowser$1=typeof window<"u"&&typeof document<"u",isIE11$1=isBrowser$1?!!window.msCrypto:!1,pluginProps={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},renderProps={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},defaultProps=Object.assign({appendTo:TIPPY_DEFAULT_APPEND_TO,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},pluginProps,renderProps),defaultKeys=Object.keys(defaultProps),setDefaultProps=function($){var I=Object.keys($);I.forEach(function(N){defaultProps[N]=$[N]})};function getExtendedPassedProps(M){var $=M.plugins||[],I=$.reduce(function(N,B){var j=B.name,U=B.defaultValue;if(j){var q;N[j]=M[j]!==void 0?M[j]:(q=defaultProps[j])!=null?q:U}return N},{});return Object.assign({},M,I)}function getDataAttributeProps(M,$){var I=$?Object.keys(getExtendedPassedProps(Object.assign({},defaultProps,{plugins:$}))):defaultKeys,N=I.reduce(function(B,j){var U=(M.getAttribute("data-tippy-"+j)||"").trim();if(!U)return B;if(j==="content")B[j]=U;else try{B[j]=JSON.parse(U)}catch{B[j]=U}return B},{});return N}function evaluateProps(M,$){var I=Object.assign({},$,{content:invokeWithArgsOrReturn($.content,[M])},$.ignoreAttributes?{}:getDataAttributeProps(M,$.plugins));return I.aria=Object.assign({},defaultProps.aria,I.aria),I.aria={expanded:I.aria.expanded==="auto"?$.interactive:I.aria.expanded,content:I.aria.content==="auto"?$.interactive?null:"describedby":I.aria.content},I}var innerHTML=function(){return"innerHTML"};function dangerouslySetInnerHTML(M,$){M[innerHTML()]=$}function createArrowElement(M){var $=div();return M===!0?$.className=ARROW_CLASS:($.className=SVG_ARROW_CLASS,isElement$3(M)?$.appendChild(M):dangerouslySetInnerHTML($,M)),$}function setContent(M,$){isElement$3($.content)?(dangerouslySetInnerHTML(M,""),M.appendChild($.content)):typeof $.content!="function"&&($.allowHTML?dangerouslySetInnerHTML(M,$.content):M.textContent=$.content)}function getChildren(M){var $=M.firstElementChild,I=arrayFrom($.children);return{box:$,content:I.find(function(N){return N.classList.contains(CONTENT_CLASS)}),arrow:I.find(function(N){return N.classList.contains(ARROW_CLASS)||N.classList.contains(SVG_ARROW_CLASS)}),backdrop:I.find(function(N){return N.classList.contains(BACKDROP_CLASS)})}}function render$3(M){var $=div(),I=div();I.className=BOX_CLASS,I.setAttribute("data-state","hidden"),I.setAttribute("tabindex","-1");var N=div();N.className=CONTENT_CLASS,N.setAttribute("data-state","hidden"),setContent(N,M.props),$.appendChild(I),I.appendChild(N),B(M.props,M.props);function B(j,U){var q=getChildren($),Y=q.box,K=q.content,G=q.arrow;U.theme?Y.setAttribute("data-theme",U.theme):Y.removeAttribute("data-theme"),typeof U.animation=="string"?Y.setAttribute("data-animation",U.animation):Y.removeAttribute("data-animation"),U.inertia?Y.setAttribute("data-inertia",""):Y.removeAttribute("data-inertia"),Y.style.maxWidth=typeof U.maxWidth=="number"?U.maxWidth+"px":U.maxWidth,U.role?Y.setAttribute("role",U.role):Y.removeAttribute("role"),(j.content!==U.content||j.allowHTML!==U.allowHTML)&&setContent(K,M.props),U.arrow?G?j.arrow!==U.arrow&&(Y.removeChild(G),Y.appendChild(createArrowElement(U.arrow))):Y.appendChild(createArrowElement(U.arrow)):G&&Y.removeChild(G)}return{popper:$,onUpdate:B}}render$3.$$tippy=!0;var idCounter$1=1,mouseMoveListeners=[],mountedInstances=[];function createTippy(M,$){var I=evaluateProps(M,Object.assign({},defaultProps,getExtendedPassedProps(removeUndefinedProps($)))),N,B,j,U=!1,q=!1,Y=!1,K=!1,G,J,Z,ee=[],te=debounce$2(On,I.interactiveDebounce),re,se=idCounter$1++,ne=null,le=unique(I.plugins),ge={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},ue={id:se,reference:M,popper:div(),popperInstance:ne,props:I,state:ge,plugins:le,clearDelayTimeouts:Qe,setProps:mt,setContent:ht,show:at,hide:ut,hideWithInteractivity:Rt,enable:$e,disable:Ue,unmount:fn,destroy:Bn};if(!I.render)return ue;var _e=I.render(ue),fe=_e.popper,me=_e.onUpdate;fe.setAttribute("data-tippy-root",""),fe.id="tippy-"+ue.id,ue.popper=fe,M._tippy=ue,fe._tippy=ue;var ve=le.map(function(en){return en.fn(ue)}),xe=M.hasAttribute("aria-expanded");return yn(),Ze(),Me(),ze("onCreate",[ue]),I.showOnCreate&&Pe(),fe.addEventListener("mouseenter",function(){ue.props.interactive&&ue.state.isVisible&&ue.clearDelayTimeouts()}),fe.addEventListener("mouseleave",function(){ue.props.interactive&&ue.props.trigger.indexOf("mouseenter")>=0&&Ae().addEventListener("mousemove",te)}),ue;function oe(){var en=ue.props.touch;return Array.isArray(en)?en:[en,0]}function ye(){return oe()[0]==="hold"}function be(){var en;return!!((en=ue.props.render)!=null&&en.$$tippy)}function we(){return re||M}function Ae(){var en=we().parentNode;return en?getOwnerDocument(en):document}function ke(){return getChildren(fe)}function Oe(en){return ue.state.isMounted&&!ue.state.isVisible||currentInput.isTouch||G&&G.type==="focus"?0:getValueAtIndexOrReturn(ue.props.delay,en?0:1,defaultProps.delay)}function Me(en){en===void 0&&(en=!1),fe.style.pointerEvents=ue.props.interactive&&!en?"":"none",fe.style.zIndex=""+ue.props.zIndex}function ze(en,xn,ot){if(ot===void 0&&(ot=!0),ve.forEach(function(Ot){Ot[en]&&Ot[en].apply(Ot,xn)}),ot){var dt;(dt=ue.props)[en].apply(dt,xn)}}function Fe(){var en=ue.props.aria;if(en.content){var xn="aria-"+en.content,ot=fe.id,dt=normalizeToArray(ue.props.triggerTarget||M);dt.forEach(function(Ot){var Yt=Ot.getAttribute(xn);if(ue.state.isVisible)Ot.setAttribute(xn,Yt?Yt+" "+ot:ot);else{var Wt=Yt&&Yt.replace(ot,"").trim();Wt?Ot.setAttribute(xn,Wt):Ot.removeAttribute(xn)}})}}function Ze(){if(!(xe||!ue.props.aria.expanded)){var en=normalizeToArray(ue.props.triggerTarget||M);en.forEach(function(xn){ue.props.interactive?xn.setAttribute("aria-expanded",ue.state.isVisible&&xn===we()?"true":"false"):xn.removeAttribute("aria-expanded")})}}function lt(){Ae().removeEventListener("mousemove",te),mouseMoveListeners=mouseMoveListeners.filter(function(en){return en!==te})}function qe(en){if(!(currentInput.isTouch&&(Y||en.type==="mousedown"))){var xn=en.composedPath&&en.composedPath()[0]||en.target;if(!(ue.props.interactive&&actualContains(fe,xn))){if(normalizeToArray(ue.props.triggerTarget||M).some(function(ot){return actualContains(ot,xn)})){if(currentInput.isTouch||ue.state.isVisible&&ue.props.trigger.indexOf("click")>=0)return}else ze("onClickOutside",[ue,en]);ue.props.hideOnClick===!0&&(ue.clearDelayTimeouts(),ue.hide(),q=!0,setTimeout(function(){q=!1}),ue.state.isMounted||zt())}}}function Ve(){Y=!0}function At(){Y=!1}function Nt(){var en=Ae();en.addEventListener("mousedown",qe,!0),en.addEventListener("touchend",qe,TOUCH_OPTIONS),en.addEventListener("touchstart",At,TOUCH_OPTIONS),en.addEventListener("touchmove",Ve,TOUCH_OPTIONS)}function zt(){var en=Ae();en.removeEventListener("mousedown",qe,!0),en.removeEventListener("touchend",qe,TOUCH_OPTIONS),en.removeEventListener("touchstart",At,TOUCH_OPTIONS),en.removeEventListener("touchmove",Ve,TOUCH_OPTIONS)}function Ht(en,xn){Qt(en,function(){!ue.state.isVisible&&fe.parentNode&&fe.parentNode.contains(fe)&&xn()})}function qt(en,xn){Qt(en,xn)}function Qt(en,xn){var ot=ke().box;function dt(Ot){Ot.target===ot&&(updateTransitionEndListener(ot,"remove",dt),xn())}if(en===0)return xn();updateTransitionEndListener(ot,"remove",J),updateTransitionEndListener(ot,"add",dt),J=dt}function Jt(en,xn,ot){ot===void 0&&(ot=!1);var dt=normalizeToArray(ue.props.triggerTarget||M);dt.forEach(function(Ot){Ot.addEventListener(en,xn,ot),ee.push({node:Ot,eventType:en,handler:xn,options:ot})})}function yn(){ye()&&(Jt("touchstart",Hn,{passive:!0}),Jt("touchend",Fn,{passive:!0})),splitBySpaces(ue.props.trigger).forEach(function(en){if(en!=="manual")switch(Jt(en,Hn),en){case"mouseenter":Jt("mouseleave",Fn);break;case"focus":Jt(isIE11$1?"focusout":"blur",In);break;case"focusin":Jt("focusout",In);break}})}function _n(){ee.forEach(function(en){var xn=en.node,ot=en.eventType,dt=en.handler,Ot=en.options;xn.removeEventListener(ot,dt,Ot)}),ee=[]}function Hn(en){var xn,ot=!1;if(!(!ue.state.isEnabled||dn(en)||q)){var dt=((xn=G)==null?void 0:xn.type)==="focus";G=en,re=en.currentTarget,Ze(),!ue.state.isVisible&&isMouseEvent(en)&&mouseMoveListeners.forEach(function(Ot){return Ot(en)}),en.type==="click"&&(ue.props.trigger.indexOf("mouseenter")<0||U)&&ue.props.hideOnClick!==!1&&ue.state.isVisible?ot=!0:Pe(en),en.type==="click"&&(U=!ot),ot&&!dt&&Se(en)}}function On(en){var xn=en.target,ot=we().contains(xn)||fe.contains(xn);if(!(en.type==="mousemove"&&ot)){var dt=We().concat(fe).map(function(Ot){var Yt,Wt=Ot._tippy,gn=(Yt=Wt.popperInstance)==null?void 0:Yt.state;return gn?{popperRect:Ot.getBoundingClientRect(),popperState:gn,props:I}:null}).filter(Boolean);isCursorOutsideInteractiveBorder(dt,en)&&(lt(),Se(en))}}function Fn(en){var xn=dn(en)||ue.props.trigger.indexOf("click")>=0&&U;if(!xn){if(ue.props.interactive){ue.hideWithInteractivity(en);return}Se(en)}}function In(en){ue.props.trigger.indexOf("focusin")<0&&en.target!==we()||ue.props.interactive&&en.relatedTarget&&fe.contains(en.relatedTarget)||Se(en)}function dn(en){return currentInput.isTouch?ye()!==en.type.indexOf("touch")>=0:!1}function kt(){Ye();var en=ue.props,xn=en.popperOptions,ot=en.placement,dt=en.offset,Ot=en.getReferenceClientRect,Yt=en.moveTransition,Wt=be()?getChildren(fe).arrow:null,gn=Ot?{getBoundingClientRect:Ot,contextElement:Ot.contextElement||we()}:M,Kn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Tt){var Lt=Tt.state;if(be()){var pn=ke(),mn=pn.box;["placement","reference-hidden","escaped"].forEach(function(En){En==="placement"?mn.setAttribute("data-placement",Lt.placement):Lt.attributes.popper["data-popper-"+En]?mn.setAttribute("data-"+En,""):mn.removeAttribute("data-"+En)}),Lt.attributes.popper={}}}},Ct=[{name:"offset",options:{offset:dt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Yt}},Kn];be()&&Wt&&Ct.push({name:"arrow",options:{element:Wt,padding:3}}),Ct.push.apply(Ct,(xn==null?void 0:xn.modifiers)||[]),ue.popperInstance=createPopper(gn,fe,Object.assign({},xn,{placement:ot,onFirstUpdate:Z,modifiers:Ct}))}function Ye(){ue.popperInstance&&(ue.popperInstance.destroy(),ue.popperInstance=null)}function _t(){var en=ue.props.appendTo,xn,ot=we();ue.props.interactive&&en===TIPPY_DEFAULT_APPEND_TO||en==="parent"?xn=ot.parentNode:xn=invokeWithArgsOrReturn(en,[ot]),xn.contains(fe)||xn.appendChild(fe),ue.state.isMounted=!0,kt()}function We(){return arrayFrom(fe.querySelectorAll("[data-tippy-root]"))}function Pe(en){ue.clearDelayTimeouts(),en&&ze("onTrigger",[ue,en]),Nt();var xn=Oe(!0),ot=oe(),dt=ot[0],Ot=ot[1];currentInput.isTouch&&dt==="hold"&&Ot&&(xn=Ot),xn?N=setTimeout(function(){ue.show()},xn):ue.show()}function Se(en){if(ue.clearDelayTimeouts(),ze("onUntrigger",[ue,en]),!ue.state.isVisible){zt();return}if(!(ue.props.trigger.indexOf("mouseenter")>=0&&ue.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(en.type)>=0&&U)){var xn=Oe(!1);xn?B=setTimeout(function(){ue.state.isVisible&&ue.hide()},xn):j=requestAnimationFrame(function(){ue.hide()})}}function $e(){ue.state.isEnabled=!0}function Ue(){ue.hide(),ue.state.isEnabled=!1}function Qe(){clearTimeout(N),clearTimeout(B),cancelAnimationFrame(j)}function mt(en){if(!ue.state.isDestroyed){ze("onBeforeUpdate",[ue,en]),_n();var xn=ue.props,ot=evaluateProps(M,Object.assign({},xn,removeUndefinedProps(en),{ignoreAttributes:!0}));ue.props=ot,yn(),xn.interactiveDebounce!==ot.interactiveDebounce&&(lt(),te=debounce$2(On,ot.interactiveDebounce)),xn.triggerTarget&&!ot.triggerTarget?normalizeToArray(xn.triggerTarget).forEach(function(dt){dt.removeAttribute("aria-expanded")}):ot.triggerTarget&&M.removeAttribute("aria-expanded"),Ze(),Me(),me&&me(xn,ot),ue.popperInstance&&(kt(),We().forEach(function(dt){requestAnimationFrame(dt._tippy.popperInstance.forceUpdate)})),ze("onAfterUpdate",[ue,en])}}function ht(en){ue.setProps({content:en})}function at(){var en=ue.state.isVisible,xn=ue.state.isDestroyed,ot=!ue.state.isEnabled,dt=currentInput.isTouch&&!ue.props.touch,Ot=getValueAtIndexOrReturn(ue.props.duration,0,defaultProps.duration);if(!(en||xn||ot||dt)&&!we().hasAttribute("disabled")&&(ze("onShow",[ue],!1),ue.props.onShow(ue)!==!1)){if(ue.state.isVisible=!0,be()&&(fe.style.visibility="visible"),Me(),Nt(),ue.state.isMounted||(fe.style.transition="none"),be()){var Yt=ke(),Wt=Yt.box,gn=Yt.content;setTransitionDuration([Wt,gn],0)}Z=function(){var Ct;if(!(!ue.state.isVisible||K)){if(K=!0,fe.offsetHeight,fe.style.transition=ue.props.moveTransition,be()&&ue.props.animation){var ft=ke(),Tt=ft.box,Lt=ft.content;setTransitionDuration([Tt,Lt],Ot),setVisibilityState([Tt,Lt],"visible")}Fe(),Ze(),pushIfUnique(mountedInstances,ue),(Ct=ue.popperInstance)==null||Ct.forceUpdate(),ze("onMount",[ue]),ue.props.animation&&be()&&qt(Ot,function(){ue.state.isShown=!0,ze("onShown",[ue])})}},_t()}}function ut(){var en=!ue.state.isVisible,xn=ue.state.isDestroyed,ot=!ue.state.isEnabled,dt=getValueAtIndexOrReturn(ue.props.duration,1,defaultProps.duration);if(!(en||xn||ot)&&(ze("onHide",[ue],!1),ue.props.onHide(ue)!==!1)){if(ue.state.isVisible=!1,ue.state.isShown=!1,K=!1,U=!1,be()&&(fe.style.visibility="hidden"),lt(),zt(),Me(!0),be()){var Ot=ke(),Yt=Ot.box,Wt=Ot.content;ue.props.animation&&(setTransitionDuration([Yt,Wt],dt),setVisibilityState([Yt,Wt],"hidden"))}Fe(),Ze(),ue.props.animation?be()&&Ht(dt,ue.unmount):ue.unmount()}}function Rt(en){Ae().addEventListener("mousemove",te),pushIfUnique(mouseMoveListeners,te),te(en)}function fn(){ue.state.isVisible&&ue.hide(),ue.state.isMounted&&(Ye(),We().forEach(function(en){en._tippy.unmount()}),fe.parentNode&&fe.parentNode.removeChild(fe),mountedInstances=mountedInstances.filter(function(en){return en!==ue}),ue.state.isMounted=!1,ze("onHidden",[ue]))}function Bn(){ue.state.isDestroyed||(ue.clearDelayTimeouts(),ue.unmount(),_n(),delete M._tippy,ue.state.isDestroyed=!0,ze("onDestroy",[ue]))}}function tippy(M,$){$===void 0&&($={});var I=defaultProps.plugins.concat($.plugins||[]);bindGlobalEventListeners();var N=Object.assign({},$,{plugins:I}),B=getArrayOfElements(M),j=B.reduce(function(U,q){var Y=q&&createTippy(q,N);return Y&&U.push(Y),U},[]);return isElement$3(M)?j[0]:j}tippy.defaultProps=defaultProps;tippy.setDefaultProps=setDefaultProps;tippy.currentInput=currentInput;Object.assign({},applyStyles$1,{effect:function($){var I=$.state,N={popper:{position:I.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(I.elements.popper.style,N.popper),I.styles=N,I.elements.arrow&&Object.assign(I.elements.arrow.style,N.arrow)}});tippy.setDefaultProps({render:render$3});class BubbleMenuView{constructor({editor:$,element:I,view:N,tippyOptions:B={},updateDelay:j=250,shouldShow:U}){this.preventHide=!1,this.shouldShow=({view:q,state:Y,from:K,to:G})=>{const{doc:J,selection:Z}=Y,{empty:ee}=Z,te=!J.textBetween(K,G).length&&isTextSelection(Y.selection),re=this.element.contains(document.activeElement);return!(!(q.hasFocus()||re)||ee||te||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:q})=>{var Y;if(this.preventHide){this.preventHide=!1;return}q!=null&&q.relatedTarget&&(!((Y=this.element.parentNode)===null||Y===void 0)&&Y.contains(q.relatedTarget))||this.hide()},this.tippyBlurHandler=q=>{this.blurHandler({event:q})},this.handleDebouncedUpdate=(q,Y)=>{this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(q,Y)},this.updateDelay)},this.updateHandler=(q,Y)=>{var K,G,J;const{state:Z,composing:ee}=q,{doc:te,selection:re}=Z,se=Y&&Y.doc.eq(te)&&Y.selection.eq(re);if(ee||se)return;this.createTooltip();const{ranges:ne}=re,le=Math.min(...ne.map(_e=>_e.$from.pos)),ge=Math.max(...ne.map(_e=>_e.$to.pos));if(!((K=this.shouldShow)===null||K===void 0?void 0:K.call(this,{editor:this.editor,view:q,state:Z,oldState:Y,from:le,to:ge}))){this.hide();return}(G=this.tippy)===null||G===void 0||G.setProps({getReferenceClientRect:((J=this.tippyOptions)===null||J===void 0?void 0:J.getReferenceClientRect)||(()=>{if(isNodeSelection(Z.selection)){let _e=q.nodeDOM(le);const fe=_e.dataset.nodeViewWrapper?_e:_e.querySelector("[data-node-view-wrapper]");if(fe&&(_e=fe.firstChild),_e)return _e.getBoundingClientRect()}return posToDOMRect(q,le,ge)})}),this.show()},this.editor=$,this.element=I,this.view=N,this.updateDelay=j,U&&(this.shouldShow=U),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=B,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:$}=this.editor.options,I=!!$.parentElement;this.tippy||!I||(this.tippy=tippy($,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update($,I){const{state:N}=$,B=N.selection.$from.pos!==N.selection.$to.pos;if(this.updateDelay>0&&B){this.handleDebouncedUpdate($,I);return}this.updateHandler($,I)}show(){var $;($=this.tippy)===null||$===void 0||$.show()}hide(){var $;($=this.tippy)===null||$===void 0||$.hide()}destroy(){var $,I;!(($=this.tippy)===null||$===void 0)&&$.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(I=this.tippy)===null||I===void 0||I.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const BubbleMenuPlugin=M=>new Plugin({key:typeof M.pluginKey=="string"?new PluginKey(M.pluginKey):M.pluginKey,view:$=>new BubbleMenuView({view:$,...M})});Extension.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[BubbleMenuPlugin({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let FloatingMenuView$1=class{constructor({editor:$,element:I,view:N,tippyOptions:B={},shouldShow:j}){this.preventHide=!1,this.shouldShow=({view:U,state:q})=>{const{selection:Y}=q,{$anchor:K,empty:G}=Y,J=K.depth===1,Z=K.parent.isTextblock&&!K.parent.type.spec.code&&!K.parent.textContent;return!(!U.hasFocus()||!G||!J||!Z||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:U})=>{var q;if(this.preventHide){this.preventHide=!1;return}U!=null&&U.relatedTarget&&(!((q=this.element.parentNode)===null||q===void 0)&&q.contains(U.relatedTarget))||this.hide()},this.tippyBlurHandler=U=>{this.blurHandler({event:U})},this.editor=$,this.element=I,this.view=N,j&&(this.shouldShow=j),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=B,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:$}=this.editor.options,I=!!$.parentElement;this.tippy||!I||(this.tippy=tippy($,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update($,I){var N,B,j;const{state:U}=$,{doc:q,selection:Y}=U,{from:K,to:G}=Y;if(I&&I.doc.eq(q)&&I.selection.eq(Y))return;if(this.createTooltip(),!((N=this.shouldShow)===null||N===void 0?void 0:N.call(this,{editor:this.editor,view:$,state:U,oldState:I}))){this.hide();return}(B=this.tippy)===null||B===void 0||B.setProps({getReferenceClientRect:((j=this.tippyOptions)===null||j===void 0?void 0:j.getReferenceClientRect)||(()=>posToDOMRect($,K,G))}),this.show()}show(){var $;($=this.tippy)===null||$===void 0||$.show()}hide(){var $;($=this.tippy)===null||$===void 0||$.hide()}destroy(){var $,I;!(($=this.tippy)===null||$===void 0)&&$.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(I=this.tippy)===null||I===void 0||I.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}};const FloatingMenuPlugin$1=M=>new Plugin({key:typeof M.pluginKey=="string"?new PluginKey(M.pluginKey):M.pluginKey,view:$=>new FloatingMenuView$1({view:$,...M})});Extension.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[FloatingMenuPlugin$1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const BubbleMenu={name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},watch:{editor:{immediate:!0,handler(M){M&&this.$nextTick(()=>{M.registerPlugin(BubbleMenuPlugin({updateDelay:this.updateDelay,editor:M,element:this.$el,pluginKey:this.pluginKey,shouldShow:this.shouldShow,tippyOptions:this.tippyOptions}))})}}},render(M){return M("div",{style:{visibility:"hidden"}},this.$slots.default)},beforeDestroy(){this.editor.unregisterPlugin(this.pluginKey)}};class Editor extends Editor$1{constructor(){super(...arguments),this.contentComponent=null}}const EditorContent={name:"EditorContent",props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(M){M&&M.options.element&&this.$nextTick(()=>{const $=this.$el;!$||!M.options.element.firstChild||($.append(...M.options.element.childNodes),M.contentComponent=this,M.setOptions({element:$}),M.createNodeViews())})}}},render(M){return M("div")},beforeDestroy(){const{editor:M}=this;if(!M||(M.isDestroyed||M.view.setProps({nodeViews:{}}),M.contentComponent=null,!M.options.element.firstChild))return;const $=document.createElement("div");$.append(...M.options.element.childNodes),M.setOptions({element:$})}},FloatingMenu$1={name:"FloatingMenu",props:{pluginKey:{type:[String,Object],default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},watch:{editor:{immediate:!0,handler(M){M&&this.$nextTick(()=>{M.registerPlugin(FloatingMenuPlugin$1({pluginKey:this.pluginKey,editor:M,element:this.$el,tippyOptions:this.tippyOptions,shouldShow:this.shouldShow}))})}}},render(M){return M("div",{style:{visibility:"hidden"}},this.$slots.default)},beforeDestroy(){this.editor.unregisterPlugin(this.pluginKey)}},NodeViewContent={props:{as:{type:String,default:"div"}},render(M){return M(this.as,{style:{whiteSpace:"pre-wrap"},attrs:{"data-node-view-content":""}})}},NodeViewWrapper={props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(M){return M(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},attrs:{"data-node-view-wrapper":""},on:{dragstart:this.onDragStart}},this.$slots.default)}};class VueRenderer{constructor($,I){const N=typeof $=="function"?$:Vue$3.extend($);this.ref=new N(I).$mount()}get element(){return this.ref.$el}updateProps($={}){var I,N,B;if(!this.ref.$props)return;const j=(B=(N=(I=this.ref.$props.editor)===null||I===void 0?void 0:I.contentComponent)===null||N===void 0?void 0:N.$options._base)!==null&&B!==void 0?B:Vue$3,U=j.config.silent;j.config.silent=!0,Object.entries($).forEach(([q,Y])=>{this.ref.$props[q]=Y}),j.config.silent=U}destroy(){this.ref.$destroy()}}const nodeViewProps={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}};class VueNodeView extends NodeView{mount(){var $,I;const N={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(q={})=>this.updateAttributes(q),deleteNode:()=>this.deleteNode()},B=this.onDragStart.bind(this);this.decorationClasses=Vue$3.observable({value:this.getDecorationClasses()});const U=((I=($=this.editor.contentComponent)===null||$===void 0?void 0:$.$options._base)!==null&&I!==void 0?I:Vue$3).extend(this.component).extend({props:Object.keys(N),provide:()=>({onDragStart:B,decorationClasses:this.decorationClasses})});this.renderer=new VueRenderer(U,{parent:this.editor.contentComponent,propsData:N})}get dom(){if(!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")||this.dom}update($,I){const N=B=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(B)};if(typeof this.options.update=="function"){const B=this.node,j=this.decorations;return this.node=$,this.decorations=I,this.options.update({oldNode:B,oldDecorations:j,newNode:$,newDecorations:I,updateProps:()=>N({node:$,decorations:I})})}return $.type!==this.node.type?!1:($===this.node&&this.decorations===I||(this.node=$,this.decorations=I,N({node:$,decorations:I})),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}getDecorationClasses(){return this.decorations.map($=>$.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy()}}function VueNodeViewRenderer(M,$){return I=>I.editor.contentComponent?new VueNodeView(M,I,$):{}}const vue2=Object.freeze(Object.defineProperty({__proto__:null,BubbleMenu,CommandManager,Editor,EditorContent,Extension,FloatingMenu:FloatingMenu$1,InputRule,Mark,Node:Node$1,NodeView,NodeViewContent,NodeViewWrapper,PasteRule,Tracker,VueNodeViewRenderer,VueRenderer,callOrReturn,combineTransactionSteps,createChainableState,createDocument,createNodeFromContent,createStyleTag,defaultBlockAt,deleteProps,elementFromString,escapeForRegEx,extensions,findChildren,findChildrenInRange,findDuplicates,findParentNode,findParentNodeClosestToPos,fromString,generateHTML,generateJSON,generateText,getAttributes,getAttributesFromExtensions,getChangedRanges,getDebugJSON,getExtensionField,getHTMLFromFragment,getMarkAttributes,getMarkRange,getMarkType,getMarksBetween,getNodeAttributes,getNodeType,getRenderedAttributes,getSchema,getSchemaByResolvedExtensions,getSchemaTypeByName,getSchemaTypeNameByName,getSplittedAttributes,getText,getTextBetween,getTextContentFromNodes,getTextSerializersFromSchema,injectExtensionAttributesToParseRule,inputRulesPlugin,isActive,isEmptyObject,isExtensionRulesEnabled,isFunction:isFunction$5,isList,isMacOS,isMarkActive,isNodeActive,isNodeEmpty,isNodeSelection,isNumber:isNumber$4,isPlainObject:isPlainObject$1,isRegExp:isRegExp$4,isString:isString$6,isTextSelection,isiOS,markInputRule,markPasteRule,mergeAttributes,mergeDeep,minMax,nodeInputRule,nodePasteRule,nodeViewProps,objectIncludes:objectIncludes$1,pasteRulesPlugin,posToDOMRect,removeDuplicates,resolveFocusPosition,selectionToInsertionEnd,splitExtensions,textInputRule,textPasteRule,textblockTypeInputRule,wrappingInputRule},Symbol.toStringTag,{value:"Module"}));class Bard{constructor($){this.instance=$,this.extensionCallbacks=[],this.extensionReplacementCallbacks=[],this.buttonCallbacks=[]}addExtension($){this.extensionCallbacks.push($)}replaceExtension($,I){this.extensionReplacementCallbacks.push({name:$,callback:I})}buttons($){this.buttonCallbacks.push($)}get tiptap(){return{core:core$2,vue2,pm:{state,model,view}}}}var mousetrap$1={exports:{}};(function(M){(function($,I,N){for(var B={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},j={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},U={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},q={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},Y,K=1;K<20;++K)B[111+K]="f"+K;for(K=0;K<=9;++K)B[K+96]=K;function G(me,ve,xe){if(me.addEventListener){me.addEventListener(ve,xe,!1);return}me.attachEvent("on"+ve,xe)}function J(me){if(me.type=="keypress"){var ve=String.fromCharCode(me.which);return me.shiftKey||(ve=ve.toLowerCase()),ve}return B[me.which]?B[me.which]:j[me.which]?j[me.which]:String.fromCharCode(me.which).toLowerCase()}function Z(me,ve){return me.sort().join(",")===ve.sort().join(",")}function ee(me){var ve=[];return me.shiftKey&&ve.push("shift"),me.altKey&&ve.push("alt"),me.ctrlKey&&ve.push("ctrl"),me.metaKey&&ve.push("meta"),ve}function te(me){if(me.preventDefault){me.preventDefault();return}me.returnValue=!1}function re(me){if(me.stopPropagation){me.stopPropagation();return}me.cancelBubble=!0}function se(me){return me=="shift"||me=="ctrl"||me=="alt"||me=="meta"}function ne(){if(!Y){Y={};for(var me in B)me>95&&me<112||B.hasOwnProperty(me)&&(Y[B[me]]=me)}return Y}function le(me,ve,xe){return xe||(xe=ne()[me]?"keydown":"keypress"),xe=="keypress"&&ve.length&&(xe="keydown"),xe}function ge(me){return me==="+"?["+"]:(me=me.replace(/\+{2}/g,"+plus"),me.split("+"))}function ue(me,ve){var xe,oe,ye,be=[];for(xe=ge(me),ye=0;ye1){Fe(lt,zt,qe,Ve);return}Ht=ue(lt,Ve),ve._callbacks[Ht.key]=ve._callbacks[Ht.key]||[],ke(Ht.key,Ht.modifiers,{type:Ht.action},At,lt,Nt),ve._callbacks[Ht.key][At?"unshift":"push"]({callback:qe,modifiers:Ht.modifiers,action:Ht.action,seq:At,level:Nt,combo:lt})}ve._bindMultiple=function(lt,qe,Ve){for(var At=0;At-1||_e(ve,xe.target)?!1:ve.tagName=="INPUT"||ve.tagName=="SELECT"||ve.tagName=="TEXTAREA"||ve.isContentEditable},fe.prototype.handleKey=function(){var me=this;return me._handleKey.apply(me,arguments)},fe.init=function(){var me=fe(I);for(var ve in me)ve.charAt(0)!=="_"&&(fe[ve]=function(xe){return function(){return me[xe].apply(me,arguments)}}(ve))},fe.init(),$.Mousetrap=fe,M.exports&&(M.exports=fe),typeof N=="function"&&N.amd&&N(function(){return fe})})(window,document)})(mousetrap$1);var mousetrapExports=mousetrap$1.exports;const mousetrap=getDefaultExportFromCjs(mousetrapExports);class Binding{constructor($){this.bindings=$}bind($,I){return typeof $=="string"&&($=[$]),$.forEach(N=>{this.bindings[N]=this.bindings[N]||[],this.bindings[N].push(I),this.bindMousetrap(N,I)}),this.bound=$,this}destroy(){this.bound.forEach($=>{this.bindings[$].pop();const I=this.bindings[$].slice(-1)[0];I?mousetrap.bind($,I):mousetrap.unbind($)})}stop($){mousetrap.prototype.stopCallback=$}bindMousetrap($,I){mousetrap.bind($,I)}}(function(M){var $={},I=M.prototype.stopCallback;M.prototype.stopCallback=function(N,B,j,U){var q=this;return q.paused?!0:$[j]||$[U]?!1:I.call(q,N,B,j)},M.prototype.bindGlobal=function(N,B,j){var U=this;if(U.bind(N,B,j),N instanceof Array){for(var q=0;q{this.getCallbacks($).sort((j,U)=>U.priority-j.priority).map(j=>this.convertToPromiseCallback(j.callback,I)).reduce((j,U)=>j.then(q=>U().then(Array.prototype.concat.bind(q))),Promise.resolve([])).then(j=>N(j)).catch(j=>B(j))})}getCallbacks($){return this.hooks[$]||[]}convertToPromiseCallback($,I){return()=>new Promise((N,B)=>{$(N,B,I)})}};function getDefaults(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let defaults$7=getDefaults();function changeDefaults(M){defaults$7=M}const escapeTest=/[&<>"']/,escapeReplace=new RegExp(escapeTest.source,"g"),escapeTestNoEncode=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode=new RegExp(escapeTestNoEncode.source,"g"),escapeReplacements={"&":"&","<":"<",">":">",'"':""","'":"'"},getEscapeReplacement=M=>escapeReplacements[M];function escape$4(M,$){if($){if(escapeTest.test(M))return M.replace(escapeReplace,getEscapeReplacement)}else if(escapeTestNoEncode.test(M))return M.replace(escapeReplaceNoEncode,getEscapeReplacement);return M}const unescapeTest=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function unescape$2(M){return M.replace(unescapeTest,($,I)=>(I=I.toLowerCase(),I==="colon"?":":I.charAt(0)==="#"?I.charAt(1)==="x"?String.fromCharCode(parseInt(I.substring(2),16)):String.fromCharCode(+I.substring(1)):""))}const caret=/(^|[^\[])\^/g;function edit(M,$){M=typeof M=="string"?M:M.source,$=$||"";const I={replace:(N,B)=>(B=B.source||B,B=B.replace(caret,"$1"),M=M.replace(N,B),I),getRegex:()=>new RegExp(M,$)};return I}const nonWordAndColonTest=/[^\w:]/g,originIndependentUrl=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function cleanUrl(M,$,I){if(M){let N;try{N=decodeURIComponent(unescape$2(I)).replace(nonWordAndColonTest,"").toLowerCase()}catch{return null}if(N.indexOf("javascript:")===0||N.indexOf("vbscript:")===0||N.indexOf("data:")===0)return null}$&&!originIndependentUrl.test(I)&&(I=resolveUrl($,I));try{I=encodeURI(I).replace(/%25/g,"%")}catch{return null}return I}const baseUrls={},justDomain=/^[^:]+:\/*[^/]*$/,protocol=/^([^:]+:)[\s\S]*$/,domain=/^([^:]+:\/*[^/]*)[\s\S]*$/;function resolveUrl(M,$){baseUrls[" "+M]||(justDomain.test(M)?baseUrls[" "+M]=M+"/":baseUrls[" "+M]=rtrim(M,"/",!0)),M=baseUrls[" "+M];const I=M.indexOf(":")===-1;return $.substring(0,2)==="//"?I?$:M.replace(protocol,"$1")+$:$.charAt(0)==="/"?I?$:M.replace(domain,"$1")+$:M+$}const noopTest={exec:function(){}};function splitCells(M,$){const I=M.replace(/\|/g,(j,U,q)=>{let Y=!1,K=U;for(;--K>=0&&q[K]==="\\";)Y=!Y;return Y?"|":" |"}),N=I.split(/ \|/);let B=0;if(N[0].trim()||N.shift(),N.length>0&&!N[N.length-1].trim()&&N.pop(),N.length>$)N.splice($);else for(;N.length<$;)N.push("");for(;B1;)$&1&&(I+=M),$>>=1,M+=M;return I+M}function outputLink(M,$,I,N){const B=$.href,j=$.title?escape$4($.title):null,U=M[1].replace(/\\([\[\]])/g,"$1");if(M[0].charAt(0)!=="!"){N.state.inLink=!0;const q={type:"link",raw:I,href:B,title:j,text:U,tokens:N.inlineTokens(U)};return N.state.inLink=!1,q}return{type:"image",raw:I,href:B,title:j,text:escape$4(U)}}function indentCodeCompensation(M,$){const I=M.match(/^(\s+)(?:```)/);if(I===null)return $;const N=I[1];return $.split(` `).map(B=>{const j=B.match(/^\s+/);if(j===null)return B;const[U]=j;return U.length>=N.length?B.slice(N.length):B}).join(` `)}class Tokenizer{constructor($){this.options=$||defaults$7}space($){const I=this.rules.block.newline.exec($);if(I&&I[0].length>0)return{type:"space",raw:I[0]}}code($){const I=this.rules.block.code.exec($);if(I){const N=I[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:I[0],codeBlockStyle:"indented",text:this.options.pedantic?N:rtrim(N,` `)}}}fences($){const I=this.rules.block.fences.exec($);if(I){const N=I[0],B=indentCodeCompensation(N,I[3]||"");return{type:"code",raw:N,lang:I[2]?I[2].trim().replace(this.rules.inline._escapes,"$1"):I[2],text:B}}}heading($){const I=this.rules.block.heading.exec($);if(I){let N=I[2].trim();if(/#$/.test(N)){const B=rtrim(N,"#");(this.options.pedantic||!B||/ $/.test(B))&&(N=B.trim())}return{type:"heading",raw:I[0],depth:I[1].length,text:N,tokens:this.lexer.inline(N)}}}hr($){const I=this.rules.block.hr.exec($);if(I)return{type:"hr",raw:I[0]}}blockquote($){const I=this.rules.block.blockquote.exec($);if(I){const N=I[0].replace(/^ *>[ \t]?/gm,""),B=this.lexer.state.top;this.lexer.state.top=!0;const j=this.lexer.blockTokens(N);return this.lexer.state.top=B,{type:"blockquote",raw:I[0],tokens:j,text:N}}}list($){let I=this.rules.block.list.exec($);if(I){let N,B,j,U,q,Y,K,G,J,Z,ee,te,re=I[1].trim();const se=re.length>1,ne={type:"list",raw:"",ordered:se,start:se?+re.slice(0,-1):"",loose:!1,items:[]};re=se?`\\d{1,9}\\${re.slice(-1)}`:`\\${re}`,this.options.pedantic&&(re=se?re:"[*+-]");const le=new RegExp(`^( {0,3}${re})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;$&&(te=!1,!(!(I=le.exec($))||this.rules.block.hr.test($)));){if(N=I[0],$=$.substring(N.length),G=I[2].split(` `,1)[0].replace(/^\t+/,ue=>" ".repeat(3*ue.length)),J=$.split(` `,1)[0],this.options.pedantic?(U=2,ee=G.trimLeft()):(U=I[2].search(/[^ ]/),U=U>4?1:U,ee=G.slice(U),U+=I[1].length),Y=!1,!G&&/^ *$/.test(J)&&(N+=J+` `,$=$.substring(J.length+1),te=!0),!te){const ue=new RegExp(`^ {0,${Math.min(3,U-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),_e=new RegExp(`^ {0,${Math.min(3,U-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fe=new RegExp(`^ {0,${Math.min(3,U-1)}}(?:\`\`\`|~~~)`),me=new RegExp(`^ {0,${Math.min(3,U-1)}}#`);for(;$&&(Z=$.split(` `,1)[0],J=Z,this.options.pedantic&&(J=J.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(fe.test(J)||me.test(J)||ue.test(J)||_e.test($)));){if(J.search(/[^ ]/)>=U||!J.trim())ee+=` `+J.slice(U);else{if(Y||G.search(/[^ ]/)>=4||fe.test(G)||me.test(G)||_e.test(G))break;ee+=` `+J}!Y&&!J.trim()&&(Y=!0),N+=Z+` `,$=$.substring(Z.length+1),G=J.slice(U)}}ne.loose||(K?ne.loose=!0:/\n *\n *$/.test(N)&&(K=!0)),this.options.gfm&&(B=/^\[[ xX]\] /.exec(ee),B&&(j=B[0]!=="[ ] ",ee=ee.replace(/^\[[ xX]\] +/,""))),ne.items.push({type:"list_item",raw:N,task:!!B,checked:j,loose:!1,text:ee}),ne.raw+=N}ne.items[ne.items.length-1].raw=N.trimRight(),ne.items[ne.items.length-1].text=ee.trimRight(),ne.raw=ne.raw.trimRight();const ge=ne.items.length;for(q=0;qfe.type==="space"),_e=ue.length>0&&ue.some(fe=>/\n.*\n/.test(fe.raw));ne.loose=_e}if(ne.loose)for(q=0;q$/,"$1").replace(this.rules.inline._escapes,"$1"):"",j=I[3]?I[3].substring(1,I[3].length-1).replace(this.rules.inline._escapes,"$1"):I[3];return{type:"def",tag:N,raw:I[0],href:B,title:j}}}table($){const I=this.rules.block.table.exec($);if(I){const N={type:"table",header:splitCells(I[1]).map(B=>({text:B})),align:I[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:I[3]&&I[3].trim()?I[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(N.header.length===N.align.length){N.raw=I[0];let B=N.align.length,j,U,q,Y;for(j=0;j({text:K}));for(B=N.header.length,U=0;U/i.test(I[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(I[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(I[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:I[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):escape$4(I[0]):I[0]}}link($){const I=this.rules.inline.link.exec($);if(I){const N=I[2].trim();if(!this.options.pedantic&&/^$/.test(N))return;const U=rtrim(N.slice(0,-1),"\\");if((N.length-U.length)%2===0)return}else{const U=findClosingBracket(I[2],"()");if(U>-1){const Y=(I[0].indexOf("!")===0?5:4)+I[1].length+U;I[2]=I[2].substring(0,U),I[0]=I[0].substring(0,Y).trim(),I[3]=""}}let B=I[2],j="";if(this.options.pedantic){const U=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(B);U&&(B=U[1],j=U[3])}else j=I[3]?I[3].slice(1,-1):"";return B=B.trim(),/^$/.test(N)?B=B.slice(1):B=B.slice(1,-1)),outputLink(I,{href:B&&B.replace(this.rules.inline._escapes,"$1"),title:j&&j.replace(this.rules.inline._escapes,"$1")},I[0],this.lexer)}}reflink($,I){let N;if((N=this.rules.inline.reflink.exec($))||(N=this.rules.inline.nolink.exec($))){let B=(N[2]||N[1]).replace(/\s+/g," ");if(B=I[B.toLowerCase()],!B){const j=N[0].charAt(0);return{type:"text",raw:j,text:j}}return outputLink(N,B,N[0],this.lexer)}}emStrong($,I,N=""){let B=this.rules.inline.emStrong.lDelim.exec($);if(!B||B[3]&&N.match(/[\p{L}\p{N}]/u))return;const j=B[1]||B[2]||"";if(!j||j&&(N===""||this.rules.inline.punctuation.exec(N))){const U=B[0].length-1;let q,Y,K=U,G=0;const J=B[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(J.lastIndex=0,I=I.slice(-1*$.length+U);(B=J.exec(I))!=null;){if(q=B[1]||B[2]||B[3]||B[4]||B[5]||B[6],!q)continue;if(Y=q.length,B[3]||B[4]){K+=Y;continue}else if((B[5]||B[6])&&U%3&&!((U+Y)%3)){G+=Y;continue}if(K-=Y,K>0)continue;Y=Math.min(Y,Y+K+G);const Z=$.slice(0,U+B.index+(B[0].length-q.length)+Y);if(Math.min(U,Y)%2){const te=Z.slice(1,-1);return{type:"em",raw:Z,text:te,tokens:this.lexer.inlineTokens(te)}}const ee=Z.slice(2,-2);return{type:"strong",raw:Z,text:ee,tokens:this.lexer.inlineTokens(ee)}}}}codespan($){const I=this.rules.inline.code.exec($);if(I){let N=I[2].replace(/\n/g," ");const B=/[^ ]/.test(N),j=/^ /.test(N)&&/ $/.test(N);return B&&j&&(N=N.substring(1,N.length-1)),N=escape$4(N,!0),{type:"codespan",raw:I[0],text:N}}}br($){const I=this.rules.inline.br.exec($);if(I)return{type:"br",raw:I[0]}}del($){const I=this.rules.inline.del.exec($);if(I)return{type:"del",raw:I[0],text:I[2],tokens:this.lexer.inlineTokens(I[2])}}autolink($,I){const N=this.rules.inline.autolink.exec($);if(N){let B,j;return N[2]==="@"?(B=escape$4(this.options.mangle?I(N[1]):N[1]),j="mailto:"+B):(B=escape$4(N[1]),j=B),{type:"link",raw:N[0],text:B,href:j,tokens:[{type:"text",raw:B,text:B}]}}}url($,I){let N;if(N=this.rules.inline.url.exec($)){let B,j;if(N[2]==="@")B=escape$4(this.options.mangle?I(N[0]):N[0]),j="mailto:"+B;else{let U;do U=N[0],N[0]=this.rules.inline._backpedal.exec(N[0])[0];while(U!==N[0]);B=escape$4(N[0]),N[1]==="www."?j="http://"+N[0]:j=N[0]}return{type:"link",raw:N[0],text:B,href:j,tokens:[{type:"text",raw:B,text:B}]}}}inlineText($,I){const N=this.rules.inline.text.exec($);if(N){let B;return this.lexer.state.inRawBlock?B=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):escape$4(N[0]):N[0]:B=escape$4(this.options.smartypants?I(N[0]):N[0]),{type:"text",raw:N[0],text:B}}}}const block={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:noopTest,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};block._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;block._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;block.def=edit(block.def).replace("label",block._label).replace("title",block._title).getRegex();block.bullet=/(?:[*+-]|\d{1,9}[.)])/;block.listItemStart=edit(/^( *)(bull) */).replace("bull",block.bullet).getRegex();block.list=edit(block.list).replace(/bull/g,block.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+block.def.source+")").getRegex();block._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";block._comment=/|$)/;block.html=edit(block.html,"i").replace("comment",block._comment).replace("tag",block._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();block.paragraph=edit(block._paragraph).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex();block.blockquote=edit(block.blockquote).replace("paragraph",block.paragraph).getRegex();block.normal={...block};block.gfm={...block.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};block.gfm.table=edit(block.gfm.table).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex();block.gfm.paragraph=edit(block._paragraph).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",block.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex();block.pedantic={...block.normal,html:edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",block._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(block.normal._paragraph).replace("hr",block.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",block.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const inline={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:noopTest,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:noopTest,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";inline.punctuation=edit(inline.punctuation).replace(/punctuation/g,inline._punctuation).getRegex();inline.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;inline.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;inline._comment=edit(block._comment).replace("(?:-->|$)","-->").getRegex();inline.emStrong.lDelim=edit(inline.emStrong.lDelim).replace(/punct/g,inline._punctuation).getRegex();inline.emStrong.rDelimAst=edit(inline.emStrong.rDelimAst,"g").replace(/punct/g,inline._punctuation).getRegex();inline.emStrong.rDelimUnd=edit(inline.emStrong.rDelimUnd,"g").replace(/punct/g,inline._punctuation).getRegex();inline._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;inline._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;inline._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;inline.autolink=edit(inline.autolink).replace("scheme",inline._scheme).replace("email",inline._email).getRegex();inline._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;inline.tag=edit(inline.tag).replace("comment",inline._comment).replace("attribute",inline._attribute).getRegex();inline._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;inline._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;inline._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;inline.link=edit(inline.link).replace("label",inline._label).replace("href",inline._href).replace("title",inline._title).getRegex();inline.reflink=edit(inline.reflink).replace("label",inline._label).replace("ref",block._label).getRegex();inline.nolink=edit(inline.nolink).replace("ref",block._label).getRegex();inline.reflinkSearch=edit(inline.reflinkSearch,"g").replace("reflink",inline.reflink).replace("nolink",inline.nolink).getRegex();inline.normal={...inline};inline.pedantic={...inline.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:edit(/^!?\[(label)\]\((.*?)\)/).replace("label",inline._label).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",inline._label).getRegex()};inline.gfm={...inline.normal,escape:edit(inline.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(N="x"+N.toString(16)),$+="&#"+N+";";return $}class Lexer{constructor($){this.tokens=[],this.tokens.links=Object.create(null),this.options=$||defaults$7,this.options.tokenizer=this.options.tokenizer||new Tokenizer,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const I={block:block.normal,inline:inline.normal};this.options.pedantic?(I.block=block.pedantic,I.inline=inline.pedantic):this.options.gfm&&(I.block=block.gfm,this.options.breaks?I.inline=inline.breaks:I.inline=inline.gfm),this.tokenizer.rules=I}static get rules(){return{block,inline}}static lex($,I){return new Lexer(I).lex($)}static lexInline($,I){return new Lexer(I).inlineTokens($)}lex($){$=$.replace(/\r\n|\r/g,` `),this.blockTokens($,this.tokens);let I;for(;I=this.inlineQueue.shift();)this.inlineTokens(I.src,I.tokens);return this.tokens}blockTokens($,I=[]){this.options.pedantic?$=$.replace(/\t/g," ").replace(/^ +$/gm,""):$=$.replace(/^( *)(\t+)/gm,(q,Y,K)=>Y+" ".repeat(K.length));let N,B,j,U;for(;$;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(q=>(N=q.call({lexer:this},$,I))?($=$.substring(N.raw.length),I.push(N),!0):!1))){if(N=this.tokenizer.space($)){$=$.substring(N.raw.length),N.raw.length===1&&I.length>0?I[I.length-1].raw+=` `:I.push(N);continue}if(N=this.tokenizer.code($)){$=$.substring(N.raw.length),B=I[I.length-1],B&&(B.type==="paragraph"||B.type==="text")?(B.raw+=` `+N.raw,B.text+=` `+N.text,this.inlineQueue[this.inlineQueue.length-1].src=B.text):I.push(N);continue}if(N=this.tokenizer.fences($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.heading($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.hr($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.blockquote($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.list($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.html($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.def($)){$=$.substring(N.raw.length),B=I[I.length-1],B&&(B.type==="paragraph"||B.type==="text")?(B.raw+=` `+N.raw,B.text+=` `+N.raw,this.inlineQueue[this.inlineQueue.length-1].src=B.text):this.tokens.links[N.tag]||(this.tokens.links[N.tag]={href:N.href,title:N.title});continue}if(N=this.tokenizer.table($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.lheading($)){$=$.substring(N.raw.length),I.push(N);continue}if(j=$,this.options.extensions&&this.options.extensions.startBlock){let q=1/0;const Y=$.slice(1);let K;this.options.extensions.startBlock.forEach(function(G){K=G.call({lexer:this},Y),typeof K=="number"&&K>=0&&(q=Math.min(q,K))}),q<1/0&&q>=0&&(j=$.substring(0,q+1))}if(this.state.top&&(N=this.tokenizer.paragraph(j))){B=I[I.length-1],U&&B.type==="paragraph"?(B.raw+=` `+N.raw,B.text+=` `+N.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=B.text):I.push(N),U=j.length!==$.length,$=$.substring(N.raw.length);continue}if(N=this.tokenizer.text($)){$=$.substring(N.raw.length),B=I[I.length-1],B&&B.type==="text"?(B.raw+=` `+N.raw,B.text+=` `+N.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=B.text):I.push(N);continue}if($){const q="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(q);break}else throw new Error(q)}}return this.state.top=!0,I}inline($,I=[]){return this.inlineQueue.push({src:$,tokens:I}),I}inlineTokens($,I=[]){let N,B,j,U=$,q,Y,K;if(this.tokens.links){const G=Object.keys(this.tokens.links);if(G.length>0)for(;(q=this.tokenizer.rules.inline.reflinkSearch.exec(U))!=null;)G.includes(q[0].slice(q[0].lastIndexOf("[")+1,-1))&&(U=U.slice(0,q.index)+"["+repeatString("a",q[0].length-2)+"]"+U.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(q=this.tokenizer.rules.inline.blockSkip.exec(U))!=null;)U=U.slice(0,q.index)+"["+repeatString("a",q[0].length-2)+"]"+U.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(q=this.tokenizer.rules.inline.escapedEmSt.exec(U))!=null;)U=U.slice(0,q.index+q[0].length-2)+"++"+U.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;$;)if(Y||(K=""),Y=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(G=>(N=G.call({lexer:this},$,I))?($=$.substring(N.raw.length),I.push(N),!0):!1))){if(N=this.tokenizer.escape($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.tag($)){$=$.substring(N.raw.length),B=I[I.length-1],B&&N.type==="text"&&B.type==="text"?(B.raw+=N.raw,B.text+=N.text):I.push(N);continue}if(N=this.tokenizer.link($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.reflink($,this.tokens.links)){$=$.substring(N.raw.length),B=I[I.length-1],B&&N.type==="text"&&B.type==="text"?(B.raw+=N.raw,B.text+=N.text):I.push(N);continue}if(N=this.tokenizer.emStrong($,U,K)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.codespan($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.br($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.del($)){$=$.substring(N.raw.length),I.push(N);continue}if(N=this.tokenizer.autolink($,mangle)){$=$.substring(N.raw.length),I.push(N);continue}if(!this.state.inLink&&(N=this.tokenizer.url($,mangle))){$=$.substring(N.raw.length),I.push(N);continue}if(j=$,this.options.extensions&&this.options.extensions.startInline){let G=1/0;const J=$.slice(1);let Z;this.options.extensions.startInline.forEach(function(ee){Z=ee.call({lexer:this},J),typeof Z=="number"&&Z>=0&&(G=Math.min(G,Z))}),G<1/0&&G>=0&&(j=$.substring(0,G+1))}if(N=this.tokenizer.inlineText(j,smartypants)){$=$.substring(N.raw.length),N.raw.slice(-1)!=="_"&&(K=N.raw.slice(-1)),Y=!0,B=I[I.length-1],B&&B.type==="text"?(B.raw+=N.raw,B.text+=N.text):I.push(N);continue}if($){const G="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(G);break}else throw new Error(G)}}return I}}let Renderer$1=class{constructor($){this.options=$||defaults$7}code($,I,N){const B=(I||"").match(/\S*/)[0];if(this.options.highlight){const j=this.options.highlight($,B);j!=null&&j!==$&&(N=!0,$=j)}return $=$.replace(/\n$/,"")+` `,B?'
'+(N?$:escape$4($,!0))+`
`:"
"+(N?$:escape$4($,!0))+`
`}blockquote($){return`
${$}
`}html($){return $}heading($,I,N,B){if(this.options.headerIds){const j=this.options.headerPrefix+B.slug(N);return`${$} `}return`${$} `}hr(){return this.options.xhtml?`
`:`
`}list($,I,N){const B=I?"ol":"ul",j=I&&N!==1?' start="'+N+'"':"";return"<"+B+j+`> `+$+" `}listitem($){return`
  • ${$}
  • `}checkbox($){return" "}paragraph($){return`

    ${$}

    `}table($,I){return I&&(I=`${I}`),` `+$+` `+I+`
    `}tablerow($){return` ${$} `}tablecell($,I){const N=I.header?"th":"td";return(I.align?`<${N} align="${I.align}">`:`<${N}>`)+$+` `}strong($){return`${$}`}em($){return`${$}`}codespan($){return`${$}`}br(){return this.options.xhtml?"
    ":"
    "}del($){return`${$}`}link($,I,N){if($=cleanUrl(this.options.sanitize,this.options.baseUrl,$),$===null)return N;let B='",B}image($,I,N){if($=cleanUrl(this.options.sanitize,this.options.baseUrl,$),$===null)return N;let B=`${N}":">",B}text($){return $}};class TextRenderer{strong($){return $}em($){return $}codespan($){return $}del($){return $}html($){return $}text($){return $}link($,I,N){return""+N}image($,I,N){return""+N}br(){return""}}class Slugger{constructor(){this.seen={}}serialize($){return $.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug($,I){let N=$,B=0;if(this.seen.hasOwnProperty(N)){B=this.seen[$];do B++,N=$+"-"+B;while(this.seen.hasOwnProperty(N))}return I||(this.seen[$]=B,this.seen[N]=0),N}slug($,I={}){const N=this.serialize($);return this.getNextSafeSlug(N,I.dryrun)}}class Parser{constructor($){this.options=$||defaults$7,this.options.renderer=this.options.renderer||new Renderer$1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new TextRenderer,this.slugger=new Slugger}static parse($,I){return new Parser(I).parse($)}static parseInline($,I){return new Parser(I).parseInline($)}parse($,I=!0){let N="",B,j,U,q,Y,K,G,J,Z,ee,te,re,se,ne,le,ge,ue,_e,fe;const me=$.length;for(B=0;B0&&le.tokens[0].type==="paragraph"?(le.tokens[0].text=_e+" "+le.tokens[0].text,le.tokens[0].tokens&&le.tokens[0].tokens.length>0&&le.tokens[0].tokens[0].type==="text"&&(le.tokens[0].tokens[0].text=_e+" "+le.tokens[0].tokens[0].text)):le.tokens.unshift({type:"text",text:_e}):ne+=_e),ne+=this.parse(le.tokens,se),Z+=this.renderer.listitem(ne,ue,ge);N+=this.renderer.list(Z,te,re);continue}case"html":{N+=this.renderer.html(ee.text);continue}case"paragraph":{N+=this.renderer.paragraph(this.parseInline(ee.tokens));continue}case"text":{for(Z=ee.tokens?this.parseInline(ee.tokens):ee.text;B+1{if(N.message+=` Please report this to https://github.com/markedjs/marked.`,M){const B="

    An error occurred:

    "+escape$4(N.message+"",!0)+"
    ";if($)return Promise.resolve(B);if(I){I(null,B);return}return B}if($)return Promise.reject(N);if(I){I(N);return}throw N}}function parseMarkdown(M,$){return(I,N,B)=>{typeof N=="function"&&(B=N,N=null);const j={...N};N={...marked.defaults,...j};const U=onError(N.silent,N.async,B);if(typeof I>"u"||I===null)return U(new Error("marked(): input parameter is undefined or null"));if(typeof I!="string")return U(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(I)+", string expected"));if(checkSanitizeDeprecation(N),N.hooks&&(N.hooks.options=N),B){const q=N.highlight;let Y;try{N.hooks&&(I=N.hooks.preprocess(I)),Y=M(I,N)}catch(J){return U(J)}const K=function(J){let Z;if(!J)try{N.walkTokens&&marked.walkTokens(Y,N.walkTokens),Z=$(Y,N),N.hooks&&(Z=N.hooks.postprocess(Z))}catch(ee){J=ee}return N.highlight=q,J?U(J):B(null,Z)};if(!q||q.length<3||(delete N.highlight,!Y.length))return K();let G=0;marked.walkTokens(Y,function(J){J.type==="code"&&(G++,setTimeout(()=>{q(J.text,J.lang,function(Z,ee){if(Z)return K(Z);ee!=null&&ee!==J.text&&(J.text=ee,J.escaped=!0),G--,G===0&&K()})},0))}),G===0&&K();return}if(N.async)return Promise.resolve(N.hooks?N.hooks.preprocess(I):I).then(q=>M(q,N)).then(q=>N.walkTokens?Promise.all(marked.walkTokens(q,N.walkTokens)).then(()=>q):q).then(q=>$(q,N)).then(q=>N.hooks?N.hooks.postprocess(q):q).catch(U);try{N.hooks&&(I=N.hooks.preprocess(I));const q=M(I,N);N.walkTokens&&marked.walkTokens(q,N.walkTokens);let Y=$(q,N);return N.hooks&&(Y=N.hooks.postprocess(Y)),Y}catch(q){return U(q)}}}function marked(M,$,I){return parseMarkdown(Lexer.lex,Parser.parse)(M,$,I)}marked.options=marked.setOptions=function(M){return marked.defaults={...marked.defaults,...M},changeDefaults(marked.defaults),marked};marked.getDefaults=getDefaults;marked.defaults=defaults$7;marked.use=function(...M){const $=marked.defaults.extensions||{renderers:{},childTokens:{}};M.forEach(I=>{const N={...I};if(N.async=marked.defaults.async||N.async||!1,I.extensions&&(I.extensions.forEach(B=>{if(!B.name)throw new Error("extension name required");if(B.renderer){const j=$.renderers[B.name];j?$.renderers[B.name]=function(...U){let q=B.renderer.apply(this,U);return q===!1&&(q=j.apply(this,U)),q}:$.renderers[B.name]=B.renderer}if(B.tokenizer){if(!B.level||B.level!=="block"&&B.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");$[B.level]?$[B.level].unshift(B.tokenizer):$[B.level]=[B.tokenizer],B.start&&(B.level==="block"?$.startBlock?$.startBlock.push(B.start):$.startBlock=[B.start]:B.level==="inline"&&($.startInline?$.startInline.push(B.start):$.startInline=[B.start]))}B.childTokens&&($.childTokens[B.name]=B.childTokens)}),N.extensions=$),I.renderer){const B=marked.defaults.renderer||new Renderer$1;for(const j in I.renderer){const U=B[j];B[j]=(...q)=>{let Y=I.renderer[j].apply(B,q);return Y===!1&&(Y=U.apply(B,q)),Y}}N.renderer=B}if(I.tokenizer){const B=marked.defaults.tokenizer||new Tokenizer;for(const j in I.tokenizer){const U=B[j];B[j]=(...q)=>{let Y=I.tokenizer[j].apply(B,q);return Y===!1&&(Y=U.apply(B,q)),Y}}N.tokenizer=B}if(I.hooks){const B=marked.defaults.hooks||new Hooks;for(const j in I.hooks){const U=B[j];Hooks.passThroughHooks.has(j)?B[j]=q=>{if(marked.defaults.async)return Promise.resolve(I.hooks[j].call(B,q)).then(K=>U.call(B,K));const Y=I.hooks[j].call(B,q);return U.call(B,Y)}:B[j]=(...q)=>{let Y=I.hooks[j].apply(B,q);return Y===!1&&(Y=U.apply(B,q)),Y}}N.hooks=B}if(I.walkTokens){const B=marked.defaults.walkTokens;N.walkTokens=function(j){let U=[];return U.push(I.walkTokens.call(this,j)),B&&(U=U.concat(B.call(this,j))),U}}marked.setOptions(N)})};marked.walkTokens=function(M,$){let I=[];for(const N of M)switch(I=I.concat($.call(marked,N)),N.type){case"table":{for(const B of N.header)I=I.concat(marked.walkTokens(B.tokens,$));for(const B of N.rows)for(const j of B)I=I.concat(marked.walkTokens(j.tokens,$));break}case"list":{I=I.concat(marked.walkTokens(N.items,$));break}default:marked.defaults.extensions&&marked.defaults.extensions.childTokens&&marked.defaults.extensions.childTokens[N.type]?marked.defaults.extensions.childTokens[N.type].forEach(function(B){I=I.concat(marked.walkTokens(N[B],$))}):N.tokens&&(I=I.concat(marked.walkTokens(N.tokens,$)))}return I};marked.parseInline=parseMarkdown(Lexer.lexInline,Parser.parseInline);marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer$1;marked.TextRenderer=TextRenderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.Tokenizer=Tokenizer;marked.Slugger=Slugger;marked.Hooks=Hooks;marked.parse=marked;marked.options;marked.setOptions;marked.use;marked.walkTokens;marked.parseInline;Parser.parse;Lexer.lex;const intervalRegexp=/^({\s*(\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*)\s*})|([\[\]])\s*(-Inf|\*|\-?\d+(\.\d+)?)\s*,\s*(\+?Inf|\*|\-?\d+(\.\d+)?)\s*([\[\]])$/,anyIntervalRegexp=/({\s*(\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*)\s*})|([\[\]])\s*(-Inf|\*|\-?\d+(\.\d+)?)\s*,\s*(\+?Inf|\*|\-?\d+(\.\d+)?)\s*([\[\]])/,testInterval=function(M,$){if(typeof $!="string")throw"Invalid interval: should be a string.";$=$.trim();var I=$.match(intervalRegexp);if(!I)throw"Invalid interval: "+$;if(I[2]){for(var N=I[2].split(","),B=0;B=U:M>U)&&(Y==="]"?M<=q:M=2&&M%10<=4&&(M%100<10||M%100>=20)?1:2;case"cs":case"sk":return M==1?0:M>=2&&M<=4?1:2;case"ga":return M==1?0:M==2?1:2;case"lt":return M%10==1&&M%100!=11?0:M%10>=2&&(M%100<10||M%100>=20)?1:2;case"sl":return M%100==1?0:M%100==2?1:M%100==3||M%100==4?2:3;case"mk":return M%10==1?0:1;case"mt":return M==1?0:M===0||M%100>1&&M%100<11?1:M%100>10&&M%100<20?2:3;case"lv":return M===0?0:M%10==1&&M%100!=11?1:2;case"pl":return M==1?0:M%10>=2&&M%10<=4&&(M%100<12||M%100>14)?1:2;case"cy":return M==1?0:M==2?1:M==8||M==11?2:3;case"ro":return M==1?0:M===0||M%100>0&&M%100<20?1:2;case"ar":return M===0?0:M==1?1:M==2?2:M%100>=3&&M%100<=10?3:M%100>=11&&M%100<=99?4:5;default:return 0}},translate=function(M,$){let I=getLine(M);for(let N in $)I=I.split(":"+N).join($[N]);return I},translateChoice=function(M,$,I){I=typeof I<"u"?I:{},$=Array.isArray($)?$.length:$,I.count=$;let N=translate(M,I);return choose(N,$,Statamic.$config.get("translationLocale"))},getLine=function(M){const $=Statamic.$config.get("translations");return $[`*.${M}`]||$[M]||$[`statamic::${M}`]||$[`statamic::messages.${M}`]||M};function commonjsRequire(M){throw new Error('Could not dynamically require "'+M+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var uniqid$2={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var pid=typeof process<"u"&&process.pid?process.pid.toString(36):"",address="";if(typeof __webpack_require__!="function"&&typeof commonjsRequire<"u"){var mac="",os$1=require$$0$1;if(os$1.networkInterfaces)var networkInterfaces=os$1.networkInterfaces();if(networkInterfaces){e:for(let M in networkInterfaces){const $=networkInterfaces[M],I=$.length;for(var i$2=0;i$2$?M:$+1}var uniqidExports=uniqid$2.exports;const uniqid$1=getDefaultExportFromCjs(uniqidExports);class PreviewHtml{constructor($){this.html=$}}function cp_url$1(M){return M=Statamic.$config.get("cpUrl")+"/"+M,tidy_url(M)}function docs_url$1(M){return tidy_url("https://statamic.dev/"+M)}function resource_url$1(M){return M=Statamic.$config.get("resourceUrl")+"/"+M,tidy_url(M)}function tidy_url(M){return M.replace(/([^:])(\/\/+)/g,"$1/")}function relative_url(M){return M.replace(/^(?:\/\/|[^/]+)*\//,"/")}function dd(M){console.log(M)}function data_get$1(M,$,I=null){var N=Array.isArray($)?$:$.split("."),B=N.reduce((j,U)=>j&&j[U],M);return B!==void 0?B:I}function data_set(M,$,I){for(var N=$.split(".");N.length-1;){var B=N.shift(),j=N.length?new RegExp("^[0-9]+$").test(N[0]):!1;B in M||(M[B]=j?[]:{}),M=M[B]}M[N[0]]=I}function clone$4(M){if(M!==void 0)return JSON.parse(JSON.stringify(M))}function tailwind_width_class$1(M){return`${{25:"w-full @lg:w-1/4",33:"w-full @lg:w-1/3",50:"w-full @lg:w-1/2",66:"w-full @lg:w-2/3",75:"w-full @lg:w-3/4",100:"w-full"}[M]||"w-full"}`}function markdown$4(M){return marked(M)}function __$1(M,$){return translate(M,$)}function __n$1(M,$,I){return translateChoice(M,$,I)}function utf8btoa$1(M){const $=encodeURIComponent(M).replace(/%([0-9A-F]{2})/g,(I,N)=>String.fromCharCode(`0x${N}`));return btoa($)}function utf8atob$1(M){const $=atob(M);return decodeURIComponent($.split("").map(I=>"%"+("00"+I.charCodeAt(0).toString(16)).slice(-2)).join(""))}function uniqid(){return uniqid$1()}function truncate$1(M,$,I="..."){return M.length<=$?M:M.substring(0,$-I.length)+I}function escapeHtml$1(M){return M.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function replicatorPreviewHtml$1(M){return new PreviewHtml(M)}function closestVm(M,$){let I=M;for(;I&&!I.__vue__;)I=I.parentElement;let N=I.__vue__;for(;N!==N.$root;){if(!$||$===N.$options.name)return N;N=N.$parent}}const Globals=Object.freeze(Object.defineProperty({__proto__:null,__:__$1,__n:__n$1,clone:clone$4,closestVm,cp_url:cp_url$1,data_get:data_get$1,data_set,dd,docs_url:docs_url$1,escapeHtml:escapeHtml$1,markdown:markdown$4,relative_url,replicatorPreviewHtml:replicatorPreviewHtml$1,resource_url:resource_url$1,tailwind_width_class:tailwind_width_class$1,tidy_url,truncate:truncate$1,uniqid,utf8atob:utf8atob$1,utf8btoa:utf8btoa$1},Symbol.toStringTag,{value:"Module"}));class Reveal{element($){if(!$)return;let I=$;for(;I;)I.matches(".tab-panel")&&closestVm(I,"publish-tabs").setActive(I.dataset.tabHandle),I.matches(".replicator-set")&&closestVm(I,"replicator-fieldtype-set").expand(),I.matches(".bard-set")&&closestVm(I,"bard-fieldtype-set").expand(),I=I.parentElement;Vue$3.nextTick(()=>{$.scrollIntoView({block:"center"})})}invalid(){Vue$3.nextTick(()=>{const $=document.querySelector(".publish-field.has-error:not(:has(.publish-field.has-error))");$&&this.element($)})}}var VERSION$1="1.13.6",root=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},ArrayProto=Array.prototype,ObjProto=Object.prototype,SymbolProto=typeof Symbol<"u"?Symbol.prototype:null,push$1=ArrayProto.push,slice$1=ArrayProto.slice,toString$3=ObjProto.toString,hasOwnProperty$2=ObjProto.hasOwnProperty,supportsArrayBuffer=typeof ArrayBuffer<"u",supportsDataView=typeof DataView<"u",nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeCreate=Object.create,nativeIsView=supportsArrayBuffer&&ArrayBuffer.isView,_isNaN=isNaN,_isFinite=isFinite,hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],MAX_ARRAY_INDEX=Math.pow(2,53)-1;function restArguments(M,$){return $=$==null?M.length-1:+$,function(){for(var I=Math.max(arguments.length-$,0),N=Array(I),B=0;B=0&&I<=MAX_ARRAY_INDEX}}function shallowProperty(M){return function($){return $==null?void 0:$[M]}}const getByteLength=shallowProperty("byteLength"),isBufferLike=createSizePropertyCheck(getByteLength);var typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function isTypedArray$1(M){return nativeIsView?nativeIsView(M)&&!isDataView$1(M):isBufferLike(M)&&typedArrayPattern.test(toString$3.call(M))}const isTypedArray$2=supportsArrayBuffer?isTypedArray$1:constant(!1),getLength=shallowProperty("length");function emulatedSet(M){for(var $={},I=M.length,N=0;N":">",'"':""","'":"'","`":"`"},escape$3=createEscaper(escapeMap),unescapeMap=invert(escapeMap),unescape$1=createEscaper(unescapeMap),templateSettings=_$1.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp$1=/\\|'|\r|\n|\u2028|\u2029/g;function escapeChar(M){return"\\"+escapes[M]}var bareIdentifier=/^\s*(\w|\$)+\s*$/;function template(M,$,I){!$&&I&&($=I),$=defaults$6({},$,_$1.templateSettings);var N=RegExp([($.escape||noMatch).source,($.interpolate||noMatch).source,($.evaluate||noMatch).source].join("|")+"|$","g"),B=0,j="__p+='";M.replace(N,function(K,G,J,Z,ee){return j+=M.slice(B,ee).replace(escapeRegExp$1,escapeChar),B=ee+K.length,G?j+=`'+ ((__t=(`+G+`))==null?'':_.escape(__t))+ '`:J?j+=`'+ ((__t=(`+J+`))==null?'':__t)+ '`:Z&&(j+=`'; `+Z+` __p+='`),K}),j+=`'; `;var U=$.variable;if(U){if(!bareIdentifier.test(U))throw new Error("variable is not a bare identifier: "+U)}else j=`with(obj||{}){ `+j+`} `,U="obj";j=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');}; `+j+`return __p; `;var q;try{q=new Function(U,"_",j)}catch(K){throw K.source=j,K}var Y=function(K){return q.call(this,K,_$1)};return Y.source="function("+U+`){ `+j+"}",Y}function result(M,$,I){$=toPath($);var N=$.length;if(!N)return isFunction$4(I)?I.call(M):I;for(var B=0;B1)flatten$1(q,$-1,I,N),B=N.length;else for(var Y=0,K=q.length;Y$?(N&&(clearTimeout(N),N=null),q=G,U=M.apply(B,j),N||(B=j=null)):!N&&I.trailing!==!1&&(N=setTimeout(Y,J)),U};return K.cancel=function(){clearTimeout(N),q=0,N=B=j=null},K}function debounce$1(M,$,I){var N,B,j,U,q,Y=function(){var G=now$1()-B;$>G?N=setTimeout(Y,$-G):(N=null,I||(U=M.apply(q,j)),N||(j=q=null))},K=restArguments(function(G){return q=this,j=G,B=now$1(),N||(N=setTimeout(Y,$),I&&(U=M.apply(q,j))),U});return K.cancel=function(){clearTimeout(N),N=j=q=null},K}function wrap(M,$){return partial$1($,M)}function negate(M){return function(){return!M.apply(this,arguments)}}function compose(){var M=arguments,$=M.length-1;return function(){for(var I=$,N=M[$].apply(this,arguments);I--;)N=M[I].call(this,N);return N}}function after(M,$){return function(){if(--M<1)return $.apply(this,arguments)}}function before(M,$){var I;return function(){return--M>0&&(I=$.apply(this,arguments)),M<=1&&($=null),I}}const once$1=partial$1(before,2);function findKey$1(M,$,I){$=cb($,I);for(var N=keys$2(M),B,j=0,U=N.length;j0?0:B-1;j>=0&&j0?U=j>=0?j:Math.max(j+q,U):q=j>=0?Math.min(j+1,q):j+q+1;else if(I&&j&&q)return j=I(N,B),N[j]===B?j:-1;if(B!==B)return j=$(slice$1.call(N,U,q),isNaN$1),j>=0?j+U:-1;for(j=M>0?U:q-1;j>=0&&j0?0:q-1;for(j||(B=I[U?U[Y]:Y],Y+=M);Y>=0&&Y=3;return $(I,optimizeCb(N,j,4),B,U)}}const reduce=createReduce(1),reduceRight=createReduce(-1);function filter(M,$,I){var N=[];return $=cb($,I),each(M,function(B,j,U){$(B,j,U)&&N.push(B)}),N}function reject(M,$,I){return filter(M,negate(cb($)),I)}function every(M,$,I){$=cb($,I);for(var N=!isArrayLike(M)&&keys$2(M),B=(N||M).length,j=0;j=0}const invoke=restArguments(function(M,$,I){var N,B;return isFunction$4($)?B=$:($=toPath($),N=$.slice(0,-1),$=$[$.length-1]),map$1(M,function(j){var U=B;if(!U){if(N&&N.length&&(j=deepGet(j,N)),j==null)return;U=j[$]}return U==null?U:U.apply(j,I)})});function pluck$1(M,$){return map$1(M,property($))}function where(M,$){return filter(M,matcher($))}function max$3(M,$,I){var N=-1/0,B=-1/0,j,U;if($==null||typeof $=="number"&&typeof M[0]!="object"&&M!=null){M=isArrayLike(M)?M:values(M);for(var q=0,Y=M.length;qN&&(N=j)}else $=cb($,I),each(M,function(K,G,J){U=$(K,G,J),(U>B||U===-1/0&&N===-1/0)&&(N=K,B=U)});return N}function min$3(M,$,I){var N=1/0,B=1/0,j,U;if($==null||typeof $=="number"&&typeof M[0]!="object"&&M!=null){M=isArrayLike(M)?M:values(M);for(var q=0,Y=M.length;qq||U===void 0)return 1;if(U1&&(N=optimizeCb(N,$[1])),$=allKeys(M)):(N=keyInObj,$=flatten$1($,!1,!1),M=Object(M));for(var B=0,j=$.length;B1&&(N=$[1])):($=map$1(flatten$1($,!1,!1),String),I=function(B,j){return!contains$1($,j)}),pick(M,I,N)});function initial(M,$,I){return slice$1.call(M,0,Math.max(0,M.length-($==null||I?1:$)))}function first(M,$,I){return M==null||M.length<1?$==null||I?void 0:[]:$==null||I?M[0]:initial(M,M.length-$)}function rest(M,$,I){return slice$1.call(M,$==null||I?1:$)}function last(M,$,I){return M==null||M.length<1?$==null||I?void 0:[]:$==null||I?M[M.length-1]:rest(M,Math.max(0,M.length-$))}function compact$1(M){return filter(M,Boolean)}function flatten(M,$){return flatten$1(M,$,!1)}const difference=restArguments(function(M,$){return $=flatten$1($,!0,!0),filter(M,function(I){return!contains$1($,I)})}),without=restArguments(function(M,$){return difference(M,$)});function uniq(M,$,I,N){isBoolean$2($)||(N=I,I=$,$=!1),I!=null&&(I=cb(I,N));for(var B=[],j=[],U=0,q=getLength(M);UM(this)),this.bootingCallbacks=[],this.$app=new Vue$3(this.$app),this.$components.$root=this.$app,this.bootedCallbacks.forEach(M=>M(this)),this.bootedCallbacks=[]},component(M,$){Vue$3.component(M,$)}}});var flushPending=!1,flushing=!1,queue=[],lastFlushedIndex=-1;function scheduler(M){queueJob(M)}function queueJob(M){queue.includes(M)||queue.push(M),queueFlush()}function dequeueJob(M){let $=queue.indexOf(M);$!==-1&&$>lastFlushedIndex&&queue.splice($,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let M=0;MM.effect($,{scheduler:I=>{shouldSchedule?scheduler(I):I()}}),raw=M.raw}function overrideEffect(M){effect=M}function elementBoundEffect(M){let $=()=>{};return[N=>{let B=effect(N);return M._x_effects||(M._x_effects=new Set,M._x_runEffects=()=>{M._x_effects.forEach(j=>j())}),M._x_effects.add(B),$=()=>{B!==void 0&&(M._x_effects.delete(B),release(B))},B},()=>{$()}]}var onAttributeAddeds=[],onElRemoveds=[],onElAddeds=[];function onElAdded(M){onElAddeds.push(M)}function onElRemoved(M,$){typeof $=="function"?(M._x_cleanups||(M._x_cleanups=[]),M._x_cleanups.push($)):($=M,onElRemoveds.push($))}function onAttributesAdded(M){onAttributeAddeds.push(M)}function onAttributeRemoved(M,$,I){M._x_attributeCleanups||(M._x_attributeCleanups={}),M._x_attributeCleanups[$]||(M._x_attributeCleanups[$]=[]),M._x_attributeCleanups[$].push(I)}function cleanupAttributes(M,$){M._x_attributeCleanups&&Object.entries(M._x_attributeCleanups).forEach(([I,N])=>{($===void 0||$.includes(I))&&(N.forEach(B=>B()),delete M._x_attributeCleanups[I])})}var observer=new MutationObserver(onMutate),currentlyObserving=!1;function startObservingMutations(){observer.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),currentlyObserving=!0}function stopObservingMutations(){flushObserver(),observer.disconnect(),currentlyObserving=!1}var recordQueue=[],willProcessRecordQueue=!1;function flushObserver(){recordQueue=recordQueue.concat(observer.takeRecords()),recordQueue.length&&!willProcessRecordQueue&&(willProcessRecordQueue=!0,queueMicrotask(()=>{processRecordQueue(),willProcessRecordQueue=!1}))}function processRecordQueue(){onMutate(recordQueue),recordQueue.length=0}function mutateDom(M){if(!currentlyObserving)return M();stopObservingMutations();let $=M();return startObservingMutations(),$}var isCollecting=!1,deferredMutations=[];function deferMutations(){isCollecting=!0}function flushAndStopDeferringMutations(){isCollecting=!1,onMutate(deferredMutations),deferredMutations=[]}function onMutate(M){if(isCollecting){deferredMutations=deferredMutations.concat(M);return}let $=[],I=[],N=new Map,B=new Map;for(let j=0;jU.nodeType===1&&$.push(U)),M[j].removedNodes.forEach(U=>U.nodeType===1&&I.push(U))),M[j].type==="attributes")){let U=M[j].target,q=M[j].attributeName,Y=M[j].oldValue,K=()=>{N.has(U)||N.set(U,[]),N.get(U).push({name:q,value:U.getAttribute(q)})},G=()=>{B.has(U)||B.set(U,[]),B.get(U).push(q)};U.hasAttribute(q)&&Y===null?K():U.hasAttribute(q)?(G(),K()):G()}B.forEach((j,U)=>{cleanupAttributes(U,j)}),N.forEach((j,U)=>{onAttributeAddeds.forEach(q=>q(U,j))});for(let j of I)if(!$.includes(j)&&(onElRemoveds.forEach(U=>U(j)),j._x_cleanups))for(;j._x_cleanups.length;)j._x_cleanups.pop()();$.forEach(j=>{j._x_ignoreSelf=!0,j._x_ignore=!0});for(let j of $)I.includes(j)||j.isConnected&&(delete j._x_ignoreSelf,delete j._x_ignore,onElAddeds.forEach(U=>U(j)),j._x_ignore=!0,j._x_ignoreSelf=!0);$.forEach(j=>{delete j._x_ignoreSelf,delete j._x_ignore}),$=null,I=null,N=null,B=null}function scope(M){return mergeProxies(closestDataStack(M))}function addScopeToNode(M,$,I){return M._x_dataStack=[$,...closestDataStack(I||M)],()=>{M._x_dataStack=M._x_dataStack.filter(N=>N!==$)}}function refreshScope(M,$){let I=M._x_dataStack[0];Object.entries($).forEach(([N,B])=>{I[N]=B})}function closestDataStack(M){return M._x_dataStack?M._x_dataStack:typeof ShadowRoot=="function"&&M instanceof ShadowRoot?closestDataStack(M.host):M.parentNode?closestDataStack(M.parentNode):[]}function mergeProxies(M){let $=new Proxy({},{ownKeys:()=>Array.from(new Set(M.flatMap(I=>Object.keys(I)))),has:(I,N)=>M.some(B=>B.hasOwnProperty(N)),get:(I,N)=>(M.find(B=>{if(B.hasOwnProperty(N)){let j=Object.getOwnPropertyDescriptor(B,N);if(j.get&&j.get._x_alreadyBound||j.set&&j.set._x_alreadyBound)return!0;if((j.get||j.set)&&j.enumerable){let U=j.get,q=j.set,Y=j;U=U&&U.bind($),q=q&&q.bind($),U&&(U._x_alreadyBound=!0),q&&(q._x_alreadyBound=!0),Object.defineProperty(B,N,{...Y,get:U,set:q})}return!0}return!1})||{})[N],set:(I,N,B)=>{let j=M.find(U=>U.hasOwnProperty(N));return j?j[N]=B:M[M.length-1][N]=B,!0}});return $}function initInterceptors(M){let $=N=>typeof N=="object"&&!Array.isArray(N)&&N!==null,I=(N,B="")=>{Object.entries(Object.getOwnPropertyDescriptors(N)).forEach(([j,{value:U,enumerable:q}])=>{if(q===!1||U===void 0)return;let Y=B===""?j:`${B}.${j}`;typeof U=="object"&&U!==null&&U._x_interceptor?N[j]=U.initialize(M,Y,j):$(U)&&U!==N&&!(U instanceof Element)&&I(U,Y)})};return I(M)}function interceptor(M,$=()=>{}){let I={initialValue:void 0,_x_interceptor:!0,initialize(N,B,j){return M(this.initialValue,()=>get$3(N,B),U=>set$2(N,B,U),B,j)}};return $(I),N=>{if(typeof N=="object"&&N!==null&&N._x_interceptor){let B=I.initialize.bind(I);I.initialize=(j,U,q)=>{let Y=N.initialize(j,U,q);return I.initialValue=Y,B(j,U,q)}}else I.initialValue=N;return I}}function get$3(M,$){return $.split(".").reduce((I,N)=>I[N],M)}function set$2(M,$,I){if(typeof $=="string"&&($=$.split(".")),$.length===1)M[$[0]]=I;else{if($.length===0)throw error;return M[$[0]]||(M[$[0]]={}),set$2(M[$[0]],$.slice(1),I)}}var magics={};function magic(M,$){magics[M]=$}function injectMagics(M,$){return Object.entries(magics).forEach(([I,N])=>{Object.defineProperty(M,`$${I}`,{get(){let[B,j]=getElementBoundUtilities($);return B={interceptor,...B},onElRemoved($,j),N($,B)},enumerable:!1})}),M}function tryCatch(M,$,I,...N){try{return I(...N)}catch(B){handleError(B,M,$)}}function handleError(M,$,I=void 0){Object.assign(M,{el:$,expression:I}),console.warn(`Alpine Expression Error: ${M.message} ${I?'Expression: "'+I+`" `:""}`,$),setTimeout(()=>{throw M},0)}var shouldAutoEvaluateFunctions=!0;function dontAutoEvaluateFunctions(M){let $=shouldAutoEvaluateFunctions;shouldAutoEvaluateFunctions=!1,M(),shouldAutoEvaluateFunctions=$}function evaluate(M,$,I={}){let N;return evaluateLater(M,$)(B=>N=B,I),N}function evaluateLater(...M){return theEvaluatorFunction(...M)}var theEvaluatorFunction=normalEvaluator;function setEvaluator(M){theEvaluatorFunction=M}function normalEvaluator(M,$){let I={};injectMagics(I,M);let N=[I,...closestDataStack(M)],B=typeof $=="function"?generateEvaluatorFromFunction(N,$):generateEvaluatorFromString(N,$,M);return tryCatch.bind(null,M,$,B)}function generateEvaluatorFromFunction(M,$){return(I=()=>{},{scope:N={},params:B=[]}={})=>{let j=$.apply(mergeProxies([N,...M]),B);runIfTypeOfFunction(I,j)}}var evaluatorMemo={};function generateFunctionFromString(M,$){if(evaluatorMemo[M])return evaluatorMemo[M];let I=Object.getPrototypeOf(async function(){}).constructor,N=/^[\n\s]*if.*\(.*\)/.test(M)||/^(let|const)\s/.test(M)?`(async()=>{ ${M} })()`:M,j=(()=>{try{return new I(["__self","scope"],`with (scope) { __self.result = ${N} }; __self.finished = true; return __self.result;`)}catch(U){return handleError(U,$,M),Promise.resolve()}})();return evaluatorMemo[M]=j,j}function generateEvaluatorFromString(M,$,I){let N=generateFunctionFromString($,I);return(B=()=>{},{scope:j={},params:U=[]}={})=>{N.result=void 0,N.finished=!1;let q=mergeProxies([j,...M]);if(typeof N=="function"){let Y=N(N,q).catch(K=>handleError(K,I,$));N.finished?(runIfTypeOfFunction(B,N.result,q,U,I),N.result=void 0):Y.then(K=>{runIfTypeOfFunction(B,K,q,U,I)}).catch(K=>handleError(K,I,$)).finally(()=>N.result=void 0)}}}function runIfTypeOfFunction(M,$,I,N,B){if(shouldAutoEvaluateFunctions&&typeof $=="function"){let j=$.apply(I,N);j instanceof Promise?j.then(U=>runIfTypeOfFunction(M,U,I,N)).catch(U=>handleError(U,B,$)):M(j)}else typeof $=="object"&&$ instanceof Promise?$.then(j=>M(j)):M($)}var prefixAsString="x-";function prefix(M=""){return prefixAsString+M}function setPrefix(M){prefixAsString=M}var directiveHandlers={};function directive$1(M,$){return directiveHandlers[M]=$,{before(I){if(!directiveHandlers[I]){console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");return}const N=directiveOrder.indexOf(I);directiveOrder.splice(N>=0?N:directiveOrder.indexOf("DEFAULT"),0,M)}}}function directives$1(M,$,I){if($=Array.from($),M._x_virtualDirectives){let j=Object.entries(M._x_virtualDirectives).map(([q,Y])=>({name:q,value:Y})),U=attributesOnly(j);j=j.map(q=>U.find(Y=>Y.name===q.name)?{name:`x-bind:${q.name}`,value:`"${q.value}"`}:q),$=$.concat(j)}let N={};return $.map(toTransformedAttributes((j,U)=>N[j]=U)).filter(outNonAlpineAttributes).map(toParsedDirectives(N,I)).sort(byPriority).map(j=>getDirectiveHandler(M,j))}function attributesOnly(M){return Array.from(M).map(toTransformedAttributes()).filter($=>!outNonAlpineAttributes($))}var isDeferringHandlers=!1,directiveHandlerStacks=new Map,currentHandlerStackKey=Symbol();function deferHandlingDirectives(M){isDeferringHandlers=!0;let $=Symbol();currentHandlerStackKey=$,directiveHandlerStacks.set($,[]);let I=()=>{for(;directiveHandlerStacks.get($).length;)directiveHandlerStacks.get($).shift()();directiveHandlerStacks.delete($)},N=()=>{isDeferringHandlers=!1,I()};M(I),N()}function getElementBoundUtilities(M){let $=[],I=q=>$.push(q),[N,B]=elementBoundEffect(M);return $.push(B),[{Alpine:alpine_default,effect:N,cleanup:I,evaluateLater:evaluateLater.bind(evaluateLater,M),evaluate:evaluate.bind(evaluate,M)},()=>$.forEach(q=>q())]}function getDirectiveHandler(M,$){let I=()=>{},N=directiveHandlers[$.type]||I,[B,j]=getElementBoundUtilities(M);onAttributeRemoved(M,$.original,j);let U=()=>{M._x_ignore||M._x_ignoreSelf||(N.inline&&N.inline(M,$,B),N=N.bind(N,M,$,B),isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(N):N())};return U.runCleanups=j,U}var startingWith=(M,$)=>({name:I,value:N})=>(I.startsWith(M)&&(I=I.replace(M,$)),{name:I,value:N}),into=M=>M;function toTransformedAttributes(M=()=>{}){return({name:$,value:I})=>{let{name:N,value:B}=attributeTransformers.reduce((j,U)=>U(j),{name:$,value:I});return N!==$&&M(N,$),{name:N,value:B}}}var attributeTransformers=[];function mapAttributes(M){attributeTransformers.push(M)}function outNonAlpineAttributes({name:M}){return alpineAttributeRegex().test(M)}var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);function toParsedDirectives(M,$){return({name:I,value:N})=>{let B=I.match(alpineAttributeRegex()),j=I.match(/:([a-zA-Z0-9\-:]+)/),U=I.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],q=$||M[I]||I;return{type:B?B[1]:null,value:j?j[1]:null,modifiers:U.map(Y=>Y.replace(".","")),expression:N,original:q}}}var DEFAULT="DEFAULT",directiveOrder=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",DEFAULT,"teleport"];function byPriority(M,$){let I=directiveOrder.indexOf(M.type)===-1?DEFAULT:M.type,N=directiveOrder.indexOf($.type)===-1?DEFAULT:$.type;return directiveOrder.indexOf(I)-directiveOrder.indexOf(N)}function dispatch(M,$,I={}){M.dispatchEvent(new CustomEvent($,{detail:I,bubbles:!0,composed:!0,cancelable:!0}))}function walk(M,$){if(typeof ShadowRoot=="function"&&M instanceof ShadowRoot){Array.from(M.children).forEach(B=>walk(B,$));return}let I=!1;if($(M,()=>I=!0),I)return;let N=M.firstElementChild;for(;N;)walk(N,$),N=N.nextElementSibling}function warn$3(M,...$){console.warn(`Alpine Warning: ${M}`,...$)}function start(){document.body||warn$3("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's `