@zipify/wysiwyg 3.4.1-dev → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/wysiwyg.cjs DELETED
@@ -1,16 +0,0 @@
1
- "use strict";var t=require("jsdom");
2
- /*!
3
- * Vue.js v2.7.14
4
- * (c) 2014-2022 Evan You
5
- * Released under the MIT License.
6
- */
7
- var e=Object.freeze({}),n=Array.isArray;function r(t){return null==t}function o(t){return null!=t}function i(t){return!0===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function a(t){return"function"==typeof t}function u(t){return null!==t&&"object"==typeof t}var l=Object.prototype.toString;function c(t){return l.call(t).slice(8,-1)}function f(t){return"[object Object]"===l.call(t)}function p(t){return"[object RegExp]"===l.call(t)}function d(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function h(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function m(t){return null==t?"":Array.isArray(t)||f(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function g(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}var y=v("slot,component",!0),b=v("key,ref,slot,slot-scope,is");function D(t,e){var n=t.length;if(n){if(e===t[n-1])return void(t.length=n-1);var r=t.indexOf(e);if(r>-1)return t.splice(r,1)}}var _=Object.prototype.hasOwnProperty;function w(t,e){return _.call(t,e)}function k(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var E=/-(\w)/g,C=k((function(t){return t.replace(E,(function(t,e){return e?e.toUpperCase():""}))})),x=k((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),A=/\B([A-Z])/g,S=k((function(t){return t.replace(A,"-$1").toLowerCase()}));var O=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function N(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function T(t,e){for(var n in e)t[n]=e[n];return t}function M(t){for(var e={},n=0;n<t.length;n++)t[n]&&T(e,t[n]);return e}function F(t,e,n){}var I=function(t,e,n){return!1},B=function(t){return t};function $(t,e){if(t===e)return!0;var n=u(t),r=u(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var o=Array.isArray(t),i=Array.isArray(e);if(o&&i)return t.length===e.length&&t.every((function(t,n){return $(t,e[n])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(o||i)return!1;var s=Object.keys(t),a=Object.keys(e);return s.length===a.length&&s.every((function(n){return $(t[n],e[n])}))}catch(t){return!1}}function R(t,e){for(var n=0;n<t.length;n++)if($(t[n],e))return n;return-1}function L(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function P(t,e){return t===e?0===t&&1/t!=1/e:t==t||e==e}var z="data-server-rendered",j=["component","directive","filter"],V=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],H={optionMergeStrategies:Object.create(null),silent:!1,productionTip:"production"!==process.env.NODE_ENV,devtools:"production"!==process.env.NODE_ENV,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:I,isReservedAttr:I,isUnknownElement:I,getTagNamespace:F,parsePlatformTagName:B,mustUseProp:I,async:!0,_lifecycleHooks:V},W=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function U(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function q(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var K=new RegExp("[^".concat(W.source,".$_\\d]"));var J="__proto__"in{},G="undefined"!=typeof window,Y=G&&window.navigator.userAgent.toLowerCase(),X=Y&&/msie|trident/.test(Y),Z=Y&&Y.indexOf("msie 9.0")>0,Q=Y&&Y.indexOf("edge/")>0;Y&&Y.indexOf("android");var tt,et=Y&&/iphone|ipad|ipod|ios/.test(Y),nt=Y&&Y.match(/firefox\/(\d+)/),rt={}.watch,ot=!1;if(G)try{var it={};Object.defineProperty(it,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var st=function(){return void 0===tt&&(tt=!G&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),tt},at=G&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ut(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,ct="undefined"!=typeof Symbol&&ut(Symbol)&&"undefined"!=typeof Reflect&&ut(Reflect.ownKeys);lt="undefined"!=typeof Set&&ut(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ft=null;function pt(t){void 0===t&&(t=null),t||ft&&ft._scope.off(),ft=t,t&&t._scope.on()}var dt=function(){function t(t,e,n,r,o,i,s,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,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=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),ht=function(t){void 0===t&&(t="");var e=new dt;return e.text=t,e.isComment=!0,e};function mt(t){return new dt(void 0,void 0,void 0,String(t))}function gt(t){var e=new dt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var vt=function(){return vt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},vt.apply(this,arguments)},yt=0,bt=[],Dt=function(){function t(){this._pending=!1,this.id=yt++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,bt.push(this))},t.prototype.depend=function(e){t.target&&(t.target.addDep(this),"production"!==process.env.NODE_ENV&&e&&t.target.onTrack&&t.target.onTrack(vt({effect:t.target},e)))},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));"production"===process.env.NODE_ENV||H.async||e.sort((function(t,e){return t.id-e.id}));for(var n=0,r=e.length;n<r;n++){var o=e[n];"production"!==process.env.NODE_ENV&&t&&o.onTrigger&&o.onTrigger(vt({effect:e[n]},t)),o.update()}},t}();Dt.target=null;var _t=[];function wt(t){_t.push(t),Dt.target=t}function kt(){_t.pop(),Dt.target=_t[_t.length-1]}var Et=Array.prototype,Ct=Object.create(Et);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(t){var e=Et[t];q(Ct,t,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o,i=e.apply(this,n),s=this.__ob__;switch(t){case"push":case"unshift":o=n;break;case"splice":o=n.slice(2)}return o&&s.observeArray(o),"production"!==process.env.NODE_ENV?s.dep.notify({type:"array mutation",target:this,key:t}):s.dep.notify(),i}))}));var xt=Object.getOwnPropertyNames(Ct),At={},St=!0;function Ot(t){St=t}var Nt={notify:F,depend:F,addSub:F,removeSub:F},Tt=function(){function t(t,e,r){if(void 0===e&&(e=!1),void 0===r&&(r=!1),this.value=t,this.shallow=e,this.mock=r,this.dep=r?Nt:new Dt,this.vmCount=0,q(t,"__ob__",this),n(t)){if(!r)if(J)t.__proto__=Ct;else for(var o=0,i=xt.length;o<i;o++){q(t,a=xt[o],Ct[a])}e||this.observeArray(t)}else{var s=Object.keys(t);for(o=0;o<s.length;o++){var a;Ft(t,a=s[o],At,void 0,e,r)}}}return t.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)Mt(t[e],!1,this.mock)},t}();function Mt(t,e,r){return t&&w(t,"__ob__")&&t.__ob__ instanceof Tt?t.__ob__:!St||!r&&st()||!n(t)&&!f(t)||!Object.isExtensible(t)||t.__v_skip||Ht(t)||t instanceof dt?void 0:new Tt(t,e,r)}function Ft(t,e,r,o,i,s){var a=new Dt,u=Object.getOwnPropertyDescriptor(t,e);if(!u||!1!==u.configurable){var l=u&&u.get,c=u&&u.set;l&&!c||r!==At&&2!==arguments.length||(r=t[e]);var f=!i&&Mt(r,!1,s);return Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var o=l?l.call(t):r;return Dt.target&&("production"!==process.env.NODE_ENV?a.depend({target:t,type:"get",key:e}):a.depend(),f&&(f.dep.depend(),n(o)&&$t(o))),Ht(o)&&!i?o.value:o},set:function(n){var u=l?l.call(t):r;if(P(u,n)){if("production"!==process.env.NODE_ENV&&o&&o(),c)c.call(t,n);else{if(l)return;if(!i&&Ht(u)&&!Ht(n))return void(u.value=n);r=n}f=!i&&Mt(n,!1,s),"production"!==process.env.NODE_ENV?a.notify({type:"set",target:t,key:e,newValue:n,oldValue:u}):a.notify()}}}),a}}function It(t,e,o){if("production"!==process.env.NODE_ENV&&(r(t)||s(t))&&Kn("Cannot set reactive property on undefined, null, or primitive value: ".concat(t)),!jt(t)){var i=t.__ob__;return n(t)&&d(e)?(t.length=Math.max(t.length,e),t.splice(e,1,o),i&&!i.shallow&&i.mock&&Mt(o,!1,!0),o):e in t&&!(e in Object.prototype)?(t[e]=o,o):t._isVue||i&&i.vmCount?("production"!==process.env.NODE_ENV&&Kn("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),o):i?(Ft(i.value,e,o,void 0,i.shallow,i.mock),"production"!==process.env.NODE_ENV?i.dep.notify({type:"add",target:t,key:e,newValue:o,oldValue:void 0}):i.dep.notify(),o):(t[e]=o,o)}"production"!==process.env.NODE_ENV&&Kn('Set operation on key "'.concat(e,'" failed: target is readonly.'))}function Bt(t,e){if("production"!==process.env.NODE_ENV&&(r(t)||s(t))&&Kn("Cannot delete reactive property on undefined, null, or primitive value: ".concat(t)),n(t)&&d(e))t.splice(e,1);else{var o=t.__ob__;t._isVue||o&&o.vmCount?"production"!==process.env.NODE_ENV&&Kn("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):jt(t)?"production"!==process.env.NODE_ENV&&Kn('Delete operation on key "'.concat(e,'" failed: target is readonly.')):w(t,e)&&(delete t[e],o&&("production"!==process.env.NODE_ENV?o.dep.notify({type:"delete",target:t,key:e}):o.dep.notify()))}}function $t(t){for(var e=void 0,r=0,o=t.length;r<o;r++)(e=t[r])&&e.__ob__&&e.__ob__.dep.depend(),n(e)&&$t(e)}function Rt(t){return Lt(t,!0),q(t,"__v_isShallow",!0),t}function Lt(t,e){if(!jt(t)){if("production"!==process.env.NODE_ENV){n(t)&&Kn("Avoid using Array as root value for ".concat(e?"shallowReactive()":"reactive()"," as it cannot be tracked in watch() or watchEffect(). Use ").concat(e?"shallowRef()":"ref()"," instead. This is a Vue-2-only limitation."));var r=t&&t.__ob__;r&&r.shallow!==e&&Kn("Target is already a ".concat(r.shallow?"":"non-","shallow reactive object, and cannot be converted to ").concat(e?"":"non-","shallow."))}var o=Mt(t,e,st());"production"===process.env.NODE_ENV||o||((null==t||s(t))&&Kn("value cannot be made reactive: ".concat(String(t))),("Map"===(i=c(t))||"WeakMap"===i||"Set"===i||"WeakSet"===i)&&Kn("Vue 2 does not support reactive collection types such as Map or Set."))}var i}function Pt(t){return jt(t)?Pt(t.__v_raw):!(!t||!t.__ob__)}function zt(t){return!(!t||!t.__v_isShallow)}function jt(t){return!(!t||!t.__v_isReadonly)}var Vt="__v_isRef";function Ht(t){return!(!t||!0!==t.__v_isRef)}function Wt(t){return function(t,e){if(Ht(t))return t;var n={};return q(n,Vt,!0),q(n,"__v_isShallow",e),q(n,"dep",Ft(n,"value",t,null,e,st())),n}(t,!1)}function Ut(t){return Ht(t)?t.value:t}function qt(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){var t=e[n];if(Ht(t))return t.value;var r=t&&t.__ob__;return r&&r.dep.depend(),t},set:function(t){var r=e[n];Ht(r)&&!Ht(t)?r.value=t:e[n]=t}})}function Kt(t,e,n){var r=t[e];if(Ht(r))return r;var o={get value(){var r=t[e];return void 0===r?n:r},set value(n){t[e]=n}};return q(o,Vt,!0),o}function Jt(t,e){var n,r,o=a(t);o?(n=t,r="production"!==process.env.NODE_ENV?function(){Kn("Write operation failed: computed value is readonly")}:F):(n=t.get,r=t.set);var i=st()?null:new ln(ft,n,F,{lazy:!0});"production"!==process.env.NODE_ENV&&i&&e&&(i.onTrack=e.onTrack,i.onTrigger=e.onTrigger);var s={effect:i,get value(){return i?(i.dirty&&i.evaluate(),Dt.target&&("production"!==process.env.NODE_ENV&&Dt.target.onTrack&&Dt.target.onTrack({effect:Dt.target,target:s,type:"get",key:"value"}),i.depend()),i.value):n()},set value(t){r(t)}};return q(s,Vt,!0),q(s,"__v_isReadonly",o),s}var Gt,Yt="watcher",Xt="".concat(Yt," callback"),Zt="".concat(Yt," getter"),Qt="".concat(Yt," cleanup"),te={};function ee(t,r,o){return"production"!==process.env.NODE_ENV&&"function"!=typeof r&&Kn("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),function(t,r,o){var i=void 0===o?e:o,s=i.immediate,u=i.deep,l=i.flush,c=void 0===l?"pre":l,f=i.onTrack,p=i.onTrigger;"production"===process.env.NODE_ENV||r||(void 0!==s&&Kn('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==u&&Kn('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));var d,h,m=function(t){Kn("Invalid watch source: ".concat(t,". A watch source can only be a getter/effect ")+"function, a ref, a reactive object, or an array of these types.")},g=ft,v=function(t,e,n){return void 0===n&&(n=null),Ve(t,null,n,g,e)},y=!1,b=!1;Ht(t)?(d=function(){return t.value},y=zt(t)):Pt(t)?(d=function(){return t.__ob__.dep.depend(),t},u=!0):n(t)?(b=!0,y=t.some((function(t){return Pt(t)||zt(t)})),d=function(){return t.map((function(t){return Ht(t)?t.value:Pt(t)?nn(t):a(t)?v(t,Zt):void("production"!==process.env.NODE_ENV&&m(t))}))}):a(t)?d=r?function(){return v(t,Zt)}:function(){if(!g||!g._isDestroyed)return h&&h(),v(t,Yt,[_])}:(d=F,"production"!==process.env.NODE_ENV&&m(t));if(r&&u){var D=d;d=function(){return nn(D())}}var _=function(t){h=w.onStop=function(){v(t,Qt)}};if(st())return _=F,r?s&&v(r,Xt,[d(),b?[]:void 0,_]):d(),F;var w=new ln(ft,d,F,{lazy:!0});w.noRecurse=!r;var k=b?[]:te;w.run=function(){if(w.active)if(r){var t=w.get();(u||y||(b?t.some((function(t,e){return P(t,k[e])})):P(t,k)))&&(h&&h(),v(r,Xt,[t,k===te?void 0:k,_]),k=t)}else w.get()},"sync"===c?w.update=w.run:"post"===c?(w.post=!0,w.update=function(){return In(w)}):w.update=function(){if(g&&g===ft&&!g._isMounted){var t=g._preWatchers||(g._preWatchers=[]);t.indexOf(w)<0&&t.push(w)}else In(w)};"production"!==process.env.NODE_ENV&&(w.onTrack=f,w.onTrigger=p);r?s?w.run():k=w.get():"post"===c&&g?g.$once("hook:mounted",(function(){return w.get()})):w.get();return function(){w.teardown()}}(t,r,o)}var ne=function(){function t(t){void 0===t&&(t=!1),this.detached=t,this.active=!0,this.effects=[],this.cleanups=[],this.parent=Gt,!t&&Gt&&(this.index=(Gt.scopes||(Gt.scopes=[])).push(this)-1)}return t.prototype.run=function(t){if(this.active){var e=Gt;try{return Gt=this,t()}finally{Gt=e}}else"production"!==process.env.NODE_ENV&&Kn("cannot run an inactive effect scope.")},t.prototype.on=function(){Gt=this},t.prototype.off=function(){Gt=this.parent},t.prototype.stop=function(t){if(this.active){var e=void 0,n=void 0;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].teardown();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){var r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0,this.active=!1}},t}();var re=k((function(t){var e="&"===t.charAt(0),n="~"===(t=e?t.slice(1):t).charAt(0),r="!"===(t=n?t.slice(1):t).charAt(0);return{name:t=r?t.slice(1):t,once:n,capture:r,passive:e}}));function oe(t,e){function r(){var t=r.fns;if(!n(t))return Ve(t,null,arguments,e,"v-on handler");for(var o=t.slice(),i=0;i<o.length;i++)Ve(o[i],null,arguments,e,"v-on handler")}return r.fns=t,r}function ie(t,e,n,o,s,a){var u,l,c,f;for(u in t)l=t[u],c=e[u],f=re(u),r(l)?"production"!==process.env.NODE_ENV&&Kn('Invalid handler for event "'.concat(f.name,'": got ')+String(l),a):r(c)?(r(l.fns)&&(l=t[u]=oe(l,a)),i(f.once)&&(l=t[u]=s(f.name,l,f.capture)),n(f.name,l,f.capture,f.passive,f.params)):l!==c&&(c.fns=l,t[u]=c);for(u in e)r(t[u])&&o((f=re(u)).name,e[u],f.capture)}function se(t,e,n){var s;t instanceof dt&&(t=t.data.hook||(t.data.hook={}));var a=t[e];function u(){n.apply(this,arguments),D(s.fns,u)}r(a)?s=oe([u]):o(a.fns)&&i(a.merged)?(s=a).fns.push(u):s=oe([a,u]),s.merged=!0,t[e]=s}function ae(t,e,n,r,i){if(o(e)){if(w(e,n))return t[n]=e[n],i||delete e[n],!0;if(w(e,r))return t[n]=e[r],i||delete e[r],!0}return!1}function ue(t){return s(t)?[mt(t)]:n(t)?ce(t):void 0}function le(t){return o(t)&&o(t.text)&&!1===t.isComment}function ce(t,e){var a,u,l,c,f=[];for(a=0;a<t.length;a++)r(u=t[a])||"boolean"==typeof u||(c=f[l=f.length-1],n(u)?u.length>0&&(le((u=ce(u,"".concat(e||"","_").concat(a)))[0])&&le(c)&&(f[l]=mt(c.text+u[0].text),u.shift()),f.push.apply(f,u)):s(u)?le(c)?f[l]=mt(c.text+u):""!==u&&f.push(mt(u)):le(u)&&le(c)?f[l]=mt(c.text+u.text):(i(t._isVList)&&o(u.tag)&&r(u.key)&&o(e)&&(u.key="__vlist".concat(e,"_").concat(a,"__")),f.push(u)));return f}function fe(t,e){var r,i,s,a,l=null;if(n(t)||"string"==typeof t)for(l=new Array(t.length),r=0,i=t.length;r<i;r++)l[r]=e(t[r],r);else if("number"==typeof t)for(l=new Array(t),r=0;r<t;r++)l[r]=e(r+1,r);else if(u(t))if(ct&&t[Symbol.iterator]){l=[];for(var c=t[Symbol.iterator](),f=c.next();!f.done;)l.push(e(f.value,l.length)),f=c.next()}else for(s=Object.keys(t),l=new Array(s.length),r=0,i=s.length;r<i;r++)a=s[r],l[r]=e(t[a],a,r);return o(l)||(l=[]),l._isVList=!0,l}function pe(t,e,n,r){var o,i=this.$scopedSlots[t];i?(n=n||{},r&&("production"===process.env.NODE_ENV||u(r)||Kn("slot v-bind without argument expects an Object",this),n=T(T({},r),n)),o=i(n)||(a(e)?e():e)):o=this.$slots[t]||(a(e)?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function de(t){return sr(this.$options,"filters",t,!0)||B}function he(t,e){return n(t)?-1===t.indexOf(e):t!==e}function me(t,e,n,r,o){var i=H.keyCodes[e]||n;return o&&r&&!H.keyCodes[e]?he(o,r):i?he(i,t):r?S(r)!==e:void 0===t}function ge(t,e,r,o,i){if(r)if(u(r)){n(r)&&(r=M(r));var s=void 0,a=function(n){if("class"===n||"style"===n||b(n))s=t;else{var a=t.attrs&&t.attrs.type;s=o||H.mustUseProp(e,a,n)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var u=C(n),l=S(n);u in s||l in s||(s[n]=r[n],i&&((t.on||(t.on={}))["update:".concat(n)]=function(t){r[n]=t}))};for(var l in r)a(l)}else"production"!==process.env.NODE_ENV&&Kn("v-bind without argument expects an Object or Array value",this);return t}function ve(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||be(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),"__static__".concat(t),!1),r}function ye(t,e,n){return be(t,"__once__".concat(e).concat(n?"_".concat(n):""),!0),t}function be(t,e,r){if(n(t))for(var o=0;o<t.length;o++)t[o]&&"string"!=typeof t[o]&&De(t[o],"".concat(e,"_").concat(o),r);else De(t,e,r)}function De(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function _e(t,e){if(e)if(f(e)){var n=t.on=t.on?T({},t.on):{};for(var r in e){var o=n[r],i=e[r];n[r]=o?[].concat(o,i):i}}else"production"!==process.env.NODE_ENV&&Kn("v-on without argument expects an Object value",this);return t}function we(t,e,r,o){e=e||{$stable:!r};for(var i=0;i<t.length;i++){var s=t[i];n(s)?we(s,e,r):s&&(s.proxy&&(s.fn.proxy=!0),e[s.key]=s.fn)}return o&&(e.$key=o),e}function ke(t,e){for(var n=0;n<e.length;n+=2){var r=e[n];"string"==typeof r&&r?t[e[n]]=e[n+1]:"production"!==process.env.NODE_ENV&&""!==r&&null!==r&&Kn("Invalid value for dynamic directive argument (expected string or null): ".concat(r),this)}return t}function Ee(t,e){return"string"==typeof t?e+t:t}function Ce(t){t._o=ye,t._n=g,t._s=m,t._l=fe,t._t=pe,t._q=$,t._i=R,t._m=ve,t._f=de,t._k=me,t._b=ge,t._v=mt,t._e=ht,t._u=we,t._g=_e,t._d=ke,t._p=Ee}function xe(t,e){if(!t||!t.length)return{};for(var n={},r=0,o=t.length;r<o;r++){var i=t[r],s=i.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,i.context!==e&&i.fnContext!==e||!s||null==s.slot)(n.default||(n.default=[])).push(i);else{var a=s.slot,u=n[a]||(n[a]=[]);"template"===i.tag?u.push.apply(u,i.children||[]):u.push(i)}}for(var l in n)n[l].every(Ae)&&delete n[l];return n}function Ae(t){return t.isComment&&!t.asyncFactory||" "===t.text}function Se(t){return t.isComment&&t.asyncFactory}function Oe(t,n,r,o){var i,s=Object.keys(r).length>0,a=n?!!n.$stable:!s,u=n&&n.$key;if(n){if(n._normalized)return n._normalized;if(a&&o&&o!==e&&u===o.$key&&!s&&!o.$hasNormal)return o;for(var l in i={},n)n[l]&&"$"!==l[0]&&(i[l]=Ne(t,r,l,n[l]))}else i={};for(var c in r)c in i||(i[c]=Te(r,c));return n&&Object.isExtensible(n)&&(n._normalized=i),q(i,"$stable",a),q(i,"$key",u),q(i,"$hasNormal",s),i}function Ne(t,e,r,o){var i=function(){var e=ft;pt(t);var r=arguments.length?o.apply(null,arguments):o({}),i=(r=r&&"object"==typeof r&&!n(r)?[r]:ue(r))&&r[0];return pt(e),r&&(!i||1===r.length&&i.isComment&&!Se(i))?void 0:r};return o.proxy&&Object.defineProperty(e,r,{get:i,enumerable:!0,configurable:!0}),i}function Te(t,e){return function(){return t[e]}}function Me(t){var n=t.$options,r=n.setup;if(r){var o=t._setupContext=function(t){var n=!1;return{get attrs(){if(!t._attrsProxy){var n=t._attrsProxy={};q(n,"_v_attr_proxy",!0),Fe(n,t.$attrs,e,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||Fe(t._listenersProxy={},t.$listeners,e,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||Be(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:O(t.$emit,t),expose:function(e){"production"!==process.env.NODE_ENV&&(n&&Kn("expose() should be called only once per setup().",t),n=!0),e&&Object.keys(e).forEach((function(n){return qt(t,e,n)}))}}}(t);pt(t),wt();var i=Ve(r,null,[t._props||Rt({}),o],t,"setup");if(kt(),pt(),a(i))n.render=i;else if(u(i))if("production"!==process.env.NODE_ENV&&i instanceof dt&&Kn("setup() should not return VNodes directly - return a render function instead."),t._setupState=i,i.__sfc){var s=t._setupProxy={};for(var l in i)"__sfc"!==l&&qt(s,i,l)}else for(var l in i)U(l)?"production"!==process.env.NODE_ENV&&Kn("Avoid using variables that start with _ or $ in setup()."):qt(t,i,l);else"production"!==process.env.NODE_ENV&&void 0!==i&&Kn("setup() should return an object. Received: ".concat(null===i?"null":typeof i))}}function Fe(t,e,n,r,o){var i=!1;for(var s in e)s in t?e[s]!==n[s]&&(i=!0):(i=!0,Ie(t,s,r,o));for(var s in t)s in e||(i=!0,delete t[s]);return i}function Ie(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function Be(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var $e=null;function Re(t,e){return(t.__esModule||ct&&"Module"===t[Symbol.toStringTag])&&(t=t.default),u(t)?e.extend(t):t}function Le(t){if(n(t))for(var e=0;e<t.length;e++){var r=t[e];if(o(r)&&(o(r.componentOptions)||Se(r)))return r}}function Pe(t,e,r,l,c,f){return(n(r)||s(r))&&(c=l,l=r,r=void 0),i(f)&&(c=2),function(t,e,r,i,l){if(o(r)&&o(r.__ob__))return"production"!==process.env.NODE_ENV&&Kn("Avoid using observed data object as vnode data: ".concat(JSON.stringify(r),"\n")+"Always create fresh vnode data objects in each render!",t),ht();o(r)&&o(r.is)&&(e=r.is);if(!e)return ht();"production"!==process.env.NODE_ENV&&o(r)&&o(r.key)&&!s(r.key)&&Kn("Avoid using non-primitive value as key, use string/number value instead.",t);n(i)&&a(i[0])&&((r=r||{}).scopedSlots={default:i[0]},i.length=0);2===l?i=ue(i):1===l&&(i=function(t){for(var e=0;e<t.length;e++)if(n(t[e]))return Array.prototype.concat.apply([],t);return t}(i));var c,f;if("string"==typeof e){var p=void 0;f=t.$vnode&&t.$vnode.ns||H.getTagNamespace(e),H.isReservedTag(e)?("production"!==process.env.NODE_ENV&&o(r)&&o(r.nativeOn)&&"component"!==r.tag&&Kn("The .native modifier for v-on is only valid on components but it was used on <".concat(e,">."),t),c=new dt(H.parsePlatformTagName(e),r,i,void 0,void 0,t)):c=r&&r.pre||!o(p=sr(t.$options,"components",e))?new dt(e,r,i,void 0,void 0,t):Hn(p,r,t,i,e)}else c=Hn(e,r,t,i);return n(c)?c:o(c)?(o(f)&&ze(c,f),o(r)&&function(t){u(t.style)&&nn(t.style);u(t.class)&&nn(t.class)}(r),c):ht()}(t,e,r,l,c)}function ze(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),o(t.children))for(var s=0,a=t.children.length;s<a;s++){var u=t.children[s];o(u.tag)&&(r(u.ns)||i(n)&&"svg"!==u.tag)&&ze(u,e,n)}}function je(t,e,n){wt();try{if(e)for(var r=e;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,t,e,n))return}catch(t){He(t,r,"errorCaptured hook")}}He(t,e,n)}finally{kt()}}function Ve(t,e,n,r,o){var i;try{(i=n?t.apply(e,n):t.call(e))&&!i._isVue&&h(i)&&!i._handled&&(i.catch((function(t){return je(t,r,o+" (Promise/async)")})),i._handled=!0)}catch(t){je(t,r,o)}return i}function He(t,e,n){if(H.errorHandler)try{return H.errorHandler.call(null,t,e,n)}catch(e){e!==t&&We(e,null,"config.errorHandler")}We(t,e,n)}function We(t,e,n){if("production"!==process.env.NODE_ENV&&Kn("Error in ".concat(n,': "').concat(t.toString(),'"'),e),!G||"undefined"==typeof console)throw t;console.error(t)}var Ue,qe=!1,Ke=[],Je=!1;function Ge(){Je=!1;var t=Ke.slice(0);Ke.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!=typeof Promise&&ut(Promise)){var Ye=Promise.resolve();Ue=function(){Ye.then(Ge),et&&setTimeout(F)},qe=!0}else if(X||"undefined"==typeof MutationObserver||!ut(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Ue="undefined"!=typeof setImmediate&&ut(setImmediate)?function(){setImmediate(Ge)}:function(){setTimeout(Ge,0)};else{var Xe=1,Ze=new MutationObserver(Ge),Qe=document.createTextNode(String(Xe));Ze.observe(Qe,{characterData:!0}),Ue=function(){Xe=(Xe+1)%2,Qe.data=String(Xe)},qe=!0}function tn(t,e){var n;if(Ke.push((function(){if(t)try{t.call(e)}catch(t){je(t,e,"nextTick")}else n&&n(e)})),Je||(Je=!0,Ue()),!t&&"undefined"!=typeof Promise)return new Promise((function(t){n=t}))}var en=new lt;function nn(t){return rn(t,en),en.clear(),t}function rn(t,e){var r,o,i=n(t);if(!(!i&&!u(t)||t.__v_skip||Object.isFrozen(t)||t instanceof dt)){if(t.__ob__){var s=t.__ob__.dep.id;if(e.has(s))return;e.add(s)}if(i)for(r=t.length;r--;)rn(t[r],e);else if(Ht(t))rn(t.value,e);else for(r=(o=Object.keys(t)).length;r--;)rn(t[o[r]],e)}}var on,sn,an,un=0,ln=function(){function t(t,e,n,r,o){var i,s;i=this,void 0===(s=Gt&&!Gt._vm?Gt:t?t._scope:void 0)&&(s=Gt),s&&s.active&&s.effects.push(i),(this.vm=t)&&o&&(t._watcher=this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before,"production"!==process.env.NODE_ENV&&(this.onTrack=r.onTrack,this.onTrigger=r.onTrigger)):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++un,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new lt,this.newDepIds=new lt,this.expression="production"!==process.env.NODE_ENV?e.toString():"",a(e)?this.getter=e:(this.getter=function(t){if(!K.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}(e),this.getter||(this.getter=F,"production"!==process.env.NODE_ENV&&Kn('Failed watching path: "'.concat(e,'" ')+"Watcher only accepts simple dot-delimited paths. For full control, use a function instead.",t))),this.value=this.lazy?void 0:this.get()}return t.prototype.get=function(){var t;wt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;je(t,e,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&nn(t),kt(),this.cleanupDeps()}return t},t.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},t.prototype.cleanupDeps=function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},t.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():In(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||u(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');Ve(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&D(this.vm._scope.effects,this),this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}();if("production"!==process.env.NODE_ENV){var cn=G&&window.performance;cn&&cn.mark&&cn.measure&&cn.clearMarks&&cn.clearMeasures&&(on=function(t){return cn.mark(t)},sn=function(t,e,n){cn.measure(t,e,n),cn.clearMarks(e),cn.clearMarks(n)})}function fn(t,e){an.$on(t,e)}function pn(t,e){an.$off(t,e)}function dn(t,e){var n=an;return function r(){var o=e.apply(null,arguments);null!==o&&n.$off(t,r)}}function hn(t,e,n){an=t,ie(e,n||{},fn,pn,dn,t),an=void 0}var mn=null,gn=!1;function vn(t){var e=mn;return mn=t,function(){mn=e}}function yn(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function bn(t,e){if(e){if(t._directInactive=!1,yn(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)bn(t.$children[n]);_n(t,"activated")}}function Dn(t,e){if(!(e&&(t._directInactive=!0,yn(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)Dn(t.$children[n]);_n(t,"deactivated")}}function _n(t,e,n,r){void 0===r&&(r=!0),wt();var o=ft;r&&pt(t);var i=t.$options[e],s="".concat(e," hook");if(i)for(var a=0,u=i.length;a<u;a++)Ve(i[a],t,n||null,t,s);t._hasHookEvent&&t.$emit("hook:"+e),r&&pt(o),kt()}var wn=[],kn=[],En={},Cn={},xn=!1,An=!1,Sn=0;var On=0,Nn=Date.now;if(G&&!X){var Tn=window.performance;Tn&&"function"==typeof Tn.now&&Nn()>document.createEvent("Event").timeStamp&&(Nn=function(){return Tn.now()})}var Mn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Fn(){var t,e;for(On=Nn(),An=!0,wn.sort(Mn),Sn=0;Sn<wn.length;Sn++)if((t=wn[Sn]).before&&t.before(),e=t.id,En[e]=null,t.run(),"production"!==process.env.NODE_ENV&&null!=En[e]&&(Cn[e]=(Cn[e]||0)+1,Cn[e]>100)){Kn("You may have an infinite update loop "+(t.user?'in watcher with expression "'.concat(t.expression,'"'):"in a component render function."),t.vm);break}var n=kn.slice(),r=wn.slice();Sn=wn.length=kn.length=0,En={},"production"!==process.env.NODE_ENV&&(Cn={}),xn=An=!1,function(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,bn(t[e],!0)}(n),function(t){var e=t.length;for(;e--;){var n=t[e],r=n.vm;r&&r._watcher===n&&r._isMounted&&!r._isDestroyed&&_n(r,"updated")}}(r),function(){for(var t=0;t<bt.length;t++){var e=bt[t];e.subs=e.subs.filter((function(t){return t})),e._pending=!1}bt.length=0}(),at&&H.devtools&&at.emit("flush")}function In(t){var e=t.id;if(null==En[e]&&(t!==Dt.target||!t.noRecurse)){if(En[e]=!0,An){for(var n=wn.length-1;n>Sn&&wn[n].id>t.id;)n--;wn.splice(n+1,0,t)}else wn.push(t);if(!xn){if(xn=!0,"production"!==process.env.NODE_ENV&&!H.async)return void Fn();tn(Fn)}}}function Bn(t){var e=t.$options.provide;if(e){var n=a(e)?e.call(t):e;if(!u(n))return;for(var r=function(t){var e=t._provided,n=t.$parent&&t.$parent._provided;return n===e?t._provided=Object.create(n):e}(t),o=ct?Reflect.ownKeys(n):Object.keys(n),i=0;i<o.length;i++){var s=o[i];Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(n,s))}}}function $n(t,e){if(t){for(var n=Object.create(null),r=ct?Reflect.ownKeys(t):Object.keys(t),o=0;o<r.length;o++){var i=r[o];if("__ob__"!==i){var s=t[i].from;if(s in e._provided)n[i]=e._provided[s];else if("default"in t[i]){var u=t[i].default;n[i]=a(u)?u.call(e):u}else"production"!==process.env.NODE_ENV&&Kn('Injection "'.concat(i,'" not found'),e)}}return n}}function Rn(t,r,o,s,a){var u,l=this,c=a.options;w(s,"_uid")?(u=Object.create(s))._original=s:(u=s,s=s._original);var f=i(c._compiled),p=!f;this.data=t,this.props=r,this.children=o,this.parent=s,this.listeners=t.on||e,this.injections=$n(c.inject,s),this.slots=function(){return l.$slots||Oe(s,t.scopedSlots,l.$slots=xe(o,s)),l.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return Oe(s,t.scopedSlots,this.slots())}}),f&&(this.$options=c,this.$slots=this.slots(),this.$scopedSlots=Oe(s,t.scopedSlots,this.$slots)),c._scopeId?this._c=function(t,e,r,o){var i=Pe(u,t,e,r,o,p);return i&&!n(i)&&(i.fnScopeId=c._scopeId,i.fnContext=s),i}:this._c=function(t,e,n,r){return Pe(u,t,e,n,r,p)}}function Ln(t,e,n,r,o){var i=gt(t);return i.fnContext=n,i.fnOptions=r,"production"!==process.env.NODE_ENV&&((i.devtoolsMeta=i.devtoolsMeta||{}).renderContext=o),e.slot&&((i.data||(i.data={})).slot=e.slot),i}function Pn(t,e){for(var n in e)t[C(n)]=e[n]}function zn(t){return t.name||t.__name||t._componentTag}Ce(Rn.prototype);var jn={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;jn.prepatch(n,n)}else{(t.componentInstance=function(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;o(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,mn)).$mount(e?t.elm:void 0,e)}},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,o,i){"production"!==process.env.NODE_ENV&&(gn=!0);var s=o.data.scopedSlots,a=t.$scopedSlots,u=!!(s&&!s.$stable||a!==e&&!a.$stable||s&&t.$scopedSlots.$key!==s.$key||!s&&t.$scopedSlots.$key),l=!!(i||t.$options._renderChildren||u),c=t.$vnode;t.$options._parentVnode=o,t.$vnode=o,t._vnode&&(t._vnode.parent=o),t.$options._renderChildren=i;var f=o.data.attrs||e;t._attrsProxy&&Fe(t._attrsProxy,f,c.data&&c.data.attrs||e,t,"$attrs")&&(l=!0),t.$attrs=f,r=r||e;var p=t.$options._parentListeners;if(t._listenersProxy&&Fe(t._listenersProxy,r,p||e,t,"$listeners"),t.$listeners=t.$options._parentListeners=r,hn(t,r,p),n&&t.$options.props){Ot(!1);for(var d=t._props,h=t.$options._propKeys||[],m=0;m<h.length;m++){var g=h[m],v=t.$options.props;d[g]=ar(g,v,n,t)}Ot(!0),t.$options.propsData=n}l&&(t.$slots=xe(i,o.context),t.$forceUpdate()),"production"!==process.env.NODE_ENV&&(gn=!1)}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(t){var e,n=t.context,r=t.componentInstance;r._isMounted||(r._isMounted=!0,_n(r,"mounted")),t.data.keepAlive&&(n._isMounted?((e=r)._inactive=!1,kn.push(e)):bn(r,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?Dn(e,!0):e.$destroy())}},Vn=Object.keys(jn);function Hn(t,s,a,l,c){if(!r(t)){var f=a.$options._base;if(u(t)&&(t=f.extend(t)),"function"==typeof t){var p;if(r(t.cid)&&(t=function(t,e){if(i(t.error)&&o(t.errorComp))return t.errorComp;if(o(t.resolved))return t.resolved;var n=$e;if(n&&o(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n),i(t.loading)&&o(t.loadingComp))return t.loadingComp;if(n&&!o(t.owners)){var s=t.owners=[n],a=!0,l=null,c=null;n.$on("hook:destroyed",(function(){return D(s,n)}));var f=function(t){for(var e=0,n=s.length;e<n;e++)s[e].$forceUpdate();t&&(s.length=0,null!==l&&(clearTimeout(l),l=null),null!==c&&(clearTimeout(c),c=null))},p=L((function(n){t.resolved=Re(n,e),a?s.length=0:f(!0)})),d=L((function(e){"production"!==process.env.NODE_ENV&&Kn("Failed to resolve async component: ".concat(String(t))+(e?"\nReason: ".concat(e):"")),o(t.errorComp)&&(t.error=!0,f(!0))})),m=t(p,d);return u(m)&&(h(m)?r(t.resolved)&&m.then(p,d):h(m.component)&&(m.component.then(p,d),o(m.error)&&(t.errorComp=Re(m.error,e)),o(m.loading)&&(t.loadingComp=Re(m.loading,e),0===m.delay?t.loading=!0:l=setTimeout((function(){l=null,r(t.resolved)&&r(t.error)&&(t.loading=!0,f(!1))}),m.delay||200)),o(m.timeout)&&(c=setTimeout((function(){c=null,r(t.resolved)&&d("production"!==process.env.NODE_ENV?"timeout (".concat(m.timeout,"ms)"):null)}),m.timeout)))),a=!1,t.loading?t.loadingComp:t.resolved}}(p=t,f),void 0===t))return function(t,e,n,r,o){var i=ht();return i.asyncFactory=t,i.asyncMeta={data:e,context:n,children:r,tag:o},i}(p,s,a,l,c);s=s||{},Ir(t),o(s.model)&&function(t,e){var r=t.model&&t.model.prop||"value",i=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[r]=e.model.value;var s=e.on||(e.on={}),a=s[i],u=e.model.callback;o(a)?(n(a)?-1===a.indexOf(u):a!==u)&&(s[i]=[u].concat(a)):s[i]=u}(t.options,s);var d=function(t,e,n){var i=e.options.props;if(!r(i)){var s={},a=t.attrs,u=t.props;if(o(a)||o(u))for(var l in i){var c=S(l);if("production"!==process.env.NODE_ENV){var f=l.toLowerCase();l!==f&&a&&w(a,f)&&Jn('Prop "'.concat(f,'" is passed to component ')+"".concat(qn(n||e),", but the declared prop name is")+' "'.concat(l,'". ')+"Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM "+'templates. You should probably use "'.concat(c,'" instead of "').concat(l,'".'))}ae(s,u,l,c,!0)||ae(s,a,l,c,!1)}return s}}(s,t,c);if(i(t.options.functional))return function(t,r,i,s,a){var u=t.options,l={},c=u.props;if(o(c))for(var f in c)l[f]=ar(f,c,r||e);else o(i.attrs)&&Pn(l,i.attrs),o(i.props)&&Pn(l,i.props);var p=new Rn(i,l,a,s,t),d=u.render.call(null,p._c,p);if(d instanceof dt)return Ln(d,i,p.parent,u,p);if(n(d)){for(var h=ue(d)||[],m=new Array(h.length),g=0;g<h.length;g++)m[g]=Ln(h[g],i,p.parent,u,p);return m}}(t,d,s,a,l);var m=s.on;if(s.on=s.nativeOn,i(t.options.abstract)){var g=s.slot;s={},g&&(s.slot=g)}!function(t){for(var e=t.hook||(t.hook={}),n=0;n<Vn.length;n++){var r=Vn[n],o=e[r],i=jn[r];o===i||o&&o._merged||(e[r]=o?Wn(i,o):i)}}(s);var v=zn(t.options)||c;return new dt("vue-component-".concat(t.cid).concat(v?"-".concat(v):""),s,void 0,void 0,void 0,a,{Ctor:t,propsData:d,listeners:m,tag:c,children:l},p)}"production"!==process.env.NODE_ENV&&Kn("Invalid Component definition: ".concat(String(t)),a)}}function Wn(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}var Un,qn,Kn=F,Jn=F;if("production"!==process.env.NODE_ENV){var Gn="undefined"!=typeof console,Yn=/(?:^|[-_])(\w)/g;Kn=function(t,e){void 0===e&&(e=ft);var n=e?Un(e):"";H.warnHandler?H.warnHandler.call(null,t,e,n):Gn&&!H.silent&&console.error("[Vue warn]: ".concat(t).concat(n))},Jn=function(t,e){Gn&&!H.silent&&console.warn("[Vue tip]: ".concat(t)+(e?Un(e):""))},qn=function(t,e){if(t.$root===t)return"<Root>";var n=a(t)&&null!=t.cid?t.options:t._isVue?t.$options||t.constructor.options:t,r=zn(n),o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<".concat(r.replace(Yn,(function(t){return t.toUpperCase()})).replace(/[-_]/g,""),">"):"<Anonymous>")+(o&&!1!==e?" at ".concat(o):"")};Un=function(t){if(t._isVue&&t.$parent){for(var e=[],r=0;t;){if(e.length>0){var o=e[e.length-1];if(o.constructor===t.constructor){r++,t=t.$parent;continue}r>0&&(e[e.length-1]=[o,r],r=0)}e.push(t),t=t.$parent}return"\n\nfound in\n\n"+e.map((function(t,e){return"".concat(0===e?"---\x3e ":function(t,e){for(var n="";e;)e%2==1&&(n+=t),e>1&&(t+=t),e>>=1;return n}(" ",5+2*e)).concat(n(t)?"".concat(qn(t[0]),"... (").concat(t[1]," recursive calls)"):qn(t))})).join("\n")}return"\n\n(found in ".concat(qn(t),")")}}var Xn=H.optionMergeStrategies;function Zn(t,e,n){if(void 0===n&&(n=!0),!e)return t;for(var r,o,i,s=ct?Reflect.ownKeys(e):Object.keys(e),a=0;a<s.length;a++)"__ob__"!==(r=s[a])&&(o=t[r],i=e[r],n&&w(t,r)?o!==i&&f(o)&&f(i)&&Zn(o,i):It(t,r,i));return t}function Qn(t,e,n){return n?function(){var r=a(e)?e.call(n,n):e,o=a(t)?t.call(n,n):t;return r?Zn(r,o):o}:e?t?function(){return Zn(a(e)?e.call(this,this):e,a(t)?t.call(this,this):t)}:e:t}function tr(t,e){var r=e?t?t.concat(e):n(e)?e:[e]:t;return r?function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(r):r}function er(t,e,n,r){var o=Object.create(t||null);return e?("production"!==process.env.NODE_ENV&&or(r,e,n),T(o,e)):o}"production"!==process.env.NODE_ENV&&(Xn.el=Xn.propsData=function(t,e,n,r){return n||Kn('option "'.concat(r,'" can only be used during instance ')+"creation with the `new` keyword."),nr(t,e)}),Xn.data=function(t,e,n){return n?Qn(t,e,n):e&&"function"!=typeof e?("production"!==process.env.NODE_ENV&&Kn('The "data" option should be a function that returns a per-instance value in component definitions.',n),t):Qn(t,e)},V.forEach((function(t){Xn[t]=tr})),j.forEach((function(t){Xn[t+"s"]=er})),Xn.watch=function(t,e,r,o){if(t===rt&&(t=void 0),e===rt&&(e=void 0),!e)return Object.create(t||null);if("production"!==process.env.NODE_ENV&&or(o,e,r),!t)return e;var i={};for(var s in T(i,t),e){var a=i[s],u=e[s];a&&!n(a)&&(a=[a]),i[s]=a?a.concat(u):n(u)?u:[u]}return i},Xn.props=Xn.methods=Xn.inject=Xn.computed=function(t,e,n,r){if(e&&"production"!==process.env.NODE_ENV&&or(r,e,n),!t)return e;var o=Object.create(null);return T(o,t),e&&T(o,e),o},Xn.provide=function(t,e){return t?function(){var n=Object.create(null);return Zn(n,a(t)?t.call(this):t),e&&Zn(n,a(e)?e.call(this):e,!1),n}:e};var nr=function(t,e){return void 0===e?t:e};function rr(t){new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(W.source,"]*$")).test(t)||Kn('Invalid component name: "'+t+'". Component names should conform to valid custom element name in html5 specification.'),(y(t)||H.isReservedTag(t))&&Kn("Do not use built-in or reserved HTML elements as component id: "+t)}function or(t,e,n){f(e)||Kn('Invalid value for option "'.concat(t,'": expected an Object, ')+"but got ".concat(c(e),"."),n)}function ir(t,e,r){if("production"!==process.env.NODE_ENV&&function(t){for(var e in t.components)rr(e)}(e),a(e)&&(e=e.options),function(t,e){var r=t.props;if(r){var o,i,s={};if(n(r))for(o=r.length;o--;)"string"==typeof(i=r[o])?s[C(i)]={type:null}:"production"!==process.env.NODE_ENV&&Kn("props must be strings when using array syntax.");else if(f(r))for(var a in r)i=r[a],s[C(a)]=f(i)?i:{type:i};else"production"!==process.env.NODE_ENV&&Kn('Invalid value for option "props": expected an Array or an Object, '+"but got ".concat(c(r),"."),e);t.props=s}}(e,r),function(t,e){var r=t.inject;if(r){var o=t.inject={};if(n(r))for(var i=0;i<r.length;i++)o[r[i]]={from:r[i]};else if(f(r))for(var s in r){var a=r[s];o[s]=f(a)?T({from:s},a):{from:a}}else"production"!==process.env.NODE_ENV&&Kn('Invalid value for option "inject": expected an Array or an Object, '+"but got ".concat(c(r),"."),e)}}(e,r),function(t){var e=t.directives;if(e)for(var n in e){var r=e[n];a(r)&&(e[n]={bind:r,update:r})}}(e),!e._base&&(e.extends&&(t=ir(t,e.extends,r)),e.mixins))for(var o=0,i=e.mixins.length;o<i;o++)t=ir(t,e.mixins[o],r);var s,u={};for(s in t)l(s);for(s in e)w(t,s)||l(s);function l(n){var o=Xn[n]||nr;u[n]=o(t[n],e[n],r,n)}return u}function sr(t,e,n,r){if("string"==typeof n){var o=t[e];if(w(o,n))return o[n];var i=C(n);if(w(o,i))return o[i];var s=x(i);if(w(o,s))return o[s];var a=o[n]||o[i]||o[s];return"production"!==process.env.NODE_ENV&&r&&!a&&Kn("Failed to resolve "+e.slice(0,-1)+": "+n),a}}function ar(t,e,r,o){var i=e[t],s=!w(r,t),l=r[t],f=dr(Boolean,i.type);if(f>-1)if(s&&!w(i,"default"))l=!1;else if(""===l||l===S(t)){var p=dr(String,i.type);(p<0||f<p)&&(l=!0)}if(void 0===l){l=function(t,e,n){if(!w(e,"default"))return;var r=e.default;"production"!==process.env.NODE_ENV&&u(r)&&Kn('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',t);if(t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n])return t._props[n];return a(r)&&"Function"!==fr(e.type)?r.call(t):r}(o,i,t);var d=St;Ot(!0),Mt(l),Ot(d)}return"production"!==process.env.NODE_ENV&&function(t,e,r,o,i){if(t.required&&i)return void Kn('Missing required prop: "'+e+'"',o);if(null==r&&!t.required)return;var s=t.type,a=!s||!0===s,u=[];if(s){n(s)||(s=[s]);for(var l=0;l<s.length&&!a;l++){var f=lr(r,s[l],o);u.push(f.expectedType||""),a=f.valid}}var p=u.some((function(t){return t}));if(!a&&p)return void Kn(function(t,e,n){var r='Invalid prop: type check failed for prop "'.concat(t,'".')+" Expected ".concat(n.map(x).join(", ")),o=n[0],i=c(e);1===n.length&&vr(o)&&vr(typeof e)&&!function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.some((function(t){return"boolean"===t.toLowerCase()}))}(o,i)&&(r+=" with value ".concat(hr(e,o)));r+=", got ".concat(i," "),vr(i)&&(r+="with value ".concat(hr(e,i),"."));return r}(e,r,u),o);var d=t.validator;d&&(d(r)||Kn('Invalid prop: custom validator check failed for prop "'+e+'".',o))}(i,t,l,o,s),l}var ur=/^(String|Number|Boolean|Function|Symbol|BigInt)$/;function lr(t,e,r){var o,i=fr(e);if(ur.test(i)){var s=typeof t;(o=s===i.toLowerCase())||"object"!==s||(o=t instanceof e)}else if("Object"===i)o=f(t);else if("Array"===i)o=n(t);else try{o=t instanceof e}catch(t){Kn('Invalid prop type: "'+String(e)+'" is not a constructor',r),o=!1}return{valid:o,expectedType:i}}var cr=/^\s*function (\w+)/;function fr(t){var e=t&&t.toString().match(cr);return e?e[1]:""}function pr(t,e){return fr(t)===fr(e)}function dr(t,e){if(!n(e))return pr(e,t)?0:-1;for(var r=0,o=e.length;r<o;r++)if(pr(e[r],t))return r;return-1}function hr(t,e){return"String"===e?'"'.concat(t,'"'):"".concat("Number"===e?Number(t):t)}var mr,gr=["string","number","boolean"];function vr(t){return gr.some((function(e){return t.toLowerCase()===e}))}if("production"!==process.env.NODE_ENV){var yr=v("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,require"),br=function(t,e){Kn('Property or method "'.concat(e,'" is not defined on the instance but ')+"referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.",t)},Dr=function(t,e){Kn('Property "'.concat(e,'" must be accessed with "$data.').concat(e,'" because ')+'properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internals. See: https://v2.vuejs.org/v2/api/#data',t)},_r="undefined"!=typeof Proxy&&ut(Proxy);if(_r){var wr=v("stop,prevent,self,ctrl,shift,alt,meta,exact");H.keyCodes=new Proxy(H.keyCodes,{set:function(t,e,n){return wr(e)?(Kn("Avoid overwriting built-in modifier in config.keyCodes: .".concat(e)),!1):(t[e]=n,!0)}})}var kr={has:function(t,e){var n=e in t,r=yr(e)||"string"==typeof e&&"_"===e.charAt(0)&&!(e in t.$data);return n||r||(e in t.$data?Dr(t,e):br(t,e)),n||!r}},Er={get:function(t,e){return"string"!=typeof e||e in t||(e in t.$data?Dr(t,e):br(t,e)),t[e]}};mr=function(t){if(_r){var e=t.$options,n=e.render&&e.render._withStripped?Er:kr;t._renderProxy=new Proxy(t,n)}else t._renderProxy=t}}var Cr={enumerable:!0,configurable:!0,get:F,set:F};function xr(t,e,n){Cr.get=function(){return this[e][n]},Cr.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Cr)}function Ar(t){var e=t.$options;if(e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=Rt({}),o=t.$options._propKeys=[],i=!t.$parent;i||Ot(!1);var s=function(s){o.push(s);var a=ar(s,e,n,t);if("production"!==process.env.NODE_ENV){var u=S(s);(b(u)||H.isReservedAttr(u))&&Kn('"'.concat(u,'" is a reserved attribute and cannot be used as component prop.'),t),Ft(r,s,a,(function(){i||gn||Kn("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's "+'value. Prop being mutated: "'.concat(s,'"'),t)}))}else Ft(r,s,a);s in t||xr(t,"_props",s)};for(var a in e)s(a);Ot(!0)}(t,e.props),Me(t),e.methods&&function(t,e){var n=t.$options.props;for(var r in e)"production"!==process.env.NODE_ENV&&("function"!=typeof e[r]&&Kn('Method "'.concat(r,'" has type "').concat(typeof e[r],'" in the component definition. ')+"Did you reference the function correctly?",t),n&&w(n,r)&&Kn('Method "'.concat(r,'" has already been defined as a prop.'),t),r in t&&U(r)&&Kn('Method "'.concat(r,'" conflicts with an existing Vue instance method. ')+"Avoid defining component methods that start with _ or $.")),t[r]="function"!=typeof e[r]?F:O(e[r],t)}(t,e.methods),e.data)!function(t){var e=t.$options.data;e=t._data=a(e)?function(t,e){wt();try{return t.call(e,e)}catch(t){return je(t,e,"data()"),{}}finally{kt()}}(e,t):e||{},f(e)||(e={},"production"!==process.env.NODE_ENV&&Kn("data functions should return an object:\nhttps://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",t));var n=Object.keys(e),r=t.$options.props,o=t.$options.methods,i=n.length;for(;i--;){var s=n[i];"production"!==process.env.NODE_ENV&&o&&w(o,s)&&Kn('Method "'.concat(s,'" has already been defined as a data property.'),t),r&&w(r,s)?"production"!==process.env.NODE_ENV&&Kn('The data property "'.concat(s,'" is already declared as a prop. ')+"Use prop default value instead.",t):U(s)||xr(t,"_data",s)}var u=Mt(e);u&&u.vmCount++}(t);else{var r=Mt(t._data={});r&&r.vmCount++}e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=st();for(var o in e){var i=e[o],s=a(i)?i:i.get;"production"!==process.env.NODE_ENV&&null==s&&Kn('Getter is missing for computed property "'.concat(o,'".'),t),r||(n[o]=new ln(t,s||F,F,Sr)),o in t?"production"!==process.env.NODE_ENV&&(o in t.$data?Kn('The computed property "'.concat(o,'" is already defined in data.'),t):t.$options.props&&o in t.$options.props?Kn('The computed property "'.concat(o,'" is already defined as a prop.'),t):t.$options.methods&&o in t.$options.methods&&Kn('The computed property "'.concat(o,'" is already defined as a method.'),t)):Or(t,o,i)}}(t,e.computed),e.watch&&e.watch!==rt&&function(t,e){for(var r in e){var o=e[r];if(n(o))for(var i=0;i<o.length;i++)Mr(t,r,o[i]);else Mr(t,r,o)}}(t,e.watch)}var Sr={lazy:!0};function Or(t,e,n){var r=!st();a(n)?(Cr.get=r?Nr(e):Tr(n),Cr.set=F):(Cr.get=n.get?r&&!1!==n.cache?Nr(e):Tr(n.get):F,Cr.set=n.set||F),"production"!==process.env.NODE_ENV&&Cr.set===F&&(Cr.set=function(){Kn('Computed property "'.concat(e,'" was assigned to but it has no setter.'),this)}),Object.defineProperty(t,e,Cr)}function Nr(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Dt.target&&("production"!==process.env.NODE_ENV&&Dt.target.onTrack&&Dt.target.onTrack({effect:Dt.target,target:this,type:"get",key:t}),e.depend()),e.value}}function Tr(t){return function(){return t.call(this,this)}}function Mr(t,e,n,r){return f(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var Fr=0;function Ir(t){var e=t.options;if(t.super){var n=Ir(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var o in n)n[o]!==r[o]&&(e||(e={}),e[o]=n[o]);return e}(t);r&&T(t.extendOptions,r),(e=t.options=ir(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function Br(t){"production"===process.env.NODE_ENV||this instanceof Br||Kn("Vue is a constructor and should be called with the `new` keyword"),this._init(t)}function $r(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var i=zn(t)||zn(n.options);"production"!==process.env.NODE_ENV&&i&&rr(i);var s=function(t){this._init(t)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=e++,s.options=ir(n.options,t),s.super=n,s.options.props&&function(t){var e=t.options.props;for(var n in e)xr(t.prototype,"_props",n)}(s),s.options.computed&&function(t){var e=t.options.computed;for(var n in e)Or(t.prototype,n,e[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,j.forEach((function(t){s[t]=n[t]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=T({},s.options),o[r]=s,s}}function Rr(t){return t&&(zn(t.Ctor.options)||t.tag)}function Lr(t,e){return n(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!p(t)&&t.test(e)}function Pr(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var s=n[i];if(s){var a=s.name;a&&!e(a)&&zr(n,i,r,o)}}}function zr(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,D(n,e)}!function(t){t.prototype._init=function(t){var n,r,o=this;o._uid=Fr++,"production"!==process.env.NODE_ENV&&H.performance&&on&&(n="vue-perf-start:".concat(o._uid),r="vue-perf-end:".concat(o._uid),on(n)),o._isVue=!0,o.__v_skip=!0,o._scope=new ne(!0),o._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(o,t):o.$options=ir(Ir(o.constructor),t||{},o),"production"!==process.env.NODE_ENV?mr(o):o._renderProxy=o,o._self=o,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(o),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&hn(t,e)}(o),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,o=r&&r.context;t.$slots=xe(n._renderChildren,o),t.$scopedSlots=r?Oe(t.$parent,r.data.scopedSlots,t.$slots):e,t._c=function(e,n,r,o){return Pe(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return Pe(t,e,n,r,o,!0)};var i=r&&r.data;"production"!==process.env.NODE_ENV?(Ft(t,"$attrs",i&&i.attrs||e,(function(){!gn&&Kn("$attrs is readonly.",t)}),!0),Ft(t,"$listeners",n._parentListeners||e,(function(){!gn&&Kn("$listeners is readonly.",t)}),!0)):(Ft(t,"$attrs",i&&i.attrs||e,null,!0),Ft(t,"$listeners",n._parentListeners||e,null,!0))}(o),_n(o,"beforeCreate",void 0,!1),function(t){var e=$n(t.$options.inject,t);e&&(Ot(!1),Object.keys(e).forEach((function(n){"production"!==process.env.NODE_ENV?Ft(t,n,e[n],(function(){Kn("Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. "+'injection being mutated: "'.concat(n,'"'),t)})):Ft(t,n,e[n])})),Ot(!0))}(o),Ar(o),Bn(o),_n(o,"created"),"production"!==process.env.NODE_ENV&&H.performance&&on&&(o._name=qn(o,!1),on(r),sn("vue ".concat(o._name," init"),n,r)),o.$options.el&&o.$mount(o.$options.el)}}(Br),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};"production"!==process.env.NODE_ENV&&(e.set=function(){Kn("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){Kn("$props is readonly.",this)}),Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=It,t.prototype.$delete=Bt,t.prototype.$watch=function(t,e,n){var r=this;if(f(e))return Mr(r,t,e,n);(n=n||{}).user=!0;var o=new ln(r,t,e,n);if(n.immediate){var i='callback for immediate watcher "'.concat(o.expression,'"');wt(),Ve(e,r,[o.value],r,i),kt()}return function(){o.teardown()}}}(Br),function(t){var e=/^hook:/;t.prototype.$on=function(t,r){var o=this;if(n(t))for(var i=0,s=t.length;i<s;i++)o.$on(t[i],r);else(o._events[t]||(o._events[t]=[])).push(r),e.test(t)&&(o._hasHookEvent=!0);return o},t.prototype.$once=function(t,e){var n=this;function r(){n.$off(t,r),e.apply(n,arguments)}return r.fn=e,n.$on(t,r),n},t.prototype.$off=function(t,e){var r=this;if(!arguments.length)return r._events=Object.create(null),r;if(n(t)){for(var o=0,i=t.length;o<i;o++)r.$off(t[o],e);return r}var s,a=r._events[t];if(!a)return r;if(!e)return r._events[t]=null,r;for(var u=a.length;u--;)if((s=a[u])===e||s.fn===e){a.splice(u,1);break}return r},t.prototype.$emit=function(t){var e=this;if("production"!==process.env.NODE_ENV){var n=t.toLowerCase();n!==t&&e._events[n]&&Jn('Event "'.concat(n,'" is emitted in component ')+"".concat(qn(e),' but the handler is registered for "').concat(t,'". ')+"Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. "+'You should probably use "'.concat(S(t),'" instead of "').concat(t,'".'))}var r=e._events[t];if(r){r=r.length>1?N(r):r;for(var o=N(arguments,1),i='event handler for "'.concat(t,'"'),s=0,a=r.length;s<a;s++)Ve(r[s],e,o,e,i)}return e}}(Br),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,o=n._vnode,i=vn(n);n._vnode=t,n.$el=o?n.__patch__(o,t):n.__patch__(n.$el,t,e,!1),i(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n);for(var s=n;s&&s.$vnode&&s.$parent&&s.$vnode===s.$parent._vnode;)s.$parent.$el=s.$el,s=s.$parent},t.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){_n(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||D(e.$children,t),t._scope.stop(),t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),_n(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(Br),function(t){Ce(t.prototype),t.prototype.$nextTick=function(t){return tn(t,this)},t.prototype._render=function(){var t,e=this,r=e.$options,o=r.render,i=r._parentVnode;i&&e._isMounted&&(e.$scopedSlots=Oe(e.$parent,i.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&Be(e._slotsProxy,e.$scopedSlots)),e.$vnode=i;try{pt(e),$e=e,t=o.call(e._renderProxy,e.$createElement)}catch(n){if(je(n,e,"render"),"production"!==process.env.NODE_ENV&&e.$options.renderError)try{t=e.$options.renderError.call(e._renderProxy,e.$createElement,n)}catch(n){je(n,e,"renderError"),t=e._vnode}else t=e._vnode}finally{$e=null,pt()}return n(t)&&1===t.length&&(t=t[0]),t instanceof dt||("production"!==process.env.NODE_ENV&&n(t)&&Kn("Multiple root nodes returned from render function. Render function should return a single root node.",e),t=ht()),t.parent=i,t}}(Br);var jr=[String,RegExp,Array],Vr={name:"keep-alive",abstract:!0,props:{include:jr,exclude:jr,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,n=t.keys,r=t.vnodeToCache,o=t.keyToCache;if(r){var i=r.tag,s=r.componentInstance,a=r.componentOptions;e[o]={name:Rr(a),tag:i,componentInstance:s},n.push(o),this.max&&n.length>parseInt(this.max)&&zr(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)zr(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Pr(t,(function(t){return Lr(e,t)}))})),this.$watch("exclude",(function(e){Pr(t,(function(t){return!Lr(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Le(t),n=e&&e.componentOptions;if(n){var r=Rr(n),o=this.include,i=this.exclude;if(o&&(!r||!Lr(o,r))||i&&r&&Lr(i,r))return e;var s=this.cache,a=this.keys,u=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;s[u]?(e.componentInstance=s[u].componentInstance,D(a,u),a.push(u)):(this.vnodeToCache=e,this.keyToCache=u),e.data.keepAlive=!0}return e||t&&t[0]}},Hr={KeepAlive:Vr};!function(t){var e={get:function(){return H}};"production"!==process.env.NODE_ENV&&(e.set=function(){Kn("Do not replace the Vue.config object, set individual fields instead.")}),Object.defineProperty(t,"config",e),t.util={warn:Kn,extend:T,mergeOptions:ir,defineReactive:Ft},t.set=It,t.delete=Bt,t.nextTick=tn,t.observable=function(t){return Mt(t),t},t.options=Object.create(null),j.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,T(t.options.components,Hr),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=N(arguments,1);return n.unshift(this),a(t.install)?t.install.apply(t,n):a(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=ir(this.options,t),this}}(t),$r(t),function(t){j.forEach((function(e){t[e]=function(t,n){return n?("production"!==process.env.NODE_ENV&&"component"===e&&rr(t),"component"===e&&f(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&a(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Br),Object.defineProperty(Br.prototype,"$isServer",{get:st}),Object.defineProperty(Br.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Br,"FunctionalRenderContext",{value:Rn}),Br.version="2.7.14";var Wr=v("style,class"),Ur=v("input,textarea,option,select,progress"),qr=v("contenteditable,draggable,spellcheck"),Kr=v("events,caret,typing,plaintext-only"),Jr=v("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"),Gr="http://www.w3.org/1999/xlink",Yr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Xr=function(t){return Yr(t)?t.slice(6,t.length):""},Zr=function(t){return null==t||!1===t};function Qr(t){for(var e=t.data,n=t,r=t;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=to(r.data,e));for(;o(n=n.parent);)n&&n.data&&(e=to(e,n.data));return function(t,e){if(o(t)||o(e))return eo(t,no(e));return""}(e.staticClass,e.class)}function to(t,e){return{staticClass:eo(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function eo(t,e){return t?e?t+" "+e:t:e||""}function no(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,i=t.length;r<i;r++)o(e=no(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):u(t)?function(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}var ro={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},oo=v("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),io=v("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),so=function(t){return oo(t)||io(t)};var ao=Object.create(null);var uo=v("text,number,password,search,email,tel,url");var lo=Object.freeze({__proto__:null,createElement:function(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(t,e){return document.createElementNS(ro[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){t.appendChild(e)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},setStyleScope:function(t,e){t.setAttribute(e,"")}}),co={create:function(t,e){fo(e)},update:function(t,e){t.data.ref!==e.data.ref&&(fo(t,!0),fo(e))},destroy:function(t){fo(t,!0)}};function fo(t,e){var r=t.data.ref;if(o(r)){var i=t.context,s=t.componentInstance||t.elm,u=e?null:s,l=e?void 0:s;if(a(r))Ve(r,i,[u],i,"template ref function");else{var c=t.data.refInFor,f="string"==typeof r||"number"==typeof r,p=Ht(r),d=i.$refs;if(f||p)if(c){var h=f?d[r]:r.value;e?n(h)&&D(h,s):n(h)?h.includes(s)||h.push(s):f?(d[r]=[s],po(i,r,d[r])):r.value=[s]}else if(f){if(e&&d[r]!==s)return;d[r]=l,po(i,r,u)}else if(p){if(e&&r.value!==s)return;r.value=u}else"production"!==process.env.NODE_ENV&&Kn("Invalid template ref type: ".concat(typeof r))}}}function po(t,e,n){var r=t._setupState;r&&w(r,e)&&(Ht(r[e])?r[e].value=n:r[e]=n)}var ho=new dt("",{},[]),mo=["create","activate","update","remove","destroy"];function go(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&o(t.data)===o(e.data)&&function(t,e){if("input"!==t.tag)return!0;var n,r=o(n=t.data)&&o(n=n.attrs)&&n.type,i=o(n=e.data)&&o(n=n.attrs)&&n.type;return r===i||uo(r)&&uo(i)}(t,e)||i(t.isAsyncPlaceholder)&&r(e.asyncFactory.error))}function vo(t,e,n){var r,i,s={};for(r=e;r<=n;++r)o(i=t[r].key)&&(s[i]=r);return s}var yo={create:bo,update:bo,destroy:function(t){bo(t,ho)}};function bo(t,e){(t.data.directives||e.data.directives)&&function(t,e){var n,r,o,i=t===ho,s=e===ho,a=_o(t.data.directives,t.context),u=_o(e.data.directives,e.context),l=[],c=[];for(n in u)r=a[n],o=u[n],r?(o.oldValue=r.value,o.oldArg=r.arg,ko(o,"update",e,t),o.def&&o.def.componentUpdated&&c.push(o)):(ko(o,"bind",e,t),o.def&&o.def.inserted&&l.push(o));if(l.length){var f=function(){for(var n=0;n<l.length;n++)ko(l[n],"inserted",e,t)};i?se(e,"insert",f):f()}c.length&&se(e,"postpatch",(function(){for(var n=0;n<c.length;n++)ko(c[n],"componentUpdated",e,t)}));if(!i)for(n in a)u[n]||ko(a[n],"unbind",t,t,s)}(t,e)}var Do=Object.create(null);function _o(t,e){var n,r,o=Object.create(null);if(!t)return o;for(n=0;n<t.length;n++){if((r=t[n]).modifiers||(r.modifiers=Do),o[wo(r)]=r,e._setupState&&e._setupState.__sfc){var i=r.def||sr(e,"_setupState","v-"+r.name);r.def="function"==typeof i?{bind:i,update:i}:i}r.def=r.def||sr(e.$options,"directives",r.name,!0)}return o}function wo(t){return t.rawName||"".concat(t.name,".").concat(Object.keys(t.modifiers||{}).join("."))}function ko(t,e,n,r,o){var i=t.def&&t.def[e];if(i)try{i(n.elm,t,n,r,o)}catch(r){je(r,n.context,"directive ".concat(t.name," ").concat(e," hook"))}}var Eo=[co,yo];function Co(t,e){var n=e.componentOptions;if(!(o(n)&&!1===n.Ctor.options.inheritAttrs||r(t.data.attrs)&&r(e.data.attrs))){var s,a,u=e.elm,l=t.data.attrs||{},c=e.data.attrs||{};for(s in(o(c.__ob__)||i(c._v_attr_proxy))&&(c=e.data.attrs=T({},c)),c)a=c[s],l[s]!==a&&xo(u,s,a,e.data.pre);for(s in(X||Q)&&c.value!==l.value&&xo(u,"value",c.value),l)r(c[s])&&(Yr(s)?u.removeAttributeNS(Gr,Xr(s)):qr(s)||u.removeAttribute(s))}}function xo(t,e,n,r){r||t.tagName.indexOf("-")>-1?Ao(t,e,n):Jr(e)?Zr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):qr(e)?t.setAttribute(e,function(t,e){return Zr(e)||"false"===e?"false":"contenteditable"===t&&Kr(e)?e:"true"}(e,n)):Yr(e)?Zr(n)?t.removeAttributeNS(Gr,Xr(e)):t.setAttributeNS(Gr,e,n):Ao(t,e,n)}function Ao(t,e,n){if(Zr(n))t.removeAttribute(e);else{if(X&&!Z&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var So={create:Co,update:Co};function Oo(t,e){var n=e.elm,i=e.data,s=t.data;if(!(r(i.staticClass)&&r(i.class)&&(r(s)||r(s.staticClass)&&r(s.class)))){var a=Qr(e),u=n._transitionClasses;o(u)&&(a=eo(a,no(u))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}var No,To={create:Oo,update:Oo},Mo="__r",Fo="__c";function Io(t,e,n){var r=No;return function o(){var i=e.apply(null,arguments);null!==i&&Ro(t,o,n,r)}}var Bo=qe&&!(nt&&Number(nt[1])<=53);function $o(t,e,n,r){if(Bo){var o=On,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}No.addEventListener(t,e,ot?{capture:n,passive:r}:n)}function Ro(t,e,n,r){(r||No).removeEventListener(t,e._wrapper||e,n)}function Lo(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};No=e.elm||t.elm,function(t){if(o(t[Mo])){var e=X?"change":"input";t[e]=[].concat(t[Mo],t[e]||[]),delete t[Mo]}o(t[Fo])&&(t.change=[].concat(t[Fo],t.change||[]),delete t[Fo])}(n),ie(n,i,$o,Ro,Io,e.context),No=void 0}}var Po,zo={create:Lo,update:Lo,destroy:function(t){return Lo(t,ho)}};function jo(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,s,a=e.elm,u=t.data.domProps||{},l=e.data.domProps||{};for(n in(o(l.__ob__)||i(l._v_attr_proxy))&&(l=e.data.domProps=T({},l)),u)n in l||(a[n]="");for(n in l){if(s=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),s===u[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=s;var c=r(s)?"":String(s);Vo(a,c)&&(a.value=c)}else if("innerHTML"===n&&io(a.tagName)&&r(a.innerHTML)){(Po=Po||document.createElement("div")).innerHTML="<svg>".concat(s,"</svg>");for(var f=Po.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;f.firstChild;)a.appendChild(f.firstChild)}else if(s!==u[n])try{a[n]=s}catch(t){}}}}function Vo(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(o(r)){if(r.number)return g(n)!==g(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Ho={create:jo,update:jo},Wo=k((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Uo(t){var e=qo(t.style);return t.staticStyle?T(t.staticStyle,e):e}function qo(t){return Array.isArray(t)?M(t):"string"==typeof t?Wo(t):t}var Ko,Jo=/^--/,Go=/\s*!important$/,Yo=function(t,e,n){if(Jo.test(e))t.style.setProperty(e,n);else if(Go.test(n))t.style.setProperty(S(e),n.replace(Go,""),"important");else{var r=Zo(e);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)t.style[r]=n[o];else t.style[r]=n}},Xo=["Webkit","Moz","ms"],Zo=k((function(t){if(Ko=Ko||document.createElement("div").style,"filter"!==(t=C(t))&&t in Ko)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Xo.length;n++){var r=Xo[n]+e;if(r in Ko)return r}}));function Qo(t,e){var n=e.data,i=t.data;if(!(r(n.staticStyle)&&r(n.style)&&r(i.staticStyle)&&r(i.style))){var s,a,u=e.elm,l=i.staticStyle,c=i.normalizedStyle||i.style||{},f=l||c,p=qo(e.data.style)||{};e.data.normalizedStyle=o(p.__ob__)?T({},p):p;var d=function(t,e){var n,r={};if(e)for(var o=t;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=Uo(o.data))&&T(r,n);(n=Uo(t.data))&&T(r,n);for(var i=t;i=i.parent;)i.data&&(n=Uo(i.data))&&T(r,n);return r}(e,!0);for(a in f)r(d[a])&&Yo(u,a,"");for(a in d)(s=d[a])!==f[a]&&Yo(u,a,null==s?"":s)}}var ti={create:Qo,update:Qo},ei=/\s+/;function ni(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(ei).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function ri(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(ei).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function oi(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&T(e,ii(t.name||"v")),T(e,t),e}return"string"==typeof t?ii(t):void 0}}var ii=k((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),si=G&&!Z,ai="transition",ui="animation",li="transition",ci="transitionend",fi="animation",pi="animationend";si&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(li="WebkitTransition",ci="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(fi="WebkitAnimation",pi="webkitAnimationEnd"));var di=G?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function hi(t){di((function(){di(t)}))}function mi(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),ni(t,e))}function gi(t,e){t._transitionClasses&&D(t._transitionClasses,e),ri(t,e)}function vi(t,e,n){var r=bi(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a=o===ai?ci:pi,u=0,l=function(){t.removeEventListener(a,c),n()},c=function(e){e.target===t&&++u>=s&&l()};setTimeout((function(){u<s&&l()}),i+1),t.addEventListener(a,c)}var yi=/\b(transform|all)(,|$)/;function bi(t,e){var n,r=window.getComputedStyle(t),o=(r[li+"Delay"]||"").split(", "),i=(r[li+"Duration"]||"").split(", "),s=Di(o,i),a=(r[fi+"Delay"]||"").split(", "),u=(r[fi+"Duration"]||"").split(", "),l=Di(a,u),c=0,f=0;return e===ai?s>0&&(n=ai,c=s,f=i.length):e===ui?l>0&&(n=ui,c=l,f=u.length):f=(n=(c=Math.max(s,l))>0?s>l?ai:ui:null)?n===ai?i.length:u.length:0,{type:n,timeout:c,propCount:f,hasTransform:n===ai&&yi.test(r[li+"Property"])}}function Di(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return _i(e)+_i(t[n])})))}function _i(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function wi(t,e){var n=t.elm;o(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var i=oi(t.data.transition);if(!r(i)&&!o(n._enterCb)&&1===n.nodeType){for(var s=i.css,l=i.type,c=i.enterClass,f=i.enterToClass,p=i.enterActiveClass,d=i.appearClass,h=i.appearToClass,m=i.appearActiveClass,v=i.beforeEnter,y=i.enter,b=i.afterEnter,D=i.enterCancelled,_=i.beforeAppear,w=i.appear,k=i.afterAppear,E=i.appearCancelled,C=i.duration,x=mn,A=mn.$vnode;A&&A.parent;)x=A.context,A=A.parent;var S=!x._isMounted||!t.isRootInsert;if(!S||w||""===w){var O=S&&d?d:c,N=S&&m?m:p,T=S&&h?h:f,M=S&&_||v,F=S&&a(w)?w:y,I=S&&k||b,B=S&&E||D,$=g(u(C)?C.enter:C);"production"!==process.env.NODE_ENV&&null!=$&&Ei($,"enter",t);var R=!1!==s&&!Z,P=xi(F),z=n._enterCb=L((function(){R&&(gi(n,T),gi(n,N)),z.cancelled?(R&&gi(n,O),B&&B(n)):I&&I(n),n._enterCb=null}));t.data.show||se(t,"insert",(function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),F&&F(n,z)})),M&&M(n),R&&(mi(n,O),mi(n,N),hi((function(){gi(n,O),z.cancelled||(mi(n,T),P||(Ci($)?setTimeout(z,$):vi(n,l,z)))}))),t.data.show&&(e&&e(),F&&F(n,z)),R||P||z()}}}function ki(t,e){var n=t.elm;o(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var i=oi(t.data.transition);if(r(i)||1!==n.nodeType)return e();if(!o(n._leaveCb)){var s=i.css,a=i.type,l=i.leaveClass,c=i.leaveToClass,f=i.leaveActiveClass,p=i.beforeLeave,d=i.leave,h=i.afterLeave,m=i.leaveCancelled,v=i.delayLeave,y=i.duration,b=!1!==s&&!Z,D=xi(d),_=g(u(y)?y.leave:y);"production"!==process.env.NODE_ENV&&o(_)&&Ei(_,"leave",t);var w=n._leaveCb=L((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),b&&(gi(n,c),gi(n,f)),w.cancelled?(b&&gi(n,l),m&&m(n)):(e(),h&&h(n)),n._leaveCb=null}));v?v(k):k()}function k(){w.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),p&&p(n),b&&(mi(n,l),mi(n,f),hi((function(){gi(n,l),w.cancelled||(mi(n,c),D||(Ci(_)?setTimeout(w,_):vi(n,a,w)))}))),d&&d(n,w),b||D||w())}}function Ei(t,e,n){"number"!=typeof t?Kn("<transition> explicit ".concat(e," duration is not a valid number - ")+"got ".concat(JSON.stringify(t),"."),n.context):isNaN(t)&&Kn("<transition> explicit ".concat(e," duration is NaN - ")+"the duration expression might be incorrect.",n.context)}function Ci(t){return"number"==typeof t&&!isNaN(t)}function xi(t){if(r(t))return!1;var e=t.fns;return o(e)?xi(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function Ai(t,e){!0!==e.data.show&&wi(e)}var Si=function(t){var e,a,u={},l=t.modules,c=t.nodeOps;for(e=0;e<mo.length;++e)for(u[mo[e]]=[],a=0;a<l.length;++a)o(l[a][mo[e]])&&u[mo[e]].push(l[a][mo[e]]);function f(t){var e=c.parentNode(t);o(e)&&c.removeChild(e,t)}function d(t,e){return!e&&!t.ns&&!(H.ignoredElements.length&&H.ignoredElements.some((function(e){return p(e)?e.test(t.tag):e===t.tag})))&&H.isUnknownElement(t.tag)}var h=0;function m(t,e,n,r,s,a,l){if(o(t.elm)&&o(a)&&(t=a[l]=gt(t)),t.isRootInsert=!s,!function(t,e,n,r){var s=t.data;if(o(s)){var a=o(t.componentInstance)&&s.keepAlive;if(o(s=s.hook)&&o(s=s.init)&&s(t,!1),o(t.componentInstance))return g(t,e),y(n,t.elm,r),i(a)&&function(t,e,n,r){var i,s=t;for(;s.componentInstance;)if(o(i=(s=s.componentInstance._vnode).data)&&o(i=i.transition)){for(i=0;i<u.activate.length;++i)u.activate[i](ho,s);e.push(s);break}y(n,t.elm,r)}(t,e,n,r),!0}}(t,e,n,r)){var f=t.data,p=t.children,m=t.tag;o(m)?("production"!==process.env.NODE_ENV&&(f&&f.pre&&h++,d(t,h)&&Kn("Unknown custom element: <"+m+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',t.context)),t.elm=t.ns?c.createElementNS(t.ns,m):c.createElement(m,t),w(t),b(t,p,e),o(f)&&_(t,e),y(n,t.elm,r),"production"!==process.env.NODE_ENV&&f&&f.pre&&h--):i(t.isComment)?(t.elm=c.createComment(t.text),y(n,t.elm,r)):(t.elm=c.createTextNode(t.text),y(n,t.elm,r))}}function g(t,e){o(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,D(t)?(_(t,e),w(t)):(fo(t),e.push(t))}function y(t,e,n){o(t)&&(o(n)?c.parentNode(n)===t&&c.insertBefore(t,e,n):c.appendChild(t,e))}function b(t,e,r){if(n(e)){"production"!==process.env.NODE_ENV&&A(e);for(var o=0;o<e.length;++o)m(e[o],r,t.elm,null,!0,e,o)}else s(t.text)&&c.appendChild(t.elm,c.createTextNode(String(t.text)))}function D(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return o(t.tag)}function _(t,n){for(var r=0;r<u.create.length;++r)u.create[r](ho,t);o(e=t.data.hook)&&(o(e.create)&&e.create(ho,t),o(e.insert)&&n.push(t))}function w(t){var e;if(o(e=t.fnScopeId))c.setStyleScope(t.elm,e);else for(var n=t;n;)o(e=n.context)&&o(e=e.$options._scopeId)&&c.setStyleScope(t.elm,e),n=n.parent;o(e=mn)&&e!==t.context&&e!==t.fnContext&&o(e=e.$options._scopeId)&&c.setStyleScope(t.elm,e)}function k(t,e,n,r,o,i){for(;r<=o;++r)m(n[r],i,t,e,!1,n,r)}function E(t){var e,n,r=t.data;if(o(r))for(o(e=r.hook)&&o(e=e.destroy)&&e(t),e=0;e<u.destroy.length;++e)u.destroy[e](t);if(o(e=t.children))for(n=0;n<t.children.length;++n)E(t.children[n])}function C(t,e,n){for(;e<=n;++e){var r=t[e];o(r)&&(o(r.tag)?(x(r),E(r)):f(r.elm))}}function x(t,e){if(o(e)||o(t.data)){var n,r=u.remove.length+1;for(o(e)?e.listeners+=r:e=function(t,e){function n(){0==--n.listeners&&f(t)}return n.listeners=e,n}(t.elm,r),o(n=t.componentInstance)&&o(n=n._vnode)&&o(n.data)&&x(n,e),n=0;n<u.remove.length;++n)u.remove[n](t,e);o(n=t.data.hook)&&o(n=n.remove)?n(t,e):e()}else f(t.elm)}function A(t){for(var e={},n=0;n<t.length;n++){var r=t[n],i=r.key;o(i)&&(e[i]?Kn("Duplicate keys detected: '".concat(i,"'. This may cause an update error."),r.context):e[i]=!0)}}function S(t,e,n,r){for(var i=n;i<r;i++){var s=e[i];if(o(s)&&go(t,s))return i}}function O(t,e,n,s,a,l){if(t!==e){o(e.elm)&&o(s)&&(e=s[a]=gt(e));var f=e.elm=t.elm;if(i(t.isAsyncPlaceholder))o(e.asyncFactory.resolved)?F(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(i(e.isStatic)&&i(t.isStatic)&&e.key===t.key&&(i(e.isCloned)||i(e.isOnce)))e.componentInstance=t.componentInstance;else{var p,d=e.data;o(d)&&o(p=d.hook)&&o(p=p.prepatch)&&p(t,e);var h=t.children,g=e.children;if(o(d)&&D(e)){for(p=0;p<u.update.length;++p)u.update[p](t,e);o(p=d.hook)&&o(p=p.update)&&p(t,e)}r(e.text)?o(h)&&o(g)?h!==g&&function(t,e,n,i,s){var a,u,l,f=0,p=0,d=e.length-1,h=e[0],g=e[d],v=n.length-1,y=n[0],b=n[v],D=!s;for("production"!==process.env.NODE_ENV&&A(n);f<=d&&p<=v;)r(h)?h=e[++f]:r(g)?g=e[--d]:go(h,y)?(O(h,y,i,n,p),h=e[++f],y=n[++p]):go(g,b)?(O(g,b,i,n,v),g=e[--d],b=n[--v]):go(h,b)?(O(h,b,i,n,v),D&&c.insertBefore(t,h.elm,c.nextSibling(g.elm)),h=e[++f],b=n[--v]):go(g,y)?(O(g,y,i,n,p),D&&c.insertBefore(t,g.elm,h.elm),g=e[--d],y=n[++p]):(r(a)&&(a=vo(e,f,d)),r(u=o(y.key)?a[y.key]:S(y,e,f,d))?m(y,i,t,h.elm,!1,n,p):go(l=e[u],y)?(O(l,y,i,n,p),e[u]=void 0,D&&c.insertBefore(t,l.elm,h.elm)):m(y,i,t,h.elm,!1,n,p),y=n[++p]);f>d?k(t,r(n[v+1])?null:n[v+1].elm,n,p,v,i):p>v&&C(e,f,d)}(f,h,g,n,l):o(g)?("production"!==process.env.NODE_ENV&&A(g),o(t.text)&&c.setTextContent(f,""),k(f,null,g,0,g.length-1,n)):o(h)?C(h,0,h.length-1):o(t.text)&&c.setTextContent(f,""):t.text!==e.text&&c.setTextContent(f,e.text),o(d)&&o(p=d.hook)&&o(p=p.postpatch)&&p(t,e)}}}function N(t,e,n){if(i(n)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}var T=!1,M=v("attrs,class,staticClass,staticStyle,key");function F(t,e,n,r){var s,a=e.tag,u=e.data,l=e.children;if(r=r||u&&u.pre,e.elm=t,i(e.isComment)&&o(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if("production"!==process.env.NODE_ENV&&!function(t,e,n){return o(e.tag)?0===e.tag.indexOf("vue-component")||!d(e,n)&&e.tag.toLowerCase()===(t.tagName&&t.tagName.toLowerCase()):t.nodeType===(e.isComment?8:3)}(t,e,r))return!1;if(o(u)&&(o(s=u.hook)&&o(s=s.init)&&s(e,!0),o(s=e.componentInstance)))return g(e,n),!0;if(o(a)){if(o(l))if(t.hasChildNodes())if(o(s=u)&&o(s=s.domProps)&&o(s=s.innerHTML)){if(s!==t.innerHTML)return"production"===process.env.NODE_ENV||"undefined"==typeof console||T||(T=!0,console.warn("Parent: ",t),console.warn("server innerHTML: ",s),console.warn("client innerHTML: ",t.innerHTML)),!1}else{for(var c=!0,f=t.firstChild,p=0;p<l.length;p++){if(!f||!F(f,l[p],n,r)){c=!1;break}f=f.nextSibling}if(!c||f)return"production"===process.env.NODE_ENV||"undefined"==typeof console||T||(T=!0,console.warn("Parent: ",t),console.warn("Mismatching childNodes vs. VNodes: ",t.childNodes,l)),!1}else b(e,l,n);if(o(u)){var h=!1;for(var m in u)if(!M(m)){h=!0,_(e,n);break}!h&&u.class&&nn(u.class)}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,s){if(!r(e)){var a,l=!1,f=[];if(r(t))l=!0,m(e,f);else{var p=o(t.nodeType);if(!p&&go(t,e))O(t,e,f,null,null,s);else{if(p){if(1===t.nodeType&&t.hasAttribute(z)&&(t.removeAttribute(z),n=!0),i(n)){if(F(t,e,f))return N(e,f,!0),t;"production"!==process.env.NODE_ENV&&Kn("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}a=t,t=new dt(c.tagName(a).toLowerCase(),{},[],void 0,a)}var d=t.elm,h=c.parentNode(d);if(m(e,f,d._leaveCb?null:h,c.nextSibling(d)),o(e.parent))for(var g=e.parent,v=D(e);g;){for(var y=0;y<u.destroy.length;++y)u.destroy[y](g);if(g.elm=e.elm,v){for(var b=0;b<u.create.length;++b)u.create[b](ho,g);var _=g.data.hook.insert;if(_.merged)for(var w=1;w<_.fns.length;w++)_.fns[w]()}else fo(g);g=g.parent}o(h)?C([t],0,0):o(t.tag)&&E(t)}}return N(e,f,l),e.elm}o(t)&&E(t)}}({nodeOps:lo,modules:[So,To,zo,Ho,ti,G?{create:Ai,activate:Ai,remove:function(t,e){!0!==t.data.show?ki(t,e):e()}}:{}].concat(Eo)});Z&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&$i(t,"input")}));var Oi={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?se(n,"postpatch",(function(){Oi.componentUpdated(t,e,n)})):Ni(t,e,n.context),t._vOptions=[].map.call(t.options,Fi)):("textarea"===n.tag||uo(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",Ii),t.addEventListener("compositionend",Bi),t.addEventListener("change",Bi),Z&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Ni(t,e,n.context);var r=t._vOptions,o=t._vOptions=[].map.call(t.options,Fi);if(o.some((function(t,e){return!$(t,r[e])})))(t.multiple?e.value.some((function(t){return Mi(t,o)})):e.value!==e.oldValue&&Mi(e.value,o))&&$i(t,"change")}}};function Ni(t,e,n){Ti(t,e,n),(X||Q)&&setTimeout((function(){Ti(t,e,n)}),0)}function Ti(t,e,n){var r=e.value,o=t.multiple;if(!o||Array.isArray(r)){for(var i,s,a=0,u=t.options.length;a<u;a++)if(s=t.options[a],o)i=R(r,Fi(s))>-1,s.selected!==i&&(s.selected=i);else if($(Fi(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}else"production"!==process.env.NODE_ENV&&Kn('<select multiple v-model="'.concat(e.expression,'"> ')+"expects an Array value for its binding, but got ".concat(Object.prototype.toString.call(r).slice(8,-1)),n)}function Mi(t,e){return e.every((function(e){return!$(e,t)}))}function Fi(t){return"_value"in t?t._value:t.value}function Ii(t){t.target.composing=!0}function Bi(t){t.target.composing&&(t.target.composing=!1,$i(t.target,"input"))}function $i(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ri(t){return!t.componentInstance||t.data&&t.data.transition?t:Ri(t.componentInstance._vnode)}var Li={bind:function(t,e,n){var r=e.value,o=(n=Ri(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,wi(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Ri(n)).data&&n.data.transition?(n.data.show=!0,r?wi(n,(function(){t.style.display=t.__vOriginalDisplay})):ki(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}},Pi={model:Oi,show:Li},zi={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 ji(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ji(Le(e.children)):t}function Vi(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[C(r)]=o[r];return e}function Hi(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Wi=function(t){return t.tag||Se(t)},Ui=function(t){return"show"===t.name},qi={name:"transition",props:zi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Wi)).length){"production"!==process.env.NODE_ENV&&n.length>1&&Kn("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;"production"!==process.env.NODE_ENV&&r&&"in-out"!==r&&"out-in"!==r&&Kn("invalid <transition> mode: "+r,this.$parent);var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=ji(o);if(!i)return o;if(this._leaving)return Hi(t,o);var a="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?a+"comment":a+i.tag:s(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var u=(i.data||(i.data={})).transition=Vi(this),l=this._vnode,c=ji(l);if(i.data.directives&&i.data.directives.some(Ui)&&(i.data.show=!0),c&&c.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,c)&&!Se(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var f=c.data.transition=T({},u);if("out-in"===r)return this._leaving=!0,se(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Hi(t,o);if("in-out"===r){if(Se(i))return l;var p,d=function(){p()};se(u,"afterEnter",d),se(u,"enterCancelled",d),se(f,"delayLeave",(function(t){p=t}))}}return o}}},Ki=T({tag:String,moveClass:String},zi);delete Ki.mode;var Ji={props:Ki,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=vn(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=Vi(this),a=0;a<o.length;a++){if((p=o[a]).tag)if(null!=p.key&&0!==String(p.key).indexOf("__vlist"))i.push(p),n[p.key]=p,(p.data||(p.data={})).transition=s;else if("production"!==process.env.NODE_ENV){var u=p.componentOptions,l=u?zn(u.Ctor.options)||u.tag||"":p.tag;Kn("<transition-group> children must be keyed: <".concat(l,">"))}}if(r){var c=[],f=[];for(a=0;a<r.length;a++){var p;(p=r[a]).data.transition=s,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?c.push(p):f.push(p)}this.kept=t(e,null,c),this.removed=f}return t(e,null,i)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(Gi),t.forEach(Yi),t.forEach(Xi),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,r=n.style;mi(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(ci,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(ci,t),n._moveCb=null,gi(n,e))})}})))},methods:{hasMove:function(t,e){if(!si)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){ri(n,t)})),ni(n,e),n.style.display="none",this.$el.appendChild(n);var r=bi(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Gi(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Yi(t){t.data.newPos=t.elm.getBoundingClientRect()}function Xi(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}var Zi={Transition:qi,TransitionGroup:Ji};function Qi(t){this.content=t}function ts(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=ts(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function es(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),u=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t<e&&s.text[s.text.length-t-1]==a.text[a.text.length-t-1];)t++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let t=es(s.content,a.content,n-1,r-1);if(t)return t}n-=u,r-=u}else n-=u,r-=u}}Br.config.mustUseProp=function(t,e,n){return"value"===n&&Ur(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Br.config.isReservedTag=so,Br.config.isReservedAttr=Wr,Br.config.getTagNamespace=function(t){return io(t)?"svg":"math"===t?"math":void 0},Br.config.isUnknownElement=function(t){if(!G)return!0;if(so(t))return!1;if(t=t.toLowerCase(),null!=ao[t])return ao[t];var e=document.createElement(t);return t.indexOf("-")>-1?ao[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ao[t]=/HTMLUnknownElement/.test(e.toString())},T(Br.options.directives,Pi),T(Br.options.components,Zi),Br.prototype.__patch__=G?Si:F,Br.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=ht,"production"!==process.env.NODE_ENV&&(t.$options.template&&"#"!==t.$options.template.charAt(0)||t.$options.el||e?Kn("You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",t):Kn("Failed to mount component: template or render function not defined.",t))),_n(t,"beforeMount"),r="production"!==process.env.NODE_ENV&&H.performance&&on?function(){var e=t._name,r=t._uid,o="vue-perf-start:".concat(r),i="vue-perf-end:".concat(r);on(o);var s=t._render();on(i),sn("vue ".concat(e," render"),o,i),on(o),t._update(s,n),on(i),sn("vue ".concat(e," patch"),o,i)}:function(){t._update(t._render(),n)};var o={before:function(){t._isMounted&&!t._isDestroyed&&_n(t,"beforeUpdate")}};"production"!==process.env.NODE_ENV&&(o.onTrack=function(e){return _n(t,"renderTracked",[e])},o.onTrigger=function(e){return _n(t,"renderTriggered",[e])}),new ln(t,r,F,o,!0),n=!1;var i=t._preWatchers;if(i)for(var s=0;s<i.length;s++)i[s].run();return null==t.$vnode&&(t._isMounted=!0,_n(t,"mounted")),t}(this,t=t&&G?function(t){if("string"==typeof t){return document.querySelector(t)||("production"!==process.env.NODE_ENV&&Kn("Cannot find element: "+t),document.createElement("div"))}return t}(t):void 0,e)},G&&setTimeout((function(){H.devtools&&(at?at.emit("init",Br):"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&console[console.info?"info":"log"]("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&!1!==H.productionTip&&"undefined"!=typeof console&&console[console.info?"info":"log"]("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html")}),0),Qi.prototype={constructor:Qi,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return-1==o?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Qi(i)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new Qi(n)},addToStart:function(t,e){return new Qi([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Qi(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(-1==i?o.length:i,0,e,n),new Qi(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Qi.from(t)).size?new Qi(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Qi.from(t)).size?new Qi(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Qi.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},Qi.from=function(t){if(t instanceof Qi)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Qi(e)};class ns{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],u=s+a.nodeSize;if(u>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new ns(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new ns(n,r)}cutByIndex(t,e){return t==e?ns.empty:0==t&&e==this.content.length?this:new ns(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new ns(r,o)}addToStart(t){return new ns([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new ns(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return ts(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return es(this,t,e,n)}findIndex(t,e=-1){if(0==t)return is(0,t);if(t==this.size)return is(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?is(n+1,o):is(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return ns.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new ns(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return ns.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new ns(e||t,n)}static from(t){if(!t)return ns.empty;if(t instanceof ns)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new ns([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ns.empty=new ns([],0);const rs={index:0,offset:0};function is(t,e){return rs.index=t,rs.offset=e,rs}function ss(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!ss(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!ss(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let as=class t{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&ss(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];let n=e.slice();return n.sort(((t,e)=>t.type.rank-e.type.rank)),n}};as.none=[];class us extends Error{}class ls{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=fs(this.content,t+this.openStart,e);return n&&new ls(n,this.openStart,this.openEnd)}removeBetween(t,e){return new ls(cs(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return ls.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new ls(ns.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new ls(t,n,r)}}function cs(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(cs(i.content,e-o-1,n-o-1)))}function fs(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=fs(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function ps(t,e,n){if(n.openStart>t.depth)throw new us("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new us("Inconsistent open depths");return ds(t,e,n,0)}function ds(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=ds(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(ns.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return ys(i,bs(t,o,s,e,r))}{let r=t.parent,o=r.content;return ys(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return ys(i,Ds(t,e,r))}function hs(t,e){if(!e.type.compatibleContent(t.type))throw new us("Cannot join "+e.type.name+" onto "+t.type.name)}function ms(t,e,n){let r=t.node(n);return hs(r,e.node(n)),r}function gs(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function vs(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(gs(t.nodeAfter,r),i++));for(let t=i;t<s;t++)gs(o.child(t),r);e&&e.depth==n&&e.textOffset&&gs(e.nodeBefore,r)}function ys(t,e){return t.type.checkContent(e),t.copy(e)}function bs(t,e,n,r,o){let i=t.depth>o&&ms(t,e,o+1),s=r.depth>o&&ms(n,r,o+1),a=[];return vs(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(hs(i,s),gs(ys(i,bs(t,e,n,r,o+1)),a)):(i&&gs(ys(i,Ds(t,e,o+1)),a),vs(e,n,o,a),s&&gs(ys(s,Ds(n,r,o+1)),a)),vs(r,null,o,a),new ns(a)}function Ds(t,e,n){let r=[];if(vs(null,t,n,r),t.depth>n){gs(ys(ms(t,e,n+1),Ds(t,e,n+1)),r)}return vs(e,null,n,r),new ns(r)}ls.empty=new ls(ns.empty,0,0);class _s{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return as.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new Cs(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(n.push(e,t,r+i),!s)break;if(e=e.child(t),e.isText)break;o=s-1,r+=i+1}return new _s(e,n,o)}static resolveCached(t,e){for(let n=0;n<ws.length;n++){let r=ws[n];if(r.pos==e&&r.doc==t)return r}let n=ws[ks]=_s.resolve(t,e);return ks=(ks+1)%Es,n}}let ws=[],ks=0,Es=12;class Cs{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const xs=Object.create(null);let As=class t{constructor(t,e,n,r=as.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||ns.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&ss(this.attrs,e||t.defaultAttrs||xs)&&as.sameSet(this.marks,n||as.none)}copy(e=null){return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return ls.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new ls(a,r.depth-i,o.depth-i)}replace(t,e,n){return ps(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return _s.resolveCached(this,t)}resolveNoCache(t){return _s.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Os(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=ns.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=as.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!as.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t=>t.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=ns.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}};As.prototype.text=void 0;class Ss extends As{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Os(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Ss(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Ss(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Os(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ns{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Ts(t,e);if(null==n.next)return Ns.empty;let r=Ms(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(Ls(t,0));function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);Ls(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new Ns(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(Rs);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}}(function(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((t=>t.to=e))}function i(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(i(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;e<t.min;e++){let e=n();o(i(t.expr,s),e),s=e}if(-1==t.max)o(i(t.expr,s),s);else for(let e=t.min;e<t.max;e++){let e=n();r(s,e),o(i(t.expr,s),e),s=e}return[r(s)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(t.exprs[r],e);if(r==t.exprs.length-1)return s;o(s,e=n())}}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(t,n);if(a&&(!e||a.validEnd))return ns.from(s.map((t=>t.createAndFill())));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r})).join("\n")}}Ns.empty=new Ns(!0);class Ts{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Ms(t){let e=[];do{e.push(Fs(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Fs(t){let e=[];do{e.push(Is(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Is(t){let e=function(t){if(t.eat("(")){let e=Ms(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&o.push(r)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=$s(t,e)}return e}function Bs(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function $s(t,e){let n=Bs(t),r=n;return t.eat(",")&&(r="}"!=t.next?Bs(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Rs(t,e){return e-t}function Ls(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(Rs)}function Ps(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function zs(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function js(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Hs(t[n]);return e}let Vs=class t{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=js(n.attrs),this.defaultAttrs=Ps(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ns.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:zs(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new As(this,this.computeAttrs(t),ns.from(e),as.setFrom(n))}createChecked(t=null,e,n){return e=ns.from(e),this.checkContent(e),new As(this,this.computeAttrs(t),e,as.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=ns.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(ns.empty,!0);return o?new As(this,t,e.append(o),as.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:as.none:t}static compile(e,n){let r=Object.create(null);e.forEach(((e,o)=>r[e]=new t(e,n,o)));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let t in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Hs{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Ws{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=js(r.attrs),this.excluded=null;let o=Ps(this.attrs);this.instance=o?new as(this,o):null}create(t=null){return!t&&this.instance?this.instance:new as(this,zs(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new Ws(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class Us{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=Qi.from(t.nodes),e.marks=Qi.from(t.marks||{}),this.nodes=Vs.compile(this.spec.nodes,this),this.marks=Ws.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",o=e.spec.marks;e.contentMatch=n[r]||(n[r]=Ns.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==o?null:o?qs(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:qs(this,n.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(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Vs))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new Ss(n,n.defaultAttrs,t,as.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return As.fromJSON(this,t)}markFromJSON(t){return as.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function qs(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}let Ks=class t{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new Qs(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Qs(this,e,!0);return n.addAll(t,e.from,e.to),ls.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(ta(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach((t=>{n(t=ea(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=ea(t)),t.node||t.ignore||t.mark||(t.node=e)}))}return e}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}};const Js={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},Gs={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ys={ol:!0,ul:!0};function Xs(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Zs{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=as.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(ns.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=ns.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(ns.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):na(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Js.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Qs{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=Xs(null,e.preserveWhitespace,0)|(n?4:0);r=o?new Zs(o.type,o.attrs,as.none,as.none,!0,e.topMatch||o.type.contentMatch,i):new Zs(n?null:t.schema.topNodeType,null,as.none,as.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let e=t.getAttribute("style");if(e){let n=this.readStyles(function(t){let e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e));if(!n)return;let[r,o]=n,i=this.top;for(let t=0;t<o.length;t++)this.removePendingMark(o[t],i);for(let t=0;t<r.length;t++)this.addPendingMark(r[t]);this.addElement(t);for(let t=0;t<r.length;t++)this.removePendingMark(r[t],i);for(let t=0;t<o.length;t++)this.addPendingMark(o[t])}else this.addElement(t)}}addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n,r=t.nodeName.toLowerCase();Ys.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&Ys.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:Gs.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let e,n=this.top,i=this.needsBlock;if(Js.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),e=!0,n.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),e&&this.sync(n),this.needsBlock=i}else this.addElementByRule(t,o,!1===o.consuming?n:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=as.none,n=as.none;t:for(let r=0;r<t.length;r+=2)for(let o;;){let i=this.parser.matchStyle(t[r],t[r+1],this,o);if(!i)continue t;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.forEach((t=>{i.clearMark(t)&&(n=t.addToSet(n))})):e=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(e),!1!==i.consuming)break;o=i}return[e,n]}addElementByRule(t,e,n){let r,o,i;if(e.node)o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs||null,e.preserveWhitespace);else{i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i)}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)e.type&&!e.type.allowsMarkType(t.marks[r].type)||(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let i=Xs(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new Zs(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));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(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function ta(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ea(t){let e={};for(let n in t)e[n]=t[n];return e}function na(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class ra{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=ia(e).createDocumentFragment());let r=n,o=[];return t.forEach((t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))})),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=ra.renderSpec(ia(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&ra.renderSpec(ia(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],u=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){u=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let o=u;o<e.length;o++){let i=e[o];if(0===i){if(o<e.length-1||o>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=ra.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ra(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=oa(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return oa(t.marks)}}function oa(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ia(t){return t.document||window.document}const sa=Math.pow(2,16);function aa(t,e){return t+e*sa}function ua(t){return 65535&t}class la{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class ca{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&ca.empty)return ca.empty}recover(t){let e=0,n=ua(t);if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/sa}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let u=this.ranges[s+o],l=this.ranges[s+i],c=a+u;if(t<=c){let o=a+r+((u?t==a?-1:t==c?1:e:e)<0?0:l);if(n)return o;let i=t==(e<0?a:c)?null:aa(s/3,t-a),f=t==a?2:t==c?1:4;return(e<0?t!=a:t!=c)&&(f|=8),new la(o,f,i)}r+=l-u}return n?t+r:new la(t+r,0,null)}touches(t,e){let n=0,r=ua(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+o];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),u=this.ranges[r+e],l=this.ranges[r+n];t(s,s+u,a,a+l),o+=l-u}}invert(){return new ca(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?ca.empty:new ca(t<0?[0,-t,0]:[0,0,t])}}ca.empty=new ca([]);class fa{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new fa(this.maps,this.mirror,t,e)}copy(){return new fa(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new fa;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(t,e);if(null!=o.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new la(t,r,null)}}const pa=Object.create(null);class da{getMap(){return ca.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=pa[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in pa)throw new RangeError("Duplicate use of step JSON ID "+t);return pa[t]=e,e.prototype.jsonID=t,e}}class ha{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new ha(t,null)}static fail(t){return new ha(null,t)}static fromReplace(t,e,n,r){try{return ha.ok(t.replace(e,n,r))}catch(t){if(t instanceof us)return ha.fail(t.message);throw t}}}function ma(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(ma(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return ns.fromArray(r)}class ga extends da{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new ls(ma(e.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return ha.fromReplace(t,this.from,this.to,o)}invert(){return new va(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new ga(e.pos,n.pos,this.mark)}merge(t){return t instanceof ga&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ga(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ga(e.from,e.to,t.markFromJSON(e.mark))}}da.jsonID("addMark",ga);class va extends da{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new ls(ma(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return ha.fromReplace(t,this.from,this.to,n)}invert(){return new ga(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new va(e.pos,n.pos,this.mark)}merge(t){return t instanceof va&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new va(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new va(e.from,e.to,t.markFromJSON(e.mark))}}da.jsonID("removeMark",va);class ya extends da{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return ha.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return ha.fromReplace(t,this.pos,this.pos+1,new ls(ns.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new ya(this.pos,e.marks[n]);return new ya(this.pos,this.mark)}}return new ba(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new ya(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ya(e.pos,t.markFromJSON(e.mark))}}da.jsonID("addNodeMark",ya);class ba extends da{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return ha.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return ha.fromReplace(t,this.pos,this.pos+1,new ls(ns.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new ya(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new ba(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ba(e.pos,t.markFromJSON(e.mark))}}da.jsonID("removeNodeMark",ba);class Da extends da{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&wa(t,this.from,this.to)?ha.fail("Structure replace would overwrite content"):ha.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new ca([this.from,this.to-this.from,this.slice.size])}invert(t){return new Da(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new Da(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof Da)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?ls.empty:new ls(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Da(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?ls.empty:new ls(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Da(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Da(e.from,e.to,ls.fromJSON(t,e.slice),!!e.structure)}}da.jsonID("replace",Da);class _a extends da{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(wa(t,this.from,this.gapFrom)||wa(t,this.gapTo,this.to)))return ha.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return ha.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?ha.fromReplace(t,this.from,this.to,n):ha.fail("Content does not fit in gap")}getMap(){return new ca([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new _a(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new _a(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _a(e.from,e.to,e.gapFrom,e.gapTo,ls.fromJSON(t,e.slice),e.insert,!!e.structure)}}function wa(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function ka(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ea(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!ka(r,o,i))break}return null}function Ca(t,e,n=null,r=t){let o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<o;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(xa).concat({type:e,attrs:n}).concat(i.map(xa)):null}function xa(t){return{type:t,attrs:null}}function Aa(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let t=o.depth-1,e=n-2;t>i;t--,e--){let n=o.node(t),i=o.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[e]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),u=r&&r[0];return o.node(i).canReplaceWith(a,a,u?u.type:o.node(i+1).type)}function Sa(t,e){let n=t.resolve(e),r=n.index();return Oa(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Oa(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function Na(t,e,n=-1){let r=t.resolve(e);for(let t=r.depth;;t--){let o,i,s=r.index(t);if(t==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(t+1),s++,i=r.node(t).maybeChild(s)):(o=r.node(t).maybeChild(s-1),i=r.node(t+1)),o&&!o.isTextblock&&Oa(o,i)&&r.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function Ta(t,e,n=e,r=ls.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Ma(o,i,r)?new Da(e,n,r):new Fa(o,i,r).fit()}function Ma(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}da.jsonID("replaceAround",_a);class Fa{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=ns.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=ns.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new ls(o,i,s);return t>-1?new _a(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new Da(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=$a(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],u=null;if(1==t&&(o?a.matchType(o.type)||(u=a.fillBefore(ns.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:n,parent:r,inject:u};if(2==t&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=$a(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new ls(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=$a(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new ls(Ia(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new ls(Ia(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-t,u=0,l=[],{match:c,type:f}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)l.push(r.child(t));c=c.matchFragment(r)}let p=s.size+t-(i.content.size-i.openEnd);for(;u<s.childCount;){let t=s.child(u),e=c.matchType(t.type);if(!e)break;u++,(u>1||0==a||t.content.size)&&(c=e,l.push(Ra(t.mark(f.allowedMarks(t.marks)),1==u?a:0,u==s.childCount?p:-1)))}let d=u==s.childCount;d||(p=-1),this.placed=Ba(this.placed,e,ns.from(l)),this.frontier[e].match=c,d&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t<p;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=d?0==t?ls.empty:new ls(Ia(i.content,t-1,1),t-1,p<0?i.openEnd:t-1):new ls(Ia(i.content,t,u),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!La(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=La(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=La(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Ba(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Ba(this.placed,this.depth,ns.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ns.empty,!0);t.childCount&&(this.placed=Ba(this.placed,this.frontier.length,t))}}function Ia(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ia(t.firstChild.content,e-1,n)))}function Ba(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ba(t.lastChild.content,e-1,n)))}function $a(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Ra(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Ra(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ns.empty,!0)))),t.copy(r)}function La(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function Pa(t){return t.spec.defining||t.spec.definingForContent}function za(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(za(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(ns.empty,!0))}return t}function ja(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class Va extends da{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return ha.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return ha.fromReplace(t,this.pos,this.pos+1,new ls(ns.from(r),0,e.isLeaf?0:1))}getMap(){return ca.empty}invert(t){return new Va(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Va(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Va(e.pos,e.attr,e.value)}}da.jsonID("attr",Va);let Ha=class extends Error{};Ha=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Ha.prototype=Object.create(Error.prototype)).constructor=Ha,Ha.prototype.name="TransformError";class Wa{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new fa}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ha(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=ls.empty){let r=Ta(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new ls(ns.from(n),0,0))}delete(t,e){return this.replace(t,e,ls.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(Ma(o,i,r))return t.step(new Da(e,n,r));let s=ja(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let u=s.indexOf(a),l=[],c=r.openStart;for(let t=r.content,e=0;;e++){let n=t.firstChild;if(l.push(n),e==r.openStart)break;t=n.content}for(let t=c-1;t>=0;t--){let e=l[t].type,n=Pa(e);if(n&&o.node(u).type!=e)c=t;else if(n||!e.isTextblock)break}for(let e=r.openStart;e>=0;e--){let a=(e+c+1)%(r.openStart+1),f=l[a];if(f)for(let e=0;e<s.length;e++){let l=s[(e+u)%s.length],c=!0;l<0&&(c=!1,l=-l);let p=o.node(l-1),d=o.index(l-1);if(p.canReplaceWith(d,d,f.type,f.marks))return t.replace(o.before(l),c?i.after(l):n,new ls(za(r.content,0,r.openStart,a),a,r.openEnd))}}let f=t.steps.length;for(let a=s.length-1;a>=0&&(t.replace(e,n,r),!(t.steps.length>f));a--){let t=s[a];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)return null}return null}(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new ls(ns.from(r),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=ja(r,o);for(let e=0;e<i.length;e++){let n=i[e],s=e==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return t.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),u=s,l=a,c=ns.empty,f=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,c=ns.from(r.node(t).copy(c)),f++):u--;let p=ns.empty,d=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,p=ns.from(o.node(t).copy(p)),d++):l++;t.step(new _a(u,l,s,a,new ls(c.append(p),f,d),c.size-f,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new Da(e-n,e+n,ls.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=ns.empty;for(let t=n.length-1;t>=0;t--){if(r.size){let e=n[t].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ns.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new _a(o,i,o,i,new ls(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),a=s.map(n,1),u=s.map(n+e.nodeSize,1);return t.step(new _a(a,u,a+1,u-1,new ls(ns.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new _a(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new ls(ns.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new Va(t,e,n)),this}addNodeMark(t,e){return this.step(new ya(t,e)),this}removeNodeMark(t,e){if(!(e instanceof as)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new ba(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=ns.empty,s=ns.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=ns.from(o.node(t).copy(i));let e=r&&r[a];s=ns.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new Da(e,e,new ls(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,u,l)=>{if(!t.isInline)return;let c=t.marks;if(!r.isInSet(c)&&l.type.allowsMarkType(r.type)){let l=Math.max(u,e),f=Math.min(u+t.nodeSize,n),p=r.addToSet(c);for(let t=0;t<c.length;t++)c[t].isInSet(p)||(o&&o.to==l&&o.mark.eq(c[t])?o.to=f:s.push(o=new va(l,f,c[t])));i&&i.to==l?i.to=f:a.push(i=new ga(l,f,r))}})),s.forEach((e=>t.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof Ws){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,u=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&u.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:u,from:Math.max(s,e),to:r,step:i})}}})),o.forEach((e=>t.step(new va(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let e=0;e<o.childCount;e++){let a=o.child(e),u=s+a.nodeSize,l=r.matchType(a.type);if(l){r=l;for(let e=0;e<a.marks.length;e++)n.allowsMarkType(a.marks[e].type)||t.step(new va(s,u,a.marks[e]))}else i.push(new Da(s,u,ls.empty));s=u}if(!r.validEnd){let e=r.fillBefore(ns.empty,!0);t.replace(s,s,new ls(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}const Ua=Object.create(null);class qa{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Ka(t.min(e),t.max(e))]}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 t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=ls.empty){let n=e.content.lastChild,r=null;for(let t=0;t<e.openEnd;t++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:u}=i[s],l=t.mapping.slice(o);t.replaceRange(l.map(a.pos),l.map(u.pos),s?ls.empty:e),0==s&&ru(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),u=a.map(i.pos),l=a.map(s.pos);o?t.deleteRange(u,l):(t.replaceRangeWith(u,l,e),ru(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Ya(t):nu(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let o=e<0?nu(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):nu(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new tu(t.node(0))}static atStart(t){return nu(t,t,0,0,1)||new tu(t)}static atEnd(t){return nu(t,t,t.content.size,t.childCount,-1)||new tu(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Ua[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Ua)throw new RangeError("Duplicate use of selection JSON ID "+t);return Ua[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Ya.between(this.$anchor,this.$head).getBookmark()}}qa.prototype.visible=!0;class Ka{constructor(t,e){this.$from=t,this.$to=e}}let Ja=!1;function Ga(t){Ja||t.parent.inlineContent||(Ja=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ya extends qa{constructor(t,e=t){Ga(t),Ga(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return qa.near(n);let r=t.resolve(e.map(this.anchor));return new Ya(r.parent.inlineContent?r:n,n)}replace(t,e=ls.empty){if(super.replace(t,e),e==ls.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Ya&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Xa(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ya(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=qa.findFrom(e,n,!0)||qa.findFrom(e,-n,!0);if(!t)return qa.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(qa.findFrom(t,-n,!0)||qa.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new Ya(t,e)}}qa.jsonID("text",Ya);class Xa{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Xa(t.map(this.anchor),t.map(this.head))}resolve(t){return Ya.between(t.resolve(this.anchor),t.resolve(this.head))}}class Za extends qa{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?qa.near(o):new Za(o)}content(){return new ls(ns.from(this.node),0,0)}eq(t){return t instanceof Za&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Qa(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Za(t.resolve(e.anchor))}static create(t,e){return new Za(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Za.prototype.visible=!1,qa.jsonID("node",Za);class Qa{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new Xa(n,n):new Qa(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Za.isSelectable(n)?new Za(e):qa.near(e)}}class tu extends qa{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=ls.empty){if(e==ls.empty){t.delete(0,t.doc.content.size);let e=qa.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new tu(t)}map(t){return new tu(t)}eq(t){return t instanceof tu}getBookmark(){return eu}}qa.jsonID("all",tu);const eu={map(){return this},resolve:t=>new tu(t)};function nu(t,e,n,r,o,i=!1){if(e.inlineContent)return Ya.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Za.isSelectable(r))return Za.create(t,n-(o<0?r.nodeSize:0))}else{let e=nu(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function ru(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof Da||i instanceof _a)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(qa.near(t.doc.resolve(o),n)))}function ou(t,e){return e&&t?t.bind(e):t}class iu{constructor(t,e,n){this.name=t,this.init=ou(e.init,n),this.apply=ou(e.apply,n)}}function su(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=su(o,e,{})),n[r]=o}return n}new iu("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new iu("selection",{init:(t,e)=>t.selection||qa.atStart(e.doc),apply:t=>t.selection}),new iu("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new iu("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e});class au{constructor(t){this.spec=t,this.props={},t.props&&su(t.props,this,this.props),this.key=t.key?t.key.key:lu("plugin")}getState(t){return t[this.key]}}const uu=Object.create(null);function lu(t){return t in uu?t+"$"+ ++uu[t]:(uu[t]=0,t+"$")}class cu{constructor(t="key"){this.key=lu(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const fu=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},pu=function(t,e,n,r){return n&&(hu(t,e,n,r,-1)||hu(t,e,n,r,1))},du=/^(img|br|input|textarea|hr)$/i;function hu(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:mu(t))){let n=t.parentNode;if(!n||1!=n.nodeType||gu(t)||du.test(t.nodeName)||"false"==t.contentEditable)return!1;e=fu(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?mu(t):0}}}function mu(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function gu(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const vu=function(t){return t.focusNode&&pu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function yu(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const bu="undefined"!=typeof navigator?navigator:null,Du="undefined"!=typeof document?document:null,_u=bu&&bu.userAgent||"",wu=/Edge\/(\d+)/.exec(_u),ku=/MSIE \d/.exec(_u),Eu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(_u),Cu=!!(ku||Eu||wu),xu=ku?document.documentMode:Eu?+Eu[1]:wu?+wu[1]:0,Au=!Cu&&/gecko\/(\d+)/i.test(_u);Au&&(/Firefox\/(\d+)/.exec(_u)||[0,0])[1];const Su=!Cu&&/Chrome\/(\d+)/.exec(_u),Ou=!!Su,Nu=Su?+Su[1]:0,Tu=!Cu&&!!bu&&/Apple Computer/.test(bu.vendor),Mu=Tu&&(/Mobile\/\w+/.test(_u)||!!bu&&bu.maxTouchPoints>2),Fu=Mu||!!bu&&/Mac/.test(bu.platform),Iu=/Android \d/.test(_u),Bu=!!Du&&"webkitFontSmoothing"in Du.documentElement.style,$u=Bu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ru(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,u,l=r.resolve(s);if(vu(n)){for(a=l;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Za.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==mu(t);r||o;){if(t==n)return!0;let e=fu(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==mu(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;u=new Za(s==t?l:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}if(!u){u=Uu(t,a,l,"pointer"==e||t.state.selection.head<l.pos&&!i?1:-1)}return u}function Lu(t){return t.editable?t.hasFocus():function(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Pu(t,e=!1){let n=t.state.selection;if(function(t,e){if(e instanceof Za){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Wu(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Wu(t)}(t,n),Lu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Ou){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&pu(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,fu(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Cu&&xu<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!zu||n instanceof Ya||(n.$from.parent.inlineContent||(r=ju(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=ju(t,n.to))),t.docView.setSelection(i,s,t.root,e),zu&&(r&&Hu(r),o&&Hu(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Lu(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const zu=Tu||Ou&&Nu<63;function ju(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Tu&&o&&"false"==o.contentEditable)return Vu(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Vu(o);if(i)return Vu(i)}}function Vu(t){return t.contentEditable="true",Tu&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Hu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Wu(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Uu(t,e,n,r){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||Ya.between(e,n,r)}function qu(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&qa.findFrom(i,e)}function Ku(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Ju(t,e,n){let r=t.state.selection;if(!(r instanceof Ya)){if(r instanceof Za&&r.node.isInline)return Ku(t,new Ya(e>0?r.$to:r.$from));{let n=qu(t.state,e);return!!n&&Ku(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=qu(t.state,e);return!!(n&&n instanceof Za)&&Ku(t,n)}if(!(Fu&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Za.isSelectable(i)?Ku(t,new Za(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Bu&&Ku(t,new Ya(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Gu(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Yu(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Xu(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(Au&&1==n.nodeType&&r<Gu(n)&&Yu(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Yu(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Qu(n))break;{let e=n.previousSibling;for(;e&&Yu(e);)o=n.parentNode,i=fu(e),e=e.previousSibling;if(e)n=e,r=Gu(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?tl(t,n,r):o&&tl(t,o,i)}function Zu(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Gu(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Yu(n.childNodes[r]))break;o=n,i=++r}else{if(Qu(n))break;{let e=n.nextSibling;for(;e&&Yu(e);)o=e.parentNode,i=fu(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=Gu(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&tl(t,o,i)}function Qu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function tl(t,e,n){let r=t.domSelection();if(vu(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout((()=>{t.state==o&&Pu(t)}),50)}function el(t,e,n){let r=t.state.selection;if(r instanceof Ya&&!r.empty||n.indexOf("s")>-1)return!1;if(Fu&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=qu(t.state,e);if(n&&n instanceof Za)return Ku(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof tu?qa.near(n,e):qa.findFrom(n,e);return!!s&&Ku(t,s)}return!1}function nl(t,e){if(!(t.state.selection instanceof Ya))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function rl(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function ol(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Fu&&72==n&&"c"==r?nl(t,-1)||Xu(t):46==n||Fu&&68==n&&"c"==r?nl(t,1)||Zu(t):13==n||27==n||(37==n||Fu&&66==n&&"c"==r?Ju(t,-1,r)||Xu(t):39==n||Fu&&70==n&&"c"==r?Ju(t,1,r)||Zu(t):38==n||Fu&&80==n&&"c"==r?el(t,-1,r)||Xu(t):40==n||Fu&&78==n&&"c"==r?function(t){if(!Tu||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;rl(t,n,"true"),setTimeout((()=>rl(t,n,"false")),20)}return!1}(t)||el(t,1,r)||Zu(t):r==(Fu?"m":"c")&&(66==n||73==n||89==n||90==n))}function il(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||ra.fromSchema(t.state.schema),a=ml(),u=a.createElement("div");u.appendChild(s.serializeFragment(r,{document:a}));let l,c=u.firstChild,f=0;for(;c&&1==c.nodeType&&(l=dl[c.nodeName.toLowerCase()]);){for(let t=l.length-1;t>=0;t--){let e=a.createElement(l[t]);for(;u.firstChild;)e.appendChild(u.firstChild);u.appendChild(e),f++}c=u.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${o} ${i}${f?` -${f}`:""} ${JSON.stringify(n)}`),{dom:u,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function sl(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let u=e&&(r||a||!n);if(u){if(t.someProp("transformPastedText",(n=>{e=n(e,a||r,t)})),a)return e?new ls(ns.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):ls.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,o,r,t)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=ra.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),i=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=ml().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&dl[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"</"+t+">")).reverse().join(""));if(r.innerHTML=t,n)for(let t=0;t<n.length;t++)r=r.querySelector(n[t])||r;return r}(n),Bu&&function(t){let e=t.querySelectorAll(Ou?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(i);let l=i&&i.querySelector("[data-pm-slice]"),c=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let t=+c[3];t>0;t--){let t=i.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Ks.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!u&&!c),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||al.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=n.length-2;t>=0;t-=2){let e=r.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;o=ns.from(e.create(n[t+1],o)),i++,s++}return new ls(o,i,s)}(pl(s,+c[1],+c[2]),c[4]);else if(s=ls.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&ll(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=cl(i[i.length-1],r.length));let e=ul(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return ns.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t<s.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=s.content.lastChild;e<s.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);s=pl(s,t,e)}return t.someProp("transformPasted",(e=>{s=e(s,t)})),s}const al=/^(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 ul(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ns.from(t));return t}function ll(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=ll(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(ns.from(ul(n,t,o+1))))}}function cl(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,cl(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ns.empty,!0);return t.copy(n.append(r))}function fl(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return o<r-1&&(a=fl(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ns.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function pl(t,e,n){return e<t.openStart&&(t=new ls(fl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ls(fl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const dl={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let hl=null;function ml(){return hl||(hl=document.implementation.createHTMLDocument("title"))}const gl={},vl={};function yl(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function bl(t){return{left:t.clientX,top:t.clientY}}function Dl(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(t.someProp(e,(e=>r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function _l(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function wl(t,e,n,r,o){return Dl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Za&&(n=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);if(Za.isSelectable(e)){r=n&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=r&&(_l(t,Za.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Za.isSelectable(r))&&(_l(t,new Za(n),"pointer"),!0)}(t,n))}function kl(t,e,n,r){return Dl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function El(t,e,n,r){return Dl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(_l(t,Ya.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let e=o.depth+1;e>0;e--){let n=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(n.inlineContent)_l(t,Ya.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Za.isSelectable(n))continue;_l(t,Za.create(r,i),"pointer")}return!0}}(t,n,r)}function Cl(t){return Ml(t)}vl.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Sl(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Iu||!Ou||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Mu||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||ol(t,n)?n.preventDefault():yl(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,yu(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},vl.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},vl.keypress=(t,e)=>{let n=e;if(Sl(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Fu&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Ya&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const xl=Fu?"metaKey":"ctrlKey";gl.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Cl(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[xl]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(bl(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Al(t,s,n,!!r)):("doubleClick"==i?kl:El)(t,s.pos,s.inside,n)?n.preventDefault():yl(t,"pointer"))};class Al{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[xl],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:u}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||u instanceof Za&&u.from<=i&&u.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Au||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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),yl(t,"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((()=>Pu(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(bl(t))),this.updateAllowDefault(t),this.allowDefault||!e?yl(this.view,"pointer"):wl(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Tu&&this.mightDrag&&!this.mightDrag.node.isAtom||Ou&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(_l(this.view,qa.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):yl(this.view,"pointer")}move(t){this.updateAllowDefault(t),yl(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function Sl(t,e){return!!t.composing||!!(Tu&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}gl.touchstart=t=>{t.input.lastTouch=Date.now(),Cl(t),yl(t,"pointer")},gl.touchmove=t=>{t.input.lastTouch=Date.now(),yl(t,"pointer")},gl.contextmenu=t=>Cl(t);const Ol=Iu?5e3:-1;function Nl(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Ml(t)),e))}function Tl(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Ml(t,e=!1){if(!(Iu&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Tl(t),e||t.docView&&t.docView.dirty){let e=Ru(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}vl.compositionstart=vl.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Ml(t,!0),t.markCursor=null;else if(Ml(t),Au&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}Nl(t,Ol)},vl.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,Nl(t,20))};const Fl=Cu&&xu<15||Mu&&$u<604;function Il(t,e,n,r){let o=sl(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||ls.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}gl.copy=vl.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Fl?null:n.clipboardData,s=r.content(),{dom:a,text:u}=il(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",u)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},vl.paste=(t,e)=>{let n=e;if(t.composing&&!Iu)return;let r=Fl?null:n.clipboardData;r&&Il(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Il(t,r.value,null,e):Il(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class Bl{constructor(t,e){this.slice=t,this.move=e}}const $l=Fu?"altKey":"ctrlKey";gl.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(bl(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Za?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Za.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Za.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:u}=il(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Fl?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Fl||n.dataTransfer.setData("text/plain",u),t.dragging=new Bl(s,!n[$l])},gl.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},vl.dragover=vl.dragenter=(t,e)=>e.preventDefault(),vl.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(bl(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=sl(t,n.dataTransfer.getData(Fl?"Text":"text/plain"),Fl?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[$l]);if(t.someProp("handleDrop",(e=>e(t,n,s||ls.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let u=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let t=0;t<n.openStart;t++)o=o.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,i=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}(t.state.doc,i.pos,s):i.pos;null==u&&(u=i.pos);let l=t.state.tr;a&&l.deleteSelection();let c=l.mapping.map(u),f=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=l.doc;if(f?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(p))return;let d=l.doc.resolve(c);if(f&&Za.isSelectable(s.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Za(d));else{let e=l.mapping.map(u);l.mapping.maps[l.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),l.setSelection(Uu(t,d,l.doc.resolve(e)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))},gl.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Pu(t)}),20))},gl.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},gl.beforeinput=(t,e)=>{if(Ou&&Iu&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,yu(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in vl)gl[t]=vl[t];function Rl(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Ll{constructor(t,e){this.toDOM=t,this.spec=e||Hl,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new jl(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Ll&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Rl(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Pl{constructor(t,e){this.attrs=t,this.spec=e||Hl}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new jl(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Pl&&Rl(this.attrs,t.attrs)&&Rl(this.spec,t.spec)}static is(t){return t.type instanceof Pl}destroy(){}}class zl{constructor(t,e){this.attrs=t,this.spec=e||Hl}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new jl(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof zl&&Rl(this.attrs,t.attrs)&&Rl(this.spec,t.spec)}destroy(){}}class jl{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new jl(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new jl(t,t,new Ll(e,n))}static inline(t,e,n,r){return new jl(t,e,new Pl(n,r))}static node(t,e,n,r){return new jl(t,e,new zl(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Pl}}const Vl=[],Hl={};class Wl{constructor(t,e){this.local=t.length?t:Vl,this.children=e.length?e:Vl}static create(t,e){return e.length?Yl(e,t,0,Hl):Ul}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==Ul||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Hl)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice();for(let t=0,e=i;t<n.maps.length;t++){let r=0;n.maps[t].forEach(((t,n,i,s)=>{let u=s-i-(n-t);for(let s=0;s<a.length;s+=3){let l=a[s+1];if(l<0||t>l+e-r)continue;let c=a[s]+e-r;n>=c?a[s+1]=t<=c?-2:-1:i>=o&&u&&(a[s]+=u,a[s+1]+=u)}r+=u})),e=n.maps[t].map(e,-1)}let u=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){u=!0,a[e+1]=-1;continue}let l=n.map(t[e]+i),c=l-o;if(c<0||c>=r.content.size){u=!0;continue}let f=n.map(t[e+1]+i,-1)-o,{index:p,offset:d}=r.content.findIndex(c),h=r.maybeChild(p);if(h&&d==c&&d+h.nodeSize==f){let r=a[e+2].mapInner(n,h,l+1,t[e]+i+1,s);r!=Ul?(a[e]=c,a[e+1]=f,a[e+2]=r):(a[e+1]=-2,u=!0)}else u=!0}if(u){let u=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let n=0;n<t.length;n+=3)-1==t[n+1]&&a(t[n+2],e[n]+i+1);return n}(a,t,e,n,o,i,s),l=Yl(u,r,0,s);e=l.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<l.children.length;t+=3){let n=l.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,l.children[t],l.children[t+1],l.children[t+2])}}return new Wl(e.sort(Xl),a)}(this.children,i||[],t,e,n,r,o):i?new Wl(i.sort(Xl),Vl):Ul}add(t,e){return e.length?this==Ul?Wl.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach(((t,i)=>{let s,a=i+n;if(s=Jl(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,Yl(s,t,a+1,Hl)),o+=3}}));let i=Kl(o?Gl(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new Wl(i.length?this.local.concat(i).sort(Xl):this.local,r||this.children)}remove(t){return 0==t.length||this==Ul?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+e,s=n[r+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=Ul?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<t.length;o++)if(n=t[o])for(let t=0;t<r.length;t++)r[t].eq(n,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Wl(r,n):Ul}forChild(t,e){if(this==Ul)return this;if(e.isLeaf)return Wl.empty;let n,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(n=this.children[e+2]);break}let o=t+1,i=o+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<i&&e.to>o&&e.type instanceof Pl){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let t=new Wl(r.sort(Xl),Vl);return n?new ql([t,n]):t}return n||Ul}eq(t){if(this==t)return!0;if(!(t instanceof Wl)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Zl(this.localsInner(t))}localsInner(t){if(this==Ul)return Vl;if(t.inlineContent||!this.local.some(Pl.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof Pl||e.push(this.local[t]);return e}}Wl.empty=new Wl([],[]),Wl.removeOverlap=Zl;const Ul=Wl.empty;class ql{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,Hl)));return ql.from(n)}forChild(t,e){if(e.isLeaf)return Wl.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=Ul&&(o instanceof ql?n=n.concat(o.members):n.push(o))}return ql.from(n)}eq(t){if(!(t instanceof ql)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?Zl(n?e:e.sort(Xl)):Vl}static from(t){switch(t.length){case 0:return Ul;case 1:return t[0];default:return new ql(t.every((t=>t instanceof Wl))?t:t.reduce(((t,e)=>t.concat(e instanceof Wl?e:e.members)),[]))}}}function Kl(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new jl(o.from+e,o.to+e,o.type))}return n}function Jl(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>n&&e.to<r&&((o||(o=[])).push(e),t[i]=null);return o}function Gl(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Yl(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=Jl(t,e,s+n);if(a){i=!0;let t=Yl(a,e,n+s+1,r);t!=Ul&&o.push(s,s+e.nodeSize,t)}}));let s=Kl(i?Gl(t):t,-n).sort(Xl);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||(r.onRemove&&r.onRemove(s[t].spec),s.splice(t--,1));return s.length||o.length?new Wl(s,o):Ul}function Xl(t,e){return t.from-e.from||t.to-e.to}function Zl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Ql(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Ql(e,o+1,i.copy(r.to,i.to)))}}return e}function Ql(t,e,n){for(;e<t.length&&Xl(n,t[e])>0;)e++;t.splice(e,0,n)}for(var tc={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:"'"},ec={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nc="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),rc="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),oc="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ic=rc||nc&&+nc[1]<57,sc=0;sc<10;sc++)tc[48+sc]=tc[96+sc]=String(sc);for(sc=1;sc<=24;sc++)tc[sc+111]="F"+sc;for(sc=65;sc<=90;sc++)tc[sc]=String.fromCharCode(sc+32),ec[sc]=String.fromCharCode(sc);for(var ac in tc)ec.hasOwnProperty(ac)||(ec[ac]=tc[ac]);const uc="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function lc(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let t=0;t<i.length-1;t++){let s=i[t];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);uc?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function cc(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function fc(t){let e=function(t){let e=Object.create(null);for(let n in t)e[lc(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!(ic&&(t.ctrlKey||t.altKey||t.metaKey)||oc&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?ec:tc)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[cc(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=tc[n.keyCode])&&r!=o){let o=e[cc(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[cc(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}function pc(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function dc(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function hc(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function mc(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function gc(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Sa(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,a=ns.empty;for(let t=r.length-1;t>=0;t--)a=ns.from(r[t].create(null,a));a=ns.from(i.copy(a));let u=t.tr.step(new _a(e.pos-1,o,e.pos,o,new ls(a,1,0),r.length,!0)),l=o+2*r.length;Sa(u.doc,l)&&u.join(l),n(u.scrollIntoView())}return!0}let u=qa.findFrom(e,1),l=u&&u.$from.blockRange(u.$to),c=l&&Ea(l);if(null!=c&&c>=e.depth)return n&&n(t.tr.lift(l,c).scrollIntoView()),!0;if(a&&pc(s,"start",!0)&&pc(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,u=1;for(;!a.isTextblock;a=a.firstChild)u++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=ns.empty;for(let t=o.length-1;t>=0;t--)r=ns.from(o[t].copy(r));n(t.tr.step(new _a(e.pos-o.length,e.pos+s.nodeSize,e.pos+u,e.pos+s.nodeSize-u,new ls(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function vc(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Ya.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const yc=vc(-1),bc=vc(1);function Dc(t,e=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,t,e)}r(o.scrollIntoView())}return!0}}function _c(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,u=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);u=new Cs(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new Cs(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let l=Ca(u,t,e,s);return!!l&&(r&&r(function(t,e,n,r,o){let i=ns.empty;for(let t=n.length-1;t>=0;t--)i=ns.from(n[t].type.create(n[t].attrs,i));t.step(new _a(e.start-(r?2:0),e.end,e.start,e.end,new ls(i,0,0),n.length,!0));let s=0;for(let t=0;t<n.length;t++)n[t].type==o&&(s=t+1);let a=n.length-s,u=e.start+n.length-(r?2:0),l=e.parent;for(let n=e.startIndex,r=e.endIndex,o=!0;n<r;n++,o=!1)!o&&Aa(t.doc,u,a)&&(t.split(u,a),u+=2*a),u+=l.child(n).nodeSize;return t}(n.tr,s,l,a,t).scrollIntoView()),!0)}}function wc(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!i&&(!n||(r.node(i.depth-1).type==t?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new _a(i-1,s,i,s,new ls(ns.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Cs(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Ea(r);if(null==a)return!1;o.lift(r,a);let u=o.mapping.map(i,-1)-1;Sa(o.doc,u)&&o.join(u);return e(o.scrollIntoView()),!0}(e,n,t,i):function(t,e,n){let r=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,i=n.startIndex;e>i;e--)t-=o.child(e).nodeSize,r.delete(t-1,t+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,u=n.endIndex==o.childCount,l=i.node(-1),c=i.index(-1);if(!l.canReplace(c+(a?0:1),c+1,s.content.append(u?ns.empty:ns.from(o))))return!1;let f=i.pos,p=f+s.nodeSize;return r.step(new _a(f-(a?1:0),p+(u?1:0),f+1,p-1,new ls((a?ns.empty:ns.from(o.copy(ns.empty))).append(u?ns.empty:ns.from(o.copy(ns.empty))),a?0:1,u?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,i)))}}function kc(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class Ec{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!t,u=t||o.tr,l={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(u,e),o=n(...t)(r);return s.push(o),l}]))),run:()=>(a||!e||u.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(u),s.every((t=>!0===t)))};return l}createCan(t){const{rawCommands:e,state:n}=this,r=t||n.tr,o=this.buildProps(r,false),i=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...o,dispatch:void 0})])));return{...i,chain:()=>this.createChain(r,false)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&t.setStoredMarks(o.storedMarks);const s={tr:t,editor:r,view:i,state:kc({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}function Cc(t,e,n){if(void 0===t.config[e]&&t.parent)return Cc(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?Cc(t.parent,e,n):null})}return t.config[e]}function xc(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function Ac(t){const e=[],{nodeExtensions:n,markExtensions:r}=xc(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=Cc(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:{...i,...r}})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Cc(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};(null==r?void 0:r.isRequired)&&void 0===(null==r?void 0:r.default)&&delete o.default,e.push({type:t.name,name:n,attribute:o})}))})),e}function Sc(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Oc(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]="class"===t?[n[t],e].join(" "):"style"===t?[n[t],e].join("; "):e:n[t]=e})),n}),{})}function Nc(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>Oc(t,e)),{})}function Tc(t,e,...n){return function(t){return"function"==typeof t}(t)?e?t.bind(e)(...n):t(...n):t}function Mc(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:{...t,[e.name]:r}}),{});return{...r,...o}}}}function Fc(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function Ic(t){var e;const n=Ac(t),{nodeExtensions:r,markExtensions:o}=xc(t),i=null===(e=r.find((t=>Cc(t,"topNode"))))||void 0===e?void 0:e.name,s=Object.fromEntries(r.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage},i=Fc({...t.reduce(((t,n)=>{const r=Cc(n,"extendNodeSchema",o);return{...t,...r?r(e):{}}}),{}),content:Tc(Cc(e,"content",o)),marks:Tc(Cc(e,"marks",o)),group:Tc(Cc(e,"group",o)),inline:Tc(Cc(e,"inline",o)),atom:Tc(Cc(e,"atom",o)),selectable:Tc(Cc(e,"selectable",o)),draggable:Tc(Cc(e,"draggable",o)),code:Tc(Cc(e,"code",o)),defining:Tc(Cc(e,"defining",o)),isolating:Tc(Cc(e,"isolating",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),s=Tc(Cc(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>Mc(t,r))));const a=Cc(e,"renderHTML",o);a&&(i.toDOM=t=>a({node:t,HTMLAttributes:Nc(t,r)}));const u=Cc(e,"renderText",o);return u&&(i.toText=u),[e.name,i]}))),a=Object.fromEntries(o.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage},i=Fc({...t.reduce(((t,n)=>{const r=Cc(n,"extendMarkSchema",o);return{...t,...r?r(e):{}}}),{}),inclusive:Tc(Cc(e,"inclusive",o)),excludes:Tc(Cc(e,"excludes",o)),group:Tc(Cc(e,"group",o)),spanning:Tc(Cc(e,"spanning",o)),code:Tc(Cc(e,"code",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),s=Tc(Cc(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>Mc(t,r))));const a=Cc(e,"renderHTML",o);return a&&(i.toDOM=t=>a({mark:t,HTMLAttributes:Nc(t,r)})),[e.name,i]})));return new Us({topNode:i,nodes:s,marks:a})}function Bc(t,e){return e.nodes[t]||e.marks[t]||null}function $c(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function Rc(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class Lc{constructor(t){this.find=t.find,this.handler=t.handler}}function Pc(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:u}=n;if(u.composing)return!1;const l=u.state.doc.resolve(r);if(l.parent.type.spec.code||(null===(e=l.nodeBefore||l.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let c=!1;const f=((t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,((t,e,o,i)=>{var s,a;const u=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:e,parent:o,index:i}))||t.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-e))})),n})(l)+i;return s.forEach((t=>{if(c)return;const e=((t,e)=>{if(Rc(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(f,t.find);if(!e)return;const s=u.state.tr,l=kc({state:u.state,transaction:s}),p={from:r-(e[0].length-i.length),to:o},{commands:d,chain:h,can:m}=new Ec({editor:n,state:l});null!==t.handler({state:l,range:p,match:e,commands:d,chain:h,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),u.dispatch(s),c=!0)})),c}function zc(t){const{editor:e,rules:n}=t,r=new au({state:{init:()=>null,apply(t,e){const n=t.getMeta(r);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(t,o,i,s)=>Pc({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&Pc({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:i}=t.state.selection;return!!i&&Pc({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class jc{constructor(t){this.find=t.find,this.handler=t.handler}}function Vc(t){const{editor:e,state:n,from:r,to:o,rule:i}=t,{commands:s,chain:a,can:u}=new Ec({editor:e,state:n}),l=[];n.doc.nodesBetween(r,o,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const c=Math.max(r,e),f=Math.min(o,e+t.content.size),p=((t,e)=>{if(Rc(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.textBetween(c-e,f-e,void 0,""),i.find);p.forEach((t=>{if(void 0===t.index)return;const e=c+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},f=i.handler({state:n,range:o,match:t,commands:s,chain:a,can:u});l.push(f)}))}));return l.every((t=>null!==t))}function Hc(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1;return n.map((t=>new au({view(t){const e=e=>{var n;r=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:t=>(i=r===t.dom.parentElement,!1),paste:(t,e)=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],u="paste"===a.getMeta("uiEvent")&&!o,l="drop"===a.getMeta("uiEvent")&&!i;if(!u&&!l)return;const c=r.doc.content.findDiffStart(s.doc.content),f=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof c||!f||c===f.b)return;const p=s.tr,d=kc({state:s,transaction:p});return Vc({editor:e,state:d,from:Math.max(c-1,0),to:f.b-1,rule:t})&&p.steps.length?p:void 0}})))}class Wc{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Wc.resolve(t),this.schema=Ic(this.extensions),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Bc(t.name,this.schema)};if("mark"===t.type){(null===(e=Tc(Cc(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const r=Cc(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=Cc(t,"onCreate",n);o&&this.editor.on("create",o);const i=Cc(t,"onUpdate",n);i&&this.editor.on("update",i);const s=Cc(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=Cc(t,"onTransaction",n);a&&this.editor.on("transaction",a);const u=Cc(t,"onFocus",n);u&&this.editor.on("focus",u);const l=Cc(t,"onBlur",n);l&&this.editor.on("blur",l);const c=Cc(t,"onDestroy",n);c&&this.editor.on("destroy",c)}))}static resolve(t){const e=Wc.sort(Wc.flatten(t)),n=function(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=Cc(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=Cc(t,"priority")||100,r=Cc(e,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=Cc(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Bc(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=Wc.sort([...this.extensions].reverse()),n=[],r=[],o=e.map((e=>{const o={name:e.name,options:e.options,storage:e.storage,editor:t,type:Bc(e.name,this.schema)},i=[],s=Cc(e,"addKeyboardShortcuts",o);let a={};if("mark"===e.type&&e.config.exitable&&(a.ArrowRight=()=>Df.handleExit({editor:t,mark:e})),s){const e=Object.fromEntries(Object.entries(s()).map((([e,n])=>[e,()=>n({editor:t})])));a={...a,...e}}const u=new au({props:{handleKeyDown:fc(a)}});i.push(u);const l=Cc(e,"addInputRules",o);$c(e,t.options.enableInputRules)&&l&&n.push(...l());const c=Cc(e,"addPasteRules",o);$c(e,t.options.enablePasteRules)&&c&&r.push(...c());const f=Cc(e,"addProseMirrorPlugins",o);if(f){const t=f();i.push(...t)}return i})).flat();return[zc({editor:t,rules:n}),...Hc({editor:t,rules:r}),...o]}get attributes(){return Ac(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=xc(this.extensions);return Object.fromEntries(e.filter((t=>!!Cc(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:e.storage,editor:t,type:Sc(e.name,this.schema)},o=Cc(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const u=Nc(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:u,extension:e})}]})))}}function Uc(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function qc(t,e){const n={...t};return Uc(t)&&Uc(e)&&Object.keys(e).forEach((r=>{Uc(e[r])?r in t?n[r]=qc(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class Kc{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=Tc(Cc(this,"addOptions",{name:this.name}))),this.storage=Tc(Cc(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Kc(t)}configure(t={}){const e=this.extend();return e.options=qc(this.options,t),e.storage=Tc(Cc(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Kc(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Tc(Cc(e,"addOptions",{name:e.name})),e.storage=Tc(Cc(e,"addStorage",{name:e.name,options:e.options})),e}}Kc.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new au({key:new cu("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map((t=>t.$from.pos))),a=Math.max(...i.map((t=>t.$to.pos))),u=function(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}(n);return function(t,e,n){const{from:r,to:o}=e,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",u=!0;return t.nodesBetween(r,o,((t,n,l,c)=>{var f;const p=null==s?void 0:s[t.type.name];p?(t.isBlock&&!u&&(a+=i,u=!0),l&&(a+=p({node:t,pos:n,parent:l,index:c,range:e}))):t.isText?(a+=null===(f=null==t?void 0:t.text)||void 0===f?void 0:f.slice(Math.max(r,n)-n,o-n),u=!1):t.isBlock&&!u&&(a+=i,u=!0)})),a}(r,{from:s,to:a},{textSerializers:u})}}})]}});function Jc(t,e,n={strict:!0}){const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:Rc(e[r])?e[r].test(t[r]):e[r]===t[r]))}function Gc(t,e,n={}){return t.find((t=>t.type===e&&Jc(t.attrs,n)))}function Yc(t,e,n={}){return!!Gc(t,e,n)}function Xc(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&0!==r.offset&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=Gc([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,u=s+r.node.nodeSize;for(Gc([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&Yc([...t.parent.child(a).marks],e,n);)u+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:u}}function Zc(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Qc(t){return t instanceof Ya}function tf(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function ef(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function nf(t){const e=`<body>${t}</body>`;return(new window.DOMParser).parseFromString(e,"text/html").body}function rf(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)?ns.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),rf("",e,n)}if("string"==typeof t){const r=Ks.fromSchema(e);return n.slice?r.parseSlice(nf(t),n.parseOptions).content:r.parse(nf(t),n.parseOptions)}return rf("",e,n)}function of(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function sf(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?Sc(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:i})}));const u=o-r,l=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>Jc(t.node.attrs,n,{strict:!1})));if(i)return!!l.length;return l.reduce(((t,e)=>t+e.to-e.from),0)>=u}function af(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function uf(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}function lf(t){return e=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(e.$from,t)}function cf(t,e){const n=Zc(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function ff(t,e){const n=af("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=Sc(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,(t=>{i.push(t)}));const s=i.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}(t,e):"mark"===n?cf(t,e):{}}function pf(t){const e=function(t,e=JSON.stringify){const n={};return t.filter((t=>{const r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(t);return 1===e.length?e:e.filter(((t,n)=>{const r=e.filter(((t,e)=>e!==n));return!r.some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}))}function df(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach((e=>{const o=Xc(n.resolve(t-1),e.type);o&&r.push({mark:e,...o})})):n.nodesBetween(t,e,((t,e)=>{r.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),r}function hf(t,e){const{nodeExtensions:n}=xc(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=Tc(Cc(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function mf(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function gf(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}const vf=(t,e)=>{const n=lf((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Sa(t.doc,n.pos)||(t.join(n.pos),!0)},yf=(t,e)=>{const n=lf((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Sa(t.doc,r)||(t.join(r),!0)};var bf=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{t.doc.nodesBetween(n.pos,r.pos,((t,n)=>{if(t.type.isText)return;const{doc:r,mapping:o}=e,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+t.nodeSize)),a=i.blockRange(s);if(!a)return;const u=Ea(a);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(a.start,t)}(u||0===u)&&e.lift(a,u)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>((t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof tu||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=mc(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(Ya.create(s.doc,n+1)),e(s.scrollIntoView())}return!0})(t,e),deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let n=o.depth;n>0;n-=1){if(o.node(n).type===r.type){if(e){const e=o.before(n),r=o.after(n);t.delete(e,r).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=Sc(t,n.schema),i=e.selection.$anchor;for(let t=i.depth;t>0;t-=1){if(i.node(t).type===o){if(r){const n=i.before(t),r=i.after(t);e.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},deleteSelection:()=>({state:t,dispatch:e})=>((t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0))(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=mc(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(qa.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0})(t,e),extendMarkRange:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Zc(t,r.schema),{doc:s,selection:a}=n,{$from:u,from:l,to:c}=a;if(o){const t=Xc(u,i,e);if(t&&t.from<=l&&t.to>=c){const e=Ya.create(s,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{ef()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===t||!1===t)return!0;if(i&&null===t&&!Qc(n.state.selection))return s(),!0;const a=function(t,e=null){if(!e)return null;const n=qa.atStart(t),r=qa.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?Ya.create(t,tf(0,o,i),tf(t.content.size,o,i)):Ya.create(t,tf(e,o,i),tf(e,o,i))}(o.doc,t)||n.state.selection,u=n.state.selection.eq(a);return i&&(u||o.setSelection(a),u&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,r)=>e(t,{...n,index:r}))),insertContent:(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=rf(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:t,u=!0,l=!0;if((o.toString().startsWith("<")?o:[o]).forEach((t=>{t.check(),u=!!u&&(t.isText&&0===t.marks.length),l=!!l&&t.isBlock})),s===a&&l){const{parent:t}=r.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}u?r.insertText(e,s,a):r.replaceWith(s,a,o),n.updateSelection&&function(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Da||o instanceof _a))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(qa.near(t.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinUp:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection,o=r instanceof Za;if(o){if(r.node.isTextblock||!Sa(t.doc,r.from))return!1;n=r.from}else if(n=Na(t.doc,r.from,-1),null==n)return!1;if(e){let r=t.tr.join(n);o&&r.setSelection(Za.create(r.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0})(t,e),joinDown:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection;if(r instanceof Za){if(r.node.isTextblock||!Sa(t.doc,r.to))return!1;n=r.to}else if(n=Na(t.doc,r.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(t,e),joinBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let o=dc(r);if(!o){let n=r.blockRange(),o=n&&Ea(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&gc(t,o,e))return!0;if(0==r.parent.content.size&&(pc(i,"end")||Za.isSelectable(i))){let n=Ta(t.doc,r.before(),r.after(),ls.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(pc(i,"end")?qa.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Za.create(r.doc,o.pos-i.nodeSize)),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))})(t,e),joinForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}(t,n);if(!r)return!1;let o=hc(r);if(!o)return!1;let i=o.nodeAfter;if(gc(t,o,e))return!0;if(0==r.parent.content.size&&(pc(i,"start")||Za.isSelectable(i))){let n=Ta(t.doc,r.before(),r.after(),ls.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(pc(i,"start")?qa.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Za.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t<e.length-1;t+=1){const s=e[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);ef()||of()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(t).split(/-(?!$)/),s=i.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==u||u.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:r})=>!!sf(n,Sc(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Ea(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:t,dispatch:e})=>((t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Aa(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Ea(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)})(t,e),liftListItem:t=>({state:e,dispatch:n})=>wc(Sc(t,e.schema))(e,n),newlineInCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))})(t,e),resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=af("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=Sc(t,r.schema)),"mark"===a&&(s=Zc(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,uf(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(uf(o.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=dc(r)}let s=i&&i.nodeBefore;return!(!s||!Za.isSelectable(s)||(e&&e(t.tr.setSelection(Za.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))})(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=hc(r)}let s=i&&i.nodeAfter;return!(!s||!Za.isSelectable(s)||(e&&e(t.tr.setSelection(Za.create(t.doc,i.pos)).scrollIntoView()),0))})(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(Za.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>bc(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>yc(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=function(t,e,n={}){return rf(t,e,{slice:!1,parseOptions:n})}(t,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,u=Zc(t,r.schema);if(o)if(s){const t=cf(r,u);n.addStoredMark(u.create({...t,...e}))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i),l=t.marks.find((t=>t.type===u));l?t.marks.forEach((t=>{u===t.type&&n.addMark(s,a,u.create({...t.attrs,...e}))})):n.addMark(s,a,u.create(e))}))}));return function(t,e,n){var r;const{selection:o}=e;let i=null;if(Qc(o)&&(i=o.$cursor),i){const e=null!==(r=t.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:s}=o;return s.some((({$from:e,$to:r})=>{let o=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,r.pos,((t,e,r)=>{if(o)return!1;if(t.isInline){const e=!r||r.type.allowsMarkType(n),i=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));o=e&&i}return!o})),o}))}(r,n,u)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=Sc(t,n.schema);return i.isTextblock?o().command((({commands:t})=>!!Dc(i,e)(n)||t.clearNodes())).command((({state:t})=>Dc(i,e)(t,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=tf(t,0,n.content.size),o=Za.create(n,r);e.setSelection(o)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=Ya.atStart(n).from,s=Ya.atEnd(n).to,a=tf(r,i,s),u=tf(o,i,s),l=Ya.create(n,a,u);e.setSelection(l)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=Sc(t,e.schema);return(o=r,function(t,e){let{$from:n,$to:r}=t.selection,i=n.blockRange(r,(t=>t.childCount>0&&t.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,u=a.child(s-1);if(u.type!=o)return!1;if(e){let n=u.lastChild&&u.lastChild.type==a.type,r=ns.from(n?o.create():null),s=new ls(ns.from(o.create(null,ns.from(a.type.create(null,r)))),n?3:1,0),l=i.start,c=i.end;e(t.tr.step(new _a(l-(n?3:1),c,l,c,s,1,!0)).scrollIntoView())}return!0})(e,n);var o},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:u}=i,l=mf(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Za&&i.node.isBlock)return!(!a.parentOffset||!Aa(s,a.pos))&&(r&&(t&&gf(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=u.parentOffset===u.parent.content.size;i instanceof Ya&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let c=r&&s?[{type:s,attrs:l}]:void 0,f=Aa(e.doc,e.mapping.map(a.pos),1,c);if(c||f||!Aa(e.doc,e.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(f=!0,c=s?[{type:s,attrs:l}]:void 0),f&&(e.split(e.mapping.map(a.pos),1,c),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const t=e.mapping.map(a.before()),n=e.doc.resolve(t);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&e.setNodeMarkup(e.mapping.map(a.before()),s)}t&&gf(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=Sc(t,n.schema),{$from:a,$to:u}=n.selection,l=n.selection.node;if(l&&l.isBlock||a.depth<2||!a.sameParent(u))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let t=ns.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let e=a.depth-n;e>=a.depth-3;e-=1)t=ns.from(a.node(e).copy(t));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=mf(f,a.node().type.name,a.node().attrs),u=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;t=t.append(ns.from(s.createAndFill(null,u)||void 0));const l=a.before(a.depth-(n-1));e.replace(l,a.after(-r),new ls(t,4-n,0));let c=-1;e.doc.nodesBetween(l,e.doc.content.size,((t,e)=>{if(c>-1)return!1;t.isTextblock&&0===t.content.size&&(c=e+1)})),c>-1&&e.setSelection(Ya.near(e.doc.resolve(c))),e.scrollIntoView()}return!0}const p=u.pos===a.end()?c.contentMatchAt(0).defaultType:null,d=mf(f,c.type.name,c.attrs),h=mf(f,a.node().type.name,a.node().attrs);e.delete(a.pos,u.pos);const m=p?[{type:s,attrs:d},{type:p,attrs:h}]:[{type:s,attrs:d}];return!!Aa(e.doc,a.pos,2)&&(r&&e.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(t,e)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:u})=>{const{extensions:l}=n.extensionManager,c=Sc(t,o.schema),f=Sc(e,o.schema),{selection:p}=o,{$from:d,$to:h}=p,m=d.blockRange(h);if(!m)return!1;const g=lf((t=>hf(t.type.name,l)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===c)return a.liftListItem(f);if(hf(g.node.type.name,l)&&c.validContent(g.node.content)&&i)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>vf(r,c))).command((()=>yf(r,c))).run()}return s().command((()=>!!u().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>vf(r,c))).command((()=>yf(r,c))).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Zc(t,r.schema),a=function(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Zc(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>Jc(t.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:e,$to:n})=>{const r=e.pos,o=n.pos;t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);s+=i-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:i}))))}))})),0===s)return!1;const u=a.filter((t=>!i||i.name===t.mark.type.name)).filter((t=>Jc(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),l=a.filter((t=>!i||t.mark.type!==i&&t.mark.type.excludes(i))).reduce(((t,e)=>t+e.to-e.from),0);return(u>0?u+l:u)>=s}(r,s,e);return a?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=Sc(t,r.schema),s=Sc(e,r.schema);return sf(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=Sc(t,n.schema);return sf(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){const n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,u=Zc(t,r.schema),{$from:l,empty:c,ranges:f}=a;if(!o)return!0;if(c&&s){let{from:t,to:e}=a;const r=null===(i=l.marks().find((t=>t.type===u)))||void 0===i?void 0:i.attrs,o=Xc(l,u,r);o&&(t=o.from,e=o.to),n.removeMark(t,e,u)}else f.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,u)}));return n.removeStoredMark(u),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=af("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=Sc(t,r.schema)),"mark"===a&&(s=Zc(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const u=Math.max(r,o),l=Math.min(r+t.nodeSize,a);n.addMark(u,l,s.create({...i.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Ca(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Sc(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>_c(Sc(t,n.schema),e)(n,r)});Kc.create({name:"commands",addCommands:()=>({...bf})}),Kc.create({name:"editable",addProseMirrorPlugins(){return[new au({key:new cu("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Kc.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new au({key:new cu("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Kc.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:r}=e,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,u=qa.atStart(r).from===s;return!(!(o&&u&&a.type.isTextblock)||a.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ef()||of()?o:r},addProseMirrorPlugins(){return[new au({key:new cu("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some((t=>t.docChanged))&&!e.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=e.selection,s=qa.atStart(e.doc).from,a=qa.atEnd(e.doc).to,u=o===s&&i===a,l=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!u||!l)return;const c=n.tr,f=kc({state:n,transaction:c}),{commands:p}=new Ec({editor:this.editor,state:f});return p.clearNodes(),c.steps.length?c:void 0}})]}}),Kc.create({name:"tabindex",addProseMirrorPlugins(){return[new au({key:new cu("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Df{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=Tc(Cc(this,"addOptions",{name:this.name}))),this.storage=Tc(Cc(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Df(t)}configure(t={}){const e=this.extend();return e.options=qc(this.options,t),e.storage=Tc(Cc(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Df(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Tc(Cc(e,"addOptions",{name:e.name})),e.storage=Tc(Cc(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const i=o.find((t=>(null==t?void 0:t.type.name)===e.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),t.view.dispatch(n),!0}return!1}}class _f{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.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=Tc(Cc(this,"addOptions",{name:this.name}))),this.storage=Tc(Cc(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new _f(t)}configure(t={}){const e=this.extend();return e.options=qc(this.options,t),e.storage=Tc(Cc(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new _f(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Tc(Cc(e,"addOptions",{name:e.name})),e.storage=Tc(Cc(e,"addStorage",{name:e.name,options:e.options})),e}}function wf(t){return new jc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Tc(t.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];let u=n.to;if(s){const r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(df(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>l)).length)return null;c<n.to&&i.delete(c,n.to),l>n.from&&i.delete(n.from+r,l),u=n.from+r+s.length,i.addMark(n.from+r,u,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}var kf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ef={};
8
- /**
9
- * @license
10
- * Lodash <https://lodash.com/>
11
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
12
- * Released under MIT license <https://lodash.com/license>
13
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
14
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
15
- */
16
- !function(t,e){(function(){var n,r="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",s=16,a=32,u=64,l=128,c=256,f=1/0,p=9007199254740991,d=NaN,h=4294967295,m=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",a],["partialRight",u],["rearg",c]],g="[object Arguments]",v="[object Array]",y="[object Boolean]",b="[object Date]",D="[object Error]",_="[object Function]",w="[object GeneratorFunction]",k="[object Map]",E="[object Number]",C="[object Object]",x="[object Promise]",A="[object RegExp]",S="[object Set]",O="[object String]",N="[object Symbol]",T="[object WeakMap]",M="[object ArrayBuffer]",F="[object DataView]",I="[object Float32Array]",B="[object Float64Array]",$="[object Int8Array]",R="[object Int16Array]",L="[object Int32Array]",P="[object Uint8Array]",z="[object Uint8ClampedArray]",j="[object Uint16Array]",V="[object Uint32Array]",H=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,J=RegExp(q.source),G=RegExp(K.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),ot=/^\s+/,it=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ut=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Et="\\u2700-\\u27bf",Ct="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ot="['’]",Nt="["+wt+"]",Tt="["+St+"]",Mt="["+kt+"]",Ft="\\d+",It="["+Et+"]",Bt="["+Ct+"]",$t="[^"+wt+St+Ft+Et+Ct+xt+"]",Rt="\\ud83c[\\udffb-\\udfff]",Lt="[^"+wt+"]",Pt="(?:\\ud83c[\\udde6-\\uddff]){2}",zt="[\\ud800-\\udbff][\\udc00-\\udfff]",jt="["+xt+"]",Vt="\\u200d",Ht="(?:"+Bt+"|"+$t+")",Wt="(?:"+jt+"|"+$t+")",Ut="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+Mt+"|"+Rt+")"+"?",Jt="["+At+"]?",Gt=Jt+Kt+("(?:"+Vt+"(?:"+[Lt,Pt,zt].join("|")+")"+Jt+Kt+")*"),Yt="(?:"+[It,Pt,zt].join("|")+")"+Gt,Xt="(?:"+[Lt+Mt+"?",Mt,Pt,zt,Nt].join("|")+")",Zt=RegExp(Ot,"g"),Qt=RegExp(Mt,"g"),te=RegExp(Rt+"(?="+Rt+")|"+Xt+Gt,"g"),ee=RegExp([jt+"?"+Bt+"+"+Ut+"(?="+[Tt,jt,"$"].join("|")+")",Wt+"+"+qt+"(?="+[Tt,jt+Ht,"$"].join("|")+")",jt+"?"+Ht+"+"+Ut,jt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ft,Yt].join("|"),"g"),ne=RegExp("["+Vt+wt+kt+At+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,oe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,se={};se[I]=se[B]=se[$]=se[R]=se[L]=se[P]=se[z]=se[j]=se[V]=!0,se[g]=se[v]=se[M]=se[y]=se[F]=se[b]=se[D]=se[_]=se[k]=se[E]=se[C]=se[A]=se[S]=se[O]=se[T]=!1;var ae={};ae[g]=ae[v]=ae[M]=ae[F]=ae[y]=ae[b]=ae[I]=ae[B]=ae[$]=ae[R]=ae[L]=ae[k]=ae[E]=ae[C]=ae[A]=ae[S]=ae[O]=ae[N]=ae[P]=ae[z]=ae[j]=ae[V]=!0,ae[D]=ae[_]=ae[T]=!1;var ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,fe="object"==typeof kf&&kf&&kf.Object===Object&&kf,pe="object"==typeof self&&self&&self.Object===Object&&self,de=fe||pe||Function("return this")(),he=e&&!e.nodeType&&e,me=he&&t&&!t.nodeType&&t,ge=me&&me.exports===he,ve=ge&&fe.process,ye=function(){try{var t=me&&me.require&&me.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),be=ye&&ye.isArrayBuffer,De=ye&&ye.isDate,_e=ye&&ye.isMap,we=ye&&ye.isRegExp,ke=ye&&ye.isSet,Ee=ye&&ye.isTypedArray;function Ce(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(r,s,n(s),t)}return r}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Se(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Oe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ne(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function Te(t,e){return!!(null==t?0:t.length)&&je(t,e,0)>-1}function Me(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Fe(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Ie(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Be(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function $e(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function Re(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Le=Ue("length");function Pe(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function ze(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function je(t,e,n){return e==e?function(t,e,n){var r=n-1,o=t.length;for(;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):ze(t,He,n)}function Ve(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function He(t){return t!=t}function We(t,e){var n=null==t?0:t.length;return n?Je(t,e)/n:d}function Ue(t){return function(e){return null==e?n:e[t]}}function qe(t){return function(e){return null==t?n:t[e]}}function Ke(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function Je(t,e){for(var r,o=-1,i=t.length;++o<i;){var s=e(t[o]);s!==n&&(r=r===n?s:r+s)}return r}function Ge(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ye(t){return t?t.slice(0,mn(t)+1).replace(ot,""):t}function Xe(t){return function(e){return t(e)}}function Ze(t,e){return Fe(e,(function(e){return t[e]}))}function Qe(t,e){return t.has(e)}function tn(t,e){for(var n=-1,r=t.length;++n<r&&je(e,t[n],0)>-1;);return n}function en(t,e){for(var n=t.length;n--&&je(e,t[n],0)>-1;);return n}function nn(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var rn=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),on=qe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function sn(t){return"\\"+ue[t]}function an(t){return ne.test(t)}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function ln(t,e){return function(n){return t(e(n))}}function cn(t,e){for(var n=-1,r=t.length,o=0,s=[];++n<r;){var a=t[n];a!==e&&a!==i||(t[n]=i,s[o++]=n)}return s}function fn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function pn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function dn(t){return an(t)?function(t){var e=te.lastIndex=0;for(;te.test(t);)++e;return e}(t):Le(t)}function hn(t){return an(t)?function(t){return t.match(te)||[]}(t):function(t){return t.split("")}(t)}function mn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var gn=qe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var vn=function t(e){var it=(e=null==e?de:vn.defaults(de.Object(),e,vn.pick(de,oe))).Array,wt=e.Date,kt=e.Error,Et=e.Function,Ct=e.Math,xt=e.Object,At=e.RegExp,St=e.String,Ot=e.TypeError,Nt=it.prototype,Tt=Et.prototype,Mt=xt.prototype,Ft=e["__core-js_shared__"],It=Tt.toString,Bt=Mt.hasOwnProperty,$t=0,Rt=function(){var t=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Lt=Mt.toString,Pt=It.call(xt),zt=de._,jt=At("^"+It.call(Bt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=ge?e.Buffer:n,Ht=e.Symbol,Wt=e.Uint8Array,Ut=Vt?Vt.allocUnsafe:n,qt=ln(xt.getPrototypeOf,xt),Kt=xt.create,Jt=Mt.propertyIsEnumerable,Gt=Nt.splice,Yt=Ht?Ht.isConcatSpreadable:n,Xt=Ht?Ht.iterator:n,te=Ht?Ht.toStringTag:n,ne=function(){try{var t=di(xt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=e.clearTimeout!==de.clearTimeout&&e.clearTimeout,fe=wt&&wt.now!==de.Date.now&&wt.now,pe=e.setTimeout!==de.setTimeout&&e.setTimeout,he=Ct.ceil,me=Ct.floor,ve=xt.getOwnPropertySymbols,ye=Vt?Vt.isBuffer:n,Le=e.isFinite,qe=Nt.join,yn=ln(xt.keys,xt),bn=Ct.max,Dn=Ct.min,_n=wt.now,wn=e.parseInt,kn=Ct.random,En=Nt.reverse,Cn=di(e,"DataView"),xn=di(e,"Map"),An=di(e,"Promise"),Sn=di(e,"Set"),On=di(e,"WeakMap"),Nn=di(xt,"create"),Tn=On&&new On,Mn={},Fn=zi(Cn),In=zi(xn),Bn=zi(An),$n=zi(Sn),Rn=zi(On),Ln=Ht?Ht.prototype:n,Pn=Ln?Ln.valueOf:n,zn=Ln?Ln.toString:n;function jn(t){if(ra(t)&&!qs(t)&&!(t instanceof Un)){if(t instanceof Wn)return t;if(Bt.call(t,"__wrapped__"))return ji(t)}return new Wn(t)}var Vn=function(){function t(){}return function(e){if(!na(e))return{};if(Kt)return Kt(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function Hn(){}function Wn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Kn(t);this.size=e.size}function Xn(t,e){var n=qs(t),r=!n&&Us(t),o=!n&&!r&&Ys(t),i=!n&&!r&&!o&&fa(t),s=n||r||o||i,a=s?Ge(t.length,St):[],u=a.length;for(var l in t)!e&&!Bt.call(t,l)||s&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Di(l,u))||a.push(l);return a}function Zn(t){var e=t.length;return e?t[Gr(0,e-1)]:n}function Qn(t,e){return Ri(To(t),ur(e,0,t.length))}function tr(t){return Ri(To(t))}function er(t,e,r){(r!==n&&!Vs(t[e],r)||r===n&&!(e in t))&&sr(t,e,r)}function nr(t,e,r){var o=t[e];Bt.call(t,e)&&Vs(o,r)&&(r!==n||e in t)||sr(t,e,r)}function rr(t,e){for(var n=t.length;n--;)if(Vs(t[n][0],e))return n;return-1}function or(t,e,n,r){return dr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function ir(t,e){return t&&Mo(e,Fa(e),t)}function sr(t,e,n){"__proto__"==e&&ne?ne(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ar(t,e){for(var r=-1,o=e.length,i=it(o),s=null==t;++r<o;)i[r]=s?n:Sa(t,e[r]);return i}function ur(t,e,r){return t==t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function lr(t,e,r,o,i,s){var a,u=1&e,l=2&e,c=4&e;if(r&&(a=i?r(t,o,i,s):r(t)),a!==n)return a;if(!na(t))return t;var f=qs(t);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Bt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!u)return To(t,a)}else{var p=gi(t),d=p==_||p==w;if(Ys(t))return Co(t,u);if(p==C||p==g||d&&!i){if(a=l||d?{}:yi(t),!u)return l?function(t,e){return Mo(t,mi(t),e)}(t,function(t,e){return t&&Mo(e,Ia(e),t)}(a,t)):function(t,e){return Mo(t,hi(t),e)}(t,ir(a,t))}else{if(!ae[p])return i?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case M:return xo(t);case y:case b:return new r(+t);case F:return function(t,e){var n=e?xo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I:case B:case $:case R:case L:case P:case z:case j:case V:return Ao(t,n);case k:return new r;case E:case O:return new r(t);case A:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case S:return new r;case N:return o=t,Pn?xt(Pn.call(o)):{}}var o}(t,p,u)}}s||(s=new Yn);var h=s.get(t);if(h)return h;s.set(t,a),ua(t)?t.forEach((function(n){a.add(lr(n,e,r,n,t,s))})):oa(t)&&t.forEach((function(n,o){a.set(o,lr(n,e,r,o,t,s))}));var m=f?n:(c?l?si:ii:l?Ia:Fa)(t);return Ae(m||t,(function(n,o){m&&(n=t[o=n]),nr(a,o,lr(n,e,r,o,t,s))})),a}function cr(t,e,r){var o=r.length;if(null==t)return!o;for(t=xt(t);o--;){var i=r[o],s=e[i],a=t[i];if(a===n&&!(i in t)||!s(a))return!1}return!0}function fr(t,e,o){if("function"!=typeof t)throw new Ot(r);return Fi((function(){t.apply(n,o)}),e)}function pr(t,e,n,r){var o=-1,i=Te,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;n&&(e=Fe(e,Xe(n))),r?(i=Me,s=!1):e.length>=200&&(i=Qe,s=!1,e=new Gn(e));t:for(;++o<a;){var c=t[o],f=null==n?c:n(c);if(c=r||0!==c?c:0,s&&f==f){for(var p=l;p--;)if(e[p]===f)continue t;u.push(c)}else i(e,f,r)||u.push(c)}return u}jn.templateSettings={escape:Y,evaluate:X,interpolate:Z,variable:"",imports:{_:jn}},jn.prototype=Hn.prototype,jn.prototype.constructor=jn,Wn.prototype=Vn(Hn.prototype),Wn.prototype.constructor=Wn,Un.prototype=Vn(Hn.prototype),Un.prototype.constructor=Un,qn.prototype.clear=function(){this.__data__=Nn?Nn(null):{},this.size=0},qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qn.prototype.get=function(t){var e=this.__data__;if(Nn){var r=e[t];return r===o?n:r}return Bt.call(e,t)?e[t]:n},qn.prototype.has=function(t){var e=this.__data__;return Nn?e[t]!==n:Bt.call(e,t)},qn.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Nn&&e===n?o:e,this},Kn.prototype.clear=function(){this.__data__=[],this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=rr(e,t);return!(n<0)&&(n==e.length-1?e.pop():Gt.call(e,n,1),--this.size,!0)},Kn.prototype.get=function(t){var e=this.__data__,r=rr(e,t);return r<0?n:e[r][1]},Kn.prototype.has=function(t){return rr(this.__data__,t)>-1},Kn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(xn||Kn),string:new qn}},Jn.prototype.delete=function(t){var e=fi(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return fi(this,t).get(t)},Jn.prototype.has=function(t){return fi(this,t).has(t)},Jn.prototype.set=function(t,e){var n=fi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(t){return this.__data__.set(t,o),this},Gn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Kn){var r=n.__data__;if(!xn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var dr=Bo(_r),hr=Bo(wr,!0);function mr(t,e){var n=!0;return dr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function gr(t,e,r){for(var o=-1,i=t.length;++o<i;){var s=t[o],a=e(s);if(null!=a&&(u===n?a==a&&!ca(a):r(a,u)))var u=a,l=s}return l}function vr(t,e){var n=[];return dr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function yr(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=bi),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?yr(a,e-1,n,r,o):Ie(o,a):r||(o[o.length]=a)}return o}var br=$o(),Dr=$o(!0);function _r(t,e){return t&&br(t,e,Fa)}function wr(t,e){return t&&Dr(t,e,Fa)}function kr(t,e){return Ne(e,(function(e){return Qs(t[e])}))}function Er(t,e){for(var r=0,o=(e=_o(e,t)).length;null!=t&&r<o;)t=t[Pi(e[r++])];return r&&r==o?t:n}function Cr(t,e,n){var r=e(t);return qs(t)?r:Ie(r,n(t))}function xr(t){return null==t?t===n?"[object Undefined]":"[object Null]":te&&te in xt(t)?function(t){var e=Bt.call(t,te),r=t[te];try{t[te]=n;var o=!0}catch(t){}var i=Lt.call(t);o&&(e?t[te]=r:delete t[te]);return i}(t):function(t){return Lt.call(t)}(t)}function Ar(t,e){return t>e}function Sr(t,e){return null!=t&&Bt.call(t,e)}function Or(t,e){return null!=t&&e in xt(t)}function Nr(t,e,r){for(var o=r?Me:Te,i=t[0].length,s=t.length,a=s,u=it(s),l=1/0,c=[];a--;){var f=t[a];a&&e&&(f=Fe(f,Xe(e))),l=Dn(f.length,l),u[a]=!r&&(e||i>=120&&f.length>=120)?new Gn(a&&f):n}f=t[0];var p=-1,d=u[0];t:for(;++p<i&&c.length<l;){var h=f[p],m=e?e(h):h;if(h=r||0!==h?h:0,!(d?Qe(d,m):o(c,m,r))){for(a=s;--a;){var g=u[a];if(!(g?Qe(g,m):o(t[a],m,r)))continue t}d&&d.push(m),c.push(h)}}return c}function Tr(t,e,r){var o=null==(t=Oi(t,e=_o(e,t)))?t:t[Pi(Zi(e))];return null==o?n:Ce(o,t,r)}function Mr(t){return ra(t)&&xr(t)==g}function Fr(t,e,r,o,i){return t===e||(null==t||null==e||!ra(t)&&!ra(e)?t!=t&&e!=e:function(t,e,r,o,i,s){var a=qs(t),u=qs(e),l=a?v:gi(t),c=u?v:gi(e),f=(l=l==g?C:l)==C,p=(c=c==g?C:c)==C,d=l==c;if(d&&Ys(t)){if(!Ys(e))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new Yn),a||fa(t)?ri(t,e,r,o,i,s):function(t,e,n,r,o,i,s){switch(n){case F:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case M:return!(t.byteLength!=e.byteLength||!i(new Wt(t),new Wt(e)));case y:case b:case E:return Vs(+t,+e);case D:return t.name==e.name&&t.message==e.message;case A:case O:return t==e+"";case k:var a=un;case S:var u=1&r;if(a||(a=fn),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;r|=2,s.set(t,e);var c=ri(a(t),a(e),r,o,i,s);return s.delete(t),c;case N:if(Pn)return Pn.call(t)==Pn.call(e)}return!1}(t,e,l,r,o,i,s);if(!(1&r)){var h=f&&Bt.call(t,"__wrapped__"),m=p&&Bt.call(e,"__wrapped__");if(h||m){var _=h?t.value():t,w=m?e.value():e;return s||(s=new Yn),i(_,w,r,o,s)}}if(!d)return!1;return s||(s=new Yn),function(t,e,r,o,i,s){var a=1&r,u=ii(t),l=u.length,c=ii(e),f=c.length;if(l!=f&&!a)return!1;var p=l;for(;p--;){var d=u[p];if(!(a?d in e:Bt.call(e,d)))return!1}var h=s.get(t),m=s.get(e);if(h&&m)return h==e&&m==t;var g=!0;s.set(t,e),s.set(e,t);var v=a;for(;++p<l;){var y=t[d=u[p]],b=e[d];if(o)var D=a?o(b,y,d,e,t,s):o(y,b,d,t,e,s);if(!(D===n?y===b||i(y,b,r,o,s):D)){g=!1;break}v||(v="constructor"==d)}if(g&&!v){var _=t.constructor,w=e.constructor;_==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w||(g=!1)}return s.delete(t),s.delete(e),g}(t,e,r,o,i,s)}(t,e,r,o,Fr,i))}function Ir(t,e,r,o){var i=r.length,s=i,a=!o;if(null==t)return!s;for(t=xt(t);i--;){var u=r[i];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++i<s;){var l=(u=r[i])[0],c=t[l],f=u[1];if(a&&u[2]){if(c===n&&!(l in t))return!1}else{var p=new Yn;if(o)var d=o(c,f,l,t,e,p);if(!(d===n?Fr(f,c,3,o,p):d))return!1}}return!0}function Br(t){return!(!na(t)||(e=t,Rt&&Rt in e))&&(Qs(t)?jt:gt).test(zi(t));var e}function $r(t){return"function"==typeof t?t:null==t?iu:"object"==typeof t?qs(t)?Vr(t[0],t[1]):jr(t):hu(t)}function Rr(t){if(!Ci(t))return yn(t);var e=[];for(var n in xt(t))Bt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Lr(t){if(!na(t))return function(t){var e=[];if(null!=t)for(var n in xt(t))e.push(n);return e}(t);var e=Ci(t),n=[];for(var r in t)("constructor"!=r||!e&&Bt.call(t,r))&&n.push(r);return n}function Pr(t,e){return t<e}function zr(t,e){var n=-1,r=Js(t)?it(t.length):[];return dr(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function jr(t){var e=pi(t);return 1==e.length&&e[0][2]?Ai(e[0][0],e[0][1]):function(n){return n===t||Ir(n,t,e)}}function Vr(t,e){return wi(t)&&xi(e)?Ai(Pi(t),e):function(r){var o=Sa(r,t);return o===n&&o===e?Oa(r,t):Fr(e,o,3)}}function Hr(t,e,r,o,i){t!==e&&br(e,(function(s,a){if(i||(i=new Yn),na(s))!function(t,e,r,o,i,s,a){var u=Ti(t,r),l=Ti(e,r),c=a.get(l);if(c)return void er(t,r,c);var f=s?s(u,l,r+"",t,e,a):n,p=f===n;if(p){var d=qs(l),h=!d&&Ys(l),m=!d&&!h&&fa(l);f=l,d||h||m?qs(u)?f=u:Gs(u)?f=To(u):h?(p=!1,f=Co(l,!0)):m?(p=!1,f=Ao(l,!0)):f=[]:sa(l)||Us(l)?(f=u,Us(u)?f=ba(u):na(u)&&!Qs(u)||(f=yi(l))):p=!1}p&&(a.set(l,f),i(f,l,o,s,a),a.delete(l));er(t,r,f)}(t,e,a,r,Hr,o,i);else{var u=o?o(Ti(t,a),s,a+"",t,e,i):n;u===n&&(u=s),er(t,a,u)}}),Ia)}function Wr(t,e){var r=t.length;if(r)return Di(e+=e<0?r:0,r)?t[e]:n}function Ur(t,e,n){e=e.length?Fe(e,(function(t){return qs(t)?function(e){return Er(e,1===t.length?t[0]:t)}:t})):[iu];var r=-1;e=Fe(e,Xe(ci()));var o=zr(t,(function(t,n,o){var i=Fe(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){var r=-1,o=t.criteria,i=e.criteria,s=o.length,a=n.length;for(;++r<s;){var u=So(o[r],i[r]);if(u)return r>=a?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var s=e[r],a=Er(t,s);n(a,s)&&to(i,_o(s,t),a)}return i}function Kr(t,e,n,r){var o=r?Ve:je,i=-1,s=e.length,a=t;for(t===e&&(e=To(e)),n&&(a=Fe(t,Xe(n)));++i<s;)for(var u=0,l=e[i],c=n?n(l):l;(u=o(a,c,u,r))>-1;)a!==t&&Gt.call(a,u,1),Gt.call(t,u,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;Di(o)?Gt.call(t,o,1):po(t,o)}}return t}function Gr(t,e){return t+me(kn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>p)return n;do{e%2&&(n+=t),(e=me(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Ii(Si(t,e,iu),t+"")}function Zr(t){return Zn(Va(t))}function Qr(t,e){var n=Va(t);return Ri(n,ur(e,0,n.length))}function to(t,e,r,o){if(!na(t))return t;for(var i=-1,s=(e=_o(e,t)).length,a=s-1,u=t;null!=u&&++i<s;){var l=Pi(e[i]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=a){var f=u[l];(c=o?o(f,l,u):n)===n&&(c=na(f)?f:Di(e[i+1])?[]:{})}nr(u,l,c),u=u[l]}return t}var eo=Tn?function(t,e){return Tn.set(t,e),t}:iu,no=ne?function(t,e){return ne(t,"toString",{configurable:!0,enumerable:!1,value:nu(e),writable:!0})}:iu;function ro(t){return Ri(Va(t))}function oo(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=it(o);++r<o;)i[r]=t[r+e];return i}function io(t,e){var n;return dr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function so(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,s=t[i];null!==s&&!ca(s)&&(n?s<=e:s<e)?r=i+1:o=i}return o}return ao(t,e,iu,n)}function ao(t,e,r,o){var i=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=r(e))!=e,u=null===e,l=ca(e),c=e===n;i<s;){var f=me((i+s)/2),p=r(t[f]),d=p!==n,h=null===p,m=p==p,g=ca(p);if(a)var v=o||m;else v=c?m&&(o||d):u?m&&d&&(o||!h):l?m&&d&&!h&&(o||!g):!h&&!g&&(o?p<=e:p<e);v?i=f+1:s=f}return Dn(s,4294967294)}function uo(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Vs(a,u)){var u=a;i[o++]=0===s?0:s}}return i}function lo(t){return"number"==typeof t?t:ca(t)?d:+t}function co(t){if("string"==typeof t)return t;if(qs(t))return Fe(t,co)+"";if(ca(t))return zn?zn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function fo(t,e,n){var r=-1,o=Te,i=t.length,s=!0,a=[],u=a;if(n)s=!1,o=Me;else if(i>=200){var l=e?null:Xo(t);if(l)return fn(l);s=!1,o=Qe,u=new Gn}else u=e?[]:a;t:for(;++r<i;){var c=t[r],f=e?e(c):c;if(c=n||0!==c?c:0,s&&f==f){for(var p=u.length;p--;)if(u[p]===f)continue t;e&&u.push(f),a.push(c)}else o(u,f,n)||(u!==a&&u.push(f),a.push(c))}return a}function po(t,e){return null==(t=Oi(t,e=_o(e,t)))||delete t[Pi(Zi(e))]}function ho(t,e,n,r){return to(t,e,n(Er(t,e)),r)}function mo(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?oo(t,r?0:i,r?i+1:o):oo(t,r?i+1:0,r?o:i)}function go(t,e){var n=t;return n instanceof Un&&(n=n.value()),Be(e,(function(t,e){return e.func.apply(e.thisArg,Ie([t],e.args))}),n)}function vo(t,e,n){var r=t.length;if(r<2)return r?fo(t[0]):[];for(var o=-1,i=it(r);++o<r;)for(var s=t[o],a=-1;++a<r;)a!=o&&(i[o]=pr(i[o]||s,t[a],e,n));return fo(yr(i,1),e,n)}function yo(t,e,r){for(var o=-1,i=t.length,s=e.length,a={};++o<i;){var u=o<s?e[o]:n;r(a,t[o],u)}return a}function bo(t){return Gs(t)?t:[]}function Do(t){return"function"==typeof t?t:iu}function _o(t,e){return qs(t)?t:wi(t,e)?[t]:Li(Da(t))}var wo=Xr;function ko(t,e,r){var o=t.length;return r=r===n?o:r,!e&&r>=o?t:oo(t,e,r)}var Eo=ue||function(t){return de.clearTimeout(t)};function Co(t,e){if(e)return t.slice();var n=t.length,r=Ut?Ut(n):new t.constructor(n);return t.copy(r),r}function xo(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Ao(t,e){var n=e?xo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function So(t,e){if(t!==e){var r=t!==n,o=null===t,i=t==t,s=ca(t),a=e!==n,u=null===e,l=e==e,c=ca(e);if(!u&&!c&&!s&&t>e||s&&a&&l&&!u&&!c||o&&a&&l||!r&&l||!i)return 1;if(!o&&!s&&!c&&t<e||c&&r&&i&&!o&&!s||u&&r&&i||!a&&i||!l)return-1}return 0}function Oo(t,e,n,r){for(var o=-1,i=t.length,s=n.length,a=-1,u=e.length,l=bn(i-s,0),c=it(u+l),f=!r;++a<u;)c[a]=e[a];for(;++o<s;)(f||o<i)&&(c[n[o]]=t[o]);for(;l--;)c[a++]=t[o++];return c}function No(t,e,n,r){for(var o=-1,i=t.length,s=-1,a=n.length,u=-1,l=e.length,c=bn(i-a,0),f=it(c+l),p=!r;++o<c;)f[o]=t[o];for(var d=o;++u<l;)f[d+u]=e[u];for(;++s<a;)(p||o<i)&&(f[d+n[s]]=t[o++]);return f}function To(t,e){var n=-1,r=t.length;for(e||(e=it(r));++n<r;)e[n]=t[n];return e}function Mo(t,e,r,o){var i=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var u=e[s],l=o?o(r[u],t[u],u,r,t):n;l===n&&(l=t[u]),i?sr(r,u,l):nr(r,u,l)}return r}function Fo(t,e){return function(n,r){var o=qs(n)?xe:or,i=e?e():{};return o(n,t,ci(r,2),i)}}function Io(t){return Xr((function(e,r){var o=-1,i=r.length,s=i>1?r[i-1]:n,a=i>2?r[2]:n;for(s=t.length>3&&"function"==typeof s?(i--,s):n,a&&_i(r[0],r[1],a)&&(s=i<3?n:s,i=1),e=xt(e);++o<i;){var u=r[o];u&&t(e,u,o,s)}return e}))}function Bo(t,e){return function(n,r){if(null==n)return n;if(!Js(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=xt(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}function $o(t){return function(e,n,r){for(var o=-1,i=xt(e),s=r(e),a=s.length;a--;){var u=s[t?a:++o];if(!1===n(i[u],u,i))break}return e}}function Ro(t){return function(e){var r=an(e=Da(e))?hn(e):n,o=r?r[0]:e.charAt(0),i=r?ko(r,1).join(""):e.slice(1);return o[t]()+i}}function Lo(t){return function(e){return Be(Qa(Ua(e).replace(Zt,"")),t,"")}}function Po(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Vn(t.prototype),r=t.apply(n,e);return na(r)?r:n}}function zo(t){return function(e,r,o){var i=xt(e);if(!Js(e)){var s=ci(r,3);e=Fa(e),r=function(t){return s(i[t],t,i)}}var a=t(e,r,o);return a>-1?i[s?e[a]:a]:n}}function jo(t){return oi((function(e){var o=e.length,i=o,s=Wn.prototype.thru;for(t&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new Ot(r);if(s&&!u&&"wrapper"==ui(a))var u=new Wn([],!0)}for(i=u?i:o;++i<o;){var l=ui(a=e[i]),c="wrapper"==l?ai(a):n;u=c&&ki(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ui(c[0])].apply(u,c[3]):1==a.length&&ki(a)?u[l]():u.thru(a)}return function(){var t=arguments,n=t[0];if(u&&1==t.length&&qs(n))return u.plant(n).value();for(var r=0,i=o?e[r].apply(this,t):n;++r<o;)i=e[r].call(this,i);return i}}))}function Vo(t,e,r,o,i,s,a,u,c,f){var p=e&l,d=1&e,h=2&e,m=24&e,g=512&e,v=h?n:Po(t);return function n(){for(var l=arguments.length,y=it(l),b=l;b--;)y[b]=arguments[b];if(m)var D=li(n),_=nn(y,D);if(o&&(y=Oo(y,o,i,m)),s&&(y=No(y,s,a,m)),l-=_,m&&l<f){var w=cn(y,D);return Go(t,e,Vo,n.placeholder,r,y,w,u,c,f-l)}var k=d?r:this,E=h?k[t]:t;return l=y.length,u?y=Ni(y,u):g&&l>1&&y.reverse(),p&&c<l&&(y.length=c),this&&this!==de&&this instanceof n&&(E=v||Po(E)),E.apply(k,y)}}function Ho(t,e){return function(n,r){return function(t,e,n,r){return _r(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function Wo(t,e){return function(r,o){var i;if(r===n&&o===n)return e;if(r!==n&&(i=r),o!==n){if(i===n)return o;"string"==typeof r||"string"==typeof o?(r=co(r),o=co(o)):(r=lo(r),o=lo(o)),i=t(r,o)}return i}}function Uo(t){return oi((function(e){return e=Fe(e,Xe(ci())),Xr((function(n){var r=this;return t(e,(function(t){return Ce(t,r,n)}))}))}))}function qo(t,e){var r=(e=e===n?" ":co(e)).length;if(r<2)return r?Yr(e,t):e;var o=Yr(e,he(t/dn(e)));return an(e)?ko(hn(o),0,t).join(""):o.slice(0,t)}function Ko(t){return function(e,r,o){return o&&"number"!=typeof o&&_i(e,r,o)&&(r=o=n),e=ma(e),r===n?(r=e,e=0):r=ma(r),function(t,e,n,r){for(var o=-1,i=bn(he((e-t)/(n||1)),0),s=it(i);i--;)s[r?i:++o]=t,t+=n;return s}(e,r,o=o===n?e<r?1:-1:ma(o),t)}}function Jo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ya(e),n=ya(n)),t(e,n)}}function Go(t,e,r,o,i,s,l,c,f,p){var d=8&e;e|=d?a:u,4&(e&=~(d?u:a))||(e&=-4);var h=[t,e,i,d?s:n,d?l:n,d?n:s,d?n:l,c,f,p],m=r.apply(n,h);return ki(t)&&Mi(m,h),m.placeholder=o,Bi(m,t,e)}function Yo(t){var e=Ct[t];return function(t,n){if(t=ya(t),(n=null==n?0:Dn(ga(n),292))&&Le(t)){var r=(Da(t)+"e").split("e");return+((r=(Da(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Xo=Sn&&1/fn(new Sn([,-0]))[1]==f?function(t){return new Sn(t)}:cu;function Zo(t){return function(e){var n=gi(e);return n==k?un(e):n==S?pn(e):function(t,e){return Fe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Qo(t,e,o,f,p,d,h,m){var g=2&e;if(!g&&"function"!=typeof t)throw new Ot(r);var v=f?f.length:0;if(v||(e&=-97,f=p=n),h=h===n?h:bn(ga(h),0),m=m===n?m:ga(m),v-=p?p.length:0,e&u){var y=f,b=p;f=p=n}var D=g?n:ai(t),_=[t,e,o,f,p,y,b,d,h,m];if(D&&function(t,e){var n=t[1],r=e[1],o=n|r,s=o<131,a=r==l&&8==n||r==l&&n==c&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var u=e[3];if(u){var f=t[3];t[3]=f?Oo(f,u,e[4]):u,t[4]=f?cn(t[3],i):e[4]}(u=e[5])&&(f=t[5],t[5]=f?No(f,u,e[6]):u,t[6]=f?cn(t[5],i):e[6]);(u=e[7])&&(t[7]=u);r&l&&(t[8]=null==t[8]?e[8]:Dn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=o}(_,D),t=_[0],e=_[1],o=_[2],f=_[3],p=_[4],!(m=_[9]=_[9]===n?g?0:t.length:bn(_[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)w=8==e||e==s?function(t,e,r){var o=Po(t);return function i(){for(var s=arguments.length,a=it(s),u=s,l=li(i);u--;)a[u]=arguments[u];var c=s<3&&a[0]!==l&&a[s-1]!==l?[]:cn(a,l);return(s-=c.length)<r?Go(t,e,Vo,i.placeholder,n,a,c,n,n,r-s):Ce(this&&this!==de&&this instanceof i?o:t,this,a)}}(t,e,m):e!=a&&33!=e||p.length?Vo.apply(n,_):function(t,e,n,r){var o=1&e,i=Po(t);return function e(){for(var s=-1,a=arguments.length,u=-1,l=r.length,c=it(l+a),f=this&&this!==de&&this instanceof e?i:t;++u<l;)c[u]=r[u];for(;a--;)c[u++]=arguments[++s];return Ce(f,o?n:this,c)}}(t,e,o,f);else var w=function(t,e,n){var r=1&e,o=Po(t);return function e(){return(this&&this!==de&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,o);return Bi((D?eo:Mi)(w,_),t,e)}function ti(t,e,r,o){return t===n||Vs(t,Mt[r])&&!Bt.call(o,r)?e:t}function ei(t,e,r,o,i,s){return na(t)&&na(e)&&(s.set(e,t),Hr(t,e,n,ei,s),s.delete(e)),t}function ni(t){return sa(t)?n:t}function ri(t,e,r,o,i,s){var a=1&r,u=t.length,l=e.length;if(u!=l&&!(a&&l>u))return!1;var c=s.get(t),f=s.get(e);if(c&&f)return c==e&&f==t;var p=-1,d=!0,h=2&r?new Gn:n;for(s.set(t,e),s.set(e,t);++p<u;){var m=t[p],g=e[p];if(o)var v=a?o(g,m,p,e,t,s):o(m,g,p,t,e,s);if(v!==n){if(v)continue;d=!1;break}if(h){if(!Re(e,(function(t,e){if(!Qe(h,e)&&(m===t||i(m,t,r,o,s)))return h.push(e)}))){d=!1;break}}else if(m!==g&&!i(m,g,r,o,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function oi(t){return Ii(Si(t,n,Ki),t+"")}function ii(t){return Cr(t,Fa,hi)}function si(t){return Cr(t,Ia,mi)}var ai=Tn?function(t){return Tn.get(t)}:cu;function ui(t){for(var e=t.name+"",n=Mn[e],r=Bt.call(Mn,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function li(t){return(Bt.call(jn,"placeholder")?jn:t).placeholder}function ci(){var t=jn.iteratee||su;return t=t===su?$r:t,arguments.length?t(arguments[0],arguments[1]):t}function fi(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function pi(t){for(var e=Fa(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,xi(o)]}return e}function di(t,e){var r=function(t,e){return null==t?n:t[e]}(t,e);return Br(r)?r:n}var hi=ve?function(t){return null==t?[]:(t=xt(t),Ne(ve(t),(function(e){return Jt.call(t,e)})))}:vu,mi=ve?function(t){for(var e=[];t;)Ie(e,hi(t)),t=qt(t);return e}:vu,gi=xr;function vi(t,e,n){for(var r=-1,o=(e=_o(e,t)).length,i=!1;++r<o;){var s=Pi(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&ea(o)&&Di(s,o)&&(qs(t)||Us(t))}function yi(t){return"function"!=typeof t.constructor||Ci(t)?{}:Vn(qt(t))}function bi(t){return qs(t)||Us(t)||!!(Yt&&t&&t[Yt])}function Di(t,e){var n=typeof t;return!!(e=null==e?p:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function _i(t,e,n){if(!na(n))return!1;var r=typeof e;return!!("number"==r?Js(n)&&Di(e,n.length):"string"==r&&e in n)&&Vs(n[e],t)}function wi(t,e){if(qs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ca(t))||(tt.test(t)||!Q.test(t)||null!=e&&t in xt(e))}function ki(t){var e=ui(t),n=jn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=ai(n);return!!r&&t===r[0]}(Cn&&gi(new Cn(new ArrayBuffer(1)))!=F||xn&&gi(new xn)!=k||An&&gi(An.resolve())!=x||Sn&&gi(new Sn)!=S||On&&gi(new On)!=T)&&(gi=function(t){var e=xr(t),r=e==C?t.constructor:n,o=r?zi(r):"";if(o)switch(o){case Fn:return F;case In:return k;case Bn:return x;case $n:return S;case Rn:return T}return e});var Ei=Ft?Qs:yu;function Ci(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Mt)}function xi(t){return t==t&&!na(t)}function Ai(t,e){return function(r){return null!=r&&(r[t]===e&&(e!==n||t in xt(r)))}}function Si(t,e,r){return e=bn(e===n?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=bn(n.length-e,0),s=it(i);++o<i;)s[o]=n[e+o];o=-1;for(var a=it(e+1);++o<e;)a[o]=n[o];return a[e]=r(s),Ce(t,this,a)}}function Oi(t,e){return e.length<2?t:Er(t,oo(e,0,-1))}function Ni(t,e){for(var r=t.length,o=Dn(e.length,r),i=To(t);o--;){var s=e[o];t[o]=Di(s,r)?i[s]:n}return t}function Ti(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Mi=$i(eo),Fi=pe||function(t,e){return de.setTimeout(t,e)},Ii=$i(no);function Bi(t,e,n){var r=e+"";return Ii(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ae(m,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ut):[]}(r),n)))}function $i(t){var e=0,r=0;return function(){var o=_n(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Ri(t,e){var r=-1,o=t.length,i=o-1;for(e=e===n?o:e;++r<e;){var s=Gr(r,i),a=t[s];t[s]=t[r],t[r]=a}return t.length=e,t}var Li=function(t){var e=$s(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(et,(function(t,n,r,o){e.push(r?o.replace(ft,"$1"):n||t)})),e}));function Pi(t){if("string"==typeof t||ca(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function zi(t){if(null!=t){try{return It.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function ji(t){if(t instanceof Un)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=To(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Vi=Xr((function(t,e){return Gs(t)?pr(t,yr(e,1,Gs,!0)):[]})),Hi=Xr((function(t,e){var r=Zi(e);return Gs(r)&&(r=n),Gs(t)?pr(t,yr(e,1,Gs,!0),ci(r,2)):[]})),Wi=Xr((function(t,e){var r=Zi(e);return Gs(r)&&(r=n),Gs(t)?pr(t,yr(e,1,Gs,!0),n,r):[]}));function Ui(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ga(n);return o<0&&(o=bn(r+o,0)),ze(t,ci(e,3),o)}function qi(t,e,r){var o=null==t?0:t.length;if(!o)return-1;var i=o-1;return r!==n&&(i=ga(r),i=r<0?bn(o+i,0):Dn(i,o-1)),ze(t,ci(e,3),i,!0)}function Ki(t){return(null==t?0:t.length)?yr(t,1):[]}function Ji(t){return t&&t.length?t[0]:n}var Gi=Xr((function(t){var e=Fe(t,bo);return e.length&&e[0]===t[0]?Nr(e):[]})),Yi=Xr((function(t){var e=Zi(t),r=Fe(t,bo);return e===Zi(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Nr(r,ci(e,2)):[]})),Xi=Xr((function(t){var e=Zi(t),r=Fe(t,bo);return(e="function"==typeof e?e:n)&&r.pop(),r.length&&r[0]===t[0]?Nr(r,n,e):[]}));function Zi(t){var e=null==t?0:t.length;return e?t[e-1]:n}var Qi=Xr(ts);function ts(t,e){return t&&t.length&&e&&e.length?Kr(t,e):t}var es=oi((function(t,e){var n=null==t?0:t.length,r=ar(t,e);return Jr(t,Fe(e,(function(t){return Di(t,n)?+t:t})).sort(So)),r}));function ns(t){return null==t?t:En.call(t)}var rs=Xr((function(t){return fo(yr(t,1,Gs,!0))})),os=Xr((function(t){var e=Zi(t);return Gs(e)&&(e=n),fo(yr(t,1,Gs,!0),ci(e,2))})),is=Xr((function(t){var e=Zi(t);return e="function"==typeof e?e:n,fo(yr(t,1,Gs,!0),n,e)}));function ss(t){if(!t||!t.length)return[];var e=0;return t=Ne(t,(function(t){if(Gs(t))return e=bn(t.length,e),!0})),Ge(e,(function(e){return Fe(t,Ue(e))}))}function as(t,e){if(!t||!t.length)return[];var r=ss(t);return null==e?r:Fe(r,(function(t){return Ce(e,n,t)}))}var us=Xr((function(t,e){return Gs(t)?pr(t,e):[]})),ls=Xr((function(t){return vo(Ne(t,Gs))})),cs=Xr((function(t){var e=Zi(t);return Gs(e)&&(e=n),vo(Ne(t,Gs),ci(e,2))})),fs=Xr((function(t){var e=Zi(t);return e="function"==typeof e?e:n,vo(Ne(t,Gs),n,e)})),ps=Xr(ss);var ds=Xr((function(t){var e=t.length,r=e>1?t[e-1]:n;return r="function"==typeof r?(t.pop(),r):n,as(t,r)}));function hs(t){var e=jn(t);return e.__chain__=!0,e}function ms(t,e){return e(t)}var gs=oi((function(t){var e=t.length,r=e?t[0]:0,o=this.__wrapped__,i=function(e){return ar(e,t)};return!(e>1||this.__actions__.length)&&o instanceof Un&&Di(r)?((o=o.slice(r,+r+(e?1:0))).__actions__.push({func:ms,args:[i],thisArg:n}),new Wn(o,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(i)}));var vs=Fo((function(t,e,n){Bt.call(t,n)?++t[n]:sr(t,n,1)}));var ys=zo(Ui),bs=zo(qi);function Ds(t,e){return(qs(t)?Ae:dr)(t,ci(e,3))}function _s(t,e){return(qs(t)?Se:hr)(t,ci(e,3))}var ws=Fo((function(t,e,n){Bt.call(t,n)?t[n].push(e):sr(t,n,[e])}));var ks=Xr((function(t,e,n){var r=-1,o="function"==typeof e,i=Js(t)?it(t.length):[];return dr(t,(function(t){i[++r]=o?Ce(e,t,n):Tr(t,e,n)})),i})),Es=Fo((function(t,e,n){sr(t,n,e)}));function Cs(t,e){return(qs(t)?Fe:zr)(t,ci(e,3))}var xs=Fo((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var As=Xr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&_i(t,e[0],e[1])?e=[]:n>2&&_i(e[0],e[1],e[2])&&(e=[e[0]]),Ur(t,yr(e,1),[])})),Ss=fe||function(){return de.Date.now()};function Os(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Qo(t,l,n,n,n,n,e)}function Ns(t,e){var o;if("function"!=typeof e)throw new Ot(r);return t=ga(t),function(){return--t>0&&(o=e.apply(this,arguments)),t<=1&&(e=n),o}}var Ts=Xr((function(t,e,n){var r=1;if(n.length){var o=cn(n,li(Ts));r|=a}return Qo(t,r,e,n,o)})),Ms=Xr((function(t,e,n){var r=3;if(n.length){var o=cn(n,li(Ms));r|=a}return Qo(e,r,t,n,o)}));function Fs(t,e,o){var i,s,a,u,l,c,f=0,p=!1,d=!1,h=!0;if("function"!=typeof t)throw new Ot(r);function m(e){var r=i,o=s;return i=s=n,f=e,u=t.apply(o,r)}function g(t){return f=t,l=Fi(y,e),p?m(t):u}function v(t){var r=t-c;return c===n||r>=e||r<0||d&&t-f>=a}function y(){var t=Ss();if(v(t))return b(t);l=Fi(y,function(t){var n=e-(t-c);return d?Dn(n,a-(t-f)):n}(t))}function b(t){return l=n,h&&i?m(t):(i=s=n,u)}function D(){var t=Ss(),r=v(t);if(i=arguments,s=this,c=t,r){if(l===n)return g(c);if(d)return Eo(l),l=Fi(y,e),m(c)}return l===n&&(l=Fi(y,e)),u}return e=ya(e)||0,na(o)&&(p=!!o.leading,a=(d="maxWait"in o)?bn(ya(o.maxWait)||0,e):a,h="trailing"in o?!!o.trailing:h),D.cancel=function(){l!==n&&Eo(l),f=0,i=c=s=l=n},D.flush=function(){return l===n?u:b(Ss())},D}var Is=Xr((function(t,e){return fr(t,1,e)})),Bs=Xr((function(t,e,n){return fr(t,ya(e)||0,n)}));function $s(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(r);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new($s.Cache||Jn),n}function Rs(t){if("function"!=typeof t)throw new Ot(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}$s.Cache=Jn;var Ls=wo((function(t,e){var n=(e=1==e.length&&qs(e[0])?Fe(e[0],Xe(ci())):Fe(yr(e,1),Xe(ci()))).length;return Xr((function(r){for(var o=-1,i=Dn(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Ce(t,this,r)}))})),Ps=Xr((function(t,e){var r=cn(e,li(Ps));return Qo(t,a,n,e,r)})),zs=Xr((function(t,e){var r=cn(e,li(zs));return Qo(t,u,n,e,r)})),js=oi((function(t,e){return Qo(t,c,n,n,n,e)}));function Vs(t,e){return t===e||t!=t&&e!=e}var Hs=Jo(Ar),Ws=Jo((function(t,e){return t>=e})),Us=Mr(function(){return arguments}())?Mr:function(t){return ra(t)&&Bt.call(t,"callee")&&!Jt.call(t,"callee")},qs=it.isArray,Ks=be?Xe(be):function(t){return ra(t)&&xr(t)==M};function Js(t){return null!=t&&ea(t.length)&&!Qs(t)}function Gs(t){return ra(t)&&Js(t)}var Ys=ye||yu,Xs=De?Xe(De):function(t){return ra(t)&&xr(t)==b};function Zs(t){if(!ra(t))return!1;var e=xr(t);return e==D||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Qs(t){if(!na(t))return!1;var e=xr(t);return e==_||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ta(t){return"number"==typeof t&&t==ga(t)}function ea(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=p}function na(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var oa=_e?Xe(_e):function(t){return ra(t)&&gi(t)==k};function ia(t){return"number"==typeof t||ra(t)&&xr(t)==E}function sa(t){if(!ra(t)||xr(t)!=C)return!1;var e=qt(t);if(null===e)return!0;var n=Bt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&It.call(n)==Pt}var aa=we?Xe(we):function(t){return ra(t)&&xr(t)==A};var ua=ke?Xe(ke):function(t){return ra(t)&&gi(t)==S};function la(t){return"string"==typeof t||!qs(t)&&ra(t)&&xr(t)==O}function ca(t){return"symbol"==typeof t||ra(t)&&xr(t)==N}var fa=Ee?Xe(Ee):function(t){return ra(t)&&ea(t.length)&&!!se[xr(t)]};var pa=Jo(Pr),da=Jo((function(t,e){return t<=e}));function ha(t){if(!t)return[];if(Js(t))return la(t)?hn(t):To(t);if(Xt&&t[Xt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xt]());var e=gi(t);return(e==k?un:e==S?fn:Va)(t)}function ma(t){return t?(t=ya(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=ma(t),n=e%1;return e==e?n?e-n:e:0}function va(t){return t?ur(ga(t),0,h):0}function ya(t){if("number"==typeof t)return t;if(ca(t))return d;if(na(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=na(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var n=mt.test(t);return n||vt.test(t)?ce(t.slice(2),n?2:8):ht.test(t)?d:+t}function ba(t){return Mo(t,Ia(t))}function Da(t){return null==t?"":co(t)}var _a=Io((function(t,e){if(Ci(e)||Js(e))Mo(e,Fa(e),t);else for(var n in e)Bt.call(e,n)&&nr(t,n,e[n])})),wa=Io((function(t,e){Mo(e,Ia(e),t)})),ka=Io((function(t,e,n,r){Mo(e,Ia(e),t,r)})),Ea=Io((function(t,e,n,r){Mo(e,Fa(e),t,r)})),Ca=oi(ar);var xa=Xr((function(t,e){t=xt(t);var r=-1,o=e.length,i=o>2?e[2]:n;for(i&&_i(e[0],e[1],i)&&(o=1);++r<o;)for(var s=e[r],a=Ia(s),u=-1,l=a.length;++u<l;){var c=a[u],f=t[c];(f===n||Vs(f,Mt[c])&&!Bt.call(t,c))&&(t[c]=s[c])}return t})),Aa=Xr((function(t){return t.push(n,ei),Ce($a,n,t)}));function Sa(t,e,r){var o=null==t?n:Er(t,e);return o===n?r:o}function Oa(t,e){return null!=t&&vi(t,e,Or)}var Na=Ho((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),nu(iu)),Ta=Ho((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),Bt.call(t,e)?t[e].push(n):t[e]=[n]}),ci),Ma=Xr(Tr);function Fa(t){return Js(t)?Xn(t):Rr(t)}function Ia(t){return Js(t)?Xn(t,!0):Lr(t)}var Ba=Io((function(t,e,n){Hr(t,e,n)})),$a=Io((function(t,e,n,r){Hr(t,e,n,r)})),Ra=oi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Fe(e,(function(e){return e=_o(e,t),r||(r=e.length>1),e})),Mo(t,si(t),n),r&&(n=lr(n,7,ni));for(var o=e.length;o--;)po(n,e[o]);return n}));var La=oi((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return Oa(t,n)}))}(t,e)}));function Pa(t,e){if(null==t)return{};var n=Fe(si(t),(function(t){return[t]}));return e=ci(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var za=Zo(Fa),ja=Zo(Ia);function Va(t){return null==t?[]:Ze(t,Fa(t))}var Ha=Lo((function(t,e,n){return e=e.toLowerCase(),t+(n?Wa(e):e)}));function Wa(t){return Za(Da(t).toLowerCase())}function Ua(t){return(t=Da(t))&&t.replace(bt,rn).replace(Qt,"")}var qa=Lo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ka=Lo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ja=Ro("toLowerCase");var Ga=Lo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ya=Lo((function(t,e,n){return t+(n?" ":"")+Za(e)}));var Xa=Lo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Za=Ro("toUpperCase");function Qa(t,e,r){return t=Da(t),(e=r?n:e)===n?function(t){return re.test(t)}(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var tu=Xr((function(t,e){try{return Ce(t,n,e)}catch(t){return Zs(t)?t:new kt(t)}})),eu=oi((function(t,e){return Ae(e,(function(e){e=Pi(e),sr(t,e,Ts(t[e],t))})),t}));function nu(t){return function(){return t}}var ru=jo(),ou=jo(!0);function iu(t){return t}function su(t){return $r("function"==typeof t?t:lr(t,1))}var au=Xr((function(t,e){return function(n){return Tr(n,t,e)}})),uu=Xr((function(t,e){return function(n){return Tr(t,n,e)}}));function lu(t,e,n){var r=Fa(e),o=kr(e,r);null!=n||na(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=kr(e,Fa(e)));var i=!(na(n)&&"chain"in n&&!n.chain),s=Qs(t);return Ae(o,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__),o=n.__actions__=To(this.__actions__);return o.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Ie([this.value()],arguments))})})),t}function cu(){}var fu=Uo(Fe),pu=Uo(Oe),du=Uo(Re);function hu(t){return wi(t)?Ue(Pi(t)):function(t){return function(e){return Er(e,t)}}(t)}var mu=Ko(),gu=Ko(!0);function vu(){return[]}function yu(){return!1}var bu=Wo((function(t,e){return t+e}),0),Du=Yo("ceil"),_u=Wo((function(t,e){return t/e}),1),wu=Yo("floor");var ku,Eu=Wo((function(t,e){return t*e}),1),Cu=Yo("round"),xu=Wo((function(t,e){return t-e}),0);return jn.after=function(t,e){if("function"!=typeof e)throw new Ot(r);return t=ga(t),function(){if(--t<1)return e.apply(this,arguments)}},jn.ary=Os,jn.assign=_a,jn.assignIn=wa,jn.assignInWith=ka,jn.assignWith=Ea,jn.at=Ca,jn.before=Ns,jn.bind=Ts,jn.bindAll=eu,jn.bindKey=Ms,jn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qs(t)?t:[t]},jn.chain=hs,jn.chunk=function(t,e,r){e=(r?_i(t,e,r):e===n)?1:bn(ga(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var i=0,s=0,a=it(he(o/e));i<o;)a[s++]=oo(t,i,i+=e);return a},jn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},jn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=it(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Ie(qs(n)?To(n):[n],yr(e,1))},jn.cond=function(t){var e=null==t?0:t.length,n=ci();return t=e?Fe(t,(function(t){if("function"!=typeof t[1])throw new Ot(r);return[n(t[0]),t[1]]})):[],Xr((function(n){for(var r=-1;++r<e;){var o=t[r];if(Ce(o[0],this,n))return Ce(o[1],this,n)}}))},jn.conforms=function(t){return function(t){var e=Fa(t);return function(n){return cr(n,t,e)}}(lr(t,1))},jn.constant=nu,jn.countBy=vs,jn.create=function(t,e){var n=Vn(t);return null==e?n:ir(n,e)},jn.curry=function t(e,r,o){var i=Qo(e,8,n,n,n,n,n,r=o?n:r);return i.placeholder=t.placeholder,i},jn.curryRight=function t(e,r,o){var i=Qo(e,s,n,n,n,n,n,r=o?n:r);return i.placeholder=t.placeholder,i},jn.debounce=Fs,jn.defaults=xa,jn.defaultsDeep=Aa,jn.defer=Is,jn.delay=Bs,jn.difference=Vi,jn.differenceBy=Hi,jn.differenceWith=Wi,jn.drop=function(t,e,r){var o=null==t?0:t.length;return o?oo(t,(e=r||e===n?1:ga(e))<0?0:e,o):[]},jn.dropRight=function(t,e,r){var o=null==t?0:t.length;return o?oo(t,0,(e=o-(e=r||e===n?1:ga(e)))<0?0:e):[]},jn.dropRightWhile=function(t,e){return t&&t.length?mo(t,ci(e,3),!0,!0):[]},jn.dropWhile=function(t,e){return t&&t.length?mo(t,ci(e,3),!0):[]},jn.fill=function(t,e,r,o){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&_i(t,e,r)&&(r=0,o=i),function(t,e,r,o){var i=t.length;for((r=ga(r))<0&&(r=-r>i?0:i+r),(o=o===n||o>i?i:ga(o))<0&&(o+=i),o=r>o?0:va(o);r<o;)t[r++]=e;return t}(t,e,r,o)):[]},jn.filter=function(t,e){return(qs(t)?Ne:vr)(t,ci(e,3))},jn.flatMap=function(t,e){return yr(Cs(t,e),1)},jn.flatMapDeep=function(t,e){return yr(Cs(t,e),f)},jn.flatMapDepth=function(t,e,r){return r=r===n?1:ga(r),yr(Cs(t,e),r)},jn.flatten=Ki,jn.flattenDeep=function(t){return(null==t?0:t.length)?yr(t,f):[]},jn.flattenDepth=function(t,e){return(null==t?0:t.length)?yr(t,e=e===n?1:ga(e)):[]},jn.flip=function(t){return Qo(t,512)},jn.flow=ru,jn.flowRight=ou,jn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},jn.functions=function(t){return null==t?[]:kr(t,Fa(t))},jn.functionsIn=function(t){return null==t?[]:kr(t,Ia(t))},jn.groupBy=ws,jn.initial=function(t){return(null==t?0:t.length)?oo(t,0,-1):[]},jn.intersection=Gi,jn.intersectionBy=Yi,jn.intersectionWith=Xi,jn.invert=Na,jn.invertBy=Ta,jn.invokeMap=ks,jn.iteratee=su,jn.keyBy=Es,jn.keys=Fa,jn.keysIn=Ia,jn.map=Cs,jn.mapKeys=function(t,e){var n={};return e=ci(e,3),_r(t,(function(t,r,o){sr(n,e(t,r,o),t)})),n},jn.mapValues=function(t,e){var n={};return e=ci(e,3),_r(t,(function(t,r,o){sr(n,r,e(t,r,o))})),n},jn.matches=function(t){return jr(lr(t,1))},jn.matchesProperty=function(t,e){return Vr(t,lr(e,1))},jn.memoize=$s,jn.merge=Ba,jn.mergeWith=$a,jn.method=au,jn.methodOf=uu,jn.mixin=lu,jn.negate=Rs,jn.nthArg=function(t){return t=ga(t),Xr((function(e){return Wr(e,t)}))},jn.omit=Ra,jn.omitBy=function(t,e){return Pa(t,Rs(ci(e)))},jn.once=function(t){return Ns(2,t)},jn.orderBy=function(t,e,r,o){return null==t?[]:(qs(e)||(e=null==e?[]:[e]),qs(r=o?n:r)||(r=null==r?[]:[r]),Ur(t,e,r))},jn.over=fu,jn.overArgs=Ls,jn.overEvery=pu,jn.overSome=du,jn.partial=Ps,jn.partialRight=zs,jn.partition=xs,jn.pick=La,jn.pickBy=Pa,jn.property=hu,jn.propertyOf=function(t){return function(e){return null==t?n:Er(t,e)}},jn.pull=Qi,jn.pullAll=ts,jn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Kr(t,e,ci(n,2)):t},jn.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Kr(t,e,n,r):t},jn.pullAt=es,jn.range=mu,jn.rangeRight=gu,jn.rearg=js,jn.reject=function(t,e){return(qs(t)?Ne:vr)(t,Rs(ci(e,3)))},jn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=ci(e,3);++r<i;){var s=t[r];e(s,r,t)&&(n.push(s),o.push(r))}return Jr(t,o),n},jn.rest=function(t,e){if("function"!=typeof t)throw new Ot(r);return Xr(t,e=e===n?e:ga(e))},jn.reverse=ns,jn.sampleSize=function(t,e,r){return e=(r?_i(t,e,r):e===n)?1:ga(e),(qs(t)?Qn:Qr)(t,e)},jn.set=function(t,e,n){return null==t?t:to(t,e,n)},jn.setWith=function(t,e,r,o){return o="function"==typeof o?o:n,null==t?t:to(t,e,r,o)},jn.shuffle=function(t){return(qs(t)?tr:ro)(t)},jn.slice=function(t,e,r){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&_i(t,e,r)?(e=0,r=o):(e=null==e?0:ga(e),r=r===n?o:ga(r)),oo(t,e,r)):[]},jn.sortBy=As,jn.sortedUniq=function(t){return t&&t.length?uo(t):[]},jn.sortedUniqBy=function(t,e){return t&&t.length?uo(t,ci(e,2)):[]},jn.split=function(t,e,r){return r&&"number"!=typeof r&&_i(t,e,r)&&(e=r=n),(r=r===n?h:r>>>0)?(t=Da(t))&&("string"==typeof e||null!=e&&!aa(e))&&!(e=co(e))&&an(t)?ko(hn(t),0,r):t.split(e,r):[]},jn.spread=function(t,e){if("function"!=typeof t)throw new Ot(r);return e=null==e?0:bn(ga(e),0),Xr((function(n){var r=n[e],o=ko(n,0,e);return r&&Ie(o,r),Ce(t,this,o)}))},jn.tail=function(t){var e=null==t?0:t.length;return e?oo(t,1,e):[]},jn.take=function(t,e,r){return t&&t.length?oo(t,0,(e=r||e===n?1:ga(e))<0?0:e):[]},jn.takeRight=function(t,e,r){var o=null==t?0:t.length;return o?oo(t,(e=o-(e=r||e===n?1:ga(e)))<0?0:e,o):[]},jn.takeRightWhile=function(t,e){return t&&t.length?mo(t,ci(e,3),!1,!0):[]},jn.takeWhile=function(t,e){return t&&t.length?mo(t,ci(e,3)):[]},jn.tap=function(t,e){return e(t),t},jn.throttle=function(t,e,n){var o=!0,i=!0;if("function"!=typeof t)throw new Ot(r);return na(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Fs(t,e,{leading:o,maxWait:e,trailing:i})},jn.thru=ms,jn.toArray=ha,jn.toPairs=za,jn.toPairsIn=ja,jn.toPath=function(t){return qs(t)?Fe(t,Pi):ca(t)?[t]:To(Li(Da(t)))},jn.toPlainObject=ba,jn.transform=function(t,e,n){var r=qs(t),o=r||Ys(t)||fa(t);if(e=ci(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:na(t)&&Qs(i)?Vn(qt(t)):{}}return(o?Ae:_r)(t,(function(t,r,o){return e(n,t,r,o)})),n},jn.unary=function(t){return Os(t,1)},jn.union=rs,jn.unionBy=os,jn.unionWith=is,jn.uniq=function(t){return t&&t.length?fo(t):[]},jn.uniqBy=function(t,e){return t&&t.length?fo(t,ci(e,2)):[]},jn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?fo(t,n,e):[]},jn.unset=function(t,e){return null==t||po(t,e)},jn.unzip=ss,jn.unzipWith=as,jn.update=function(t,e,n){return null==t?t:ho(t,e,Do(n))},jn.updateWith=function(t,e,r,o){return o="function"==typeof o?o:n,null==t?t:ho(t,e,Do(r),o)},jn.values=Va,jn.valuesIn=function(t){return null==t?[]:Ze(t,Ia(t))},jn.without=us,jn.words=Qa,jn.wrap=function(t,e){return Ps(Do(e),t)},jn.xor=ls,jn.xorBy=cs,jn.xorWith=fs,jn.zip=ps,jn.zipObject=function(t,e){return yo(t||[],e||[],nr)},jn.zipObjectDeep=function(t,e){return yo(t||[],e||[],to)},jn.zipWith=ds,jn.entries=za,jn.entriesIn=ja,jn.extend=wa,jn.extendWith=ka,lu(jn,jn),jn.add=bu,jn.attempt=tu,jn.camelCase=Ha,jn.capitalize=Wa,jn.ceil=Du,jn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=ya(r))==r?r:0),e!==n&&(e=(e=ya(e))==e?e:0),ur(ya(t),e,r)},jn.clone=function(t){return lr(t,4)},jn.cloneDeep=function(t){return lr(t,5)},jn.cloneDeepWith=function(t,e){return lr(t,5,e="function"==typeof e?e:n)},jn.cloneWith=function(t,e){return lr(t,4,e="function"==typeof e?e:n)},jn.conformsTo=function(t,e){return null==e||cr(t,e,Fa(e))},jn.deburr=Ua,jn.defaultTo=function(t,e){return null==t||t!=t?e:t},jn.divide=_u,jn.endsWith=function(t,e,r){t=Da(t),e=co(e);var o=t.length,i=r=r===n?o:ur(ga(r),0,o);return(r-=e.length)>=0&&t.slice(r,i)==e},jn.eq=Vs,jn.escape=function(t){return(t=Da(t))&&G.test(t)?t.replace(K,on):t},jn.escapeRegExp=function(t){return(t=Da(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},jn.every=function(t,e,r){var o=qs(t)?Oe:mr;return r&&_i(t,e,r)&&(e=n),o(t,ci(e,3))},jn.find=ys,jn.findIndex=Ui,jn.findKey=function(t,e){return Pe(t,ci(e,3),_r)},jn.findLast=bs,jn.findLastIndex=qi,jn.findLastKey=function(t,e){return Pe(t,ci(e,3),wr)},jn.floor=wu,jn.forEach=Ds,jn.forEachRight=_s,jn.forIn=function(t,e){return null==t?t:br(t,ci(e,3),Ia)},jn.forInRight=function(t,e){return null==t?t:Dr(t,ci(e,3),Ia)},jn.forOwn=function(t,e){return t&&_r(t,ci(e,3))},jn.forOwnRight=function(t,e){return t&&wr(t,ci(e,3))},jn.get=Sa,jn.gt=Hs,jn.gte=Ws,jn.has=function(t,e){return null!=t&&vi(t,e,Sr)},jn.hasIn=Oa,jn.head=Ji,jn.identity=iu,jn.includes=function(t,e,n,r){t=Js(t)?t:Va(t),n=n&&!r?ga(n):0;var o=t.length;return n<0&&(n=bn(o+n,0)),la(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&je(t,e,n)>-1},jn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ga(n);return o<0&&(o=bn(r+o,0)),je(t,e,o)},jn.inRange=function(t,e,r){return e=ma(e),r===n?(r=e,e=0):r=ma(r),function(t,e,n){return t>=Dn(e,n)&&t<bn(e,n)}(t=ya(t),e,r)},jn.invoke=Ma,jn.isArguments=Us,jn.isArray=qs,jn.isArrayBuffer=Ks,jn.isArrayLike=Js,jn.isArrayLikeObject=Gs,jn.isBoolean=function(t){return!0===t||!1===t||ra(t)&&xr(t)==y},jn.isBuffer=Ys,jn.isDate=Xs,jn.isElement=function(t){return ra(t)&&1===t.nodeType&&!sa(t)},jn.isEmpty=function(t){if(null==t)return!0;if(Js(t)&&(qs(t)||"string"==typeof t||"function"==typeof t.splice||Ys(t)||fa(t)||Us(t)))return!t.length;var e=gi(t);if(e==k||e==S)return!t.size;if(Ci(t))return!Rr(t).length;for(var n in t)if(Bt.call(t,n))return!1;return!0},jn.isEqual=function(t,e){return Fr(t,e)},jn.isEqualWith=function(t,e,r){var o=(r="function"==typeof r?r:n)?r(t,e):n;return o===n?Fr(t,e,n,r):!!o},jn.isError=Zs,jn.isFinite=function(t){return"number"==typeof t&&Le(t)},jn.isFunction=Qs,jn.isInteger=ta,jn.isLength=ea,jn.isMap=oa,jn.isMatch=function(t,e){return t===e||Ir(t,e,pi(e))},jn.isMatchWith=function(t,e,r){return r="function"==typeof r?r:n,Ir(t,e,pi(e),r)},jn.isNaN=function(t){return ia(t)&&t!=+t},jn.isNative=function(t){if(Ei(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Br(t)},jn.isNil=function(t){return null==t},jn.isNull=function(t){return null===t},jn.isNumber=ia,jn.isObject=na,jn.isObjectLike=ra,jn.isPlainObject=sa,jn.isRegExp=aa,jn.isSafeInteger=function(t){return ta(t)&&t>=-9007199254740991&&t<=p},jn.isSet=ua,jn.isString=la,jn.isSymbol=ca,jn.isTypedArray=fa,jn.isUndefined=function(t){return t===n},jn.isWeakMap=function(t){return ra(t)&&gi(t)==T},jn.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==xr(t)},jn.join=function(t,e){return null==t?"":qe.call(t,e)},jn.kebabCase=qa,jn.last=Zi,jn.lastIndexOf=function(t,e,r){var o=null==t?0:t.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=ga(r))<0?bn(o+i,0):Dn(i,o-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):ze(t,He,i,!0)},jn.lowerCase=Ka,jn.lowerFirst=Ja,jn.lt=pa,jn.lte=da,jn.max=function(t){return t&&t.length?gr(t,iu,Ar):n},jn.maxBy=function(t,e){return t&&t.length?gr(t,ci(e,2),Ar):n},jn.mean=function(t){return We(t,iu)},jn.meanBy=function(t,e){return We(t,ci(e,2))},jn.min=function(t){return t&&t.length?gr(t,iu,Pr):n},jn.minBy=function(t,e){return t&&t.length?gr(t,ci(e,2),Pr):n},jn.stubArray=vu,jn.stubFalse=yu,jn.stubObject=function(){return{}},jn.stubString=function(){return""},jn.stubTrue=function(){return!0},jn.multiply=Eu,jn.nth=function(t,e){return t&&t.length?Wr(t,ga(e)):n},jn.noConflict=function(){return de._===this&&(de._=zt),this},jn.noop=cu,jn.now=Ss,jn.pad=function(t,e,n){t=Da(t);var r=(e=ga(e))?dn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return qo(me(o),n)+t+qo(he(o),n)},jn.padEnd=function(t,e,n){t=Da(t);var r=(e=ga(e))?dn(t):0;return e&&r<e?t+qo(e-r,n):t},jn.padStart=function(t,e,n){t=Da(t);var r=(e=ga(e))?dn(t):0;return e&&r<e?qo(e-r,n)+t:t},jn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),wn(Da(t).replace(ot,""),e||0)},jn.random=function(t,e,r){if(r&&"boolean"!=typeof r&&_i(t,e,r)&&(e=r=n),r===n&&("boolean"==typeof e?(r=e,e=n):"boolean"==typeof t&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=ma(t),e===n?(e=t,t=0):e=ma(e)),t>e){var o=t;t=e,e=o}if(r||t%1||e%1){var i=kn();return Dn(t+i*(e-t+le("1e-"+((i+"").length-1))),e)}return Gr(t,e)},jn.reduce=function(t,e,n){var r=qs(t)?Be:Ke,o=arguments.length<3;return r(t,ci(e,4),n,o,dr)},jn.reduceRight=function(t,e,n){var r=qs(t)?$e:Ke,o=arguments.length<3;return r(t,ci(e,4),n,o,hr)},jn.repeat=function(t,e,r){return e=(r?_i(t,e,r):e===n)?1:ga(e),Yr(Da(t),e)},jn.replace=function(){var t=arguments,e=Da(t[0]);return t.length<3?e:e.replace(t[1],t[2])},jn.result=function(t,e,r){var o=-1,i=(e=_o(e,t)).length;for(i||(i=1,t=n);++o<i;){var s=null==t?n:t[Pi(e[o])];s===n&&(o=i,s=r),t=Qs(s)?s.call(t):s}return t},jn.round=Cu,jn.runInContext=t,jn.sample=function(t){return(qs(t)?Zn:Zr)(t)},jn.size=function(t){if(null==t)return 0;if(Js(t))return la(t)?dn(t):t.length;var e=gi(t);return e==k||e==S?t.size:Rr(t).length},jn.snakeCase=Ga,jn.some=function(t,e,r){var o=qs(t)?Re:io;return r&&_i(t,e,r)&&(e=n),o(t,ci(e,3))},jn.sortedIndex=function(t,e){return so(t,e)},jn.sortedIndexBy=function(t,e,n){return ao(t,e,ci(n,2))},jn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=so(t,e);if(r<n&&Vs(t[r],e))return r}return-1},jn.sortedLastIndex=function(t,e){return so(t,e,!0)},jn.sortedLastIndexBy=function(t,e,n){return ao(t,e,ci(n,2),!0)},jn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=so(t,e,!0)-1;if(Vs(t[n],e))return n}return-1},jn.startCase=Ya,jn.startsWith=function(t,e,n){return t=Da(t),n=null==n?0:ur(ga(n),0,t.length),e=co(e),t.slice(n,n+e.length)==e},jn.subtract=xu,jn.sum=function(t){return t&&t.length?Je(t,iu):0},jn.sumBy=function(t,e){return t&&t.length?Je(t,ci(e,2)):0},jn.template=function(t,e,r){var o=jn.templateSettings;r&&_i(t,e,r)&&(e=n),t=Da(t),e=ka({},e,o,ti);var i,s,a=ka({},e.imports,o.imports,ti),u=Fa(a),l=Ze(a,u),c=0,f=e.interpolate||Dt,p="__p += '",d=At((e.escape||Dt).source+"|"+f.source+"|"+(f===Z?pt:Dt).source+"|"+(e.evaluate||Dt).source+"|$","g"),h="//# sourceURL="+(Bt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ie+"]")+"\n";t.replace(d,(function(e,n,r,o,a,u){return r||(r=o),p+=t.slice(c,u).replace(_t,sn),n&&(i=!0,p+="' +\n__e("+n+") +\n'"),a&&(s=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),p+="';\n";var m=Bt.call(e,"variable")&&e.variable;if(m){if(ct.test(m))throw new kt("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(s?p.replace(H,""):p).replace(W,"$1").replace(U,"$1;"),p="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=tu((function(){return Et(u,h+"return "+p).apply(n,l)}));if(g.source=p,Zs(g))throw g;return g},jn.times=function(t,e){if((t=ga(t))<1||t>p)return[];var n=h,r=Dn(t,h);e=ci(e),t-=h;for(var o=Ge(r,e);++n<t;)e(n);return o},jn.toFinite=ma,jn.toInteger=ga,jn.toLength=va,jn.toLower=function(t){return Da(t).toLowerCase()},jn.toNumber=ya,jn.toSafeInteger=function(t){return t?ur(ga(t),-9007199254740991,p):0===t?t:0},jn.toString=Da,jn.toUpper=function(t){return Da(t).toUpperCase()},jn.trim=function(t,e,r){if((t=Da(t))&&(r||e===n))return Ye(t);if(!t||!(e=co(e)))return t;var o=hn(t),i=hn(e);return ko(o,tn(o,i),en(o,i)+1).join("")},jn.trimEnd=function(t,e,r){if((t=Da(t))&&(r||e===n))return t.slice(0,mn(t)+1);if(!t||!(e=co(e)))return t;var o=hn(t);return ko(o,0,en(o,hn(e))+1).join("")},jn.trimStart=function(t,e,r){if((t=Da(t))&&(r||e===n))return t.replace(ot,"");if(!t||!(e=co(e)))return t;var o=hn(t);return ko(o,tn(o,hn(e))).join("")},jn.truncate=function(t,e){var r=30,o="...";if(na(e)){var i="separator"in e?e.separator:i;r="length"in e?ga(e.length):r,o="omission"in e?co(e.omission):o}var s=(t=Da(t)).length;if(an(t)){var a=hn(t);s=a.length}if(r>=s)return t;var u=r-dn(o);if(u<1)return o;var l=a?ko(a,0,u).join(""):t.slice(0,u);if(i===n)return l+o;if(a&&(u+=l.length-u),aa(i)){if(t.slice(u).search(i)){var c,f=l;for(i.global||(i=At(i.source,Da(dt.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var p=c.index;l=l.slice(0,p===n?u:p)}}else if(t.indexOf(co(i),u)!=u){var d=l.lastIndexOf(i);d>-1&&(l=l.slice(0,d))}return l+o},jn.unescape=function(t){return(t=Da(t))&&J.test(t)?t.replace(q,gn):t},jn.uniqueId=function(t){var e=++$t;return Da(t)+e},jn.upperCase=Xa,jn.upperFirst=Za,jn.each=Ds,jn.eachRight=_s,jn.first=Ji,lu(jn,(ku={},_r(jn,(function(t,e){Bt.call(jn.prototype,e)||(ku[e]=t)})),ku),{chain:!1}),jn.VERSION="4.17.21",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){jn[t].placeholder=jn})),Ae(["drop","take"],(function(t,e){Un.prototype[t]=function(r){r=r===n?1:bn(ga(r),0);var o=this.__filtered__&&!e?new Un(this):this.clone();return o.__filtered__?o.__takeCount__=Dn(r,o.__takeCount__):o.__views__.push({size:Dn(r,h),type:t+(o.__dir__<0?"Right":"")}),o},Un.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ci(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(iu)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Tr(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(Rs(ci(t)))},Un.prototype.slice=function(t,e){t=ga(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Un(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=ga(e))<0?r.dropRight(-e):r.take(e-t)),r)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(h)},_r(Un.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=jn[o?"take"+("last"==e?"Right":""):e],s=o||/^find/.test(e);i&&(jn.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,u=e instanceof Un,l=a[0],c=u||qs(e),f=function(t){var e=i.apply(jn,Ie([t],a));return o&&p?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var p=this.__chain__,d=!!this.__actions__.length,h=s&&!p,m=u&&!d;if(!s&&c){e=m?e:new Un(this);var g=t.apply(e,a);return g.__actions__.push({func:ms,args:[f],thisArg:n}),new Wn(g,p)}return h&&m?t.apply(this,a):(g=this.thru(f),h?o?g.value()[0]:g.value():g)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Nt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);jn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(qs(o)?o:[],t)}return this[n]((function(n){return e.apply(qs(n)?n:[],t)}))}})),_r(Un.prototype,(function(t,e){var n=jn[e];if(n){var r=n.name+"";Bt.call(Mn,r)||(Mn[r]=[]),Mn[r].push({name:e,func:n})}})),Mn[Vo(n,2).name]=[{name:"wrapper",func:n}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=To(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=To(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=To(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qs(t),r=e<0,o=n?t.length:0,i=function(t,e,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],s=i.size;switch(i.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=Dn(e,t+s);break;case"takeRight":t=bn(t,e-s)}}return{start:t,end:e}}(0,o,this.__views__),s=i.start,a=i.end,u=a-s,l=r?a:s-1,c=this.__iteratees__,f=c.length,p=0,d=Dn(u,this.__takeCount__);if(!n||!r&&o==u&&d==u)return go(t,this.__actions__);var h=[];t:for(;u--&&p<d;){for(var m=-1,g=t[l+=e];++m<f;){var v=c[m],y=v.iteratee,b=v.type,D=y(g);if(2==b)g=D;else if(!D){if(1==b)continue t;break t}}h[p++]=g}return h},jn.prototype.at=gs,jn.prototype.chain=function(){return hs(this)},jn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},jn.prototype.next=function(){this.__values__===n&&(this.__values__=ha(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},jn.prototype.plant=function(t){for(var e,r=this;r instanceof Hn;){var o=ji(r);o.__index__=0,o.__values__=n,e?i.__wrapped__=o:e=o;var i=o;r=r.__wrapped__}return i.__wrapped__=t,e},jn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Un){var e=t;return this.__actions__.length&&(e=new Un(this)),(e=e.reverse()).__actions__.push({func:ms,args:[ns],thisArg:n}),new Wn(e,this.__chain__)}return this.thru(ns)},jn.prototype.toJSON=jn.prototype.valueOf=jn.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},jn.prototype.first=jn.prototype.head,Xt&&(jn.prototype[Xt]=function(){return this}),jn}();me?((me.exports=vn)._=vn,he._=vn):de._=vn}).call(kf)}({get exports(){return Ef},set exports(t){Ef=t}},Ef);const Cf=_f.create({name:"text",group:"inline"});var xf=200,Af=function(){};Af.prototype.append=function(t){return t.length?(t=Af.from(t),!this.length&&t||t.length<xf&&this.leafAppend(t)||this.length<xf&&t.leafPrepend(this)||this.appendInner(t)):this},Af.prototype.prepend=function(t){return t.length?Af.from(t).append(this):this},Af.prototype.appendInner=function(t){return new Of(this,t)},Af.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Af.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Af.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Af.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Af.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Af.from=function(t){return t instanceof Af?t:t&&t.length?new Sf(t):Af.empty};var Sf=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=xf)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=xf)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Af);Af.empty=new Sf([]);var Of=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Af),Nf=Af;class Tf{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,u=[],l=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void l.push(t);if(n){l.push(new Mf(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],u.push(new Mf(e,void 0,void 0,u.length+l.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new Tf(this.items.slice(0,o).append(l.reverse().concat(u)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let u,l=t.steps[n].invert(t.docs[n]),c=new Mf(t.mapping.maps[n],l,e);(u=a&&a.merge(c))&&(c=u,n?o.pop():s=s.slice(0,s.length-1)),o.push(c),e&&(i++,e=void 0),r||(a=c)}let u=i-n.depth;return u>If&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,u),i-=u),new Tf(s.append(o),i)}remapping(t,e){let n=new fa;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new Tf(this.items.append(t.map((t=>new Mf(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let u=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(o.slice(a+1,r));l&&s++,n.push(new Mf(u,i,l))}else n.push(new Mf(u))}),r);let u=[];for(let t=e;t<i;t++)u.push(new Mf(o.maps[t]));let l=this.items.slice(0,r).append(u).append(n),c=new Tf(l,s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let u,l=new Mf(s.invert(),t,a),c=r.length-1;(u=r.length&&r[c].merge(l))?r[c]=u:r.push(l)}}else i.map&&n--}),this.items.length,0),new Tf(Nf.from(r.reverse()),o)}}Tf.empty=new Tf(Nf.empty,0);class Mf{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new Mf(e.getMap().invert(),e,this.selection)}}}class Ff{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const If=20;function Bf(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function $f(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function Rf(t,e,n,r){let o=zf(e),i=jf.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),u=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),l=new Ff(r?u:s.remaining,r?s.remaining:u,null,0);n(s.transform.setSelection(a).setMeta(jf,{redo:r,historyState:l}).scrollIntoView())}let Lf=!1,Pf=null;function zf(t){let e=t.plugins;if(Pf!=e){Lf=!1,Pf=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Lf=!0;break}}return Lf}const jf=new cu("history"),Vf=new cu("closeHistory");function Hf(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new au({key:jf,state:{init:()=>new Ff(Tf.empty,Tf.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(jf);if(i)return i.historyState;n.getMeta(Vf)&&(t=new Ff(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(jf))return s.getMeta(jf).redo?new Ff(t.done.addTransform(n,void 0,r,zf(e)),t.undone,Bf(n.mapping.maps[n.steps.length-1]),t.prevTime):new Ff(t.done,t.undone.addTransform(n,void 0,r,zf(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Ff(t.done.rebased(n,o),t.undone.rebased(n,o),$f(t.prevRanges,n.mapping),t.prevTime):new Ff(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),$f(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?$f(t.prevRanges,n.mapping):Bf(n.mapping.maps[n.steps.length-1]);return new Ff(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,zf(e)),Tf.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Wf:"historyRedo"==n?Uf:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const Wf=(t,e)=>{let n=jf.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Rf(n,t,e,!1),!0)},Uf=(t,e)=>{let n=jf.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Rf(n,t,e,!0),!0)},qf=Kc.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Wf(t,e),redo:()=>({state:t,dispatch:e})=>Uf(t,e)}),addProseMirrorPlugins(){return[Hf(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Kf=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),Jf=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),Gf=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),Yf=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Xf=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),Zf=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),Qf=Object.freeze({SETTINGS:"settings",ALL:"_"}),tp=Object.freeze({BLANK:"_blank",SELF:"_self"}),ep=Object.freeze({URL:"url",BLOCK:"block"});class np{static create(t,e){const n=new this(t,e||{});return new au({key:new cu(this.name),props:n._buildProps()})}constructor(t,e){this.options=e,this.editor=t}_buildProps(){const t=Object.entries(this.addProps()).map((([t,e])=>[t,e.bind(this)]));return Object.fromEntries(t)}addProps(){return{}}}class rp extends np{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(t){if(t.includes("data-pm-slice")&&t.includes("zw-style"))return t;const e=zh.build(t);return e.normalizeHTML(),this._removeDeprecatedStyles(e),e.normalizedHTML}_removeDeprecatedStyles(t){const e=t.dom.querySelectorAll('[style*="margin"]');for(const t of Array.from(e))t.style.removeProperty("margin"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-right"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("margin-left")}_handlePaste(t,e,n){const r=this._insertPastedContent(t,n).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return t.dispatch(r),!0}_insertPastedContent({state:t,input:e},n){return this._isFullBlockSelected(t)?t.tr.replaceSelectionWith(n.content,e.shiftKey):t.tr.replaceSelection(n)}_isFullBlockSelected(t){const e=this._expandSelectionToBlocks(t),n=this._isMatchPosition(e.from,t.selection.from),r=this._isMatchPosition(e.to,t.selection.to);return n&&r}_expandSelectionToBlocks({selection:t,doc:e}){let n=t.from,r=t.to;return e.nodesBetween(n,r,((t,e,o)=>{o.type.name===Yf.DOCUMENT&&(n=Math.min(n,e+1),r=Math.max(r,e+t.nodeSize-1))})),{from:n,to:r}}_isMatchPosition(t,e){return Math.abs(t-e)<5}}class op extends np{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:t}){const e=[];return this.editor.isEditable?t.childCount>1?void 0:(t.descendants(((t,n)=>{if(!t.childCount){const r=jl.node(n,n+t.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});e.push(r)}return!1})),Wl.create(t,e)):null}}function ip(t){this.j={},this.jr=[],this.jd=null,this.t=t}ip.prototype={accepts:function(){return!!this.t},tt:function(t,e){if(e&&e.j)return this.j[t]=e,e;var n=e,r=this.j[t];if(r)return n&&(r.t=n),r;r=sp();var o=cp(this,t);return o?(Object.assign(r.j,o.j),r.jr.append(o.jr),r.jr=o.jd,r.t=n||o.t):r.t=n,this.j[t]=r,r}};var sp=function(){return new ip},ap=function(t){return new ip(t)},up=function(t,e,n){t.j[e]||(t.j[e]=n)},lp=function(t,e,n){t.jr.push([e,n])},cp=function(t,e){var n=t.j[e];if(n)return n;for(var r=0;r<t.jr.length;r++){var o=t.jr[r][0],i=t.jr[r][1];if(o.test(e))return i}return t.jd},fp=function(t,e,n){for(var r=0;r<e.length;r++)up(t,e[r],n)},pp=function(t,e){for(var n=0;n<e.length;n++){var r=e[n][0],o=e[n][1];up(t,r,o)}},dp=function(t,e,n,r){for(var o,i=0,s=e.length;i<s&&(o=t.j[e[i]]);)t=o,i++;if(i>=s)return[];for(;i<s-1;)o=r(),up(t,e[i],o),t=o,i++;up(t,e[s-1],n)},hp="DOMAIN",mp="LOCALHOST",gp="TLD",vp="NUM",yp="PROTOCOL",bp="MAILTO",Dp="WS",_p="NL",wp="OPENBRACE",kp="OPENBRACKET",Ep="OPENANGLEBRACKET",Cp="OPENPAREN",xp="CLOSEBRACE",Ap="CLOSEBRACKET",Sp="CLOSEANGLEBRACKET",Op="CLOSEPAREN",Np="AMPERSAND",Tp="APOSTROPHE",Mp="ASTERISK",Fp="AT",Ip="BACKSLASH",Bp="BACKTICK",$p="CARET",Rp="COLON",Lp="COMMA",Pp="DOLLAR",zp="DOT",jp="EQUALS",Vp="EXCLAMATION",Hp="HYPHEN",Wp="PERCENT",Up="PIPE",qp="PLUS",Kp="POUND",Jp="QUERY",Gp="QUOTE",Yp="SEMI",Xp="SLASH",Zp="TILDE",Qp="UNDERSCORE",td="SYM",ed=Object.freeze({__proto__:null,DOMAIN:hp,LOCALHOST:mp,TLD:gp,NUM:vp,PROTOCOL:yp,MAILTO:bp,WS:Dp,NL:_p,OPENBRACE:wp,OPENBRACKET:kp,OPENANGLEBRACKET:Ep,OPENPAREN:Cp,CLOSEBRACE:xp,CLOSEBRACKET:Ap,CLOSEANGLEBRACKET:Sp,CLOSEPAREN:Op,AMPERSAND:Np,APOSTROPHE:Tp,ASTERISK:Mp,AT:Fp,BACKSLASH:Ip,BACKTICK:Bp,CARET:$p,COLON:Rp,COMMA:Lp,DOLLAR:Pp,DOT:zp,EQUALS:jp,EXCLAMATION:Vp,HYPHEN:Hp,PERCENT:Wp,PIPE:Up,PLUS:qp,POUND:Kp,QUERY:Jp,QUOTE:Gp,SEMI:Yp,SLASH:Xp,TILDE:Zp,UNDERSCORE:Qp,SYM:td}),nd="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw vermögensberater-ctb vermögensberatung-pwb ελ ευ бг бел дети ею католик ком қаз мкд мон москва онлайн орг рус рф сайт срб укр გე հայ ישראל קום ابوظبي اتصالات ارامكو الاردن البحرين الجزائر السعودية العليان المغرب امارات ایران بارت بازار بھارت بيتك پاکستان ڀارت تونس سودان سورية شبكة عراق عرب عمان فلسطين قطر كاثوليك كوم مصر مليسيا موريتانيا موقع همراه कॉम नेट भारत भारतम् भारोत संगठन বাংলা ভারত ভাৰত ਭਾਰਤ ભારત ଭାରତ இந்தியா இலங்கை சிங்கப்பூர் భారత్ ಭಾರತ ഭാരതം ලංකා คอม ไทย ລາວ 닷넷 닷컴 삼성 한국 アマゾン グーグル クラウド コム ストア セール ファッション ポイント みんな 世界 中信 中国 中國 中文网 亚马逊 企业 佛山 信息 健康 八卦 公司 公益 台湾 台灣 商城 商店 商标 嘉里 嘉里大酒店 在线 大众汽车 大拿 天主教 娱乐 家電 广东 微博 慈善 我爱你 手机 招聘 政务 政府 新加坡 新闻 时尚 書籍 机构 淡马锡 游戏 澳門 点看 移动 组织机构 网址 网店 网站 网络 联通 诺基亚 谷歌 购物 通販 集团 電訊盈科 飞利浦 食品 餐厅 香格里拉 香港".split(" "),rd=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,od=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,id=/\uFE0F/,sd=/\d/,ad=/\s/;function ud(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=sp(),n=ap(vp),r=ap(hp),o=sp(),i=ap(Dp),s=[[sd,r],[rd,r],[od,r],[id,r]],a=function(){var t=ap(hp);return t.j={"-":o},t.jr=[].concat(s),t},u=function(t){var e=a();return e.t=t,e};pp(e,[["'",ap(Tp)],["{",ap(wp)],["[",ap(kp)],["<",ap(Ep)],["(",ap(Cp)],["}",ap(xp)],["]",ap(Ap)],[">",ap(Sp)],[")",ap(Op)],["&",ap(Np)],["*",ap(Mp)],["@",ap(Fp)],["`",ap(Bp)],["^",ap($p)],[":",ap(Rp)],[",",ap(Lp)],["$",ap(Pp)],[".",ap(zp)],["=",ap(jp)],["!",ap(Vp)],["-",ap(Hp)],["%",ap(Wp)],["|",ap(Up)],["+",ap(qp)],["#",ap(Kp)],["?",ap(Jp)],['"',ap(Gp)],["/",ap(Xp)],[";",ap(Yp)],["~",ap(Zp)],["_",ap(Qp)],["\\",ap(Ip)]]),up(e,"\n",ap(_p)),lp(e,ad,i),up(i,"\n",sp()),lp(i,ad,i);for(var l=0;l<nd.length;l++)dp(e,nd[l],u(gp),a);var c=a(),f=a(),p=a(),d=a();dp(e,"file",c,a),dp(e,"ftp",f,a),dp(e,"http",p,a),dp(e,"mailto",d,a);var h=a(),m=ap(yp),g=ap(bp);up(f,"s",h),up(f,":",m),up(p,"s",h),up(p,":",m),up(c,":",m),up(h,":",m),up(d,":",g);for(var v=a(),y=0;y<t.length;y++)dp(e,t[y],v,a);return up(v,":",m),dp(e,"localhost",u(mp),a),lp(e,sd,n),lp(e,rd,r),lp(e,od,r),lp(e,id,r),lp(n,sd,n),lp(n,rd,r),lp(n,od,r),lp(n,id,r),up(n,"-",o),up(r,"-",o),up(o,"-",o),lp(r,sd,r),lp(r,rd,r),lp(r,od,r),lp(r,id,r),lp(o,sd,r),lp(o,rd,r),lp(o,od,r),lp(o,id,r),e.jd=ap(td),e}var ld={defaultProtocol:"http",events:null,format:cd,formatHref:cd,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function cd(t){return t}function fd(){}function pd(t,e){function n(e,n){this.t=t,this.v=e,this.tk=n}return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(t.prototype);for(var o in n)r[o]=n[o];r.constructor=e,e.prototype=r}(fd,n,e),n}fd.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ld.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}}};var dd=pd("email",{isLink:!0}),hd=pd("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),md=pd("text"),gd=pd("nl"),vd=pd("url",{isLink:!0,toHref:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ld.defaultProtocol,e=this.tk,n=!1,r=!1,o=[],i=0;e[i].t===yp;)n=!0,o.push(e[i].v),i++;for(;e[i].t===Xp;)r=!0,o.push(e[i].v),i++;for(;i<e.length;i++)o.push(e[i].v);return o=o.join(""),n||r||(o="".concat(t,"://").concat(o)),o},hasProtocol:function(){return this.tk[0].t===yp}}),yd=Object.freeze({__proto__:null,MultiToken:fd,Base:fd,createTokenClass:pd,MailtoEmail:dd,Email:hd,Text:md,Nl:gd,Url:vd});function bd(){var t=sp(),e=sp(),n=sp(),r=sp(),o=sp(),i=sp(),s=sp(),a=ap(vd),u=sp(),l=ap(vd),c=ap(vd),f=sp(),p=sp(),d=sp(),h=sp(),m=sp(),g=ap(vd),v=ap(vd),y=ap(vd),b=ap(vd),D=sp(),_=sp(),w=sp(),k=sp(),E=sp(),C=sp(),x=ap(hd),A=sp(),S=ap(hd),O=ap(dd),N=sp(),T=sp(),M=sp(),F=sp(),I=ap(gd);up(t,_p,I),up(t,yp,e),up(t,bp,n),up(e,Xp,r),up(r,Xp,o),up(t,gp,i),up(t,hp,i),up(t,mp,a),up(t,vp,i),up(o,gp,c),up(o,hp,c),up(o,vp,c),up(o,mp,c),up(i,zp,s),up(E,zp,C),up(s,gp,a),up(s,hp,i),up(s,vp,i),up(s,mp,i),up(C,gp,x),up(C,hp,E),up(C,vp,E),up(C,mp,E),up(a,zp,s),up(x,zp,C),up(a,Rp,u),up(a,Xp,c),up(u,vp,l),up(l,Xp,c),up(x,Rp,A),up(A,vp,S);var B=[Np,Mp,Fp,Ip,Bp,$p,Pp,hp,jp,Hp,mp,vp,Wp,Up,qp,Kp,yp,Xp,td,Zp,gp,Qp],$=[Tp,Sp,xp,Ap,Op,Rp,Lp,zp,Vp,Ep,wp,kp,Cp,Jp,Gp,Yp];up(c,wp,p),up(c,kp,d),up(c,Ep,h),up(c,Cp,m),up(f,wp,p),up(f,kp,d),up(f,Ep,h),up(f,Cp,m),up(p,xp,c),up(d,Ap,c),up(h,Sp,c),up(m,Op,c),up(g,xp,c),up(v,Ap,c),up(y,Sp,c),up(b,Op,c),up(D,xp,c),up(_,Ap,c),up(w,Sp,c),up(k,Op,c),fp(p,B,g),fp(d,B,v),fp(h,B,y),fp(m,B,b),fp(p,$,D),fp(d,$,_),fp(h,$,w),fp(m,$,k),fp(g,B,g),fp(v,B,v),fp(y,B,y),fp(b,B,b),fp(g,$,g),fp(v,$,v),fp(y,$,y),fp(b,$,b),fp(D,B,g),fp(_,B,v),fp(w,B,y),fp(k,B,b),fp(D,$,D),fp(_,$,_),fp(w,$,w),fp(k,$,k),fp(c,B,c),fp(f,B,c),fp(c,$,f),fp(f,$,f),up(n,gp,O),up(n,hp,O),up(n,vp,O),up(n,mp,O),fp(O,B,O),fp(O,$,N),fp(N,B,O),fp(N,$,N);var R=[Np,Tp,Mp,Ip,Bp,$p,xp,Pp,hp,jp,Hp,vp,wp,Wp,Up,qp,Kp,Jp,Xp,td,Zp,gp,Qp];return fp(i,R,T),up(i,Fp,M),fp(a,R,T),up(a,Fp,M),fp(s,R,T),fp(T,R,T),up(T,Fp,M),up(T,zp,F),fp(F,R,T),up(M,gp,E),up(M,hp,E),up(M,vp,E),up(M,mp,x),t}function Dd(t,e,n){var r=n[0].s,o=n[n.length-1].e;return new t(e.substr(r,o-r),n)}var _d="undefined"!=typeof console&&console&&console.warn||function(){},wd={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function kd(t){if(wd.initialized&&_d('linkifyjs: already initialized - will not register custom protocol "'.concat(t,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(t))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");wd.customProtocols.push(t)}function Ed(t){return wd.initialized||function(){wd.scanner={start:ud(wd.customProtocols),tokens:ed},wd.parser={start:bd(),tokens:yd};for(var t={createTokenClass:pd},e=0;e<wd.pluginQueue.length;e++)wd.pluginQueue[e][1]({scanner:wd.scanner,parser:wd.parser,utils:t});wd.initialized=!0}(),function(t,e,n){for(var r=n.length,o=0,i=[],s=[];o<r;){for(var a=t,u=null,l=null,c=0,f=null,p=-1;o<r&&!(u=cp(a,n[o].t));)s.push(n[o++]);for(;o<r&&(l=u||cp(a,n[o].t));)u=null,(a=l).accepts()?(p=0,f=a):p>=0&&p++,o++,c++;if(p<0)for(var d=o-c;d<o;d++)s.push(n[d]);else{s.length>0&&(i.push(Dd(md,e,s)),s=[]),o-=p,c-=p;var h=f.t,m=n.slice(o-c,o);i.push(Dd(h,e,m))}}return s.length>0&&i.push(Dd(md,e,s)),i}(wd.parser.start,t,function(t,e){for(var n=function(t){for(var e=[],n=t.length,r=0;r<n;){var o=t.charCodeAt(r),i=void 0,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(function(t){return t.toLowerCase()}))),r=n.length,o=[],i=0,s=0;s<r;){for(var a=t,u=null,l=0,c=null,f=-1,p=-1;s<r&&(u=cp(a,n[s]));)(a=u).accepts()?(f=0,p=0,c=a):f>=0&&(f+=n[s].length,p++),l+=n[s].length,i+=n[s].length,s++;i-=f,s-=p,l-=f,o.push({t:c.t,v:e.substr(i-l,l),s:i-l,e:i})}return o}(wd.scanner.start,t))}function Cd(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Ed(t),r=[],o=0;o<n.length;o++){var i=n[o];!i.isLink||e&&i.t!==e||r.push(i.toObject())}return r}function xd(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Ed(t);return 1===n.length&&n[0].isLink&&(!e||n[0].t===e)}class Ad extends np{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(t,e,n){if(t.state.selection.empty)return!1;const r=n.content.textBetween(0,n.content.size).trim(),o=xd(r);if(!r||!o)return!1;const i=this._createLinkAttrs(r,n.content);return this.editor.commands.applyLink(i),!0}_createLinkAttrs(t,e){return Uh.query(e,{typeName:Yf.TEXT,mark:{typeName:Zf.LINK},getMark:{typeName:Zf.LINK}})?.attrs||{href:t}}}function Sd(t){return(...e)=>n=>t(n,...e)}function Od(t){const e=Object.entries(t).reduce(((t,[e,n])=>{if(!n)return t;return`${t}--zw-${e.replace(/_/g,"-")}:${n};`}),"");return e?{style:e}:null}function Nd(t){const e=Od(t);return["span",e?{...e,class:"zw-style"}:{},0]}function Td(t,...e){return({editor:n})=>(n.commands[t](...e),!0)}var Md=Object.defineProperty,Fd=(t,e,n)=>(((t,e,n)=>{e in t?Md(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);function Id(t,e){let n=!1;return function(){n||(t.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),e))}}function Bd(t){return t>1||t<-1?t/100:t}const $d=t=>Number.parseFloat(t.toFixed(5).substr(0,5));function Rd(t){const e=function(t,e=1){const n=[];let r=0;for(;r<t.length;)n.push(t.substr(r,e)),r+=e;return n}(t.slice(1),2).map((t=>parseInt(t,16))),n=void 0!==e[3]?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:n}}function Ld(t){const{h:e,s:n,v:r,a:o}=t,i=t=>{const o=(t+e/60)%6;return r-r*n*Math.max(Math.min(o,4-o,1),0)},s=[i(5),i(3),i(1)].map((t=>Math.round(255*t)));return{r:s[0],g:s[1],b:s[2],a:o}}function Pd(t){if(!t)return{h:0,s:1,v:1,a:1};const e=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(e,n,r),i=Math.min(e,n,r);let s=0;o!==i&&(o===e?s=60*(0+(n-r)/(o-i)):o===n?s=60*(2+(r-e)/(o-i)):o===r&&(s=60*(4+(e-n)/(o-i)))),s<0&&(s+=360);const a=[s,0===o?0:(o-i)/o,o],u=$d(a[1]),l=$d(a[2]);return{h:Math.floor(a[0]),s:u,v:l,a:t.a}}function zd(t){const e=Pd(Rd(t));const n=function(t){const{h:e,s:n,v:r,a:o}=t,i=r-r*n/2,s=1===i||0===i?0:(r-i)/Math.min(i,1-i);return{h:e,s:$d(s),l:$d(i),a:o}}(e),r=Rd(t);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:n,hsva:e,hue:e.h,rgba:r}}function jd(t,e,n="0"){return t+n.repeat(Math.max(0,e-t.length))}function Vd(t){return zd(function(t){let e=t;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),3!==e.length&&4!==e.length||(e=e.split("").map((t=>t+t)).join("")),e=6===e.length?jd(e,8,"F"):jd(jd(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}(t))}const Hd=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),Wd="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",Ud=`[\\s|\\(]+(${Wd})[,|\\s]+(${Wd})[,|\\s]+(${Wd})\\s*\\)?`,qd=`[\\s|\\(]+(${Wd})[,|\\s]+(${Wd})[,|\\s]+(${Wd})[,|\\s]+(${Wd})\\s*\\)?`,Kd=Object.freeze({CSS_UNIT:new RegExp(Wd),RGB:new RegExp(`rgb${Ud}`),RGBA:new RegExp(`rgba${qd}`),HSL:new RegExp(`hsl${Ud}`),HSLA:new RegExp(`hsla${qd}`),HSV:new RegExp(`hsv${Ud}`),HSVA:new RegExp(`hsva${qd}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),Jd=Object.freeze({WINDOW:Symbol("window")});Jd.WINDOW;Jd.WINDOW,Jd.WINDOW,Id(((t,e)=>{t(e)}),20);const Gd=class{static create(t){if(!t)return Gd.fromBlack();let e=t.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(Hd[e])e=Hd[e];else if(e===this.TRANSPARENT)return Gd.fromTransparent();const n=Kd.RGB.exec(e)||Kd.RGBA.exec(e);if(n){const t=void 0===n[4]?1:n[4];return Gd.fromRgba({r:Number.parseInt(n[1]),g:Number.parseInt(n[2]),b:Number.parseInt(n[3]),a:Number.parseFloat(t)})}const r=Kd.HSL.exec(e)||Kd.HSLA.exec(e);if(r){const t=void 0===r[4]?1:r[4];return Gd.fromHsla({h:Number.parseInt(r[1]),s:Number.parseFloat(r[2]),l:Number.parseFloat(r[3]),a:Number.parseFloat(t)})}const o=Kd.HSV.exec(e)||Kd.HSVA.exec(e);if(o){const t=void 0===o[4]?1:o[4];return Gd.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(t)})}return Kd.HEX8.exec(e)||Kd.HEX6.exec(e)||Kd.HEX4.exec(e)||Kd.HEX3.exec(e)?Gd.fromHex(e):Gd.fromBlack()}static fromHex(t){const{rgba:e}=Vd(t);return new Gd(e)}static fromRgba({r:t,g:e,b:n,a:r}){const o=Bd(r);return new Gd({r:t,g:e,b:n,a:o})}static fromHsla({h:t,s:e,l:n,a:r}){const o=Bd(e),i=Bd(n),s=Bd(r);return Gd.fromHsva(function(t){const{h:e,s:n,l:r,a:o}=t,i=r+n*Math.min(r,1-r);return{h:e,s:$d(0===i?0:2-2*r/i),v:$d(i),a:o}}({h:t,s:o,l:i,a:s}))}static fromHsva({h:t,s:e,v:n,a:r}){const o=Ld({h:t,s:Bd(e),v:Bd(n),a:Bd(r)});return new Gd(o)}static fromTransparent(){return new Gd({r:0,g:0,b:0,a:0})}static fromWhite(){return new Gd({r:255,g:255,b:255,a:1})}static fromBlack(){return new Gd({r:0,g:0,b:0,a:1})}static isTransparent(t){return Gd.create(t).isTransparent()}static isDark(t){return Gd.create(t).isDark()}constructor(t){this._rgba=t,this._hsva=this._calcHsva(),this._alpha=t.a}get hex(){return this.toHexString()}get r(){return this._rgba.r}get b(){return this._rgba.b}get g(){return this._rgba.g}get h(){return this._hsva.h}get s(){return this._hsva.s}get v(){return this._hsva.v}get alpha(){return this._alpha}setAlpha(t){return this._alpha=t,this}toHexString(){return function(t){const e=t=>{const e=Math.round(t).toString(16);return("00".substr(0,2-e.length)+e).toUpperCase()};return`#${[e(t.r),e(t.g),e(t.b)].join("")}`}({r:this.r,g:this.g,b:this.b,a:this.alpha})}toRgbaString(){const t=`${Math.floor(100*this.alpha)}%`;return`rgba(${[this.r,this.g,this.b,t].join(", ")})`}get rgba(){return this._rgba}updateRgb(t){this._rgba={...this._rgba,...t},this._hsva=this._calcHsva()}get hsva(){return this._hsva}updateHsv(t){this._hsva={...this._hsva,...t},this._rgba=this._calcRgba()}isTransparent(){return 0===this.alpha}isDark(){return this.getBrightness()<128}getBrightness(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3}_calcHsva(){return Pd(this.rgba)}_calcRgba(){return Ld(this.hsva)}};let Yd=Gd;function Xd(t){const e=Yd.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}function Zd(t,e){if(!t.includes("em"))return parseInt(t);const n=jh.getComputedStyle(e).fontSize,r=parseFloat(t)*parseFloat(n);return Math.round(r)}function Qd(t,e,n){if(!t.includes("px"))return t;const r=function(t,e){return(t.firstElementChild||t).style.fontSize||jh.getComputedStyle(e).fontSize}(e,n),o=Zd(r,n);return o?(parseInt(t)/o).toFixed(2):null}Fd(Yd,"TRANSPARENT","transparent"),Fd(Yd,"NONE","none");const th={start:Gf.LEFT,end:Gf.RIGHT};const eh=(t,e,n,r)=>({from:Math.max(r,t.pos),to:Math.min(r+n.nodeSize,e.pos)});function nh(t,e){return t.resolve(e).depth+1}const rh=(t,e)=>t.eq(e);function oh(t){return t.type.create(Ef.cloneDeep(t.attrs))}const ih=Kc.create({name:"node_processor",addCommands:()=>({setBlockAttributes:Sd((({commands:t,state:e},n,r,o={})=>{const i=Ut(t.getBlockAttributes(n))??{},{doc:s,tr:a}=e,{from:u,to:l}=a.selection;s.nodesBetween(u,l,((t,e)=>{Yf.blocks.includes(t.type.name)&&a.setNodeAttribute(e,n,{...o,...i,...r})}))})),getBlockAttributes:Sd((({editor:t},e,n)=>Jt((()=>{let r=Object.assign({},n||{});for(const n of Yf.blocks)Object.assign(r,t.getAttributes(n)?.[e]||{});return Object.keys(r).length?r:null})))),removeBlockAttributes:Sd((({commands:t},e)=>{for(const n of Yf.blocks)t.resetAttributes(n,e)})),applyMark:Sd((({state:t,commands:e},n,r,o={})=>{const{tr:i,doc:s,schema:a}=t,{$from:u,$to:l}=i.selection,c=Zc(Zf.LINK,a),f=Zc(n,a);if(!(f.spec.group||"").includes(Qf.SETTINGS))return e.setMark(n,r);if(u.pos===l.pos)return;s.nodesBetween(u.pos,l.pos,((t,s)=>{if(t.type.name===Yf.LIST)return;const a=function(t,e){const n="string"==typeof e?e:e.name;return t.find((t=>t.type.name===n))}(t.marks,n),p=f.create({...a?.attrs||{},...r}),d=eh(u,l,t,s),h=!c.isInSet(t.marks)&&function(t,e,n,r=rh){const o=t.resolve(e).path.reverse();for(const t of o)if("number"!=typeof t)for(const e of t.marks)if(r(e,n))return!0;return!1}(i.doc,s,p,o.isAppliedToParent);if(h)return(t=>{if(!o.onAppliedToParent||!1===o.onAppliedToParent(t)){const{tr:n,node:r,position:o,mark:i}=t;e._removeNodeMark({tr:n,node:r,position:o,mark:i.type})}})({tr:i,node:t,position:s,mark:p});t.isText?i.addMark(d.from,d.to,p):function(t,e,n,r){const o=nh(t,r),i=e.from-o<=r,s=e.to+o>=n.nodeSize+r;return i&&s}(i.doc,i.selection,t,s)&&i.addNodeMark(s,p)}))})),getMarks:Sd((({editor:t},e)=>{const n=Kt(t,"state");return Jt((()=>{const{selection:t,doc:r}=Ut(n),{from:o,to:i}=Ut(t),s=[];return r.nodesBetween(o,i,(t=>{for(const n of t.marks)n.type.name===e&&s.unshift(n.attrs)})),s}))})),getMark:Sd((({commands:t},e)=>{const n=t.getMarks(e);return Jt((()=>Ut(n)[0]??null))})),hasMark:Sd((({commands:t},e)=>{const n=t.getMark(e);return Jt((()=>!!Ut(n)))})),getCommonSettingMark:Sd((({commands:t},e,n)=>{const r=t.getMark(e);return Jt((()=>Ut(r)?.value??Ut(n)))})),getDeviceSettingMark:Sd((({commands:t},e,n)=>{const r=t.getMarks(e),o=t.getDevice();return Jt((()=>{for(const t of Ut(r)){const e=t[Ut(o)];if(e)return e}return Ut(n)}))})),removeAllMarks:Sd((({state:t,commands:e})=>{const{tr:n,doc:r}=t,{from:o,to:i}=n.selection;r.nodesBetween(o,i,((t,r)=>{for(const o of t.marks)e._removeNodeMark({tr:n,node:t,position:r,mark:o})}))})),removeMarks:Sd((({state:t,commands:e},n)=>{const{tr:r,doc:o}=t,{from:i,to:s}=r.selection;o.nodesBetween(i,s,((t,o)=>{const i=t.marks.filter((t=>n.includes(t.type.name)));for(const n of i)e._removeNodeMark({tr:r,node:t,position:o,mark:n})}))})),_removeNodeMark:Sd(((t,{tr:e,node:n,position:r,mark:o})=>n.isText?e.removeMark(r,r+n.nodeSize,o):e.removeNodeMark(r,o)))})}),sh=Kc.create({name:"text_processor",addCommands:()=>({getSelectedText:Sd((({state:t})=>{const{from:e,to:n}=t.selection;return t.doc.textBetween(e,n," ")})),transformText:Sd((({state:t},e)=>{const{$from:n,$to:r}=t.tr.selection;n.pos!==r.pos&&t.doc.nodesBetween(n.pos,r.pos,((o,i)=>{if(!o.isText)return;const s=eh(n,r,o,i),a=Math.max(0,n.pos-i),u=Math.max(0,r.pos-i),l=e({text:o.textContent.substring(a,u)}),c=t.schema.text(l,o.marks);t.tr.replaceWith(s.from,s.to,c)}))}))})}),ah=Kc.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:Sd((({state:t})=>{this.storage.selection=t.selection})),restoreSelection:Sd((({commands:t})=>{this.storage.selection&&t.setTextSelection(this.storage.selection)})),expandSelection:Sd((({tr:t,commands:e},n)=>{let r=t.selection.from,o=t.selection.to;t.doc.nodesBetween(r,o,((e,i,s)=>{if(n({node:e,parent:s})){const n=e.isText?0:nh(t.doc,i);r=Math.min(r,i+n),o=Math.max(o,i+e.nodeSize-n)}})),e.setTextSelection({from:r,to:o})})),expandSelectionToBlock:Sd((({commands:t})=>{t.expandSelection((({parent:t})=>t.type.name===Yf.DOCUMENT))}))}}}),uh=_f.create({name:"doc",topNode:!0,content:"block+"}).extend({marks:Qf.SETTINGS,onCreate(){this.editor.view.dom.addEventListener("click",(t=>{t.target.closest("a")&&t.preventDefault()}))}}),lh=_f.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Oc(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ch=lh.extend({marks:Qf.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),fh=_f.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Oc(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>function(t){return new Lc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Tc(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}}),ph=fh.extend({marks:Qf.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),dh=Kc.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[rp.create(this.editor),op.create(this.editor)]}}),hh=Df.create({name:Zf.FONT_FAMILY,group:Qf.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:Sd((({commands:t},e)=>{t.applyMark(this.name,{value:e});const n=t.findFontByName(e);let r=Ut(t.getFontWeight());n.isWeightSupported(r)||(r=n.findClosestWeight(r),t.applyFontWeight(r)),n.isItalicSupported(r)||t.removeItalic()})),getFont:Sd((({commands:t})=>{const e=Ut(this.options.defaultPreset),n=t.findFontByName(e.common.font_family),r=t.getFontFamily();return Jt((()=>t.findFontByName(Ut(r))||n))})),findFontByName:Sd(((t,e)=>this.options.fonts.find((t=>t.name===e)))),getFontFamily:Sd((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontFamily()))),getDefaultFontFamily:Sd((({commands:t})=>{const e=t.getPreset();return Jt((()=>Ut(e).common.font_family))}))}},parseHTML(){const t=t=>({value:t.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:t},{style:"font-family",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Nd({font_family:t.value?`"${t.value}"`:null})}),mh=Kc.create({name:Zf.STYLE_PRESET,addGlobalAttributes(){return[{types:[Yf.PARAGRAPH,Yf.HEADING],attributes:{preset:{isRequired:!1,default:{id:this.options.defaultId},parseHTML:t=>{const e=Ut(this.options.presets);if("LI"===t.parentElement.tagName)return null;for(const{id:n,node:r,fallbackClass:o}of e){if(o&&t.classList.contains(o))return{id:n};const e=this.options.styleRenderer.makePresetCssClass({id:n});if(t.matches(e))return{id:n};if(t.tagName===`H${r?.level}`)return{id:n}}return"P"===t.tagName?{id:this.options.defaultId}:null},renderHTML:t=>t.preset?{class:this.options.styleRenderer.makePresetHtmlClass(t.preset)}:null}}}]},addCommands(){function t(t,e){return t.find((t=>e===t.id))}function e(t,e){const n={};for(const r of Object.keys(t)){const o=t[r],i=e[r],s=!i||"inherit"===i.toLowerCase();n[r]=s?o:i}return n}return{getPresetList:Sd((()=>Jt((()=>this.options.presets.filter((t=>!t.hidden)))))),getPreset:Sd((({commands:n})=>{const r=n.getBlockAttributes("preset",{id:this.options.defaultId}),o=n.getPresetList(),i=n.isLink(),s=n.getLinkPreset();return Jt((()=>{const n=t(Ut(o),Ut(r).id);if(!Ut(i))return n;const a=Ut(s);return{id:n.id,common:e(n.common,a.common),mobile:e(n.mobile,a.mobile),tablet:e(n.tablet,a.tablet),desktop:e(n.desktop,a.desktop)}}))})),applyPreset:Sd((({commands:e,chain:n},r)=>{const o=t(Ut(e.getPresetList()),r),i=o.node?.type??Yf.PARAGRAPH,s={preset:{id:r}};o.node&&(s.level=o.node.level);for(const t of Zf.attributes)s[t]=Ut(e.getBlockAttributes(t));n().removeList().setNode(i,s).run()})),applyDefaultPreset:Sd((({commands:t})=>{t.applyPreset(this.options.defaultId)})),removePreset:Sd((({commands:t})=>{t.setNode(Yf.PARAGRAPH,{preset:null})})),getPresetCustomization:Sd((({editor:t,commands:e})=>{const n=Kt(t,"state");return Jt((()=>{const{selection:t,doc:r}=Ut(n),{from:o,to:i}=t;return e._getSettingCustomization(r,o,i)}))})),isSettingCustomized:Sd((({commands:t},e)=>{const n=t.getPresetCustomization(),r=Zf.presetAttributes.includes(e)?"attributes":"marks";return Jt((()=>Ut(n)[r]?.includes(e)??!1))})),getContentCustomization:Sd((({editor:t,commands:e})=>{const n=Kt(t,"state");return Jt((()=>{const{doc:t}=Ut(n);return e._getSettingCustomization(t,0,t.content.size)}))})),_getSettingCustomization:Sd(((t,e,n,r)=>{const o=new Set,i=new Set;return e.nodesBetween(n,r,(t=>{for(const[e,n]of Object.entries(t.attrs)){Zf.presetAttributes.includes(e)&&n&&i.add(e)}for(const{type:e}of t.marks)Zf.marks.includes(e.name)&&o.add(e.name)})),{attributes:Array.from(i),marks:Array.from(o)}})),removePresetCustomization:Sd((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(Zf.marks).resetAttributes(Yf.PARAGRAPH,Zf.presetAttributes).resetAttributes(Yf.HEADING,Zf.presetAttributes).restoreSelection().run()})),removeFormat:Sd((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()}))}},onCreate(){this.options.styleRenderer.inject(jh.head,this.options.presets)}}),gh=Df.create({name:Zf.FONT_WEIGHT,group:Qf.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:Sd((({commands:t},e)=>{t.applyMark(this.name,{value:e});Ut(t.getFont()).isItalicSupported(e)||t.removeItalic()})),toggleBold:Sd((({commands:t})=>{const e=Ut(t.getFontWeight()),n=Ut(t.getFont()),r=Number(e)>=600?"400":"700",o=n.findClosestWeight(r);t.applyFontWeight(o)})),getFontWeight:Sd((({commands:t})=>{const e=t.getCommonSettingMark(this.name,t.getDefaultFontWeight()),n=t.getFont();return Jt((()=>{const t=Ut(e),r=Ut(n);return r.isWeightSupported(t)?t:r.findClosestWeight(t)}))})),getDefaultFontWeight:Sd((({commands:t})=>{const e=t.getPreset();return Jt((()=>Ut(e).common.font_weight))}))}},addKeyboardShortcuts:()=>({"Mod-b":Td("toggleBold"),"Mod-B":Td("toggleBold")}),parseHTML(){const t=t=>"bold"===t?{value:"700"}:!!Number(t)&&{value:t};return[{style:"--zw-font-weight",getAttrs:t},{style:"font-weight",getAttrs:t},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML:({HTMLAttributes:t})=>Nd({font_weight:t.value})}),vh=Df.create({name:Zf.FONT_SIZE,group:Qf.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getFontSize:Sd((({commands:t})=>t.getDeviceSettingMark(this.name,t.getDefaultFontSize()))),getDefaultFontSize:Sd((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Jt((()=>Ut(n)[Ut(e)].font_size.replace("px","")))})),applyFontSize:Sd((({commands:t},e)=>{const n=Ut(t.getDevice());t.applyMark(this.name,{[n]:e},{isAppliedToParent:(t,e)=>t.type.name===e.type.name&&t.attrs[n]===e.attrs[n],onAppliedToParent:({tr:t,node:e,position:r,mark:o})=>{const i={...o.attrs,[n]:null},s=!Object.values(i).some((t=>!!t));if(s)return!1;const a=o.type.create(i);e.isText?t.addMark(r,r+e.nodeSize,a):t.addNodeMark(r,a)}})})),increaseFontSize:Sd((({commands:t})=>{const e=Number(Ut(t.getFontSize())),n=Math.min(e+1,this.options.maxSize);t.applyFontSize(String(n))})),decreaseFontSize:Sd((({commands:t})=>{const e=Number(Ut(t.getFontSize())),n=Math.max(e-1,this.options.minSize);t.applyFontSize(String(n))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Td("increaseFontSize"),"Mod-Shift--":Td("decreaseFontSize")}),parseHTML(){const t=t=>{if(!t)return null;const e=Zd(t,Ut(this.options.wrapperRef));return String(e)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:t(e.getPropertyValue("--zw-font-size-mobile")),tablet:t(e.getPropertyValue("--zw-font-size-tablet")),desktop:t(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const n=t(e);return{desktop:n,tablet:n,mobile:null}}}]},renderHTML({HTMLAttributes:t}){const e=t=>t?`${t}px`:null;return Nd({font_size_mobile:e(t.mobile),font_size_tablet:e(t.tablet),font_size_desktop:e(t.desktop)})}}),yh=Df.create({name:Zf.FONT_COLOR,group:Qf.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:Sd((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontColor()))),getDefaultFontColor:Sd((({commands:t})=>{const e=t.getPreset();return Jt((()=>Ut(e).common.color))})),applyFontColor:Sd((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:Xd(t)});return[{style:"--zw-font-color",getAttrs:t},{style:"color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Nd({font_color:t.value})}),bh=Df.create({name:Zf.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:Sd((({commands:t})=>t.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)"))),applyBackgroundColor:Sd((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:Xd(t)});return[{style:"--zw-background-color",getAttrs:t},{style:"background-color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Nd({background_color:t.value})}),Dh=Kc.create({name:"device_manager",addCommands(){return{getDevice:Sd((()=>Kt(this.options,"device")))}}}),_h=Df.create({name:Zf.FONT_STYLE,group:Qf.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:Sd((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultFontStyle();return Jt((()=>Ut(e)?.italic??Ut(n).italic))})),isItalicAvailable:Sd((({commands:t})=>{const e=t.getFont(),n=t.getFontWeight();return Jt((()=>{const t=Ut(e),r=Ut(n);return t.isItalicSupported(r)&&!t.isWeightItalicOnly(r)}))})),getDefaultFontStyle:Sd((({commands:t})=>{const e=t.getPreset();return Jt((()=>({italic:"italic"===Ut(e).common.font_style})))})),toggleItalic:Sd((({commands:t})=>{Ut(t.isItalicAvailable())&&(Ut(t.isItalic())?t.removeItalic():t.applyItalic())})),applyItalic:Sd((({commands:t})=>{t.applyMark(this.name,{italic:!0})})),removeItalic:Sd((({commands:t})=>{t.applyMark(this.name,{italic:!1})}))}},addKeyboardShortcuts:()=>({"Mod-i":Td("toggleItalic"),"Mod-I":Td("toggleItalic")}),parseHTML(){const t=t=>({italic:t.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:t},{style:"font-style",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Nd({font_style:t.italic?"italic":"normal"})}),wh=Df.create({name:Zf.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:Sd((({commands:t})=>{const e=t.getTextDecoration();return Jt((()=>Ut(e).underline))})),isStrikeThrough:Sd((({commands:t})=>{const e=t.getTextDecoration();return Jt((()=>Ut(e).strike_through))})),getTextDecoration:Sd((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultTextDecoration();return Jt((()=>{const t=Ut(e)??{},r=Ut(n);return{underline:t.underline||r.underline,strike_through:t.strike_through||r.strike_through}}))})),isUnderlineCustomized:Sd((({commands:t})=>{const e=t.isUnderline(),n=t.getDefaultTextDecoration();return Jt((()=>Ut(e)!==Ut(n).underline))})),getDefaultTextDecoration:Sd((({commands:t})=>{const e=t.getPreset();return Jt((()=>{const{text_decoration:t}=Ut(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:Sd((({commands:t})=>{t.toggleTextDecoration("underline")})),toggleStrikeThrough:Sd((({commands:t})=>{t.toggleTextDecoration("strike_through")})),toggleTextDecoration:Sd((({commands:t},e,n=null)=>{const r=Ut(t.getTextDecoration()),o=n??!r[e];t.applyMark(this.name,{[e]:o})})),applyTextDecoration:Sd((({commands:t},e)=>{t.toggleTextDecoration(e,!0)})),removeTextDecoration:Sd((({commands:t},e)=>{t.toggleTextDecoration(e,!1)}))}},addKeyboardShortcuts:()=>({"Mod-u":Td("toggleUnderline"),"Mod-U":Td("toggleUnderline")}),parseHTML(){const t=t=>{const e=t.includes("underline"),n=t.includes("line-through");return!(!e&&!n)&&{underline:e,strike_through:n}};return[{style:"--zw-text-decoration",getAttrs:t},{style:"text-decoration-line",getAttrs:t},{style:"text-decoration",getAttrs:t},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:t}){const e=[];return t.underline&&e.push("underline"),t.strike_through&&e.push("line-through"),e.length||e.push("none"),Nd({text_decoration:e.join(" ")})}}),kh=Kc.create({name:"case_style",addCommands:()=>({applyCaseStyle:Sd((({commands:t},e)=>{switch(e){case Jf.CAPITALIZE:return t.applyCapitalize();case Jf.LOWERCASE:return t.applyLowerCase();case Jf.UPPERCASE:return t.applyUpperCase()}})),applyCapitalize:Sd((({commands:t})=>{t.transformText((({text:t})=>function(t){return t.toLowerCase().replace(/(?:^|\s)\S/g,(t=>t.toUpperCase()))}(t)))})),applyLowerCase:Sd((({commands:t})=>{t.transformText((({text:t})=>t.toLowerCase()))})),applyUpperCase:Sd((({commands:t})=>{t.transformText((({text:t})=>t.toUpperCase()))}))})}),Eh={mobile:null,tablet:null,desktop:null},Ch=Kc.create({name:Zf.ALIGNMENT,addGlobalAttributes:()=>[{types:[Yf.PARAGRAPH,Yf.HEADING],attributes:{[Zf.ALIGNMENT]:{isRequired:!1,parseHTML({style:t}){const e=function(t){const e=th[t]||t;return Gf.values.includes(e)?e:null}(t.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const n=t.getPropertyValue("--zw-alignment-mobile")||null,r=t.getPropertyValue("--zw-alignment-tablet")||null,o=t.getPropertyValue("--zw-alignment-desktop")||null;return n||r||o?{desktop:o,tablet:r,mobile:n}:null},renderHTML:t=>t.alignment?Od({alignment_mobile:t.alignment.mobile,alignment_tablet:t.alignment.tablet,alignment_desktop:t.alignment.desktop}):null}}}],addCommands(){return{applyAlignment:Sd((({commands:t},e)=>{const n=Ut(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},Eh)})),removeAlignment:Sd((({commands:t})=>t.removeBlockAttributes(this.name))),getAlignment:Sd((({commands:t})=>{const e=t.getBlockAttributes(this.name,Eh),n=t.getDevice(),r=t.getDefaultAlignment();return Jt((()=>Ut(e)?.[Ut(n)]??Ut(r)))})),getDefaultAlignment:Sd((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Jt((()=>Ut(n)[Ut(e)].alignment??Gf.LEFT))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Td("applyAlignment",Gf.LEFT),"Mod-Shift-e":Td("applyAlignment",Gf.CENTER),"Mod-Shift-r":Td("applyAlignment",Gf.RIGHT),"Mod-Shift-j":Td("applyAlignment",Gf.JUSTIFY)})}),xh={mobile:null,tablet:null,desktop:null},Ah=Kc.create({name:Zf.LINE_HEIGHT,addGlobalAttributes(){return[{types:[Yf.PARAGRAPH,Yf.HEADING],attributes:{[Zf.LINE_HEIGHT]:{isRequired:!1,parseHTML:t=>{if(t.matches('[style*="--zw-line-height"]')){return{mobile:null,tablet:t.style.getPropertyValue("--zw-line-height-tablet")||null,desktop:t.style.getPropertyValue("--zw-line-height-desktop")||null}}const e=t.style.lineHeight;if(!e)return null;const n=Qd(e,t,Ut(this.options.wrapperRef));return n?{desktop:n,tablet:n,mobile:null}:null},renderHTML:t=>t.line_height?Od({line_height_mobile:t.line_height.mobile,line_height_tablet:t.line_height.tablet,line_height_desktop:t.line_height.desktop}):null}}}]},addCommands(){return{getLineHeight:Sd((({commands:t})=>{const e=t.getBlockAttributes(this.name,xh),n=t.getDevice(),r=t.getDefaultLineHeight();return Jt((()=>Ut(e)?.[Ut(n)]??Ut(r)))})),getDefaultLineHeight:Sd((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return Jt((()=>Ut(n)[Ut(e)].line_height))})),applyLineHeight:Sd((({commands:t},e)=>{const n=Ut(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},xh)}))}}}),Sh=_f.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Oc(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:Yf.LIST_ITEM,marks:Qf.SETTINGS,addCommands(){const t=({selection:t})=>t.$cursor.before(t.$cursor.depth-1);return{listItemNewline:Sd((({commands:e,tr:n})=>{const r=n.doc.nodeAt(t(n));if(!n.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=t(n);for(const t of r.marks)n.addNodeMark(o,oh(t));return!0}))}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:t=>{const{state:e,commands:n}=t.editor,r=e.selection.$cursor?.path.some((t=>t.type?.name===Yf.LIST));if(r)return n.listItemNewline()}})}),Oh=_f.create({name:Yf.LIST,content:`${Yf.LIST_ITEM}+`,group:"block list",marks:Qf.SETTINGS,addExtensions:()=>[Sh],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Xf.DISC}}}),parseHTML(){const t={a:Xf.ROMAN,i:Xf.LATIN,1:Xf.DECIMAL},e=e=>{for(const n of Xf.values){const r=`.${this.options.baseClass}${n}`;if(e.matches(r))return n;if(t[e.type.toLowerCase()]===n)return n}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Xf.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Xf.DISC}})}]},renderHTML({HTMLAttributes:t}){const e=[this.options.baseClass+t.bullet.type,this.options.presetClass];return[Xf.ordered.includes(t.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands:()=>({getListType:Sd((({commands:t})=>{const e=t.getBlockAttributes("bullet",{type:null});return Jt((()=>Ut(e).type??null))})),applyList:Sd((({commands:t,chain:e},n)=>{if(Ut(t.getListType())!==n)return e().applyDefaultPreset().toggleList(Yf.LIST,Yf.LIST_ITEM).setBlockAttributes("bullet",{type:n}).command((({commands:t,tr:e})=>t._bubbleListItemMarks(e))).run();t.removeList()})),_bubbleListItemMarks:Sd(((t,e)=>{const{doc:n,selection:r}=e,o=r.$from.start(),i=r.$to.end();function s(t,e){if(Zf.inlineMarks.includes(e.type))return!1;if(e.type.isInSet(t.marks))return!1;for(const n of t.content.content)if(n.childCount){if(!n.marks)return!1;if(!e.isInSet(n.marks))return!1}return!0}n.nodesBetween(o,i,((t,n)=>{if(t.type.name===Yf.LIST)return;if(t.type.name!==Yf.LIST_ITEM)return!1;const r=[];return t.forEach((o=>{for(const i of o.marks)i.isInSet(r)?e.removeNodeMark(n+1,i):s(t,i)&&(e.removeNodeMark(n+1,i),e.addNodeMark(n,oh(i)),r.push(i))})),!1}))})),removeList:Sd((({commands:t,state:e})=>{const{tr:n,doc:r,selection:o}=e,i=o.$from.start(),s=o.$to.end();r.nodesBetween(i,s,((t,e,r)=>{if([Yf.LIST,Yf.LIST_ITEM].includes(t.type.name))return;if(r.type.name!==Yf.LIST_ITEM)return!1;const o=r.marks.filter((function(e){return!e.type.isInSet(t.marks)}));for(const t of o)n.addNodeMark(e,oh(t));return!1})),t.liftListItem(Yf.LIST_ITEM)}))}),addInputRules(){const t=(t,e)=>function(t){return new Lc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Tc(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),s=i.doc.resolve(n.from).blockRange(),a=s&&Ca(s,t.type,o);if(!a)return null;i.wrap(s,a);const u=i.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Sa(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&i.join(n.from-1)}})}({find:e,type:this.type,getAttributes:{bullet:{type:t}},joinPredicate:(e,{attrs:n})=>n.bullet.type===t});return[t(Xf.DISC,/^\s*([-+*])\s$/),t(Xf.DECIMAL,/^(\d+)\.\s$/),t(Xf.LATIN,/^([ivx]{1,3})\.\s$/i),t(Xf.ROMAN,/^([a-z])\.\s$/i)]}});function Nh(t){return new au({key:new cu("autolink"),appendTransaction:(e,n,r)=>{const o=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),i=e.some((t=>t.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(t,e){const n=new Wa(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}(n.doc,[...e]),{mapping:u}=a,l=function(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach(((t,o)=>{const i=[];if(t.ranges.length)t.forEach(((t,e)=>{i.push({from:t,to:e})}));else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;i.push({from:t,to:e})}i.forEach((({from:t,to:n})=>{const i=e.slice(o).map(t,-1),s=e.slice(o).map(n),a=e.invert().map(i,-1),u=e.invert().map(s);r.push({oldRange:{from:a,to:u},newRange:{from:i,to:s}})}))})),pf(r)}(a);return l.forEach((({oldRange:e,newRange:o})=>{df(e.from,e.to,n.doc).filter((e=>e.mark.type===t.type)).forEach((e=>{const o=df(u.map(e.from),u.map(e.to),r.doc).filter((e=>e.mark.type===t.type));if(!o.length)return;const i=o[0],a=n.doc.textBetween(e.from,e.to,void 0," "),l=r.doc.textBetween(i.from,i.to,void 0," "),c=xd(a),f=xd(l);c&&!f&&s.removeMark(i.from,i.to,t.type)}));const i=function(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&r.push({node:t,pos:e})})),r}(r.doc,o,(t=>t.isTextblock));let a,l;if(i.length>1?(a=i[0],l=r.doc.textBetween(a.pos,a.pos+a.node.nodeSize,void 0," ")):i.length&&r.doc.textBetween(o.from,o.to," "," ").endsWith(" ")&&(a=i[0],l=r.doc.textBetween(a.pos,o.to,void 0," ")),a&&l){const e=l.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],r=a.pos+l.lastIndexOf(n);if(!n)return!1;Cd(n).filter((t=>t.isLink)).filter((e=>!t.validate||t.validate(e.value))).map((t=>({...t,from:r+t.start+1,to:r+t.end+1}))).forEach((e=>{s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}})),s.steps.length?s:void 0}})}const Th=Df.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(kd)},onDestroy(){wd.scanner=null,wd.parser=null,wd.pluginQueue=[],wd.customProtocols=[],wd.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",Oc(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[wf({find:t=>Cd(t).filter((t=>!this.options.validate||this.options.validate(t.value))).filter((t=>t.isLink)).map((t=>({text:t.value,index:t.start,data:t}))),type:this.type,getAttributes:t=>{var e;return{href:null===(e=t.data)||void 0===e?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];var e;return this.options.autolink&&t.push(Nh({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new au({key:new cu("handleClickLink"),props:{handleClick:(t,n,r)=>{var o;const i=ff(t.state,e.type.name);return!(!(null===(o=r.target)||void 0===o?void 0:o.closest("a"))||!i.href||(window.open(i.href,i.target),0))}}}))),this.options.linkOnPaste&&t.push(function(t){return new au({key:new cu("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((t=>{a+=t.textContent}));const u=Cd(a).find((t=>t.isLink&&t.value===a));return!(!a||!u||(t.editor.commands.setMark(t.type,{href:u.href}),0))}}})}({editor:this.editor,type:this.type})),t}}),Mh=Th.extend({name:Zf.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:t=>{const e=t.getAttribute("href");return e.startsWith("#")?parseFloat(t.getAttribute("href").replace("#","")):e}},target:{default:tp.SELF,parseHTML:t=>t.getAttribute("target")||tp.SELF},destination:{default:ep.URL,parseHTML:t=>{const e=t.getAttribute("href");if(!e.startsWith("#"))return ep.URL;const n=e.replace("#","");return Ut(this.options.pageBlocks).find((t=>t.id===parseInt(n)))?ep.BLOCK:ep.URL}}}},addCommands(){const{unsetLink:t}=this.parent();return{removeLink:t,applyLink:Sd((({commands:t,chain:e},n)=>(t.setMeta("preventAutolink",!0),t.getSelectedText()?e().applyMark(this.name,n).expandSelectionToLink().command((({tr:t})=>(n.text&&t.insertText(n.text,t.selection.from,t.selection.to),!0))).run():t.insertContent(Hh.text(n.text,[Hh.mark(Zf.LINK,n)]))))),expandSelectionToLink:Sd((({commands:t})=>{t.expandSelection((({node:t})=>this.type.isInSet(t.marks)))})),isLink:Sd((({commands:t})=>t.hasMark(this.name))),getLinkPreset:Sd((()=>Jt((()=>this.options.preset))))}},addProseMirrorPlugins(){return[...this.parent(),Ad.create(this.editor)]},renderHTML({HTMLAttributes:t}){const e=t.destination===ep.BLOCK?`#${t.href}`:t.href,n=Ut(this.options.basePresetClass)+Ut(this.options.preset).id;return["a",{href:e,target:t.target,class:`${n} zw-style`},0]}}),Fh=Df.create({name:Zf.SUPERSCRIPT,addCommands(){return{applySuperscript:Sd((({commands:t})=>{t.setMark(this.name)})),removeSuperscript:Sd((({commands:t})=>{t.unsetMark(this.name)})),toggleSuperscript:Sd((({commands:t})=>{Ut(t.isSuperscript())?t.removeSuperscript():t.applySuperscript()})),isSuperscript:Sd((({commands:t})=>{const e=t.getMark(this.name);return Jt((()=>!!Ut(e)))}))}},parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML:()=>["sup",{class:"zw-superscript"},0]}),Ih=Kc.create({name:Zf.MARGIN,addGlobalAttributes:()=>[{types:[Yf.PARAGRAPH,Yf.HEADING],attributes:{[Zf.MARGIN]:{isRequired:!1,parseHTML(t){const{margin:e,marginTop:n,marginRight:r,marginBottom:o,marginLeft:i}=t.style;if(![e,n,r,o,i].some((t=>!!t)))return null;if(e)return{value:e};return{value:[n||0,r||0,o||0,i||0].join(" ")}},renderHTML:t=>t.margin?Od({margin:t.margin.value}):null}}}]});function Bh(t){const e=e=>t.presetsRef.value.find((t=>t.id===e)),n=function(t){return Lt(t,!1),t}({default:null,link:null});return ee(t.presetsRef,(()=>{n.default=e(t.defaultPresetId),n.link=e(t.linkPresetId)}),{immediate:!0}),[uh,ch,ph,Cf,qf,ih,sh,ah,dh].concat([mh.configure({presets:t.presetsRef,defaultId:t.defaultPresetId,styleRenderer:new Wh({baseClass:t.basePresetClass,makeVariable:t.makePresetVariable,linkPresetId:t.linkPresetId})}),Oh.configure({baseClass:t.baseListClass,presetClass:t.basePresetClass+t.defaultPresetId}),Dh.configure({device:t.deviceRef}),vh.configure({minSize:t.minFontSize,maxSize:t.maxFontSize,wrapperRef:t.wrapperRef}),hh.configure({fonts:t.fonts,defaultPreset:Kt(n,"default")}),gh,yh,bh,_h,wh,kh,Fh,Ch,Ah.configure({wrapperRef:t.wrapperRef}),Mh.configure({preset:Kt(n,"link"),basePresetClass:t.basePresetClass,pageBlocks:t.pageBlocksRef}),Ih])}class $h{_domParser=new DOMParser;types=window;parse(t){return this._domParser.parseFromString(t,"text/html")}}class Rh{content;constructor({content:t}){this.content=t}normalize(){throw new Error("Implement abstract method")}}class Lh extends Rh{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=Lh.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:t,parser:e}){super({content:t}),this._parser=e,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,(t=>"BR"===t.tagName)),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,(t=>"LI"===t.tagName)),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const t=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(t,(t=>t.remove()))}_normalizeRootTags(){const t=Array.from(this.dom.body.childNodes),e=this.dom.createDocumentFragment();let n;for(const r of t)this._isRootNode(r)?(e.append(r),n=null):(n||(n=this.dom.createElement("p"),e.append(n)),n.append(r));this.dom.body.innerHTML="",this.dom.body.append(e)}_createNodeIterator(t,e){return this.dom.createNodeIterator(this.dom.body,t,e)}_iterateNodes(t,e=(()=>!0)){const n=t=>"BODY"!==t.tagName&&e.call(this,t),r=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:t=>n(t)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(r,t)}_runIterator(t,e){let n=t.nextNode();for(;n;)e.call(this,n),n=t.nextNode()}_removeEmptyNodes(t){t.innerHTML.trim()||t.remove()}_normalizeListItems(t){const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes);let r,o;const i=n=>{this._assignElementProperties(n,t,Lh.BLOCK_STYLES),e.append(n)};this._assignElementProperties(t,t.parentElement,Lh.BLOCK_STYLES);for(const t of n)if(this._isBlockNode(t))i(t),r=null,o=t;else if("BR"===t.tagName&&o&&"BR"!==o?.tagName)t.remove(),o=t;else if("BR"!==t.tagName)r||(r=this.dom.createElement("p"),i(r)),r.append(t),o=t;else{const e=this.dom.createElement("p");e.append(t),i(e),r=null,o=t}t.append(e),this._removeStyleProperties(t,Lh.BLOCK_STYLES)}_isBlockNode(t){return Lh.BLOCK_NODE_NAMES.includes(t.tagName)}_isRootNode(t){return Lh.ROOT_NODE_NAMES.includes(t.tagName)}_assignElementProperties(t,e,n){for(const r of n){const n=e.style.getPropertyValue(r);n&&!t.style.getPropertyValue(r)&&t.style.setProperty(r,n)}}_removeStyleProperties(t,e){for(const n of e)t.style.removeProperty(n);0===t.style.length&&t.removeAttribute("style")}_normalizeBreakLines({parentElement:t}){if(!this._isBlockNode(t))return;if(!t.textContent)return;const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes),r=t.cloneNode(!0);r.innerHTML="";let o=r.cloneNode();const i=n=>{this._assignElementProperties(n,t,Lh.BLOCK_STYLES),e.append(n)};for(const t of n)"BR"!==t.tagName?o.append(t):(i(o),o=r.cloneNode());e.append(o),t.replaceWith(e)}_normalizeBlockTextDecoration(){const t=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveTextDecorationToChildren(e)}_moveTextDecorationToChildren(t){const e=this._parseTextDecoration(t);if(t.style.removeProperty("text-decoration-line"),t.style.removeProperty("text-decoration"),t.style.cssText||t.removeAttribute("style"),!e.none)for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=this._parseTextDecoration(r),i={underline:o.underline||e.underline,line_through:o.line_through||e.line_through};r.style.removeProperty("text-decoration-line"),r.style.removeProperty("text-decoration"),r.style.textDecoration=Object.entries(i).filter((([,t])=>t)).map((([t])=>t.replace("_","-"))).join(" ")}}_parseTextDecoration(t){const{textDecoration:e,textDecorationLine:n}=t.style,r=e||n||"";return{none:r.includes("none"),underline:r.includes("underline"),line_through:r.includes("line-through")}}_normalizeBlockBackgroundColor(){const t=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveBackgroundColorToChildren(e)}_moveBackgroundColorToChildren(t){const e=t.style.backgroundColor;t.style.removeProperty("background-color"),t.style.cssText||t.removeAttribute("style");for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=r.style.backgroundColor||e;r.style.backgroundColor=o}}_wrapTextNode(t,e){if(e.nodeType!==this._Node.TEXT_NODE)return e;const n=this.dom.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}}class Ph extends Rh{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(t){this._iterateChildNodes(this.content,t)}_iterateChildNodes(t,e){for(const n of t.content)n.content&&this._iterateChildNodes(n,e),e.call(this,n)}_bubbleMarks(t){if(t.content&&t.type!==Yf.LIST)for(const e of t.content)if(!this._isLink(e)&&e.marks)for(const n of e.marks.slice())this._includesMark(t,n)?this._removeMark(e,n):this._canBubbleMark(t,n)&&(this._removeMark(e,n),this._addMark(t,n))}_canBubbleMark(t,e){if(Zf.inlineMarks.includes(e.type))return!1;if(this._includesMarkType(t,e.type))return!1;for(const n of t.content)if(n.content||t.type!==Yf.LIST_ITEM){if(!n.marks)return!1;if(!this._includesMark(n,e))return!1}return!0}_includesMark(t,e){return t.marks?.some((t=>Ef.isEqual(t,e)))??!1}_includesMarkType(t,e){return t.marks?.some((t=>t.type===e))??!1}_isLink(t){return t.type===Yf.TEXT&&this._includesMarkType(t,Zf.LINK)}_removeMark(t,e){if(!t.marks)return;const n=this._findMarkIndexByType(t,e.type);n>=0&&t.marks.splice(n,1),t.marks.length||delete t.marks}_addMark(t,e){this._removeMark(t,e),t.marks??=[],t.marks.push(e)}_findMarkIndexByType(t,e){return t.marks?.findIndex((t=>t.type===e))??null}}class zh{static build(t,e={}){return"string"==typeof t?this._buildHtml(t,e):this._buildJson(t)}static _buildHtml(t,e){return new Lh({content:t,parser:e.parser||new $h})}static _buildJson(t){return new Ph({content:t})}static normalize(t,e={}){return zh.build(t,e).normalize()}}class jh{static window=globalThis.window;static use(t){this.window=t}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(t){return this.window.getComputedStyle(t)}}class Vh{static build({config:t,nodeDomParser:e}){const n=function(t){return Ic(Wc.resolve(t))}(Bh({fonts:t.fonts,minFontSize:0,maxFontSize:0,presetsRef:Wt(t.presets),defaultPresetId:t.defaultPresetId,linkPresetId:t.linkPresetId,makePresetVariable:()=>"",basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:Wt(Kf.DESKTOP),pageBlocksRef:Wt([]),wrapperRef:jh.document.createElement("p")}));return new Vh({schema:n,domParser:Ks.fromSchema(n),nodeDomParser:e})}_schema;_domParser;_nodeDomParser;constructor({schema:t,domParser:e,nodeDomParser:n}){this._schema=t,this._domParser=e,this._nodeDomParser=n}toJSON(t){const e=zh.build(t,{parser:this._nodeDomParser});return e.normalizeHTML(),this._domParser.parse(e.dom.body).toJSON()}}class Hh{static doc(t){return{type:Yf.DOCUMENT,content:t}}static list(t,e){return{type:Yf.LIST,attrs:{bullet:{type:t}},content:e.map((t=>t.type===Yf.LIST_ITEM?t:this.listItem([].concat(t))))}}static listItem(...t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{type:Yf.LIST_ITEM,...e?{attrs:e}:{},...r?{marks:r}:{},content:[].concat(n).map((t=>"string"==typeof t?this.paragraph(t):t))}}static heading(t,...e){const n=this._textBlock(e,this.text);return n.attrs??={},n.attrs.level=t,{type:Yf.HEADING,...n}}static paragraph(...t){return{type:Yf.PARAGRAPH,...this._textBlock(t,this.text)}}static _textBlock(t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{content:"string"==typeof n?[this.text(n)]:n,...e?{attrs:e}:{},...r?{marks:r}:{}}}static _normalizeTextBlockArgs(t){return 1===t.length?{attrs:null,marks:null,content:t[0]}:2===t.length?{attrs:t[0],marks:null,content:t[1]}:{attrs:t[0],marks:t[1],content:t[2]}}static text(t,e){return{type:Yf.TEXT,...e?{marks:e}:{},text:t}}static link(t,e,n=[]){return this.text(t,[this.mark(Zf.LINK,e),...n])}static mark(t,e){return{type:t,attrs:e}}static populateAllDevices(t){return{mobile:t,tablet:t,desktop:t}}}class Wh{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:t,makeVariable:e,linkPresetId:n}){this._baseClass=t,this._makeVariable=e,this._linkPresetId=n}inject(t,e){let n=t.querySelector("[data-zw-styles]");n||(n=jh.document.createElement("style"),n.dataset.zwStyles="",n.innerHTML=this.render(e),t.append(n))}render(t){let e="";for(const n of t){const t=n.id===this._linkPresetId;e+=` ${this.makePresetCssClass(n)} {`;for(const r of Kf.values)for(const o of Object.keys(n[r])){const i=this._makeVariable({device:r,preset:n,property:o}),s=this._makeInternalVariableName(o,r);if(e+=`${s}: var(${i}, inherit);`,t&&!Zf.attributes.includes(o)){e+=`${s.replace("preset-","")}: var(${s});`}}e+="}"}return e}_makeInternalVariableName(t,e){return`--zw-preset-${"color"===t?"font-color":t.replace(/_/i,"-")}${e===Kf.COMMON?"":`-${e}`}`}makePresetHtmlClass(t){return this._baseClass+t.id}makePresetCssClass(t){return this.makePresetHtmlClass(t).split(" ").map((t=>`.${t}`)).join("")}}class Uh{static _instance;static get instance(){return this._instance??=new Uh,this._instance}static query(t,e){return this.instance.query(t,e)}query(t,e){let n=null;return t.descendants((t=>!n&&(this.matchNode(t,e)?(n=t,!1):void 0))),n?e.getMark?this.getMark(n,e.getMark):n:null}matchNode(t,e){return(!e.typeName||e.typeName===t.type.name)&&!(e.mark&&!this.getMark(t,e.mark))}getMark(t,e){return t.marks.find((t=>this.matchMark(t,e)))||null}matchMark(t,e){return t.type.name===e.typeName}}exports.ContentSerializer=Vh,exports.ContextWindow=jh,exports.NodeDomParser=class{static createWindow(){return(new t.JSDOM).window}types;parse(e){const{window:n}=new t.JSDOM(e);return this.types=n,n.document}};