238 lines
687 KiB
JavaScript
238 lines
687 KiB
JavaScript
var Xk=Object.create;var ay=Object.defineProperty;var Zk=Object.getOwnPropertyDescriptor;var jk=Object.getOwnPropertyNames;var Qk=Object.getPrototypeOf,eO=Object.prototype.hasOwnProperty;var Jd=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var tO=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jk(e))!eO.call(t,i)&&i!==n&&ay(t,i,{get:()=>e[i],enumerable:!(r=Zk(e,i))||r.enumerable});return t};var Xd=(t,e,n)=>(n=t!=null?Xk(Qk(t)):{},tO(e||!t||!t.__esModule?ay(n,"default",{value:t,enumerable:!0}):n,t));var sS=Jd((nq,oS)=>{function q_(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&q_(n)}),t}var Tu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Y_(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ci(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var zF="</span>",z_=t=>!!t.scope,UF=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},xm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Y_(e)}openNode(e){if(!z_(e))return;let n=UF(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){z_(e)&&(this.buffer+=zF)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},U_=(t={})=>{let e={children:[]};return Object.assign(e,t),e},_m=class t{constructor(){this.rootNode=U_(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=U_({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},Sm=class extends _m{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new xm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function va(t){return t?typeof t=="string"?t:t.source:null}function J_(t){return yo("(?=",t,")")}function WF(t){return yo("(?:",t,")*")}function KF(t){return yo("(?:",t,")?")}function yo(...t){return t.map(n=>va(n)).join("")}function VF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Cm(...t){return"("+(VF(t).capture?"":"?:")+t.map(r=>va(r)).join("|")+")"}function X_(t){return new RegExp(t.toString()+"|").exec("").length-1}function GF(t,e){let n=t&&t.exec(e);return n&&n.index===0}var qF=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Am(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=va(r),s="";for(;o.length>0;){let l=qF.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var YF=/\b\B/,Z_="[a-zA-Z]\\w*",Mm="[a-zA-Z_]\\w*",j_="\\b\\d+(\\.\\d+)?",Q_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",eS="\\b(0b[01]+)",JF="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",XF=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=yo(e,/.*\b/,t.binary,/\b.*/)),Ci({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},wa={begin:"\\\\[\\s\\S]",relevance:0},ZF={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[wa]},jF={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[wa]},QF={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Au=function(t,e,n={}){let r=Ci({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Cm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:yo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},eH=Au("//","$"),tH=Au("/\\*","\\*/"),nH=Au("#","$"),rH={scope:"number",begin:j_,relevance:0},iH={scope:"number",begin:Q_,relevance:0},oH={scope:"number",begin:eS,relevance:0},sH={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[wa,{begin:/\[/,end:/\]/,relevance:0,contains:[wa]}]}]},aH={scope:"title",begin:Z_,relevance:0},lH={scope:"title",begin:Mm,relevance:0},cH={begin:"\\.\\s*"+Mm,relevance:0},uH=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Su=Object.freeze({__proto__:null,MATCH_NOTHING_RE:YF,IDENT_RE:Z_,UNDERSCORE_IDENT_RE:Mm,NUMBER_RE:j_,C_NUMBER_RE:Q_,BINARY_NUMBER_RE:eS,RE_STARTERS_RE:JF,SHEBANG:XF,BACKSLASH_ESCAPE:wa,APOS_STRING_MODE:ZF,QUOTE_STRING_MODE:jF,PHRASAL_WORDS_MODE:QF,COMMENT:Au,C_LINE_COMMENT_MODE:eH,C_BLOCK_COMMENT_MODE:tH,HASH_COMMENT_MODE:nH,NUMBER_MODE:rH,C_NUMBER_MODE:iH,BINARY_NUMBER_MODE:oH,REGEXP_MODE:sH,TITLE_MODE:aH,UNDERSCORE_TITLE_MODE:lH,METHOD_GUARD:cH,END_SAME_AS_BEGIN:uH});function dH(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function fH(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function pH(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=dH,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function hH(t,e){Array.isArray(t.illegal)&&(t.illegal=Cm(...t.illegal))}function mH(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function gH(t,e){t.relevance===void 0&&(t.relevance=1)}var bH=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=yo(n.beforeMatch,J_(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},yH=["of","and","for","in","not","or","if","then","parent","list","value"],EH="keyword";function tS(t,e,n=EH){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,tS(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,vH(u[0],u[1])]})}}function vH(t,e){return e?Number(e):wH(t)?0:1}function wH(t){return yH.includes(t.toLowerCase())}var W_={},bo=t=>{console.error(t)},K_=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ds=(t,e)=>{W_[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),W_[`${t}/${e}`]=!0)},Cu=new Error;function nS(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=X_(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function xH(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw bo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Cu;if(typeof t.beginScope!="object"||t.beginScope===null)throw bo("beginScope must be object"),Cu;nS(t,t.begin,{key:"beginScope"}),t.begin=Am(t.begin,{joinWith:""})}}function _H(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw bo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Cu;if(typeof t.endScope!="object"||t.endScope===null)throw bo("endScope must be object"),Cu;nS(t,t.end,{key:"endScope"}),t.end=Am(t.end,{joinWith:""})}}function SH(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function TH(t){SH(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),xH(t),_H(t)}function CH(t){function e(s,l){return new RegExp(va(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=X_(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(Am(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[fH,mH,TH,bH].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[pH,hH,gH].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=tS(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=va(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return AH(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ci(t.classNameAliases||{}),o(t)}function rS(t){return t?t.endsWithParent||rS(t.starts):!1}function AH(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ci(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:rS(t)?Ci(t,{starts:t.starts?Ci(t.starts):null}):Object.isFrozen(t)?Ci(t):t}var MH="11.8.0",Tm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},wm=Y_,V_=Ci,G_=Symbol("nomatch"),NH=7,iS=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Sm};function u(A){return l.noHighlightRe.test(A)}function d(A){let R=A.className+" ";R+=A.parentNode?A.parentNode.className:"";let K=l.languageDetectRe.exec(R);if(K){let J=z(K[1]);return J||(K_(o.replace("{}",K[1])),K_("Falling back to no-highlight mode for this block.",A)),J?K[1]:"no-highlight"}return R.split(/\s+/).find(J=>u(J)||z(J))}function f(A,R,K){let J="",ae="";typeof R=="object"?(J=A,K=R.ignoreIllegals,ae=R.language):(ds("10.7.0","highlight(lang, code, ...args) has been deprecated."),ds("10.7.0",`Please use highlight(code, options) instead.
|
|
https://github.com/highlightjs/highlight.js/issues/2277`),ae=A,J=R),K===void 0&&(K=!0);let be={code:J,language:ae};ge("before:highlight",be);let Ie=be.result?be.result:h(be.language,be.code,K);return Ie.code=be.code,ge("after:highlight",Ie),Ie}function h(A,R,K,J){let ae=Object.create(null);function be(I,F){return I.keywords[F]}function Ie(){if(!V.keywords){we.addText(fe);return}let I=0;V.keywordPatternRe.lastIndex=0;let F=V.keywordPatternRe.exec(fe),X="";for(;F;){X+=fe.substring(I,F.index);let se=Je.case_insensitive?F[0].toLowerCase():F[0],Fe=be(V,se);if(Fe){let[it,xr]=Fe;if(we.addText(X),X="",ae[se]=(ae[se]||0)+1,ae[se]<=NH&&(ct+=xr),it.startsWith("_"))X+=F[0];else{let B=Je.classNameAliases[it]||it;Be(F[0],B)}}else X+=F[0];I=V.keywordPatternRe.lastIndex,F=V.keywordPatternRe.exec(fe)}X+=fe.substring(I),we.addText(X)}function Qe(){if(fe==="")return;let I=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){we.addText(fe);return}I=h(V.subLanguage,fe,!0,bt[V.subLanguage]),bt[V.subLanguage]=I._top}else I=y(fe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ct+=I.relevance),we.__addSublanguage(I._emitter,I.language)}function Me(){V.subLanguage!=null?Qe():Ie(),fe=""}function Be(I,F){I!==""&&(we.startScope(F),we.addText(I),we.endScope())}function wt(I,F){let X=1,se=F.length-1;for(;X<=se;){if(!I._emit[X]){X++;continue}let Fe=Je.classNameAliases[I[X]]||I[X],it=F[X];Fe?Be(it,Fe):(fe=it,Ie(),fe=""),X++}}function Nt(I,F){return I.scope&&typeof I.scope=="string"&&we.openNode(Je.classNameAliases[I.scope]||I.scope),I.beginScope&&(I.beginScope._wrap?(Be(fe,Je.classNameAliases[I.beginScope._wrap]||I.beginScope._wrap),fe=""):I.beginScope._multi&&(wt(I.beginScope,F),fe="")),V=Object.create(I,{parent:{value:V}}),V}function ke(I,F,X){let se=GF(I.endRe,X);if(se){if(I["on:end"]){let Fe=new Tu(I);I["on:end"](F,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;I.endsParent&&I.parent;)I=I.parent;return I}}if(I.endsWithParent)return ke(I.parent,F,X)}function xt(I){return V.matcher.regexIndex===0?(fe+=I[0],1):(kt=!0,0)}function Jt(I){let F=I[0],X=I.rule,se=new Tu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let it of Fe)if(it&&(it(I,se),se.isMatchIgnored))return xt(F);return X.skip?fe+=F:(X.excludeBegin&&(fe+=F),Me(),!X.returnBegin&&!X.excludeBegin&&(fe=F)),Nt(X,I),X.returnBegin?0:F.length}function pt(I){let F=I[0],X=R.substring(I.index),se=ke(V,I,X);if(!se)return G_;let Fe=V;V.endScope&&V.endScope._wrap?(Me(),Be(F,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Me(),wt(V.endScope,I)):Fe.skip?fe+=F:(Fe.returnEnd||Fe.excludeEnd||(fe+=F),Me(),Fe.excludeEnd&&(fe=F));do V.scope&&we.closeNode(),!V.skip&&!V.subLanguage&&(ct+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&Nt(se.starts,I),Fe.returnEnd?0:F.length}function sn(){let I=[];for(let F=V;F!==Je;F=F.parent)F.scope&&I.unshift(F.scope);I.forEach(F=>we.openNode(F))}let Xt={};function _t(I,F){let X=F&&F[0];if(fe+=I,X==null)return Me(),0;if(Xt.type==="begin"&&F.type==="end"&&Xt.index===F.index&&X===""){if(fe+=R.slice(F.index,F.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Xt.rule,se}return 1}if(Xt=F,F.type==="begin")return Jt(F);if(F.type==="illegal"&&!K){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"<unnamed>")+'"');throw se.mode=V,se}else if(F.type==="end"){let se=pt(F);if(se!==G_)return se}if(F.type==="illegal"&&X==="")return 1;if(Pt>1e5&&Pt>F.index*3)throw new Error("potential infinite loop, way more iterations than matches");return fe+=X,X.length}let Je=z(A);if(!Je)throw bo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let Xn=CH(Je),Dt="",V=J||Xn,bt={},we=new l.__emitter(l);sn();let fe="",ct=0,ut=0,Pt=0,kt=!1;try{if(Je.__emitTokens)Je.__emitTokens(R,we);else{for(V.matcher.considerAll();;){Pt++,kt?kt=!1:V.matcher.considerAll(),V.matcher.lastIndex=ut;let I=V.matcher.exec(R);if(!I)break;let F=R.substring(ut,I.index),X=_t(F,I);ut=I.index+X}_t(R.substring(ut))}return we.finalize(),Dt=we.toHTML(),{language:A,value:Dt,relevance:ct,illegal:!1,_emitter:we,_top:V}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:A,value:wm(R),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:ut,context:R.slice(ut-100,ut+100),mode:I.mode,resultSoFar:Dt},_emitter:we};if(i)return{language:A,value:wm(R),illegal:!1,relevance:0,errorRaised:I,_emitter:we,_top:V};throw I}}function m(A){let R={value:wm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return R._emitter.addText(A),R}function y(A,R){R=R||l.languages||Object.keys(e);let K=m(A),J=R.filter(z).filter(he).map(Me=>h(Me,A,!1));J.unshift(K);let ae=J.sort((Me,Be)=>{if(Me.relevance!==Be.relevance)return Be.relevance-Me.relevance;if(Me.language&&Be.language){if(z(Me.language).supersetOf===Be.language)return 1;if(z(Be.language).supersetOf===Me.language)return-1}return 0}),[be,Ie]=ae,Qe=be;return Qe.secondBest=Ie,Qe}function b(A,R,K){let J=R&&n[R]||K;A.classList.add("hljs"),A.classList.add(`language-${J}`)}function w(A){let R=null,K=d(A);if(u(K))return;if(ge("before:highlightElement",{el:A,language:K}),A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new Tm("One of your code blocks includes unescaped HTML.",A.innerHTML);R=A;let J=R.textContent,ae=K?f(J,{language:K,ignoreIllegals:!0}):y(J);A.innerHTML=ae.value,b(A,K,ae.language),A.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(A.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ae,text:J})}function _(A){l=V_(l,A)}let S=()=>{T(),ds("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){T(),ds("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function T(){if(document.readyState==="loading"){L=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function $(){L&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",$,!1);function O(A,R){let K=null;try{K=R(t)}catch(J){if(bo("Language definition for '{}' could not be registered.".replace("{}",A)),i)bo(J);else throw J;K=s}K.name||(K.name=A),e[A]=K,K.rawDefinition=R.bind(null,t),K.aliases&&re(K.aliases,{languageName:A})}function Y(A){delete e[A];for(let R of Object.keys(n))n[R]===A&&delete n[R]}function ee(){return Object.keys(e)}function z(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function re(A,{languageName:R}){typeof A=="string"&&(A=[A]),A.forEach(K=>{n[K.toLowerCase()]=R})}function he(A){let R=z(A);return R&&!R.disableAutodetect}function Se(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=R=>{A["before:highlightBlock"](Object.assign({block:R.el},R))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=R=>{A["after:highlightBlock"](Object.assign({block:R.el},R))})}function me(A){Se(A),r.push(A)}function Ce(A){let R=r.indexOf(A);R!==-1&&r.splice(R,1)}function ge(A,R){let K=A;r.forEach(function(J){J[K]&&J[K](R)})}function _e(A){return ds("10.7.0","highlightBlock will be removed entirely in v12.0"),ds("10.7.0","Please use highlightElement now."),w(A)}Object.assign(t,{highlight:f,highlightAuto:y,highlightAll:T,highlightElement:w,highlightBlock:_e,configure:_,initHighlighting:S,initHighlightingOnLoad:D,registerLanguage:O,unregisterLanguage:Y,listLanguages:ee,getLanguage:z,registerAliases:re,autoDetection:he,inherit:V_,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=MH,t.regex={concat:yo,lookahead:J_,either:Cm,optional:KF,anyNumberOfTimes:WF};for(let A in Su)typeof Su[A]=="object"&&q_(Su[A]);return Object.assign(t,Su),t},fs=iS({});fs.newInstance=()=>iS({});oS.exports=fs;fs.HighlightJS=fs;fs.default=fs});var lS=Jd((iq,Nm)=>{(function(){var t;typeof Nm<"u"?t=Nm.exports=r:t=function(){return this||(0,eval)("this")}(),t.format=r,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(r.apply(null,arguments))}function n(i,o){return r.apply(null,[i].concat(o))}function r(i){for(var o=1,s=[].slice.call(arguments),l=0,u=i.length,d="",f,h=!1,m,y,b=!1,w,_=function(){return s[o++]},S=function(){for(var D="";/\d/.test(i[l]);)D+=i[l++],f=i[l];return D.length>0?parseInt(D):null};l<u;++l)if(f=i[l],h)switch(h=!1,f=="."?(b=!1,f=i[++l]):f=="0"&&i[l+1]=="."?(b=!0,l+=2,f=i[l]):b=!0,w=S(),f){case"b":d+=parseInt(_(),10).toString(2);break;case"c":m=_(),typeof m=="string"||m instanceof String?d+=m:d+=String.fromCharCode(parseInt(m,10));break;case"d":d+=parseInt(_(),10);break;case"f":y=String(parseFloat(_()).toFixed(w||6)),d+=b?y:y.replace(/^0/,"");break;case"j":d+=JSON.stringify(_());break;case"o":d+="0"+parseInt(_(),10).toString(8);break;case"s":d+=_();break;case"x":d+="0x"+parseInt(_(),10).toString(16);break;case"X":d+="0x"+parseInt(_(),10).toString(16).toUpperCase();break;default:d+=f;break}else f==="%"?h=!0:d+=f;return d}})()});var SS=Jd((ms,Ta)=>{(function(){var t,e="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",l=500,u="__lodash_placeholder__",d=1,f=2,h=4,m=1,y=2,b=1,w=2,_=4,S=8,D=16,L=32,T=64,$=128,O=256,Y=512,ee=30,z="...",re=800,he=16,Se=1,me=2,Ce=3,ge=1/0,_e=9007199254740991,A=17976931348623157e292,R=NaN,K=4294967295,J=K-1,ae=K>>>1,be=[["ary",$],["bind",b],["bindKey",w],["curry",S],["curryRight",D],["flip",Y],["partial",L],["partialRight",T],["rearg",O]],Ie="[object Arguments]",Qe="[object Array]",Me="[object AsyncFunction]",Be="[object Boolean]",wt="[object Date]",Nt="[object DOMException]",ke="[object Error]",xt="[object Function]",Jt="[object GeneratorFunction]",pt="[object Map]",sn="[object Number]",Xt="[object Null]",_t="[object Object]",Je="[object Promise]",Xn="[object Proxy]",Dt="[object RegExp]",V="[object Set]",bt="[object String]",we="[object Symbol]",fe="[object Undefined]",ct="[object WeakMap]",ut="[object WeakSet]",Pt="[object ArrayBuffer]",kt="[object DataView]",I="[object Float32Array]",F="[object Float64Array]",X="[object Int8Array]",se="[object Int16Array]",Fe="[object Int32Array]",it="[object Uint8Array]",xr="[object Uint8ClampedArray]",B="[object Uint16Array]",le="[object Uint32Array]",xe=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,Ue=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bt=/&(?:amp|lt|gt|quot|#39);/g,an=/[&<>"']/g,Jr=RegExp(Bt.source),Ca=RegExp(an.source),_r=/<%-([\s\S]+?)%>/g,gs=/<%([\s\S]+?)%>/g,Mi=/<%=([\s\S]+?)%>/g,Xr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bu=/^\w*$/,bs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zr=/[\\^$.*+?()[\]{}|]/g,AS=RegExp(Zr.source),Fu=/^\s+/,MS=/\s/,NS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,kS=/\{\n\/\* \[wrapped with (.+)\] \*/,OS=/,? & /,RS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,IS=/[()=,{}\[\]\/\s]/,LS=/\\(\\)?/g,DS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Dm=/\w*$/,PS=/^[-+]0x[0-9a-f]+$/i,BS=/^0b[01]+$/i,FS=/^\[object .+?Constructor\]$/,HS=/^0o[0-7]+$/i,$S=/^(?:0|[1-9]\d*)$/,zS=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Aa=/($^)/,US=/['\n\r\u2028\u2029\\]/g,Ma="\\ud800-\\udfff",WS="\\u0300-\\u036f",KS="\\ufe20-\\ufe2f",VS="\\u20d0-\\u20ff",Pm=WS+KS+VS,Bm="\\u2700-\\u27bf",Fm="a-z\\xdf-\\xf6\\xf8-\\xff",GS="\\xac\\xb1\\xd7\\xf7",qS="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",YS="\\u2000-\\u206f",JS=" \\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",Hm="A-Z\\xc0-\\xd6\\xd8-\\xde",$m="\\ufe0e\\ufe0f",zm=GS+qS+YS+JS,Hu="['\u2019]",XS="["+Ma+"]",Um="["+zm+"]",Na="["+Pm+"]",Wm="\\d+",ZS="["+Bm+"]",Km="["+Fm+"]",Vm="[^"+Ma+zm+Wm+Bm+Fm+Hm+"]",$u="\\ud83c[\\udffb-\\udfff]",jS="(?:"+Na+"|"+$u+")",Gm="[^"+Ma+"]",zu="(?:\\ud83c[\\udde6-\\uddff]){2}",Uu="[\\ud800-\\udbff][\\udc00-\\udfff]",vo="["+Hm+"]",qm="\\u200d",Ym="(?:"+Km+"|"+Vm+")",QS="(?:"+vo+"|"+Vm+")",Jm="(?:"+Hu+"(?:d|ll|m|re|s|t|ve))?",Xm="(?:"+Hu+"(?:D|LL|M|RE|S|T|VE))?",Zm=jS+"?",jm="["+$m+"]?",eT="(?:"+qm+"(?:"+[Gm,zu,Uu].join("|")+")"+jm+Zm+")*",tT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qm=jm+Zm+eT,rT="(?:"+[ZS,zu,Uu].join("|")+")"+Qm,iT="(?:"+[Gm+Na+"?",Na,zu,Uu,XS].join("|")+")",oT=RegExp(Hu,"g"),sT=RegExp(Na,"g"),Wu=RegExp($u+"(?="+$u+")|"+iT+Qm,"g"),aT=RegExp([vo+"?"+Km+"+"+Jm+"(?="+[Um,vo,"$"].join("|")+")",QS+"+"+Xm+"(?="+[Um,vo+Ym,"$"].join("|")+")",vo+"?"+Ym+"+"+Jm,vo+"+"+Xm,nT,tT,Wm,rT].join("|"),"g"),lT=RegExp("["+qm+Ma+Pm+$m+"]"),cT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,uT=["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"],dT=-1,ot={};ot[I]=ot[F]=ot[X]=ot[se]=ot[Fe]=ot[it]=ot[xr]=ot[B]=ot[le]=!0,ot[Ie]=ot[Qe]=ot[Pt]=ot[Be]=ot[kt]=ot[wt]=ot[ke]=ot[xt]=ot[pt]=ot[sn]=ot[_t]=ot[Dt]=ot[V]=ot[bt]=ot[ct]=!1;var nt={};nt[Ie]=nt[Qe]=nt[Pt]=nt[kt]=nt[Be]=nt[wt]=nt[I]=nt[F]=nt[X]=nt[se]=nt[Fe]=nt[pt]=nt[sn]=nt[_t]=nt[Dt]=nt[V]=nt[bt]=nt[we]=nt[it]=nt[xr]=nt[B]=nt[le]=!0,nt[ke]=nt[xt]=nt[ct]=!1;var fT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},pT={"&":"&","<":"<",">":">",'"':""","'":"'"},hT={"&":"&","<":"<",">":">",""":'"',"'":"'"},mT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},gT=parseFloat,bT=parseInt,eg=typeof global=="object"&&global&&global.Object===Object&&global,yT=typeof self=="object"&&self&&self.Object===Object&&self,Ft=eg||yT||Function("return this")(),Ku=typeof ms=="object"&&ms&&!ms.nodeType&&ms,Ni=Ku&&typeof Ta=="object"&&Ta&&!Ta.nodeType&&Ta,tg=Ni&&Ni.exports===Ku,Vu=tg&&eg.process,kn=function(){try{var N=Ni&&Ni.require&&Ni.require("util").types;return N||Vu&&Vu.binding&&Vu.binding("util")}catch{}}(),ng=kn&&kn.isArrayBuffer,rg=kn&&kn.isDate,ig=kn&&kn.isMap,og=kn&&kn.isRegExp,sg=kn&&kn.isSet,ag=kn&&kn.isTypedArray;function _n(N,H,P){switch(P.length){case 0:return N.call(H);case 1:return N.call(H,P[0]);case 2:return N.call(H,P[0],P[1]);case 3:return N.call(H,P[0],P[1],P[2])}return N.apply(H,P)}function ET(N,H,P,ie){for(var Ae=-1,Ye=N==null?0:N.length;++Ae<Ye;){var Ot=N[Ae];H(ie,Ot,P(Ot),N)}return ie}function On(N,H){for(var P=-1,ie=N==null?0:N.length;++P<ie&&H(N[P],P,N)!==!1;);return N}function vT(N,H){for(var P=N==null?0:N.length;P--&&H(N[P],P,N)!==!1;);return N}function lg(N,H){for(var P=-1,ie=N==null?0:N.length;++P<ie;)if(!H(N[P],P,N))return!1;return!0}function jr(N,H){for(var P=-1,ie=N==null?0:N.length,Ae=0,Ye=[];++P<ie;){var Ot=N[P];H(Ot,P,N)&&(Ye[Ae++]=Ot)}return Ye}function ka(N,H){var P=N==null?0:N.length;return!!P&&wo(N,H,0)>-1}function Gu(N,H,P){for(var ie=-1,Ae=N==null?0:N.length;++ie<Ae;)if(P(H,N[ie]))return!0;return!1}function at(N,H){for(var P=-1,ie=N==null?0:N.length,Ae=Array(ie);++P<ie;)Ae[P]=H(N[P],P,N);return Ae}function Qr(N,H){for(var P=-1,ie=H.length,Ae=N.length;++P<ie;)N[Ae+P]=H[P];return N}function qu(N,H,P,ie){var Ae=-1,Ye=N==null?0:N.length;for(ie&&Ye&&(P=N[++Ae]);++Ae<Ye;)P=H(P,N[Ae],Ae,N);return P}function wT(N,H,P,ie){var Ae=N==null?0:N.length;for(ie&&Ae&&(P=N[--Ae]);Ae--;)P=H(P,N[Ae],Ae,N);return P}function Yu(N,H){for(var P=-1,ie=N==null?0:N.length;++P<ie;)if(H(N[P],P,N))return!0;return!1}var xT=Ju("length");function _T(N){return N.split("")}function ST(N){return N.match(RS)||[]}function cg(N,H,P){var ie;return P(N,function(Ae,Ye,Ot){if(H(Ae,Ye,Ot))return ie=Ye,!1}),ie}function Oa(N,H,P,ie){for(var Ae=N.length,Ye=P+(ie?1:-1);ie?Ye--:++Ye<Ae;)if(H(N[Ye],Ye,N))return Ye;return-1}function wo(N,H,P){return H===H?PT(N,H,P):Oa(N,ug,P)}function TT(N,H,P,ie){for(var Ae=P-1,Ye=N.length;++Ae<Ye;)if(ie(N[Ae],H))return Ae;return-1}function ug(N){return N!==N}function dg(N,H){var P=N==null?0:N.length;return P?Zu(N,H)/P:R}function Ju(N){return function(H){return H==null?t:H[N]}}function Xu(N){return function(H){return N==null?t:N[H]}}function fg(N,H,P,ie,Ae){return Ae(N,function(Ye,Ot,et){P=ie?(ie=!1,Ye):H(P,Ye,Ot,et)}),P}function CT(N,H){var P=N.length;for(N.sort(H);P--;)N[P]=N[P].value;return N}function Zu(N,H){for(var P,ie=-1,Ae=N.length;++ie<Ae;){var Ye=H(N[ie]);Ye!==t&&(P=P===t?Ye:P+Ye)}return P}function ju(N,H){for(var P=-1,ie=Array(N);++P<N;)ie[P]=H(P);return ie}function AT(N,H){return at(H,function(P){return[P,N[P]]})}function pg(N){return N&&N.slice(0,bg(N)+1).replace(Fu,"")}function Sn(N){return function(H){return N(H)}}function Qu(N,H){return at(H,function(P){return N[P]})}function ys(N,H){return N.has(H)}function hg(N,H){for(var P=-1,ie=N.length;++P<ie&&wo(H,N[P],0)>-1;);return P}function mg(N,H){for(var P=N.length;P--&&wo(H,N[P],0)>-1;);return P}function MT(N,H){for(var P=N.length,ie=0;P--;)N[P]===H&&++ie;return ie}var NT=Xu(fT),kT=Xu(pT);function OT(N){return"\\"+mT[N]}function RT(N,H){return N==null?t:N[H]}function xo(N){return lT.test(N)}function IT(N){return cT.test(N)}function LT(N){for(var H,P=[];!(H=N.next()).done;)P.push(H.value);return P}function ed(N){var H=-1,P=Array(N.size);return N.forEach(function(ie,Ae){P[++H]=[Ae,ie]}),P}function gg(N,H){return function(P){return N(H(P))}}function ei(N,H){for(var P=-1,ie=N.length,Ae=0,Ye=[];++P<ie;){var Ot=N[P];(Ot===H||Ot===u)&&(N[P]=u,Ye[Ae++]=P)}return Ye}function Ra(N){var H=-1,P=Array(N.size);return N.forEach(function(ie){P[++H]=ie}),P}function DT(N){var H=-1,P=Array(N.size);return N.forEach(function(ie){P[++H]=[ie,ie]}),P}function PT(N,H,P){for(var ie=P-1,Ae=N.length;++ie<Ae;)if(N[ie]===H)return ie;return-1}function BT(N,H,P){for(var ie=P+1;ie--;)if(N[ie]===H)return ie;return ie}function _o(N){return xo(N)?HT(N):xT(N)}function Zn(N){return xo(N)?$T(N):_T(N)}function bg(N){for(var H=N.length;H--&&MS.test(N.charAt(H)););return H}var FT=Xu(hT);function HT(N){for(var H=Wu.lastIndex=0;Wu.test(N);)++H;return H}function $T(N){return N.match(Wu)||[]}function zT(N){return N.match(aT)||[]}var UT=function N(H){H=H==null?Ft:ti.defaults(Ft.Object(),H,ti.pick(Ft,uT));var P=H.Array,ie=H.Date,Ae=H.Error,Ye=H.Function,Ot=H.Math,et=H.Object,td=H.RegExp,WT=H.String,Rn=H.TypeError,Ia=P.prototype,KT=Ye.prototype,So=et.prototype,La=H["__core-js_shared__"],Da=KT.toString,Ze=So.hasOwnProperty,VT=0,yg=function(){var a=/[^.]+$/.exec(La&&La.keys&&La.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),Pa=So.toString,GT=Da.call(et),qT=Ft._,YT=td("^"+Da.call(Ze).replace(Zr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ba=tg?H.Buffer:t,ni=H.Symbol,Fa=H.Uint8Array,Eg=Ba?Ba.allocUnsafe:t,Ha=gg(et.getPrototypeOf,et),vg=et.create,wg=So.propertyIsEnumerable,$a=Ia.splice,xg=ni?ni.isConcatSpreadable:t,Es=ni?ni.iterator:t,ki=ni?ni.toStringTag:t,za=function(){try{var a=Di(et,"defineProperty");return a({},"",{}),a}catch{}}(),JT=H.clearTimeout!==Ft.clearTimeout&&H.clearTimeout,XT=ie&&ie.now!==Ft.Date.now&&ie.now,ZT=H.setTimeout!==Ft.setTimeout&&H.setTimeout,Ua=Ot.ceil,Wa=Ot.floor,nd=et.getOwnPropertySymbols,jT=Ba?Ba.isBuffer:t,_g=H.isFinite,QT=Ia.join,e1=gg(et.keys,et),Rt=Ot.max,Zt=Ot.min,t1=ie.now,n1=H.parseInt,Sg=Ot.random,r1=Ia.reverse,rd=Di(H,"DataView"),vs=Di(H,"Map"),id=Di(H,"Promise"),To=Di(H,"Set"),ws=Di(H,"WeakMap"),xs=Di(et,"create"),Ka=ws&&new ws,Co={},i1=Pi(rd),o1=Pi(vs),s1=Pi(id),a1=Pi(To),l1=Pi(ws),Va=ni?ni.prototype:t,_s=Va?Va.valueOf:t,Tg=Va?Va.toString:t;function v(a){if(ht(a)&&!Ne(a)&&!(a instanceof ze)){if(a instanceof In)return a;if(Ze.call(a,"__wrapped__"))return Cb(a)}return new In(a)}var Ao=function(){function a(){}return function(c){if(!dt(c))return{};if(vg)return vg(c);a.prototype=c;var p=new a;return a.prototype=t,p}}();function Ga(){}function In(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=t}v.templateSettings={escape:_r,evaluate:gs,interpolate:Mi,variable:"",imports:{_:v}},v.prototype=Ga.prototype,v.prototype.constructor=v,In.prototype=Ao(Ga.prototype),In.prototype.constructor=In;function ze(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=K,this.__views__=[]}function c1(){var a=new ze(this.__wrapped__);return a.__actions__=mn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=mn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=mn(this.__views__),a}function u1(){if(this.__filtered__){var a=new ze(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function d1(){var a=this.__wrapped__.value(),c=this.__dir__,p=Ne(a),g=c<0,E=p?a.length:0,x=_C(0,E,this.__views__),C=x.start,M=x.end,k=M-C,U=g?M:C-1,W=this.__iteratees__,q=W.length,te=0,de=Zt(k,this.__takeCount__);if(!p||!g&&E==k&&de==k)return Jg(a,this.__actions__);var Ee=[];e:for(;k--&&te<de;){U+=c;for(var Le=-1,ve=a[U];++Le<q;){var $e=W[Le],We=$e.iteratee,An=$e.type,un=We(ve);if(An==me)ve=un;else if(!un){if(An==Se)continue e;break e}}Ee[te++]=ve}return Ee}ze.prototype=Ao(Ga.prototype),ze.prototype.constructor=ze;function Oi(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var g=a[c];this.set(g[0],g[1])}}function f1(){this.__data__=xs?xs(null):{},this.size=0}function p1(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}function h1(a){var c=this.__data__;if(xs){var p=c[a];return p===s?t:p}return Ze.call(c,a)?c[a]:t}function m1(a){var c=this.__data__;return xs?c[a]!==t:Ze.call(c,a)}function g1(a,c){var p=this.__data__;return this.size+=this.has(a)?0:1,p[a]=xs&&c===t?s:c,this}Oi.prototype.clear=f1,Oi.prototype.delete=p1,Oi.prototype.get=h1,Oi.prototype.has=m1,Oi.prototype.set=g1;function Sr(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var g=a[c];this.set(g[0],g[1])}}function b1(){this.__data__=[],this.size=0}function y1(a){var c=this.__data__,p=qa(c,a);if(p<0)return!1;var g=c.length-1;return p==g?c.pop():$a.call(c,p,1),--this.size,!0}function E1(a){var c=this.__data__,p=qa(c,a);return p<0?t:c[p][1]}function v1(a){return qa(this.__data__,a)>-1}function w1(a,c){var p=this.__data__,g=qa(p,a);return g<0?(++this.size,p.push([a,c])):p[g][1]=c,this}Sr.prototype.clear=b1,Sr.prototype.delete=y1,Sr.prototype.get=E1,Sr.prototype.has=v1,Sr.prototype.set=w1;function Tr(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var g=a[c];this.set(g[0],g[1])}}function x1(){this.size=0,this.__data__={hash:new Oi,map:new(vs||Sr),string:new Oi}}function _1(a){var c=ol(this,a).delete(a);return this.size-=c?1:0,c}function S1(a){return ol(this,a).get(a)}function T1(a){return ol(this,a).has(a)}function C1(a,c){var p=ol(this,a),g=p.size;return p.set(a,c),this.size+=p.size==g?0:1,this}Tr.prototype.clear=x1,Tr.prototype.delete=_1,Tr.prototype.get=S1,Tr.prototype.has=T1,Tr.prototype.set=C1;function Ri(a){var c=-1,p=a==null?0:a.length;for(this.__data__=new Tr;++c<p;)this.add(a[c])}function A1(a){return this.__data__.set(a,s),this}function M1(a){return this.__data__.has(a)}Ri.prototype.add=Ri.prototype.push=A1,Ri.prototype.has=M1;function jn(a){var c=this.__data__=new Sr(a);this.size=c.size}function N1(){this.__data__=new Sr,this.size=0}function k1(a){var c=this.__data__,p=c.delete(a);return this.size=c.size,p}function O1(a){return this.__data__.get(a)}function R1(a){return this.__data__.has(a)}function I1(a,c){var p=this.__data__;if(p instanceof Sr){var g=p.__data__;if(!vs||g.length<n-1)return g.push([a,c]),this.size=++p.size,this;p=this.__data__=new Tr(g)}return p.set(a,c),this.size=p.size,this}jn.prototype.clear=N1,jn.prototype.delete=k1,jn.prototype.get=O1,jn.prototype.has=R1,jn.prototype.set=I1;function Cg(a,c){var p=Ne(a),g=!p&&Bi(a),E=!p&&!g&&ai(a),x=!p&&!g&&!E&&Oo(a),C=p||g||E||x,M=C?ju(a.length,WT):[],k=M.length;for(var U in a)(c||Ze.call(a,U))&&!(C&&(U=="length"||E&&(U=="offset"||U=="parent")||x&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||Nr(U,k)))&&M.push(U);return M}function Ag(a){var c=a.length;return c?a[md(0,c-1)]:t}function L1(a,c){return sl(mn(a),Ii(c,0,a.length))}function D1(a){return sl(mn(a))}function od(a,c,p){(p!==t&&!Qn(a[c],p)||p===t&&!(c in a))&&Cr(a,c,p)}function Ss(a,c,p){var g=a[c];(!(Ze.call(a,c)&&Qn(g,p))||p===t&&!(c in a))&&Cr(a,c,p)}function qa(a,c){for(var p=a.length;p--;)if(Qn(a[p][0],c))return p;return-1}function P1(a,c,p,g){return ri(a,function(E,x,C){c(g,E,p(E),C)}),g}function Mg(a,c){return a&&dr(c,Ht(c),a)}function B1(a,c){return a&&dr(c,bn(c),a)}function Cr(a,c,p){c=="__proto__"&&za?za(a,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):a[c]=p}function sd(a,c){for(var p=-1,g=c.length,E=P(g),x=a==null;++p<g;)E[p]=x?t:$d(a,c[p]);return E}function Ii(a,c,p){return a===a&&(p!==t&&(a=a<=p?a:p),c!==t&&(a=a>=c?a:c)),a}function Ln(a,c,p,g,E,x){var C,M=c&d,k=c&f,U=c&h;if(p&&(C=E?p(a,g,E,x):p(a)),C!==t)return C;if(!dt(a))return a;var W=Ne(a);if(W){if(C=TC(a),!M)return mn(a,C)}else{var q=jt(a),te=q==xt||q==Jt;if(ai(a))return jg(a,M);if(q==_t||q==Ie||te&&!E){if(C=k||te?{}:bb(a),!M)return k?hC(a,B1(C,a)):pC(a,Mg(C,a))}else{if(!nt[q])return E?a:{};C=CC(a,q,M)}}x||(x=new jn);var de=x.get(a);if(de)return de;x.set(a,C),Gb(a)?a.forEach(function(ve){C.add(Ln(ve,c,p,ve,a,x))}):Kb(a)&&a.forEach(function(ve,$e){C.set($e,Ln(ve,c,p,$e,a,x))});var Ee=U?k?Cd:Td:k?bn:Ht,Le=W?t:Ee(a);return On(Le||a,function(ve,$e){Le&&($e=ve,ve=a[$e]),Ss(C,$e,Ln(ve,c,p,$e,a,x))}),C}function F1(a){var c=Ht(a);return function(p){return Ng(p,a,c)}}function Ng(a,c,p){var g=p.length;if(a==null)return!g;for(a=et(a);g--;){var E=p[g],x=c[E],C=a[E];if(C===t&&!(E in a)||!x(C))return!1}return!0}function kg(a,c,p){if(typeof a!="function")throw new Rn(i);return Os(function(){a.apply(t,p)},c)}function Ts(a,c,p,g){var E=-1,x=ka,C=!0,M=a.length,k=[],U=c.length;if(!M)return k;p&&(c=at(c,Sn(p))),g?(x=Gu,C=!1):c.length>=n&&(x=ys,C=!1,c=new Ri(c));e:for(;++E<M;){var W=a[E],q=p==null?W:p(W);if(W=g||W!==0?W:0,C&&q===q){for(var te=U;te--;)if(c[te]===q)continue e;k.push(W)}else x(c,q,g)||k.push(W)}return k}var ri=rb(ur),Og=rb(ld,!0);function H1(a,c){var p=!0;return ri(a,function(g,E,x){return p=!!c(g,E,x),p}),p}function Ya(a,c,p){for(var g=-1,E=a.length;++g<E;){var x=a[g],C=c(x);if(C!=null&&(M===t?C===C&&!Cn(C):p(C,M)))var M=C,k=x}return k}function $1(a,c,p,g){var E=a.length;for(p=Oe(p),p<0&&(p=-p>E?0:E+p),g=g===t||g>E?E:Oe(g),g<0&&(g+=E),g=p>g?0:Yb(g);p<g;)a[p++]=c;return a}function Rg(a,c){var p=[];return ri(a,function(g,E,x){c(g,E,x)&&p.push(g)}),p}function Kt(a,c,p,g,E){var x=-1,C=a.length;for(p||(p=MC),E||(E=[]);++x<C;){var M=a[x];c>0&&p(M)?c>1?Kt(M,c-1,p,g,E):Qr(E,M):g||(E[E.length]=M)}return E}var ad=ib(),Ig=ib(!0);function ur(a,c){return a&&ad(a,c,Ht)}function ld(a,c){return a&&Ig(a,c,Ht)}function Ja(a,c){return jr(c,function(p){return kr(a[p])})}function Li(a,c){c=oi(c,a);for(var p=0,g=c.length;a!=null&&p<g;)a=a[fr(c[p++])];return p&&p==g?a:t}function Lg(a,c,p){var g=c(a);return Ne(a)?g:Qr(g,p(a))}function ln(a){return a==null?a===t?fe:Xt:ki&&ki in et(a)?xC(a):DC(a)}function cd(a,c){return a>c}function z1(a,c){return a!=null&&Ze.call(a,c)}function U1(a,c){return a!=null&&c in et(a)}function W1(a,c,p){return a>=Zt(c,p)&&a<Rt(c,p)}function ud(a,c,p){for(var g=p?Gu:ka,E=a[0].length,x=a.length,C=x,M=P(x),k=1/0,U=[];C--;){var W=a[C];C&&c&&(W=at(W,Sn(c))),k=Zt(W.length,k),M[C]=!p&&(c||E>=120&&W.length>=120)?new Ri(C&&W):t}W=a[0];var q=-1,te=M[0];e:for(;++q<E&&U.length<k;){var de=W[q],Ee=c?c(de):de;if(de=p||de!==0?de:0,!(te?ys(te,Ee):g(U,Ee,p))){for(C=x;--C;){var Le=M[C];if(!(Le?ys(Le,Ee):g(a[C],Ee,p)))continue e}te&&te.push(Ee),U.push(de)}}return U}function K1(a,c,p,g){return ur(a,function(E,x,C){c(g,p(E),x,C)}),g}function Cs(a,c,p){c=oi(c,a),a=wb(a,c);var g=a==null?a:a[fr(Pn(c))];return g==null?t:_n(g,a,p)}function Dg(a){return ht(a)&&ln(a)==Ie}function V1(a){return ht(a)&&ln(a)==Pt}function G1(a){return ht(a)&&ln(a)==wt}function As(a,c,p,g,E){return a===c?!0:a==null||c==null||!ht(a)&&!ht(c)?a!==a&&c!==c:q1(a,c,p,g,As,E)}function q1(a,c,p,g,E,x){var C=Ne(a),M=Ne(c),k=C?Qe:jt(a),U=M?Qe:jt(c);k=k==Ie?_t:k,U=U==Ie?_t:U;var W=k==_t,q=U==_t,te=k==U;if(te&&ai(a)){if(!ai(c))return!1;C=!0,W=!1}if(te&&!W)return x||(x=new jn),C||Oo(a)?hb(a,c,p,g,E,x):vC(a,c,k,p,g,E,x);if(!(p&m)){var de=W&&Ze.call(a,"__wrapped__"),Ee=q&&Ze.call(c,"__wrapped__");if(de||Ee){var Le=de?a.value():a,ve=Ee?c.value():c;return x||(x=new jn),E(Le,ve,p,g,x)}}return te?(x||(x=new jn),wC(a,c,p,g,E,x)):!1}function Y1(a){return ht(a)&&jt(a)==pt}function dd(a,c,p,g){var E=p.length,x=E,C=!g;if(a==null)return!x;for(a=et(a);E--;){var M=p[E];if(C&&M[2]?M[1]!==a[M[0]]:!(M[0]in a))return!1}for(;++E<x;){M=p[E];var k=M[0],U=a[k],W=M[1];if(C&&M[2]){if(U===t&&!(k in a))return!1}else{var q=new jn;if(g)var te=g(U,W,k,a,c,q);if(!(te===t?As(W,U,m|y,g,q):te))return!1}}return!0}function Pg(a){if(!dt(a)||kC(a))return!1;var c=kr(a)?YT:FS;return c.test(Pi(a))}function J1(a){return ht(a)&&ln(a)==Dt}function X1(a){return ht(a)&&jt(a)==V}function Z1(a){return ht(a)&&fl(a.length)&&!!ot[ln(a)]}function Bg(a){return typeof a=="function"?a:a==null?yn:typeof a=="object"?Ne(a)?$g(a[0],a[1]):Hg(a):oy(a)}function fd(a){if(!ks(a))return e1(a);var c=[];for(var p in et(a))Ze.call(a,p)&&p!="constructor"&&c.push(p);return c}function j1(a){if(!dt(a))return LC(a);var c=ks(a),p=[];for(var g in a)g=="constructor"&&(c||!Ze.call(a,g))||p.push(g);return p}function pd(a,c){return a<c}function Fg(a,c){var p=-1,g=gn(a)?P(a.length):[];return ri(a,function(E,x,C){g[++p]=c(E,x,C)}),g}function Hg(a){var c=Md(a);return c.length==1&&c[0][2]?Eb(c[0][0],c[0][1]):function(p){return p===a||dd(p,a,c)}}function $g(a,c){return kd(a)&&yb(c)?Eb(fr(a),c):function(p){var g=$d(p,a);return g===t&&g===c?zd(p,a):As(c,g,m|y)}}function Xa(a,c,p,g,E){a!==c&&ad(c,function(x,C){if(E||(E=new jn),dt(x))Q1(a,c,C,p,Xa,g,E);else{var M=g?g(Rd(a,C),x,C+"",a,c,E):t;M===t&&(M=x),od(a,C,M)}},bn)}function Q1(a,c,p,g,E,x,C){var M=Rd(a,p),k=Rd(c,p),U=C.get(k);if(U){od(a,p,U);return}var W=x?x(M,k,p+"",a,c,C):t,q=W===t;if(q){var te=Ne(k),de=!te&&ai(k),Ee=!te&&!de&&Oo(k);W=k,te||de||Ee?Ne(M)?W=M:yt(M)?W=mn(M):de?(q=!1,W=jg(k,!0)):Ee?(q=!1,W=Qg(k,!0)):W=[]:Rs(k)||Bi(k)?(W=M,Bi(M)?W=Jb(M):(!dt(M)||kr(M))&&(W=bb(k))):q=!1}q&&(C.set(k,W),E(W,k,g,x,C),C.delete(k)),od(a,p,W)}function zg(a,c){var p=a.length;if(p)return c+=c<0?p:0,Nr(c,p)?a[c]:t}function Ug(a,c,p){c.length?c=at(c,function(x){return Ne(x)?function(C){return Li(C,x.length===1?x[0]:x)}:x}):c=[yn];var g=-1;c=at(c,Sn(ye()));var E=Fg(a,function(x,C,M){var k=at(c,function(U){return U(x)});return{criteria:k,index:++g,value:x}});return CT(E,function(x,C){return fC(x,C,p)})}function eC(a,c){return Wg(a,c,function(p,g){return zd(a,g)})}function Wg(a,c,p){for(var g=-1,E=c.length,x={};++g<E;){var C=c[g],M=Li(a,C);p(M,C)&&Ms(x,oi(C,a),M)}return x}function tC(a){return function(c){return Li(c,a)}}function hd(a,c,p,g){var E=g?TT:wo,x=-1,C=c.length,M=a;for(a===c&&(c=mn(c)),p&&(M=at(a,Sn(p)));++x<C;)for(var k=0,U=c[x],W=p?p(U):U;(k=E(M,W,k,g))>-1;)M!==a&&$a.call(M,k,1),$a.call(a,k,1);return a}function Kg(a,c){for(var p=a?c.length:0,g=p-1;p--;){var E=c[p];if(p==g||E!==x){var x=E;Nr(E)?$a.call(a,E,1):yd(a,E)}}return a}function md(a,c){return a+Wa(Sg()*(c-a+1))}function nC(a,c,p,g){for(var E=-1,x=Rt(Ua((c-a)/(p||1)),0),C=P(x);x--;)C[g?x:++E]=a,a+=p;return C}function gd(a,c){var p="";if(!a||c<1||c>_e)return p;do c%2&&(p+=a),c=Wa(c/2),c&&(a+=a);while(c);return p}function He(a,c){return Id(vb(a,c,yn),a+"")}function rC(a){return Ag(Ro(a))}function iC(a,c){var p=Ro(a);return sl(p,Ii(c,0,p.length))}function Ms(a,c,p,g){if(!dt(a))return a;c=oi(c,a);for(var E=-1,x=c.length,C=x-1,M=a;M!=null&&++E<x;){var k=fr(c[E]),U=p;if(k==="__proto__"||k==="constructor"||k==="prototype")return a;if(E!=C){var W=M[k];U=g?g(W,k,M):t,U===t&&(U=dt(W)?W:Nr(c[E+1])?[]:{})}Ss(M,k,U),M=M[k]}return a}var Vg=Ka?function(a,c){return Ka.set(a,c),a}:yn,oC=za?function(a,c){return za(a,"toString",{configurable:!0,enumerable:!1,value:Wd(c),writable:!0})}:yn;function sC(a){return sl(Ro(a))}function Dn(a,c,p){var g=-1,E=a.length;c<0&&(c=-c>E?0:E+c),p=p>E?E:p,p<0&&(p+=E),E=c>p?0:p-c>>>0,c>>>=0;for(var x=P(E);++g<E;)x[g]=a[g+c];return x}function aC(a,c){var p;return ri(a,function(g,E,x){return p=c(g,E,x),!p}),!!p}function Za(a,c,p){var g=0,E=a==null?g:a.length;if(typeof c=="number"&&c===c&&E<=ae){for(;g<E;){var x=g+E>>>1,C=a[x];C!==null&&!Cn(C)&&(p?C<=c:C<c)?g=x+1:E=x}return E}return bd(a,c,yn,p)}function bd(a,c,p,g){var E=0,x=a==null?0:a.length;if(x===0)return 0;c=p(c);for(var C=c!==c,M=c===null,k=Cn(c),U=c===t;E<x;){var W=Wa((E+x)/2),q=p(a[W]),te=q!==t,de=q===null,Ee=q===q,Le=Cn(q);if(C)var ve=g||Ee;else U?ve=Ee&&(g||te):M?ve=Ee&&te&&(g||!de):k?ve=Ee&&te&&!de&&(g||!Le):de||Le?ve=!1:ve=g?q<=c:q<c;ve?E=W+1:x=W}return Zt(x,J)}function Gg(a,c){for(var p=-1,g=a.length,E=0,x=[];++p<g;){var C=a[p],M=c?c(C):C;if(!p||!Qn(M,k)){var k=M;x[E++]=C===0?0:C}}return x}function qg(a){return typeof a=="number"?a:Cn(a)?R:+a}function Tn(a){if(typeof a=="string")return a;if(Ne(a))return at(a,Tn)+"";if(Cn(a))return Tg?Tg.call(a):"";var c=a+"";return c=="0"&&1/a==-ge?"-0":c}function ii(a,c,p){var g=-1,E=ka,x=a.length,C=!0,M=[],k=M;if(p)C=!1,E=Gu;else if(x>=n){var U=c?null:yC(a);if(U)return Ra(U);C=!1,E=ys,k=new Ri}else k=c?[]:M;e:for(;++g<x;){var W=a[g],q=c?c(W):W;if(W=p||W!==0?W:0,C&&q===q){for(var te=k.length;te--;)if(k[te]===q)continue e;c&&k.push(q),M.push(W)}else E(k,q,p)||(k!==M&&k.push(q),M.push(W))}return M}function yd(a,c){return c=oi(c,a),a=wb(a,c),a==null||delete a[fr(Pn(c))]}function Yg(a,c,p,g){return Ms(a,c,p(Li(a,c)),g)}function ja(a,c,p,g){for(var E=a.length,x=g?E:-1;(g?x--:++x<E)&&c(a[x],x,a););return p?Dn(a,g?0:x,g?x+1:E):Dn(a,g?x+1:0,g?E:x)}function Jg(a,c){var p=a;return p instanceof ze&&(p=p.value()),qu(c,function(g,E){return E.func.apply(E.thisArg,Qr([g],E.args))},p)}function Ed(a,c,p){var g=a.length;if(g<2)return g?ii(a[0]):[];for(var E=-1,x=P(g);++E<g;)for(var C=a[E],M=-1;++M<g;)M!=E&&(x[E]=Ts(x[E]||C,a[M],c,p));return ii(Kt(x,1),c,p)}function Xg(a,c,p){for(var g=-1,E=a.length,x=c.length,C={};++g<E;){var M=g<x?c[g]:t;p(C,a[g],M)}return C}function vd(a){return yt(a)?a:[]}function wd(a){return typeof a=="function"?a:yn}function oi(a,c){return Ne(a)?a:kd(a,c)?[a]:Tb(Xe(a))}var lC=He;function si(a,c,p){var g=a.length;return p=p===t?g:p,!c&&p>=g?a:Dn(a,c,p)}var Zg=JT||function(a){return Ft.clearTimeout(a)};function jg(a,c){if(c)return a.slice();var p=a.length,g=Eg?Eg(p):new a.constructor(p);return a.copy(g),g}function xd(a){var c=new a.constructor(a.byteLength);return new Fa(c).set(new Fa(a)),c}function cC(a,c){var p=c?xd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function uC(a){var c=new a.constructor(a.source,Dm.exec(a));return c.lastIndex=a.lastIndex,c}function dC(a){return _s?et(_s.call(a)):{}}function Qg(a,c){var p=c?xd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function eb(a,c){if(a!==c){var p=a!==t,g=a===null,E=a===a,x=Cn(a),C=c!==t,M=c===null,k=c===c,U=Cn(c);if(!M&&!U&&!x&&a>c||x&&C&&k&&!M&&!U||g&&C&&k||!p&&k||!E)return 1;if(!g&&!x&&!U&&a<c||U&&p&&E&&!g&&!x||M&&p&&E||!C&&E||!k)return-1}return 0}function fC(a,c,p){for(var g=-1,E=a.criteria,x=c.criteria,C=E.length,M=p.length;++g<C;){var k=eb(E[g],x[g]);if(k){if(g>=M)return k;var U=p[g];return k*(U=="desc"?-1:1)}}return a.index-c.index}function tb(a,c,p,g){for(var E=-1,x=a.length,C=p.length,M=-1,k=c.length,U=Rt(x-C,0),W=P(k+U),q=!g;++M<k;)W[M]=c[M];for(;++E<C;)(q||E<x)&&(W[p[E]]=a[E]);for(;U--;)W[M++]=a[E++];return W}function nb(a,c,p,g){for(var E=-1,x=a.length,C=-1,M=p.length,k=-1,U=c.length,W=Rt(x-M,0),q=P(W+U),te=!g;++E<W;)q[E]=a[E];for(var de=E;++k<U;)q[de+k]=c[k];for(;++C<M;)(te||E<x)&&(q[de+p[C]]=a[E++]);return q}function mn(a,c){var p=-1,g=a.length;for(c||(c=P(g));++p<g;)c[p]=a[p];return c}function dr(a,c,p,g){var E=!p;p||(p={});for(var x=-1,C=c.length;++x<C;){var M=c[x],k=g?g(p[M],a[M],M,p,a):t;k===t&&(k=a[M]),E?Cr(p,M,k):Ss(p,M,k)}return p}function pC(a,c){return dr(a,Nd(a),c)}function hC(a,c){return dr(a,mb(a),c)}function Qa(a,c){return function(p,g){var E=Ne(p)?ET:P1,x=c?c():{};return E(p,a,ye(g,2),x)}}function Mo(a){return He(function(c,p){var g=-1,E=p.length,x=E>1?p[E-1]:t,C=E>2?p[2]:t;for(x=a.length>3&&typeof x=="function"?(E--,x):t,C&&cn(p[0],p[1],C)&&(x=E<3?t:x,E=1),c=et(c);++g<E;){var M=p[g];M&&a(c,M,g,x)}return c})}function rb(a,c){return function(p,g){if(p==null)return p;if(!gn(p))return a(p,g);for(var E=p.length,x=c?E:-1,C=et(p);(c?x--:++x<E)&&g(C[x],x,C)!==!1;);return p}}function ib(a){return function(c,p,g){for(var E=-1,x=et(c),C=g(c),M=C.length;M--;){var k=C[a?M:++E];if(p(x[k],k,x)===!1)break}return c}}function mC(a,c,p){var g=c&b,E=Ns(a);function x(){var C=this&&this!==Ft&&this instanceof x?E:a;return C.apply(g?p:this,arguments)}return x}function ob(a){return function(c){c=Xe(c);var p=xo(c)?Zn(c):t,g=p?p[0]:c.charAt(0),E=p?si(p,1).join(""):c.slice(1);return g[a]()+E}}function No(a){return function(c){return qu(ry(ny(c).replace(oT,"")),a,"")}}function Ns(a){return function(){var c=arguments;switch(c.length){case 0:return new a;case 1:return new a(c[0]);case 2:return new a(c[0],c[1]);case 3:return new a(c[0],c[1],c[2]);case 4:return new a(c[0],c[1],c[2],c[3]);case 5:return new a(c[0],c[1],c[2],c[3],c[4]);case 6:return new a(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new a(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=Ao(a.prototype),g=a.apply(p,c);return dt(g)?g:p}}function gC(a,c,p){var g=Ns(a);function E(){for(var x=arguments.length,C=P(x),M=x,k=ko(E);M--;)C[M]=arguments[M];var U=x<3&&C[0]!==k&&C[x-1]!==k?[]:ei(C,k);if(x-=U.length,x<p)return ub(a,c,el,E.placeholder,t,C,U,t,t,p-x);var W=this&&this!==Ft&&this instanceof E?g:a;return _n(W,this,C)}return E}function sb(a){return function(c,p,g){var E=et(c);if(!gn(c)){var x=ye(p,3);c=Ht(c),p=function(M){return x(E[M],M,E)}}var C=a(c,p,g);return C>-1?E[x?c[C]:C]:t}}function ab(a){return Mr(function(c){var p=c.length,g=p,E=In.prototype.thru;for(a&&c.reverse();g--;){var x=c[g];if(typeof x!="function")throw new Rn(i);if(E&&!C&&il(x)=="wrapper")var C=new In([],!0)}for(g=C?g:p;++g<p;){x=c[g];var M=il(x),k=M=="wrapper"?Ad(x):t;k&&Od(k[0])&&k[1]==($|S|L|O)&&!k[4].length&&k[9]==1?C=C[il(k[0])].apply(C,k[3]):C=x.length==1&&Od(x)?C[M]():C.thru(x)}return function(){var U=arguments,W=U[0];if(C&&U.length==1&&Ne(W))return C.plant(W).value();for(var q=0,te=p?c[q].apply(this,U):W;++q<p;)te=c[q].call(this,te);return te}})}function el(a,c,p,g,E,x,C,M,k,U){var W=c&$,q=c&b,te=c&w,de=c&(S|D),Ee=c&Y,Le=te?t:Ns(a);function ve(){for(var $e=arguments.length,We=P($e),An=$e;An--;)We[An]=arguments[An];if(de)var un=ko(ve),Mn=MT(We,un);if(g&&(We=tb(We,g,E,de)),x&&(We=nb(We,x,C,de)),$e-=Mn,de&&$e<U){var Et=ei(We,un);return ub(a,c,el,ve.placeholder,p,We,Et,M,k,U-$e)}var er=q?p:this,Rr=te?er[a]:a;return $e=We.length,M?We=PC(We,M):Ee&&$e>1&&We.reverse(),W&&k<$e&&(We.length=k),this&&this!==Ft&&this instanceof ve&&(Rr=Le||Ns(Rr)),Rr.apply(er,We)}return ve}function lb(a,c){return function(p,g){return K1(p,a,c(g),{})}}function tl(a,c){return function(p,g){var E;if(p===t&&g===t)return c;if(p!==t&&(E=p),g!==t){if(E===t)return g;typeof p=="string"||typeof g=="string"?(p=Tn(p),g=Tn(g)):(p=qg(p),g=qg(g)),E=a(p,g)}return E}}function _d(a){return Mr(function(c){return c=at(c,Sn(ye())),He(function(p){var g=this;return a(c,function(E){return _n(E,g,p)})})})}function nl(a,c){c=c===t?" ":Tn(c);var p=c.length;if(p<2)return p?gd(c,a):c;var g=gd(c,Ua(a/_o(c)));return xo(c)?si(Zn(g),0,a).join(""):g.slice(0,a)}function bC(a,c,p,g){var E=c&b,x=Ns(a);function C(){for(var M=-1,k=arguments.length,U=-1,W=g.length,q=P(W+k),te=this&&this!==Ft&&this instanceof C?x:a;++U<W;)q[U]=g[U];for(;k--;)q[U++]=arguments[++M];return _n(te,E?p:this,q)}return C}function cb(a){return function(c,p,g){return g&&typeof g!="number"&&cn(c,p,g)&&(p=g=t),c=Or(c),p===t?(p=c,c=0):p=Or(p),g=g===t?c<p?1:-1:Or(g),nC(c,p,g,a)}}function rl(a){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=Bn(c),p=Bn(p)),a(c,p)}}function ub(a,c,p,g,E,x,C,M,k,U){var W=c&S,q=W?C:t,te=W?t:C,de=W?x:t,Ee=W?t:x;c|=W?L:T,c&=~(W?T:L),c&_||(c&=~(b|w));var Le=[a,c,E,de,q,Ee,te,M,k,U],ve=p.apply(t,Le);return Od(a)&&xb(ve,Le),ve.placeholder=g,_b(ve,a,c)}function Sd(a){var c=Ot[a];return function(p,g){if(p=Bn(p),g=g==null?0:Zt(Oe(g),292),g&&_g(p)){var E=(Xe(p)+"e").split("e"),x=c(E[0]+"e"+(+E[1]+g));return E=(Xe(x)+"e").split("e"),+(E[0]+"e"+(+E[1]-g))}return c(p)}}var yC=To&&1/Ra(new To([,-0]))[1]==ge?function(a){return new To(a)}:Gd;function db(a){return function(c){var p=jt(c);return p==pt?ed(c):p==V?DT(c):AT(c,a(c))}}function Ar(a,c,p,g,E,x,C,M){var k=c&w;if(!k&&typeof a!="function")throw new Rn(i);var U=g?g.length:0;if(U||(c&=~(L|T),g=E=t),C=C===t?C:Rt(Oe(C),0),M=M===t?M:Oe(M),U-=E?E.length:0,c&T){var W=g,q=E;g=E=t}var te=k?t:Ad(a),de=[a,c,p,g,E,W,q,x,C,M];if(te&&IC(de,te),a=de[0],c=de[1],p=de[2],g=de[3],E=de[4],M=de[9]=de[9]===t?k?0:a.length:Rt(de[9]-U,0),!M&&c&(S|D)&&(c&=~(S|D)),!c||c==b)var Ee=mC(a,c,p);else c==S||c==D?Ee=gC(a,c,M):(c==L||c==(b|L))&&!E.length?Ee=bC(a,c,p,g):Ee=el.apply(t,de);var Le=te?Vg:xb;return _b(Le(Ee,de),a,c)}function fb(a,c,p,g){return a===t||Qn(a,So[p])&&!Ze.call(g,p)?c:a}function pb(a,c,p,g,E,x){return dt(a)&&dt(c)&&(x.set(c,a),Xa(a,c,t,pb,x),x.delete(c)),a}function EC(a){return Rs(a)?t:a}function hb(a,c,p,g,E,x){var C=p&m,M=a.length,k=c.length;if(M!=k&&!(C&&k>M))return!1;var U=x.get(a),W=x.get(c);if(U&&W)return U==c&&W==a;var q=-1,te=!0,de=p&y?new Ri:t;for(x.set(a,c),x.set(c,a);++q<M;){var Ee=a[q],Le=c[q];if(g)var ve=C?g(Le,Ee,q,c,a,x):g(Ee,Le,q,a,c,x);if(ve!==t){if(ve)continue;te=!1;break}if(de){if(!Yu(c,function($e,We){if(!ys(de,We)&&(Ee===$e||E(Ee,$e,p,g,x)))return de.push(We)})){te=!1;break}}else if(!(Ee===Le||E(Ee,Le,p,g,x))){te=!1;break}}return x.delete(a),x.delete(c),te}function vC(a,c,p,g,E,x,C){switch(p){case kt:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case Pt:return!(a.byteLength!=c.byteLength||!x(new Fa(a),new Fa(c)));case Be:case wt:case sn:return Qn(+a,+c);case ke:return a.name==c.name&&a.message==c.message;case Dt:case bt:return a==c+"";case pt:var M=ed;case V:var k=g&m;if(M||(M=Ra),a.size!=c.size&&!k)return!1;var U=C.get(a);if(U)return U==c;g|=y,C.set(a,c);var W=hb(M(a),M(c),g,E,x,C);return C.delete(a),W;case we:if(_s)return _s.call(a)==_s.call(c)}return!1}function wC(a,c,p,g,E,x){var C=p&m,M=Td(a),k=M.length,U=Td(c),W=U.length;if(k!=W&&!C)return!1;for(var q=k;q--;){var te=M[q];if(!(C?te in c:Ze.call(c,te)))return!1}var de=x.get(a),Ee=x.get(c);if(de&&Ee)return de==c&&Ee==a;var Le=!0;x.set(a,c),x.set(c,a);for(var ve=C;++q<k;){te=M[q];var $e=a[te],We=c[te];if(g)var An=C?g(We,$e,te,c,a,x):g($e,We,te,a,c,x);if(!(An===t?$e===We||E($e,We,p,g,x):An)){Le=!1;break}ve||(ve=te=="constructor")}if(Le&&!ve){var un=a.constructor,Mn=c.constructor;un!=Mn&&"constructor"in a&&"constructor"in c&&!(typeof un=="function"&&un instanceof un&&typeof Mn=="function"&&Mn instanceof Mn)&&(Le=!1)}return x.delete(a),x.delete(c),Le}function Mr(a){return Id(vb(a,t,Nb),a+"")}function Td(a){return Lg(a,Ht,Nd)}function Cd(a){return Lg(a,bn,mb)}var Ad=Ka?function(a){return Ka.get(a)}:Gd;function il(a){for(var c=a.name+"",p=Co[c],g=Ze.call(Co,c)?p.length:0;g--;){var E=p[g],x=E.func;if(x==null||x==a)return E.name}return c}function ko(a){var c=Ze.call(v,"placeholder")?v:a;return c.placeholder}function ye(){var a=v.iteratee||Kd;return a=a===Kd?Bg:a,arguments.length?a(arguments[0],arguments[1]):a}function ol(a,c){var p=a.__data__;return NC(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Md(a){for(var c=Ht(a),p=c.length;p--;){var g=c[p],E=a[g];c[p]=[g,E,yb(E)]}return c}function Di(a,c){var p=RT(a,c);return Pg(p)?p:t}function xC(a){var c=Ze.call(a,ki),p=a[ki];try{a[ki]=t;var g=!0}catch{}var E=Pa.call(a);return g&&(c?a[ki]=p:delete a[ki]),E}var Nd=nd?function(a){return a==null?[]:(a=et(a),jr(nd(a),function(c){return wg.call(a,c)}))}:qd,mb=nd?function(a){for(var c=[];a;)Qr(c,Nd(a)),a=Ha(a);return c}:qd,jt=ln;(rd&&jt(new rd(new ArrayBuffer(1)))!=kt||vs&&jt(new vs)!=pt||id&&jt(id.resolve())!=Je||To&&jt(new To)!=V||ws&&jt(new ws)!=ct)&&(jt=function(a){var c=ln(a),p=c==_t?a.constructor:t,g=p?Pi(p):"";if(g)switch(g){case i1:return kt;case o1:return pt;case s1:return Je;case a1:return V;case l1:return ct}return c});function _C(a,c,p){for(var g=-1,E=p.length;++g<E;){var x=p[g],C=x.size;switch(x.type){case"drop":a+=C;break;case"dropRight":c-=C;break;case"take":c=Zt(c,a+C);break;case"takeRight":a=Rt(a,c-C);break}}return{start:a,end:c}}function SC(a){var c=a.match(kS);return c?c[1].split(OS):[]}function gb(a,c,p){c=oi(c,a);for(var g=-1,E=c.length,x=!1;++g<E;){var C=fr(c[g]);if(!(x=a!=null&&p(a,C)))break;a=a[C]}return x||++g!=E?x:(E=a==null?0:a.length,!!E&&fl(E)&&Nr(C,E)&&(Ne(a)||Bi(a)))}function TC(a){var c=a.length,p=new a.constructor(c);return c&&typeof a[0]=="string"&&Ze.call(a,"index")&&(p.index=a.index,p.input=a.input),p}function bb(a){return typeof a.constructor=="function"&&!ks(a)?Ao(Ha(a)):{}}function CC(a,c,p){var g=a.constructor;switch(c){case Pt:return xd(a);case Be:case wt:return new g(+a);case kt:return cC(a,p);case I:case F:case X:case se:case Fe:case it:case xr:case B:case le:return Qg(a,p);case pt:return new g;case sn:case bt:return new g(a);case Dt:return uC(a);case V:return new g;case we:return dC(a)}}function AC(a,c){var p=c.length;if(!p)return a;var g=p-1;return c[g]=(p>1?"& ":"")+c[g],c=c.join(p>2?", ":" "),a.replace(NS,`{
|
|
/* [wrapped with `+c+`] */
|
|
`)}function MC(a){return Ne(a)||Bi(a)||!!(xg&&a&&a[xg])}function Nr(a,c){var p=typeof a;return c=c??_e,!!c&&(p=="number"||p!="symbol"&&$S.test(a))&&a>-1&&a%1==0&&a<c}function cn(a,c,p){if(!dt(p))return!1;var g=typeof c;return(g=="number"?gn(p)&&Nr(c,p.length):g=="string"&&c in p)?Qn(p[c],a):!1}function kd(a,c){if(Ne(a))return!1;var p=typeof a;return p=="number"||p=="symbol"||p=="boolean"||a==null||Cn(a)?!0:Bu.test(a)||!Xr.test(a)||c!=null&&a in et(c)}function NC(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}function Od(a){var c=il(a),p=v[c];if(typeof p!="function"||!(c in ze.prototype))return!1;if(a===p)return!0;var g=Ad(p);return!!g&&a===g[0]}function kC(a){return!!yg&&yg in a}var OC=La?kr:Yd;function ks(a){var c=a&&a.constructor,p=typeof c=="function"&&c.prototype||So;return a===p}function yb(a){return a===a&&!dt(a)}function Eb(a,c){return function(p){return p==null?!1:p[a]===c&&(c!==t||a in et(p))}}function RC(a){var c=ul(a,function(g){return p.size===l&&p.clear(),g}),p=c.cache;return c}function IC(a,c){var p=a[1],g=c[1],E=p|g,x=E<(b|w|$),C=g==$&&p==S||g==$&&p==O&&a[7].length<=c[8]||g==($|O)&&c[7].length<=c[8]&&p==S;if(!(x||C))return a;g&b&&(a[2]=c[2],E|=p&b?0:_);var M=c[3];if(M){var k=a[3];a[3]=k?tb(k,M,c[4]):M,a[4]=k?ei(a[3],u):c[4]}return M=c[5],M&&(k=a[5],a[5]=k?nb(k,M,c[6]):M,a[6]=k?ei(a[5],u):c[6]),M=c[7],M&&(a[7]=M),g&$&&(a[8]=a[8]==null?c[8]:Zt(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=E,a}function LC(a){var c=[];if(a!=null)for(var p in et(a))c.push(p);return c}function DC(a){return Pa.call(a)}function vb(a,c,p){return c=Rt(c===t?a.length-1:c,0),function(){for(var g=arguments,E=-1,x=Rt(g.length-c,0),C=P(x);++E<x;)C[E]=g[c+E];E=-1;for(var M=P(c+1);++E<c;)M[E]=g[E];return M[c]=p(C),_n(a,this,M)}}function wb(a,c){return c.length<2?a:Li(a,Dn(c,0,-1))}function PC(a,c){for(var p=a.length,g=Zt(c.length,p),E=mn(a);g--;){var x=c[g];a[g]=Nr(x,p)?E[x]:t}return a}function Rd(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}var xb=Sb(Vg),Os=ZT||function(a,c){return Ft.setTimeout(a,c)},Id=Sb(oC);function _b(a,c,p){var g=c+"";return Id(a,AC(g,BC(SC(g),p)))}function Sb(a){var c=0,p=0;return function(){var g=t1(),E=he-(g-p);if(p=g,E>0){if(++c>=re)return arguments[0]}else c=0;return a.apply(t,arguments)}}function sl(a,c){var p=-1,g=a.length,E=g-1;for(c=c===t?g:c;++p<c;){var x=md(p,E),C=a[x];a[x]=a[p],a[p]=C}return a.length=c,a}var Tb=RC(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(bs,function(p,g,E,x){c.push(E?x.replace(LS,"$1"):g||p)}),c});function fr(a){if(typeof a=="string"||Cn(a))return a;var c=a+"";return c=="0"&&1/a==-ge?"-0":c}function Pi(a){if(a!=null){try{return Da.call(a)}catch{}try{return a+""}catch{}}return""}function BC(a,c){return On(be,function(p){var g="_."+p[0];c&p[1]&&!ka(a,g)&&a.push(g)}),a.sort()}function Cb(a){if(a instanceof ze)return a.clone();var c=new In(a.__wrapped__,a.__chain__);return c.__actions__=mn(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}function FC(a,c,p){(p?cn(a,c,p):c===t)?c=1:c=Rt(Oe(c),0);var g=a==null?0:a.length;if(!g||c<1)return[];for(var E=0,x=0,C=P(Ua(g/c));E<g;)C[x++]=Dn(a,E,E+=c);return C}function HC(a){for(var c=-1,p=a==null?0:a.length,g=0,E=[];++c<p;){var x=a[c];x&&(E[g++]=x)}return E}function $C(){var a=arguments.length;if(!a)return[];for(var c=P(a-1),p=arguments[0],g=a;g--;)c[g-1]=arguments[g];return Qr(Ne(p)?mn(p):[p],Kt(c,1))}var zC=He(function(a,c){return yt(a)?Ts(a,Kt(c,1,yt,!0)):[]}),UC=He(function(a,c){var p=Pn(c);return yt(p)&&(p=t),yt(a)?Ts(a,Kt(c,1,yt,!0),ye(p,2)):[]}),WC=He(function(a,c){var p=Pn(c);return yt(p)&&(p=t),yt(a)?Ts(a,Kt(c,1,yt,!0),t,p):[]});function KC(a,c,p){var g=a==null?0:a.length;return g?(c=p||c===t?1:Oe(c),Dn(a,c<0?0:c,g)):[]}function VC(a,c,p){var g=a==null?0:a.length;return g?(c=p||c===t?1:Oe(c),c=g-c,Dn(a,0,c<0?0:c)):[]}function GC(a,c){return a&&a.length?ja(a,ye(c,3),!0,!0):[]}function qC(a,c){return a&&a.length?ja(a,ye(c,3),!0):[]}function YC(a,c,p,g){var E=a==null?0:a.length;return E?(p&&typeof p!="number"&&cn(a,c,p)&&(p=0,g=E),$1(a,c,p,g)):[]}function Ab(a,c,p){var g=a==null?0:a.length;if(!g)return-1;var E=p==null?0:Oe(p);return E<0&&(E=Rt(g+E,0)),Oa(a,ye(c,3),E)}function Mb(a,c,p){var g=a==null?0:a.length;if(!g)return-1;var E=g-1;return p!==t&&(E=Oe(p),E=p<0?Rt(g+E,0):Zt(E,g-1)),Oa(a,ye(c,3),E,!0)}function Nb(a){var c=a==null?0:a.length;return c?Kt(a,1):[]}function JC(a){var c=a==null?0:a.length;return c?Kt(a,ge):[]}function XC(a,c){var p=a==null?0:a.length;return p?(c=c===t?1:Oe(c),Kt(a,c)):[]}function ZC(a){for(var c=-1,p=a==null?0:a.length,g={};++c<p;){var E=a[c];g[E[0]]=E[1]}return g}function kb(a){return a&&a.length?a[0]:t}function jC(a,c,p){var g=a==null?0:a.length;if(!g)return-1;var E=p==null?0:Oe(p);return E<0&&(E=Rt(g+E,0)),wo(a,c,E)}function QC(a){var c=a==null?0:a.length;return c?Dn(a,0,-1):[]}var eA=He(function(a){var c=at(a,vd);return c.length&&c[0]===a[0]?ud(c):[]}),tA=He(function(a){var c=Pn(a),p=at(a,vd);return c===Pn(p)?c=t:p.pop(),p.length&&p[0]===a[0]?ud(p,ye(c,2)):[]}),nA=He(function(a){var c=Pn(a),p=at(a,vd);return c=typeof c=="function"?c:t,c&&p.pop(),p.length&&p[0]===a[0]?ud(p,t,c):[]});function rA(a,c){return a==null?"":QT.call(a,c)}function Pn(a){var c=a==null?0:a.length;return c?a[c-1]:t}function iA(a,c,p){var g=a==null?0:a.length;if(!g)return-1;var E=g;return p!==t&&(E=Oe(p),E=E<0?Rt(g+E,0):Zt(E,g-1)),c===c?BT(a,c,E):Oa(a,ug,E,!0)}function oA(a,c){return a&&a.length?zg(a,Oe(c)):t}var sA=He(Ob);function Ob(a,c){return a&&a.length&&c&&c.length?hd(a,c):a}function aA(a,c,p){return a&&a.length&&c&&c.length?hd(a,c,ye(p,2)):a}function lA(a,c,p){return a&&a.length&&c&&c.length?hd(a,c,t,p):a}var cA=Mr(function(a,c){var p=a==null?0:a.length,g=sd(a,c);return Kg(a,at(c,function(E){return Nr(E,p)?+E:E}).sort(eb)),g});function uA(a,c){var p=[];if(!(a&&a.length))return p;var g=-1,E=[],x=a.length;for(c=ye(c,3);++g<x;){var C=a[g];c(C,g,a)&&(p.push(C),E.push(g))}return Kg(a,E),p}function Ld(a){return a==null?a:r1.call(a)}function dA(a,c,p){var g=a==null?0:a.length;return g?(p&&typeof p!="number"&&cn(a,c,p)?(c=0,p=g):(c=c==null?0:Oe(c),p=p===t?g:Oe(p)),Dn(a,c,p)):[]}function fA(a,c){return Za(a,c)}function pA(a,c,p){return bd(a,c,ye(p,2))}function hA(a,c){var p=a==null?0:a.length;if(p){var g=Za(a,c);if(g<p&&Qn(a[g],c))return g}return-1}function mA(a,c){return Za(a,c,!0)}function gA(a,c,p){return bd(a,c,ye(p,2),!0)}function bA(a,c){var p=a==null?0:a.length;if(p){var g=Za(a,c,!0)-1;if(Qn(a[g],c))return g}return-1}function yA(a){return a&&a.length?Gg(a):[]}function EA(a,c){return a&&a.length?Gg(a,ye(c,2)):[]}function vA(a){var c=a==null?0:a.length;return c?Dn(a,1,c):[]}function wA(a,c,p){return a&&a.length?(c=p||c===t?1:Oe(c),Dn(a,0,c<0?0:c)):[]}function xA(a,c,p){var g=a==null?0:a.length;return g?(c=p||c===t?1:Oe(c),c=g-c,Dn(a,c<0?0:c,g)):[]}function _A(a,c){return a&&a.length?ja(a,ye(c,3),!1,!0):[]}function SA(a,c){return a&&a.length?ja(a,ye(c,3)):[]}var TA=He(function(a){return ii(Kt(a,1,yt,!0))}),CA=He(function(a){var c=Pn(a);return yt(c)&&(c=t),ii(Kt(a,1,yt,!0),ye(c,2))}),AA=He(function(a){var c=Pn(a);return c=typeof c=="function"?c:t,ii(Kt(a,1,yt,!0),t,c)});function MA(a){return a&&a.length?ii(a):[]}function NA(a,c){return a&&a.length?ii(a,ye(c,2)):[]}function kA(a,c){return c=typeof c=="function"?c:t,a&&a.length?ii(a,t,c):[]}function Dd(a){if(!(a&&a.length))return[];var c=0;return a=jr(a,function(p){if(yt(p))return c=Rt(p.length,c),!0}),ju(c,function(p){return at(a,Ju(p))})}function Rb(a,c){if(!(a&&a.length))return[];var p=Dd(a);return c==null?p:at(p,function(g){return _n(c,t,g)})}var OA=He(function(a,c){return yt(a)?Ts(a,c):[]}),RA=He(function(a){return Ed(jr(a,yt))}),IA=He(function(a){var c=Pn(a);return yt(c)&&(c=t),Ed(jr(a,yt),ye(c,2))}),LA=He(function(a){var c=Pn(a);return c=typeof c=="function"?c:t,Ed(jr(a,yt),t,c)}),DA=He(Dd);function PA(a,c){return Xg(a||[],c||[],Ss)}function BA(a,c){return Xg(a||[],c||[],Ms)}var FA=He(function(a){var c=a.length,p=c>1?a[c-1]:t;return p=typeof p=="function"?(a.pop(),p):t,Rb(a,p)});function Ib(a){var c=v(a);return c.__chain__=!0,c}function HA(a,c){return c(a),a}function al(a,c){return c(a)}var $A=Mr(function(a){var c=a.length,p=c?a[0]:0,g=this.__wrapped__,E=function(x){return sd(x,a)};return c>1||this.__actions__.length||!(g instanceof ze)||!Nr(p)?this.thru(E):(g=g.slice(p,+p+(c?1:0)),g.__actions__.push({func:al,args:[E],thisArg:t}),new In(g,this.__chain__).thru(function(x){return c&&!x.length&&x.push(t),x}))});function zA(){return Ib(this)}function UA(){return new In(this.value(),this.__chain__)}function WA(){this.__values__===t&&(this.__values__=qb(this.value()));var a=this.__index__>=this.__values__.length,c=a?t:this.__values__[this.__index__++];return{done:a,value:c}}function KA(){return this}function VA(a){for(var c,p=this;p instanceof Ga;){var g=Cb(p);g.__index__=0,g.__values__=t,c?E.__wrapped__=g:c=g;var E=g;p=p.__wrapped__}return E.__wrapped__=a,c}function GA(){var a=this.__wrapped__;if(a instanceof ze){var c=a;return this.__actions__.length&&(c=new ze(this)),c=c.reverse(),c.__actions__.push({func:al,args:[Ld],thisArg:t}),new In(c,this.__chain__)}return this.thru(Ld)}function qA(){return Jg(this.__wrapped__,this.__actions__)}var YA=Qa(function(a,c,p){Ze.call(a,p)?++a[p]:Cr(a,p,1)});function JA(a,c,p){var g=Ne(a)?lg:H1;return p&&cn(a,c,p)&&(c=t),g(a,ye(c,3))}function XA(a,c){var p=Ne(a)?jr:Rg;return p(a,ye(c,3))}var ZA=sb(Ab),jA=sb(Mb);function QA(a,c){return Kt(ll(a,c),1)}function eM(a,c){return Kt(ll(a,c),ge)}function tM(a,c,p){return p=p===t?1:Oe(p),Kt(ll(a,c),p)}function Lb(a,c){var p=Ne(a)?On:ri;return p(a,ye(c,3))}function Db(a,c){var p=Ne(a)?vT:Og;return p(a,ye(c,3))}var nM=Qa(function(a,c,p){Ze.call(a,p)?a[p].push(c):Cr(a,p,[c])});function rM(a,c,p,g){a=gn(a)?a:Ro(a),p=p&&!g?Oe(p):0;var E=a.length;return p<0&&(p=Rt(E+p,0)),pl(a)?p<=E&&a.indexOf(c,p)>-1:!!E&&wo(a,c,p)>-1}var iM=He(function(a,c,p){var g=-1,E=typeof c=="function",x=gn(a)?P(a.length):[];return ri(a,function(C){x[++g]=E?_n(c,C,p):Cs(C,c,p)}),x}),oM=Qa(function(a,c,p){Cr(a,p,c)});function ll(a,c){var p=Ne(a)?at:Fg;return p(a,ye(c,3))}function sM(a,c,p,g){return a==null?[]:(Ne(c)||(c=c==null?[]:[c]),p=g?t:p,Ne(p)||(p=p==null?[]:[p]),Ug(a,c,p))}var aM=Qa(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function lM(a,c,p){var g=Ne(a)?qu:fg,E=arguments.length<3;return g(a,ye(c,4),p,E,ri)}function cM(a,c,p){var g=Ne(a)?wT:fg,E=arguments.length<3;return g(a,ye(c,4),p,E,Og)}function uM(a,c){var p=Ne(a)?jr:Rg;return p(a,dl(ye(c,3)))}function dM(a){var c=Ne(a)?Ag:rC;return c(a)}function fM(a,c,p){(p?cn(a,c,p):c===t)?c=1:c=Oe(c);var g=Ne(a)?L1:iC;return g(a,c)}function pM(a){var c=Ne(a)?D1:sC;return c(a)}function hM(a){if(a==null)return 0;if(gn(a))return pl(a)?_o(a):a.length;var c=jt(a);return c==pt||c==V?a.size:fd(a).length}function mM(a,c,p){var g=Ne(a)?Yu:aC;return p&&cn(a,c,p)&&(c=t),g(a,ye(c,3))}var gM=He(function(a,c){if(a==null)return[];var p=c.length;return p>1&&cn(a,c[0],c[1])?c=[]:p>2&&cn(c[0],c[1],c[2])&&(c=[c[0]]),Ug(a,Kt(c,1),[])}),cl=XT||function(){return Ft.Date.now()};function bM(a,c){if(typeof c!="function")throw new Rn(i);return a=Oe(a),function(){if(--a<1)return c.apply(this,arguments)}}function Pb(a,c,p){return c=p?t:c,c=a&&c==null?a.length:c,Ar(a,$,t,t,t,t,c)}function Bb(a,c){var p;if(typeof c!="function")throw new Rn(i);return a=Oe(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=t),p}}var Pd=He(function(a,c,p){var g=b;if(p.length){var E=ei(p,ko(Pd));g|=L}return Ar(a,g,c,p,E)}),Fb=He(function(a,c,p){var g=b|w;if(p.length){var E=ei(p,ko(Fb));g|=L}return Ar(c,g,a,p,E)});function Hb(a,c,p){c=p?t:c;var g=Ar(a,S,t,t,t,t,t,c);return g.placeholder=Hb.placeholder,g}function $b(a,c,p){c=p?t:c;var g=Ar(a,D,t,t,t,t,t,c);return g.placeholder=$b.placeholder,g}function zb(a,c,p){var g,E,x,C,M,k,U=0,W=!1,q=!1,te=!0;if(typeof a!="function")throw new Rn(i);c=Bn(c)||0,dt(p)&&(W=!!p.leading,q="maxWait"in p,x=q?Rt(Bn(p.maxWait)||0,c):x,te="trailing"in p?!!p.trailing:te);function de(Et){var er=g,Rr=E;return g=E=t,U=Et,C=a.apply(Rr,er),C}function Ee(Et){return U=Et,M=Os($e,c),W?de(Et):C}function Le(Et){var er=Et-k,Rr=Et-U,sy=c-er;return q?Zt(sy,x-Rr):sy}function ve(Et){var er=Et-k,Rr=Et-U;return k===t||er>=c||er<0||q&&Rr>=x}function $e(){var Et=cl();if(ve(Et))return We(Et);M=Os($e,Le(Et))}function We(Et){return M=t,te&&g?de(Et):(g=E=t,C)}function An(){M!==t&&Zg(M),U=0,g=k=E=M=t}function un(){return M===t?C:We(cl())}function Mn(){var Et=cl(),er=ve(Et);if(g=arguments,E=this,k=Et,er){if(M===t)return Ee(k);if(q)return Zg(M),M=Os($e,c),de(k)}return M===t&&(M=Os($e,c)),C}return Mn.cancel=An,Mn.flush=un,Mn}var yM=He(function(a,c){return kg(a,1,c)}),EM=He(function(a,c,p){return kg(a,Bn(c)||0,p)});function vM(a){return Ar(a,Y)}function ul(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Rn(i);var p=function(){var g=arguments,E=c?c.apply(this,g):g[0],x=p.cache;if(x.has(E))return x.get(E);var C=a.apply(this,g);return p.cache=x.set(E,C)||x,C};return p.cache=new(ul.Cache||Tr),p}ul.Cache=Tr;function dl(a){if(typeof a!="function")throw new Rn(i);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function wM(a){return Bb(2,a)}var xM=lC(function(a,c){c=c.length==1&&Ne(c[0])?at(c[0],Sn(ye())):at(Kt(c,1),Sn(ye()));var p=c.length;return He(function(g){for(var E=-1,x=Zt(g.length,p);++E<x;)g[E]=c[E].call(this,g[E]);return _n(a,this,g)})}),Bd=He(function(a,c){var p=ei(c,ko(Bd));return Ar(a,L,t,c,p)}),Ub=He(function(a,c){var p=ei(c,ko(Ub));return Ar(a,T,t,c,p)}),_M=Mr(function(a,c){return Ar(a,O,t,t,t,c)});function SM(a,c){if(typeof a!="function")throw new Rn(i);return c=c===t?c:Oe(c),He(a,c)}function TM(a,c){if(typeof a!="function")throw new Rn(i);return c=c==null?0:Rt(Oe(c),0),He(function(p){var g=p[c],E=si(p,0,c);return g&&Qr(E,g),_n(a,this,E)})}function CM(a,c,p){var g=!0,E=!0;if(typeof a!="function")throw new Rn(i);return dt(p)&&(g="leading"in p?!!p.leading:g,E="trailing"in p?!!p.trailing:E),zb(a,c,{leading:g,maxWait:c,trailing:E})}function AM(a){return Pb(a,1)}function MM(a,c){return Bd(wd(c),a)}function NM(){if(!arguments.length)return[];var a=arguments[0];return Ne(a)?a:[a]}function kM(a){return Ln(a,h)}function OM(a,c){return c=typeof c=="function"?c:t,Ln(a,h,c)}function RM(a){return Ln(a,d|h)}function IM(a,c){return c=typeof c=="function"?c:t,Ln(a,d|h,c)}function LM(a,c){return c==null||Ng(a,c,Ht(c))}function Qn(a,c){return a===c||a!==a&&c!==c}var DM=rl(cd),PM=rl(function(a,c){return a>=c}),Bi=Dg(function(){return arguments}())?Dg:function(a){return ht(a)&&Ze.call(a,"callee")&&!wg.call(a,"callee")},Ne=P.isArray,BM=ng?Sn(ng):V1;function gn(a){return a!=null&&fl(a.length)&&!kr(a)}function yt(a){return ht(a)&&gn(a)}function FM(a){return a===!0||a===!1||ht(a)&&ln(a)==Be}var ai=jT||Yd,HM=rg?Sn(rg):G1;function $M(a){return ht(a)&&a.nodeType===1&&!Rs(a)}function zM(a){if(a==null)return!0;if(gn(a)&&(Ne(a)||typeof a=="string"||typeof a.splice=="function"||ai(a)||Oo(a)||Bi(a)))return!a.length;var c=jt(a);if(c==pt||c==V)return!a.size;if(ks(a))return!fd(a).length;for(var p in a)if(Ze.call(a,p))return!1;return!0}function UM(a,c){return As(a,c)}function WM(a,c,p){p=typeof p=="function"?p:t;var g=p?p(a,c):t;return g===t?As(a,c,t,p):!!g}function Fd(a){if(!ht(a))return!1;var c=ln(a);return c==ke||c==Nt||typeof a.message=="string"&&typeof a.name=="string"&&!Rs(a)}function KM(a){return typeof a=="number"&&_g(a)}function kr(a){if(!dt(a))return!1;var c=ln(a);return c==xt||c==Jt||c==Me||c==Xn}function Wb(a){return typeof a=="number"&&a==Oe(a)}function fl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=_e}function dt(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function ht(a){return a!=null&&typeof a=="object"}var Kb=ig?Sn(ig):Y1;function VM(a,c){return a===c||dd(a,c,Md(c))}function GM(a,c,p){return p=typeof p=="function"?p:t,dd(a,c,Md(c),p)}function qM(a){return Vb(a)&&a!=+a}function YM(a){if(OC(a))throw new Ae(r);return Pg(a)}function JM(a){return a===null}function XM(a){return a==null}function Vb(a){return typeof a=="number"||ht(a)&&ln(a)==sn}function Rs(a){if(!ht(a)||ln(a)!=_t)return!1;var c=Ha(a);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Da.call(p)==GT}var Hd=og?Sn(og):J1;function ZM(a){return Wb(a)&&a>=-_e&&a<=_e}var Gb=sg?Sn(sg):X1;function pl(a){return typeof a=="string"||!Ne(a)&&ht(a)&&ln(a)==bt}function Cn(a){return typeof a=="symbol"||ht(a)&&ln(a)==we}var Oo=ag?Sn(ag):Z1;function jM(a){return a===t}function QM(a){return ht(a)&&jt(a)==ct}function eN(a){return ht(a)&&ln(a)==ut}var tN=rl(pd),nN=rl(function(a,c){return a<=c});function qb(a){if(!a)return[];if(gn(a))return pl(a)?Zn(a):mn(a);if(Es&&a[Es])return LT(a[Es]());var c=jt(a),p=c==pt?ed:c==V?Ra:Ro;return p(a)}function Or(a){if(!a)return a===0?a:0;if(a=Bn(a),a===ge||a===-ge){var c=a<0?-1:1;return c*A}return a===a?a:0}function Oe(a){var c=Or(a),p=c%1;return c===c?p?c-p:c:0}function Yb(a){return a?Ii(Oe(a),0,K):0}function Bn(a){if(typeof a=="number")return a;if(Cn(a))return R;if(dt(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=dt(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=pg(a);var p=BS.test(a);return p||HS.test(a)?bT(a.slice(2),p?2:8):PS.test(a)?R:+a}function Jb(a){return dr(a,bn(a))}function rN(a){return a?Ii(Oe(a),-_e,_e):a===0?a:0}function Xe(a){return a==null?"":Tn(a)}var iN=Mo(function(a,c){if(ks(c)||gn(c)){dr(c,Ht(c),a);return}for(var p in c)Ze.call(c,p)&&Ss(a,p,c[p])}),Xb=Mo(function(a,c){dr(c,bn(c),a)}),hl=Mo(function(a,c,p,g){dr(c,bn(c),a,g)}),oN=Mo(function(a,c,p,g){dr(c,Ht(c),a,g)}),sN=Mr(sd);function aN(a,c){var p=Ao(a);return c==null?p:Mg(p,c)}var lN=He(function(a,c){a=et(a);var p=-1,g=c.length,E=g>2?c[2]:t;for(E&&cn(c[0],c[1],E)&&(g=1);++p<g;)for(var x=c[p],C=bn(x),M=-1,k=C.length;++M<k;){var U=C[M],W=a[U];(W===t||Qn(W,So[U])&&!Ze.call(a,U))&&(a[U]=x[U])}return a}),cN=He(function(a){return a.push(t,pb),_n(Zb,t,a)});function uN(a,c){return cg(a,ye(c,3),ur)}function dN(a,c){return cg(a,ye(c,3),ld)}function fN(a,c){return a==null?a:ad(a,ye(c,3),bn)}function pN(a,c){return a==null?a:Ig(a,ye(c,3),bn)}function hN(a,c){return a&&ur(a,ye(c,3))}function mN(a,c){return a&&ld(a,ye(c,3))}function gN(a){return a==null?[]:Ja(a,Ht(a))}function bN(a){return a==null?[]:Ja(a,bn(a))}function $d(a,c,p){var g=a==null?t:Li(a,c);return g===t?p:g}function yN(a,c){return a!=null&&gb(a,c,z1)}function zd(a,c){return a!=null&&gb(a,c,U1)}var EN=lb(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=Pa.call(c)),a[c]=p},Wd(yn)),vN=lb(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=Pa.call(c)),Ze.call(a,c)?a[c].push(p):a[c]=[p]},ye),wN=He(Cs);function Ht(a){return gn(a)?Cg(a):fd(a)}function bn(a){return gn(a)?Cg(a,!0):j1(a)}function xN(a,c){var p={};return c=ye(c,3),ur(a,function(g,E,x){Cr(p,c(g,E,x),g)}),p}function _N(a,c){var p={};return c=ye(c,3),ur(a,function(g,E,x){Cr(p,E,c(g,E,x))}),p}var SN=Mo(function(a,c,p){Xa(a,c,p)}),Zb=Mo(function(a,c,p,g){Xa(a,c,p,g)}),TN=Mr(function(a,c){var p={};if(a==null)return p;var g=!1;c=at(c,function(x){return x=oi(x,a),g||(g=x.length>1),x}),dr(a,Cd(a),p),g&&(p=Ln(p,d|f|h,EC));for(var E=c.length;E--;)yd(p,c[E]);return p});function CN(a,c){return jb(a,dl(ye(c)))}var AN=Mr(function(a,c){return a==null?{}:eC(a,c)});function jb(a,c){if(a==null)return{};var p=at(Cd(a),function(g){return[g]});return c=ye(c),Wg(a,p,function(g,E){return c(g,E[0])})}function MN(a,c,p){c=oi(c,a);var g=-1,E=c.length;for(E||(E=1,a=t);++g<E;){var x=a==null?t:a[fr(c[g])];x===t&&(g=E,x=p),a=kr(x)?x.call(a):x}return a}function NN(a,c,p){return a==null?a:Ms(a,c,p)}function kN(a,c,p,g){return g=typeof g=="function"?g:t,a==null?a:Ms(a,c,p,g)}var Qb=db(Ht),ey=db(bn);function ON(a,c,p){var g=Ne(a),E=g||ai(a)||Oo(a);if(c=ye(c,4),p==null){var x=a&&a.constructor;E?p=g?new x:[]:dt(a)?p=kr(x)?Ao(Ha(a)):{}:p={}}return(E?On:ur)(a,function(C,M,k){return c(p,C,M,k)}),p}function RN(a,c){return a==null?!0:yd(a,c)}function IN(a,c,p){return a==null?a:Yg(a,c,wd(p))}function LN(a,c,p,g){return g=typeof g=="function"?g:t,a==null?a:Yg(a,c,wd(p),g)}function Ro(a){return a==null?[]:Qu(a,Ht(a))}function DN(a){return a==null?[]:Qu(a,bn(a))}function PN(a,c,p){return p===t&&(p=c,c=t),p!==t&&(p=Bn(p),p=p===p?p:0),c!==t&&(c=Bn(c),c=c===c?c:0),Ii(Bn(a),c,p)}function BN(a,c,p){return c=Or(c),p===t?(p=c,c=0):p=Or(p),a=Bn(a),W1(a,c,p)}function FN(a,c,p){if(p&&typeof p!="boolean"&&cn(a,c,p)&&(c=p=t),p===t&&(typeof c=="boolean"?(p=c,c=t):typeof a=="boolean"&&(p=a,a=t)),a===t&&c===t?(a=0,c=1):(a=Or(a),c===t?(c=a,a=0):c=Or(c)),a>c){var g=a;a=c,c=g}if(p||a%1||c%1){var E=Sg();return Zt(a+E*(c-a+gT("1e-"+((E+"").length-1))),c)}return md(a,c)}var HN=No(function(a,c,p){return c=c.toLowerCase(),a+(p?ty(c):c)});function ty(a){return Ud(Xe(a).toLowerCase())}function ny(a){return a=Xe(a),a&&a.replace(zS,NT).replace(sT,"")}function $N(a,c,p){a=Xe(a),c=Tn(c);var g=a.length;p=p===t?g:Ii(Oe(p),0,g);var E=p;return p-=c.length,p>=0&&a.slice(p,E)==c}function zN(a){return a=Xe(a),a&&Ca.test(a)?a.replace(an,kT):a}function UN(a){return a=Xe(a),a&&AS.test(a)?a.replace(Zr,"\\$&"):a}var WN=No(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),KN=No(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),VN=ob("toLowerCase");function GN(a,c,p){a=Xe(a),c=Oe(c);var g=c?_o(a):0;if(!c||g>=c)return a;var E=(c-g)/2;return nl(Wa(E),p)+a+nl(Ua(E),p)}function qN(a,c,p){a=Xe(a),c=Oe(c);var g=c?_o(a):0;return c&&g<c?a+nl(c-g,p):a}function YN(a,c,p){a=Xe(a),c=Oe(c);var g=c?_o(a):0;return c&&g<c?nl(c-g,p)+a:a}function JN(a,c,p){return p||c==null?c=0:c&&(c=+c),n1(Xe(a).replace(Fu,""),c||0)}function XN(a,c,p){return(p?cn(a,c,p):c===t)?c=1:c=Oe(c),gd(Xe(a),c)}function ZN(){var a=arguments,c=Xe(a[0]);return a.length<3?c:c.replace(a[1],a[2])}var jN=No(function(a,c,p){return a+(p?"_":"")+c.toLowerCase()});function QN(a,c,p){return p&&typeof p!="number"&&cn(a,c,p)&&(c=p=t),p=p===t?K:p>>>0,p?(a=Xe(a),a&&(typeof c=="string"||c!=null&&!Hd(c))&&(c=Tn(c),!c&&xo(a))?si(Zn(a),0,p):a.split(c,p)):[]}var ek=No(function(a,c,p){return a+(p?" ":"")+Ud(c)});function tk(a,c,p){return a=Xe(a),p=p==null?0:Ii(Oe(p),0,a.length),c=Tn(c),a.slice(p,p+c.length)==c}function nk(a,c,p){var g=v.templateSettings;p&&cn(a,c,p)&&(c=t),a=Xe(a),c=hl({},c,g,fb);var E=hl({},c.imports,g.imports,fb),x=Ht(E),C=Qu(E,x),M,k,U=0,W=c.interpolate||Aa,q="__p += '",te=td((c.escape||Aa).source+"|"+W.source+"|"+(W===Mi?DS:Aa).source+"|"+(c.evaluate||Aa).source+"|$","g"),de="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++dT+"]")+`
|
|
`;a.replace(te,function(ve,$e,We,An,un,Mn){return We||(We=An),q+=a.slice(U,Mn).replace(US,OT),$e&&(M=!0,q+=`' +
|
|
__e(`+$e+`) +
|
|
'`),un&&(k=!0,q+=`';
|
|
`+un+`;
|
|
__p += '`),We&&(q+=`' +
|
|
((__t = (`+We+`)) == null ? '' : __t) +
|
|
'`),U=Mn+ve.length,ve}),q+=`';
|
|
`;var Ee=Ze.call(c,"variable")&&c.variable;if(!Ee)q=`with (obj) {
|
|
`+q+`
|
|
}
|
|
`;else if(IS.test(Ee))throw new Ae(o);q=(k?q.replace(xe,""):q).replace(qe,"$1").replace(Ue,"$1;"),q="function("+(Ee||"obj")+`) {
|
|
`+(Ee?"":`obj || (obj = {});
|
|
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(k?`, __j = Array.prototype.join;
|
|
function print() { __p += __j.call(arguments, '') }
|
|
`:`;
|
|
`)+q+`return __p
|
|
}`;var Le=iy(function(){return Ye(x,de+"return "+q).apply(t,C)});if(Le.source=q,Fd(Le))throw Le;return Le}function rk(a){return Xe(a).toLowerCase()}function ik(a){return Xe(a).toUpperCase()}function ok(a,c,p){if(a=Xe(a),a&&(p||c===t))return pg(a);if(!a||!(c=Tn(c)))return a;var g=Zn(a),E=Zn(c),x=hg(g,E),C=mg(g,E)+1;return si(g,x,C).join("")}function sk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.slice(0,bg(a)+1);if(!a||!(c=Tn(c)))return a;var g=Zn(a),E=mg(g,Zn(c))+1;return si(g,0,E).join("")}function ak(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.replace(Fu,"");if(!a||!(c=Tn(c)))return a;var g=Zn(a),E=hg(g,Zn(c));return si(g,E).join("")}function lk(a,c){var p=ee,g=z;if(dt(c)){var E="separator"in c?c.separator:E;p="length"in c?Oe(c.length):p,g="omission"in c?Tn(c.omission):g}a=Xe(a);var x=a.length;if(xo(a)){var C=Zn(a);x=C.length}if(p>=x)return a;var M=p-_o(g);if(M<1)return g;var k=C?si(C,0,M).join(""):a.slice(0,M);if(E===t)return k+g;if(C&&(M+=k.length-M),Hd(E)){if(a.slice(M).search(E)){var U,W=k;for(E.global||(E=td(E.source,Xe(Dm.exec(E))+"g")),E.lastIndex=0;U=E.exec(W);)var q=U.index;k=k.slice(0,q===t?M:q)}}else if(a.indexOf(Tn(E),M)!=M){var te=k.lastIndexOf(E);te>-1&&(k=k.slice(0,te))}return k+g}function ck(a){return a=Xe(a),a&&Jr.test(a)?a.replace(Bt,FT):a}var uk=No(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Ud=ob("toUpperCase");function ry(a,c,p){return a=Xe(a),c=p?t:c,c===t?IT(a)?zT(a):ST(a):a.match(c)||[]}var iy=He(function(a,c){try{return _n(a,t,c)}catch(p){return Fd(p)?p:new Ae(p)}}),dk=Mr(function(a,c){return On(c,function(p){p=fr(p),Cr(a,p,Pd(a[p],a))}),a});function fk(a){var c=a==null?0:a.length,p=ye();return a=c?at(a,function(g){if(typeof g[1]!="function")throw new Rn(i);return[p(g[0]),g[1]]}):[],He(function(g){for(var E=-1;++E<c;){var x=a[E];if(_n(x[0],this,g))return _n(x[1],this,g)}})}function pk(a){return F1(Ln(a,d))}function Wd(a){return function(){return a}}function hk(a,c){return a==null||a!==a?c:a}var mk=ab(),gk=ab(!0);function yn(a){return a}function Kd(a){return Bg(typeof a=="function"?a:Ln(a,d))}function bk(a){return Hg(Ln(a,d))}function yk(a,c){return $g(a,Ln(c,d))}var Ek=He(function(a,c){return function(p){return Cs(p,a,c)}}),vk=He(function(a,c){return function(p){return Cs(a,p,c)}});function Vd(a,c,p){var g=Ht(c),E=Ja(c,g);p==null&&!(dt(c)&&(E.length||!g.length))&&(p=c,c=a,a=this,E=Ja(c,Ht(c)));var x=!(dt(p)&&"chain"in p)||!!p.chain,C=kr(a);return On(E,function(M){var k=c[M];a[M]=k,C&&(a.prototype[M]=function(){var U=this.__chain__;if(x||U){var W=a(this.__wrapped__),q=W.__actions__=mn(this.__actions__);return q.push({func:k,args:arguments,thisArg:a}),W.__chain__=U,W}return k.apply(a,Qr([this.value()],arguments))})}),a}function wk(){return Ft._===this&&(Ft._=qT),this}function Gd(){}function xk(a){return a=Oe(a),He(function(c){return zg(c,a)})}var _k=_d(at),Sk=_d(lg),Tk=_d(Yu);function oy(a){return kd(a)?Ju(fr(a)):tC(a)}function Ck(a){return function(c){return a==null?t:Li(a,c)}}var Ak=cb(),Mk=cb(!0);function qd(){return[]}function Yd(){return!1}function Nk(){return{}}function kk(){return""}function Ok(){return!0}function Rk(a,c){if(a=Oe(a),a<1||a>_e)return[];var p=K,g=Zt(a,K);c=ye(c),a-=K;for(var E=ju(g,c);++p<a;)c(p);return E}function Ik(a){return Ne(a)?at(a,fr):Cn(a)?[a]:mn(Tb(Xe(a)))}function Lk(a){var c=++VT;return Xe(a)+c}var Dk=tl(function(a,c){return a+c},0),Pk=Sd("ceil"),Bk=tl(function(a,c){return a/c},1),Fk=Sd("floor");function Hk(a){return a&&a.length?Ya(a,yn,cd):t}function $k(a,c){return a&&a.length?Ya(a,ye(c,2),cd):t}function zk(a){return dg(a,yn)}function Uk(a,c){return dg(a,ye(c,2))}function Wk(a){return a&&a.length?Ya(a,yn,pd):t}function Kk(a,c){return a&&a.length?Ya(a,ye(c,2),pd):t}var Vk=tl(function(a,c){return a*c},1),Gk=Sd("round"),qk=tl(function(a,c){return a-c},0);function Yk(a){return a&&a.length?Zu(a,yn):0}function Jk(a,c){return a&&a.length?Zu(a,ye(c,2)):0}return v.after=bM,v.ary=Pb,v.assign=iN,v.assignIn=Xb,v.assignInWith=hl,v.assignWith=oN,v.at=sN,v.before=Bb,v.bind=Pd,v.bindAll=dk,v.bindKey=Fb,v.castArray=NM,v.chain=Ib,v.chunk=FC,v.compact=HC,v.concat=$C,v.cond=fk,v.conforms=pk,v.constant=Wd,v.countBy=YA,v.create=aN,v.curry=Hb,v.curryRight=$b,v.debounce=zb,v.defaults=lN,v.defaultsDeep=cN,v.defer=yM,v.delay=EM,v.difference=zC,v.differenceBy=UC,v.differenceWith=WC,v.drop=KC,v.dropRight=VC,v.dropRightWhile=GC,v.dropWhile=qC,v.fill=YC,v.filter=XA,v.flatMap=QA,v.flatMapDeep=eM,v.flatMapDepth=tM,v.flatten=Nb,v.flattenDeep=JC,v.flattenDepth=XC,v.flip=vM,v.flow=mk,v.flowRight=gk,v.fromPairs=ZC,v.functions=gN,v.functionsIn=bN,v.groupBy=nM,v.initial=QC,v.intersection=eA,v.intersectionBy=tA,v.intersectionWith=nA,v.invert=EN,v.invertBy=vN,v.invokeMap=iM,v.iteratee=Kd,v.keyBy=oM,v.keys=Ht,v.keysIn=bn,v.map=ll,v.mapKeys=xN,v.mapValues=_N,v.matches=bk,v.matchesProperty=yk,v.memoize=ul,v.merge=SN,v.mergeWith=Zb,v.method=Ek,v.methodOf=vk,v.mixin=Vd,v.negate=dl,v.nthArg=xk,v.omit=TN,v.omitBy=CN,v.once=wM,v.orderBy=sM,v.over=_k,v.overArgs=xM,v.overEvery=Sk,v.overSome=Tk,v.partial=Bd,v.partialRight=Ub,v.partition=aM,v.pick=AN,v.pickBy=jb,v.property=oy,v.propertyOf=Ck,v.pull=sA,v.pullAll=Ob,v.pullAllBy=aA,v.pullAllWith=lA,v.pullAt=cA,v.range=Ak,v.rangeRight=Mk,v.rearg=_M,v.reject=uM,v.remove=uA,v.rest=SM,v.reverse=Ld,v.sampleSize=fM,v.set=NN,v.setWith=kN,v.shuffle=pM,v.slice=dA,v.sortBy=gM,v.sortedUniq=yA,v.sortedUniqBy=EA,v.split=QN,v.spread=TM,v.tail=vA,v.take=wA,v.takeRight=xA,v.takeRightWhile=_A,v.takeWhile=SA,v.tap=HA,v.throttle=CM,v.thru=al,v.toArray=qb,v.toPairs=Qb,v.toPairsIn=ey,v.toPath=Ik,v.toPlainObject=Jb,v.transform=ON,v.unary=AM,v.union=TA,v.unionBy=CA,v.unionWith=AA,v.uniq=MA,v.uniqBy=NA,v.uniqWith=kA,v.unset=RN,v.unzip=Dd,v.unzipWith=Rb,v.update=IN,v.updateWith=LN,v.values=Ro,v.valuesIn=DN,v.without=OA,v.words=ry,v.wrap=MM,v.xor=RA,v.xorBy=IA,v.xorWith=LA,v.zip=DA,v.zipObject=PA,v.zipObjectDeep=BA,v.zipWith=FA,v.entries=Qb,v.entriesIn=ey,v.extend=Xb,v.extendWith=hl,Vd(v,v),v.add=Dk,v.attempt=iy,v.camelCase=HN,v.capitalize=ty,v.ceil=Pk,v.clamp=PN,v.clone=kM,v.cloneDeep=RM,v.cloneDeepWith=IM,v.cloneWith=OM,v.conformsTo=LM,v.deburr=ny,v.defaultTo=hk,v.divide=Bk,v.endsWith=$N,v.eq=Qn,v.escape=zN,v.escapeRegExp=UN,v.every=JA,v.find=ZA,v.findIndex=Ab,v.findKey=uN,v.findLast=jA,v.findLastIndex=Mb,v.findLastKey=dN,v.floor=Fk,v.forEach=Lb,v.forEachRight=Db,v.forIn=fN,v.forInRight=pN,v.forOwn=hN,v.forOwnRight=mN,v.get=$d,v.gt=DM,v.gte=PM,v.has=yN,v.hasIn=zd,v.head=kb,v.identity=yn,v.includes=rM,v.indexOf=jC,v.inRange=BN,v.invoke=wN,v.isArguments=Bi,v.isArray=Ne,v.isArrayBuffer=BM,v.isArrayLike=gn,v.isArrayLikeObject=yt,v.isBoolean=FM,v.isBuffer=ai,v.isDate=HM,v.isElement=$M,v.isEmpty=zM,v.isEqual=UM,v.isEqualWith=WM,v.isError=Fd,v.isFinite=KM,v.isFunction=kr,v.isInteger=Wb,v.isLength=fl,v.isMap=Kb,v.isMatch=VM,v.isMatchWith=GM,v.isNaN=qM,v.isNative=YM,v.isNil=XM,v.isNull=JM,v.isNumber=Vb,v.isObject=dt,v.isObjectLike=ht,v.isPlainObject=Rs,v.isRegExp=Hd,v.isSafeInteger=ZM,v.isSet=Gb,v.isString=pl,v.isSymbol=Cn,v.isTypedArray=Oo,v.isUndefined=jM,v.isWeakMap=QM,v.isWeakSet=eN,v.join=rA,v.kebabCase=WN,v.last=Pn,v.lastIndexOf=iA,v.lowerCase=KN,v.lowerFirst=VN,v.lt=tN,v.lte=nN,v.max=Hk,v.maxBy=$k,v.mean=zk,v.meanBy=Uk,v.min=Wk,v.minBy=Kk,v.stubArray=qd,v.stubFalse=Yd,v.stubObject=Nk,v.stubString=kk,v.stubTrue=Ok,v.multiply=Vk,v.nth=oA,v.noConflict=wk,v.noop=Gd,v.now=cl,v.pad=GN,v.padEnd=qN,v.padStart=YN,v.parseInt=JN,v.random=FN,v.reduce=lM,v.reduceRight=cM,v.repeat=XN,v.replace=ZN,v.result=MN,v.round=Gk,v.runInContext=N,v.sample=dM,v.size=hM,v.snakeCase=jN,v.some=mM,v.sortedIndex=fA,v.sortedIndexBy=pA,v.sortedIndexOf=hA,v.sortedLastIndex=mA,v.sortedLastIndexBy=gA,v.sortedLastIndexOf=bA,v.startCase=ek,v.startsWith=tk,v.subtract=qk,v.sum=Yk,v.sumBy=Jk,v.template=nk,v.times=Rk,v.toFinite=Or,v.toInteger=Oe,v.toLength=Yb,v.toLower=rk,v.toNumber=Bn,v.toSafeInteger=rN,v.toString=Xe,v.toUpper=ik,v.trim=ok,v.trimEnd=sk,v.trimStart=ak,v.truncate=lk,v.unescape=ck,v.uniqueId=Lk,v.upperCase=uk,v.upperFirst=Ud,v.each=Lb,v.eachRight=Db,v.first=kb,Vd(v,function(){var a={};return ur(v,function(c,p){Ze.call(v.prototype,p)||(a[p]=c)}),a}(),{chain:!1}),v.VERSION=e,On(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){v[a].placeholder=v}),On(["drop","take"],function(a,c){ze.prototype[a]=function(p){p=p===t?1:Rt(Oe(p),0);var g=this.__filtered__&&!c?new ze(this):this.clone();return g.__filtered__?g.__takeCount__=Zt(p,g.__takeCount__):g.__views__.push({size:Zt(p,K),type:a+(g.__dir__<0?"Right":"")}),g},ze.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),On(["filter","map","takeWhile"],function(a,c){var p=c+1,g=p==Se||p==Ce;ze.prototype[a]=function(E){var x=this.clone();return x.__iteratees__.push({iteratee:ye(E,3),type:p}),x.__filtered__=x.__filtered__||g,x}}),On(["head","last"],function(a,c){var p="take"+(c?"Right":"");ze.prototype[a]=function(){return this[p](1).value()[0]}}),On(["initial","tail"],function(a,c){var p="drop"+(c?"":"Right");ze.prototype[a]=function(){return this.__filtered__?new ze(this):this[p](1)}}),ze.prototype.compact=function(){return this.filter(yn)},ze.prototype.find=function(a){return this.filter(a).head()},ze.prototype.findLast=function(a){return this.reverse().find(a)},ze.prototype.invokeMap=He(function(a,c){return typeof a=="function"?new ze(this):this.map(function(p){return Cs(p,a,c)})}),ze.prototype.reject=function(a){return this.filter(dl(ye(a)))},ze.prototype.slice=function(a,c){a=Oe(a);var p=this;return p.__filtered__&&(a>0||c<0)?new ze(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==t&&(c=Oe(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},ze.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},ze.prototype.toArray=function(){return this.take(K)},ur(ze.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),g=/^(?:head|last)$/.test(c),E=v[g?"take"+(c=="last"?"Right":""):c],x=g||/^find/.test(c);E&&(v.prototype[c]=function(){var C=this.__wrapped__,M=g?[1]:arguments,k=C instanceof ze,U=M[0],W=k||Ne(C),q=function($e){var We=E.apply(v,Qr([$e],M));return g&&te?We[0]:We};W&&p&&typeof U=="function"&&U.length!=1&&(k=W=!1);var te=this.__chain__,de=!!this.__actions__.length,Ee=x&&!te,Le=k&&!de;if(!x&&W){C=Le?C:new ze(this);var ve=a.apply(C,M);return ve.__actions__.push({func:al,args:[q],thisArg:t}),new In(ve,te)}return Ee&&Le?a.apply(this,M):(ve=this.thru(q),Ee?g?ve.value()[0]:ve.value():ve)})}),On(["pop","push","shift","sort","splice","unshift"],function(a){var c=Ia[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",g=/^(?:pop|shift)$/.test(a);v.prototype[a]=function(){var E=arguments;if(g&&!this.__chain__){var x=this.value();return c.apply(Ne(x)?x:[],E)}return this[p](function(C){return c.apply(Ne(C)?C:[],E)})}}),ur(ze.prototype,function(a,c){var p=v[c];if(p){var g=p.name+"";Ze.call(Co,g)||(Co[g]=[]),Co[g].push({name:c,func:p})}}),Co[el(t,w).name]=[{name:"wrapper",func:t}],ze.prototype.clone=c1,ze.prototype.reverse=u1,ze.prototype.value=d1,v.prototype.at=$A,v.prototype.chain=zA,v.prototype.commit=UA,v.prototype.next=WA,v.prototype.plant=VA,v.prototype.reverse=GA,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=qA,v.prototype.first=v.prototype.head,Es&&(v.prototype[Es]=KA),v},ti=UT();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ft._=ti,define(function(){return ti})):Ni?((Ni.exports=ti)._=ti,Ku._=ti):Ft._=ti}).call(ms)});function Qt(t){this.content=t}Qt.prototype={constructor:Qt,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 e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new Qt(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Qt(n)},addToStart:function(t,e){return new Qt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Qt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new Qt(i)},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=Qt.from(t),t.size?new Qt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Qt.from(t),t.size?new Qt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Qt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Qt.from=function(t){if(t instanceof Qt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Qt(e)};var Zd=Qt;function by(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=by(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function yy(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),u=s.nodeSize;if(s==l){n-=u,r-=u;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,f=Math.min(s.text.length,l.text.length);for(;d<f&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=yy(s.content,l.content,n-1,r-1);if(d)return d}n-=u,r-=u}}var G=class t{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let u=this.content[s],d=l+u.nodeSize;if(d>e&&r(u,i+l,o||null,s)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,i+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new t(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],u=s+l.nodeSize;u>e&&((s<e||u>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=u}return new t(r,i)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return by(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return yy(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ml(0,e);if(e==this.size)return ml(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ml(r+1,s):ml(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new t(n||e,r)}static from(e){if(!e)return t.empty;if(e instanceof t)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};G.empty=new G([],0);var jd={index:0,offset:0};function ml(t,e){return jd.index=t,jd.offset=e,jd}function bl(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))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 r=0;r<t.length;r++)if(!bl(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!bl(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}var Ge=class t{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&bl(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return t.none;if(e instanceof t)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Ge.none=[];var $i=class extends Error{},Z=class t{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=vy(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(Ey(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return t.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(G.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new t(e,r,i)}};Z.empty=new Z(G.empty,0,0);function Ey(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=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,o.copy(Ey(o.content,e-i-1,n-i-1)))}function vy(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=vy(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function nO(t,e,n){if(n.openStart>t.depth)throw new $i("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new $i("Inconsistent open depths");return wy(t,e,n,0)}function wy(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=wy(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return Hi(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=rO(n,t);return Hi(o,_y(t,s,l,e,r))}else return Hi(o,yl(t,e,r))}function xy(t,e){if(!e.type.compatibleContent(t.type))throw new $i("Cannot join "+e.type.name+" onto "+t.type.name)}function ef(t,e,n){let r=t.node(n);return xy(r,e.node(n)),r}function Fi(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 Is(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Fi(t.nodeAfter,r),o++));for(let l=o;l<s;l++)Fi(i.child(l),r);e&&e.depth==n&&e.textOffset&&Fi(e.nodeBefore,r)}function Hi(t,e){return t.type.checkContent(e),t.copy(e)}function _y(t,e,n,r,i){let o=t.depth>i&&ef(t,e,i+1),s=r.depth>i&&ef(n,r,i+1),l=[];return Is(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(xy(o,s),Fi(Hi(o,_y(t,e,n,r,i+1)),l)):(o&&Fi(Hi(o,yl(t,e,i+1)),l),Is(e,n,i,l),s&&Fi(Hi(s,yl(n,r,i+1)),l)),Is(r,null,i,l),new G(l)}function yl(t,e,n){let r=[];if(Is(null,t,n,r),t.depth>n){let i=ef(t,e,n+1);Fi(Hi(i,yl(t,e,n+1)),r)}return Is(e,null,n,r),new G(r)}function rO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(G.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var El=class t{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ge.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new zi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:u}=s.content.findIndex(o),d=o-u;if(r.push(s,l,i+u),!d||(s=s.child(l),s.isText))break;o=d-1,i+=u+1}return new t(n,r,o)}static resolveCached(e,n){let r=ly.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else ly.set(e,r=new tf);let i=r.elts[r.i]=t.resolve(e,n);return r.i=(r.i+1)%iO,i}},tf=class{constructor(){this.elts=[],this.i=0}},iO=12,ly=new WeakMap,zi=class{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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)}},oO=Object.create(null),tr=class t{constructor(e,n,r,i=Ge.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||G.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&bl(this.attrs,n||e.defaultAttrs||oO)&&Ge.sameSet(this.marks,r||Ge.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(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Z.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new Z(d,i.depth-s,o.depth-s)}replace(e,n,r){return nO(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return El.resolveCached(this,e)}resolveNoCache(e){return El.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Sy(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=G.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;u<o;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ge.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ge.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=G.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};tr.prototype.text=void 0;var nf=class t extends tr{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Sy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Sy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var Ui=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new rf(e,n);if(r.next==null)return t.empty;let i=Ty(r);r.next&&r.err("Unexpected trailing text");let o=fO(dO(i));return pO(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,l){let u=s.matchFragment(e,r);if(u&&(!n||u.validEnd))return G.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:f,next:h}=s.next[d];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let m=o(h,l.concat(f));if(m)return m}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:u}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||u.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
`)}};Ui.empty=new Ui(!0);var rf=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function Ty(t){let e=[];do e.push(sO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function sO(t){let e=[];do e.push(aO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function aO(t){let e=uO(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("{"))e=lO(t,e);else break;return e}function cy(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function lO(t,e){let n=cy(t),r=n;return t.eat(",")&&(t.next!="}"?r=cy(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function cO(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function uO(t){if(t.eat("(")){let e=Ty(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=cO(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function dO(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,u){let d={term:u,to:l};return e[s].push(d),d}function i(s,l){s.forEach(u=>u.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((u,d)=>u.concat(o(d,l)),[]);if(s.type=="seq")for(let u=0;;u++){let d=o(s.exprs[u],l);if(u==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let u=n();return r(l,u),i(o(s.expr,u),u),[r(u)]}else if(s.type=="plus"){let u=n();return i(o(s.expr,l),u),i(o(s.expr,u),u),[r(u)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let u=l;for(let d=0;d<s.min;d++){let f=n();i(o(s.expr,u),f),u=f}if(s.max==-1)i(o(s.expr,u),u);else for(let d=s.min;d<s.max;d++){let f=n();r(u,f),i(o(s.expr,u),f),u=f}return[r(u)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Cy(t,e){return e-t}function uy(t,e){let n=[];return r(e),n.sort(Cy);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:u}=o[s];!l&&n.indexOf(u)==-1&&r(u)}}}function fO(t){let e=Object.create(null);return n(uy(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let f=0;f<i.length;f++)i[f][0]==l&&(d=i[f][1]);uy(t,u).forEach(f=>{d||i.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let o=e[r.join(",")]=new Ui(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(Cy);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function pO(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:u,next:d}=i.next[l];s.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ay(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 My(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Ny(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function ky(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new of(t,r,e[r]);return n}var vl=class t{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ky(e,r.attrs),this.defaultAttrs=Ay(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ui.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:My(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new tr(this,this.computeAttrs(e),G.from(n),Ge.setFrom(r))}createChecked(e=null,n,r){return n=G.from(n),this.checkContent(n),new tr(this,this.computeAttrs(e),n,Ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=G.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(G.empty,!0);return o?new tr(this,e,n.append(o),Ge.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ny(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ge.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new t(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function hO(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}var of=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?hO(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},Ds=class t{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=ky(e,i.attrs),this.excluded=null;let o=Ay(this.attrs);this.instance=o?new Ge(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ge(this,My(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new t(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Ny(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Ps=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Zd.from(e.nodes),n.marks=Zd.from(e.marks||{}),this.nodes=vl.compile(this.spec.nodes,this),this.marks=Ds.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Ui.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?dy(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:dy(this,s.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(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof vl){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new nf(r,r.defaultAttrs,e,Ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return tr.fromJSON(this,e)}markFromJSON(e){return Ge.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function dy(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let l in t.marks){let u=t.marks[l];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function mO(t){return t.tag!=null}function gO(t){return t.style!=null}var Ir=class t{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(mO(i))this.tags.push(i);else if(gO(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new _l(this,n,!1);return r.addAll(e,Ge.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new _l(this,n,!0);return r.addAll(e,Ge.none,n.from,n.to),Z.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(EO(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let u=s.getAttrs(n);if(u===!1)continue;s.attrs=u||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=py(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=py(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}},Oy={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},bO={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ry={ol:!0,ul:!0},wl=1,xl=2,Ls=4;function fy(t,e,n){return e!=null?(e?wl:0)|(e==="full"?xl:0):t&&t.whitespace=="pre"?wl|xl:n&~Ls}var Io=class{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ge.none,this.match=o||(s&Ls?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(G.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&wl)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=G.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(G.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Oy.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},_l=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=fy(null,n.preserveWhitespace,0)|(r?Ls:0);i?o=new Io(i.type,i.attrs,Ge.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Io(null,null,Ge.none,!0,null,s):o=new Io(e.schema.topNodeType,null,Ge.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top;if(i.options&xl||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&wl)i.options&xl?r=r.replace(/\r\n?/g,`
|
|
`):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=e.nodeName.toLowerCase(),o;Ry.hasOwnProperty(i)&&this.parser.normalizeLists&&yO(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));if(s?s.ignore:bO.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let l,u=this.top,d=this.needsBlock;if(Oy.hasOwnProperty(i))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),l=!0,u.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);return}let f=s&&s.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),l&&this.sync(u),this.needsBlock=d}else{let l=this.readStyles(e,n);l&&this.addElementByRule(e,s,l,s.consuming===!1?o:void 0)}}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let u=this.parser.matchStyle(o,s,this,l);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(d=>!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let u=this.enter(s,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=Ge.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):hy(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=fy(e,o,s.options);s.options&Ls&&s.content.length==0&&(l|=Ls);let u=Ge.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):hy(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Io(e,n,u,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));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(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=o;u--)if(s(l-1,u))return!0;return!1}else{let f=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!f||f.name!=d&&f.groups.indexOf(d)==-1)return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function yO(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ry.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function EO(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function py(t){let e={};for(let n in t)e[n]=t[n];return e}function hy(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let u=0;u<l.edgeCount;u++){let{type:d,next:f}=l.edge(u);if(d==e||o.indexOf(f)<0&&s(f))return!0}};if(s(i.contentMatch))return!0}}var Lr=class t{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Qd(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,u=0;for(;l<o.length&&u<s.marks.length;){let d=s.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,u++}for(;l<o.length;)i=o.pop()[1];for(;u<s.marks.length;){let d=s.marks[u++],f=this.serializeMark(d,s.isInline,n);f&&(o.push([d,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=gl(Qd(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&gl(Qd(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return gl(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=my(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return my(e.marks)}};function my(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Qd(t){return t.document||window.document}var gy=new WeakMap;function vO(t){let e=gy.get(t);return e===void 0&&gy.set(t,e=wO(t)),e}function wO(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function gl(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=vO(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,u=n?t.createElementNS(n,i):t.createElement(i),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):u.setAttribute(h,d[h])}}for(let h=f;h<e.length;h++){let m=e[h];if(m===0){if(h<e.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:y,contentDOM:b}=gl(t,m,n,r);if(u.appendChild(y),b){if(l)throw new RangeError("Multiple content holes");l=b}}}return{dom:u,contentDOM:l}}var Dy=65535,Py=Math.pow(2,16);function xO(t,e){return t+e*Py}function Iy(t){return t&Dy}function _O(t){return(t-(t&Dy))/Py}var By=1,Fy=2,Sl=4,Hy=8,Hs=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Hy)>0}get deletedBefore(){return(this.delInfo&(By|Sl))>0}get deletedAfter(){return(this.delInfo&(Fy|Sl))>0}get deletedAcross(){return(this.delInfo&Sl)>0}},Dr=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=Iy(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+_O(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?i:0);if(u>e)break;let d=this.ranges[l+o],f=this.ranges[l+s],h=u+d;if(e<=h){let m=d?e==u?-1:e==h?1:n:n,y=u+i+(m<0?0:f);if(r)return y;let b=e==(n<0?u:h)?null:xO(l/3,e-u),w=e==u?Fy:e==h?By:Sl;return(n<0?e!=u:e!=h)&&(w|=Hy),new Hs(y,w,b)}i+=f-d}return r?e+i:new Hs(e+i,0,null)}touches(e,n){let r=0,i=Iy(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?r:0);if(u>e)break;let d=this.ranges[l+o],f=u+d;if(e<=f&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),u=s+(this.inverted?0:o),d=this.ranges[i+n],f=this.ranges[i+r];e(l,l+d,u,u+f),o+=f-d}}invert(){return new t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?t.empty:new t(e<0?[0,-e,0]:[0,0,e])}};Dr.empty=new Dr([]);var $s=class t{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new t(this.maps,this.mirror,e,n)}copy(){return new t(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],l=s.mapResult(e,n);if(l.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,e=this.maps[u].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Hs(e,i,null)}},sf=Object.create(null),$t=class{getMap(){return Dr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=sf[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in sf)throw new RangeError("Duplicate use of step JSON ID "+e);return sf[e]=n,n.prototype.jsonID=e,n}},Vt=class t{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new t(e,null)}static fail(e){return new t(null,e)}static fromReplace(e,n,r,i){try{return t.ok(e.replace(n,r,i))}catch(o){if(o instanceof $i)return t.fail(o.message);throw o}}};function df(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(df(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return G.fromArray(r)}var zs=class t extends $t{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new Z(df(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Vt.fromReplace(e,this.from,this.to,o)}invert(){return new Wi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};$t.jsonID("addMark",zs);var Wi=class t extends $t{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Z(df(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Vt.fromReplace(e,this.from,this.to,r)}invert(){return new zs(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};$t.jsonID("removeMark",Wi);var Us=class t extends $t{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new Z(G.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new t(this.pos,n.marks[i]);return new t(this.pos,this.mark)}}return new Ws(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new t(n.pos,e.markFromJSON(n.mark))}};$t.jsonID("addNodeMark",Us);var Ws=class t extends $t{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new Z(G.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Us(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new t(n.pos,e.markFromJSON(n.mark))}};$t.jsonID("removeNodeMark",Ws);var en=class t extends $t{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&cf(e,this.from,this.to)?Vt.fail("Structure replace would overwrite content"):Vt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Dr([this.from,this.to-this.from,this.slice.size])}invert(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?Z.empty:new Z(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?Z.empty:new Z(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,Z.fromJSON(e,n.slice),!!n.structure)}};$t.jsonID("replace",en);var St=class t extends $t{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(cf(e,this.from,this.gapFrom)||cf(e,this.gapTo,this.to)))return Vt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Vt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Vt.fromReplace(e,this.from,this.to,r):Vt.fail("Content does not fit in gap")}getMap(){return new Dr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(e,n.slice),n.insert,!!n.structure)}};$t.jsonID("replaceAround",St);function cf(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function SO(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(u,d,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,e),y=Math.min(d+u.nodeSize,n),b=r.addToSet(h);for(let w=0;w<h.length;w++)h[w].isInSet(b)||(s&&s.to==m&&s.mark.eq(h[w])?s.to=y:i.push(s=new Wi(m,y,h[w])));l&&l.to==m?l.to=y:o.push(l=new zs(m,y,r))}}),i.forEach(u=>t.step(u)),o.forEach(u=>t.step(u))}function TO(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Ds){let d=s.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let d=Math.min(l+s.nodeSize,n);for(let f=0;f<u.length;f++){let h=u[f],m;for(let y=0;y<i.length;y++){let b=i[y];b.step==o-1&&h.eq(i[y].style)&&(m=b)}m?(m.to=d,m.step=o):i.push({style:h,from:Math.max(l,e),to:d,step:o})}}}),i.forEach(s=>t.step(new Wi(s.from,s.to,s.style)))}function $y(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let u=0;u<o.childCount;u++){let d=o.child(u),f=l+d.nodeSize,h=r.matchType(d.type);if(!h)s.push(new en(l,f,Z.empty));else{r=h;for(let m=0;m<d.marks.length;m++)n.allowsMarkType(d.marks[m].type)||t.step(new Wi(l,f,d.marks[m]));if(i&&d.isText&&n.whitespace!="pre"){let m,y=/\r?\n|\r/g,b;for(;m=y.exec(d.text);)b||(b=new Z(G.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new en(l+m.index,l+m.index+m[0].length,b))}}l=f}if(!r.validEnd){let u=r.fillBefore(G.empty,!0);t.replace(l,l,new Z(u,0,0))}for(let u=s.length-1;u>=0;u--)t.step(s[u])}function CO(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Pr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!CO(i,o,s))break}return null}function AO(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),u=s,d=l,f=G.empty,h=0;for(let b=o,w=!1;b>n;b--)w||r.index(b)>0?(w=!0,f=G.from(r.node(b).copy(f)),h++):u--;let m=G.empty,y=0;for(let b=o,w=!1;b>n;b--)w||i.after(b+1)<i.end(b)?(w=!0,m=G.from(i.node(b).copy(m)),y++):d++;t.step(new St(u,d,s,l,new Z(f.append(m),h,y),f.size-h,!0))}function Do(t,e,n=null,r=t){let i=MO(t,e),o=i&&NO(r,e);return o?i.map(Ly).concat({type:e,attrs:n}).concat(o.map(Ly)):null}function Ly(t){return{type:t,attrs:null}}function MO(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function NO(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let u=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;u&&d<i;d++)u=u.matchType(n.child(d).type);return!u||!u.validEnd?null:s}function kO(t,e,n){let r=G.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=G.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new St(i,o,i,o,new Z(r,0,0),n.length,!0))}function OO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let u=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,u)&&LO(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let y=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);y&&!b?d=!1:!y&&b&&(d=!0)}d===!1&&IO(t,s,l,o),$y(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let f=t.mapping.slice(o),h=f.map(l,1),m=f.map(l+s.nodeSize,1);return t.step(new St(h,m,h+1,m-1,new Z(G.from(r.create(u,null,s.marks)),0,0),1,!0)),d===!0&&RO(t,s,l,o),!1}})}function RO(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let u=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function IO(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
`))}})}function LO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function DO(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new St(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Z(G.from(s),0,0),1,!0))}function Fn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,f=n-2;d>o;d--,f--){let h=i.node(d),m=i.index(d);if(h.type.spec.isolating)return!1;let y=h.content.cutByIndex(m,h.childCount),b=r&&r[f+1];b&&(y=y.replaceChild(0,b.type.create(b.attrs)));let w=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!w.type.validContent(y))return!1}let l=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(l,l,u?u.type:i.node(o+1).type)}function PO(t,e,n=1,r){let i=t.doc.resolve(e),o=G.empty,s=G.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){o=G.from(i.node(l).copy(o));let f=r&&r[d];s=G.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new en(e,e,new Z(o.append(s),n,n),!0))}function nr(t,e){let n=t.resolve(e),r=n.index();return zy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zy(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Po(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&zy(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function BO(t,e,n){let r=new en(e-n,e+n,Z.empty,!0);t.step(r)}function FO(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Al(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),d=r.node(s),f=!1;if(o==1)f=d.canReplace(u,u,i);else{let h=d.contentMatchAt(u).findWrapping(i.firstChild.type);f=h&&d.canReplaceWith(u,u,h[0])}if(f)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Ks(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Uy(i,o,r)?new en(e,n,r):new uf(i,o,r).fit()}function Uy(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var uf=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=G.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=G.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let u=new Z(o,s,l);return e>-1?new St(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new en(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=af(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],f,h=null;if(n==1&&(s?d.matchType(s.type)||(h=d.fillBefore(G.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:h};if(n==2&&s&&(f=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=af(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=af(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Z(Bs(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Bs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let w=0;w<o.length;w++)this.openFrontierNode(o[w]);let s=this.unplaced,l=r?r.content:s.content,u=s.openStart-e,d=0,f=[],{match:h,type:m}=this.frontier[n];if(i){for(let w=0;w<i.childCount;w++)f.push(i.child(w));h=h.matchFragment(i)}let y=l.size+e-(s.content.size-s.openEnd);for(;d<l.childCount;){let w=l.child(d),_=h.matchType(w.type);if(!_)break;d++,(d>1||u==0||w.content.size)&&(h=_,f.push(Wy(w.mark(m.allowedMarks(w.marks)),d==1?u:0,d==l.childCount?y:-1)))}let b=d==l.childCount;b||(y=-1),this.placed=Fs(this.placed,n,G.from(f)),this.frontier[n].match=h,b&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,_=l;w<y;w++){let S=_.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),_=S.content}this.unplaced=b?e==0?Z.empty:new Z(Bs(s.content,e-1,1),e-1,y<0?s.openEnd:e-1):new Z(Bs(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!lf(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=lf(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:u,type:d}=this.frontier[l],f=lf(e,l,d,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Fs(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Fs(this.placed,this.depth,G.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(G.empty,!0);n.childCount&&(this.placed=Fs(this.placed,this.frontier.length,n))}};function Bs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Bs(t.firstChild.content,e-1,n)))}function Fs(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Fs(t.lastChild.content,e-1,n)))}function af(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Wy(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Wy(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(G.empty,!0)))),t.copy(r)}function lf(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!HO(n,o.content,s)?l:null}function HO(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function $O(t){return t.spec.defining||t.spec.definingForContent}function zO(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Uy(i,o,r))return t.step(new en(e,n,r));let s=Vy(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let m=i.depth,y=i.pos-1;m>0;m--,y--){let b=i.node(m).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;s.indexOf(m)>-1?l=m:i.before(m)==y&&s.splice(1,0,-m)}let u=s.indexOf(l),d=[],f=r.openStart;for(let m=r.content,y=0;;y++){let b=m.firstChild;if(d.push(b),y==r.openStart)break;m=b.content}for(let m=f-1;m>=0;m--){let y=d[m],b=$O(y.type);if(b&&!y.sameMarkup(i.node(Math.abs(l)-1)))f=m;else if(b||!y.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let y=(m+f+1)%(r.openStart+1),b=d[y];if(b)for(let w=0;w<s.length;w++){let _=s[(w+u)%s.length],S=!0;_<0&&(S=!1,_=-_);let D=i.node(_-1),L=i.index(_-1);if(D.canReplaceWith(L,L,b.type,b.marks))return t.replace(i.before(_),S?o.after(_):n,new Z(Ky(r.content,0,r.openStart,y),y,r.openEnd))}}let h=t.steps.length;for(let m=s.length-1;m>=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let y=s[m];y<0||(e=i.before(y),n=o.after(y))}}function Ky(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Ky(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(G.empty,!0))}return t}function UO(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=FO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(G.from(r),0,0))}function WO(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Vy(r,i);for(let s=0;s<o.length;s++){let l=o[s],u=s==o.length-1;if(u&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function Vy(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var Tl=class t extends $t{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Vt.fromReplace(e,this.pos,this.pos+1,new Z(G.from(i),0,n.isLeaf?0:1))}getMap(){return Dr.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}};$t.jsonID("attr",Tl);var Cl=class t extends $t{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Vt.ok(r)}getMap(){return Dr.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}};$t.jsonID("docAttr",Cl);var Lo=class extends Error{};Lo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Lo.prototype=Object.create(Error.prototype);Lo.prototype.constructor=Lo;Lo.prototype.name="TransformError";var li=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new $s}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Lo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Z.empty){let i=Ks(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(G.from(r),0,0))}delete(e,n){return this.replace(e,n,Z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return zO(this,e,n,r),this}replaceRangeWith(e,n,r){return UO(this,e,n,r),this}deleteRange(e,n){return WO(this,e,n),this}lift(e,n){return AO(this,e,n),this}join(e,n=1){return BO(this,e,n),this}wrap(e,n){return kO(this,e,n),this}setBlockType(e,n=e,r,i=null){return OO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return DO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Tl(e,n,r)),this}setDocAttribute(e,n){return this.step(new Cl(e,n)),this}addNodeMark(e,n){return this.step(new Us(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ws(e,n)),this}split(e,n=1,r){return PO(this,e,n,r),this}addMark(e,n,r){return SO(this,e,n,r),this}removeMark(e,n,r){return TO(this,e,n,r),this}clearIncompatible(e,n,r){return $y(this,e,n,r),this}};var ff=Object.create(null),ue=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Fo(e.min(n),e.max(n))]}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 e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=Z.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:u,$to:d}=s[l],f=e.mapping.slice(o);e.replaceRange(f.map(u.pos),f.map(d.pos),l?Z.empty:n),l==0&&Yy(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],u=e.mapping.slice(r),d=u.map(s.pos),f=u.map(l.pos);o?e.deleteRange(d,f):(e.replaceRangeWith(d,f,n),Yy(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ce(e):Bo(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Bo(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Bo(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Nn(e.node(0))}static atStart(e){return Bo(e,e,0,0,1)||new Nn(e)}static atEnd(e){return Bo(e,e,e.content.size,e.childCount,-1)||new Nn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ff[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in ff)throw new RangeError("Duplicate use of selection JSON ID "+e);return ff[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}};ue.prototype.visible=!0;var Fo=class{constructor(e,n){this.$from=e,this.$to=n}},Gy=!1;function qy(t){!Gy&&!t.parent.inlineContent&&(Gy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var ce=class t extends ue{constructor(e,n=e){qy(e),qy(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ue.near(r);let i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}replace(e,n=Z.empty){if(super.replace(e,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Nl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new t(e,n)}};ue.jsonID("text",ce);var Nl=class t{constructor(e,n){this.anchor=e,this.head=n}map(e){return new t(e.map(this.anchor),e.map(this.head))}resolve(e){return ce.between(e.resolve(this.anchor),e.resolve(this.head))}},pe=class t extends ue{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?ue.near(o):new t(o)}content(){return new Z(G.from(this.node),0,0)}eq(e){return e instanceof t&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new hf(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))}static create(e,n){return new t(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};pe.prototype.visible=!1;ue.jsonID("node",pe);var hf=class t{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Nl(r,r):new t(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&pe.isSelectable(r)?new pe(n):ue.near(n)}},Nn=class t extends ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Z.empty){if(n==Z.empty){e.delete(0,e.doc.content.size);let r=ue.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new t(e)}map(e){return new t(e)}eq(e){return e instanceof t}getBookmark(){return KO}};ue.jsonID("all",Nn);var KO={map(){return this},resolve(t){return new Nn(t)}};function Bo(t,e,n,r,i,o=!1){if(e.inlineContent)return ce.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&pe.isSelectable(l))return pe.create(t,n-(i<0?l.nodeSize:0))}else{let u=Bo(t,l,n+i,i<0?l.childCount:0,i,o);if(u)return u}n+=l.nodeSize*i}return null}function Yy(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof en||i instanceof St))return;let o=t.mapping.maps[r],s;o.forEach((l,u,d,f)=>{s==null&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var Jy=1,Ml=2,Xy=4,mf=class extends li{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Jy)&~Ml,this.storedMarks=null,this}get selectionSet(){return(this.updated&Jy)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ml,this}ensureMarks(e){return Ge.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ml)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ml,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Xy,this}get scrolledIntoView(){return(this.updated&Xy)>0}};function Zy(t,e){return!e||!t?t:t.bind(e)}var Ki=class{constructor(e,n,r){this.name=e,this.init=Zy(n.init,r),this.apply=Zy(n.apply,r)}},VO=[new Ki("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ki("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new Ki("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ki("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],Vs=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=VO.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ki(r.key,r.spec.state,r))})}},kl=class t{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let u=i?i[s].n:0,d=i?i[s].state:this,f=u<n.length&&l.spec.appendTransaction.call(l,u?n.slice(u):n,d,r);if(f&&r.filterTransaction(f,s)){if(f.setMeta("appendedTransaction",e),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<s?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new t(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new mf(this)}static create(e){let n=new Vs(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new t(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Vs(this.schema,e.plugins),r=n.fields,i=new t(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Vs(e.schema,e.plugins),o=new t(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=tr.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],d=u.spec.state;if(u.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(u,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}};function jy(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=jy(i,e,{})),n[r]=i}return n}var De=class{constructor(e){this.spec=e,this.props={},e.props&&jy(e.props,this,this.props),this.key=e.key?e.key.key:Qy("plugin")}getState(e){return e[this.key]}},pf=Object.create(null);function Qy(t){return t in pf?t+"$"+ ++pf[t]:(pf[t]=0,t+"$")}var Ke=class{constructor(e="key"){this.key=Qy(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var Gt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Js=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},vf=null,Fr=function(t,e,n){let r=vf||(vf=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},GO=function(){vf=null},Zi=function(t,e,n,r){return n&&(e0(t,e,n,r,-1)||e0(t,e,n,r,1))},qO=/^(img|br|input|textarea|hr)$/i;function e0(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:$n(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Qs(t)||qO.test(t.nodeName)||t.contentEditable=="false")return!1;e=Gt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?$n(t):0}else return!1}}function $n(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function YO(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=$n(t)}else if(t.parentNode&&!Qs(t))e=Gt(t),t=t.parentNode;else return null}}function JO(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Qs(t))e=Gt(t)+1,t=t.parentNode;else return null}}function XO(t,e,n){for(let r=e==0,i=e==$n(t);r||i;){if(t==n)return!0;let o=Gt(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==$n(t)}}function Qs(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)}var zl=function(t){return t.focusNode&&Zi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Vi(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function ZO(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jO(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min($n(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min($n(r.startContainer),r.startOffset)}}}var pr=typeof navigator<"u"?navigator:null,t0=typeof document<"u"?document:null,hi=pr&&pr.userAgent||"",wf=/Edge\/(\d+)/.exec(hi),I0=/MSIE \d/.exec(hi),xf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hi),En=!!(I0||xf||wf),fi=I0?document.documentMode:xf?+xf[1]:wf?+wf[1]:0,ir=!En&&/gecko\/(\d+)/i.test(hi);ir&&+(/Firefox\/(\d+)/.exec(hi)||[0,0])[1];var _f=!En&&/Chrome\/(\d+)/.exec(hi),nn=!!_f,L0=_f?+_f[1]:0,dn=!En&&!!pr&&/Apple Computer/.test(pr.vendor),Wo=dn&&(/Mobile\/\w+/.test(hi)||!!pr&&pr.maxTouchPoints>2),Hn=Wo||(pr?/Mac/.test(pr.platform):!1),QO=pr?/Win/.test(pr.platform):!1,rr=/Android \d/.test(hi),ea=!!t0&&"webkitFontSmoothing"in t0.documentElement.style,eR=ea?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tR(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Br(t,e){return typeof t=="number"?t:t[e]}function nR(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function n0(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Js(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,d=u?tR(o):nR(l),f=0,h=0;if(e.top<d.top+Br(r,"top")?h=-(d.top-e.top+Br(i,"top")):e.bottom>d.bottom-Br(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+Br(i,"top")-d.top:e.bottom-d.bottom+Br(i,"bottom")),e.left<d.left+Br(r,"left")?f=-(d.left-e.left+Br(i,"left")):e.right>d.right-Br(r,"right")&&(f=e.right-d.right+Br(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let m=l.scrollLeft,y=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let b=l.scrollLeft-m,w=l.scrollTop-y;e={left:e.left-b,top:e.top-w,right:e.right-b,bottom:e.bottom-w}}if(u||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function rR(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(o,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let u=l.getBoundingClientRect();if(u.top>=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:D0(t.dom)}}function D0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Js(r));return e}function iR({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;P0(n,r==0?0:r-e)}function P0(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}var Ho=null;function oR(t){if(t.setActive)return t.setActive();if(Ho)return t.focus(Ho);let e=D0(t);t.focus(Ho==null?{get preventScroll(){return Ho={preventScroll:!0},!0}}:void 0),Ho||(Ho=!1,P0(e,0))}function B0(t,e){let n,r=2e8,i,o=0,s=e.top,l=e.top,u,d;for(let f=t.firstChild,h=0;f;f=f.nextSibling,h++){let m;if(f.nodeType==1)m=f.getClientRects();else if(f.nodeType==3)m=Fr(f).getClientRects();else continue;for(let y=0;y<m.length;y++){let b=m[y];if(b.top<=s&&b.bottom>=l){s=Math.max(b.bottom,s),l=Math.min(b.top,l);let w=b.left>e.left?b.left-e.left:b.right<e.left?e.left-b.right:0;if(w<r){n=f,r=w,i=w&&n.nodeType==3?{left:b.right<e.left?b.right:b.left,top:e.top}:e,f.nodeType==1&&w&&(o=h+(e.left>=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!u&&b.left<=e.left&&b.right>=e.left&&(u=f,d={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?sR(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:B0(n,i)}function sR(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=ci(r,1);if(o.top!=o.bottom&&Hf(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Hf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function aR(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function lR(t,e,n){let{node:r,offset:i}=B0(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function cR(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)){let u=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&u.left>r.left||u.top>r.top?i=l.posBefore:(!s&&u.right<r.left||u.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText)return(l.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?l.posBefore:l.posAfter}o=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function F0(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let l=s.getClientRects();for(let u=0;u<l.length;u++){let d=l[u];if(Hf(e,d))return F0(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function uR(t,e){let n=t.dom.ownerDocument,r,i=0,o=jO(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!Hf(e,d)||(s=F0(t.dom,e,d),!s))return null}if(dn)for(let d=s;r&&d;d=Js(d))d.draggable&&(r=void 0);if(s=aR(s,e),r){if(ir&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let f=r.childNodes[i],h;f.nodeName=="IMG"&&(h=f.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&i++}let d;ea&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=cR(t,r,i,e))}l==null&&(l=lR(t,s,e));let u=t.docView.nearestDesc(s,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function r0(t){return t.top<t.bottom||t.left<t.right}function ci(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(r0(r))return r}return Array.prototype.find.call(n,r0)||t.getBoundingClientRect()}var dR=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function H0(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=ea||ir;if(r.nodeType==3)if(s&&(dR.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let u=ci(Fr(r,i,i),n);if(ir&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=ci(Fr(r,i-1,i-1),-1);if(d.top==u.top){let f=ci(Fr(r,i,i+1),-1);if(f.top!=u.top)return Gs(f,f.left<d.left)}}return u}else{let u=i,d=i,f=n<0?1:-1;return n<0&&!i?(d++,f=-1):n>=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,Gs(ci(Fr(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==$n(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return gf(u.getBoundingClientRect(),!1)}if(o==null&&i<$n(r)){let u=r.childNodes[i];if(u.nodeType==1)return gf(u.getBoundingClientRect(),!0)}return gf(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==$n(r))){let u=r.childNodes[i-1],d=u.nodeType==3?Fr(u,$n(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return Gs(ci(d,1),!1)}if(o==null&&i<$n(r)){let u=r.childNodes[i];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?Fr(u,0,s?0:1):u.nodeType==1?u:null:null;if(d)return Gs(ci(d,-1),!0)}return Gs(ci(r.nodeType==3?Fr(r):r,-n),n>=0)}function Gs(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function gf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function $0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function fR(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return $0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=H0(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Fr(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let f=u[d];if(f.bottom>f.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}var pR=/[\u0590-\u08ac]/;function hR(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!pR.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:$0(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let y=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:w}=t.domSelectionRange(),_=b&&!y.contains(b.nodeType==1?b:b.parentNode)||u==b&&d==w;try{l.collapse(f,h),u&&(u!=f||d!=h)&&l.extend&&l.extend(u,d)}catch{}return m!=null&&(l.caretBidiLevel=m),_}):r.pos==r.start()||r.pos==r.end()}var i0=null,o0=null,s0=!1;function mR(t,e,n){return i0==e&&o0==n?s0:(i0=e,o0=n,s0=n=="up"||n=="down"?fR(t,e,n):hR(t,e,n))}var zn=0,a0=1,Gi=2,hr=3,ji=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=zn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Gt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],l=o+s.size;if(l>e||s instanceof Il){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Ol&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Gt(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Gt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,l=0;;l++){let u=this.children[l],d=s+u.size;if(i==-1&&e<=d){let f=s+u.border;if(e>=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=s;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=Gt(m.dom)+1;break}e-=m.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;f<this.children.length;f++){let h=this.children[f];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=Gt(h.dom);break}n+=h.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let m=0,y=0;m<this.children.length;m++){let b=this.children[m],w=y+b.size;if(o>y&&s<w)return b.setSelection(e-y-b.border,n-y-b.border,r,i);y=w}let l=this.domFromPos(e,e?-1:1),u=n==e?l:this.domFromPos(n,n?-1:1),d=r.getSelection(),f=!1;if((ir||dn)&&e==n){let{node:m,offset:y}=l;if(m.nodeType==3){if(f=!!(y&&m.nodeValue[y-1]==`
|
|
`),f&&y==m.nodeValue.length)for(let b=m,w;b;b=b.parentNode){if(w=b.nextSibling){w.nodeName=="BR"&&(l=u={node:w.parentNode,offset:Gt(w)+1});break}let _=b.pmViewDesc;if(_&&_.node&&_.node.isBlock)break}}else{let b=m.childNodes[y-1];f=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(ir&&d.focusNode&&d.focusNode!=u.node&&d.focusNode.nodeType==1){let m=d.focusNode.childNodes[d.focusOffset];m&&m.contentEditable=="false"&&(i=!0)}if(!(i||f&&dn)&&Zi(l.node,l.offset,d.anchorNode,d.anchorOffset)&&Zi(u.node,u.offset,d.focusNode,d.focusOffset))return;let h=!1;if((d.extend||e==n)&&!f){d.collapse(l.node,l.offset);try{e!=n&&d.extend(u.node,u.offset),h=!0}catch{}}if(!h){if(e>n){let y=l;l=u,u=y}let m=document.createRange();m.setEnd(u.node,u.offset),m.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?Gi:a0,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=hr:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Gi:hr}r=s}this.dirty=Gi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Gi:a0;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}},Ol=class extends ji{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==zn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}},Sf=class extends ji{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Ko=class t extends ji{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Lr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&hr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=hr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=zn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=zn}}slice(e,n,r){let i=t.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Nf(o,n,s,r)),e>0&&(o=Nf(o,0,e,r));for(let l=0;l<o.length;l++)o[l].parent=i;return i.children=o,i}},pi=class t extends ji{constructor(e,n,r,i,o,s,l,u,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,o,s){let l=o.nodeViews[n.type.name],u,d=l&&l(n,o,()=>{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),f=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Lr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=W0(f,r,n),d?u=new Tf(e,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Rl(e,n,r,i,f,m,o):new t(e,n,r,i,f,h||null,m,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>G.empty)}return e}matchesNode(e,n,r){return this.dirty==zn&&e.eq(this.node)&&Af(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,u=new Mf(this,s&&s.node,e);ER(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?Ge.none:this.node.child(f).marks,r,e),u.placeWidget(d,e,i)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,e);let y;u.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(y=u.findIndexWithChild(o.node))>-1&&u.updateNodeAt(d,f,h,y,e)||u.updateNextNode(d,f,h,e,m,i)||u.addNode(d,f,h,e,i),i+=d.nodeSize}),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==Gi)&&(s&&this.protectLocalComposition(e,s),z0(this.contentDOM,this.children,e),Wo&&vR(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ce)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=wR(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Sf(this,o,n,i);e.input.compositionNodes.push(s),this.children=Nf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==hr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=zn}updateOuterDeco(e){if(Af(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=U0(this.dom,this.nodeDOM,Cf(this.outerDeco,this.node,n),Cf(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function l0(t,e,n,r,i){W0(r,e,t);let o=new pi(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Rl=class t extends pi{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==hr||this.dirty!=zn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=zn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=zn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=hr)}get domAtom(){return!1}isText(e){return this.node.text==e}},Il=class extends ji{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==zn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Tf=class extends pi{constructor(e,n,r,i,o,s,l,u,d,f){super(e,n,r,i,o,s,l,d,f),this.spec=u}update(e,n,r,i){if(this.dirty==hr)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function z0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=c0(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof Ko){let u=r?r.previousSibling:t.lastChild;z0(s.contentDOM,s.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=c0(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}var qs=function(t){t&&(this.nodeName=t)};qs.prototype=Object.create(null);var qi=[new qs];function Cf(t,e,n){if(t.length==0)return qi;let r=n?qi[0]:new qs,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new qs(s.nodeName));for(let l in s){let u=s[l];u!=null&&(n&&i.length==1&&i.push(r=new qs(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+u:l=="style"?r.style=(r.style?r.style+";":"")+u:l!="nodeName"&&(r[l]=u))}}}return i}function U0(t,e,n,r){if(n==qi&&r==qi)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let u;l&&l.nodeName==s.nodeName&&i!=t&&(u=i.parentNode)&&u.nodeName.toLowerCase()==s.nodeName||(u=document.createElement(s.nodeName),u.pmIsDeco=!0,u.appendChild(i),l=qi[0]),i=u}gR(i,l||qi[0],s)}return i}function gR(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function W0(t,e,n){return U0(t,t,qi,Cf(e,n,t.nodeType!=1))}function Af(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function c0(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var Mf=class{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=bR(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=zn,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let u=this.index;u<Math.min(this.index+3,this.top.children.length);u++){let d=this.top.children[u];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=u;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Ko.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l<u;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==hr&&s.dom==s.contentDOM&&(s.dirty=Gi),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let l=this.index;l<this.top.children.length;l++){let u=this.top.children[l];if(u instanceof pi){let d=this.preMatch.matched.get(u);if(d!=null&&d!=o)return!1;let f=u.dom,h,m=this.isLocked(f)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=hr&&Af(n,u.outerDeco));if(!m&&u.update(e,n,r,i))return this.destroyBetween(this.index,l),u.dom!=f&&(this.changed=!0),this.index++,!0;if(!m&&(h=this.recreateWrapper(u,e,n,r,i,s)))return this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Gi,h.updateChildren(i,s+1),h.dirty=zn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let l=pi.create(this.top,n,r,i,o,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let u of l.children)u.parent=l}return e.destroy(),l}addNode(e,n,r,i,o){let s=pi.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Ol(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Ko;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Rl)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((dn||nn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Il(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function bR(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Ko)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function yR(t,e){return t.type.side-e.type.side}function ER(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let f=t.child(d);r(f,i,e.forChild(o,f),d),o+=f.nodeSize}return}let s=0,l=[],u=null;for(let d=0;;){let f,h;for(;s<i.length&&i[s].to==o;){let _=i[s++];_.widget&&(f?(h||(h=[f])).push(_):f=_)}if(f)if(h){h.sort(yR);for(let _=0;_<h.length;_++)n(h[_],d,!!u)}else n(f,d,!!u);let m,y;if(u)y=-1,m=u,u=null;else if(d<t.childCount)y=d,m=t.child(d++);else break;for(let _=0;_<l.length;_++)l[_].to<=o&&l.splice(_--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let b=o+m.nodeSize;if(m.isText){let _=b;s<i.length&&i[s].from<_&&(_=i[s].from);for(let S=0;S<l.length;S++)l[S].to<_&&(_=l[S].to);_<b&&(u=m.cut(_-o),m=m.cut(0,_-o),b=_,y=-1)}else for(;s<i.length&&i[s].to<b;)s++;let w=m.isInline&&!m.isLeaf?l.filter(_=>!_.inline):l.slice();r(m,w,e.forChild(o,m),y),o=b}}function vR(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function wR(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let u=s.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;u+=d.text}if(o>=n){if(o>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?u.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function Nf(t,e,n,r,i){let o=[];for(let s=0,l=0;s<t.length;s++){let u=t[s],d=l,f=l+=u.size;d>=n||f<=e?o.push(u):(d<e&&o.push(u.slice(0,e-d,r)),i&&(o.push(i),i=void 0),f>n&&o.push(u.slice(n-d,u.size,r)))}return o}function $f(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),u,d;if(zl(n)){for(u=l;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&pe.isSelectable(f)&&i.parent&&!(f.isInline&&XO(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new pe(s==h?l:r.resolve(h))}}else{let f=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;u=r.resolve(f)}if(!d){let f=e=="pointer"||t.state.selection.head<l.pos&&!o?1:-1;d=zf(t,u,l,f)}return d}function K0(t){return t.editable?t.hasFocus():G0(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Hr(t,e=!1){let n=t.state.selection;if(V0(t,n),!!K0(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&nn){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Zi(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)_R(t);else{let{anchor:r,head:i}=n,o,s;u0&&!(n instanceof ce)&&(n.$from.parent.inlineContent||(o=d0(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=d0(t,n.to))),t.docView.setSelection(r,i,t.root,e),u0&&(o&&f0(o),s&&f0(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&xR(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}var u0=dn||nn&&L0<63;function d0(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(dn&&i&&i.contentEditable=="false")return bf(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return bf(i);if(o)return bf(o)}}function bf(t){return t.contentEditable="true",dn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function f0(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function xR(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!K0(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function _R(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Gt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&En&&fi<=11&&(r.disabled=!0,r.disabled=!1)}function V0(t,e){if(e instanceof pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(p0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else p0(t)}function p0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function zf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ce.between(e,n,r)}function h0(t){return t.editable&&!t.hasFocus()?!1:G0(t)}function G0(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function SR(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Zi(e.node,e.offset,n.anchorNode,n.anchorOffset)}function kf(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function ui(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function m0(t,e,n){let r=t.state.selection;if(r instanceof ce)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return ui(t,new ce(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=kf(t.state,e);return i&&i instanceof pe?ui(t,i):!1}else if(!(Hn&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?pe.isSelectable(o)?ui(t,new pe(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):ea?ui(t,new ce(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return ui(t,new ce(e>0?r.$to:r.$from));{let i=kf(t.state,e);return i?ui(t,i):!1}}}function Ll(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ys(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function $o(t,e){return e<0?TR(t):CR(t)}function TR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(ir&&n.nodeType==1&&r<Ll(n)&&Ys(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Ys(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(q0(n))break;{let l=n.previousSibling;for(;l&&Ys(l,-1);)i=n.parentNode,o=Gt(l),l=l.previousSibling;if(l)n=l,r=Ll(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Of(t,n,r):i&&Of(t,i,o)}function CR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Ll(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Ys(l,1))o=n,s=++r;else break}else{if(q0(n))break;{let l=n.nextSibling;for(;l&&Ys(l,1);)o=l.parentNode,s=Gt(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=Ll(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Of(t,o,s)}function q0(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function AR(t,e){for(;t&&e==t.childNodes.length&&!Qs(t);)e=Gt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function MR(t,e){for(;t&&!e&&!Qs(t);)e=Gt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Of(t,e,n){if(e.nodeType!=3){let o,s;(s=AR(e,n))?(e=s,n=0):(o=MR(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(zl(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Hr(t)},50)}function g0(t,e){let n=t.state.doc.resolve(e);if(!(nn||QO)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function b0(t,e,n){let r=t.state.selection;if(r instanceof ce&&!r.empty||n.indexOf("s")>-1||Hn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=kf(t.state,e);if(s&&s instanceof pe)return ui(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Nn?ue.near(s,e):ue.findFrom(s,e);return l?ui(t,l):!1}return!1}function y0(t,e){if(!(t.state.selection instanceof ce))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function E0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function NR(t){if(!dn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;E0(t,r,"true"),setTimeout(()=>E0(t,r,"false"),20)}return!1}function kR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function OR(t,e){let n=e.keyCode,r=kR(e);if(n==8||Hn&&n==72&&r=="c")return y0(t,-1)||$o(t,-1);if(n==46&&!e.shiftKey||Hn&&n==68&&r=="c")return y0(t,1)||$o(t,1);if(n==13||n==27)return!0;if(n==37||Hn&&n==66&&r=="c"){let i=n==37?g0(t,t.state.selection.from)=="ltr"?-1:1:-1;return m0(t,i,r)||$o(t,i)}else if(n==39||Hn&&n==70&&r=="c"){let i=n==39?g0(t,t.state.selection.from)=="ltr"?1:-1:1;return m0(t,i,r)||$o(t,i)}else{if(n==38||Hn&&n==80&&r=="c")return b0(t,-1,r)||$o(t,-1);if(n==40||Hn&&n==78&&r=="c")return NR(t)||b0(t,1,r)||$o(t,1);if(r==(Hn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Y0(t,e){t.someProp("transformCopied",y=>{e=y(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let s=t.someProp("clipboardSerializer")||Lr.fromSchema(t.state.schema),l=eE(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=Q0[d.nodeName.toLowerCase()]);){for(let y=f.length-1;y>=0;y--){let b=l.createElement(f[y]);for(;u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b),h++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",y=>y(e,t))||e.content.textBetween(0,e.content.size,`
|
|
|
|
`);return{dom:u,text:m,slice:e}}function J0(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let u=e&&(r||o||!n);if(u){if(t.someProp("transformPastedText",m=>{e=m(e,o||r,t)}),o)return e?new Z(G.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
`))),0,0):Z.empty;let h=t.someProp("clipboardTextParser",m=>m(e,i,r,t));if(h)l=h;else{let m=i.marks(),{schema:y}=t.state,b=Lr.fromSchema(y);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(w=>{let _=s.appendChild(document.createElement("p"));w&&_.appendChild(b.serializeNode(y.text(w,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),s=DR(n),ea&&PR(s);let d=s&&s.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Ir.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!RR.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=BR(v0(l,+f[1],+f[2]),f[4]);else if(l=Z.maxOpen(IR(l.content,i),!0),l.openStart||l.openEnd){let h=0,m=0;for(let y=l.content.firstChild;h<l.openStart&&!y.type.spec.isolating;h++,y=y.firstChild);for(let y=l.content.lastChild;m<l.openEnd&&!y.type.spec.isolating;m++,y=y.lastChild);l=v0(l,h,m)}return t.someProp("transformPasted",h=>{l=h(l,t)}),l}var RR=/^(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 IR(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let u=i.findWrapping(l.type),d;if(!u)return s=null;if(d=s.length&&o.length&&Z0(u,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=j0(s[s.length-1],o.length));let f=X0(l,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return G.from(s)}return t}function X0(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,G.from(t));return t}function Z0(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Z0(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(G.from(X0(n,t,i+1))))}}function j0(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,j0(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(G.empty,!0);return t.copy(n.append(r))}function Rf(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(o=0),i<r-1&&(l=Rf(l,e,n,r,i+1,o)),i>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(G.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function v0(t,e,n){return e<t.openStart&&(t=new Z(Rf(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Z(Rf(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Q0={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},w0=null;function eE(){return w0||(w0=document.implementation.createHTMLDocument("title"))}function LR(t){let e=window.trustedTypes;return e?e.createPolicy("detachedDocument",{createHTML:n=>n}).createHTML(t):t}function DR(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=eE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Q0[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=LR(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function PR(t){let e=t.querySelectorAll(nn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function BR(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=G.from(u.create(r[l+1],i)),o++,s++}return new Z(i,o,s)}var fn={},pn={},FR={touchstart:!0,touchmove:!0},If=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function HR(t){for(let e in fn){let n=fn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{zR(t,r)&&!Uf(t,r)&&(t.editable||!(r.type in pn))&&n(t,r)},FR[e]?{passive:!0}:void 0)}dn&&t.dom.addEventListener("input",()=>null),Lf(t)}function di(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function $R(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Lf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Uf(t,r))})}function Uf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function zR(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function UR(t,e){!Uf(t,e)&&fn[e.type]&&(t.editable||!(e.type in pn))&&fn[e.type](t,e)}pn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!nE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rr&&nn&&n.keyCode==13)))if(t.domObserver.selectionChanged(t.domSelectionRange())?t.domObserver.flush():n.keyCode!=229&&t.domObserver.forceFlush(),Wo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Vi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||OR(t,n)?n.preventDefault():di(t,"key")};pn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};pn.keypress=(t,e)=>{let n=e;if(nE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ce)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Ul(t){return{left:t.clientX,top:t.clientY}}function WR(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Wf(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Uo(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function KR(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(Uo(t,new pe(n),"pointer"),!0):!1}function VR(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof pe&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(pe.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Uo(t,pe.create(t.state.doc,i),"pointer"),!0):!1}function GR(t,e,n,r,i){return Wf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?VR(t,n):KR(t,n))}function qR(t,e,n,r){return Wf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function YR(t,e,n,r){return Wf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||JR(t,n,r)}function JR(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Uo(t,ce.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Uo(t,ce.create(r,l+1,l+1+s.content.size),"pointer");else if(pe.isSelectable(s))Uo(t,pe.create(r,l),"pointer");else continue;return!0}}function Kf(t){return Dl(t)}var tE=Hn?"metaKey":"ctrlKey";fn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Kf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&WR(n,t.input.lastClick)&&!n[tE]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Ul(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Df(t,s,n,!!r)):(o=="doubleClick"?qR:YR)(t,s.pos,s.inside,n)?n.preventDefault():di(t,"pointer"))};var Df=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[tE],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}let l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof pe&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ir&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),di(e,"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(()=>Hr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ul(e))),this.updateAllowDefault(e),this.allowDefault||!n?di(this.view,"pointer"):GR(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||dn&&this.mightDrag&&!this.mightDrag.node.isAtom||nn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Uo(this.view,ue.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):di(this.view,"pointer")}move(e){this.updateAllowDefault(e),di(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};fn.touchstart=t=>{t.input.lastTouch=Date.now(),Kf(t),di(t,"pointer")};fn.touchmove=t=>{t.input.lastTouch=Date.now(),di(t,"pointer")};fn.contextmenu=t=>Kf(t);function nE(t,e){return t.composing?!0:dn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var XR=rr?5e3:-1;pn.compositionstart=pn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ce&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Dl(t,!0),t.markCursor=null;else if(Dl(t,!e.selection.empty),ir&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}rE(t,XR)};pn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,rE(t,20))};function rE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Dl(t),e))}function iE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=jR());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ZR(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=YO(e.focusNode,e.focusOffset),r=JO(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function jR(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Dl(t,e=!1){if(!(rr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),iE(t),e||t.docView&&t.docView.dirty){let n=$f(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function QR(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(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var Xs=En&&fi<15||Wo&&eR<604;fn.copy=pn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Xs?null:n.clipboardData,s=r.content(),{dom:l,text:u}=Y0(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):QR(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function eI(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function tI(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();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Zs(t,r.value,null,i,e):Zs(t,r.textContent,r.innerHTML,i,e)},50)}function Zs(t,e,n,r,i){let o=J0(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,o||Z.empty)))return!0;if(!o)return!1;let s=eI(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function oE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}pn.paste=(t,e)=>{let n=e;if(t.composing&&!rr)return;let r=Xs?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Zs(t,oE(r),r.getData("text/html"),i,n)?n.preventDefault():tI(t,n)};var Pl=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},sE=Hn?"altKey":"ctrlKey";fn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Ul(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof pe?i.to-1:i.to))){if(r&&r.mightDrag)s=pe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(s=pe.create(t.state.doc,h.posBefore))}}let l=(s||t.state.selection).content(),{dom:u,text:d,slice:f}=Y0(t,l);(!n.dataTransfer.files.length||!nn||L0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Xs?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Xs||n.dataTransfer.setData("text/plain",d),t.dragging=new Pl(f,!n[sE],s)};fn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};pn.dragover=pn.dragenter=(t,e)=>e.preventDefault();pn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Ul(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",b=>{s=b(s,t)}):s=J0(t,oE(n.dataTransfer),Xs?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[sE]);if(t.someProp("handleDrop",b=>b(t,n,s||Z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?Al(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let d=t.state.tr;if(l){let{node:b}=r;b?b.replace(d):d.deleteSelection()}let f=d.mapping.map(u),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=d.doc;if(h?d.replaceRangeWith(f,f,s.content.firstChild):d.replaceRange(f,f,s),d.doc.eq(m))return;let y=d.doc.resolve(f);if(h&&pe.isSelectable(s.content.firstChild)&&y.nodeAfter&&y.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new pe(y));else{let b=d.mapping.map(u);d.mapping.maps[d.mapping.maps.length-1].forEach((w,_,S,D)=>b=D),d.setSelection(zf(t,y,d.doc.resolve(b)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))};fn.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())&&Hr(t)},20))};fn.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)};fn.beforeinput=(t,e)=>{if(nn&&rr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Vi(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in pn)fn[t]=pn[t];function js(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}var Bl=class t{constructor(e,n){this.toDOM=e,this.spec=n||Ji,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Tt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&js(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Yi=class t{constructor(e,n){this.attrs=e,this.spec=n||Ji}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Tt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof t&&js(this.attrs,e.attrs)&&js(this.spec,e.spec)}static is(e){return e.type instanceof t}destroy(){}},Pf=class t{constructor(e,n){this.attrs=e,this.spec=n||Ji}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Tt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof t&&js(this.attrs,e.attrs)&&js(this.spec,e.spec)}destroy(){}},Tt=class t{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new t(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new t(e,e,new Bl(n,r))}static inline(e,n,r,i){return new t(e,n,new Yi(r,i))}static node(e,n,r,i){return new t(e,n,new Pf(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Yi}get widget(){return this.type instanceof Bl}},zo=[],Ji={},st=class t{constructor(e,n){this.local=e.length?e:zo,this.children=n.length?n:zo}static create(e,n){return n.length?Hl(n,e,0,Ji):tn}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==tn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ji)}mapInner(e,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let u=this.local[l].map(e,r,i);u&&u.type.valid(n,u)?(s||(s=[])).push(u):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?nI(this.children,s||[],e,n,r,i,o):s?new t(s.sort(Xi),zo):tn}add(e,n){return n.length?this==tn?t.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((l,u)=>{let d=u+r,f;if(f=lE(n,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<u;)o+=3;i[o]==u?i[o+2]=i[o+2].addInner(l,f,d+1):i.splice(o,0,u,u+l.nodeSize,Hl(f,l,d+1,Ji)),o+=3}});let s=aE(o?cE(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new t(s.length?this.local.concat(s).sort(Xi):this.local,i||this.children)}remove(e){return e.length==0||this==tn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,l=r[o]+n,u=r[o+1]+n;for(let f=0,h;f<e.length;f++)(h=e[f])&&h.from>l&&h.to<u&&(e[f]=null,(s||(s=[])).push(h));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,l+1);d!=tn?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new t(i,r):tn}forChild(e,n){if(this==tn)return this;if(n.isLeaf)return t.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;l<this.local.length;l++){let u=this.local[l];if(u.from<s&&u.to>o&&u.type instanceof Yi){let d=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;d<f&&(i||(i=[])).push(u.copy(d,f))}}if(i){let l=new t(i.sort(Xi),zo);return r?new Fl([l,r]):l}return r||tn}eq(e){if(this==e)return!0;if(!(e instanceof t)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Vf(this.localsInner(e))}localsInner(e){if(this==tn)return zo;if(e.inlineContent||!this.local.some(Yi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Yi||n.push(this.local[r]);return n}forEachSet(e){e(this)}};st.empty=new st([],[]);st.removeOverlap=Vf;var tn=st.empty,Fl=class t{constructor(e){this.members=e}map(e,n){let r=this.members.map(i=>i.map(e,n,Ji));return t.from(r)}forChild(e,n){if(n.isLeaf)return st.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=tn&&(o instanceof t?r=r.concat(o.members):r.push(o))}return t.from(r)}eq(e){if(!(e instanceof t)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Vf(r?n:n.sort(Xi)):zo}static from(e){switch(e.length){case 0:return tn;case 1:return e[0];default:return new t(e.every(n=>n instanceof st)?e:e.reduce((n,r)=>n.concat(r instanceof st?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}};function nI(t,e,n,r,i,o,s){let l=t.slice();for(let d=0,f=o;d<n.maps.length;d++){let h=0;n.maps[d].forEach((m,y,b,w)=>{let _=w-b-(y-m);for(let S=0;S<l.length;S+=3){let D=l[S+1];if(D<0||m>D+f-h)continue;let L=l[S]+f-h;y>=L?l[S+1]=m<=L?-2:-1:m>=f&&_&&(l[S]+=_,l[S+1]+=_)}h+=_}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){u=!0,l[d+1]=-1;continue}let f=n.map(t[d]+o),h=f-i;if(h<0||h>=r.content.size){u=!0;continue}let m=n.map(t[d+1]+o,-1),y=m-i,{index:b,offset:w}=r.content.findIndex(h),_=r.maybeChild(b);if(_&&w==h&&w+_.nodeSize==y){let S=l[d+2].mapInner(n,_,f+1,t[d]+o+1,s);S!=tn?(l[d]=h,l[d+1]=y,l[d+2]=S):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=rI(l,t,e,n,i,o,s),f=Hl(d,r,0,s);e=f.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,m=0;h<f.children.length;h+=3){let y=f.children[h];for(;m<l.length&&l[m]<y;)m+=3;l.splice(m,0,f.children[h],f.children[h+1],f.children[h+2])}}return new st(e.sort(Xi),l)}function aE(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Tt(i.from+e,i.to+e,i.type))}return n}function rI(t,e,n,r,i,o,s){function l(u,d){for(let f=0;f<u.local.length;f++){let h=u.local[f].map(r,i,d);h?n.push(h):s.onRemove&&s.onRemove(u.local[f].spec)}for(let f=0;f<u.children.length;f+=3)l(u.children[f+2],u.children[f]+d+1)}for(let u=0;u<t.length;u+=3)t[u+1]==-1&&l(t[u+2],e[u]+o+1);return n}function lE(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function cE(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Hl(t,e,n,r){let i=[],o=!1;e.forEach((l,u)=>{let d=lE(t,l,u+n);if(d){o=!0;let f=Hl(d,l,n+u+1,r);f!=tn&&i.push(u,u+l.nodeSize,f)}});let s=aE(o?cE(t):t,-n).sort(Xi);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new st(s,i):tn}function Xi(t,e){return t.from-e.from||t.to-e.to}function Vf(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),x0(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),x0(e,i,r.copy(o.from,r.to)));break}}}return e}function x0(t,e,n){for(;e<t.length&&Xi(n,t[e])>0;)e++;t.splice(e,0,n)}function yf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=tn&&e.push(r)}),t.cursorWrapper&&e.push(st.create(t.state.doc,[t.cursorWrapper.deco])),Fl.from(e)}var iI={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},oI=En&&fi<=11,Bf=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Ff=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Bf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);En&&fi<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),oI&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,iI)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(h0(this.view)){if(this.suppressingSelectionUpdates)return Hr(this.view);if(En&&fi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Zi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=Js(o))n.add(o);for(let o=e.anchorNode;o;o=Js(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}selectionChanged(e){return!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&h0(this.view)&&!this.ignoreSelectionChange(e)}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=this.selectionChanged(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let f=0;f<n.length;f++){let h=this.registerMutation(n[f],u);h&&(o=o<0?h.from:Math.min(h.from,o),s=s<0?h.to:Math.max(h.to,s),h.typeOver&&(l=!0))}if(ir&&u.length){let f=u.filter(h=>h.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let y=m.parentNode;y&&y.nodeName=="LI"&&(!h||lI(e,h)!=y)&&m.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&zl(r)&&(d=$f(e))&&d.eq(ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Hr(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),sI(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Hr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;f<e.addedNodes.length;f++){let h=e.addedNodes[f];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(En&&fi<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:h,nextSibling:m}=e.addedNodes[f];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h),(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(o=m)}let s=i&&i.parentNode==e.target?Gt(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),u=o&&o.parentNode==e.target?Gt(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,u,1);return{from:l,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},_0=new WeakMap,S0=!1;function sI(t){if(!_0.has(t)&&(_0.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=ir,S0)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),S0=!0}}function T0(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Zi(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function aI(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return T0(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?T0(t,n):null}function lI(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function cI(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=t.docView.parseRange(e,n),u=t.domSelectionRange(),d,f=u.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(d=[{node:f,offset:u.anchorOffset}],zl(u)||d.push({node:u.focusNode,offset:u.focusOffset})),nn&&t.input.lastKeyCode===8)for(let _=o;_>i;_--){let S=r.childNodes[_-1],D=S.pmViewDesc;if(S.nodeName=="BR"&&!D){o=_;break}if(!D||D.size)break}let h=t.state.doc,m=t.someProp("domParser")||Ir.fromSchema(t.state.schema),y=h.resolve(s),b=null,w=m.parse(r,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:i,to:o,preserveWhitespace:y.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:uI,context:y});if(d&&d[0].pos!=null){let _=d[0].pos,S=d[1]&&d[1].pos;S==null&&(S=_),b={anchor:_+s,head:S+s}}return{doc:w,sel:b,from:s,to:l}}function uI(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(dn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||dn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var dI=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function fI(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let z=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,re=$f(t,z);if(re&&!t.state.selection.eq(re)){if(nn&&rr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",Se=>Se(t,Vi(13,"Enter"))))return;let he=t.state.tr.setSelection(re);z=="pointer"?he.setMeta("pointer",!0):z=="key"&&he.scrollIntoView(),o&&he.setMeta("composition",o),t.dispatch(he)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=cI(t,e,n),f=t.state.doc,h=f.slice(d.from,d.to),m,y;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,y="end"):(m=t.state.selection.from,y="start"),t.input.lastKeyCode=null;let b=mI(h.content,d.doc.content,d.from,m,y);if(b&&t.input.domChangeCount++,(Wo&&t.input.lastIOSEnter>Date.now()-225||rr)&&i.some(z=>z.nodeType==1&&!dI.test(z.nodeName))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",z=>z(t,Vi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!b)if(r&&u instanceof ce&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))b={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let z=C0(t,t.state.doc,d.sel);if(z&&!z.eq(t.state.selection)){let re=t.state.tr.setSelection(z);o&&re.setMeta("composition",o),t.dispatch(re)}}return}t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof ce&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),En&&fi<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>d.from&&d.doc.textBetween(b.start-d.from-1,b.start-d.from+1)==" \xA0"&&(b.start--,b.endA--,b.endB--);let w=d.doc.resolveNoCache(b.start-d.from),_=d.doc.resolveNoCache(b.endB-d.from),S=f.resolve(b.start),D=w.sameParent(_)&&w.parent.inlineContent&&S.end()>=b.endA,L;if((Wo&&t.input.lastIOSEnter>Date.now()-225&&(!D||i.some(z=>z.nodeName=="DIV"||z.nodeName=="P"))||!D&&w.pos<d.doc.content.size&&!w.sameParent(_)&&(L=ue.findFrom(d.doc.resolve(w.pos+1),1,!0))&&L.head==_.pos)&&t.someProp("handleKeyDown",z=>z(t,Vi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>b.start&&hI(f,b.start,b.endA,w,_)&&t.someProp("handleKeyDown",z=>z(t,Vi(8,"Backspace")))){rr&&nn&&t.domObserver.suppressSelectionUpdates();return}nn&&rr&&b.endB==b.start&&(t.input.lastAndroidDelete=Date.now()),rr&&!D&&w.start()!=_.start()&&_.parentOffset==0&&w.depth==_.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==b.endA&&(b.endB-=2,_=d.doc.resolveNoCache(b.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(z){return z(t,Vi(13,"Enter"))})},20));let T=b.start,$=b.endA,O,Y,ee;if(D){if(w.pos==_.pos)En&&fi<=11&&w.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Hr(t),20)),O=t.state.tr.delete(T,$),Y=f.resolve(b.start).marksAcross(f.resolve(b.endA));else if(b.endA==b.endB&&(ee=pI(w.parent.content.cut(w.parentOffset,_.parentOffset),S.parent.content.cut(S.parentOffset,b.endA-S.start()))))O=t.state.tr,ee.type=="add"?O.addMark(T,$,ee.mark):O.removeMark(T,$,ee.mark);else if(w.parent.child(w.index()).isText&&w.index()==_.index()-(_.textOffset?0:1)){let z=w.parent.textBetween(w.parentOffset,_.parentOffset);if(t.someProp("handleTextInput",re=>re(t,T,$,z)))return;O=t.state.tr.insertText(z,T,$)}}if(O||(O=t.state.tr.replace(T,$,d.doc.slice(b.start-d.from,b.endB-d.from))),d.sel){let z=C0(t,O.doc,d.sel);z&&!(nn&&rr&&t.composing&&z.empty&&(b.start!=b.endB||t.input.lastAndroidDelete<Date.now()-100)&&(z.head==T||z.head==O.mapping.map($)-1)||En&&z.empty&&z.head==T)&&O.setSelection(z)}Y&&O.ensureMarks(Y),o&&O.setMeta("composition",o),t.dispatch(O.scrollIntoView())}function C0(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:zf(t,e.resolve(n.anchor),e.resolve(n.head))}function pI(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let f=0;f<r.length;f++)i=r[f].removeFromSet(i);for(let f=0;f<n.length;f++)o=n[f].removeFromSet(o);if(i.length==1&&o.length==0)l=i[0],s="add",u=f=>f.mark(l.addToSet(f.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;f<e.childCount;f++)d.push(u(e.child(f)));if(G.from(d).eq(t))return{mark:l,type:s}}function hI(t,e,n,r,i){if(n-e<=i.pos-r.pos||Ef(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&n==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Ef(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Ef(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Ef(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function mI(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,l));r-=s+u-o}if(s<o&&t.size<e.size){let u=r<=o&&r>=s?o-r:0;o-=u,o&&o<e.size&&A0(e.textBetween(o-1,o+1))&&(o+=u?1:-1),l=o+(l-s),s=o}else if(l<o){let u=r<=o&&r>=l?o-r:0;o-=u,o&&o<t.size&&A0(t.textBetween(o-1,o+1))&&(o+=u?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function A0(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}var $l=class{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new If,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(R0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=k0(this),N0(this),this.nodeViews=O0(this),this.docView=l0(this.state.doc,M0(this),yf(this),this.dom,this),this.domObserver=new Ff(this,(r,i,o,s)=>fI(this,r,i,o,s)),this.domObserver.start(),HR(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Lf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(R0),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(iE(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let y=O0(this);bI(y,this.nodeViews)&&(this.nodeViews=y,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Lf(this),this.editable=k0(this),N0(this);let u=yf(this),d=M0(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(e.doc,d,u);(h||!e.selection.eq(i.selection))&&(s=!0);let m=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&rR(this);if(s){this.domObserver.stop();let y=h&&(En||nn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&gI(i.selection,e.selection);if(h){let b=nn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ZR(this)),(o||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=l0(e.doc,d,u,this.dom,this)),b&&!this.trackWrites&&(y=!0)}y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&SR(this))?Hr(this,y):(V0(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&iR(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof pe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&n0(this,n.getBoundingClientRect(),e)}else n0(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Pl(e.slice,e.move,i<0?void 0:pe.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(i=n?n(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(En){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&oR(this.dom),Hr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return uR(this,e)}coordsAtPos(e,n=1){return H0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return mR(this,n||this.state,e)}pasteHTML(e,n){return Zs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Zs(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&($R(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],yf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,GO())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return UR(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?dn&&this.root.nodeType===11&&ZO(this.dom.ownerDocument)==this.dom&&aI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function M0(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Tt.node(0,t.state.doc.content.size,e)]}function N0(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Tt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function k0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function gI(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function O0(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function bI(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function R0(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var $r={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:"'"},Kl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yI=typeof navigator<"u"&&/Mac/.test(navigator.platform),EI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Ct=0;Ct<10;Ct++)$r[48+Ct]=$r[96+Ct]=String(Ct);var Ct;for(Ct=1;Ct<=24;Ct++)$r[Ct+111]="F"+Ct;var Ct;for(Ct=65;Ct<=90;Ct++)$r[Ct]=String.fromCharCode(Ct+32),Kl[Ct]=String.fromCharCode(Ct);var Ct;for(Wl in $r)Kl.hasOwnProperty(Wl)||(Kl[Wl]=$r[Wl]);var Wl;function uE(t){var e=yI&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||EI&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Kl:$r)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var vI=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function wI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l++){let u=e[l];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))vI?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function xI(t){let e=Object.create(null);for(let n in t)e[wI(n)]=t[n];return e}function Gf(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function dE(t){return new De({props:{handleKeyDown:ta(t)}})}function ta(t){let e=xI(t);return function(n,r){let i=uE(r),o,s=e[Gf(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[Gf(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=$r[r.keyCode])&&o!=i){let l=e[Gf(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Vl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function pE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var Yf=(t,e,n)=>{let r=pE(t,n);if(!r)return!1;let i=Xf(r);if(!i){let s=r.blockRange(),l=s&&Pr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(xE(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Vo(o,"end")||pe.isSelectable(o)))for(let s=r.depth;;s--){let l=Ks(t.doc,r.before(s),r.after(s),Z.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=t.tr.step(l);u.setSelection(Vo(o,"end")?ue.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):pe.create(u.doc,i.pos-o.nodeSize)),e(u.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},hE=(t,e,n)=>{let r=pE(t,n);if(!r)return!1;let i=Xf(r);return i?gE(t,i,e):!1},mE=(t,e,n)=>{let r=bE(t,n);if(!r)return!1;let i=Qf(r);return i?gE(t,i,e):!1};function gE(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=e.nodeAfter,l=s,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=Ks(t.doc,o,u,Z.empty);if(!d||d.from!=o||d instanceof en&&d.slice.size>=u-o)return!1;if(n){let f=t.tr.step(d);f.setSelection(ce.create(f.doc,o)),n(f.scrollIntoView())}return!0}function Vo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Jf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Xf(r)}let s=o&&o.nodeBefore;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Xf(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 bE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}var Zf=(t,e,n)=>{let r=bE(t,n);if(!r)return!1;let i=Qf(r);if(!i)return!1;let o=i.nodeAfter;if(xE(t,i,e,1))return!0;if(r.parent.content.size==0&&(Vo(o,"start")||pe.isSelectable(o))){let s=Ks(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(Vo(o,"start")?ue.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):pe.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},jf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=Qf(r)}let s=o&&o.nodeAfter;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos)).scrollIntoView()),!0)};function Qf(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}var yE=(t,e)=>{let n=t.selection,r=n instanceof pe,i;if(r){if(n.node.isTextblock||!nr(t.doc,n.from))return!1;i=n.from}else if(i=Po(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(pe.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},EE=(t,e)=>{let n=t.selection,r;if(n instanceof pe){if(n.node.isTextblock||!nr(t.doc,n.to))return!1;r=n.to}else if(r=Po(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},vE=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Pr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},ep=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
`).scrollIntoView()),!0)};function tp(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var np=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=tp(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,s.createAndFill());u.setSelection(ue.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},rp=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Nn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=tp(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(s,o.createAndFill());l.setSelection(ce.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},ip=(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 o=n.before();if(Fn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Pr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function _I(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof pe&&e.selection.node.isBlock)return!r.parentOffset||!Fn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let o=i.parentOffset==i.parent.content.size,s=e.tr;(e.selection instanceof ce||e.selection instanceof Nn)&&s.deleteSelection();let l=r.depth==0?null:tp(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=t&&t(i.parent,o,r),d=u?[u]:o&&l?[{type:l}]:void 0,f=Fn(s.doc,s.mapping.map(r.pos),1,d);if(!d&&!f&&Fn(s.doc,s.mapping.map(r.pos),1,l?[{type:l}]:void 0)&&(l&&(d=[{type:l}]),f=!0),f&&(s.split(s.mapping.map(r.pos),1,d),!o&&!r.parentOffset&&r.parent.type!=l)){let h=s.mapping.map(r.before()),m=s.doc.resolve(h);l&&r.node(-1).canReplaceWith(m.index(),m.index()+1,l)&&s.setNodeMarkup(s.mapping.map(r.before()),l)}n(s.scrollIntoView())}return!0}}var SI=_I();var wE=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(pe.create(t.doc,i))),!0)},TI=(t,e)=>(e&&e(t.tr.setSelection(new Nn(t.doc))),!0);function CI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||nr(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function xE(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&CI(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let y=e.pos+o.nodeSize,b=G.empty;for(let S=s.length-1;S>=0;S--)b=G.from(s[S].create(null,b));b=G.from(i.copy(b));let w=t.tr.step(new St(e.pos-1,y,e.pos,y,new Z(b,1,0),s.length,!0)),_=y+2*s.length;nr(w.doc,_)&&w.join(_),n(w.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&u?null:ue.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Pr(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(d&&Vo(o,"start",!0)&&Vo(i,"end")){let y=i,b=[];for(;b.push(y),!y.isTextblock;)y=y.lastChild;let w=o,_=1;for(;!w.isTextblock;w=w.firstChild)_++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){let S=G.empty;for(let L=b.length-1;L>=0;L--)S=G.from(b[L].copy(S));let D=t.tr.step(new St(e.pos-b.length,e.pos+o.nodeSize,e.pos+_,e.pos+o.nodeSize-_,new Z(S,b.length,0),0,!0));n(D.scrollIntoView())}return!0}}return!1}function _E(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(ce.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var op=_E(-1),sp=_E(1);function SE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Do(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function ap(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[o];n.doc.nodesBetween(s,l,(u,d)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let f=n.doc.resolve(d),h=f.index();i=f.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:u}}=n.selection.ranges[s];o.setBlockType(l,u,t,e)}r(o.scrollIntoView())}return!0}}function lp(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}var qf=lp(Vl,Yf,Jf),fE=lp(Vl,Zf,jf),mi={Enter:lp(ep,rp,ip,SI),"Mod-Enter":np,Backspace:qf,"Mod-Backspace":qf,"Shift-Backspace":qf,Delete:fE,"Mod-Delete":fE,"Mod-a":TI},AI={"Ctrl-h":mi.Backspace,"Alt-Backspace":mi["Mod-Backspace"],"Ctrl-d":mi.Delete,"Ctrl-Alt-Backspace":mi["Mod-Delete"],"Alt-Delete":mi["Mod-Delete"],"Alt-d":mi["Mod-Delete"],"Ctrl-a":op,"Ctrl-e":sp};for(let t in mi)AI[t]=mi[t];var _$=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1;function TE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=!1,u=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let f=n.doc.resolve(s.start-2);u=new zi(f,f,s.depth),s.endIndex<s.parent.childCount&&(s=new zi(i,n.doc.resolve(o.end(s.depth)),s.depth)),l=!0}let d=Do(u,t,e,s);return d?(r&&r(MI(n.tr,s,d,l,t).scrollIntoView()),!0):!1}}function MI(t,e,n,r,i){let o=G.empty;for(let f=n.length-1;f>=0;f--)o=G.from(n[f].type.create(n[f].attrs,o));t.step(new St(e.start-(r?2:0),e.end,e.start,e.end,new Z(o,0,0),n.length,!0));let s=0;for(let f=0;f<n.length;f++)n[f].type==i&&(s=f+1);let l=n.length-s,u=e.start+n.length-(r?2:0),d=e.parent;for(let f=e.startIndex,h=e.endIndex,m=!0;f<h;f++,m=!1)!m&&Fn(t.doc,u,l)&&(t.split(u,l),u+=2*l),u+=d.child(f).nodeSize;return t}function CE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?NI(e,n,t,o):kI(e,n,o):!0:!1}}function NI(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new St(o-1,s,o,s,new Z(G.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new zi(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));let l=Pr(r);if(l==null)return!1;i.lift(r,l);let u=i.mapping.map(o,-1)-1;return nr(i.doc,u)&&i.join(u),e(i.scrollIntoView()),!0}function kI(t,e,n){let r=t.tr,i=n.parent;for(let y=n.end,b=n.endIndex-1,w=n.startIndex;b>w;b--)y-=i.child(b).nodeSize,r.delete(y-1,y+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(l?0:1),f+1,s.content.append(u?G.empty:G.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new St(h-(l?1:0),m+(u?1:0),h+1,m-1,new Z((l?G.empty:G.from(i.copy(G.empty))).append(u?G.empty:G.from(i.copy(G.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function AE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,u=l.child(s-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,f=G.from(d?t.create():null),h=new Z(G.from(t.create(null,G.from(l.type.create(null,f)))),d?3:1,0),m=o.start,y=o.end;n(e.tr.step(new St(m-(d?3:1),y,m,y,h,1,!0)).scrollIntoView())}return!0}}function Ql(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Go=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...f)=>{let h=u(...f)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],u=!!e,d=e||o.tr,f=()=>(!u&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,y])=>[m,(...w)=>{let _=this.buildProps(d,n),S=y(...w)(_);return l.push(S),h}])),run:f};return h}createCan(e){let{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,d])=>[u,(...f)=>d(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:Ql({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,d])=>[u,(...f)=>d(...f)(l)]))}};return l}},fp=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){let r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){let r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}};function ne(t,e,n){return t.config[e]===void 0&&t.parent?ne(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ne(t.parent,e,n):null}):t.config[e]}function ec(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function LE(t){let e=[],{nodeExtensions:n,markExtensions:r}=ec(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage,extensions:i},u=ne(s,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,y])=>{e.push({type:h,name:m,attribute:{...o,...y}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},u=ne(s,"addAttributes",l);if(!u)return;let d=u();Object.entries(d).forEach(([f,h])=>{let m={...o,...h};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,e.push({type:s.name,name:f,attribute:m})})}),e}function zt(t,e){if(typeof t=="string"){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 j(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let l=o?o.split(" "):[],u=r[i]?r[i].split(" "):[],d=l.filter(f=>!u.includes(f));r[i]=[...u,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function pp(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>j(n,r),{})}function DE(t){return typeof t=="function"}function Te(t,e=void 0,...n){return DE(t)?e?t.bind(e)(...n):t(...n):t}function OI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function RI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function ME(t,e){return"style"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let l=s.attribute.parseHTML?s.attribute.parseHTML(n):RI(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function NE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&OI(n)?!1:n!=null))}function II(t,e){var n;let r=LE(t),{nodeExtensions:i,markExtensions:o}=ec(t),s=(n=i.find(d=>ne(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{let f=r.filter(S=>S.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((S,D)=>{let L=ne(D,"extendNodeSchema",h);return{...S,...L?L(d):{}}},{}),y=NE({...m,content:Te(ne(d,"content",h)),marks:Te(ne(d,"marks",h)),group:Te(ne(d,"group",h)),inline:Te(ne(d,"inline",h)),atom:Te(ne(d,"atom",h)),selectable:Te(ne(d,"selectable",h)),draggable:Te(ne(d,"draggable",h)),code:Te(ne(d,"code",h)),whitespace:Te(ne(d,"whitespace",h)),defining:Te(ne(d,"defining",h)),isolating:Te(ne(d,"isolating",h)),attrs:Object.fromEntries(f.map(S=>{var D;return[S.name,{default:(D=S?.attribute)===null||D===void 0?void 0:D.default}]}))}),b=Te(ne(d,"parseHTML",h));b&&(y.parseDOM=b.map(S=>ME(S,f)));let w=ne(d,"renderHTML",h);w&&(y.toDOM=S=>w({node:S,HTMLAttributes:pp(S,f)}));let _=ne(d,"renderText",h);return _&&(y.toText=_),[d.name,y]})),u=Object.fromEntries(o.map(d=>{let f=r.filter(_=>_.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((_,S)=>{let D=ne(S,"extendMarkSchema",h);return{..._,...D?D(d):{}}},{}),y=NE({...m,inclusive:Te(ne(d,"inclusive",h)),excludes:Te(ne(d,"excludes",h)),group:Te(ne(d,"group",h)),spanning:Te(ne(d,"spanning",h)),code:Te(ne(d,"code",h)),attrs:Object.fromEntries(f.map(_=>{var S;return[_.name,{default:(S=_?.attribute)===null||S===void 0?void 0:S.default}]}))}),b=Te(ne(d,"parseHTML",h));b&&(y.parseDOM=b.map(_=>ME(_,f)));let w=ne(d,"renderHTML",h);return w&&(y.toDOM=_=>w({mark:_,HTMLAttributes:pp(_,f)})),[d.name,y]}));return new Ps({topNode:s,nodes:l,marks:u})}function cp(t,e){return e.nodes[t]||e.marks[t]||null}function kE(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}var LI=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var u,d;let f=((d=(u=i.type.spec).toText)===null||d===void 0?void 0:d.call(u,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-o))}),n};function vp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var qo=class{constructor(e){this.find=e.find,this.handler=e.handler}},DI=(t,e)=>{if(vp(e))return e.exec(t);let n=e(t);if(!n)return null;let 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};function Gl(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:u}=n;if(u.composing)return!1;let d=u.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1,h=LI(d)+o;return s.forEach(m=>{if(f)return;let y=DI(h,m.find);if(!y)return;let b=u.state.tr,w=Ql({state:u.state,transaction:b}),_={from:r-(y[0].length-o.length),to:i},{commands:S,chain:D,can:L}=new Go({editor:n,state:w});m.handler({state:w,range:_,match:y,commands:S,chain:D,can:L})===null||!b.steps.length||(b.setMeta(l,{transform:b,from:r,to:i,text:o}),u.dispatch(b),f=!0)}),f}function PI(t){let{editor:e,rules:n}=t,r=new De({state:{init(){return null},apply(i,o){let s=i.getMeta(r);if(s)return s;let l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{from:d,text:f}=l,h=d+f.length;Gl({editor:e,from:d,to:h,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Gl({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Gl({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Gl({editor:e,from:s.pos,to:s.pos,text:`
|
|
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function BI(t){return typeof t=="number"}var hp=class{constructor(e){this.find=e.find,this.handler=e.handler}},FI=(t,e,n)=>{if(vp(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function HI(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Go({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(y,b)=>{if(!y.isTextblock||y.type.spec.code)return;let w=Math.max(r,b),_=Math.min(i,b+y.content.size),S=y.textBetween(w-b,_-b,void 0,"\uFFFC");FI(S,o.find,s).forEach(L=>{if(L.index===void 0)return;let T=w+L.index+1,$=T+L[0].length,O={from:n.tr.mapping.map(T),to:n.tr.mapping.map($)},Y=o.handler({state:n,range:O,match:L,commands:u,chain:d,can:f,pasteEvent:s,dropEvent:l});h.push(Y)})}),h.every(y=>y!==null)}var $I=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function zI(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l=typeof DragEvent<"u"?new DragEvent("drop"):null,u=({state:f,from:h,to:m,rule:y,pasteEvt:b})=>{let w=f.tr,_=Ql({state:f,transaction:w});if(!(!HI({editor:e,state:_,from:Math.max(h-1,0),to:m.b-1,rule:y,pasteEvent:b,dropEvent:l})||!w.steps.length))return l=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,w};return n.map(f=>new De({view(h){let m=y=>{var b;r=!((b=h.dom.parentElement)===null||b===void 0)&&b.contains(y.target)?h.dom.parentElement:null};return window.addEventListener("dragstart",m),{destroy(){window.removeEventListener("dragstart",m)}}},props:{handleDOMEvents:{drop:(h,m)=>(o=r===h.dom.parentElement,l=m,!1),paste:(h,m)=>{var y;let b=(y=m.clipboardData)===null||y===void 0?void 0:y.getData("text/html");return s=m,i=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(h,m,y)=>{let b=h[0],w=b.getMeta("uiEvent")==="paste"&&!i,_=b.getMeta("uiEvent")==="drop"&&!o,S=b.getMeta("applyPasteRules"),D=!!S;if(!w&&!_&&!D)return;if(D){let{from:$,text:O}=S,Y=$+O.length,ee=$I(O);return u({rule:f,state:y,from:$,to:{b:Y},pasteEvt:ee})}let L=m.doc.content.findDiffStart(y.doc.content),T=m.doc.content.findDiffEnd(y.doc.content);if(!(!BI(L)||!T||L===T.b))return u({rule:f,state:y,from:L,to:T,pasteEvt:s})}}))}function UI(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}var mp=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=II(this.extensions,n),this.setupExtensions()}static resolve(e){let n=t.sort(t.flatten(e)),r=UI(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{let r={name:n.name,options:n.options,storage:n.storage},i=ne(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=ne(r,"priority")||100,s=ne(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:cp(n.name,this.schema)},i=ne(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){let{editor:e}=this,n=t.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{let l={name:s.name,options:s.options,storage:s.storage,editor:e,type:cp(s.name,this.schema)},u=[],d=ne(s,"addKeyboardShortcuts",l),f={};if(s.type==="mark"&&ne(s,"exitable",l)&&(f.ArrowRight=()=>je.handleExit({editor:e,mark:s})),d){let w=Object.fromEntries(Object.entries(d()).map(([_,S])=>[_,()=>S({editor:e})]));f={...f,...w}}let h=dE(f);u.push(h);let m=ne(s,"addInputRules",l);kE(s,e.options.enableInputRules)&&m&&r.push(...m());let y=ne(s,"addPasteRules",l);kE(s,e.options.enablePasteRules)&&y&&i.push(...y());let b=ne(s,"addProseMirrorPlugins",l);if(b){let w=b();u.push(...w)}return u}).flat();return[PI({editor:e,rules:r}),...zI({editor:e,rules:i}),...o]}get attributes(){return LE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=ec(this.extensions);return Object.fromEntries(n.filter(r=>!!ne(r,"addNodeView")).map(r=>{let i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:zt(r.name,this.schema)},s=ne(r,"addNodeView",o);if(!s)return[];let l=(u,d,f,h)=>{let m=pp(u,i);return s()({editor:e,node:u,getPos:f,decorations:h,HTMLAttributes:m,extension:r})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;let r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:cp(e.name,this.schema)};e.type==="mark"&&(!((n=Te(ne(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);let i=ne(e,"onBeforeCreate",r),o=ne(e,"onCreate",r),s=ne(e,"onUpdate",r),l=ne(e,"onSelectionUpdate",r),u=ne(e,"onTransaction",r),d=ne(e,"onFocus",r),f=ne(e,"onBlur",r),h=ne(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}};function WI(t){return Object.prototype.toString.call(t).slice(8,-1)}function ql(t){return WI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function tc(t,e){let n={...t};return ql(t)&&ql(e)&&Object.keys(e).forEach(r=>{ql(e[r])&&ql(t[r])?n[r]=tc(t[r],e[r]):n[r]=e[r]}),n}var Ve=class t{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&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=Te(ne(this,"addOptions",{name:this.name}))),this.storage=Te(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>tc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(ne(n,"addOptions",{name:n.name})),n.storage=Te(ne(n,"addStorage",{name:n.name,options:n.options})),n}};function PE(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=`
|
|
|
|
`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,i,(u,d,f,h)=>{var m;u.isBlock&&d>r&&(l+=o);let y=s?.[u.type.name];if(y)return f&&(l+=y({node:u,pos:d,parent:f,index:h,range:e})),!1;u.isText&&(l+=(m=u?.text)===null||m===void 0?void 0:m.slice(Math.max(r,d)-d,i-d))}),l}function BE(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var KI=Ve.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new De({key:new Ke("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),l=Math.max(...o.map(f=>f.$to.pos)),u=BE(n);return PE(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),VI=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),GI=(t=!1)=>({commands:e})=>e.setContent("",t),qI=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,u)=>{if(l.type.isText)return;let{doc:d,mapping:f}=e,h=d.resolve(f.map(u)),m=d.resolve(f.map(u+l.nodeSize)),y=h.blockRange(m);if(!y)return;let b=Pr(y);if(l.type.isTextblock){let{defaultType:w}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(y.start,w)}(b||b===0)&&e.lift(y,b)})}),!0},YI=t=>e=>t(e),JI=()=>({state:t,dispatch:e})=>rp(t,e),XI=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new ce(r.doc.resolve(s-1))),!0},ZI=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let l=i.before(o),u=i.after(o);t.delete(l,u).scrollIntoView()}return!0}return!1},jI=t=>({tr:e,state:n,dispatch:r})=>{let i=zt(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let u=o.before(s),d=o.after(s);e.delete(u,d).scrollIntoView()}return!0}return!1},QI=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},eL=()=>({state:t,dispatch:e})=>Vl(t,e),tL=()=>({commands:t})=>t.keyboardShortcut("Enter"),nL=()=>({state:t,dispatch:e})=>np(t,e);function Xl(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:vp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function gp(t,e,n={}){return t.find(r=>r.type===e&&Xl(r.attrs,n))}function rL(t,e,n={}){return!!gp(t,e,n)}function wp(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;let i=gp([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,l=o+1,u=s+r.node.nodeSize;for(gp([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&rL([...t.parent.child(l).marks],e,n);)u+=t.parent.child(l).nodeSize,l+=1;return{from:s,to:u}}function gi(t,e){if(typeof t=="string"){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}var iL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=gi(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:d,to:f}=l;if(i){let h=wp(u,o,e);if(h&&h.from<=d&&h.to>=f){let m=ce.create(s,h.from,h.to);n.setSelection(m)}}return!0},oL=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function nc(t){return t instanceof ce}function zr(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function FE(t,e=null){if(!e)return null;let n=ue.atStart(t),r=ue.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;let i=n.from,o=r.to;return e==="all"?ce.create(t,zr(0,i,o),zr(t.content.size,i,o)):ce.create(t,zr(e,i,o),zr(e,i,o))}function xp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var sL=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{xp()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!nc(n.state.selection))return s(),!0;let l=FE(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return o&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},aL=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),lL=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),HE=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&HE(r)}return t};function Yl(t){let e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return HE(n)}function Zl(t,e,n){n={slice:!0,parseOptions:{},...n};let r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return G.fromArray(t.map(l=>e.nodeFromJSON(l)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Zl("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="",u=new Ps({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Ir.fromSchema(u).parseSlice(Yl(t),n.parseOptions):Ir.fromSchema(u).parse(Yl(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}let o=Ir.fromSchema(e);return n.slice?o.parseSlice(Yl(t),n.parseOptions).content:o.parse(Yl(t),n.parseOptions)}return Zl("",e,n)}function cL(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof en||i instanceof St))return;let o=t.mapping.maps[r],s=0;o.forEach((l,u,d,f)=>{s===0&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var uL=t=>!("type"in t),dL=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=Zl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(b){return o.emit("contentError",{editor:o,error:b,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:u,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((uL(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),u===d&&h){let{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,d+=1)}let y;f?(Array.isArray(e)?y=e.map(b=>b.text||"").join(""):typeof e=="object"&&e&&e.text?y=e.text:y=e,r.insertText(y,u,d)):(y=l,r.replaceWith(u,d,y)),n.updateSelection&&cL(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:y}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:y})}return!0},fL=()=>({state:t,dispatch:e})=>yE(t,e),pL=()=>({state:t,dispatch:e})=>EE(t,e),hL=()=>({state:t,dispatch:e})=>Yf(t,e),mL=()=>({state:t,dispatch:e})=>Zf(t,e),gL=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Po(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},bL=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Po(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},yL=()=>({state:t,dispatch:e})=>hE(t,e),EL=()=>({state:t,dispatch:e})=>mE(t,e);function $E(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function vL(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l+=1){let u=e[l];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))xp()||$E()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}var wL=t=>({editor:e,view:n,tr:r,dispatch:i})=>{let o=vL(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u?.steps.forEach(d=>{let f=d.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function na(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?zt(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;let y=Math.max(r,m),b=Math.min(i,m+h.nodeSize);l.push({node:h,from:y,to:b})});let u=i-r,d=l.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>Xl(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var xL=(t,e={})=>({state:n,dispatch:r})=>{let i=zt(t,n.schema);return na(n,i,e)?vE(n,r):!1},_L=()=>({state:t,dispatch:e})=>ip(t,e),SL=t=>({state:e,dispatch:n})=>{let r=zt(t,e.schema);return CE(r)(e,n)},TL=()=>({state:t,dispatch:e})=>ep(t,e);function rc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function OE(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var CL=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=rc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=zt(t,r.schema)),l==="mark"&&(s=gi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,f)=>{o&&o===d.type&&n.setNodeMarkup(f,void 0,OE(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&n.addMark(f,f+d.nodeSize,s.create(OE(h.attrs,e)))})})}),!0):!1},AL=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),ML=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),NL=()=>({state:t,dispatch:e})=>Jf(t,e),kL=()=>({state:t,dispatch:e})=>jf(t,e),OL=()=>({state:t,dispatch:e})=>wE(t,e),RL=()=>({state:t,dispatch:e})=>sp(t,e),IL=()=>({state:t,dispatch:e})=>op(t,e);function bp(t,e,n={},r={}){return Zl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var LL=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var u,d;let{doc:f}=o;if(n.preserveWhitespace!=="full"){let h=bp(t,i.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck});return s&&o.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:f.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function bi(t,e){let n=gi(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});let l=s.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function zE(t,e){let n=new li(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function _p(t){for(let e=0;e<t.edgeCount;e+=1){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Qi(t,e){let n=[];return t.descendants((r,i)=>{e(r)&&n.push({node:r,pos:i})}),n}function UE(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Sp(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function eo(t){return e=>Sp(e.$from,t)}function DL(t,e){let n=Lr.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function PL(t,e){let n={from:0,to:t.content.size};return PE(t,n,e)}function BL(t,e){let n=zt(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});let s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function Tp(t,e){let n=rc(typeof e=="string"?e:e.name,t.schema);return n==="node"?BL(t,e):n==="mark"?bi(t,e):{}}function FL(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function HL(t){let e=FL(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function WE(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((l,u)=>{s.push({from:l,to:u})});else{let{from:l,to:u}=n[o];if(l===void 0||u===void 0)return;s.push({from:l,to:u})}s.forEach(({from:l,to:u})=>{let d=e.slice(o).map(l,-1),f=e.slice(o).map(u),h=e.invert().map(d,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:d,to:f}})})}),HL(r)}function ic(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t),s=wp(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Jl(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function yp(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?gi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>Xl(h.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:h,$to:m})=>{let y=h.pos,b=m.pos;t.doc.nodesBetween(y,b,(w,_)=>{if(!w.isText&&!w.marks.length)return;let S=Math.max(y,_),D=Math.min(b,_+w.nodeSize),L=D-S;s+=L,l.push(...w.marks.map(T=>({mark:T,from:S,to:D})))})}),s===0)return!1;let u=l.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>Xl(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=l.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+d:u)>=s}function Ur(t,e,n={}){if(!e)return na(t,null,n)||yp(t,null,n);let r=rc(e,t.schema);return r==="node"?na(t,e,n):r==="mark"?yp(t,e,n):!1}function RE(t,e){let{nodeExtensions:n}=ec(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Te(ne(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function oc(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(oc(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function sc(t){return t instanceof pe}function ac(t,e,n){let i=t.state.doc.content.size,o=zr(e,0,i),s=zr(n,0,i),l=t.coordsAtPos(o),u=t.coordsAtPos(s,-1),d=Math.min(l.top,u.top),f=Math.max(l.bottom,u.bottom),h=Math.min(l.left,u.left),m=Math.max(l.right,u.right),y=m-h,b=f-d,S={top:d,bottom:f,left:h,right:m,width:y,height:b,x:h,y:d};return{...S,toJSON:()=>S}}function $L(t,e,n){var r;let{selection:i}=e,o=null;if(nc(i)&&(o=i.$cursor),o){let l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,h,m)=>{if(d)return!1;if(f.isInline){let y=!m||m.type.allowsMarkType(n),b=!!n.isInSet(f.marks)||!f.marks.some(w=>w.type.excludes(n));d=y&&b}return!d}),d})}var zL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,u=gi(t,r.schema);if(i)if(s){let d=bi(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{let f=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(f,h,(m,y)=>{let b=Math.max(y,f),w=Math.min(y+m.nodeSize,h);m.marks.find(S=>S.type===u)?m.marks.forEach(S=>{u===S.type&&n.addMark(b,w,u.create({...S.attrs,...e}))}):n.addMark(b,w,u.create(e))})});return $L(r,n,u)},UL=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),WL=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=zt(t,n.schema);return o.isTextblock?i().command(({commands:s})=>ap(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>ap(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},KL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=zr(t,0,r.content.size),o=pe.create(r,i);e.setSelection(o)}return!0},VL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ce.atStart(r).from,l=ce.atEnd(r).to,u=zr(i,s,l),d=zr(o,s,l),f=ce.create(r,u,d);e.setSelection(f)}return!0},GL=t=>({state:e,dispatch:n})=>{let r=zt(t,e.schema);return AE(r)(e,n)};function IE(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var qL=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:l,$to:u}=o,d=i.extensionManager.attributes,f=Jl(d,l.node().type.name,l.node().attrs);if(o instanceof pe&&o.node.isBlock)return!l.parentOffset||!Fn(s,l.pos)?!1:(r&&(t&&IE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let h=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:_p(l.node(-1).contentMatchAt(l.indexAfter(-1))),y=h&&m?[{type:m,attrs:f}]:void 0,b=Fn(e.doc,e.mapping.map(l.pos),1,y);if(!y&&!b&&Fn(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,y=m?[{type:m,attrs:f}]:void 0),r){if(b&&(o instanceof ce&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,y),m&&!h&&!l.parentOffset&&l.parent.type!==m)){let w=e.mapping.map(l.before()),_=e.doc.resolve(w);l.node(-1).canReplaceWith(_.index(),_.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&IE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return b},YL=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let l=zt(t,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;let h=u.node(-1);if(h.type!==l)return!1;let m=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let S=G.empty,D=u.index(-1)?1:u.index(-2)?2:3;for(let ee=u.depth-D;ee>=u.depth-3;ee-=1)S=G.from(u.node(ee).copy(S));let L=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,T={...Jl(m,u.node().type.name,u.node().attrs),...e},$=((s=l.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(T))||void 0;S=S.append(G.from(l.createAndFill(null,$)||void 0));let O=u.before(u.depth-(D-1));n.replace(O,u.after(-L),new Z(S,4-D,0));let Y=-1;n.doc.nodesBetween(O,n.doc.content.size,(ee,z)=>{if(Y>-1)return!1;ee.isTextblock&&ee.content.size===0&&(Y=z+1)}),Y>-1&&n.setSelection(ce.near(n.doc.resolve(Y))),n.scrollIntoView()}return!0}let y=d.pos===u.end()?h.contentMatchAt(0).defaultType:null,b={...Jl(m,h.type.name,h.attrs),...e},w={...Jl(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);let _=y?[{type:l,attrs:b},{type:y,attrs:w}]:[{type:l,attrs:b}];if(!Fn(n.doc,u.pos,2))return!1;if(i){let{selection:S,storedMarks:D}=r,{splittableMarks:L}=o.extensionManager,T=D||S.$to.parentOffset&&S.$from.marks();if(n.split(u.pos,2,_).scrollIntoView(),!T||!i)return!0;let $=T.filter(O=>L.includes(O.type.name));n.ensureMarks($)}return!0},up=(t,e)=>{let n=eo(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&nr(t.doc,n.pos)&&t.join(n.pos),!0},dp=(t,e)=>{let n=eo(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&nr(t.doc,r)&&t.join(r),!0},JL=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:u,commands:d,can:f})=>{let{extensions:h,splittableMarks:m}=i.extensionManager,y=zt(t,s.schema),b=zt(e,s.schema),{selection:w,storedMarks:_}=s,{$from:S,$to:D}=w,L=S.blockRange(D),T=_||w.$to.parentOffset&&w.$from.marks();if(!L)return!1;let $=eo(O=>RE(O.type.name,h))(w);if(L.depth>=1&&$&&L.depth-$.depth<=1){if($.node.type===y)return d.liftListItem(b);if(RE($.node.type.name,h)&&y.validContent($.node.content)&&l)return u().command(()=>(o.setNodeMarkup($.pos,y),!0)).command(()=>up(o,y)).command(()=>dp(o,y)).run()}return!n||!T||!l?u().command(()=>f().wrapInList(y,r)?!0:d.clearNodes()).wrapInList(y,r).command(()=>up(o,y)).command(()=>dp(o,y)).run():u().command(()=>{let O=f().wrapInList(y,r),Y=T.filter(ee=>m.includes(ee.type.name));return o.ensureMarks(Y),O?!0:d.clearNodes()}).wrapInList(y,r).command(()=>up(o,y)).command(()=>dp(o,y)).run()},XL=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=gi(t,r.schema);return yp(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},ZL=(t,e,n={})=>({state:r,commands:i})=>{let o=zt(t,r.schema),s=zt(e,r.schema);return na(r,o,n)?i.setNode(s):i.setNode(o,n)},jL=(t,e={})=>({state:n,commands:r})=>{let i=zt(t,n.schema);return na(n,i,e)?r.lift(i):r.wrapIn(i,e)},QL=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){let s=t.tr,l=o.transform;for(let u=l.steps.length-1;u>=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(o.text){let u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},eD=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},tD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=gi(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!i)return!0;if(f&&s){let{from:m,to:y}=l,b=(o=d.marks().find(_=>_.type===u))===null||o===void 0?void 0:o.attrs,w=wp(d,u,b);w&&(m=w.from,y=w.to),n.removeMark(m,y,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},nD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=rc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=zt(t,r.schema)),l==="mark"&&(s=gi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{let d=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(d,f,(h,m)=>{o&&o===h.type&&n.setNodeMarkup(m,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(y=>{if(s===y.type){let b=Math.max(m,d),w=Math.min(m+h.nodeSize,f);n.addMark(b,w,s.create({...y.attrs,...e}))}})})}),!0):!1},rD=(t,e={})=>({state:n,dispatch:r})=>{let i=zt(t,n.schema);return SE(i,e)(n,r)},iD=(t,e={})=>({state:n,dispatch:r})=>{let i=zt(t,n.schema);return TE(i,e)(n,r)},oD=Object.freeze({__proto__:null,blur:VI,clearContent:GI,clearNodes:qI,command:YI,createParagraphNear:JI,cut:XI,deleteCurrentNode:ZI,deleteNode:jI,deleteRange:QI,deleteSelection:eL,enter:tL,exitCode:nL,extendMarkRange:iL,first:oL,focus:sL,forEach:aL,insertContent:lL,insertContentAt:dL,joinBackward:hL,joinDown:pL,joinForward:mL,joinItemBackward:gL,joinItemForward:bL,joinTextblockBackward:yL,joinTextblockForward:EL,joinUp:fL,keyboardShortcut:wL,lift:xL,liftEmptyBlock:_L,liftListItem:SL,newlineInCode:TL,resetAttributes:CL,scrollIntoView:AL,selectAll:ML,selectNodeBackward:NL,selectNodeForward:kL,selectParentNode:OL,selectTextblockEnd:RL,selectTextblockStart:IL,setContent:LL,setMark:zL,setMeta:UL,setNode:WL,setNodeSelection:KL,setTextSelection:VL,sinkListItem:GL,splitBlock:qL,splitListItem:YL,toggleList:JL,toggleMark:XL,toggleNode:ZL,toggleWrap:jL,undoInputRule:QL,unsetAllMarks:eD,unsetMark:tD,updateAttributes:nD,wrapIn:rD,wrapInList:iD}),sD=Ve.create({name:"commands",addCommands(){return{...oD}}}),aD=Ve.create({name:"editable",addProseMirrorPlugins(){return[new De({key:new Ke("editable"),props:{editable:()=>this.editor.options.editable}})]}}),lD=Ve.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new De({key:new Ke("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),cD=Ve.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:u,doc:d}=l,{empty:f,$anchor:h}=u,{pos:m,parent:y}=h,b=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,w=b.parent.type.spec.isolating,_=h.pos-h.parentOffset,S=w&&b.parent.childCount===1?_===h.pos:ue.atStart(d).from===m;return!f||!y.type.isTextblock||y.textContent.length||!S||S&&h.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.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()},i={...r},o={...r,"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 xp()||$E()?o:i},addProseMirrorPlugins(){return[new De({key:new Ke("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(b=>b.docChanged)&&!e.doc.eq(n.doc)))return;let{empty:i,from:o,to:s}=e.selection,l=ue.atStart(e.doc).from,u=ue.atEnd(e.doc).to;if(i||!(o===l&&s===u)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;let h=n.tr,m=Ql({state:n,transaction:h}),{commands:y}=new Go({editor:this.editor,state:m});if(y.clearNodes(),!!h.steps.length)return h}})]}}),uD=Ve.create({name:"tabindex",addProseMirrorPlugins(){return[new De({key:new Ke("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Ep=class t{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;let l=new t(s,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new t(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let l=0;l<s.length;l+=1){let u=s[l];if(o[u]!==n[u])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;let o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(u=>n[u]===s.node.attrs[u])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){let n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}},dD=`.ProseMirror {
|
|
position: relative;
|
|
}
|
|
|
|
.ProseMirror {
|
|
word-wrap: break-word;
|
|
white-space: pre-wrap;
|
|
white-space: break-spaces;
|
|
-webkit-font-variant-ligatures: none;
|
|
font-variant-ligatures: none;
|
|
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
}
|
|
|
|
.ProseMirror [contenteditable="false"] {
|
|
white-space: normal;
|
|
}
|
|
|
|
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
.ProseMirror pre {
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
img.ProseMirror-separator {
|
|
display: inline !important;
|
|
border: none !important;
|
|
margin: 0 !important;
|
|
width: 0 !important;
|
|
height: 0 !important;
|
|
}
|
|
|
|
.ProseMirror-gapcursor {
|
|
display: none;
|
|
pointer-events: none;
|
|
position: absolute;
|
|
margin: 0;
|
|
}
|
|
|
|
.ProseMirror-gapcursor:after {
|
|
content: "";
|
|
display: block;
|
|
position: absolute;
|
|
top: -2px;
|
|
width: 20px;
|
|
border-top: 1px solid black;
|
|
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
}
|
|
|
|
@keyframes ProseMirror-cursor-blink {
|
|
to {
|
|
visibility: hidden;
|
|
}
|
|
}
|
|
|
|
.ProseMirror-hideselection *::selection {
|
|
background: transparent;
|
|
}
|
|
|
|
.ProseMirror-hideselection *::-moz-selection {
|
|
background: transparent;
|
|
}
|
|
|
|
.ProseMirror-hideselection * {
|
|
caret-color: transparent;
|
|
}
|
|
|
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
display: block;
|
|
}
|
|
|
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
opacity: 0
|
|
}`;function fD(t,e,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var jl=class extends fp{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n}},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=fD(dD,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){let r=DE(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;let n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;let i=[...this.options.enableCoreExtensions?[aD,KI.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),sD,lD,cD,uD]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new mp(i,this)}createCommandManager(){this.commandManager=new Go({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=bp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=bp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let n=FE(e,this.options.autofocus);this.view=new $l(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:kl.create({doc:e,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}let n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Tp(this.state,e)}isActive(e,n){let r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return Ur(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return DL(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:n=`
|
|
|
|
`,textSerializers:r={}}=e||{};return PL(this.state.doc,{blockSeparator:n,textSerializers:{...BE(this.schema),...r}})}get isEmpty(){return oc(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){let n=this.state.doc.resolve(e);return new Ep(n,this)}get $doc(){return this.$pos(0)}};function Un(t){return new qo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],l=r[0];if(s){let u=l.search(/\S/),d=n.from+l.indexOf(s),f=d+s.length;if(ic(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(w=>w===t.type&&w!==y.mark.type)).filter(y=>y.to>d).length)return null;f<n.to&&o.delete(f,n.to),d>n.from&&o.delete(n.from+u,d);let m=n.from+u+s.length;o.addMark(n.from+u,m,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function lc(t){return new qo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,l=n.to,u=t.type.create(i);if(r[1]){let d=r[0].lastIndexOf(r[1]),f=s+d;f>l?f=l:l=f+r[1].length;let h=r[0][r[0].length-1];o.insertText(h,s+r[0].length-1),o.replaceWith(f,l,u)}else if(r[0]){let d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function ra(t){return new qo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Te(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function yi(t){return new qo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Te(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),d=u&&Do(u,t.type,o);if(!d)return null;if(s.wrap(u,d),t.keepMarks&&t.editor){let{selection:h,storedMarks:m}=e,{splittableMarks:y}=t.editor.extensionManager,b=m||h.$to.parentOffset&&h.$from.marks();if(b){let w=b.filter(_=>y.includes(_.type.name));s.ensureMarks(w)}}if(t.keepAttributes){let h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}let f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&nr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&s.join(n.from-1)}})}var je=class t{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&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=Te(ne(this,"addOptions",{name:this.name}))),this.storage=Te(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>tc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(ne(n,"addOptions",{name:n.name})),n.storage=Te(ne(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(d=>d?.type.name===n.name))return!1;let u=s.find(d=>d?.type.name===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}},oe=class t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&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=Te(ne(this,"addOptions",{name:this.name}))),this.storage=Te(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>tc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(ne(n,"addOptions",{name:n.name})),n.storage=Te(ne(n,"addStorage",{name:n.name,options:n.options})),n}};function vn(t){return new hp({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Te(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,l=r[r.length-1],u=r[0],d=n.to;if(l){let f=u.search(/\S/),h=n.from+u.indexOf(l),m=h+l.length;if(ic(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(_=>_===t.type&&_!==b.mark.type)).filter(b=>b.to>h).length)return null;m<n.to&&s.delete(m,n.to),h>n.from&&s.delete(n.from+f,h),d=n.from+f+l.length,s.addMark(n.from+f,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function KE(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var pD=/^\s*>\s$/,VE=oe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[yi({find:pD,type:this.type})]}});var hD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,mD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,gD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,bD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,GE=je.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Un({find:hD,type:this.type}),Un({find:gD,type:this.type})]},addPasteRules(){return[vn({find:mD,type:this.type}),vn({find:bD,type:this.type})]}});var yD=oe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",j(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)}}}),qE=je.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",j(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=bi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),YE=/^\s*([-+*])\s$/,JE=oe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",j(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yD.name,this.editor.getAttributes(qE.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=yi({find:YE,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=yi({find:YE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(qE.name),editor:this.editor})),[t]}});var ED=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,vD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,XE=je.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Un({find:ED,type:this.type})]},addPasteRules(){return[vn({find:vD,type:this.type})]}});var ZE=je.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",j(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=bi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}});var jE=Ve.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var QE=oe.create({name:"doc",topNode:!0,content:"block+"});function ev(t={}){return new De({view(e){return new Cp(e,t)}})}var Cp=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let f=d.getBoundingClientRect(),h=l?f.bottom:f.top;l&&u&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Al(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};var tv=Ve.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[ev(this.options)]}});var rn=class t extends ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):ue.near(r)}content(){return Z.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}getBookmark(){return new Ap(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!wD(e)||!xD(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&t.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)<l.childCount:e.index(s)>0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let u=e.doc.resolve(i);if(t.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!pe.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(t.valid(l))return l}return null}}};rn.prototype.visible=!1;rn.findFrom=rn.findGapCursorFrom;ue.jsonID("gapcursor",rn);var Ap=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return rn.valid(n)?new rn(n):ue.near(n)}};function wD(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function xD(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function nv(){return new De({props:{decorations:CD,createSelectionBetween(t,e,n){return e.pos==n.pos&&rn.valid(n)?new rn(n):null},handleClick:SD,handleKeyDown:_D,handleDOMEvents:{beforeinput:TD}}})}var _D=ta({ArrowLeft:cc("horiz",-1),ArrowRight:cc("horiz",1),ArrowUp:cc("vert",-1),ArrowDown:cc("vert",1)});function cc(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,u=s.empty;if(s instanceof ce){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=rn.findGapCursorFrom(l,e,u);return d?(i&&i(r.tr.setSelection(new rn(d))),!0):!1}}function SD(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!rn.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&pe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new rn(r))),!0)}function TD(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof rn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=G.empty;for(let s=r.length-1;s>=0;s--)i=G.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new Z(i,0,0));return o.setSelection(ce.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function CD(t){if(!(t.selection instanceof rn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",st.create(t.doc,[Tt.widget(t.selection.head,e,{key:"gapcursor"})])}var rv=Ve.create({name:"gapCursor",addProseMirrorPlugins(){return[nv()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Te(ne(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var iv=oe.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",j(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&s){let h=u.filter(m=>l.includes(m.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var ov=oe.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{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]}`,j(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},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=>ra({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var uc=200,qt=function(){};qt.prototype.append=function(e){return e.length?(e=qt.from(e),!this.length&&e||e.length<uc&&this.leafAppend(e)||this.length<uc&&e.leafPrepend(this)||this.appendInner(e)):this};qt.prototype.prepend=function(e){return e.length?qt.from(e).append(this):this};qt.prototype.appendInner=function(e){return new AD(this,e)};qt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?qt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};qt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};qt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};qt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};qt.from=function(e){return e instanceof qt?e:e&&e.length?new sv(e):qt.empty};var sv=function(t){function e(r){t.call(this),this.values=r}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(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var u=o;u<s;u++)if(i(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var u=o-1;u>=s;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=uc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=uc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qt);qt.empty=new sv([]);var AD=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qt),Mp=qt;var MD=500,no=class t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,u,d=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,f.push(h);return}if(i){f.push(new mr(h.map));let y=h.step.map(i.slice(o)),b;y&&s.maybeStep(y).doc&&(b=s.mapping.maps[s.mapping.maps.length-1],d.push(new mr(b,void 0,void 0,d.length+f.length))),o--,b&&i.appendMap(b,o)}else s.maybeStep(h.step);if(h.selection)return l=i?h.selection.map(i.slice(o)):h.selection,u=new t(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let h=e.steps[f].invert(e.docs[f]),m=new mr(e.mapping.maps[f],h,n),y;(y=u&&u.merge(m))&&(m=y,f?o.pop():l=l.slice(0,l.length-1)),o.push(m),n&&(s++,n=void 0),i||(u=m)}let d=s-r.depth;return d>kD&&(l=ND(l,d),s-=d),new t(l.append(o),s)}remapping(e,n){let r=new $s;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(n=>new mr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},i);let u=n;this.items.forEach(m=>{let y=o.getMirror(--u);if(y==null)return;s=Math.min(s,y);let b=o.maps[y];if(m.step){let w=e.steps[y].invert(e.docs[y]),_=m.selection&&m.selection.map(o.slice(u+1,y));_&&l++,r.push(new mr(b,w,_))}else r.push(new mr(b))},i);let d=[];for(let m=n;m<s;m++)d.push(new mr(o.maps[m]));let f=this.items.slice(0,i).append(d).append(r),h=new t(f,l);return h.emptyItemCount()>MD&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let h=new mr(d.invert(),u,f),m,y=i.length-1;(m=i.length&&i[y].merge(h))?i[y]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new t(Mp.from(i.reverse()),o)}};no.empty=new no(Mp.empty,0);function ND(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var mr=class t{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}},gr=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},kD=20;function OD(t,e,n,r){let i=n.getMeta(to),o;if(i)return i.historyState;n.getMeta(LD)&&(t=new gr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(to))return s.getMeta(to).redo?new gr(t.done.addTransform(n,void 0,r,dc(e)),t.undone,av(n.mapping.maps),t.prevTime,t.prevComposition):new gr(t.done,t.undone.addTransform(n,void 0,r,dc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!RD(n,t.prevRanges)),d=s?Np(t.prevRanges,n.mapping):av(n.mapping.maps);return new gr(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,dc(e)),no.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gr(t.done.rebased(n,o),t.undone.rebased(n,o),Np(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Np(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function RD(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function av(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Np(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function ID(t,e,n){let r=dc(e),i=to.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),u=new gr(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(to,{redo:n,historyState:u})}var kp=!1,lv=null;function dc(t){let e=t.plugins;if(lv!=e){kp=!1,lv=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){kp=!0;break}}return kp}var to=new Ke("history"),LD=new Ke("closeHistory");function cv(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new De({key:to,state:{init(){return new gr(no.empty,no.empty,null,0,-1)},apply(e,n,r){return OD(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Op:r=="historyRedo"?Rp:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function fc(t,e){return(n,r)=>{let i=to.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=ID(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}var Op=fc(!1,!0),Rp=fc(!0,!0),Az=fc(!1,!1),Mz=fc(!0,!1);var uv=Ve.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Op(t,e),redo:()=>({state:t,dispatch:e})=>Rp(t,e)}},addProseMirrorPlugins(){return[cv(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var dv=oe.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",j(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):sc(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:l})=>{var u;if(l){let{$to:d}=s.selection,f=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?s.setSelection(ce.create(s.doc,d.pos+1)):d.nodeAfter.isBlock?s.setSelection(pe.create(s.doc,d.pos)):s.setSelection(ce.create(s.doc,d.pos));else{let h=(u=d.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();h&&(s.insert(f,h),s.setSelection(ce.create(s.doc,f+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[lc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var DD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,PD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,BD=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,FD=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,fv=je.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Un({find:DD,type:this.type}),Un({find:BD,type:this.type})]},addPasteRules(){return[vn({find:PD,type:this.type}),vn({find:FD,type:this.type})]}});var Ip=oe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",j(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)}}});var HD=oe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",j(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)}}}),pv=je.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",j(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=bi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),hv=/^(\d+)\.\s$/,mv=oe.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",j(this.options.HTMLAttributes,n),0]:["ol",j(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(HD.name,this.editor.getAttributes(pv.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=yi({find:hv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=yi({find:hv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(pv.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var pc=oe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var gv=Ve.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new De({key:new Ke("placeholder"),props:{decorations:({doc:t,selection:e})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;let o=this.editor.isEmpty;return t.descendants((s,l)=>{let u=r>=l&&r<=l+s.nodeSize,d=!s.isLeaf&&oc(s);if((u||!this.options.showOnlyCurrent)&&d){let f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);let h=Tt.node(l,l+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:u}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),st.create(t,i)}}})]}});var $D=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,zD=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,bv=je.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Un({find:$D,type:this.type})]},addPasteRules(){return[vn({find:zD,type:this.type})]}});var yv=je.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});var Ev=je.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var Dp,Pp;if(typeof WeakMap<"u"){let t=new WeakMap;Dp=e=>t.get(e),Pp=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;Dp=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Pp=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var mt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){let n=this.map[e];if(n!=t)continue;let r=e%this.width,i=e/this.width|0,o=r+1,s=i+1;for(let l=1;o<this.width&&this.map[e+l]==n;l++)o++;for(let l=1;s<this.height&&this.map[e+this.width*l]==n;l++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){let{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:l,top:u,bottom:d}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(i,u),right:Math.max(r,l),bottom:Math.max(o,d)}}cellsInRect(t){let e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){let o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==t){let s=e+t*this.width,l=(t+1)*this.width;for(;s<l&&this.map[s]<i;)s++;return s==l?o-1:this.map[s]}i=o}}static get(t){return Dp(t)||Pp(t,UD(t))}};function UD(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);let e=WD(t),n=t.childCount,r=[],i=0,o=null,s=[];for(let d=0,f=e*n;d<f;d++)r[d]=0;for(let d=0,f=0;d<n;d++){let h=t.child(d);f++;for(let b=0;;b++){for(;i<r.length&&r[i]!=0;)i++;if(b==h.childCount)break;let w=h.child(b),{colspan:_,rowspan:S,colwidth:D}=w.attrs;for(let L=0;L<S;L++){if(L+d>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:S-L});break}let T=i+L*e;for(let $=0;$<_;$++){r[T+$]==0?r[T+$]=f:(o||(o=[])).push({type:"collision",row:d,pos:f,n:_-$});let O=D&&D[$];if(O){let Y=(T+$)%e*2,ee=s[Y];ee==null||ee!=O&&s[Y+1]==1?(s[Y]=O,s[Y+1]=1):ee==O&&s[Y+1]++}}}i+=_,f+=w.nodeSize}let m=(d+1)*e,y=0;for(;i<m;)r[i++]==0&&y++;y&&(o||(o=[])).push({type:"missing",row:d,n:y}),f++}let l=new mt(e,n,r,o),u=!1;for(let d=0;!u&&d<s.length;d+=2)s[d]!=null&&s[d+1]<n&&(u=!0);return u&&KD(l,s,t),l}function WD(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),o=0;if(n)for(let s=0;s<r;s++){let l=t.child(s);for(let u=0;u<l.childCount;u++){let d=l.child(u);s+d.attrs.rowspan>r&&(o+=d.attrs.colspan)}}for(let s=0;s<i.childCount;s++){let l=i.child(s);o+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function KD(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i<t.map.length;i++){let o=t.map[i];if(r[o])continue;r[o]=!0;let s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let l=null,u=s.attrs;for(let d=0;d<u.colspan;d++){let f=(i+d)%t.width,h=e[f*2];h!=null&&(!u.colwidth||u.colwidth[d]!=h)&&((l||(l=VD(u)))[d]=h)}l&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:l})}}function VD(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function on(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var Ei=new Ke("selectingCells");function Yo(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function GD(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function or(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Ec(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Yo(e.$head)||qD(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function qD(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Bp(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function YD(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function $p(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Mv(t,e,n){let r=t.node(-1),i=mt.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function ro(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Nv(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function JD(t,e,n){let r=on(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var tt=class Wr extends ue{constructor(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),l=e.node(0),u=i.cellsInRect(s).filter(f=>f!=n.pos-o);u.unshift(n.pos-o);let d=u.map(f=>{let h=r.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);let m=o+f+1;return new Fo(l.resolve(m),l.resolve(m+h.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Bp(r)&&Bp(i)&&$p(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Wr.rowSelection(r,i):o&&this.isColSelection()?Wr.colSelection(r,i):new Wr(r,i)}return ce.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=mt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let u=i.top;u<i.bottom;u++){let d=[];for(let f=u*n.width+i.left,h=i.left;h<i.right;h++,f++){let m=n.map[f];if(o[m])continue;o[m]=!0;let y=n.findCell(m),b=e.nodeAt(m);if(!b)throw RangeError(`No cell with offset ${m} found`);let w=i.left-y.left,_=y.right-i.right;if(w>0||_>0){let S=b.attrs;if(w>0&&(S=ro(S,0,w)),_>0&&(S=ro(S,S.colspan-_,_)),y.left<i.left){if(b=b.type.createAndFill(S),!b)throw RangeError(`Could not create cell with attrs ${JSON.stringify(S)}`)}else b=b.type.create(S,b.content)}if(y.top<i.top||y.bottom>i.bottom){let S={...b.attrs,rowspan:Math.min(y.bottom,i.bottom)-Math.max(y.top,i.top)};y.top<i.top?b=b.type.createAndFill(S):b=b.type.create(S,b.content)}d.push(b)}s.push(e.child(u).copy(G.from(d)))}let l=this.isColSelection()&&this.isRowSelection()?e:s;return new Z(G.from(l),1,1)}replace(e,n=Z.empty){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:l,$to:u}=i[s],d=e.mapping.slice(r);e.replace(d.map(l.pos),d.map(u.pos),s?Z.empty:n)}let o=ue.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new Z(G.from(n),0,0))}forEachCell(e){let n=this.$anchorCell.node(-1),r=mt.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(n.nodeAt(o[s]),i+o[s])}isColSelection(){let e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.top<=l.top?(s.top>0&&(e=u.resolve(o+i.map[s.left])),l.bottom<i.height&&(n=u.resolve(o+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(o+i.map[l.left])),s.bottom<i.height&&(e=u.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new Wr(e,n)}isRowSelection(){let e=this.$anchorCell.node(-1),n=mt.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;let s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Wr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.left<=l.left?(s.left>0&&(e=u.resolve(o+i.map[s.top*i.width])),l.right<i.width&&(n=u.resolve(o+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(o+i.map[l.top*i.width])),s.right<i.width&&(e=u.resolve(o+i.map[i.width*(s.top+1)-1]))),new Wr(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Wr(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Wr(e.resolve(n),e.resolve(r))}getBookmark(){return new XD(this.$anchorCell.pos,this.$headCell.pos)}};tt.prototype.visible=!1;ue.jsonID("cell",tt);var XD=class kv{constructor(e,n){this.anchor=e,this.head=n}map(e){return new kv(e.map(this.anchor),e.map(this.head))}resolve(e){let n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&$p(n,r)?new tt(n,r):ue.near(r,1)}};function ZD(t){if(!(t.selection instanceof tt))return null;let e=[];return t.selection.forEachCell((n,r)=>{e.push(Tt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),st.create(t.doc,e)}function jD({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function QD({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function eP(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof pe&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=tt.create(i,r.from);else if(s=="row"){let l=i.resolve(r.from+1);o=tt.rowSelection(l,l)}else if(!n){let l=mt.get(r.node),u=r.from+1,d=u+l.map[l.width*l.height-1];o=tt.create(i,u+1,d)}}else r instanceof ce&&jD(r)?o=ce.create(i,r.from):r instanceof ce&&QD(r)&&(o=ce.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var tP=new Ke("fix-tables");function Ov(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s<o;s++){let u=e.child(s);for(let d=l,f=Math.min(i,s+3);d<f;d++)if(t.child(d)==u){l=d+1,n+=u.nodeSize;continue e}r(u,n),l<i&&t.child(l).sameMarkup(u)?Ov(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function zp(t,e){let n,r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=nP(t,i,o,n))};return e?e.doc!=t.doc&&Ov(e.doc,t.doc,0,r):t.doc.descendants(r),n}function nP(t,e,n,r){let i=mt.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let u=0;u<i.height;u++)o.push(0);for(let u=0;u<i.problems.length;u++){let d=i.problems[u];if(d.type=="collision"){let f=e.nodeAt(d.pos);if(!f)continue;let h=f.attrs;for(let m=0;m<h.rowspan;m++)o[d.row+m]+=d.n;r.setNodeMarkup(r.mapping.map(n+1+d.pos),null,ro(h,h.colspan-d.n,d.n))}else if(d.type=="missing")o[d.row]+=d.n;else if(d.type=="overlong_rowspan"){let f=e.nodeAt(d.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+d.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-d.n})}else if(d.type=="colwidth mismatch"){let f=e.nodeAt(d.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+d.pos),null,{...f.attrs,colwidth:d.colwidth})}}let s,l;for(let u=0;u<o.length;u++)o[u]&&(s==null&&(s=u),l=u);for(let u=0,d=n+1;u<i.height;u++){let f=e.child(u),h=d+f.nodeSize,m=o[u];if(m>0){let y="cell";f.firstChild&&(y=f.firstChild.type.spec.tableRole);let b=[];for(let _=0;_<m;_++){let S=on(t.schema)[y].createAndFill();S&&b.push(S)}let w=(u==0||s==u-1)&&l==u?d+1:h-1;r.insert(r.mapping.map(w),b)}d=h}return r.setMeta(tP,{fixTables:!0})}function br(t){let e=t.selection,n=Ec(t),r=n.node(-1),i=n.start(-1),o=mt.get(r);return{...e instanceof tt?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function Rv(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;JD(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){let l=s*e.width+i;if(i>0&&i<e.width&&e.map[l-1]==e.map[l]){let u=e.map[l],d=r.nodeAt(u);t.setNodeMarkup(t.mapping.map(n+u),null,Nv(d.attrs,i-e.colCount(u))),s+=d.attrs.rowspan-1}else{let u=o==null?on(r.type.schema).cell:r.nodeAt(e.map[l+o]).type,d=e.positionAt(s,i,r);t.insert(t.mapping.map(n+d),u.createAndFill())}}return t}function Iv(t,e){if(!or(t))return!1;if(e){let n=br(t);e(Rv(t.tr,n,n.left))}return!0}function Lv(t,e){if(!or(t))return!1;if(e){let n=br(t);e(Rv(t.tr,n,n.right))}return!0}function rP(t,{map:e,table:n,tableStart:r},i){let o=t.mapping.maps.length;for(let s=0;s<e.height;){let l=s*e.width+i,u=e.map[l],d=n.nodeAt(u),f=d.attrs;if(i>0&&e.map[l-1]==u||i<e.width-1&&e.map[l+1]==u)t.setNodeMarkup(t.mapping.slice(o).map(r+u),null,ro(f,i-e.colCount(u)));else{let h=t.mapping.slice(o).map(r+u);t.delete(h,h+d.nodeSize)}s+=f.rowspan}}function Dv(t,e){if(!or(t))return!1;if(e){let n=br(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;rP(r,n,i),i!=n.left;i--){let o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=mt.get(o)}e(r)}return!0}function iP(t,e,n){var r;let i=on(e.type.schema).header_cell;for(let o=0;o<t.width;o++)if(((r=e.nodeAt(t.map[o+n*t.width]))==null?void 0:r.type)!=i)return!1;return!0}function Pv(t,{map:e,tableStart:n,table:r},i){var o;let s=n;for(let d=0;d<i;d++)s+=r.child(d).nodeSize;let l=[],u=i>0?-1:0;iP(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let d=0,f=e.width*i;d<e.width;d++,f++)if(i>0&&i<e.height&&e.map[f]==e.map[f-e.width]){let h=e.map[f],m=r.nodeAt(h).attrs;t.setNodeMarkup(n+h,null,{...m,rowspan:m.rowspan+1}),d+=m.colspan-1}else{let h=u==null?on(r.type.schema).cell:(o=r.nodeAt(e.map[f+u*e.width]))==null?void 0:o.type,m=h?.createAndFill();m&&l.push(m)}return t.insert(s,on(r.type.schema).row.create(null,l)),t}function Bv(t,e){if(!or(t))return!1;if(e){let n=br(t);e(Pv(t.tr,n,n.top))}return!0}function Fv(t,e){if(!or(t))return!1;if(e){let n=br(t);e(Pv(t.tr,n,n.bottom))}return!0}function oP(t,{map:e,table:n,tableStart:r},i){let o=0;for(let d=0;d<i;d++)o+=n.child(d).nodeSize;let s=o+n.child(i).nodeSize,l=t.mapping.maps.length;t.delete(o+r,s+r);let u=new Set;for(let d=0,f=i*e.width;d<e.width;d++,f++){let h=e.map[f];if(!u.has(h)){if(u.add(h),i>0&&h==e.map[f-e.width]){let m=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m,rowspan:m.rowspan-1}),d+=m.colspan-1}else if(i<e.height&&h==e.map[f+e.width]){let m=n.nodeAt(h),y=m.attrs,b=m.type.create({...y,rowspan:m.attrs.rowspan-1},m.content),w=e.positionAt(i+1,d,n);t.insert(t.mapping.slice(l).map(r+w),b),d+=y.colspan-1}}}}function Hv(t,e){if(!or(t))return!1;if(e){let n=br(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;oP(r,n,i),i!=n.top;i--){let o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=mt.get(n.table)}e(r)}return!0}function vv(t){let e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function sP({width:t,height:e,map:n},r){let i=r.top*t+r.left,o=i,s=(r.bottom-1)*t+r.left,l=i+(r.right-r.left-1);for(let u=r.top;u<r.bottom;u++){if(r.left>0&&n[o]==n[o-1]||r.right<t&&n[l]==n[l+1])return!0;o+=t,l+=t}for(let u=r.left;u<r.right;u++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[s]==n[s+t])return!0;i++,s++}return!1}function Up(t,e){let n=t.selection;if(!(n instanceof tt)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=br(t),{map:i}=r;if(sP(i,r))return!1;if(e){let o=t.tr,s={},l=G.empty,u,d;for(let f=r.top;f<r.bottom;f++)for(let h=r.left;h<r.right;h++){let m=i.map[f*i.width+h],y=r.table.nodeAt(m);if(!(s[m]||!y))if(s[m]=!0,u==null)u=m,d=y;else{vv(y)||(l=l.append(y.content));let b=o.mapping.map(m+r.tableStart);o.delete(b,b+y.nodeSize)}}if(u==null||d==null)return!0;if(o.setNodeMarkup(u+r.tableStart,null,{...Nv(d.attrs,d.attrs.colspan,r.right-r.left-d.attrs.colspan),rowspan:r.bottom-r.top}),l.size){let f=u+1+d.content.size,h=vv(d)?u+1:f;o.replaceWith(h+r.tableStart,f+r.tableStart,l)}o.setSelection(new tt(o.doc.resolve(u+r.tableStart))),e(o)}return!0}function Wp(t,e){let n=on(t.schema);return aP(({node:r})=>n[r.type.spec.tableRole])(t,e)}function aP(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof tt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=GD(i.$from),!o)return!1;s=(r=Yo(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs,u=[],d=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});let f=br(e),h=e.tr;for(let y=0;y<f.right-f.left;y++)u.push(d?{...l,colwidth:d&&d[y]?[d[y]]:null}:l);let m;for(let y=f.top;y<f.bottom;y++){let b=f.map.positionAt(y,f.left,f.table);y==f.top&&(b+=o.nodeSize);for(let w=f.left,_=0;w<f.right;w++,_++)w==f.left&&y==f.top||h.insert(m=h.mapping.map(b+f.tableStart,1),t({node:o,row:y,col:w}).createAndFill(u[_]))}h.setNodeMarkup(s,t({node:o,row:f.top,col:f.left}),u[0]),i instanceof tt&&h.setSelection(new tt(h.doc.resolve(i.$anchorCell.pos),m?h.doc.resolve(m):void 0)),n(h)}return!0}}function $v(t,e){return function(n,r){if(!or(n))return!1;let i=Ec(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){let o=n.tr;n.selection instanceof tt?n.selection.forEachCell((s,l)=>{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function lP(t){return function(e,n){if(!or(e))return!1;if(n){let r=on(e.schema),i=br(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(u=>i.table.nodeAt(u));for(let u=0;u<s.length;u++)l[u].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[u],r.cell,l[u].attrs);if(o.steps.length==0)for(let u=0;u<s.length;u++)o.setNodeMarkup(i.tableStart+s[u],r.header_cell,l[u].attrs);n(o)}return!0}}function wv(t,e,n){let r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){let o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Jo(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?lP(t):function(n,r){if(!or(n))return!1;if(r){let i=on(n.schema),o=br(n),s=n.tr,l=wv("row",o,i),u=wv("column",o,i),f=(t==="column"?l:t==="row"?u:!1)?1:0,h=t=="column"?{left:0,top:f,right:1,bottom:o.map.height}:t=="row"?{left:f,top:0,right:o.map.width,bottom:1}:o,m=t=="column"?u?i.cell:i.header_cell:t=="row"?l?i.cell:i.header_cell:i.cell;o.map.cellsInRect(h).forEach(y=>{let b=y+o.tableStart,w=s.doc.nodeAt(b);w&&s.setNodeMarkup(b,m,w.attrs)}),r(s)}return!0}}var pU=Jo("row",{useDeprecatedLogic:!0}),hU=Jo("column",{useDeprecatedLogic:!0}),zv=Jo("cell",{useDeprecatedLogic:!0});function cP(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;let n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){let o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function Kp(t){return function(e,n){if(!or(e))return!1;let r=cP(Ec(e),t);if(r==null)return!1;if(n){let i=e.doc.resolve(r);n(e.tr.setSelection(ce.between(i,YD(i))).scrollIntoView())}return!0}}function Uv(t,e){let n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function hc(t,e){let n=t.selection;if(!(n instanceof tt))return!1;if(e){let r=t.tr,i=on(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new Z(i,0,0))}),r.docChanged&&e(r)}return!0}function uP(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let u=0;u<e.childCount;u++){let d=e.child(u).content,f=u?0:Math.max(0,n-1),h=u<e.childCount-1?0:Math.max(0,r-1);(f||h)&&(d=Fp(on(s).row,new Z(d,f,h)).content),l.push(d)}else if(o=="cell"||o=="header_cell")l.push(n||r?Fp(on(s).row,new Z(e,n,r)).content:e);else return null;return dP(s,l)}function dP(t,e){let n=[];for(let i=0;i<e.length;i++){let o=e[i];for(let s=o.childCount-1;s>=0;s--){let{rowspan:l,colspan:u}=o.child(s).attrs;for(let d=i;d<i+l;d++)n[d]=(n[d]||0)+u}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(G.empty),n[i]<r){let o=on(t).cell.createAndFill(),s=[];for(let l=n[i];l<r;l++)s.push(o);e[i]=e[i].append(G.from(s))}return{height:e.length,width:r,rows:e}}function Fp(t,e){let n=t.createAndFill();return new li(n).replace(0,n.content.size,e).doc}function fP({width:t,height:e,rows:n},r,i){if(t!=r){let o=[],s=[];for(let l=0;l<n.length;l++){let u=n[l],d=[];for(let f=o[l]||0,h=0;f<r;h++){let m=u.child(h%u.childCount);f+m.attrs.colspan>r&&(m=m.type.createChecked(ro(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),d.push(m),f+=m.attrs.colspan;for(let y=1;y<m.attrs.rowspan;y++)o[l+y]=(o[l+y]||0)+m.attrs.colspan}s.push(G.from(d))}n=s,t=r}if(e!=i){let o=[];for(let s=0,l=0;s<i;s++,l++){let u=[],d=n[l%e];for(let f=0;f<d.childCount;f++){let h=d.child(f);s+h.attrs.rowspan>i&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),u.push(h)}o.push(G.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function pP(t,e,n,r,i,o,s){let l=t.doc.type.schema,u=on(l),d,f;if(i>e.width)for(let h=0,m=0;h<e.height;h++){let y=n.child(h);m+=y.nodeSize;let b=[],w;y.lastChild==null||y.lastChild.type==u.cell?w=d||(d=u.cell.createAndFill()):w=f||(f=u.header_cell.createAndFill());for(let _=e.width;_<i;_++)b.push(w);t.insert(t.mapping.slice(s).map(m-1+r),b)}if(o>e.height){let h=[];for(let b=0,w=(e.height-1)*e.width;b<Math.max(e.width,i);b++){let _=b>=e.width?!1:n.nodeAt(e.map[w+b]).type==u.header_cell;h.push(_?f||(f=u.header_cell.createAndFill()):d||(d=u.cell.createAndFill()))}let m=u.row.create(null,G.from(h)),y=[];for(let b=e.height;b<o;b++)y.push(m);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),y)}return!!(d||f)}function xv(t,e,n,r,i,o,s,l){if(s==0||s==e.height)return!1;let u=!1;for(let d=i;d<o;d++){let f=s*e.width+d,h=e.map[f];if(e.map[f-e.width]==h){u=!0;let m=n.nodeAt(h),{top:y,left:b}=e.findCell(h);t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m.attrs,rowspan:s-y}),t.insert(t.mapping.slice(l).map(e.positionAt(s,b,n)),m.type.createAndFill({...m.attrs,rowspan:y+m.attrs.rowspan-s})),d+=m.attrs.colspan-1}}return u}function _v(t,e,n,r,i,o,s,l){if(s==0||s==e.width)return!1;let u=!1;for(let d=i;d<o;d++){let f=d*e.width+s,h=e.map[f];if(e.map[f-1]==h){u=!0;let m=n.nodeAt(h),y=e.colCount(h),b=t.mapping.slice(l).map(h+r);t.setNodeMarkup(b,null,ro(m.attrs,s-y,m.attrs.colspan-(s-y))),t.insert(b+m.nodeSize,m.type.createAndFill(ro(m.attrs,0,s-y))),d+=m.attrs.rowspan-1}}return u}function Sv(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc;if(!o)throw new Error("No table found");let s=mt.get(o),{top:l,left:u}=r,d=u+i.width,f=l+i.height,h=t.tr,m=0;function y(){if(o=n?h.doc.nodeAt(n-1):h.doc,!o)throw new Error("No table found");s=mt.get(o),m=h.mapping.maps.length}pP(h,s,o,n,d,f,m)&&y(),xv(h,s,o,n,u,d,l,m)&&y(),xv(h,s,o,n,u,d,f,m)&&y(),_v(h,s,o,n,l,f,u,m)&&y(),_v(h,s,o,n,l,f,d,m)&&y();for(let b=l;b<f;b++){let w=s.positionAt(b,u,o),_=s.positionAt(b,d,o);h.replace(h.mapping.slice(m).map(w+n),h.mapping.slice(m).map(_+n),new Z(i.rows[b-l],0,0))}y(),h.setSelection(new tt(h.doc.resolve(n+s.positionAt(l,u,o)),h.doc.resolve(n+s.positionAt(f-1,d-1,o)))),e(h)}var hP=ta({ArrowLeft:mc("horiz",-1),ArrowRight:mc("horiz",1),ArrowUp:mc("vert",-1),ArrowDown:mc("vert",1),"Shift-ArrowLeft":gc("horiz",-1),"Shift-ArrowRight":gc("horiz",1),"Shift-ArrowUp":gc("vert",-1),"Shift-ArrowDown":gc("vert",1),Backspace:hc,"Mod-Backspace":hc,Delete:hc,"Mod-Delete":hc});function bc(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function mc(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection;if(o instanceof tt)return bc(n,r,ue.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=Wv(i,t,e);if(s==null)return!1;if(t=="horiz")return bc(n,r,ue.near(n.doc.resolve(o.head+e),e));{let l=n.doc.resolve(s),u=Mv(l,t,e),d;return u?d=ue.near(u,1):e<0?d=ue.near(n.doc.resolve(l.before(-1)),-1):d=ue.near(n.doc.resolve(l.after(-1)),1),bc(n,r,d)}}}function gc(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof tt)s=o;else{let u=Wv(i,t,e);if(u==null)return!1;s=new tt(n.doc.resolve(u))}let l=Mv(s.$headCell,t,e);return l?bc(n,r,new tt(s.$anchorCell,l)):!1}}function mP(t,e){let n=t.state.doc,r=Yo(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new tt(r))),!0):!1}function gP(t,e,n){if(!or(t.state))return!1;let r=uP(n),i=t.state.selection;if(i instanceof tt){r||(r={width:1,height:1,rows:[G.from(Fp(on(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=mt.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=fP(r,l.right-l.left,l.bottom-l.top),Sv(t.state,t.dispatch,s,l,r),!0}else if(r){let o=Ec(t.state),s=o.start(-1);return Sv(t.state,t.dispatch,s,mt.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function bP(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=Tv(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof tt)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Yo(t.state.selection.$anchor))!=null&&((n=Lp(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,d){let f=Lp(t,d),h=Ei.getState(t.state)==null;if(!f||!$p(u,f))if(h)f=u;else return;let m=new tt(u,f);if(h||!t.state.selection.eq(m)){let y=t.state.tr.setSelection(m);h&&y.setMeta(Ei,u.pos),t.dispatch(y)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),Ei.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Ei,-1))}function l(u){let d=u,f=Ei.getState(t.state),h;if(f!=null)h=t.state.doc.resolve(f);else if(Tv(t,d.target)!=r&&(h=Lp(t,e),!h))return s();h&&o(h,d)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function Wv(t,e,n){if(!(t.state.selection instanceof ce))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function Tv(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Lp(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Yo(t.state.doc.resolve(n.pos)):null}var yP=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Hp(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Hp(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Hp(t,e,n,r,i,o){var s;let l=0,u=!0,d=e.firstChild,f=t.firstChild;if(f){for(let h=0,m=0;h<f.childCount;h++){let{colspan:y,colwidth:b}=f.child(h).attrs;for(let w=0;w<y;w++,m++){let _=i==m?o:b&&b[w],S=_?_+"px":"";l+=_||r,_||(u=!1),d?(d.style.width!=S&&(d.style.width=S),d=d.nextSibling):e.appendChild(document.createElement("col")).style.width=S}}for(;d;){let h=d.nextSibling;(s=d.parentNode)==null||s.removeChild(d),d=h}u?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var Wn=new Ke("tableColumnResizing");function Kv({handleWidth:t=5,cellMinWidth:e=25,View:n=yP,lastColumnResizable:r=!0}={}){let i=new De({key:Wn,state:{init(o,s){var l,u;let d=(u=(l=i.spec)==null?void 0:l.props)==null?void 0:u.nodeViews,f=on(s.schema).table.name;return n&&d&&(d[f]=(h,m)=>new n(h,e,m)),new EP(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{let s=Wn.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{vP(o,s,t,e,r)},mouseleave:o=>{wP(o)},mousedown:(o,s)=>{xP(o,s,e)}},decorations:o=>{let s=Wn.getState(o);if(s&&s.activeHandle>-1)return MP(o,s.activeHandle)},nodeViews:{}}});return i}var EP=class yc{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(Wn);if(r&&r.setHandle!=null)return new yc(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new yc(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Bp(e.doc.resolve(i))||(i=-1),new yc(i,n.dragging)}return n}};function vP(t,e,n,r,i){let o=Wn.getState(t.state);if(o&&!o.dragging){let s=SP(e.target),l=-1;if(s){let{left:u,right:d}=s.getBoundingClientRect();e.clientX-u<=n?l=Cv(t,e,"left",n):d-e.clientX<=n&&(l=Cv(t,e,"right",n))}if(l!=o.activeHandle){if(!i&&l!==-1){let u=t.state.doc.resolve(l),d=u.node(-1),f=mt.get(d),h=u.start(-1);if(f.colCount(u.pos-h)+u.nodeAfter.attrs.colspan-1==f.width-1)return}Vv(t,l)}}}function wP(t){let e=Wn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Vv(t,-1)}function xP(t,e,n){var r;let i=(r=t.dom.ownerDocument.defaultView)!=null?r:window,o=Wn.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;let s=t.state.doc.nodeAt(o.activeHandle),l=_P(t,o.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Wn,{setDragging:{startX:e.clientX,startWidth:l}}));function u(f){i.removeEventListener("mouseup",u),i.removeEventListener("mousemove",d);let h=Wn.getState(t.state);h?.dragging&&(TP(t,h.activeHandle,Av(h.dragging,f,n)),t.dispatch(t.state.tr.setMeta(Wn,{setDragging:null})))}function d(f){if(!f.which)return u(f);let h=Wn.getState(t.state);if(h&&h.dragging){let m=Av(h.dragging,f,n);CP(t,h.activeHandle,m,n)}}return i.addEventListener("mouseup",u),i.addEventListener("mousemove",d),e.preventDefault(),!0}function _P(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),l=o.node.childNodes[o.offset].offsetWidth,u=n;if(r)for(let d=0;d<n;d++)r[d]&&(l-=r[d],u--);return l/u}function SP(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function Cv(t,e,n,r){let i=n=="right"?-r:r,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;let{pos:s}=o,l=Yo(t.state.doc.resolve(s));if(!l)return-1;if(n=="right")return l.pos;let u=mt.get(l.node(-1)),d=l.start(-1),f=u.map.indexOf(l.pos-d);return f%u.width==0?-1:d+u.map[f-1]}function Av(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Vv(t,e){t.dispatch(t.state.tr.setMeta(Wn,{setHandle:e}))}function TP(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),o=mt.get(i),s=r.start(-1),l=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,u=t.state.tr;for(let d=0;d<o.height;d++){let f=d*o.width+l;if(d&&o.map[f]==o.map[f-o.width])continue;let h=o.map[f],m=i.nodeAt(h).attrs,y=m.colspan==1?0:l-o.colCount(h);if(m.colwidth&&m.colwidth[y]==n)continue;let b=m.colwidth?m.colwidth.slice():AP(m.colspan);b[y]=n,u.setNodeMarkup(s+h,null,{...m,colwidth:b})}u.docChanged&&t.dispatch(u)}function CP(t,e,n,r){let i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),l=mt.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1,u=t.domAtPos(i.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&Hp(o,u.firstChild,u,r,l,n)}function AP(t){return Array(t).fill(0)}function MP(t,e){let n=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return st.empty;let o=mt.get(i),s=r.start(-1),l=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let u=0;u<o.height;u++){let d=l+u*o.width;if((l==o.width-1||o.map[d]!=o.map[d+1])&&(u==0||o.map[d]!=o.map[d-o.width])){let f=o.map[d],h=s+f+i.nodeAt(f).nodeSize-1,m=document.createElement("div");m.className="column-resize-handle",n.push(Tt.widget(h,m))}}return st.create(t.doc,n)}function Gv({allowTableNodeSelection:t=!1}={}){return new De({key:Ei,state:{init(){return null},apply(e,n){let r=e.getMeta(Ei);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;let{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:ZD,handleDOMEvents:{mousedown:bP},createSelectionBetween(e){return Ei.getState(e.state)!=null?e.state.selection:null},handleTripleClick:mP,handleKeyDown:hP,handlePaste:gP},appendTransaction(e,n,r){return eP(r,zp(r,n),t)}})}function qv(t,e,n,r,i,o){let s=0,l=!0,u=e.firstChild,d=t.firstChild;for(let f=0,h=0;f<d.childCount;f+=1){let{colspan:m,colwidth:y}=d.child(f).attrs;for(let b=0;b<m;b+=1,h+=1){let w=i===h?o:y&&y[b],_=w?`${w}px`:"";s+=w||r,w||(l=!1),u?(u.style.width!==_&&(u.style.width=_),u=u.nextSibling):e.appendChild(document.createElement("col")).style.width=_}}for(;u;){let f=u.nextSibling;u.parentNode.removeChild(u),u=f}l?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Vp=class{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),qv(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,qv(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}};function NP(t,e,n,r){let i=0,o=!0,s=[],l=t.firstChild;if(!l)return{};for(let h=0,m=0;h<l.childCount;h+=1){let{colspan:y,colwidth:b}=l.child(h).attrs;for(let w=0;w<y;w+=1,m+=1){let _=n===m?r:b&&b[w],S=_?`${_}px`:"";i+=_||e,_||(o=!1),s.push(["col",S?{style:`width: ${S}`}:{}])}}let u=o?`${i}px`:"",d=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:u,tableMinWidth:d}}function Yv(t,e){return e?t.createChecked(null,e):t.createAndFill()}function kP(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function OP(t,e,n,r,i){let o=kP(t),s=[],l=[];for(let d=0;d<n;d+=1){let f=Yv(o.cell,i);if(f&&l.push(f),r){let h=Yv(o.header_cell,i);h&&s.push(h)}}let u=[];for(let d=0;d<e;d+=1)u.push(o.row.createChecked(null,r&&d===0?s:l));return o.table.createChecked(null,u)}function RP(t){return t instanceof tt}var vc=({editor:t})=>{let{selection:e}=t.state;if(!RP(e))return!1;let n=0,r=Sp(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},Jv=oe.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Vp,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=NP(t,this.options.cellMinWidth);return["table",j(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=OP(o.schema,t,e,n);if(i){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(ce.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Iv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Lv(t,e),deleteColumn:()=>({state:t,dispatch:e})=>Dv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Bv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Fv(t,e),deleteRow:()=>({state:t,dispatch:e})=>Hv(t,e),deleteTable:()=>({state:t,dispatch:e})=>Uv(t,e),mergeCells:()=>({state:t,dispatch:e})=>Up(t,e),splitCell:()=>({state:t,dispatch:e})=>Wp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Jo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Jo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>zv(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Up(t,e)?!0:Wp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>$v(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Kp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Kp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&zp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=tt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:vc,"Mod-Backspace":vc,Delete:vc,"Mod-Delete":vc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Kv({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Gv({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Te(ne(t,"tableRole",e))}}});var Xv=oe.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",j(this.options.HTMLAttributes,t),0]}});var Zv=oe.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",j(this.options.HTMLAttributes,t),0]}});var jv=oe.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",j(this.options.HTMLAttributes,t),0]}});var Qv=oe.create({name:"text",group:"inline"});var ew=je.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var IP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,LP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,tw=je.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Un({find:IP,type:this.type})]},addPasteRules(){return[vn({find:LP,type:this.type})]}});var gt="top",It="bottom",At="right",vt="left",wc="auto",vi=[gt,It,At,vt],Kr="start",io="end",nw="clippingParents",xc="viewport",Xo="popper",rw="reference",Gp=vi.reduce(function(t,e){return t.concat([e+"-"+Kr,e+"-"+io])},[]),_c=[].concat(vi,[wc]).reduce(function(t,e){return t.concat([e,e+"-"+Kr,e+"-"+io])},[]),DP="beforeRead",PP="read",BP="afterRead",FP="beforeMain",HP="main",$P="afterMain",zP="beforeWrite",UP="write",WP="afterWrite",iw=[DP,PP,BP,FP,HP,$P,zP,UP,WP];function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function lt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Kn(t){var e=lt(t).Element;return t instanceof e||t instanceof Element}function Lt(t){var e=lt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Zo(t){if(typeof ShadowRoot>"u")return!1;var e=lt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function KP(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Lt(o)||!Ut(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function VP(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,d){return u[d]="",u},{});!Lt(i)||!Ut(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var ia={name:"applyStyles",enabled:!0,phase:"write",fn:KP,effect:VP,requires:["computeStyles"]};function Wt(t){return t.split("-")[0]}var sr=Math.max,oo=Math.min,Vr=Math.round;function jo(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function oa(){return!/^((?!chrome|android).)*safari/i.test(jo())}function Vn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Lt(t)&&(i=t.offsetWidth>0&&Vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Vr(r.height)/t.offsetHeight||1);var s=Kn(t)?lt(t):window,l=s.visualViewport,u=!oa()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/i,f=(r.top+(u&&l?l.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function so(t){var e=Vn(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function sa(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Zo(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function hn(t){return lt(t).getComputedStyle(t)}function qp(t){return["table","td","th"].indexOf(Ut(t))>=0}function Yt(t){return((Kn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gr(t){return Ut(t)==="html"?t:t.assignedSlot||t.parentNode||(Zo(t)?t.host:null)||Yt(t)}function ow(t){return!Lt(t)||hn(t).position==="fixed"?null:t.offsetParent}function GP(t){var e=/firefox/i.test(jo()),n=/Trident/i.test(jo());if(n&&Lt(t)){var r=hn(t);if(r.position==="fixed")return null}var i=Gr(t);for(Zo(i)&&(i=i.host);Lt(i)&&["html","body"].indexOf(Ut(i))<0;){var o=hn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ar(t){for(var e=lt(t),n=ow(t);n&&qp(n)&&hn(n).position==="static";)n=ow(n);return n&&(Ut(n)==="html"||Ut(n)==="body"&&hn(n).position==="static")?e:n||GP(t)||e}function ao(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function lo(t,e,n){return sr(t,oo(e,n))}function sw(t,e,n){var r=lo(t,e,n);return r>n?n:r}function aa(){return{top:0,right:0,bottom:0,left:0}}function la(t){return Object.assign({},aa(),t)}function ca(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var qP=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,la(typeof e!="number"?e:ca(e,vi))};function YP(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Wt(n.placement),u=ao(l),d=[vt,At].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=qP(i.padding,n),m=so(o),y=u==="y"?gt:vt,b=u==="y"?It:At,w=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],_=s[u]-n.rects.reference[u],S=ar(o),D=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,L=w/2-_/2,T=h[y],$=D-m[f]-h[b],O=D/2-m[f]/2+L,Y=lo(T,O,$),ee=u;n.modifiersData[r]=(e={},e[ee]=Y,e.centerOffset=Y-O,e)}}function JP(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||sa(e.elements.popper,i)&&(e.elements.arrow=i))}var aw={name:"arrow",enabled:!0,phase:"main",fn:YP,effect:JP,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gn(t){return t.split("-")[1]}var XP={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ZP(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Vr(n*i)/i||0,y:Vr(r*i)/i||0}}function lw(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,d=t.adaptive,f=t.roundOffsets,h=t.isFixed,m=s.x,y=m===void 0?0:m,b=s.y,w=b===void 0?0:b,_=typeof f=="function"?f({x:y,y:w}):{x:y,y:w};y=_.x,w=_.y;var S=s.hasOwnProperty("x"),D=s.hasOwnProperty("y"),L=vt,T=gt,$=window;if(d){var O=ar(n),Y="clientHeight",ee="clientWidth";if(O===lt(n)&&(O=Yt(n),hn(O).position!=="static"&&l==="absolute"&&(Y="scrollHeight",ee="scrollWidth")),O=O,i===gt||(i===vt||i===At)&&o===io){T=It;var z=h&&O===$&&$.visualViewport?$.visualViewport.height:O[Y];w-=z-r.height,w*=u?1:-1}if(i===vt||(i===gt||i===It)&&o===io){L=At;var re=h&&O===$&&$.visualViewport?$.visualViewport.width:O[ee];y-=re-r.width,y*=u?1:-1}}var he=Object.assign({position:l},d&&XP),Se=f===!0?ZP({x:y,y:w},lt(n)):{x:y,y:w};if(y=Se.x,w=Se.y,u){var me;return Object.assign({},he,(me={},me[T]=D?"0":"",me[L]=S?"0":"",me.transform=($.devicePixelRatio||1)<=1?"translate("+y+"px, "+w+"px)":"translate3d("+y+"px, "+w+"px, 0)",me))}return Object.assign({},he,(e={},e[T]=D?w+"px":"",e[L]=S?y+"px":"",e.transform="",e))}function jP(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Wt(e.placement),variation:Gn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,lw(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,lw(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var cw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:jP,data:{}};var Sc={passive:!0};function QP(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=lt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,Sc)}),l&&u.addEventListener("resize",n.update,Sc),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,Sc)}),l&&u.removeEventListener("resize",n.update,Sc)}}var uw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:QP,data:{}};var eB={left:"right",right:"left",bottom:"top",top:"bottom"};function Qo(t){return t.replace(/left|right|bottom|top/g,function(e){return eB[e]})}var tB={start:"end",end:"start"};function Tc(t){return t.replace(/start|end/g,function(e){return tB[e]})}function co(t){var e=lt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function uo(t){return Vn(Yt(t)).left+co(t).scrollLeft}function Yp(t,e){var n=lt(t),r=Yt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var d=oa();(d||!d&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+uo(t),y:u}}function Jp(t){var e,n=Yt(t),r=co(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=sr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=sr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+uo(t),u=-r.scrollTop;return hn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function fo(t){var e=hn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Cc(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:Lt(t)&&fo(t)?t:Cc(Gr(t))}function wi(t,e){var n;e===void 0&&(e=[]);var r=Cc(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=lt(r),s=i?[o].concat(o.visualViewport||[],fo(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(wi(Gr(s)))}function es(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function nB(t,e){var n=Vn(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function dw(t,e,n){return e===xc?es(Yp(t,n)):Kn(e)?nB(e,n):es(Jp(Yt(t)))}function rB(t){var e=wi(Gr(t)),n=["absolute","fixed"].indexOf(hn(t).position)>=0,r=n&&Lt(t)?ar(t):t;return Kn(r)?e.filter(function(i){return Kn(i)&&sa(i,r)&&Ut(i)!=="body"}):[]}function Xp(t,e,n,r){var i=e==="clippingParents"?rB(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,d){var f=dw(t,d,r);return u.top=sr(f.top,u.top),u.right=oo(f.right,u.right),u.bottom=oo(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},dw(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function ua(t){var e=t.reference,n=t.element,r=t.placement,i=r?Wt(r):null,o=r?Gn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case gt:u={x:s,y:e.y-n.height};break;case It:u={x:s,y:e.y+e.height};break;case At:u={x:e.x+e.width,y:l};break;case vt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var d=i?ao(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Kr:u[d]=u[d]-(e[f]/2-n[f]/2);break;case io:u[d]=u[d]+(e[f]/2-n[f]/2);break;default:}}return u}function lr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?nw:l,d=n.rootBoundary,f=d===void 0?xc:d,h=n.elementContext,m=h===void 0?Xo:h,y=n.altBoundary,b=y===void 0?!1:y,w=n.padding,_=w===void 0?0:w,S=la(typeof _!="number"?_:ca(_,vi)),D=m===Xo?rw:Xo,L=t.rects.popper,T=t.elements[b?D:m],$=Xp(Kn(T)?T:T.contextElement||Yt(t.elements.popper),u,f,s),O=Vn(t.elements.reference),Y=ua({reference:O,element:L,strategy:"absolute",placement:i}),ee=es(Object.assign({},L,Y)),z=m===Xo?ee:O,re={top:$.top-z.top+S.top,bottom:z.bottom-$.bottom+S.bottom,left:$.left-z.left+S.left,right:z.right-$.right+S.right},he=t.modifiersData.offset;if(m===Xo&&he){var Se=he[i];Object.keys(re).forEach(function(me){var Ce=[At,It].indexOf(me)>=0?1:-1,ge=[gt,It].indexOf(me)>=0?"y":"x";re[me]+=Se[ge]*Ce})}return re}function Zp(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?_c:u,f=Gn(r),h=f?l?Gp:Gp.filter(function(b){return Gn(b)===f}):vi,m=h.filter(function(b){return d.indexOf(b)>=0});m.length===0&&(m=h);var y=m.reduce(function(b,w){return b[w]=lr(t,{placement:w,boundary:i,rootBoundary:o,padding:s})[Wt(w)],b},{});return Object.keys(y).sort(function(b,w){return y[b]-y[w]})}function iB(t){if(Wt(t)===wc)return[];var e=Qo(t);return[Tc(t),e,Tc(e)]}function oB(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,w=n.allowedAutoPlacements,_=e.options.placement,S=Wt(_),D=S===_,L=u||(D||!b?[Qo(_)]:iB(_)),T=[_].concat(L).reduce(function(Qe,Me){return Qe.concat(Wt(Me)===wc?Zp(e,{placement:Me,boundary:f,rootBoundary:h,padding:d,flipVariations:b,allowedAutoPlacements:w}):Me)},[]),$=e.rects.reference,O=e.rects.popper,Y=new Map,ee=!0,z=T[0],re=0;re<T.length;re++){var he=T[re],Se=Wt(he),me=Gn(he)===Kr,Ce=[gt,It].indexOf(Se)>=0,ge=Ce?"width":"height",_e=lr(e,{placement:he,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),A=Ce?me?At:vt:me?It:gt;$[ge]>O[ge]&&(A=Qo(A));var R=Qo(A),K=[];if(o&&K.push(_e[Se]<=0),l&&K.push(_e[A]<=0,_e[R]<=0),K.every(function(Qe){return Qe})){z=he,ee=!1;break}Y.set(he,K)}if(ee)for(var J=b?3:1,ae=function(Me){var Be=T.find(function(wt){var Nt=Y.get(wt);if(Nt)return Nt.slice(0,Me).every(function(ke){return ke})});if(Be)return z=Be,"break"},be=J;be>0;be--){var Ie=ae(be);if(Ie==="break")break}e.placement!==z&&(e.modifiersData[r]._skip=!0,e.placement=z,e.reset=!0)}}var fw={name:"flip",enabled:!0,phase:"main",fn:oB,requiresIfExists:["offset"],data:{_skip:!1}};function pw(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function hw(t){return[gt,At,It,vt].some(function(e){return t[e]>=0})}function sB(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=lr(e,{elementContext:"reference"}),l=lr(e,{altBoundary:!0}),u=pw(s,r),d=pw(l,i,o),f=hw(u),h=hw(d);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var mw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:sB};function aB(t,e,n){var r=Wt(t),i=[vt,gt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[vt,At].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function lB(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=_c.reduce(function(f,h){return f[h]=aB(h,e.rects,o),f},{}),l=s[e.placement],u=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}var gw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:lB};function cB(t){var e=t.state,n=t.name;e.modifiersData[n]=ua({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var bw={name:"popperOffsets",enabled:!0,phase:"read",fn:cB,data:{}};function jp(t){return t==="x"?"y":"x"}function uB(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,m=n.tether,y=m===void 0?!0:m,b=n.tetherOffset,w=b===void 0?0:b,_=lr(e,{boundary:u,rootBoundary:d,padding:h,altBoundary:f}),S=Wt(e.placement),D=Gn(e.placement),L=!D,T=ao(S),$=jp(T),O=e.modifiersData.popperOffsets,Y=e.rects.reference,ee=e.rects.popper,z=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,re=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),he=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Se={x:0,y:0};if(O){if(o){var me,Ce=T==="y"?gt:vt,ge=T==="y"?It:At,_e=T==="y"?"height":"width",A=O[T],R=A+_[Ce],K=A-_[ge],J=y?-ee[_e]/2:0,ae=D===Kr?Y[_e]:ee[_e],be=D===Kr?-ee[_e]:-Y[_e],Ie=e.elements.arrow,Qe=y&&Ie?so(Ie):{width:0,height:0},Me=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:aa(),Be=Me[Ce],wt=Me[ge],Nt=lo(0,Y[_e],Qe[_e]),ke=L?Y[_e]/2-J-Nt-Be-re.mainAxis:ae-Nt-Be-re.mainAxis,xt=L?-Y[_e]/2+J+Nt+wt+re.mainAxis:be+Nt+wt+re.mainAxis,Jt=e.elements.arrow&&ar(e.elements.arrow),pt=Jt?T==="y"?Jt.clientTop||0:Jt.clientLeft||0:0,sn=(me=he?.[T])!=null?me:0,Xt=A+ke-sn-pt,_t=A+xt-sn,Je=lo(y?oo(R,Xt):R,A,y?sr(K,_t):K);O[T]=Je,Se[T]=Je-A}if(l){var Xn,Dt=T==="x"?gt:vt,V=T==="x"?It:At,bt=O[$],we=$==="y"?"height":"width",fe=bt+_[Dt],ct=bt-_[V],ut=[gt,vt].indexOf(S)!==-1,Pt=(Xn=he?.[$])!=null?Xn:0,kt=ut?fe:bt-Y[we]-ee[we]-Pt+re.altAxis,I=ut?bt+Y[we]+ee[we]-Pt-re.altAxis:ct,F=y&&ut?sw(kt,bt,I):lo(y?kt:fe,bt,y?I:ct);O[$]=F,Se[$]=F-bt}e.modifiersData[r]=Se}}var yw={name:"preventOverflow",enabled:!0,phase:"main",fn:uB,requiresIfExists:["offset"]};function Qp(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function eh(t){return t===lt(t)||!Lt(t)?co(t):Qp(t)}function dB(t){var e=t.getBoundingClientRect(),n=Vr(e.width)/t.offsetWidth||1,r=Vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function th(t,e,n){n===void 0&&(n=!1);var r=Lt(e),i=Lt(e)&&dB(e),o=Yt(e),s=Vn(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Ut(e)!=="body"||fo(o))&&(l=eh(e)),Lt(e)?(u=Vn(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=uo(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function fB(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function nh(t){var e=fB(t);return iw.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function rh(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function ih(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ew={placement:"bottom",modifiers:[],strategy:"absolute"};function vw(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function ww(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Ew:i;return function(l,u,d){d===void 0&&(d=o);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ew,o),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},h=[],m=!1,y={state:f,setOptions:function(S){var D=typeof S=="function"?S(f.options):S;w(),f.options=Object.assign({},o,f.options,D),f.scrollParents={reference:Kn(l)?wi(l):l.contextElement?wi(l.contextElement):[],popper:wi(u)};var L=nh(ih([].concat(r,f.options.modifiers)));return f.orderedModifiers=L.filter(function(T){return T.enabled}),b(),y.update()},forceUpdate:function(){if(!m){var S=f.elements,D=S.reference,L=S.popper;if(vw(D,L)){f.rects={reference:th(D,ar(L),f.options.strategy==="fixed"),popper:so(L)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(re){return f.modifiersData[re.name]=Object.assign({},re.data)});for(var T=0;T<f.orderedModifiers.length;T++){if(f.reset===!0){f.reset=!1,T=-1;continue}var $=f.orderedModifiers[T],O=$.fn,Y=$.options,ee=Y===void 0?{}:Y,z=$.name;typeof O=="function"&&(f=O({state:f,options:ee,name:z,instance:y})||f)}}}},update:rh(function(){return new Promise(function(_){y.forceUpdate(),_(f)})}),destroy:function(){w(),m=!0}};if(!vw(l,u))return y;y.setOptions(d).then(function(_){!m&&d.onFirstUpdate&&d.onFirstUpdate(_)});function b(){f.orderedModifiers.forEach(function(_){var S=_.name,D=_.options,L=D===void 0?{}:D,T=_.effect;if(typeof T=="function"){var $=T({state:f,name:S,instance:y,options:L}),O=function(){};h.push($||O)}})}function w(){h.forEach(function(_){return _()}),h=[]}return y}}var pB=[uw,bw,cw,ia,gw,fw,yw,aw,mw],oh=ww({defaultModifiers:pB});var hB="tippy-box",Ow="tippy-content",mB="tippy-backdrop",Rw="tippy-arrow",Iw="tippy-svg-arrow",po={passive:!0,capture:!0},Lw=function(){return document.body};function sh(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function fh(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Dw(t,e){return typeof t=="function"?t.apply(void 0,e):t}function xw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function gB(t){return t.split(/\s+/).filter(Boolean)}function ts(t){return[].concat(t)}function _w(t,e){t.indexOf(e)===-1&&t.push(e)}function bB(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function yB(t){return t.split("-")[0]}function Mc(t){return[].slice.call(t)}function Sw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function da(){return document.createElement("div")}function Nc(t){return["Element","Fragment"].some(function(e){return fh(t,e)})}function EB(t){return fh(t,"NodeList")}function vB(t){return fh(t,"MouseEvent")}function wB(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function xB(t){return Nc(t)?[t]:EB(t)?Mc(t):Array.isArray(t)?t:Mc(document.querySelectorAll(t))}function ah(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Tw(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function _B(t){var e,n=ts(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function SB(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,d=yB(s.placement),f=s.modifiersData.offset;if(!f)return!0;var h=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,y=d==="right"?f.left.x:0,b=d==="left"?f.right.x:0,w=o.top-r+h>u,_=r-o.bottom-m>u,S=o.left-n+y>u,D=n-o.right-b>u;return w||_||S||D})}function lh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Cw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var yr={isTouch:!1},Aw=0;function TB(){yr.isTouch||(yr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pw))}function Pw(){var t=performance.now();t-Aw<20&&(yr.isTouch=!1,document.removeEventListener("mousemove",Pw)),Aw=t}function CB(){var t=document.activeElement;if(wB(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function AB(){document.addEventListener("touchstart",TB,po),window.addEventListener("blur",CB)}var MB=typeof window<"u"&&typeof document<"u",NB=MB?!!window.msCrypto:!1;var kB={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},OB={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:Lw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},kB,OB),RB=Object.keys(cr),IB=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function Bw(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=cr[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function LB(t,e){var n=e?Object.keys(Bw(Object.assign({},cr,{plugins:e}))):RB,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Mw(t,e){var n=Object.assign({},e,{content:Dw(e.content,[t])},e.ignoreAttributes?{}:LB(t,e.plugins));return n.aria=Object.assign({},cr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var DB=function(){return"innerHTML"};function uh(t,e){t[DB()]=e}function Nw(t){var e=da();return t===!0?e.className=Rw:(e.className=Iw,Nc(t)?e.appendChild(t):uh(e,t)),e}function kw(t,e){Nc(e.content)?(uh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?uh(t,e.content):t.textContent=e.content)}function dh(t){var e=t.firstElementChild,n=Mc(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Ow)}),arrow:n.find(function(r){return r.classList.contains(Rw)||r.classList.contains(Iw)}),backdrop:n.find(function(r){return r.classList.contains(mB)})}}function Fw(t){var e=da(),n=da();n.className=hB,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=da();r.className=Ow,r.setAttribute("data-state","hidden"),kw(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=dh(e),u=l.box,d=l.content,f=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&kw(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(u.removeChild(f),u.appendChild(Nw(s.arrow))):u.appendChild(Nw(s.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}Fw.$$tippy=!0;var PB=1,Ac=[],ch=[];function BB(t,e){var n=Mw(t,Object.assign({},cr,Bw(Sw(e)))),r,i,o,s=!1,l=!1,u=!1,d=!1,f,h,m,y=[],b=xw(Xt,n.interactiveDebounce),w,_=PB++,S=null,D=bB(n.plugins),L={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},T={id:_,reference:t,popper:da(),popperInstance:S,props:n,state:L,plugins:D,clearDelayTimeouts:kt,setProps:I,setContent:F,show:X,hide:se,hideWithInteractivity:Fe,enable:ut,disable:Pt,unmount:it,destroy:xr};if(!n.render)return T;var $=n.render(T),O=$.popper,Y=$.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+T.id,T.popper=O,t._tippy=T,O._tippy=T;var ee=D.map(function(B){return B.fn(T)}),z=t.hasAttribute("aria-expanded");return Jt(),J(),A(),R("onCreate",[T]),n.showOnCreate&&fe(),O.addEventListener("mouseenter",function(){T.props.interactive&&T.state.isVisible&&T.clearDelayTimeouts()}),O.addEventListener("mouseleave",function(){T.props.interactive&&T.props.trigger.indexOf("mouseenter")>=0&&Ce().addEventListener("mousemove",b)}),T;function re(){var B=T.props.touch;return Array.isArray(B)?B:[B,0]}function he(){return re()[0]==="hold"}function Se(){var B;return!!((B=T.props.render)!=null&&B.$$tippy)}function me(){return w||t}function Ce(){var B=me().parentNode;return B?_B(B):document}function ge(){return dh(O)}function _e(B){return T.state.isMounted&&!T.state.isVisible||yr.isTouch||f&&f.type==="focus"?0:sh(T.props.delay,B?0:1,cr.delay)}function A(B){B===void 0&&(B=!1),O.style.pointerEvents=T.props.interactive&&!B?"":"none",O.style.zIndex=""+T.props.zIndex}function R(B,le,xe){if(xe===void 0&&(xe=!0),ee.forEach(function(Ue){Ue[B]&&Ue[B].apply(Ue,le)}),xe){var qe;(qe=T.props)[B].apply(qe,le)}}function K(){var B=T.props.aria;if(B.content){var le="aria-"+B.content,xe=O.id,qe=ts(T.props.triggerTarget||t);qe.forEach(function(Ue){var Bt=Ue.getAttribute(le);if(T.state.isVisible)Ue.setAttribute(le,Bt?Bt+" "+xe:xe);else{var an=Bt&&Bt.replace(xe,"").trim();an?Ue.setAttribute(le,an):Ue.removeAttribute(le)}})}}function J(){if(!(z||!T.props.aria.expanded)){var B=ts(T.props.triggerTarget||t);B.forEach(function(le){T.props.interactive?le.setAttribute("aria-expanded",T.state.isVisible&&le===me()?"true":"false"):le.removeAttribute("aria-expanded")})}}function ae(){Ce().removeEventListener("mousemove",b),Ac=Ac.filter(function(B){return B!==b})}function be(B){if(!(yr.isTouch&&(u||B.type==="mousedown"))){var le=B.composedPath&&B.composedPath()[0]||B.target;if(!(T.props.interactive&&Cw(O,le))){if(ts(T.props.triggerTarget||t).some(function(xe){return Cw(xe,le)})){if(yr.isTouch||T.state.isVisible&&T.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[T,B]);T.props.hideOnClick===!0&&(T.clearDelayTimeouts(),T.hide(),l=!0,setTimeout(function(){l=!1}),T.state.isMounted||Be())}}}function Ie(){u=!0}function Qe(){u=!1}function Me(){var B=Ce();B.addEventListener("mousedown",be,!0),B.addEventListener("touchend",be,po),B.addEventListener("touchstart",Qe,po),B.addEventListener("touchmove",Ie,po)}function Be(){var B=Ce();B.removeEventListener("mousedown",be,!0),B.removeEventListener("touchend",be,po),B.removeEventListener("touchstart",Qe,po),B.removeEventListener("touchmove",Ie,po)}function wt(B,le){ke(B,function(){!T.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&le()})}function Nt(B,le){ke(B,le)}function ke(B,le){var xe=ge().box;function qe(Ue){Ue.target===xe&&(lh(xe,"remove",qe),le())}if(B===0)return le();lh(xe,"remove",h),lh(xe,"add",qe),h=qe}function xt(B,le,xe){xe===void 0&&(xe=!1);var qe=ts(T.props.triggerTarget||t);qe.forEach(function(Ue){Ue.addEventListener(B,le,xe),y.push({node:Ue,eventType:B,handler:le,options:xe})})}function Jt(){he()&&(xt("touchstart",sn,{passive:!0}),xt("touchend",_t,{passive:!0})),gB(T.props.trigger).forEach(function(B){if(B!=="manual")switch(xt(B,sn),B){case"mouseenter":xt("mouseleave",_t);break;case"focus":xt(NB?"focusout":"blur",Je);break;case"focusin":xt("focusout",Je);break}})}function pt(){y.forEach(function(B){var le=B.node,xe=B.eventType,qe=B.handler,Ue=B.options;le.removeEventListener(xe,qe,Ue)}),y=[]}function sn(B){var le,xe=!1;if(!(!T.state.isEnabled||Xn(B)||l)){var qe=((le=f)==null?void 0:le.type)==="focus";f=B,w=B.currentTarget,J(),!T.state.isVisible&&vB(B)&&Ac.forEach(function(Ue){return Ue(B)}),B.type==="click"&&(T.props.trigger.indexOf("mouseenter")<0||s)&&T.props.hideOnClick!==!1&&T.state.isVisible?xe=!0:fe(B),B.type==="click"&&(s=!xe),xe&&!qe&&ct(B)}}function Xt(B){var le=B.target,xe=me().contains(le)||O.contains(le);if(!(B.type==="mousemove"&&xe)){var qe=we().concat(O).map(function(Ue){var Bt,an=Ue._tippy,Jr=(Bt=an.popperInstance)==null?void 0:Bt.state;return Jr?{popperRect:Ue.getBoundingClientRect(),popperState:Jr,props:n}:null}).filter(Boolean);SB(qe,B)&&(ae(),ct(B))}}function _t(B){var le=Xn(B)||T.props.trigger.indexOf("click")>=0&&s;if(!le){if(T.props.interactive){T.hideWithInteractivity(B);return}ct(B)}}function Je(B){T.props.trigger.indexOf("focusin")<0&&B.target!==me()||T.props.interactive&&B.relatedTarget&&O.contains(B.relatedTarget)||ct(B)}function Xn(B){return yr.isTouch?he()!==B.type.indexOf("touch")>=0:!1}function Dt(){V();var B=T.props,le=B.popperOptions,xe=B.placement,qe=B.offset,Ue=B.getReferenceClientRect,Bt=B.moveTransition,an=Se()?dh(O).arrow:null,Jr=Ue?{getBoundingClientRect:Ue,contextElement:Ue.contextElement||me()}:t,Ca={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Mi){var Xr=Mi.state;if(Se()){var Bu=ge(),bs=Bu.box;["placement","reference-hidden","escaped"].forEach(function(Zr){Zr==="placement"?bs.setAttribute("data-placement",Xr.placement):Xr.attributes.popper["data-popper-"+Zr]?bs.setAttribute("data-"+Zr,""):bs.removeAttribute("data-"+Zr)}),Xr.attributes.popper={}}}},_r=[{name:"offset",options:{offset:qe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Bt}},Ca];Se()&&an&&_r.push({name:"arrow",options:{element:an,padding:3}}),_r.push.apply(_r,le?.modifiers||[]),T.popperInstance=oh(Jr,O,Object.assign({},le,{placement:xe,onFirstUpdate:m,modifiers:_r}))}function V(){T.popperInstance&&(T.popperInstance.destroy(),T.popperInstance=null)}function bt(){var B=T.props.appendTo,le,xe=me();T.props.interactive&&B===Lw||B==="parent"?le=xe.parentNode:le=Dw(B,[xe]),le.contains(O)||le.appendChild(O),T.state.isMounted=!0,Dt()}function we(){return Mc(O.querySelectorAll("[data-tippy-root]"))}function fe(B){T.clearDelayTimeouts(),B&&R("onTrigger",[T,B]),Me();var le=_e(!0),xe=re(),qe=xe[0],Ue=xe[1];yr.isTouch&&qe==="hold"&&Ue&&(le=Ue),le?r=setTimeout(function(){T.show()},le):T.show()}function ct(B){if(T.clearDelayTimeouts(),R("onUntrigger",[T,B]),!T.state.isVisible){Be();return}if(!(T.props.trigger.indexOf("mouseenter")>=0&&T.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&s)){var le=_e(!1);le?i=setTimeout(function(){T.state.isVisible&&T.hide()},le):o=requestAnimationFrame(function(){T.hide()})}}function ut(){T.state.isEnabled=!0}function Pt(){T.hide(),T.state.isEnabled=!1}function kt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function I(B){if(!T.state.isDestroyed){R("onBeforeUpdate",[T,B]),pt();var le=T.props,xe=Mw(t,Object.assign({},le,Sw(B),{ignoreAttributes:!0}));T.props=xe,Jt(),le.interactiveDebounce!==xe.interactiveDebounce&&(ae(),b=xw(Xt,xe.interactiveDebounce)),le.triggerTarget&&!xe.triggerTarget?ts(le.triggerTarget).forEach(function(qe){qe.removeAttribute("aria-expanded")}):xe.triggerTarget&&t.removeAttribute("aria-expanded"),J(),A(),Y&&Y(le,xe),T.popperInstance&&(Dt(),we().forEach(function(qe){requestAnimationFrame(qe._tippy.popperInstance.forceUpdate)})),R("onAfterUpdate",[T,B])}}function F(B){T.setProps({content:B})}function X(){var B=T.state.isVisible,le=T.state.isDestroyed,xe=!T.state.isEnabled,qe=yr.isTouch&&!T.props.touch,Ue=sh(T.props.duration,0,cr.duration);if(!(B||le||xe||qe)&&!me().hasAttribute("disabled")&&(R("onShow",[T],!1),T.props.onShow(T)!==!1)){if(T.state.isVisible=!0,Se()&&(O.style.visibility="visible"),A(),Me(),T.state.isMounted||(O.style.transition="none"),Se()){var Bt=ge(),an=Bt.box,Jr=Bt.content;ah([an,Jr],0)}m=function(){var _r;if(!(!T.state.isVisible||d)){if(d=!0,O.offsetHeight,O.style.transition=T.props.moveTransition,Se()&&T.props.animation){var gs=ge(),Mi=gs.box,Xr=gs.content;ah([Mi,Xr],Ue),Tw([Mi,Xr],"visible")}K(),J(),_w(ch,T),(_r=T.popperInstance)==null||_r.forceUpdate(),R("onMount",[T]),T.props.animation&&Se()&&Nt(Ue,function(){T.state.isShown=!0,R("onShown",[T])})}},bt()}}function se(){var B=!T.state.isVisible,le=T.state.isDestroyed,xe=!T.state.isEnabled,qe=sh(T.props.duration,1,cr.duration);if(!(B||le||xe)&&(R("onHide",[T],!1),T.props.onHide(T)!==!1)){if(T.state.isVisible=!1,T.state.isShown=!1,d=!1,s=!1,Se()&&(O.style.visibility="hidden"),ae(),Be(),A(!0),Se()){var Ue=ge(),Bt=Ue.box,an=Ue.content;T.props.animation&&(ah([Bt,an],qe),Tw([Bt,an],"hidden"))}K(),J(),T.props.animation?Se()&&wt(qe,T.unmount):T.unmount()}}function Fe(B){Ce().addEventListener("mousemove",b),_w(Ac,b),b(B)}function it(){T.state.isVisible&&T.hide(),T.state.isMounted&&(V(),we().forEach(function(B){B._tippy.unmount()}),O.parentNode&&O.parentNode.removeChild(O),ch=ch.filter(function(B){return B!==T}),T.state.isMounted=!1,R("onHidden",[T]))}function xr(){T.state.isDestroyed||(T.clearDelayTimeouts(),T.unmount(),pt(),delete t._tippy,T.state.isDestroyed=!0,R("onDestroy",[T]))}}function fa(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);AB();var r=Object.assign({},e,{plugins:n}),i=xB(t);if(0)var o,s;var l=i.reduce(function(u,d){var f=d&&BB(d,r);return f&&u.push(f),u},[]);return Nc(t)?l[0]:l}fa.defaultProps=cr;fa.setDefaultProps=IB;fa.currentInput=yr;var PV=Object.assign({},ia,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});fa.setDefaultProps({render:Fw});var ns=fa;var ph=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:u,from:d,to:f})=>{let{doc:h,selection:m}=u,{empty:y}=m,b=!h.textBetween(d,f).length&&nc(u.selection),w=this.element.contains(document.activeElement);return!(!(l.hasFocus()||w)||y||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var u;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,u)=>{let d=!u?.selection.eq(l.state.selection),f=!u?.doc.eq(l.state.doc);!d&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,f,u)},this.updateDelay))},this.updateHandler=(l,u,d,f)=>{var h,m,y;let{state:b,composing:w}=l,{selection:_}=b;if(w||!u&&!d)return;this.createTooltip();let{ranges:D}=_,L=Math.min(...D.map(O=>O.$from.pos)),T=Math.max(...D.map(O=>O.$to.pos));if(!((h=this.shouldShow)===null||h===void 0?void 0:h.call(this,{editor:this.editor,view:l,state:b,oldState:f,from:L,to:T}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((y=this.tippyOptions)===null||y===void 0?void 0:y.getReferenceClientRect)||(()=>{if(sc(b.selection)){let O=l.nodeDOM(L),Y=O.dataset.nodeViewWrapper?O:O.querySelector("[data-node-view-wrapper]");if(Y&&(O=Y.firstChild),O)return O.getBoundingClientRect()}return ac(l,L,T)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ns(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},FB=t=>new De({key:typeof t.pluginKey=="string"?new Ke(t.pluginKey):t.pluginKey,view:e=>new ph({view:e,...t})}),Hw=Ve.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[FB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var hh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{let{selection:u}=l,{$anchor:d,empty:f}=u,h=d.depth===1,m=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!s.hasFocus()||!f||!h||!m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ns(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;let{state:s}=e,{doc:l,selection:u}=s,{from:d,to:f}=u;if(n&&n.doc.eq(l)&&n.selection.eq(u))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>ac(e,d,f))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},HB=t=>new De({key:typeof t.pluginKey=="string"?new Ke(t.pluginKey):t.pluginKey,view:e=>new hh({view:e,...t})}),$w=Ve.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[HB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});var mh=oe.create({name:"checkedList",priority:50,addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{class:"checked-list"}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul",getAttrs:t=>t.classList.contains("checked-list"),priority:1e3}]},renderHTML({HTMLAttributes:t}){return["ul",j(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleCheckedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}}});var gh=oe.create({name:"lead",group:"block",content:"block+",addOptions(){return{HTMLAttributes:{class:"lead"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("lead")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",j(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleLead:()=>({commands:t})=>t.toggleWrap(this.name)}}});var $B="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",zB="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",ss=(t,e)=>{for(let n in e)t[n]=e[n];return t},wh="numeric",xh="ascii",_h="alpha",Lc="asciinumeric",kc="alphanumeric",Sh="domain",Jw="emoji",UB="scheme",WB="slashscheme",zw="whitespace";function KB(t,e){return t in e||(e[t]=[]),e[t]}function ho(t,e,n){e[wh]&&(e[Lc]=!0,e[kc]=!0),e[xh]&&(e[Lc]=!0,e[_h]=!0),e[Lc]&&(e[kc]=!0),e[_h]&&(e[kc]=!0),e[kc]&&(e[Sh]=!0),e[Jw]&&(e[Sh]=!0);for(let r in e){let i=KB(r,n);i.indexOf(t)<0&&i.push(t)}}function VB(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function wn(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}wn.groups={};wn.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){let i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(t))return o}return e.jd},has(t,e){return e===void 0&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||wn.groups;let i;return e&&e.j?i=e:(i=new wn(e),n&&r&&ho(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this,o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||wn.groups;let i=this;if(e&&e.j)return i.j[t]=e,e;let o=e,s,l=i.go(t);if(l?(s=new wn,ss(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new wn,o){if(r)if(s.t&&typeof s.t=="string"){let u=ss(VB(s.t,r),n);ho(o,u,r)}else n&&ho(o,n,r);s.t=o}return i.j[t]=s,s}};var Pe=(t,e,n,r,i)=>t.ta(e,n,r,i),qn=(t,e,n,r,i)=>t.tr(e,n,r,i),Uw=(t,e,n,r,i)=>t.ts(e,n,r,i),Q=(t,e,n,r,i)=>t.tt(e,n,r,i),qr="WORD",Th="UWORD",ga="LOCALHOST",Ch="TLD",Ah="UTLD",Dc="SCHEME",is="SLASH_SCHEME",Mh="NUM",Xw="WS",Nh="NL",pa="OPENBRACE",ha="CLOSEBRACE",Pc="OPENBRACKET",Bc="CLOSEBRACKET",Fc="OPENPAREN",Hc="CLOSEPAREN",$c="OPENANGLEBRACKET",zc="CLOSEANGLEBRACKET",Uc="FULLWIDTHLEFTPAREN",Wc="FULLWIDTHRIGHTPAREN",Kc="LEFTCORNERBRACKET",Vc="RIGHTCORNERBRACKET",Gc="LEFTWHITECORNERBRACKET",qc="RIGHTWHITECORNERBRACKET",Yc="FULLWIDTHLESSTHAN",Jc="FULLWIDTHGREATERTHAN",Xc="AMPERSAND",Zc="APOSTROPHE",jc="ASTERISK",_i="AT",Qc="BACKSLASH",eu="BACKTICK",tu="CARET",Si="COLON",kh="COMMA",nu="DOLLAR",Er="DOT",ru="EQUALS",Oh="EXCLAMATION",vr="HYPHEN",iu="PERCENT",ou="PIPE",su="PLUS",au="POUND",lu="QUERY",Rh="QUOTE",Ih="SEMI",wr="SLASH",ma="TILDE",cu="UNDERSCORE",Zw="EMOJI",uu="SYM",jw=Object.freeze({__proto__:null,WORD:qr,UWORD:Th,LOCALHOST:ga,TLD:Ch,UTLD:Ah,SCHEME:Dc,SLASH_SCHEME:is,NUM:Mh,WS:Xw,NL:Nh,OPENBRACE:pa,CLOSEBRACE:ha,OPENBRACKET:Pc,CLOSEBRACKET:Bc,OPENPAREN:Fc,CLOSEPAREN:Hc,OPENANGLEBRACKET:$c,CLOSEANGLEBRACKET:zc,FULLWIDTHLEFTPAREN:Uc,FULLWIDTHRIGHTPAREN:Wc,LEFTCORNERBRACKET:Kc,RIGHTCORNERBRACKET:Vc,LEFTWHITECORNERBRACKET:Gc,RIGHTWHITECORNERBRACKET:qc,FULLWIDTHLESSTHAN:Yc,FULLWIDTHGREATERTHAN:Jc,AMPERSAND:Xc,APOSTROPHE:Zc,ASTERISK:jc,AT:_i,BACKSLASH:Qc,BACKTICK:eu,CARET:tu,COLON:Si,COMMA:kh,DOLLAR:nu,DOT:Er,EQUALS:ru,EXCLAMATION:Oh,HYPHEN:vr,PERCENT:iu,PIPE:ou,PLUS:su,POUND:au,QUERY:lu,QUOTE:Rh,SEMI:Ih,SLASH:wr,TILDE:ma,UNDERSCORE:cu,EMOJI:Zw,SYM:uu}),rs=/[a-z]/,bh=/\p{L}/u,yh=/\p{Emoji}/u;var Eh=/\d/,Ww=/\s/;var Kw=`
|
|
`,GB="\uFE0F",qB="\u200D",Oc=null,Rc=null;function YB(t){t===void 0&&(t=[]);let e={};wn.groups=e;let n=new wn;Oc==null&&(Oc=Vw($B)),Rc==null&&(Rc=Vw(zB)),Q(n,"'",Zc),Q(n,"{",pa),Q(n,"}",ha),Q(n,"[",Pc),Q(n,"]",Bc),Q(n,"(",Fc),Q(n,")",Hc),Q(n,"<",$c),Q(n,">",zc),Q(n,"\uFF08",Uc),Q(n,"\uFF09",Wc),Q(n,"\u300C",Kc),Q(n,"\u300D",Vc),Q(n,"\u300E",Gc),Q(n,"\u300F",qc),Q(n,"\uFF1C",Yc),Q(n,"\uFF1E",Jc),Q(n,"&",Xc),Q(n,"*",jc),Q(n,"@",_i),Q(n,"`",eu),Q(n,"^",tu),Q(n,":",Si),Q(n,",",kh),Q(n,"$",nu),Q(n,".",Er),Q(n,"=",ru),Q(n,"!",Oh),Q(n,"-",vr),Q(n,"%",iu),Q(n,"|",ou),Q(n,"+",su),Q(n,"#",au),Q(n,"?",lu),Q(n,'"',Rh),Q(n,"/",wr),Q(n,";",Ih),Q(n,"~",ma),Q(n,"_",cu),Q(n,"\\",Qc);let r=qn(n,Eh,Mh,{[wh]:!0});qn(r,Eh,r);let i=qn(n,rs,qr,{[xh]:!0});qn(i,rs,i);let o=qn(n,bh,Th,{[_h]:!0});qn(o,rs),qn(o,bh,o);let s=qn(n,Ww,Xw,{[zw]:!0});Q(n,Kw,Nh,{[zw]:!0}),Q(s,Kw),qn(s,Ww,s);let l=qn(n,yh,Zw,{[Jw]:!0});qn(l,yh,l),Q(l,GB,l);let u=Q(l,qB);qn(u,yh,l);let d=[[rs,i]],f=[[rs,null],[bh,o]];for(let h=0;h<Oc.length;h++)xi(n,Oc[h],Ch,qr,d);for(let h=0;h<Rc.length;h++)xi(n,Rc[h],Ah,Th,f);ho(Ch,{tld:!0,ascii:!0},e),ho(Ah,{utld:!0,alpha:!0},e),xi(n,"file",Dc,qr,d),xi(n,"mailto",Dc,qr,d),xi(n,"http",is,qr,d),xi(n,"https",is,qr,d),xi(n,"ftp",is,qr,d),xi(n,"ftps",is,qr,d),ho(Dc,{scheme:!0,ascii:!0},e),ho(is,{slashscheme:!0,ascii:!0},e),t=t.sort((h,m)=>h[0]>m[0]?1:-1);for(let h=0;h<t.length;h++){let m=t[h][0],b=t[h][1]?{[UB]:!0}:{[WB]:!0};m.indexOf("-")>=0?b[Sh]=!0:rs.test(m)?Eh.test(m)?b[Lc]=!0:b[xh]=!0:b[wh]=!0,Uw(n,m,m,b)}return Uw(n,"localhost",ga,{ascii:!0}),n.jd=new wn(uu),{start:n,tokens:ss({groups:e},jw)}}function JB(t,e){let n=XB(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let l=t,u=null,d=0,f=null,h=-1,m=-1;for(;s<r&&(u=l.go(n[s]));)l=u,l.accepts()?(h=0,m=0,f=l):h>=0&&(h+=n[s].length,m++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=m,d-=h,i.push({t:f.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function XB(t){let e=[],n=t.length,r=0;for(;r<n;){let i=t.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function xi(t,e,n,r,i){let o,s=e.length;for(let l=0;l<s-1;l++){let u=e[l];t.j[u]?o=t.j[u]:(o=new wn(r),o.jr=i.slice(),t.j[u]=o),t=o}return o=new wn(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function Vw(t){let e=[],n=[],r=0,i="0123456789";for(;r<t.length;){let o=0;for(;i.indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}var ba={defaultProtocol:"http",events:null,format:Gw,formatHref:Gw,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Lh(t,e){e===void 0&&(e=null);let n=ss({},ba);t&&(n=ss(n,t instanceof Lh?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}Lh.prototype={o:ba,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){let r=e!=null,i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:ba[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Gw(t){return t}function Qw(t,e){this.t="token",this.v=t,this.tk=e}Qw.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=ba.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),u&&(s.target=u),d&&(s.rel=d),f&&ss(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function du(t,e){class n extends Qw{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var qw=du("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Yw=du("text"),ZB=du("nl"),Ic=du("url",{isLink:!0,toHref(t){return t===void 0&&(t=ba.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==ga&&t[1].t===Si}});var Yn=t=>new wn(t);function jB(t){let{groups:e}=t,n=e.domain.concat([Xc,jc,_i,Qc,eu,tu,nu,ru,vr,Mh,iu,ou,su,au,wr,uu,ma,cu]),r=[Zc,Si,kh,Er,Oh,lu,Rh,Ih,$c,zc,pa,ha,Bc,Pc,Fc,Hc,Uc,Wc,Kc,Vc,Gc,qc,Yc,Jc],i=[Xc,Zc,jc,Qc,eu,tu,nu,ru,vr,pa,ha,iu,ou,su,au,lu,wr,uu,ma,cu],o=Yn(),s=Q(o,ma);Pe(s,i,s),Pe(s,e.domain,s);let l=Yn(),u=Yn(),d=Yn();Pe(o,e.domain,l),Pe(o,e.scheme,u),Pe(o,e.slashscheme,d),Pe(l,i,s),Pe(l,e.domain,l);let f=Q(l,_i);Q(s,_i,f),Q(u,_i,f),Q(d,_i,f);let h=Q(s,Er);Pe(h,i,s),Pe(h,e.domain,s);let m=Yn();Pe(f,e.domain,m),Pe(m,e.domain,m);let y=Q(m,Er);Pe(y,e.domain,m);let b=Yn(qw);Pe(y,e.tld,b),Pe(y,e.utld,b),Q(f,ga,b);let w=Q(m,vr);Pe(w,e.domain,m),Pe(b,e.domain,m),Q(b,Er,y),Q(b,vr,w);let _=Q(b,Si);Pe(_,e.numeric,qw);let S=Q(l,vr),D=Q(l,Er);Pe(S,e.domain,l),Pe(D,i,s),Pe(D,e.domain,l);let L=Yn(Ic);Pe(D,e.tld,L),Pe(D,e.utld,L),Pe(L,e.domain,l),Pe(L,i,s),Q(L,Er,D),Q(L,vr,S),Q(L,_i,f);let T=Q(L,Si),$=Yn(Ic);Pe(T,e.numeric,$);let O=Yn(Ic),Y=Yn();Pe(O,n,O),Pe(O,r,Y),Pe(Y,n,O),Pe(Y,r,Y),Q(L,wr,O),Q($,wr,O);let ee=Q(u,Si),z=Q(d,Si),re=Q(z,wr),he=Q(re,wr);Pe(u,e.domain,l),Q(u,Er,D),Q(u,vr,S),Pe(d,e.domain,l),Q(d,Er,D),Q(d,vr,S),Pe(ee,e.domain,O),Q(ee,wr,O),Pe(he,e.domain,O),Pe(he,n,O),Q(he,wr,O);let Se=[[pa,ha],[Pc,Bc],[Fc,Hc],[$c,zc],[Uc,Wc],[Kc,Vc],[Gc,qc],[Yc,Jc]];for(let me=0;me<Se.length;me++){let[Ce,ge]=Se[me],_e=Q(O,Ce);Q(Y,Ce,_e),Q(_e,ge,O);let A=Yn(Ic);Pe(_e,n,A);let R=Yn();Pe(_e,r),Pe(A,n,A),Pe(A,r,R),Pe(R,n,A),Pe(R,r,R),Q(A,ge,O),Q(R,ge,O)}return Q(o,ga,L),Q(o,Nh,ZB),{start:o,tokens:jw}}function QB(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=t,u=null,d=null,f=0,h=null,m=-1;for(;i<r&&!(u=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(d=u||l.go(n[i].t));)u=null,l=d,l.accepts()?(m=0,h=l):m>=0&&m++,i++,f++;if(m<0)i-=f,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(vh(Yw,e,s)),s=[]),i-=m,f-=m;let y=h.t,b=n.slice(i-f,i);o.push(vh(y,e,b))}}return s.length>0&&o.push(vh(Yw,e,s)),o}function vh(t,e,n){let r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}var e2=typeof console<"u"&&console&&console.warn||(()=>{}),t2="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ft={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ex(){wn.groups={},ft.scanner=null,ft.parser=null,ft.tokenQueue=[],ft.pluginQueue=[],ft.customSchemes=[],ft.initialized=!1}function Dh(t,e){if(e===void 0&&(e=!1),ft.initialized&&e2(`linkifyjs: already initialized - will not register custom scheme "${t}" ${t2}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
2. Cannot start or end with "-"
|
|
3. "-" cannot repeat`);ft.customSchemes.push([t,e])}function n2(){ft.scanner=YB(ft.customSchemes);for(let t=0;t<ft.tokenQueue.length;t++)ft.tokenQueue[t][1]({scanner:ft.scanner});ft.parser=jB(ft.scanner.tokens);for(let t=0;t<ft.pluginQueue.length;t++)ft.pluginQueue[t][1]({scanner:ft.scanner,parser:ft.parser});ft.initialized=!0}function Ph(t){return ft.initialized||n2(),QB(ft.parser.start,t,JB(ft.scanner.start,t))}function Bh(t,e,n){if(e===void 0&&(e=null),n===void 0&&(n=null),e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new Lh(n),i=Ph(t),o=[];for(let s=0;s<i.length;s++){let l=i[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&o.push(l.toFormattedObject(r))}return o}function r2(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function i2(t){return new De({key:new Ke("autolink"),appendTransaction:(e,n,r)=>{let i=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,l=zE(n.doc,[...e]);if(WE(l).forEach(({newRange:d})=>{let f=UE(r.doc,d,y=>y.isTextblock),h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,d.to,void 0," ")),h&&m){let y=m.split(" ").filter(S=>S!=="");if(y.length<=0)return!1;let b=y[y.length-1],w=h.pos+m.lastIndexOf(b);if(!b)return!1;let _=Ph(b).map(S=>S.toObject(t.defaultProtocol));if(!r2(_))return!1;_.filter(S=>S.isLink).map(S=>({...S,from:w+S.start+1,to:w+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).forEach(S=>{ic(S.from,S.to,r.doc).some(D=>D.mark.type===t.type)||s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function o2(t){return new De({key:new Ke("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target,l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;let u=Tp(e.state,t.type.name),d=r.target,f=(i=d?.href)!==null&&i!==void 0?i:u.href,h=(o=d?.target)!==null&&o!==void 0?o:u.target;return d&&f?(window.open(f,h),!0):!1}}})}function s2(t){return new De({key:new Ke("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});let u=Bh(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u?!1:(t.editor.commands.setMark(t.type,{href:u.href}),!0)}}})}var a2=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function tx(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(a2,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}var nx=je.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){Dh(t);return}Dh(t.scheme,t.optionalSlashes)})},onDestroy(){ex()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return!e||!tx(e,this.options.protocols)?!1:null}}]},renderHTML({HTMLAttributes:t}){return tx(t.href,this.options.protocols)?["a",j(this.options.HTMLAttributes,t),0]:["a",j(this.options.HTMLAttributes,{...t,href:""}),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[vn({find:t=>{let e=[];if(t){let{validate:n}=this.options,r=Bh(t).filter(i=>i.isLink&&n(i.value));r.length&&r.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[];return this.options.autolink&&t.push(i2({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(o2({type:this.type})),this.options.linkOnPaste&&t.push(s2({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});var Fh=nx.extend({addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{},validate:void 0}},addAttributes(){return{href:{default:null},id:{default:null},target:{default:this.options.HTMLAttributes.target},hreflang:{default:null},rel:{default:null},referrerpolicy:{default:null},class:{default:null},as_button:{default:null,parseHTML:t=>t.getAttribute("data-as-button"),renderHTML:t=>({"data-as-button":t.as_button})},button_theme:{default:null,parseHTML:t=>t.getAttribute("data-as-button-theme"),renderHTML:t=>({"data-as-button-theme":t.button_theme})}}}});var l2=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,rx=oe.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",j(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[lc({find:l2,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Hh=rx.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},lazy:{default:null,parseHTML:t=>t.getAttribute("loading")==="lazy"?t.getAttribute("data-lazy"):null,renderHTML:t=>{if(t.lazy)return{"data-lazy":t.lazy,loading:"lazy"}}}}}});var c2=pc.extend({addAttributes(){return{class:{default:null}}}});var $h=je.create({name:"small",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"small"}]},renderHTML({HTMLAttributes:t}){return["small",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setSmall:()=>({commands:t})=>t.setMark(this.name),toggleSmall:()=>({commands:t})=>t.toggleMark(this.name),unsetSmall:()=>({commands:t})=>t.unsetMark(this.name)}}});function ix(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function ox(t){if(t.cached.gridNodeTypes)return t.cached.gridNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridRole&&(e[r.spec.gridRole]=r)}),t.cached.gridNodeTypes=e,e}function sx(t,e,n,r){let i=ox(t),o=[];for(let s=0;s<e;s+=1){let l=ix(i.column,r);l&&o.push(l)}return i.grid.createChecked({cols:e,type:n},o)}var zh=oe.create({name:"grid",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"gridColumn+",gridRole:"grid",addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid"}}},addAttributes(){return{type:{default:"responsive",parseHTML:t=>t.getAttribute("type")},cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid")&&null}]},renderHTML({HTMLAttributes:t}){return["div",j(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({cols:t=3,type:e="responsive"}={})=>({tr:n,dispatch:r,editor:i})=>{let o=sx(i.schema,t,e);if(r){let s=n.selection.anchor+1;n.replaceSelectionWith(o).scrollIntoView().setSelection(ce.near(n.doc.resolve(s)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGrid()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridRole:Te(ne(t,"gridRole",e))}}});var Uh=oe.create({name:"gridColumn",content:"block+",gridRole:"column",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid__column"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",j(this.options.HTMLAttributes,t),0]}});var lx=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),ax=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",Wh=t=>{let{url:e,controls:n,nocookie:r,startAt:i}=t;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){let d=e.split("/").pop();return d?`${ax(r)}${d}`:null}let s=/v=([-\w]+)/gm.exec(e);if(!s||!s[1])return null;let l=`${ax(r)}${s[1]}`,u=[];return n?u.push("controls=1"):u.push("controls=0"),i&&u.push(`start=${i}`),u.length&&(l+=`?${u.join("&")}`),l};var Kh=oe.create({name:"youtube",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},start:{default:0},controls:{default:!0},nocookie:{default:!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>{if(!lx(t.src))return!1;let n=Wh({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=Wh({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return["div",{"data-youtube-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowFullscreen,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var cx=t=>t.match(/(vimeo\.com)(.+)?$/),Vh=t=>{let{url:e,autoplay:n,loop:r,title:i,byline:o,portrait:s}=t;if(e.includes("/video/"))return e;let u=/\.com\/([0-9]+)/gm.exec(e);if(!u||!u[1])return null;let d=`https://player.vimeo.com/video/${u[1]}`,f=[`autoplay=${n}`,`loop=${r}`,`title=${i}`,`byline=${o}`,`portrait=${s}`];return d+=`?${f.join("&")}`,d};var Gh=oe.create({name:"vimeo",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},allowFullscreen:!0,width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:0},loop:{default:0},title:{default:0},byline:{default:0},portrait:{default:0},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-vimeo-video] iframe"}]},addCommands(){return{setVimeoVideo:t=>({commands:e})=>{if(!cx(t.src))return!1;let n=Vh({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=Vh({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return["div",{"data-vimeo-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowfullscreen,frameborder:0,allow:"autoplay; fullscreen; picture-in-picture",style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var qh=oe.create({name:"video",selectable:!0,draggable:!0,atom:!0,inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addOptions(){return{inline:!1,HTMLAttributes:{autoplay:null,controls:null,loop:null},width:640,height:480}},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:null,parseHTML:t=>t.getAttribute("autoplay")},controls:{default:null,parseHTML:t=>t.getAttribute("controls")},loop:{default:null,parseHTML:t=>t.getAttribute("loop")},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-native-video] video"}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-native-video":"",class:t.responsive?"responsive":null},["video",{src:t.src,width:t.width,height:t.height,autoplay:t.autoplay?"true":null,controls:t.controls?"true":null,loop:t.loop?"true":null,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Yh=oe.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{}},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",j(this.options.HTMLAttributes,t),0]},addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{let i=document.createElement("div"),o=document.createElement("div"),s=j(this.options.HTMLAttributes,r,{"data-type":this.name});return Object.entries(s).forEach(([l,u])=>i.setAttribute(l,u)),{dom:i,contentDOM:i,ignoreMutation(l){return l.type==="selection"?!1:!i.contains(l.target)||i===l.target},update:l=>l.type===this.type}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;let{schema:r,selection:i}=t,{$from:o,$to:s}=i,l=o.blockRange(s);if(!l)return!1;let u=t.doc.slice(l.start,l.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(u.content))return!1;let f=((n=u.toJSON())===null||n===void 0?void 0:n.content)||[];return e().insertContentAt({from:l.start,to:l.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:f}]}).setTextSelection(l.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{let{selection:n,schema:r}=t,i=eo(S=>S.type===this.type)(n);if(!i)return!1;let o=Qi(i.node,S=>S.type===r.nodes.detailsSummary),s=Qi(i.node,S=>S.type===r.nodes.detailsContent);if(!o.length||!s.length)return!1;let l=o[0],u=s[0],d=i.pos,f=t.doc.resolve(d),h=d+i.node.nodeSize,m={from:d,to:h},y=u.node.content.toJSON()||[],b=f.parent.type.contentMatch.defaultType,_=[b?.create(null,l.node.content).toJSON(),...y];return e().insertContentAt(m,_).setTextSelection(d+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{let o=r.pos-1,s=r.pos;return i.delete(o,s),!0}):this.editor.commands.unsetDetails()}}}});var Jh=oe.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",j(this.options.HTMLAttributes,t),0]}});var Xh=oe.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="details-content"]'}]},renderHTML({HTMLAttributes:t}){return["div",j(this.options.HTMLAttributes,t,{"data-type":"details-content"}),0]},addKeyboardShortcuts(){return{Enter:({editor:t})=>{let{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:o}=r,s=eo(he=>he.type===this.type)(r);if(!o||!s||!s.node.childCount)return!1;let l=i.index(s.depth),{childCount:u}=s.node;if(!(u===l+1))return!1;let f=s.node.type.contentMatch.defaultType,h=f?.createAndFill();if(!h)return!1;let m=e.doc.resolve(s.pos+1),y=u-1,b=s.node.child(y),w=m.posAtIndex(y,s.depth);if(!b.eq(h))return!1;let S=i.node(-3);if(!S)return!1;let D=i.indexAfter(-3),L=_p(S.contentMatchAt(D));if(!L||!S.canReplaceWith(D,D,L))return!1;let T=L.createAndFill();if(!T)return!1;let{tr:$}=e,O=i.after(-2);$.replaceWith(O,O,T);let Y=$.doc.resolve(O),ee=ue.near(Y,1);$.setSelection(ee);let z=w,re=w+b.nodeSize;return $.delete(z,re),$.scrollIntoView(),n.dispatch($),!0}}}});var u2=/^```([a-z]+)?[\s\n]$/,d2=/^~~~([a-z]+)?[\s\n]$/,ux=oe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",j(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
|
|
`);return!o||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;let l=i.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(ue.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[ra({find:u2,type:this.type,getAttributes:t=>({language:t[1]})}),ra({find:d2,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new De({key:new Ke("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!n||!o)return!1;let{tr:s,schema:l}=t.state,u=l.text(n.replace(/\r\n?/g,`
|
|
`));return s.replaceSelectionWith(this.type.create({language:o},u)),s.selection.$from.parent.type!==this.type&&s.setSelection(ce.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function f2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ex(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Ex(n)}),t}var pu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function vx(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ti(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var p2="</span>",dx=t=>!!t.scope,h2=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},jh=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=vx(e)}openNode(e){if(!dx(e))return;let n=h2(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){dx(e)&&(this.buffer+=p2)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},fx=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Qh=class t{constructor(){this.rootNode=fx(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=fx({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},em=class extends Qh{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new jh(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function ya(t){return t?typeof t=="string"?t:t.source:null}function wx(t){return go("(?=",t,")")}function m2(t){return go("(?:",t,")*")}function g2(t){return go("(?:",t,")?")}function go(...t){return t.map(n=>ya(n)).join("")}function b2(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function nm(...t){return"("+(b2(t).capture?"":"?:")+t.map(r=>ya(r)).join("|")+")"}function xx(t){return new RegExp(t.toString()+"|").exec("").length-1}function y2(t,e){let n=t&&t.exec(e);return n&&n.index===0}var E2=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function rm(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=ya(r),s="";for(;o.length>0;){let l=E2.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var v2=/\b\B/,_x="[a-zA-Z]\\w*",im="[a-zA-Z_]\\w*",Sx="\\b\\d+(\\.\\d+)?",Tx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Cx="\\b(0b[01]+)",w2="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",x2=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=go(e,/.*\b/,t.binary,/\b.*/)),Ti({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Ea={begin:"\\\\[\\s\\S]",relevance:0},_2={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ea]},S2={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ea]},T2={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},mu=function(t,e,n={}){let r=Ti({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=nm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:go(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},C2=mu("//","$"),A2=mu("/\\*","\\*/"),M2=mu("#","$"),N2={scope:"number",begin:Sx,relevance:0},k2={scope:"number",begin:Tx,relevance:0},O2={scope:"number",begin:Cx,relevance:0},R2={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ea,{begin:/\[/,end:/\]/,relevance:0,contains:[Ea]}]},I2={scope:"title",begin:_x,relevance:0},L2={scope:"title",begin:im,relevance:0},D2={begin:"\\.\\s*"+im,relevance:0},P2=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},fu=Object.freeze({__proto__:null,APOS_STRING_MODE:_2,BACKSLASH_ESCAPE:Ea,BINARY_NUMBER_MODE:O2,BINARY_NUMBER_RE:Cx,COMMENT:mu,C_BLOCK_COMMENT_MODE:A2,C_LINE_COMMENT_MODE:C2,C_NUMBER_MODE:k2,C_NUMBER_RE:Tx,END_SAME_AS_BEGIN:P2,HASH_COMMENT_MODE:M2,IDENT_RE:_x,MATCH_NOTHING_RE:v2,METHOD_GUARD:D2,NUMBER_MODE:N2,NUMBER_RE:Sx,PHRASAL_WORDS_MODE:T2,QUOTE_STRING_MODE:S2,REGEXP_MODE:R2,RE_STARTERS_RE:w2,SHEBANG:x2,TITLE_MODE:I2,UNDERSCORE_IDENT_RE:im,UNDERSCORE_TITLE_MODE:L2});function B2(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function F2(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function H2(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=B2,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function $2(t,e){Array.isArray(t.illegal)&&(t.illegal=nm(...t.illegal))}function z2(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function U2(t,e){t.relevance===void 0&&(t.relevance=1)}var W2=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=go(n.beforeMatch,wx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},K2=["of","and","for","in","not","or","if","then","parent","list","value"],V2="keyword";function Ax(t,e,n=V2){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,Ax(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,G2(u[0],u[1])]})}}function G2(t,e){return e?Number(e):q2(t)?0:1}function q2(t){return K2.includes(t.toLowerCase())}var px={},mo=t=>{console.error(t)},hx=(t,...e)=>{console.log(`WARN: ${t}`,...e)},as=(t,e)=>{px[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),px[`${t}/${e}`]=!0)},hu=new Error;function Mx(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=xx(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function Y2(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw mo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),hu;if(typeof t.beginScope!="object"||t.beginScope===null)throw mo("beginScope must be object"),hu;Mx(t,t.begin,{key:"beginScope"}),t.begin=rm(t.begin,{joinWith:""})}}function J2(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw mo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),hu;if(typeof t.endScope!="object"||t.endScope===null)throw mo("endScope must be object"),hu;Mx(t,t.end,{key:"endScope"}),t.end=rm(t.end,{joinWith:""})}}function X2(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Z2(t){X2(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Y2(t),J2(t)}function j2(t){function e(s,l){return new RegExp(ya(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=xx(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(rm(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[F2,z2,Z2,W2].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[H2,$2,U2].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=Ax(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=ya(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return Q2(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ti(t.classNameAliases||{}),o(t)}function Nx(t){return t?t.endsWithParent||Nx(t.starts):!1}function Q2(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ti(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Nx(t)?Ti(t,{starts:t.starts?Ti(t.starts):null}):Object.isFrozen(t)?Ti(t):t}var eF="11.10.0",tm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Zh=vx,mx=Ti,gx=Symbol("nomatch"),tF=7,kx=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:em};function u(A){return l.noHighlightRe.test(A)}function d(A){let R=A.className+" ";R+=A.parentNode?A.parentNode.className:"";let K=l.languageDetectRe.exec(R);if(K){let J=z(K[1]);return J||(hx(o.replace("{}",K[1])),hx("Falling back to no-highlight mode for this block.",A)),J?K[1]:"no-highlight"}return R.split(/\s+/).find(J=>u(J)||z(J))}function f(A,R,K){let J="",ae="";typeof R=="object"?(J=A,K=R.ignoreIllegals,ae=R.language):(as("10.7.0","highlight(lang, code, ...args) has been deprecated."),as("10.7.0",`Please use highlight(code, options) instead.
|
|
https://github.com/highlightjs/highlight.js/issues/2277`),ae=A,J=R),K===void 0&&(K=!0);let be={code:J,language:ae};ge("before:highlight",be);let Ie=be.result?be.result:h(be.language,be.code,K);return Ie.code=be.code,ge("after:highlight",Ie),Ie}function h(A,R,K,J){let ae=Object.create(null);function be(I,F){return I.keywords[F]}function Ie(){if(!V.keywords){we.addText(fe);return}let I=0;V.keywordPatternRe.lastIndex=0;let F=V.keywordPatternRe.exec(fe),X="";for(;F;){X+=fe.substring(I,F.index);let se=Je.case_insensitive?F[0].toLowerCase():F[0],Fe=be(V,se);if(Fe){let[it,xr]=Fe;if(we.addText(X),X="",ae[se]=(ae[se]||0)+1,ae[se]<=tF&&(ct+=xr),it.startsWith("_"))X+=F[0];else{let B=Je.classNameAliases[it]||it;Be(F[0],B)}}else X+=F[0];I=V.keywordPatternRe.lastIndex,F=V.keywordPatternRe.exec(fe)}X+=fe.substring(I),we.addText(X)}function Qe(){if(fe==="")return;let I=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){we.addText(fe);return}I=h(V.subLanguage,fe,!0,bt[V.subLanguage]),bt[V.subLanguage]=I._top}else I=y(fe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ct+=I.relevance),we.__addSublanguage(I._emitter,I.language)}function Me(){V.subLanguage!=null?Qe():Ie(),fe=""}function Be(I,F){I!==""&&(we.startScope(F),we.addText(I),we.endScope())}function wt(I,F){let X=1,se=F.length-1;for(;X<=se;){if(!I._emit[X]){X++;continue}let Fe=Je.classNameAliases[I[X]]||I[X],it=F[X];Fe?Be(it,Fe):(fe=it,Ie(),fe=""),X++}}function Nt(I,F){return I.scope&&typeof I.scope=="string"&&we.openNode(Je.classNameAliases[I.scope]||I.scope),I.beginScope&&(I.beginScope._wrap?(Be(fe,Je.classNameAliases[I.beginScope._wrap]||I.beginScope._wrap),fe=""):I.beginScope._multi&&(wt(I.beginScope,F),fe="")),V=Object.create(I,{parent:{value:V}}),V}function ke(I,F,X){let se=y2(I.endRe,X);if(se){if(I["on:end"]){let Fe=new pu(I);I["on:end"](F,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;I.endsParent&&I.parent;)I=I.parent;return I}}if(I.endsWithParent)return ke(I.parent,F,X)}function xt(I){return V.matcher.regexIndex===0?(fe+=I[0],1):(kt=!0,0)}function Jt(I){let F=I[0],X=I.rule,se=new pu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let it of Fe)if(it&&(it(I,se),se.isMatchIgnored))return xt(F);return X.skip?fe+=F:(X.excludeBegin&&(fe+=F),Me(),!X.returnBegin&&!X.excludeBegin&&(fe=F)),Nt(X,I),X.returnBegin?0:F.length}function pt(I){let F=I[0],X=R.substring(I.index),se=ke(V,I,X);if(!se)return gx;let Fe=V;V.endScope&&V.endScope._wrap?(Me(),Be(F,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Me(),wt(V.endScope,I)):Fe.skip?fe+=F:(Fe.returnEnd||Fe.excludeEnd||(fe+=F),Me(),Fe.excludeEnd&&(fe=F));do V.scope&&we.closeNode(),!V.skip&&!V.subLanguage&&(ct+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&Nt(se.starts,I),Fe.returnEnd?0:F.length}function sn(){let I=[];for(let F=V;F!==Je;F=F.parent)F.scope&&I.unshift(F.scope);I.forEach(F=>we.openNode(F))}let Xt={};function _t(I,F){let X=F&&F[0];if(fe+=I,X==null)return Me(),0;if(Xt.type==="begin"&&F.type==="end"&&Xt.index===F.index&&X===""){if(fe+=R.slice(F.index,F.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Xt.rule,se}return 1}if(Xt=F,F.type==="begin")return Jt(F);if(F.type==="illegal"&&!K){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"<unnamed>")+'"');throw se.mode=V,se}else if(F.type==="end"){let se=pt(F);if(se!==gx)return se}if(F.type==="illegal"&&X==="")return 1;if(Pt>1e5&&Pt>F.index*3)throw new Error("potential infinite loop, way more iterations than matches");return fe+=X,X.length}let Je=z(A);if(!Je)throw mo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let Xn=j2(Je),Dt="",V=J||Xn,bt={},we=new l.__emitter(l);sn();let fe="",ct=0,ut=0,Pt=0,kt=!1;try{if(Je.__emitTokens)Je.__emitTokens(R,we);else{for(V.matcher.considerAll();;){Pt++,kt?kt=!1:V.matcher.considerAll(),V.matcher.lastIndex=ut;let I=V.matcher.exec(R);if(!I)break;let F=R.substring(ut,I.index),X=_t(F,I);ut=I.index+X}_t(R.substring(ut))}return we.finalize(),Dt=we.toHTML(),{language:A,value:Dt,relevance:ct,illegal:!1,_emitter:we,_top:V}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:A,value:Zh(R),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:ut,context:R.slice(ut-100,ut+100),mode:I.mode,resultSoFar:Dt},_emitter:we};if(i)return{language:A,value:Zh(R),illegal:!1,relevance:0,errorRaised:I,_emitter:we,_top:V};throw I}}function m(A){let R={value:Zh(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return R._emitter.addText(A),R}function y(A,R){R=R||l.languages||Object.keys(e);let K=m(A),J=R.filter(z).filter(he).map(Me=>h(Me,A,!1));J.unshift(K);let ae=J.sort((Me,Be)=>{if(Me.relevance!==Be.relevance)return Be.relevance-Me.relevance;if(Me.language&&Be.language){if(z(Me.language).supersetOf===Be.language)return 1;if(z(Be.language).supersetOf===Me.language)return-1}return 0}),[be,Ie]=ae,Qe=be;return Qe.secondBest=Ie,Qe}function b(A,R,K){let J=R&&n[R]||K;A.classList.add("hljs"),A.classList.add(`language-${J}`)}function w(A){let R=null,K=d(A);if(u(K))return;if(ge("before:highlightElement",{el:A,language:K}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new tm("One of your code blocks includes unescaped HTML.",A.innerHTML);R=A;let J=R.textContent,ae=K?f(J,{language:K,ignoreIllegals:!0}):y(J);A.innerHTML=ae.value,A.dataset.highlighted="yes",b(A,K,ae.language),A.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(A.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ae,text:J})}function _(A){l=mx(l,A)}let S=()=>{T(),as("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){T(),as("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function T(){if(document.readyState==="loading"){L=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function $(){L&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",$,!1);function O(A,R){let K=null;try{K=R(t)}catch(J){if(mo("Language definition for '{}' could not be registered.".replace("{}",A)),i)mo(J);else throw J;K=s}K.name||(K.name=A),e[A]=K,K.rawDefinition=R.bind(null,t),K.aliases&&re(K.aliases,{languageName:A})}function Y(A){delete e[A];for(let R of Object.keys(n))n[R]===A&&delete n[R]}function ee(){return Object.keys(e)}function z(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function re(A,{languageName:R}){typeof A=="string"&&(A=[A]),A.forEach(K=>{n[K.toLowerCase()]=R})}function he(A){let R=z(A);return R&&!R.disableAutodetect}function Se(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=R=>{A["before:highlightBlock"](Object.assign({block:R.el},R))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=R=>{A["after:highlightBlock"](Object.assign({block:R.el},R))})}function me(A){Se(A),r.push(A)}function Ce(A){let R=r.indexOf(A);R!==-1&&r.splice(R,1)}function ge(A,R){let K=A;r.forEach(function(J){J[K]&&J[K](R)})}function _e(A){return as("10.7.0","highlightBlock will be removed entirely in v12.0"),as("10.7.0","Please use highlightElement now."),w(A)}Object.assign(t,{highlight:f,highlightAuto:y,highlightAll:T,highlightElement:w,highlightBlock:_e,configure:_,initHighlighting:S,initHighlightingOnLoad:D,registerLanguage:O,unregisterLanguage:Y,listLanguages:ee,getLanguage:z,registerAliases:re,autoDetection:he,inherit:mx,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=eF,t.regex={concat:go,lookahead:wx,either:nm,optional:g2,anyNumberOfTimes:m2};for(let A in fu)typeof fu[A]=="object"&&Ex(fu[A]);return Object.assign(t,fu),t},ls=kx({});ls.newInstance=()=>kx({});var nF=ls;ls.HighlightJS=ls;ls.default=ls;var rF=f2(nF);function Ox(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?Ox(n.children,r):{text:n.value,classes:r}}).flat()}function bx(t){return t.value||t.children||[]}function iF(t){return!!rF.getLanguage(t)}function yx({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return Qi(t,o=>o.type.name===e).forEach(o=>{let s=o.pos+1,l=o.node.attrs.language||r,u=n.listLanguages(),d=l&&(u.includes(l)||iF(l))?bx(n.highlight(l,o.node.textContent)):bx(n.highlightAuto(o.node.textContent));Ox(d).forEach(f=>{let h=s+f.text.length;if(f.classes.length){let m=Tt.inline(s,h,{class:f.classes.join(" ")});i.push(m)}s=h})}),st.create(t,i)}function oF(t){return typeof t=="function"}function sF({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>oF(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new De({key:new Ke("lowlight"),state:{init:(i,{doc:o})=>yx({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,l)=>{let u=s.selection.$head.parent.type.name,d=l.selection.$head.parent.type.name,f=Qi(s.doc,m=>m.type.name===t),h=Qi(l.doc,m=>m.type.name===t);return i.docChanged&&([u,d].includes(t)||h.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(y=>y.pos>=m.from&&y.pos+y.node.nodeSize<=m.to)))?yx({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Rx=ux.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],sF({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var om=Rx.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var sm=oe.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",j(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var am=Ve.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.style&&t.style.includes("text-align")?{}:t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function gu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function Ix(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function Lx(t,e,n,r,i,o,s){let l=Ix(t),u=[];if(n==="asymmetric")u.push(gu(l.builderColumn,i,s)),u.push(gu(l.builderColumn,o,s));else for(let d=0;d<e;d+=1){let f=gu(l.builderColumn,null,s);f&&u.push(f)}return l.gridBuilder.createChecked({"data-cols":e,"data-type":n,"data-stack-at":r},u)}var lm=oe.create({name:"gridBuilder",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"gridBuilderColumn+",gridBuilderRole:"gridBuilder",addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder"}}},addAttributes(){return{"data-type":{default:"responsive",parseHTML:t=>t.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",j(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:l})=>{let u=Lx(l.schema,t,e,n,r,i);if(s){let d=o.selection.anchor+1;o.replaceSelectionWith(u).scrollIntoView().setSelection(ce.near(o.doc.resolve(d)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:Te(ne(t,"gridBuilderRole",e))}}});var cm=oe.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",j(this.options.HTMLAttributes,t),0]}});var um=Ve.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new De({props:{handleDrop(e,n){if(!n)return!1;n.preventDefault();let r=e.posAtCoords({left:n.clientX,top:n.clientY});return n.dataTransfer.getData("block")?(n.target.dispatchEvent(new CustomEvent("dragged-block",{detail:{type:n.dataTransfer.getData("block"),coordinates:r},bubbles:!0})),!1):(n.dataTransfer.getData("mergeTag")&&n.target.dispatchEvent(new CustomEvent("dragged-merge-tag",{detail:{tag:n.dataTransfer.getData("mergeTag"),coordinates:r},bubbles:!0})),!1)}}})]}});var dm=oe.create({name:"tiptapBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addAttributes(){return{preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),renderHTML:t=>t.preview?{"data-preview":t.preview}:null},statePath:{default:null,parseHTML:t=>t.getAttribute("data-state-path"),renderHTML:t=>t.statePath?{"data-state-path":t.statePath}:null},type:{default:null,parseHTML:t=>t.getAttribute("data-type"),renderHTML:t=>t.type?{"data-type":t.type}:null},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:null},data:{default:null,parseHTML:t=>t.getAttribute("data-data"),renderHTML:t=>t.data?{"data-data":JSON.stringify(t.data)}:null}}},parseHTML(){return[{tag:"tiptap-block"}]},renderHTML({HTMLAttributes:t}){return["tiptap-block",j(t)]},addNodeView(){return({editor:t,node:e,getPos:n})=>{let r=document.createElement("div");r.contentEditable="false",r.classList.add("tiptap-block-wrapper");let i=typeof e.attrs.data=="object"?JSON.stringify(e.attrs.data):e.attrs.data;return r.innerHTML=`
|
|
<div
|
|
x-data="{
|
|
showOptionsButton: ${i==="[]"?"false":"true"},
|
|
openSettings() {
|
|
this.$dispatch('open-block-settings', {
|
|
type: \`${e.attrs.type}\`,
|
|
statePath: \`${t.commands.getStatePath()}\`,
|
|
data: ${i},
|
|
coordinates: ${n()}
|
|
})
|
|
},
|
|
deleteBlock() {
|
|
this.$dispatch('delete-block')
|
|
}
|
|
}"
|
|
class="tiptap-block"
|
|
style="min-height: 3rem;"
|
|
>
|
|
<div class="tiptap-block-heading">
|
|
<h3 class="tiptap-block-title">${e.attrs.label}</h3>
|
|
<div x-show="! disabled" class="tiptap-block-actions">
|
|
<button x-show="showOptionsButton" type="button" x-on:click="openSettings">
|
|
<svg class="w-4 h-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
|
|
<path fill-rule="evenodd" d="M7.84 1.804A1 1 0 018.82 1h2.36a1 1 0 01.98.804l.331 1.652a6.993 6.993 0 011.929 1.115l1.598-.54a1 1 0 011.186.447l1.18 2.044a1 1 0 01-.205 1.251l-1.267 1.113a7.047 7.047 0 010 2.228l1.267 1.113a1 1 0 01.206 1.25l-1.18 2.045a1 1 0 01-1.187.447l-1.598-.54a6.993 6.993 0 01-1.929 1.115l-.33 1.652a1 1 0 01-.98.804H8.82a1 1 0 01-.98-.804l-.331-1.652a6.993 6.993 0 01-1.929-1.115l-1.598.54a1 1 0 01-1.186-.447l-1.18-2.044a1 1 0 01.205-1.251l1.267-1.114a7.05 7.05 0 010-2.227L1.821 7.773a1 1 0 01-.206-1.25l1.18-2.045a1 1 0 011.187-.447l1.598.54A6.993 6.993 0 017.51 3.456l.33-1.652zM10 13a3 3 0 100-6 3 3 0 000 6z" clip-rule="evenodd" />
|
|
</svg>
|
|
</button>
|
|
<button type="button" x-on:click="deleteBlock()">
|
|
<svg class="w-4 h-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
|
|
<path fill-rule="evenodd" d="M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z" clip-rule="evenodd" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="preview">
|
|
${e.attrs.preview}
|
|
</div>
|
|
</div>
|
|
`,{dom:r}}},addCommands(){return{insertBlock:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},{type:this.name,attrs:t}),r.setTextSelection(t.coordinates.pos);let{selection:i}=n,{$from:o,$to:s}=i,l=o.blockRange(s);return l?(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:this.name,attrs:t}):r.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),r.setTextSelection(l.end)):(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}):r.setNode({type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}),r.setTextSelection(s.pos+1))},updateBlock:t=>({commands:e,chain:n,state:r})=>{let{selection:i}=r,{$from:o,$to:s}=i,l=o.blockRange(s),u=n();return l?(u.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),u.focus(l.end+1)):t.coordinates?(u.insertContentAt({from:t.coordinates,to:t.coordinates+1},{type:this.name,attrs:t}),!1):(u.insertContentAt({from:o.pos,to:o.pos+1},{type:this.name,attrs:t}),!1)},removeBlock:()=>({commands:t})=>t.deleteSelection()}}});function aF(t){var e;let{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,l=KE(n),u=new RegExp(`\\s${l}$`),d=o?"^":"",f=r?new RegExp(`${d}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${d}(?:^)?${l}[^\\s${l}]*`,"gm"),h=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!h)return null;let m=s.pos-h.length,y=Array.from(h.matchAll(f)).pop();if(!y||y.input===void 0||y.index===void 0)return null;let b=y.input.slice(Math.max(0,y.index-1),y.index),w=new RegExp(`^[${i?.join("")}\0]?$`).test(b);if(i!==null&&!w)return null;let _=m+y.index,S=_+y[0].length;return r&&u.test(h.slice(S-1,S+1))&&(y[0]+=" ",S+=1),_<s.pos&&S>=s.pos?{range:{from:_,to:S},query:y[0].slice(n.length),text:y[0]}:null}var lF=new Ke("suggestion");function Dx({pluginKey:t=lF,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:l="suggestion",command:u=()=>null,items:d=()=>[],render:f=()=>({}),allow:h=()=>!0,findSuggestionMatch:m=aF}){let y,b=f?.(),w=new De({key:t,view(){return{update:async(_,S)=>{var D,L,T,$,O,Y,ee;let z=(D=this.key)===null||D===void 0?void 0:D.getState(S),re=(L=this.key)===null||L===void 0?void 0:L.getState(_.state),he=z.active&&re.active&&z.range.from!==re.range.from,Se=!z.active&&re.active,me=z.active&&!re.active,Ce=!Se&&!me&&z.query!==re.query,ge=Se||he&&Ce,_e=Ce||he,A=me||he&&Ce;if(!ge&&!_e&&!A)return;let R=A&&!ge?z:re,K=_.dom.querySelector(`[data-decoration-id="${R.decorationId}"]`);y={editor:e,range:R.range,query:R.query,text:R.text,items:[],command:J=>u({editor:e,range:R.range,props:J}),decorationNode:K,clientRect:K?()=>{var J;let{decorationId:ae}=(J=this.key)===null||J===void 0?void 0:J.getState(e.state),be=_.dom.querySelector(`[data-decoration-id="${ae}"]`);return be?.getBoundingClientRect()||null}:null},ge&&((T=b?.onBeforeStart)===null||T===void 0||T.call(b,y)),_e&&(($=b?.onBeforeUpdate)===null||$===void 0||$.call(b,y)),(_e||ge)&&(y.items=await d({editor:e,query:R.query})),A&&((O=b?.onExit)===null||O===void 0||O.call(b,y)),_e&&((Y=b?.onUpdate)===null||Y===void 0||Y.call(b,y)),ge&&((ee=b?.onStart)===null||ee===void 0||ee.call(b,y))},destroy:()=>{var _;y&&((_=b?.onExit)===null||_===void 0||_.call(b,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(_,S,D,L){let{isEditable:T}=e,{composing:$}=e.view,{selection:O}=_,{empty:Y,from:ee}=O,z={...S};if(z.composing=$,T&&(Y||e.view.composing)){(ee<S.range.from||ee>S.range.to)&&!$&&!S.composing&&(z.active=!1);let re=m({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:O.$from}),he=`id_${Math.floor(Math.random()*4294967295)}`;re&&h({editor:e,state:L,range:re.range,isActive:S.active})?(z.active=!0,z.decorationId=S.decorationId?S.decorationId:he,z.range=re.range,z.query=re.query,z.text=re.text):z.active=!1}else z.active=!1;return z.active||(z.decorationId=null,z.range={from:0,to:0},z.query=null,z.text=null),z}},props:{handleKeyDown(_,S){var D;let{active:L,range:T}=w.getState(_.state);return L&&((D=b?.onKeyDown)===null||D===void 0?void 0:D.call(b,{view:_,event:S,range:T}))||!1},decorations(_){let{active:S,range:D,decorationId:L}=w.getState(_);return S?st.create(_.doc,[Tt.inline(D.from,D.to,{nodeName:s,class:l,"data-decoration-id":L})]):null}}});return w}var cF=new Ke("mergeTag"),fm=oe.create({name:"mergeTag",group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}}}},parseHTML(){return[{tag:`span[data-type='${this.name}']`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",j({"data-type":this.name},e),`{{ ${t.attrs.id} }}`]},renderText({node:t}){return`{{ ${t.attrs.id} }}`},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1,{selection:r}=e,{empty:i,anchor:o}=r;return i?(e.doc.nodesBetween(o-1,o,(s,l)=>{if(s.type.name===this.name)return n=!0,t.insertText("{{",l,l+s.nodeSize),!1}),n):!1})}},addCommands(){return{insertMergeTag:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},[{type:this.name,attrs:{id:t.tag}},{type:"text",text:" "}]),r}}},addProseMirrorPlugins(){return[Dx({editor:this.editor,char:"{{",items:({query:t})=>this.options.mergeTags.filter(e=>e.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),pluginKey:cF,command:({editor:t,range:e,props:n})=>{t.view.state.selection.$to.nodeAfter?.text?.startsWith(" ")&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),window.getSelection()?.collapseToEnd()},allow:({state:t,range:e})=>{let n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)},render:()=>{let t,e;return{onStart:n=>{if(!n.clientRect)return;let r=`
|
|
<div
|
|
x-data="{
|
|
|
|
items: ['${n.items.join("', '")}'],
|
|
|
|
selectedIndex: 0,
|
|
|
|
init: function () {
|
|
this.$el.parentElement.addEventListener(
|
|
'merge-tags-key-down',
|
|
(event) => this.onKeyDown(event.detail),
|
|
);
|
|
|
|
this.$el.parentElement.addEventListener(
|
|
'merge-tags-update-items',
|
|
(event) => (items = event.detail),
|
|
);
|
|
},
|
|
|
|
onKeyDown: function (event) {
|
|
if (event.key === 'ArrowUp') {
|
|
event.preventDefault();
|
|
this.selectedIndex = ((this.selectedIndex + this.items.length) - 1) % this.items.length;
|
|
|
|
return true;
|
|
};
|
|
|
|
if (event.key === 'ArrowDown') {
|
|
event.preventDefault();
|
|
this.selectedIndex = (this.selectedIndex + 1) % this.items.length;
|
|
|
|
return true;
|
|
};
|
|
|
|
if (event.key === 'Enter') {
|
|
event.preventDefault();
|
|
this.selectItem(this.selectedIndex);
|
|
|
|
return true;
|
|
};
|
|
|
|
return false;
|
|
},
|
|
|
|
selectItem: function (index) {
|
|
const item = this.items[index];
|
|
|
|
if (! item) {
|
|
return;
|
|
};
|
|
|
|
$el.parentElement.dispatchEvent(new CustomEvent('merge-tags-select', { detail: { item } }));
|
|
},
|
|
|
|
}"
|
|
class="tippy-content-p-0"
|
|
>
|
|
<template x-for="(item, index) in items" :key="index">
|
|
<button
|
|
x-text="item"
|
|
x-on:click="selectItem(index)"
|
|
:class="{ 'bg-primary-500': index === selectedIndex }"
|
|
class="block w-full text-left rounded px-2 py-1"
|
|
></button>
|
|
</template>
|
|
</div>
|
|
`;t=document.createElement("div"),t.innerHTML=r,t.addEventListener("merge-tags-select",i=>{n.command({id:i.detail.item})}),e=ns("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t,allowHTML:!0,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(n){if(!n.items.length){e[0].hide();return}e[0].show(),t.dispatchEvent(new CustomEvent("merge-tags-update-items",{detail:n.items}))},onKeyDown(n){t.dispatchEvent(new CustomEvent("merge-tags-key-down",{detail:n.event}))},onExit(){e[0].destroy()}}}})]}});var pm=Ve.create({name:"classExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{class:{default:null,parseHTML:t=>t.getAttribute("class")??null,renderHTML:t=>t.class?{class:t.class}:null}}}]}});var hm=Ve.create({name:"idExtension",addGlobalAttributes(){return[{types:["heading","link"],attributes:{id:{default:null,parseHTML:t=>t.getAttribute("id")??null,renderHTML:t=>t.id?{id:t.id}:null}}}]}});var mm=Ve.create({name:"styleExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.getAttribute("style")??null,renderHTML:t=>t.style?{style:t.style}:null}}}]}});var gm=Ve.create({name:"statePath",addOptions(){return{statePath:null}},addStorage(){return{statePath:null}},onBeforeCreate(){this.storage.statePath=this.options.statePath},addCommands(){return{getStatePath:()=>()=>this.storage.statePath}}});function uF(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},y=e.optional(i)+t.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],_=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:w,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:_},$={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[$,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:O.concat([{begin:/\(/,end:/\)/,keywords:T,contains:O.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+s+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:y,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(Y,ee,$,O,[h,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Px(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=uF(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Bx(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let l={className:"",begin:/\\"/},u={className:"string",begin:/'/,end:/'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],b=["true","false"],w={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],D=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],L=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:y,literal:b,built_in:[..._,...S,"set","shopt",...D,...L]},contains:[h,t.SHEBANG(),m,d,t.HASH_COMMENT_MODE,o,w,s,l,u,n]}}function Fx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},y=e.optional(i)+t.IDENT_RE+"\\s*\\(",_={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:S.concat([{begin:/\(/,end:/\)/,keywords:_,contains:S.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+s+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:y,returnBegin:!0,contains:[t.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:_,disableAutodetect:!0,illegal:"</",contains:[].concat(D,L,S,[h,{begin:t.IDENT_RE+"::",keywords:_},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:h,strings:d,keywords:_}}}function Hx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},y=e.optional(i)+t.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],_=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:w,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:_},$={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[$,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:O.concat([{begin:/\(/,end:/\)/,keywords:T,contains:O.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+s+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:y,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(Y,ee,$,O,[h,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function $x(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=t.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:s},m=t.inherit(h,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=t.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,y,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],m.contains=[w,y,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let _={variants:[b,y,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},D=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",L={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+D+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[_,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},L]}}var dF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),fF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],pF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],hF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],mF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],gF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function zx(t){let e=t.regex,n=dF(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+hF.join("|")+")"},{begin:":(:)?("+mF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gF.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:pF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+fF.join("|")+")\\b"}]}}function Ux(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Wx(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:t.C_NUMBER_RE+"[i]",relevance:1},t.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function Kx(t){let e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Vx(t){let e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},u=/[A-Za-z0-9_-]+/,d=/"(\\"|[^"])*"/,f=/'[^']*'/,h=e.either(u,d,f),m=e.concat(h,"(\\s*\\.\\s*",h,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:m,className:"attr",starts:{end:/$/,contains:[r,l,o,i,s,n]}}]}}var cs="[0-9](_*[0-9])*",bu=`\\.(${cs})`,yu="[0-9a-fA-F](_*[0-9a-fA-F])*",Gx={className:"number",variants:[{begin:`(\\b(${cs})((${bu})|\\.)?|(${bu}))[eE][+-]?(${cs})[fFdD]?\\b`},{begin:`\\b(${cs})((${bu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${bu})[fFdD]?\\b`},{begin:`\\b(${cs})[fFdD]\\b`},{begin:`\\b0[xX]((${yu})\\.?|(${yu})?\\.(${yu}))[pP][+-]?(${cs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${yu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function qx(t,e,n){return n===-1?"":t.replace(e,r=>qx(t,e,n-1))}function Yx(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+qx("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Gx,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Gx,d]}}var Jx="[A-Za-z$_][0-9A-Za-z$_]*",bF=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],yF=["true","false","null","undefined","NaN","Infinity"],Xx=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Zx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],EF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],vF=[].concat(jx,Xx,Zx);function Qx(t){let e=t.regex,n=(R,{after:K})=>{let J="</"+R[0].slice(1);return R.input.indexOf(J,K)!==-1},r=Jx,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,K)=>{let J=R[0].length+R.index,ae=R.input[J];if(ae==="<"||ae===","){K.ignoreMatch();return}ae===">"&&(n(R,{after:J})||K.ignoreMatch());let be,Ie=R.input.substring(J);if(be=Ie.match(/^\s*=/)){K.ignoreMatch();return}if((be=Ie.match(/^\s+extends\s+/))&&be.index===0){K.ignoreMatch();return}}},l={$pattern:Jx,keyword:bF,literal:yF,built_in:vF,"variable.language":EF},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},y={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},w={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},D={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},L=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,y,b,w,_,{match:/\$\d+/},h];m.contains=L.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(L)});let T=[].concat(D,m.contains),$=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),O={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:$},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Xx,...Zx]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},re={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},he={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Se(R){return e.concat("(?!",R.join("|"),")")}let me={match:e.concat(/\b/,Se([...jx,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},_e="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(_e)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,y,b,w,_,D,{match:/\$\d+/},h,ee,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,t.REGEXP_MODE,{className:"function",begin:_e,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},re,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},me,he,Y,ge,{match:/\$[(.]/}]}}function e_(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var us="[0-9](_*[0-9])*",Eu=`\\.(${us})`,vu="[0-9a-fA-F](_*[0-9a-fA-F])*",wF={className:"number",variants:[{begin:`(\\b(${us})((${Eu})|\\.)?|(${Eu}))[eE][+-]?(${us})[fFdD]?\\b`},{begin:`\\b(${us})((${Eu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Eu})[fFdD]?\\b`},{begin:`\\b(${us})[fFdD]\\b`},{begin:`\\b0[xX]((${vu})\\.?|(${vu})?\\.(${vu}))[pP][+-]?(${us})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${vu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function t_(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},d=wF,f=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=h;return m.variants[1].contains=[h],h.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,f,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[h,t.C_LINE_COMMENT_MODE,f],relevance:0},t.C_LINE_COMMENT_MODE,f,l,u,s,t.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
`},d]}}var xF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),_F=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],SF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],n_=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],r_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],TF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),CF=n_.concat(r_);function i_(t){let e=xF(t),n=CF,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],u=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},d=function(L,T,$){return{className:L,begin:T,relevance:$}},f={$pattern:/[a-z-]+/,keyword:r,attribute:SF.join(" ")},h={begin:"\\(",end:"\\)",contains:l,keywords:f,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,h,d("variable","@@?"+i,10),d("variable","@\\{"+i+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let m=l.concat({begin:/\{/,end:/\}/,contains:s}),y={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},b={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+TF.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},w={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:l,relevance:0}},_={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,y,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+_F.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",o,0),d("selector-id","#"+o),d("selector-class","\\."+o,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+n_.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r_.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},D={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[S]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,w,_,D,b,S,y,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function o_(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function s_(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,o,s]}}function a_(t){let e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=t.inherit(d,{contains:[]}),m=t.inherit(f,{contains:[]});d.contains.push(m),f.contains.push(h);let y=[n,u];return[d,f,h,m].forEach(_=>{_.contains=_.contains.concat(y)}),y=y.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},i,r,u,s]}}function l_(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function c_(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},l={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},u=[t.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(y,b,w="\\1")=>{let _=w==="\\1"?w:e.concat(w,b);return e.concat(e.concat("(?:",y,")"),b,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,w,r)},h=(y,b,w)=>e.concat(e.concat("(?:",y,")"),b,/(?:\\.|[^\\\/])*?/,w,r),m=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...d,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function u_(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(me,Ce)=>{Ce.data._beginMatch=me[1]||me[2]},"on:end":(me,Ce)=>{Ce.data._beginMatch!==me[1]&&Ce.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[
|
|
]`,y={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],L={keyword:_,literal:(me=>{let Ce=[];return me.forEach(ge=>{Ce.push(ge),ge.toLowerCase()===ge?Ce.push(ge.toUpperCase()):Ce.push(ge.toLowerCase())}),Ce})(w),built_in:S},T=me=>me.map(Ce=>Ce.replace(/\|\d+$/,"")),$={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",T(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},O=e.concat(r,"\\b(?!\\()"),Y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),O],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),O],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ee={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},z={relevance:0,begin:/\(/,end:/\)/,keywords:L,contains:[ee,o,Y,t.C_BLOCK_COMMENT_MODE,y,b,$]},re={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",T(_).join("\\b|"),"|",T(S).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[z]};z.contains.push(re);let he=[ee,Y,t.C_BLOCK_COMMENT_MODE,y,b,$],Se={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...he]},...he,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:L,contains:[Se,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,re,Y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},$,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:L,contains:["self",o,Y,t.C_BLOCK_COMMENT_MODE,y,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},y,b]}}function d_(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function f_(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function p_(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,f,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",y=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,b=`\\b|${r.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${y}))[eE][+-]?(${m})[jJ]?(?=${b})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${m})[jJ](?=${b})`}]},_={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,w,h,t.HASH_COMMENT_MODE]}]};return d.contains=[h,w,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,w,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},h,_,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,S,h]}]}}function h_(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function m_(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function g_(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},d=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},h={className:"string",contains:[t.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,f]})]}]},m="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${y}))?([eE][+-]?(${y})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},O=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:n}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,d),relevance:0}].concat(u,d);f.contains=O,w.contains=O;let re=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:O}}];return d.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(re).concat(d).concat(O)}}function b_(t){let e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],o=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:l,keyword:i,literal:o,built_in:s},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+r},{begin:"\\b0o([0-7_]+)"+r},{begin:"\\b0x([A-Fa-f0-9_]+)"+r},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+r}],relevance:0},{begin:[/fn/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,t.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:s,type:l}},{className:"punctuation",begin:"->"},n]}}var AF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),MF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],NF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],kF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],OF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],RF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function y_(t){let e=AF(t),n=OF,r=kF,i="@[a-z-]+",o="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+MF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+RF.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:NF.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function E_(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function v_(t){let e=t.regex,n=t.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],y=f,b=[...d,...u].filter(L=>!f.includes(L)),w={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},_={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={begin:e.concat(/\b/,e.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function D(L,{exceptions:T,when:$}={}){let O=$;return T=T||[],L.map(Y=>Y.match(/\|\d+$/)||T.includes(Y)?Y:O(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(b,{when:L=>L.length<3}),literal:o,type:l,built_in:h},contains:[{begin:e.either(...m),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:b.concat(m),literal:o,type:l}},{className:"type",begin:e.either(...s)},S,w,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,_]}}function S_(t){return t?typeof t=="string"?t:t.source:null}function wu(t){return rt("(?=",t,")")}function rt(...t){return t.map(n=>S_(n)).join("")}function IF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function xn(...t){return"("+(IF(t).capture?"":"?:")+t.map(r=>S_(r)).join("|")+")"}var vm=t=>rt(/\b/,t,/\w$/.test(t)?/\b/:/\B/),LF=["Protocol","Type"].map(vm),w_=["init","self"].map(vm),DF=["Any","Self"],bm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],x_=["false","nil","true"],PF=["assignment","associativity","higherThan","left","lowerThan","none","right"],BF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],__=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],T_=xn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),C_=xn(T_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ym=rt(T_,C_,"*"),A_=xn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),xu=xn(A_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Yr=rt(A_,xu,"*"),Em=rt(/[A-Z]/,xu,"*"),FF=["autoclosure",rt(/convention\(/,xn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",rt(/objc\(/,Yr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],HF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function M_(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,xn(...LF,...w_)],className:{2:"keyword"}},o={match:rt(/\./,xn(...bm)),relevance:0},s=bm.filter(ke=>typeof ke=="string").concat(["_|0"]),l=bm.filter(ke=>typeof ke!="string").concat(DF).map(vm),u={variants:[{className:"keyword",match:xn(...l,...w_)}]},d={$pattern:xn(/\b\w+/,/#\w+/),keyword:s.concat(BF),literal:x_},f=[i,o,u],h={match:rt(/\./,xn(...__)),relevance:0},m={className:"built_in",match:rt(/\b/,xn(...__),/(?=\()/)},y=[h,m],b={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:ym},{match:`\\.(\\.|${C_})+`}]},_=[b,w],S="([0-9]_*)+",D="([0-9a-fA-F]_*)+",L={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},T=(ke="")=>({className:"subst",variants:[{match:rt(/\\/,ke,/[0\\tnr"']/)},{match:rt(/\\/,ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),$=(ke="")=>({className:"subst",match:rt(/\\/,ke,/[\t ]*(?:[\r\n]|\r\n)/)}),O=(ke="")=>({className:"subst",label:"interpol",begin:rt(/\\/,ke,/\(/),end:/\)/}),Y=(ke="")=>({begin:rt(ke,/"""/),end:rt(/"""/,ke),contains:[T(ke),$(ke),O(ke)]}),ee=(ke="")=>({begin:rt(ke,/"/),end:rt(/"/,ke),contains:[T(ke),O(ke)]}),z={className:"string",variants:[Y(),Y("#"),Y("##"),Y("###"),ee(),ee("#"),ee("##"),ee("###")]},re={match:rt(/`/,Yr,/`/)},he={className:"variable",match:/\$\d+/},Se={className:"variable",match:`\\$${xu}+`},me=[re,he,Se],Ce={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:HF,contains:[..._,L,z]}]}},ge={className:"keyword",match:rt(/@/,xn(...FF))},_e={className:"meta",match:rt(/@/,Yr)},A=[Ce,ge,_e],R={match:wu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:rt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,xu,"+")},{className:"type",match:Em,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:rt(/\s+&\s+/,wu(Em)),relevance:0}]},K={begin:/</,end:/>/,keywords:d,contains:[...r,...f,...A,b,R]};R.contains.push(K);let J={match:rt(Yr,/\s*:/),keywords:"_|0",relevance:0},ae={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",J,...r,...f,...y,..._,L,z,...me,...A,R]},be={begin:/</,end:/>/,contains:[...r,R]},Ie={begin:xn(wu(rt(Yr,/\s*:/)),wu(rt(Yr,/\s+/,Yr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Yr}]},Qe={begin:/\(/,end:/\)/,keywords:d,contains:[Ie,...r,...f,..._,L,z,...A,R,ae],endsParent:!0,illegal:/["']/},Me={match:[/func/,/\s+/,xn(re.match,Yr,ym)],className:{1:"keyword",3:"title.function"},contains:[be,Qe,e],illegal:[/\[/,/%/]},Be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[be,Qe,e],illegal:/\[|%/},wt={match:[/operator/,/\s+/,ym],className:{1:"keyword",3:"title"}},Nt={begin:[/precedencegroup/,/\s+/,Em],className:{1:"keyword",3:"title"},contains:[R],keywords:[...PF,...x_],end:/}/};for(let ke of z.variants){let xt=ke.contains.find(pt=>pt.label==="interpol");xt.keywords=d;let Jt=[...f,...y,..._,L,z,...me];xt.contains=[...Jt,{begin:/\(/,end:/\)/,contains:["self",...Jt]}]}return{name:"Swift",keywords:d,contains:[...r,Me,Be,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:d,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...f]},wt,Nt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...f,...y,..._,L,z,...me,...A,R,ae]}}var _u="[A-Za-z$_][0-9A-Za-z$_]*",N_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],k_=["true","false","null","undefined","NaN","Infinity"],O_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],R_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],I_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],L_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],D_=[].concat(I_,O_,R_);function $F(t){let e=t.regex,n=(R,{after:K})=>{let J="</"+R[0].slice(1);return R.input.indexOf(J,K)!==-1},r=_u,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,K)=>{let J=R[0].length+R.index,ae=R.input[J];if(ae==="<"||ae===","){K.ignoreMatch();return}ae===">"&&(n(R,{after:J})||K.ignoreMatch());let be,Ie=R.input.substring(J);if(be=Ie.match(/^\s*=/)){K.ignoreMatch();return}if((be=Ie.match(/^\s+extends\s+/))&&be.index===0){K.ignoreMatch();return}}},l={$pattern:_u,keyword:N_,literal:k_,built_in:D_,"variable.language":L_},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},y={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},w={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},D={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},L=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,y,b,w,_,{match:/\$\d+/},h];m.contains=L.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(L)});let T=[].concat(D,m.contains),$=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),O={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:$},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...O_,...R_]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},re={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},he={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Se(R){return e.concat("(?!",R.join("|"),")")}let me={match:e.concat(/\b/,Se([...I_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},_e="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(_e)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,y,b,w,_,D,{match:/\$\d+/},h,ee,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,t.REGEXP_MODE,{className:"function",begin:_e,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},re,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},me,he,Y,ge,{match:/\$[(.]/}]}}function P_(t){let e=$F(t),n=_u,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],u={$pattern:_u,keyword:N_.concat(l),literal:k_,built_in:D_.concat(r),"variable.language":L_},d={className:"meta",begin:"@"+n},f=(m,y,b)=>{let w=m.contains.findIndex(_=>_.label===y);if(w===-1)throw new Error("can not find mode to replace");m.contains.splice(w,1,b)};Object.assign(e.keywords,u),e.exports.PARAMS_CONTAINS.push(d),e.contains=e.contains.concat([d,i,o]),f(e,"shebang",t.SHEBANG()),f(e,"use_strict",s);let h=e.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function B_(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},h=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,d,f,h,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function F_(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,u,d,l]}}function H_(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,u,l]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function $_(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},y={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},h,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},y,b,o],_=[...w];return _.pop(),_.push(s),m.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}var aS=Xd(sS(),1);var Jn=aS.default;var cS=Xd(lS(),1),xa=Object.assign(Eo(Error),{eval:Eo(EvalError),range:Eo(RangeError),reference:Eo(ReferenceError),syntax:Eo(SyntaxError),type:Eo(TypeError),uri:Eo(URIError)});function Eo(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){let i=n&&(0,cS.default)(n,...r);return new t(i)}}var kH={}.hasOwnProperty,uS="hljs-";function dS(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw xa("Expected `string` for name, got `%s`",t);if(!Jn.getLanguage(t))throw xa("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw xa("Expected `string` for value, got `%s`",e);r==null&&(r=uS),Jn.configure({__emitter:km,classPrefix:r});let i=Jn.highlight(e,{language:t,ignoreIllegals:!0});if(Jn.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function OH(t,e={}){let n=e.subset||Jn.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=uS),typeof t!="string")throw xa("Expected `string` for value, got `%s`",t);for(;++i<n.length;){let s=n[i];if(!Jn.getLanguage(s))continue;let l=dS(s,t,e);l.data.relevance>o.data.relevance&&(o=l)}return o}function RH(t,e){Jn.registerLanguage(t,e)}var IH=function(t,e){if(typeof t=="string")Jn.registerAliases(e,{languageName:t});else{let n;for(n in t)kH.call(t,n)&&Jn.registerAliases(t[n],{languageName:n})}};function LH(t){return!!Jn.getLanguage(t)}function DH(){return Jn.listLanguages()}var km=class{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){let n=e.split(".").map((o,s)=>s?o+"_".repeat(s):this.options.classPrefix+o),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}},Re={highlight:dS,highlightAuto:OH,registerLanguage:RH,registered:LH,listLanguages:DH,registerAlias:IH};Re.registerLanguage("arduino",Px);Re.registerLanguage("bash",Bx);Re.registerLanguage("c",Fx);Re.registerLanguage("cpp",Hx);Re.registerLanguage("csharp",$x);Re.registerLanguage("css",zx);Re.registerLanguage("diff",Ux);Re.registerLanguage("go",Wx);Re.registerLanguage("graphql",Kx);Re.registerLanguage("ini",Vx);Re.registerLanguage("java",Yx);Re.registerLanguage("javascript",Qx);Re.registerLanguage("json",e_);Re.registerLanguage("kotlin",t_);Re.registerLanguage("less",i_);Re.registerLanguage("lua",o_);Re.registerLanguage("makefile",s_);Re.registerLanguage("markdown",a_);Re.registerLanguage("objectivec",l_);Re.registerLanguage("perl",c_);Re.registerLanguage("php",u_);Re.registerLanguage("php-template",d_);Re.registerLanguage("plaintext",f_);Re.registerLanguage("python",p_);Re.registerLanguage("python-repl",h_);Re.registerLanguage("r",m_);Re.registerLanguage("ruby",g_);Re.registerLanguage("rust",b_);Re.registerLanguage("scss",y_);Re.registerLanguage("shell",E_);Re.registerLanguage("sql",v_);Re.registerLanguage("swift",M_);Re.registerLanguage("typescript",P_);Re.registerLanguage("vbnet",B_);Re.registerLanguage("wasm",F_);Re.registerLanguage("xml",H_);Re.registerLanguage("yaml",$_);var Ai=(t,e=0,n=1)=>t>n?n:t<e?e:t,Mt=(t,e=0,n=Math.pow(10,e))=>Math.round(n*t)/n;var Zq={grad:360/400,turn:360,rad:360/(Math.PI*2)},fS=t=>HH(Nu(t)),Nu=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Mt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Mt(parseInt(t.substring(6,8),16)/255,2):1});var pS=t=>FH(BH(t)),PH=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:Mt(t),s:Mt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Mt(i/2),a:Mt(r,2)}};var _a=t=>{let{h:e,s:n,l:r}=PH(t);return`hsl(${e}, ${n}%, ${r}%)`};var BH=({h:t,s:e,v:n,a:r})=>{t=t/360*6,e=e/100,n=n/100;let i=Math.floor(t),o=n*(1-e),s=n*(1-(t-i)*e),l=n*(1-(1-t+i)*e),u=i%6;return{r:Mt([n,s,o,o,l,n][u]*255),g:Mt([l,n,n,s,o,o][u]*255),b:Mt([o,o,l,n,n,s][u]*255),a:Mt(r,2)}};var Mu=t=>{let e=t.toString(16);return e.length<2?"0"+e:e},FH=({r:t,g:e,b:n,a:r})=>{let i=r<1?Mu(Mt(r*255)):"";return"#"+Mu(t)+Mu(e)+Mu(n)+i},HH=({r:t,g:e,b:n,a:r})=>{let i=Math.max(t,e,n),o=i-Math.min(t,e,n),s=o?i===t?(e-n)/o:i===e?2+(n-t)/o:4+(t-e)/o:0;return{h:Mt(60*(s<0?s+6:s)),s:Mt(i?o/i*100:0),v:Mt(i/255*100),a:r}};var Om=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var hS=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:Om(Nu(t),Nu(e));var mS={},ku=t=>{let e=mS[t];return e||(e=document.createElement("template"),e.innerHTML=t,mS[t]=e),e},Sa=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var ps=!1,Rm=t=>"touches"in t,$H=t=>ps&&!Rm(t)?!1:(ps||(ps=Rm(t)),!0),gS=(t,e)=>{let n=Rm(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();Sa(t.el,"move",t.getMove({x:Ai((n.pageX-(r.left+window.pageXOffset))/r.width),y:Ai((n.pageY-(r.top+window.pageYOffset))/r.height)}))},zH=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),Sa(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},hs=class{constructor(e,n,r,i){let o=ku(`<div role="slider" tabindex="0" part="${n}" ${r}><div part="${n}-pointer"></div></div>`);e.appendChild(o.content.cloneNode(!0));let s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){let n=e?document.addEventListener:document.removeEventListener;n(ps?"touchmove":"mousemove",this),n(ps?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!$H(e)||!ps&&e.button!=0)return;this.el.focus(),gS(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),gS(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":zH(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Ou=class extends hs{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:_a({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Mt(e)}`)}getMove(e,n){return{h:n?Ai(this.h+e.x*360,0,360):360*e.x}}};var Ru=class extends hs{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:_a(e)},{"background-color":_a({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Mt(e.s)}%, Brightness ${Mt(e.v)}%`)}getMove(e,n){return{s:n?Ai(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Ai(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var bS=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var yS="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var ES="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var Iu=Symbol("same"),Im=Symbol("color"),vS=Symbol("hsva"),Lm=Symbol("update"),wS=Symbol("parts"),xS=Symbol("css"),_S=Symbol("sliders"),Lu=class extends HTMLElement{static get observedAttributes(){return["color"]}get[xS](){return[bS,yS,ES]}get[_S](){return[Ru,Ou]}get color(){return this[Im]}set color(e){if(!this[Iu](e)){let n=this.colorModel.toHsva(e);this[Lm](n),this[Im]=e}}constructor(){super();let e=ku(`<style>${this[xS].join("")}</style>`),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[wS]=this[_S].map(r=>new r(n))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,r){let i=this.colorModel.fromAttr(r);this[Iu](i)||(this.color=i)}handleEvent(e){let n=this[vS],r={...n,...e.detail};this[Lm](r);let i;!Om(r,n)&&!this[Iu](i=this.colorModel.fromHsva(r))&&(this[Im]=i,Sa(this,"color-changed",{value:i}))}[Iu](e){return this.color&&this.colorModel.equal(e,this.color)}[Lm](e){this[vS]=e,this[wS].forEach(n=>n.update(e))}};var UH={defaultColor:"#000",toHsva:fS,fromHsva:({h:t,s:e,v:n})=>pS({h:t,s:e,v:n,a:1}),equal:hS,fromAttr:t=>t},Du=class extends Lu{get colorModel(){return UH}};var CS=Xd(SS(),1);customElements.define("tiptap-hex-color-picker",Du);var WH={blockquote:[VE],bold:[GE],"bullet-list":[JE],"checked-list":[mh],code:[XE],"code-block":[om.configure({lowlight:Re,HTMLAttributes:{class:"hljs"}})],color:[jE],details:[Yh,Jh,Xh],grid:[zh,Uh],"grid-builder":[lm,cm],heading:[ov.configure({levels:[1,2,3,4,5,6]})],highlight:[tw],hr:[dv],hurdle:[sm],italic:[fv],lead:[gh],link:[Fh.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[Hh.configure({inline:!0})],oembed:[Kh,Gh,qh],"ordered-list":[mv],small:[$h],strike:[bv],subscript:[yv],superscript:[Ev],table:[Jv.configure({resizable:!0}),Zv,Xv,jv],underline:[ew]},KH=window.TiptapEditorExtensions||{},TS={...WH,...KH},Pu=document.getElementById("activeLocale");Pu&&Pu.addEventListener("change",()=>{let t=new CustomEvent("locale-change",{bubbles:!0,detail:{locale:Pu.value}});Pu.dispatchEvent(t)});document.addEventListener("livewire:navigating",()=>{window.filamentTiptapEditors={}});document.addEventListener("dblclick",function(t){(t.target&&(t.target.hasAttribute("data-youtube-video")||t.target.hasAttribute("data-vimeo-video"))||t.target.hasAttribute("data-native-video"))&&(t.target.firstChild.style.pointerEvents="all")});Livewire.on("insertFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-content",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("insertBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("updateBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("update-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});function VH({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",floatingMenuTools:o=[],placeholder:s=null,mergeTags:l=[]}){let u=null;return{id:null,modalId:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),disabled:r,locale:i,floatingMenuTools:o,getExtensions(){let d=this.tools.map(h=>typeof h=="string"?h:h.id),f=[QE,Qv,pc,tv,rv,iv,uv,ZE,um,pm,hm,mm,gm.configure({statePath:e}),dm];if(s&&!r&&f.push(gv.configure({placeholder:s})),d.length){let h=Object.keys(TS),m=[],y=["paragraph"];f.push(Hw.configure({element:this.$refs.bubbleMenu,tippyOptions:{duration:[500,0],maxWidth:"none",placement:"top",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10},shouldShow:({state:b,from:w,to:_})=>{if(Ur(b,"link")||Ur(b,"table")||w!==_)return!0;if(Ur(b,"oembed")||Ur(b,"vimeo")||Ur(b,"youtube")||Ur(b,"video")||Ur(b,"tiptapBlock"))return!1}})),this.floatingMenuTools.length&&(f.push($w.configure({element:this.$refs.floatingMenu,tippyOptions:{duration:[500,0],maxWidth:"none",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10}})),this.floatingMenuTools.forEach(b=>{d.includes(b)||d.push(b)})),d.forEach(b=>{h.includes(b)?TS[b].forEach(w=>{["ordered-list","bullet-list","checked-list"].includes(b)?(f.push(w),f.includes(Ip)||f.push(Ip)):f.push(w)}):["align-left","align-right","align-center","align-justify"].includes(b)&&(b==="align-left"&&m.push("start"),b==="align-center"&&m.push("center"),b==="align-right"&&m.push("end"),b==="align-justify"&&m.push("justify"),d.includes("heading")&&y.push("heading"),typeof f.find(_=>_.name==="textAlign")>"u"&&f.push(am.configure({types:y,alignments:m})))})}return l?.length&&f.push(fm.configure({mergeTags:l})),f},init:function(){this.modalId=this.$el.closest('[x-ref="modalContainer"]')?.getAttribute("wire:key");let d=this.$refs.element.querySelector(".tiptap");d&&(d.remove(),u=null),this.initEditor(this.state);let f=this.$el.parentElement.closest("[x-sortable]");f&&(window.Sortable.utils.on(f,"start",()=>{f.classList.add("sorting")}),window.Sortable.utils.on(f,"end",()=>{f.classList.remove("sorting")})),this.$watch("state",(h,m)=>{typeof h<"u"&&((0,CS.isEqual)(m,Alpine.raw(h))||this.updateEditorContent(h))})},initEditor(d){if(!this.$el.querySelector(".tiptap")){let f=this;u=new jl({element:f.$refs.element,extensions:f.getExtensions(),editable:!f.disabled,content:d,editorProps:{handlePaste(h,m,y){y.content.descendants(b=>{b.type.name==="tiptapBlock"&&(b.attrs.statePath=f.statePath,b.attrs.data=JSON.parse(b.attrs.data))})}},onCreate({editor:h}){f.$store.previous&&h.commands.getStatePath()===f.$store.previous.statePath&&(h.chain().focus().setContent(f.$store.previous.editor.getJSON()).setTextSelection(f.$store.previous.editor.state.selection).run(),f.updatedAt=Date.now())},onUpdate({editor:h}){f.updatedAt=Date.now(),f.state=h.isEmpty?null:h.getJSON()},onSelectionUpdate(){f.updatedAt=Date.now()},onBlur(){f.updatedAt=Date.now()},onFocus(){f.updatedAt=Date.now()}})}},handleOpenModal(){this.modalId&&this.$nextTick(()=>{this.$store.previous={statePath:this.statePath,editor:u}})},isActive(d,f={}){return u.isActive(d,f)},editor(){return u},blur(){let d=this.$el.querySelectorAll("[data-tippy-content]");d&&d.forEach(f=>f.destroy()),this.updatedAt=Date.now()},updateEditorContent(d){if(u.isEditable){let{from:f,to:h}=u.state.selection;u.commands.setContent(d,!0),u.chain().focus().setTextSelection({from:f,to:h}).run()}},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},updateLocale(d){this.locale=d.detail.locale},insertContent(d){if(d.detail.statePath===this.statePath)switch(d.detail.type){case"media":this.insertMedia(d);return;case"video":this.insertVideo(d);return;case"link":this.insertLink(d);return;case"source":this.insertSource(d);return;case"grid":this.insertGridBuilder(d);return;default:return}},insertMedia(d){Array.isArray(d.detail.media)?d.detail.media.forEach(f=>{this.executeMediaInsert(f)}):this.executeMediaInsert(d.detail.media)},executeMediaInsert(d=null){if(!(!d||d?.url===null)&&d){let f=d?.url||d?.src,h=["jpg","jpeg","svg","png","webp","gif","avif","jxl","heic"],y=/.*\.([a-zA-Z]*)\??/.exec(f.toLowerCase());y!==null&&h.includes(y[1])?u.chain().focus().setImage({src:f,alt:d?.alt,title:d?.title,width:d?.width,height:d?.height,lazy:d?.lazy}).run():u.chain().focus().extendMarkRange("link").setLink({href:f}).insertContent(d?.link_text).run()}},insertVideo(d){let f=d.detail.video;if(!f||f.url===null)return;let h={src:f.url,width:f.responsive?f.width*100:f.width,height:f.responsive?f.height*100:f.height,responsive:f.responsive??!0,"data-aspect-width":f.width,"data-aspect-height":f.height};f.url.includes("youtube")||f.url.includes("youtu.be")?u.chain().focus().setYoutubeVideo({...h,controls:f.youtube_options.includes("controls"),nocookie:f.youtube_options.includes("nocookie"),start:f.start_at??0}).run():f.url.includes("vimeo")?u.chain().focus().setVimeoVideo({...h,autoplay:f.vimeo_options.includes("autoplay"),loop:f.vimeo_options.includes("loop"),title:f.vimeo_options.includes("show_title"),byline:f.vimeo_options.includes("byline"),portrait:f.vimeo_options.includes("portrait")}).run():u.chain().focus().setVideo({...h,autoplay:f.native_options.includes("autoplay"),loop:f.native_options.includes("loop"),controls:f.native_options.includes("controls")}).run()},insertLink(d){let f=d.detail;if(!(f.href===null&&f.id===null)){if(f.href===""&&f.id===null){this.unsetLink();return}u.chain().focus().extendMarkRange("link").setLink({href:f.href,id:f.id??null,target:f.target??null,hreflang:f.hreflang??null,rel:f.rel??null,referrerpolicy:f.referrerpolicy??null,as_button:f.as_button??null,button_theme:f.button_theme??null}).selectTextblockEnd().run()}},unsetLink(){u.chain().focus().extendMarkRange("link").unsetLink().selectTextblockEnd().run()},insertSource(d){this.updateEditorContent(d.detail.source)},insertGridBuilder(d){let f=d.detail.data,h="responsive",m=parseInt(f.asymmetric_left)??null,y=parseInt(f.asymmetric_right)??null;f.fixed&&(h="fixed"),f.asymmetric&&(h="asymmetric"),u.chain().focus().insertGridBuilder({cols:f.columns,type:h,stackAt:f.stack_at,asymmetricLeft:m,asymmetricRight:y}).run()},insertBlock(d){d.detail.statePath===this.statePath&&(u.commands.insertBlock({type:d.detail.type,statePath:d.detail.statePath,data:d.detail.data,preview:d.detail.preview,label:d.detail.label,coordinates:d.detail.coordinates}),u.isFocused||u.commands.focus())},insertMergeTag(d){u.commands.insertMergeTag({tag:d.detail.tag,coordinates:d.detail.coordinates}),u.isFocused||u.commands.focus()},openBlockSettings(d){d.detail.statePath===this.statePath&&this.$wire.dispatchFormEvent("tiptap::updateBlock",this.statePath,d.detail)},updateBlock(d){d.detail.statePath===this.statePath&&(u.commands.updateBlock({type:d.detail.type,statePath:d.detail.statePath,data:d.detail.data,preview:d.detail.preview,label:d.detail.label,coordinates:d.detail.coordinates}),u.isFocused||u.commands.focus())},deleteBlock(){u.commands.removeBlock()}}}export{VH as default};
|
|
/*! Bundled license information:
|
|
|
|
lodash/lodash.js:
|
|
(**
|
|
* @license
|
|
* Lodash <https://lodash.com/>
|
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
* Released under MIT license <https://lodash.com/license>
|
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
*)
|
|
*/
|