From 20940d1eaaa78fff06f7103dd2443f2f283f1ef8 Mon Sep 17 00:00:00 2001 From: Adam Weston Date: Sat, 23 Dec 2023 10:28:38 -0500 Subject: [PATCH] Fix: lazy load --- resources/dist/filament-tiptap-editor.js | 44 ++++++++++++------------ resources/js/extensions/Image.js | 6 ++-- src/Extensions/Nodes/Image.php | 2 +- src/TiptapConverter.php | 4 +-- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/resources/dist/filament-tiptap-editor.js b/resources/dist/filament-tiptap-editor.js index aeda2ce4..ba1103d4 100644 --- a/resources/dist/filament-tiptap-editor.js +++ b/resources/dist/filament-tiptap-editor.js @@ -1,7 +1,7 @@ -var IN=Object.create;var Wd=Object.defineProperty;var DN=Object.getOwnPropertyDescriptor;var LN=Object.getOwnPropertyNames;var PN=Object.getPrototypeOf,BN=Object.prototype.hasOwnProperty;var FN=(t,e,n)=>e in t?Wd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Kd=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var HN=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of LN(e))!BN.call(t,i)&&i!==n&&Wd(t,i,{get:()=>e[i],enumerable:!(r=DN(e,i))||r.enumerable});return t};var Vd=(t,e,n)=>(n=t!=null?IN(PN(t)):{},HN(e||!t||!t.__esModule?Wd(n,"default",{value:t,enumerable:!0}):n,t));var un=(t,e,n)=>(FN(t,typeof e!="symbol"?e+"":e,n),n);var W_=Kd((R4,$_)=>{function N_(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)&&N_(n)}),t}var Eu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function O_(t){return t.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 mF="",S_=t=>!!t.scope,gF=(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}`},hm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=O_(e)}openNode(e){if(!S_(e))return;let n=gF(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){S_(e)&&(this.buffer+=mF)}value(){return this.buffer}span(e){this.buffer+=``}},T_=(t={})=>{let e={children:[]};return Object.assign(e,t),e},mm=class t{constructor(){this.rootNode=T_(),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=T_({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)}))}},gm=class extends mm{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 hm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function ba(t){return t?typeof t=="string"?t:t.source:null}function R_(t){return yo("(?=",t,")")}function bF(t){return yo("(?:",t,")*")}function yF(t){return yo("(?:",t,")?")}function yo(...t){return t.map(n=>ba(n)).join("")}function EF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function ym(...t){return"("+(EF(t).capture?"":"?:")+t.map(r=>ba(r)).join("|")+")"}function I_(t){return new RegExp(t.toString()+"|").exec("").length-1}function vF(t,e){let n=t&&t.exec(e);return n&&n.index===0}var wF=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Em(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=ba(r),s="";for(;o.length>0;){let l=wF.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 xF=/\b\B/,D_="[a-zA-Z]\\w*",vm="[a-zA-Z_]\\w*",L_="\\b\\d+(\\.\\d+)?",P_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",B_="\\b(0b[01]+)",_F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SF=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=yo(e,/.*\b/,t.binary,/\b.*/)),Ti({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},ya={begin:"\\\\[\\s\\S]",relevance:0},TF={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ya]},MF={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ya]},CF={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/},wu=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=ym("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},AF=wu("//","$"),kF=wu("/\\*","\\*/"),NF=wu("#","$"),OF={scope:"number",begin:L_,relevance:0},RF={scope:"number",begin:P_,relevance:0},IF={scope:"number",begin:B_,relevance:0},DF={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[ya,{begin:/\[/,end:/\]/,relevance:0,contains:[ya]}]}]},LF={scope:"title",begin:D_,relevance:0},PF={scope:"title",begin:vm,relevance:0},BF={begin:"\\.\\s*"+vm,relevance:0},FF=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()}})},yu=Object.freeze({__proto__:null,MATCH_NOTHING_RE:xF,IDENT_RE:D_,UNDERSCORE_IDENT_RE:vm,NUMBER_RE:L_,C_NUMBER_RE:P_,BINARY_NUMBER_RE:B_,RE_STARTERS_RE:_F,SHEBANG:SF,BACKSLASH_ESCAPE:ya,APOS_STRING_MODE:TF,QUOTE_STRING_MODE:MF,PHRASAL_WORDS_MODE:CF,COMMENT:wu,C_LINE_COMMENT_MODE:AF,C_BLOCK_COMMENT_MODE:kF,HASH_COMMENT_MODE:NF,NUMBER_MODE:OF,C_NUMBER_MODE:RF,BINARY_NUMBER_MODE:IF,REGEXP_MODE:DF,TITLE_MODE:LF,UNDERSCORE_TITLE_MODE:PF,METHOD_GUARD:BF,END_SAME_AS_BEGIN:FF});function HF(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function zF(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function UF(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=HF,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function $F(t,e){Array.isArray(t.illegal)&&(t.illegal=ym(...t.illegal))}function WF(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 KF(t,e){t.relevance===void 0&&(t.relevance=1)}var VF=(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,R_(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},GF=["of","and","for","in","not","or","if","then","parent","list","value"],qF="keyword";function F_(t,e,n=qF){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,F_(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,YF(u[0],u[1])]})}}function YF(t,e){return e?Number(e):JF(t)?0:1}function JF(t){return GF.includes(t.toLowerCase())}var M_={},bo=t=>{console.error(t)},C_=(t,...e)=>{console.log(`WARN: ${t}`,...e)},cs=(t,e)=>{M_[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),M_[`${t}/${e}`]=!0)},vu=new Error;function H_(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+=I_(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function XF(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw bo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),vu;if(typeof t.beginScope!="object"||t.beginScope===null)throw bo("beginScope must be object"),vu;H_(t,t.begin,{key:"beginScope"}),t.begin=Em(t.begin,{joinWith:""})}}function ZF(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw bo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),vu;if(typeof t.endScope!="object"||t.endScope===null)throw bo("endScope must be object"),vu;H_(t,t.end,{key:"endScope"}),t.end=Em(t.end,{joinWith:""})}}function jF(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function QF(t){jF(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),XF(t),ZF(t)}function eH(t){function e(s,l){return new RegExp(ba(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+=I_(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(Em(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;[zF,WF,QF,VF].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[UF,$F,KF].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=F_(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=ba(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 tH(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 z_(t){return t?t.endsWithParent||z_(t.starts):!1}function tH(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ti(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:z_(t)?Ti(t,{starts:t.starts?Ti(t.starts):null}):Object.isFrozen(t)?Ti(t):t}var nH="11.8.0",bm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},pm=O_,A_=Ti,k_=Symbol("nomatch"),rH=7,U_=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:gm};function u(N){return l.noHighlightRe.test(N)}function d(N){let R=N.className+" ";R+=N.parentNode?N.parentNode.className:"";let K=l.languageDetectRe.exec(R);if(K){let te=W(K[1]);return te||(C_(o.replace("{}",K[1])),C_("Falling back to no-highlight mode for this block.",N)),te?K[1]:"no-highlight"}return R.split(/\s+/).find(te=>u(te)||W(te))}function f(N,R,K){let te="",pe="";typeof R=="object"?(te=N,K=R.ignoreIllegals,pe=R.language):(cs("10.7.0","highlight(lang, code, ...args) has been deprecated."),cs("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),pe=N,te=R),K===void 0&&(K=!0);let Ce={code:te,language:pe};xe("before:highlight",Ce);let Ue=Ce.result?Ce.result:h(Ce.language,Ce.code,K);return Ue.code=Ce.code,xe("after:highlight",Ue),Ue}function h(N,R,K,te){let pe=Object.create(null);function Ce(H,Y){return H.keywords[Y]}function Ue(){if(!ee.keywords){We.addText(Oe);return}let H=0;ee.keywordPatternRe.lastIndex=0;let Y=ee.keywordPatternRe.exec(Oe),le="";for(;Y;){le+=Oe.substring(H,Y.index);let Me=ft.case_insensitive?Y[0].toLowerCase():Y[0],ct=Ce(ee,Me);if(ct){let[Vt,Ci]=ct;if(We.addText(le),le="",pe[Me]=(pe[Me]||0)+1,pe[Me]<=rH&&(mt+=Ci),Vt.startsWith("_"))le+=Y[0];else{let B=ft.classNameAliases[Vt]||Vt;Je(Y[0],B)}}else le+=Y[0];H=ee.keywordPatternRe.lastIndex,Y=ee.keywordPatternRe.exec(Oe)}le+=Oe.substring(H),We.addText(le)}function $e(){if(Oe==="")return;let H=null;if(typeof ee.subLanguage=="string"){if(!e[ee.subLanguage]){We.addText(Oe);return}H=h(ee.subLanguage,Oe,!0,Ae[ee.subLanguage]),Ae[ee.subLanguage]=H._top}else H=b(Oe,ee.subLanguage.length?ee.subLanguage:null);ee.relevance>0&&(mt+=H.relevance),We.__addSublanguage(H._emitter,H.language)}function He(){ee.subLanguage!=null?$e():Ue(),Oe=""}function Je(H,Y){H!==""&&(We.startScope(Y),We.addText(H),We.endScope())}function xt(H,Y){let le=1,Me=Y.length-1;for(;le<=Me;){if(!H._emit[le]){le++;continue}let ct=ft.classNameAliases[H[le]]||H[le],Vt=Y[le];ct?Je(Vt,ct):(Oe=Vt,Ue(),Oe=""),le++}}function Pt(H,Y){return H.scope&&typeof H.scope=="string"&&We.openNode(ft.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(Je(Oe,ft.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),Oe=""):H.beginScope._multi&&(xt(H.beginScope,Y),Oe="")),ee=Object.create(H,{parent:{value:ee}}),ee}function De(H,Y,le){let Me=vF(H.endRe,le);if(Me){if(H["on:end"]){let ct=new Eu(H);H["on:end"](Y,ct),ct.isMatchIgnored&&(Me=!1)}if(Me){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return De(H.parent,Y,le)}function _t(H){return ee.matcher.regexIndex===0?(Oe+=H[0],1):(re=!0,0)}function Xt(H){let Y=H[0],le=H.rule,Me=new Eu(le),ct=[le.__beforeBegin,le["on:begin"]];for(let Vt of ct)if(Vt&&(Vt(H,Me),Me.isMatchIgnored))return _t(Y);return le.skip?Oe+=Y:(le.excludeBegin&&(Oe+=Y),He(),!le.returnBegin&&!le.excludeBegin&&(Oe=Y)),Pt(le,H),le.returnBegin?0:Y.length}function st(H){let Y=H[0],le=R.substring(H.index),Me=De(ee,H,le);if(!Me)return k_;let ct=ee;ee.endScope&&ee.endScope._wrap?(He(),Je(Y,ee.endScope._wrap)):ee.endScope&&ee.endScope._multi?(He(),xt(ee.endScope,H)):ct.skip?Oe+=Y:(ct.returnEnd||ct.excludeEnd||(Oe+=Y),He(),ct.excludeEnd&&(Oe=Y));do ee.scope&&We.closeNode(),!ee.skip&&!ee.subLanguage&&(mt+=ee.relevance),ee=ee.parent;while(ee!==Me.parent);return Me.starts&&Pt(Me.starts,H),ct.returnEnd?0:Y.length}function Zt(){let H=[];for(let Y=ee;Y!==ft;Y=Y.parent)Y.scope&&H.unshift(Y.scope);H.forEach(Y=>We.openNode(Y))}let St={};function Nt(H,Y){let le=Y&&Y[0];if(Oe+=H,le==null)return He(),0;if(St.type==="begin"&&Y.type==="end"&&St.index===Y.index&&le===""){if(Oe+=R.slice(Y.index,Y.index+1),!i){let Me=new Error(`0 width match regex (${N})`);throw Me.languageName=N,Me.badRule=St.rule,Me}return 1}if(St=Y,Y.type==="begin")return Xt(Y);if(Y.type==="illegal"&&!K){let Me=new Error('Illegal lexeme "'+le+'" for mode "'+(ee.scope||"")+'"');throw Me.mode=ee,Me}else if(Y.type==="end"){let Me=st(Y);if(Me!==k_)return Me}if(Y.type==="illegal"&&le==="")return 1;if(X>1e5&&X>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Oe+=le,le.length}let ft=W(N);if(!ft)throw bo(o.replace("{}",N)),new Error('Unknown language: "'+N+'"');let me=eH(ft),Kt="",ee=te||me,Ae={},We=new l.__emitter(l);Zt();let Oe="",mt=0,Ot=0,X=0,re=!1;try{if(ft.__emitTokens)ft.__emitTokens(R,We);else{for(ee.matcher.considerAll();;){X++,re?re=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=Ot;let H=ee.matcher.exec(R);if(!H)break;let Y=R.substring(Ot,H.index),le=Nt(Y,H);Ot=H.index+le}Nt(R.substring(Ot))}return We.finalize(),Kt=We.toHTML(),{language:N,value:Kt,relevance:mt,illegal:!1,_emitter:We,_top:ee}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:N,value:pm(R),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:Ot,context:R.slice(Ot-100,Ot+100),mode:H.mode,resultSoFar:Kt},_emitter:We};if(i)return{language:N,value:pm(R),illegal:!1,relevance:0,errorRaised:H,_emitter:We,_top:ee};throw H}}function m(N){let R={value:pm(N),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return R._emitter.addText(N),R}function b(N,R){R=R||l.languages||Object.keys(e);let K=m(N),te=R.filter(W).filter(ye).map(He=>h(He,N,!1));te.unshift(K);let pe=te.sort((He,Je)=>{if(He.relevance!==Je.relevance)return Je.relevance-He.relevance;if(He.language&&Je.language){if(W(He.language).supersetOf===Je.language)return 1;if(W(Je.language).supersetOf===He.language)return-1}return 0}),[Ce,Ue]=pe,$e=Ce;return $e.secondBest=Ue,$e}function y(N,R,K){let te=R&&n[R]||K;N.classList.add("hljs"),N.classList.add(`language-${te}`)}function w(N){let R=null,K=d(N);if(u(K))return;if(xe("before:highlightElement",{el:N,language:K}),N.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(N)),l.throwUnescapedHTML))throw new bm("One of your code blocks includes unescaped HTML.",N.innerHTML);R=N;let te=R.textContent,pe=K?f(te,{language:K,ignoreIllegals:!0}):b(te);N.innerHTML=pe.value,y(N,K,pe.language),N.result={language:pe.language,re:pe.relevance,relevance:pe.relevance},pe.secondBest&&(N.secondBest={language:pe.secondBest.language,relevance:pe.secondBest.relevance}),xe("after:highlightElement",{el:N,result:pe,text:te})}function x(N){l=A_(l,N)}let M=()=>{S(),cs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function L(){S(),cs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function S(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function z(){D&&S()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",z,!1);function O(N,R){let K=null;try{K=R(t)}catch(te){if(bo("Language definition for '{}' could not be registered.".replace("{}",N)),i)bo(te);else throw te;K=s}K.name||(K.name=N),e[N]=K,K.rawDefinition=R.bind(null,t),K.aliases&&ue(K.aliases,{languageName:N})}function q(N){delete e[N];for(let R of Object.keys(n))n[R]===N&&delete n[R]}function J(){return Object.keys(e)}function W(N){return N=(N||"").toLowerCase(),e[N]||e[n[N]]}function ue(N,{languageName:R}){typeof N=="string"&&(N=[N]),N.forEach(K=>{n[K.toLowerCase()]=R})}function ye(N){let R=W(N);return R&&!R.disableAutodetect}function Te(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=R=>{N["before:highlightBlock"](Object.assign({block:R.el},R))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=R=>{N["after:highlightBlock"](Object.assign({block:R.el},R))})}function ge(N){Te(N),r.push(N)}function we(N){let R=r.indexOf(N);R!==-1&&r.splice(R,1)}function xe(N,R){let K=N;r.forEach(function(te){te[K]&&te[K](R)})}function P(N){return cs("10.7.0","highlightBlock will be removed entirely in v12.0"),cs("10.7.0","Please use highlightElement now."),w(N)}Object.assign(t,{highlight:f,highlightAuto:b,highlightAll:S,highlightElement:w,highlightBlock:P,configure:x,initHighlighting:M,initHighlightingOnLoad:L,registerLanguage:O,unregisterLanguage:q,listLanguages:J,getLanguage:W,registerAliases:ue,autoDetection:ye,inherit:A_,addPlugin:ge,removePlugin:we}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=nH,t.regex={concat:yo,lookahead:R_,either:ym,optional:yF,anyNumberOfTimes:bF};for(let N in yu)typeof yu[N]=="object"&&N_(yu[N]);return Object.assign(t,yu),t},us=U_({});us.newInstance=()=>U_({});$_.exports=us;us.HighlightJS=us;us.default=us});var V_=Kd((D4,wm)=>{(function(){var t;typeof wm<"u"?t=wm.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,b,y=!1,w,x=function(){return s[o++]},M=function(){for(var L="";/\d/.test(i[l]);)L+=i[l++],f=i[l];return L.length>0?parseInt(L):null};l{(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,b=2,y=1,w=2,x=4,M=8,L=16,D=32,S=64,z=128,O=256,q=512,J=30,W="...",ue=800,ye=16,Te=1,ge=2,we=3,xe=1/0,P=9007199254740991,N=17976931348623157e292,R=NaN,K=4294967295,te=K-1,pe=K>>>1,Ce=[["ary",z],["bind",y],["bindKey",w],["curry",M],["curryRight",L],["flip",q],["partial",D],["partialRight",S],["rearg",O]],Ue="[object Arguments]",$e="[object Array]",He="[object AsyncFunction]",Je="[object Boolean]",xt="[object Date]",Pt="[object DOMException]",De="[object Error]",_t="[object Function]",Xt="[object GeneratorFunction]",st="[object Map]",Zt="[object Number]",St="[object Null]",Nt="[object Object]",ft="[object Promise]",me="[object Proxy]",Kt="[object RegExp]",ee="[object Set]",Ae="[object String]",We="[object Symbol]",Oe="[object Undefined]",mt="[object WeakMap]",Ot="[object WeakSet]",X="[object ArrayBuffer]",re="[object DataView]",H="[object Float32Array]",Y="[object Float64Array]",le="[object Int8Array]",Me="[object Int16Array]",ct="[object Int32Array]",Vt="[object Uint8Array]",Ci="[object Uint8ClampedArray]",B="[object Uint16Array]",ae="[object Uint32Array]",_e=/\b__p \+= '';/g,Xe=/\b(__p \+=) '' \+/g,Ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bt=/&(?:amp|lt|gt|quot|#39);/g,sn=/[&<>"']/g,qr=RegExp(Bt.source),_a=RegExp(sn.source),_r=/<%-([\s\S]+?)%>/g,hs=/<%([\s\S]+?)%>/g,Ai=/<%=([\s\S]+?)%>/g,Yr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ou=/^\w*$/,ms=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jr=/[\\^$.*+?()[\]{}|]/g,uS=RegExp(Jr.source),Ru=/^\s+/,dS=/\s/,fS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pS=/\{\n\/\* \[wrapped with (.+)\] \*/,hS=/,? & /,mS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gS=/[()=,{}\[\]\/\s]/,bS=/\\(\\)?/g,yS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cm=/\w*$/,ES=/^[-+]0x[0-9a-f]+$/i,vS=/^0b[01]+$/i,wS=/^\[object .+?Constructor\]$/,xS=/^0o[0-7]+$/i,_S=/^(?:0|[1-9]\d*)$/,SS=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Sa=/($^)/,TS=/['\n\r\u2028\u2029\\]/g,Ta="\\ud800-\\udfff",MS="\\u0300-\\u036f",CS="\\ufe20-\\ufe2f",AS="\\u20d0-\\u20ff",Am=MS+CS+AS,km="\\u2700-\\u27bf",Nm="a-z\\xdf-\\xf6\\xf8-\\xff",kS="\\xac\\xb1\\xd7\\xf7",NS="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",OS="\\u2000-\\u206f",RS=" \\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",Om="A-Z\\xc0-\\xd6\\xd8-\\xde",Rm="\\ufe0e\\ufe0f",Im=kS+NS+OS+RS,Iu="['\u2019]",IS="["+Ta+"]",Dm="["+Im+"]",Ma="["+Am+"]",Lm="\\d+",DS="["+km+"]",Pm="["+Nm+"]",Bm="[^"+Ta+Im+Lm+km+Nm+Om+"]",Du="\\ud83c[\\udffb-\\udfff]",LS="(?:"+Ma+"|"+Du+")",Fm="[^"+Ta+"]",Lu="(?:\\ud83c[\\udde6-\\uddff]){2}",Pu="[\\ud800-\\udbff][\\udc00-\\udfff]",vo="["+Om+"]",Hm="\\u200d",zm="(?:"+Pm+"|"+Bm+")",PS="(?:"+vo+"|"+Bm+")",Um="(?:"+Iu+"(?:d|ll|m|re|s|t|ve))?",$m="(?:"+Iu+"(?:D|LL|M|RE|S|T|VE))?",Wm=LS+"?",Km="["+Rm+"]?",BS="(?:"+Hm+"(?:"+[Fm,Lu,Pu].join("|")+")"+Km+Wm+")*",FS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",HS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vm=Km+Wm+BS,zS="(?:"+[DS,Lu,Pu].join("|")+")"+Vm,US="(?:"+[Fm+Ma+"?",Ma,Lu,Pu,IS].join("|")+")",$S=RegExp(Iu,"g"),WS=RegExp(Ma,"g"),Bu=RegExp(Du+"(?="+Du+")|"+US+Vm,"g"),KS=RegExp([vo+"?"+Pm+"+"+Um+"(?="+[Dm,vo,"$"].join("|")+")",PS+"+"+$m+"(?="+[Dm,vo+zm,"$"].join("|")+")",vo+"?"+zm+"+"+Um,vo+"+"+$m,HS,FS,Lm,zS].join("|"),"g"),VS=RegExp("["+Hm+Ta+Am+Rm+"]"),GS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qS=["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"],YS=-1,at={};at[H]=at[Y]=at[le]=at[Me]=at[ct]=at[Vt]=at[Ci]=at[B]=at[ae]=!0,at[Ue]=at[$e]=at[X]=at[Je]=at[re]=at[xt]=at[De]=at[_t]=at[st]=at[Zt]=at[Nt]=at[Kt]=at[ee]=at[Ae]=at[mt]=!1;var it={};it[Ue]=it[$e]=it[X]=it[re]=it[Je]=it[xt]=it[H]=it[Y]=it[le]=it[Me]=it[ct]=it[st]=it[Zt]=it[Nt]=it[Kt]=it[ee]=it[Ae]=it[We]=it[Vt]=it[Ci]=it[B]=it[ae]=!0,it[De]=it[_t]=it[mt]=!1;var JS={\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"},XS={"&":"&","<":"<",">":">",'"':""","'":"'"},ZS={"&":"&","<":"<",">":">",""":'"',"'":"'"},jS={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},QS=parseFloat,e1=parseInt,Gm=typeof global=="object"&&global&&global.Object===Object&&global,t1=typeof self=="object"&&self&&self.Object===Object&&self,Ft=Gm||t1||Function("return this")(),Fu=typeof ps=="object"&&ps&&!ps.nodeType&&ps,ki=Fu&&typeof xa=="object"&&xa&&!xa.nodeType&&xa,qm=ki&&ki.exports===Fu,Hu=qm&&Gm.process,Rn=function(){try{var A=ki&&ki.require&&ki.require("util").types;return A||Hu&&Hu.binding&&Hu.binding("util")}catch{}}(),Ym=Rn&&Rn.isArrayBuffer,Jm=Rn&&Rn.isDate,Xm=Rn&&Rn.isMap,Zm=Rn&&Rn.isRegExp,jm=Rn&&Rn.isSet,Qm=Rn&&Rn.isTypedArray;function Tn(A,F,I){switch(I.length){case 0:return A.call(F);case 1:return A.call(F,I[0]);case 2:return A.call(F,I[0],I[1]);case 3:return A.call(F,I[0],I[1],I[2])}return A.apply(F,I)}function n1(A,F,I,oe){for(var ke=-1,Ze=A==null?0:A.length;++ke-1}function zu(A,F,I){for(var oe=-1,ke=A==null?0:A.length;++oe-1;);return I}function ag(A,F){for(var I=A.length;I--&&wo(F,A[I],0)>-1;);return I}function d1(A,F){for(var I=A.length,oe=0;I--;)A[I]===F&&++oe;return oe}var f1=Ku(JS),p1=Ku(XS);function h1(A){return"\\"+jS[A]}function m1(A,F){return A==null?t:A[F]}function xo(A){return VS.test(A)}function g1(A){return GS.test(A)}function b1(A){for(var F,I=[];!(F=A.next()).done;)I.push(F.value);return I}function Yu(A){var F=-1,I=Array(A.size);return A.forEach(function(oe,ke){I[++F]=[ke,oe]}),I}function lg(A,F){return function(I){return A(F(I))}}function jr(A,F){for(var I=-1,oe=A.length,ke=0,Ze=[];++I-1}function iT(a,c){var p=this.__data__,g=Ka(p,a);return g<0?(++this.size,p.push([a,c])):p[g][1]=c,this}Sr.prototype.clear=eT,Sr.prototype.delete=tT,Sr.prototype.get=nT,Sr.prototype.has=rT,Sr.prototype.set=iT;function Tr(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c=c?a:c)),a}function Pn(a,c,p,g,E,_){var T,C=c&d,k=c&f,U=c&h;if(p&&(T=E?p(a,g,E,_):p(a)),T!==t)return T;if(!pt(a))return a;var $=Ne(a);if($){if(T=lM(a),!C)return bn(a,T)}else{var G=Qt(a),ne=G==_t||G==Xt;if(oi(a))return Kg(a,C);if(G==Nt||G==Ue||ne&&!E){if(T=k||ne?{}:cb(a),!C)return k?ZT(a,vT(T,a)):XT(a,vg(T,a))}else{if(!it[G])return E?a:{};T=cM(a,G,C)}}_||(_=new jn);var de=_.get(a);if(de)return de;_.set(a,T),Fb(a)?a.forEach(function(ve){T.add(Pn(ve,c,p,ve,a,_))}):Pb(a)&&a.forEach(function(ve,ze){T.set(ze,Pn(ve,c,p,ze,a,_))});var Ee=U?k?vd:Ed:k?En:Ht,Le=$?t:Ee(a);return In(Le||a,function(ve,ze){Le&&(ze=ve,ve=a[ze]),xs(T,ze,Pn(ve,c,p,ze,a,_))}),T}function wT(a){var c=Ht(a);return function(p){return wg(p,a,c)}}function wg(a,c,p){var g=p.length;if(a==null)return!g;for(a=nt(a);g--;){var E=p[g],_=c[E],T=a[E];if(T===t&&!(E in a)||!_(T))return!1}return!0}function xg(a,c,p){if(typeof a!="function")throw new Dn(i);return ks(function(){a.apply(t,p)},c)}function _s(a,c,p,g){var E=-1,_=Ca,T=!0,C=a.length,k=[],U=c.length;if(!C)return k;p&&(c=ut(c,Mn(p))),g?(_=zu,T=!1):c.length>=n&&(_=gs,T=!1,c=new Ri(c));e:for(;++EE?0:E+p),g=g===t||g>E?E:Re(g),g<0&&(g+=E),g=p>g?0:zb(g);p0&&p(C)?c>1?Gt(C,c-1,p,g,E):Zr(E,C):g||(E[E.length]=C)}return E}var td=Xg(),Tg=Xg(!0);function ur(a,c){return a&&td(a,c,Ht)}function nd(a,c){return a&&Tg(a,c,Ht)}function Ga(a,c){return Xr(c,function(p){return Nr(a[p])})}function Di(a,c){c=ri(c,a);for(var p=0,g=c.length;a!=null&&pc}function ST(a,c){return a!=null&&et.call(a,c)}function TT(a,c){return a!=null&&c in nt(a)}function MT(a,c,p){return a>=jt(c,p)&&a=120&&$.length>=120)?new Ri(T&&$):t}$=a[0];var G=-1,ne=C[0];e:for(;++G-1;)C!==a&&Ba.call(C,k,1),Ba.call(a,k,1);return a}function Pg(a,c){for(var p=a?c.length:0,g=p-1;p--;){var E=c[p];if(p==g||E!==_){var _=E;kr(E)?Ba.call(a,E,1):fd(a,E)}}return a}function cd(a,c){return a+za(gg()*(c-a+1))}function HT(a,c,p,g){for(var E=-1,_=It(Ha((c-a)/(p||1)),0),T=I(_);_--;)T[g?_:++E]=a,a+=p;return T}function ud(a,c){var p="";if(!a||c<1||c>P)return p;do c%2&&(p+=a),c=za(c/2),c&&(a+=a);while(c);return p}function Fe(a,c){return Cd(fb(a,c,vn),a+"")}function zT(a){return Eg(Ro(a))}function UT(a,c){var p=Ro(a);return rl(p,Ii(c,0,p.length))}function Ms(a,c,p,g){if(!pt(a))return a;c=ri(c,a);for(var E=-1,_=c.length,T=_-1,C=a;C!=null&&++E<_;){var k=fr(c[E]),U=p;if(k==="__proto__"||k==="constructor"||k==="prototype")return a;if(E!=T){var $=C[k];U=g?g($,k,C):t,U===t&&(U=pt($)?$:kr(c[E+1])?[]:{})}xs(C,k,U),C=C[k]}return a}var Bg=Ua?function(a,c){return Ua.set(a,c),a}:vn,$T=Fa?function(a,c){return Fa(a,"toString",{configurable:!0,enumerable:!1,value:Bd(c),writable:!0})}:vn;function WT(a){return rl(Ro(a))}function Bn(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 _=I(E);++g>>1,T=a[_];T!==null&&!An(T)&&(p?T<=c:T=n){var U=c?null:tM(a);if(U)return ka(U);T=!1,E=gs,k=new Ri}else k=c?[]:C;e:for(;++g<_;){var $=a[g],G=c?c($):$;if($=p||$!==0?$:0,T&&G===G){for(var ne=k.length;ne--;)if(k[ne]===G)continue e;c&&k.push(G),C.push($)}else E(k,G,p)||(k!==C&&k.push(G),C.push($))}return C}function fd(a,c){return c=ri(c,a),a=pb(a,c),a==null||delete a[fr(Fn(c))]}function zg(a,c,p,g){return Ms(a,c,p(Di(a,c)),g)}function Ja(a,c,p,g){for(var E=a.length,_=g?E:-1;(g?_--:++_=g?a:Bn(a,c,p)}var Wg=R1||function(a){return Ft.clearTimeout(a)};function Kg(a,c){if(c)return a.slice();var p=a.length,g=dg?dg(p):new a.constructor(p);return a.copy(g),g}function gd(a){var c=new a.constructor(a.byteLength);return new La(c).set(new La(a)),c}function GT(a,c){var p=c?gd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function qT(a){var c=new a.constructor(a.source,Cm.exec(a));return c.lastIndex=a.lastIndex,c}function YT(a){return ws?nt(ws.call(a)):{}}function Vg(a,c){var p=c?gd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function Gg(a,c){if(a!==c){var p=a!==t,g=a===null,E=a===a,_=An(a),T=c!==t,C=c===null,k=c===c,U=An(c);if(!C&&!U&&!_&&a>c||_&&T&&k&&!C&&!U||g&&T&&k||!p&&k||!E)return 1;if(!g&&!_&&!U&&a=C)return k;var U=p[g];return k*(U=="desc"?-1:1)}}return a.index-c.index}function qg(a,c,p,g){for(var E=-1,_=a.length,T=p.length,C=-1,k=c.length,U=It(_-T,0),$=I(k+U),G=!g;++C1?p[E-1]:t,T=E>2?p[2]:t;for(_=a.length>3&&typeof _=="function"?(E--,_):t,T&&ln(p[0],p[1],T)&&(_=E<3?t:_,E=1),c=nt(c);++g-1?E[_?c[T]:T]:t}}function Qg(a){return Ar(function(c){var p=c.length,g=p,E=Ln.prototype.thru;for(a&&c.reverse();g--;){var _=c[g];if(typeof _!="function")throw new Dn(i);if(E&&!T&&tl(_)=="wrapper")var T=new Ln([],!0)}for(g=T?g:p;++g1&&Ge.reverse(),$&&kC))return!1;var U=_.get(a),$=_.get(c);if(U&&$)return U==c&&$==a;var G=-1,ne=!0,de=p&b?new Ri:t;for(_.set(a,c),_.set(c,a);++G1?"& ":"")+c[g],c=c.join(p>2?", ":" "),a.replace(fS,`{ +var IN=Object.create;var Wd=Object.defineProperty;var LN=Object.getOwnPropertyDescriptor;var DN=Object.getOwnPropertyNames;var PN=Object.getPrototypeOf,BN=Object.prototype.hasOwnProperty;var FN=(t,e,n)=>e in t?Wd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Kd=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var HN=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of DN(e))!BN.call(t,i)&&i!==n&&Wd(t,i,{get:()=>e[i],enumerable:!(r=LN(e,i))||r.enumerable});return t};var Vd=(t,e,n)=>(n=t!=null?IN(PN(t)):{},HN(e||!t||!t.__esModule?Wd(n,"default",{value:t,enumerable:!0}):n,t));var un=(t,e,n)=>(FN(t,typeof e!="symbol"?e+"":e,n),n);var W_=Kd((R4,$_)=>{function N_(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)&&N_(n)}),t}var Eu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function O_(t){return t.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 mF="",S_=t=>!!t.scope,gF=(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}`},hm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=O_(e)}openNode(e){if(!S_(e))return;let n=gF(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){S_(e)&&(this.buffer+=mF)}value(){return this.buffer}span(e){this.buffer+=``}},T_=(t={})=>{let e={children:[]};return Object.assign(e,t),e},mm=class t{constructor(){this.rootNode=T_(),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=T_({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)}))}},gm=class extends mm{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 hm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function ba(t){return t?typeof t=="string"?t:t.source:null}function R_(t){return yo("(?=",t,")")}function bF(t){return yo("(?:",t,")*")}function yF(t){return yo("(?:",t,")?")}function yo(...t){return t.map(n=>ba(n)).join("")}function EF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function ym(...t){return"("+(EF(t).capture?"":"?:")+t.map(r=>ba(r)).join("|")+")"}function I_(t){return new RegExp(t.toString()+"|").exec("").length-1}function vF(t,e){let n=t&&t.exec(e);return n&&n.index===0}var wF=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Em(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=ba(r),s="";for(;o.length>0;){let l=wF.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 xF=/\b\B/,L_="[a-zA-Z]\\w*",vm="[a-zA-Z_]\\w*",D_="\\b\\d+(\\.\\d+)?",P_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",B_="\\b(0b[01]+)",_F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SF=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=yo(e,/.*\b/,t.binary,/\b.*/)),Ti({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},ya={begin:"\\\\[\\s\\S]",relevance:0},TF={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ya]},MF={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ya]},CF={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/},wu=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=ym("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},AF=wu("//","$"),kF=wu("/\\*","\\*/"),NF=wu("#","$"),OF={scope:"number",begin:D_,relevance:0},RF={scope:"number",begin:P_,relevance:0},IF={scope:"number",begin:B_,relevance:0},LF={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[ya,{begin:/\[/,end:/\]/,relevance:0,contains:[ya]}]}]},DF={scope:"title",begin:L_,relevance:0},PF={scope:"title",begin:vm,relevance:0},BF={begin:"\\.\\s*"+vm,relevance:0},FF=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()}})},yu=Object.freeze({__proto__:null,MATCH_NOTHING_RE:xF,IDENT_RE:L_,UNDERSCORE_IDENT_RE:vm,NUMBER_RE:D_,C_NUMBER_RE:P_,BINARY_NUMBER_RE:B_,RE_STARTERS_RE:_F,SHEBANG:SF,BACKSLASH_ESCAPE:ya,APOS_STRING_MODE:TF,QUOTE_STRING_MODE:MF,PHRASAL_WORDS_MODE:CF,COMMENT:wu,C_LINE_COMMENT_MODE:AF,C_BLOCK_COMMENT_MODE:kF,HASH_COMMENT_MODE:NF,NUMBER_MODE:OF,C_NUMBER_MODE:RF,BINARY_NUMBER_MODE:IF,REGEXP_MODE:LF,TITLE_MODE:DF,UNDERSCORE_TITLE_MODE:PF,METHOD_GUARD:BF,END_SAME_AS_BEGIN:FF});function HF(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function zF(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function UF(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=HF,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function $F(t,e){Array.isArray(t.illegal)&&(t.illegal=ym(...t.illegal))}function WF(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 KF(t,e){t.relevance===void 0&&(t.relevance=1)}var VF=(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,R_(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},GF=["of","and","for","in","not","or","if","then","parent","list","value"],qF="keyword";function F_(t,e,n=qF){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,F_(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,YF(u[0],u[1])]})}}function YF(t,e){return e?Number(e):JF(t)?0:1}function JF(t){return GF.includes(t.toLowerCase())}var M_={},bo=t=>{console.error(t)},C_=(t,...e)=>{console.log(`WARN: ${t}`,...e)},cs=(t,e)=>{M_[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),M_[`${t}/${e}`]=!0)},vu=new Error;function H_(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+=I_(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function XF(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw bo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),vu;if(typeof t.beginScope!="object"||t.beginScope===null)throw bo("beginScope must be object"),vu;H_(t,t.begin,{key:"beginScope"}),t.begin=Em(t.begin,{joinWith:""})}}function ZF(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw bo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),vu;if(typeof t.endScope!="object"||t.endScope===null)throw bo("endScope must be object"),vu;H_(t,t.end,{key:"endScope"}),t.end=Em(t.end,{joinWith:""})}}function jF(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function QF(t){jF(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),XF(t),ZF(t)}function eH(t){function e(s,l){return new RegExp(ba(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+=I_(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(Em(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;[zF,WF,QF,VF].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[UF,$F,KF].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=F_(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=ba(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 tH(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 z_(t){return t?t.endsWithParent||z_(t.starts):!1}function tH(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ti(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:z_(t)?Ti(t,{starts:t.starts?Ti(t.starts):null}):Object.isFrozen(t)?Ti(t):t}var nH="11.8.0",bm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},pm=O_,A_=Ti,k_=Symbol("nomatch"),rH=7,U_=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:gm};function u(N){return l.noHighlightRe.test(N)}function d(N){let R=N.className+" ";R+=N.parentNode?N.parentNode.className:"";let K=l.languageDetectRe.exec(R);if(K){let te=W(K[1]);return te||(C_(o.replace("{}",K[1])),C_("Falling back to no-highlight mode for this block.",N)),te?K[1]:"no-highlight"}return R.split(/\s+/).find(te=>u(te)||W(te))}function f(N,R,K){let te="",pe="";typeof R=="object"?(te=N,K=R.ignoreIllegals,pe=R.language):(cs("10.7.0","highlight(lang, code, ...args) has been deprecated."),cs("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),pe=N,te=R),K===void 0&&(K=!0);let Ce={code:te,language:pe};xe("before:highlight",Ce);let Ue=Ce.result?Ce.result:h(Ce.language,Ce.code,K);return Ue.code=Ce.code,xe("after:highlight",Ue),Ue}function h(N,R,K,te){let pe=Object.create(null);function Ce(H,Y){return H.keywords[Y]}function Ue(){if(!ee.keywords){We.addText(Oe);return}let H=0;ee.keywordPatternRe.lastIndex=0;let Y=ee.keywordPatternRe.exec(Oe),le="";for(;Y;){le+=Oe.substring(H,Y.index);let Me=ft.case_insensitive?Y[0].toLowerCase():Y[0],ct=Ce(ee,Me);if(ct){let[Vt,Ci]=ct;if(We.addText(le),le="",pe[Me]=(pe[Me]||0)+1,pe[Me]<=rH&&(mt+=Ci),Vt.startsWith("_"))le+=Y[0];else{let B=ft.classNameAliases[Vt]||Vt;Je(Y[0],B)}}else le+=Y[0];H=ee.keywordPatternRe.lastIndex,Y=ee.keywordPatternRe.exec(Oe)}le+=Oe.substring(H),We.addText(le)}function $e(){if(Oe==="")return;let H=null;if(typeof ee.subLanguage=="string"){if(!e[ee.subLanguage]){We.addText(Oe);return}H=h(ee.subLanguage,Oe,!0,Ae[ee.subLanguage]),Ae[ee.subLanguage]=H._top}else H=b(Oe,ee.subLanguage.length?ee.subLanguage:null);ee.relevance>0&&(mt+=H.relevance),We.__addSublanguage(H._emitter,H.language)}function He(){ee.subLanguage!=null?$e():Ue(),Oe=""}function Je(H,Y){H!==""&&(We.startScope(Y),We.addText(H),We.endScope())}function xt(H,Y){let le=1,Me=Y.length-1;for(;le<=Me;){if(!H._emit[le]){le++;continue}let ct=ft.classNameAliases[H[le]]||H[le],Vt=Y[le];ct?Je(Vt,ct):(Oe=Vt,Ue(),Oe=""),le++}}function Pt(H,Y){return H.scope&&typeof H.scope=="string"&&We.openNode(ft.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(Je(Oe,ft.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),Oe=""):H.beginScope._multi&&(xt(H.beginScope,Y),Oe="")),ee=Object.create(H,{parent:{value:ee}}),ee}function Le(H,Y,le){let Me=vF(H.endRe,le);if(Me){if(H["on:end"]){let ct=new Eu(H);H["on:end"](Y,ct),ct.isMatchIgnored&&(Me=!1)}if(Me){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return Le(H.parent,Y,le)}function _t(H){return ee.matcher.regexIndex===0?(Oe+=H[0],1):(re=!0,0)}function Xt(H){let Y=H[0],le=H.rule,Me=new Eu(le),ct=[le.__beforeBegin,le["on:begin"]];for(let Vt of ct)if(Vt&&(Vt(H,Me),Me.isMatchIgnored))return _t(Y);return le.skip?Oe+=Y:(le.excludeBegin&&(Oe+=Y),He(),!le.returnBegin&&!le.excludeBegin&&(Oe=Y)),Pt(le,H),le.returnBegin?0:Y.length}function st(H){let Y=H[0],le=R.substring(H.index),Me=Le(ee,H,le);if(!Me)return k_;let ct=ee;ee.endScope&&ee.endScope._wrap?(He(),Je(Y,ee.endScope._wrap)):ee.endScope&&ee.endScope._multi?(He(),xt(ee.endScope,H)):ct.skip?Oe+=Y:(ct.returnEnd||ct.excludeEnd||(Oe+=Y),He(),ct.excludeEnd&&(Oe=Y));do ee.scope&&We.closeNode(),!ee.skip&&!ee.subLanguage&&(mt+=ee.relevance),ee=ee.parent;while(ee!==Me.parent);return Me.starts&&Pt(Me.starts,H),ct.returnEnd?0:Y.length}function Zt(){let H=[];for(let Y=ee;Y!==ft;Y=Y.parent)Y.scope&&H.unshift(Y.scope);H.forEach(Y=>We.openNode(Y))}let St={};function Nt(H,Y){let le=Y&&Y[0];if(Oe+=H,le==null)return He(),0;if(St.type==="begin"&&Y.type==="end"&&St.index===Y.index&&le===""){if(Oe+=R.slice(Y.index,Y.index+1),!i){let Me=new Error(`0 width match regex (${N})`);throw Me.languageName=N,Me.badRule=St.rule,Me}return 1}if(St=Y,Y.type==="begin")return Xt(Y);if(Y.type==="illegal"&&!K){let Me=new Error('Illegal lexeme "'+le+'" for mode "'+(ee.scope||"")+'"');throw Me.mode=ee,Me}else if(Y.type==="end"){let Me=st(Y);if(Me!==k_)return Me}if(Y.type==="illegal"&&le==="")return 1;if(X>1e5&&X>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Oe+=le,le.length}let ft=W(N);if(!ft)throw bo(o.replace("{}",N)),new Error('Unknown language: "'+N+'"');let me=eH(ft),Kt="",ee=te||me,Ae={},We=new l.__emitter(l);Zt();let Oe="",mt=0,Ot=0,X=0,re=!1;try{if(ft.__emitTokens)ft.__emitTokens(R,We);else{for(ee.matcher.considerAll();;){X++,re?re=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=Ot;let H=ee.matcher.exec(R);if(!H)break;let Y=R.substring(Ot,H.index),le=Nt(Y,H);Ot=H.index+le}Nt(R.substring(Ot))}return We.finalize(),Kt=We.toHTML(),{language:N,value:Kt,relevance:mt,illegal:!1,_emitter:We,_top:ee}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:N,value:pm(R),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:Ot,context:R.slice(Ot-100,Ot+100),mode:H.mode,resultSoFar:Kt},_emitter:We};if(i)return{language:N,value:pm(R),illegal:!1,relevance:0,errorRaised:H,_emitter:We,_top:ee};throw H}}function m(N){let R={value:pm(N),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return R._emitter.addText(N),R}function b(N,R){R=R||l.languages||Object.keys(e);let K=m(N),te=R.filter(W).filter(ye).map(He=>h(He,N,!1));te.unshift(K);let pe=te.sort((He,Je)=>{if(He.relevance!==Je.relevance)return Je.relevance-He.relevance;if(He.language&&Je.language){if(W(He.language).supersetOf===Je.language)return 1;if(W(Je.language).supersetOf===He.language)return-1}return 0}),[Ce,Ue]=pe,$e=Ce;return $e.secondBest=Ue,$e}function y(N,R,K){let te=R&&n[R]||K;N.classList.add("hljs"),N.classList.add(`language-${te}`)}function w(N){let R=null,K=d(N);if(u(K))return;if(xe("before:highlightElement",{el:N,language:K}),N.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(N)),l.throwUnescapedHTML))throw new bm("One of your code blocks includes unescaped HTML.",N.innerHTML);R=N;let te=R.textContent,pe=K?f(te,{language:K,ignoreIllegals:!0}):b(te);N.innerHTML=pe.value,y(N,K,pe.language),N.result={language:pe.language,re:pe.relevance,relevance:pe.relevance},pe.secondBest&&(N.secondBest={language:pe.secondBest.language,relevance:pe.secondBest.relevance}),xe("after:highlightElement",{el:N,result:pe,text:te})}function x(N){l=A_(l,N)}let M=()=>{S(),cs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){S(),cs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function S(){if(document.readyState==="loading"){L=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function z(){L&&S()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",z,!1);function O(N,R){let K=null;try{K=R(t)}catch(te){if(bo("Language definition for '{}' could not be registered.".replace("{}",N)),i)bo(te);else throw te;K=s}K.name||(K.name=N),e[N]=K,K.rawDefinition=R.bind(null,t),K.aliases&&ue(K.aliases,{languageName:N})}function q(N){delete e[N];for(let R of Object.keys(n))n[R]===N&&delete n[R]}function J(){return Object.keys(e)}function W(N){return N=(N||"").toLowerCase(),e[N]||e[n[N]]}function ue(N,{languageName:R}){typeof N=="string"&&(N=[N]),N.forEach(K=>{n[K.toLowerCase()]=R})}function ye(N){let R=W(N);return R&&!R.disableAutodetect}function Te(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=R=>{N["before:highlightBlock"](Object.assign({block:R.el},R))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=R=>{N["after:highlightBlock"](Object.assign({block:R.el},R))})}function ge(N){Te(N),r.push(N)}function we(N){let R=r.indexOf(N);R!==-1&&r.splice(R,1)}function xe(N,R){let K=N;r.forEach(function(te){te[K]&&te[K](R)})}function P(N){return cs("10.7.0","highlightBlock will be removed entirely in v12.0"),cs("10.7.0","Please use highlightElement now."),w(N)}Object.assign(t,{highlight:f,highlightAuto:b,highlightAll:S,highlightElement:w,highlightBlock:P,configure:x,initHighlighting:M,initHighlightingOnLoad:D,registerLanguage:O,unregisterLanguage:q,listLanguages:J,getLanguage:W,registerAliases:ue,autoDetection:ye,inherit:A_,addPlugin:ge,removePlugin:we}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=nH,t.regex={concat:yo,lookahead:R_,either:ym,optional:yF,anyNumberOfTimes:bF};for(let N in yu)typeof yu[N]=="object"&&N_(yu[N]);return Object.assign(t,yu),t},us=U_({});us.newInstance=()=>U_({});$_.exports=us;us.HighlightJS=us;us.default=us});var V_=Kd((L4,wm)=>{(function(){var t;typeof wm<"u"?t=wm.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,b,y=!1,w,x=function(){return s[o++]},M=function(){for(var D="";/\d/.test(i[l]);)D+=i[l++],f=i[l];return D.length>0?parseInt(D):null};l{(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,b=2,y=1,w=2,x=4,M=8,D=16,L=32,S=64,z=128,O=256,q=512,J=30,W="...",ue=800,ye=16,Te=1,ge=2,we=3,xe=1/0,P=9007199254740991,N=17976931348623157e292,R=NaN,K=4294967295,te=K-1,pe=K>>>1,Ce=[["ary",z],["bind",y],["bindKey",w],["curry",M],["curryRight",D],["flip",q],["partial",L],["partialRight",S],["rearg",O]],Ue="[object Arguments]",$e="[object Array]",He="[object AsyncFunction]",Je="[object Boolean]",xt="[object Date]",Pt="[object DOMException]",Le="[object Error]",_t="[object Function]",Xt="[object GeneratorFunction]",st="[object Map]",Zt="[object Number]",St="[object Null]",Nt="[object Object]",ft="[object Promise]",me="[object Proxy]",Kt="[object RegExp]",ee="[object Set]",Ae="[object String]",We="[object Symbol]",Oe="[object Undefined]",mt="[object WeakMap]",Ot="[object WeakSet]",X="[object ArrayBuffer]",re="[object DataView]",H="[object Float32Array]",Y="[object Float64Array]",le="[object Int8Array]",Me="[object Int16Array]",ct="[object Int32Array]",Vt="[object Uint8Array]",Ci="[object Uint8ClampedArray]",B="[object Uint16Array]",ae="[object Uint32Array]",_e=/\b__p \+= '';/g,Xe=/\b(__p \+=) '' \+/g,Ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bt=/&(?:amp|lt|gt|quot|#39);/g,sn=/[&<>"']/g,qr=RegExp(Bt.source),_a=RegExp(sn.source),_r=/<%-([\s\S]+?)%>/g,hs=/<%([\s\S]+?)%>/g,Ai=/<%=([\s\S]+?)%>/g,Yr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ou=/^\w*$/,ms=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jr=/[\\^$.*+?()[\]{}|]/g,uS=RegExp(Jr.source),Ru=/^\s+/,dS=/\s/,fS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pS=/\{\n\/\* \[wrapped with (.+)\] \*/,hS=/,? & /,mS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gS=/[()=,{}\[\]\/\s]/,bS=/\\(\\)?/g,yS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cm=/\w*$/,ES=/^[-+]0x[0-9a-f]+$/i,vS=/^0b[01]+$/i,wS=/^\[object .+?Constructor\]$/,xS=/^0o[0-7]+$/i,_S=/^(?:0|[1-9]\d*)$/,SS=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Sa=/($^)/,TS=/['\n\r\u2028\u2029\\]/g,Ta="\\ud800-\\udfff",MS="\\u0300-\\u036f",CS="\\ufe20-\\ufe2f",AS="\\u20d0-\\u20ff",Am=MS+CS+AS,km="\\u2700-\\u27bf",Nm="a-z\\xdf-\\xf6\\xf8-\\xff",kS="\\xac\\xb1\\xd7\\xf7",NS="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",OS="\\u2000-\\u206f",RS=" \\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",Om="A-Z\\xc0-\\xd6\\xd8-\\xde",Rm="\\ufe0e\\ufe0f",Im=kS+NS+OS+RS,Iu="['\u2019]",IS="["+Ta+"]",Lm="["+Im+"]",Ma="["+Am+"]",Dm="\\d+",LS="["+km+"]",Pm="["+Nm+"]",Bm="[^"+Ta+Im+Dm+km+Nm+Om+"]",Lu="\\ud83c[\\udffb-\\udfff]",DS="(?:"+Ma+"|"+Lu+")",Fm="[^"+Ta+"]",Du="(?:\\ud83c[\\udde6-\\uddff]){2}",Pu="[\\ud800-\\udbff][\\udc00-\\udfff]",vo="["+Om+"]",Hm="\\u200d",zm="(?:"+Pm+"|"+Bm+")",PS="(?:"+vo+"|"+Bm+")",Um="(?:"+Iu+"(?:d|ll|m|re|s|t|ve))?",$m="(?:"+Iu+"(?:D|LL|M|RE|S|T|VE))?",Wm=DS+"?",Km="["+Rm+"]?",BS="(?:"+Hm+"(?:"+[Fm,Du,Pu].join("|")+")"+Km+Wm+")*",FS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",HS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vm=Km+Wm+BS,zS="(?:"+[LS,Du,Pu].join("|")+")"+Vm,US="(?:"+[Fm+Ma+"?",Ma,Du,Pu,IS].join("|")+")",$S=RegExp(Iu,"g"),WS=RegExp(Ma,"g"),Bu=RegExp(Lu+"(?="+Lu+")|"+US+Vm,"g"),KS=RegExp([vo+"?"+Pm+"+"+Um+"(?="+[Lm,vo,"$"].join("|")+")",PS+"+"+$m+"(?="+[Lm,vo+zm,"$"].join("|")+")",vo+"?"+zm+"+"+Um,vo+"+"+$m,HS,FS,Dm,zS].join("|"),"g"),VS=RegExp("["+Hm+Ta+Am+Rm+"]"),GS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qS=["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"],YS=-1,at={};at[H]=at[Y]=at[le]=at[Me]=at[ct]=at[Vt]=at[Ci]=at[B]=at[ae]=!0,at[Ue]=at[$e]=at[X]=at[Je]=at[re]=at[xt]=at[Le]=at[_t]=at[st]=at[Zt]=at[Nt]=at[Kt]=at[ee]=at[Ae]=at[mt]=!1;var it={};it[Ue]=it[$e]=it[X]=it[re]=it[Je]=it[xt]=it[H]=it[Y]=it[le]=it[Me]=it[ct]=it[st]=it[Zt]=it[Nt]=it[Kt]=it[ee]=it[Ae]=it[We]=it[Vt]=it[Ci]=it[B]=it[ae]=!0,it[Le]=it[_t]=it[mt]=!1;var JS={\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"},XS={"&":"&","<":"<",">":">",'"':""","'":"'"},ZS={"&":"&","<":"<",">":">",""":'"',"'":"'"},jS={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},QS=parseFloat,e1=parseInt,Gm=typeof global=="object"&&global&&global.Object===Object&&global,t1=typeof self=="object"&&self&&self.Object===Object&&self,Ft=Gm||t1||Function("return this")(),Fu=typeof ps=="object"&&ps&&!ps.nodeType&&ps,ki=Fu&&typeof xa=="object"&&xa&&!xa.nodeType&&xa,qm=ki&&ki.exports===Fu,Hu=qm&&Gm.process,Rn=function(){try{var A=ki&&ki.require&&ki.require("util").types;return A||Hu&&Hu.binding&&Hu.binding("util")}catch{}}(),Ym=Rn&&Rn.isArrayBuffer,Jm=Rn&&Rn.isDate,Xm=Rn&&Rn.isMap,Zm=Rn&&Rn.isRegExp,jm=Rn&&Rn.isSet,Qm=Rn&&Rn.isTypedArray;function Tn(A,F,I){switch(I.length){case 0:return A.call(F);case 1:return A.call(F,I[0]);case 2:return A.call(F,I[0],I[1]);case 3:return A.call(F,I[0],I[1],I[2])}return A.apply(F,I)}function n1(A,F,I,oe){for(var ke=-1,Ze=A==null?0:A.length;++ke-1}function zu(A,F,I){for(var oe=-1,ke=A==null?0:A.length;++oe-1;);return I}function ag(A,F){for(var I=A.length;I--&&wo(F,A[I],0)>-1;);return I}function d1(A,F){for(var I=A.length,oe=0;I--;)A[I]===F&&++oe;return oe}var f1=Ku(JS),p1=Ku(XS);function h1(A){return"\\"+jS[A]}function m1(A,F){return A==null?t:A[F]}function xo(A){return VS.test(A)}function g1(A){return GS.test(A)}function b1(A){for(var F,I=[];!(F=A.next()).done;)I.push(F.value);return I}function Yu(A){var F=-1,I=Array(A.size);return A.forEach(function(oe,ke){I[++F]=[ke,oe]}),I}function lg(A,F){return function(I){return A(F(I))}}function jr(A,F){for(var I=-1,oe=A.length,ke=0,Ze=[];++I-1}function iT(a,c){var p=this.__data__,g=Ka(p,a);return g<0?(++this.size,p.push([a,c])):p[g][1]=c,this}Sr.prototype.clear=eT,Sr.prototype.delete=tT,Sr.prototype.get=nT,Sr.prototype.has=rT,Sr.prototype.set=iT;function Tr(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c=c?a:c)),a}function Pn(a,c,p,g,E,_){var T,C=c&d,k=c&f,U=c&h;if(p&&(T=E?p(a,g,E,_):p(a)),T!==t)return T;if(!pt(a))return a;var $=Ne(a);if($){if(T=lM(a),!C)return bn(a,T)}else{var G=Qt(a),ne=G==_t||G==Xt;if(oi(a))return Kg(a,C);if(G==Nt||G==Ue||ne&&!E){if(T=k||ne?{}:cb(a),!C)return k?ZT(a,vT(T,a)):XT(a,vg(T,a))}else{if(!it[G])return E?a:{};T=cM(a,G,C)}}_||(_=new jn);var de=_.get(a);if(de)return de;_.set(a,T),Fb(a)?a.forEach(function(ve){T.add(Pn(ve,c,p,ve,a,_))}):Pb(a)&&a.forEach(function(ve,ze){T.set(ze,Pn(ve,c,p,ze,a,_))});var Ee=U?k?vd:Ed:k?En:Ht,De=$?t:Ee(a);return In(De||a,function(ve,ze){De&&(ze=ve,ve=a[ze]),xs(T,ze,Pn(ve,c,p,ze,a,_))}),T}function wT(a){var c=Ht(a);return function(p){return wg(p,a,c)}}function wg(a,c,p){var g=p.length;if(a==null)return!g;for(a=nt(a);g--;){var E=p[g],_=c[E],T=a[E];if(T===t&&!(E in a)||!_(T))return!1}return!0}function xg(a,c,p){if(typeof a!="function")throw new Ln(i);return ks(function(){a.apply(t,p)},c)}function _s(a,c,p,g){var E=-1,_=Ca,T=!0,C=a.length,k=[],U=c.length;if(!C)return k;p&&(c=ut(c,Mn(p))),g?(_=zu,T=!1):c.length>=n&&(_=gs,T=!1,c=new Ri(c));e:for(;++EE?0:E+p),g=g===t||g>E?E:Re(g),g<0&&(g+=E),g=p>g?0:zb(g);p0&&p(C)?c>1?Gt(C,c-1,p,g,E):Zr(E,C):g||(E[E.length]=C)}return E}var td=Xg(),Tg=Xg(!0);function ur(a,c){return a&&td(a,c,Ht)}function nd(a,c){return a&&Tg(a,c,Ht)}function Ga(a,c){return Xr(c,function(p){return Nr(a[p])})}function Li(a,c){c=ri(c,a);for(var p=0,g=c.length;a!=null&&pc}function ST(a,c){return a!=null&&et.call(a,c)}function TT(a,c){return a!=null&&c in nt(a)}function MT(a,c,p){return a>=jt(c,p)&&a=120&&$.length>=120)?new Ri(T&&$):t}$=a[0];var G=-1,ne=C[0];e:for(;++G-1;)C!==a&&Ba.call(C,k,1),Ba.call(a,k,1);return a}function Pg(a,c){for(var p=a?c.length:0,g=p-1;p--;){var E=c[p];if(p==g||E!==_){var _=E;kr(E)?Ba.call(a,E,1):fd(a,E)}}return a}function cd(a,c){return a+za(gg()*(c-a+1))}function HT(a,c,p,g){for(var E=-1,_=It(Ha((c-a)/(p||1)),0),T=I(_);_--;)T[g?_:++E]=a,a+=p;return T}function ud(a,c){var p="";if(!a||c<1||c>P)return p;do c%2&&(p+=a),c=za(c/2),c&&(a+=a);while(c);return p}function Fe(a,c){return Cd(fb(a,c,vn),a+"")}function zT(a){return Eg(Ro(a))}function UT(a,c){var p=Ro(a);return rl(p,Ii(c,0,p.length))}function Ms(a,c,p,g){if(!pt(a))return a;c=ri(c,a);for(var E=-1,_=c.length,T=_-1,C=a;C!=null&&++E<_;){var k=fr(c[E]),U=p;if(k==="__proto__"||k==="constructor"||k==="prototype")return a;if(E!=T){var $=C[k];U=g?g($,k,C):t,U===t&&(U=pt($)?$:kr(c[E+1])?[]:{})}xs(C,k,U),C=C[k]}return a}var Bg=Ua?function(a,c){return Ua.set(a,c),a}:vn,$T=Fa?function(a,c){return Fa(a,"toString",{configurable:!0,enumerable:!1,value:Bd(c),writable:!0})}:vn;function WT(a){return rl(Ro(a))}function Bn(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 _=I(E);++g>>1,T=a[_];T!==null&&!An(T)&&(p?T<=c:T=n){var U=c?null:tM(a);if(U)return ka(U);T=!1,E=gs,k=new Ri}else k=c?[]:C;e:for(;++g<_;){var $=a[g],G=c?c($):$;if($=p||$!==0?$:0,T&&G===G){for(var ne=k.length;ne--;)if(k[ne]===G)continue e;c&&k.push(G),C.push($)}else E(k,G,p)||(k!==C&&k.push(G),C.push($))}return C}function fd(a,c){return c=ri(c,a),a=pb(a,c),a==null||delete a[fr(Fn(c))]}function zg(a,c,p,g){return Ms(a,c,p(Li(a,c)),g)}function Ja(a,c,p,g){for(var E=a.length,_=g?E:-1;(g?_--:++_=g?a:Bn(a,c,p)}var Wg=R1||function(a){return Ft.clearTimeout(a)};function Kg(a,c){if(c)return a.slice();var p=a.length,g=dg?dg(p):new a.constructor(p);return a.copy(g),g}function gd(a){var c=new a.constructor(a.byteLength);return new Da(c).set(new Da(a)),c}function GT(a,c){var p=c?gd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function qT(a){var c=new a.constructor(a.source,Cm.exec(a));return c.lastIndex=a.lastIndex,c}function YT(a){return ws?nt(ws.call(a)):{}}function Vg(a,c){var p=c?gd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function Gg(a,c){if(a!==c){var p=a!==t,g=a===null,E=a===a,_=An(a),T=c!==t,C=c===null,k=c===c,U=An(c);if(!C&&!U&&!_&&a>c||_&&T&&k&&!C&&!U||g&&T&&k||!p&&k||!E)return 1;if(!g&&!_&&!U&&a=C)return k;var U=p[g];return k*(U=="desc"?-1:1)}}return a.index-c.index}function qg(a,c,p,g){for(var E=-1,_=a.length,T=p.length,C=-1,k=c.length,U=It(_-T,0),$=I(k+U),G=!g;++C1?p[E-1]:t,T=E>2?p[2]:t;for(_=a.length>3&&typeof _=="function"?(E--,_):t,T&&ln(p[0],p[1],T)&&(_=E<3?t:_,E=1),c=nt(c);++g-1?E[_?c[T]:T]:t}}function Qg(a){return Ar(function(c){var p=c.length,g=p,E=Dn.prototype.thru;for(a&&c.reverse();g--;){var _=c[g];if(typeof _!="function")throw new Ln(i);if(E&&!T&&tl(_)=="wrapper")var T=new Dn([],!0)}for(g=T?g:p;++g1&&Ge.reverse(),$&&kC))return!1;var U=_.get(a),$=_.get(c);if(U&&$)return U==c&&$==a;var G=-1,ne=!0,de=p&b?new Ri:t;for(_.set(a,c),_.set(c,a);++G1?"& ":"")+c[g],c=c.join(p>2?", ":" "),a.replace(fS,`{ /* [wrapped with `+c+`] */ -`)}function dM(a){return Ne(a)||Bi(a)||!!(hg&&a&&a[hg])}function kr(a,c){var p=typeof a;return c=c??P,!!c&&(p=="number"||p!="symbol"&&_S.test(a))&&a>-1&&a%1==0&&a0){if(++c>=ue)return arguments[0]}else c=0;return a.apply(t,arguments)}}function rl(a,c){var p=-1,g=a.length,E=g-1;for(c=c===t?g:c;++p1?a[c-1]:t;return p=typeof p=="function"?(a.pop(),p):t,Sb(a,p)});function Tb(a){var c=v(a);return c.__chain__=!0,c}function xC(a,c){return c(a),a}function il(a,c){return c(a)}var _C=Ar(function(a){var c=a.length,p=c?a[0]:0,g=this.__wrapped__,E=function(_){return ed(_,a)};return c>1||this.__actions__.length||!(g instanceof Ke)||!kr(p)?this.thru(E):(g=g.slice(p,+p+(c?1:0)),g.__actions__.push({func:il,args:[E],thisArg:t}),new Ln(g,this.__chain__).thru(function(_){return c&&!_.length&&_.push(t),_}))});function SC(){return Tb(this)}function TC(){return new Ln(this.value(),this.__chain__)}function MC(){this.__values__===t&&(this.__values__=Hb(this.value()));var a=this.__index__>=this.__values__.length,c=a?t:this.__values__[this.__index__++];return{done:a,value:c}}function CC(){return this}function AC(a){for(var c,p=this;p instanceof Wa;){var g=yb(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 kC(){var a=this.__wrapped__;if(a instanceof Ke){var c=a;return this.__actions__.length&&(c=new Ke(this)),c=c.reverse(),c.__actions__.push({func:il,args:[Ad],thisArg:t}),new Ln(c,this.__chain__)}return this.thru(Ad)}function NC(){return Ug(this.__wrapped__,this.__actions__)}var OC=Xa(function(a,c,p){et.call(a,p)?++a[p]:Mr(a,p,1)});function RC(a,c,p){var g=Ne(a)?eg:xT;return p&&ln(a,c,p)&&(c=t),g(a,be(c,3))}function IC(a,c){var p=Ne(a)?Xr:Sg;return p(a,be(c,3))}var DC=jg(Eb),LC=jg(vb);function PC(a,c){return Gt(ol(a,c),1)}function BC(a,c){return Gt(ol(a,c),xe)}function FC(a,c,p){return p=p===t?1:Re(p),Gt(ol(a,c),p)}function Mb(a,c){var p=Ne(a)?In:ti;return p(a,be(c,3))}function Cb(a,c){var p=Ne(a)?r1:_g;return p(a,be(c,3))}var HC=Xa(function(a,c,p){et.call(a,p)?a[p].push(c):Mr(a,p,[c])});function zC(a,c,p,g){a=yn(a)?a:Ro(a),p=p&&!g?Re(p):0;var E=a.length;return p<0&&(p=It(E+p,0)),ul(a)?p<=E&&a.indexOf(c,p)>-1:!!E&&wo(a,c,p)>-1}var UC=Fe(function(a,c,p){var g=-1,E=typeof c=="function",_=yn(a)?I(a.length):[];return ti(a,function(T){_[++g]=E?Tn(c,T,p):Ss(T,c,p)}),_}),$C=Xa(function(a,c,p){Mr(a,p,c)});function ol(a,c){var p=Ne(a)?ut:Ng;return p(a,be(c,3))}function WC(a,c,p,g){return a==null?[]:(Ne(c)||(c=c==null?[]:[c]),p=g?t:p,Ne(p)||(p=p==null?[]:[p]),Dg(a,c,p))}var KC=Xa(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function VC(a,c,p){var g=Ne(a)?Uu:ig,E=arguments.length<3;return g(a,be(c,4),p,E,ti)}function GC(a,c,p){var g=Ne(a)?i1:ig,E=arguments.length<3;return g(a,be(c,4),p,E,_g)}function qC(a,c){var p=Ne(a)?Xr:Sg;return p(a,ll(be(c,3)))}function YC(a){var c=Ne(a)?Eg:zT;return c(a)}function JC(a,c,p){(p?ln(a,c,p):c===t)?c=1:c=Re(c);var g=Ne(a)?bT:UT;return g(a,c)}function XC(a){var c=Ne(a)?yT:WT;return c(a)}function ZC(a){if(a==null)return 0;if(yn(a))return ul(a)?_o(a):a.length;var c=Qt(a);return c==st||c==ee?a.size:sd(a).length}function jC(a,c,p){var g=Ne(a)?$u:KT;return p&&ln(a,c,p)&&(c=t),g(a,be(c,3))}var QC=Fe(function(a,c){if(a==null)return[];var p=c.length;return p>1&&ln(a,c[0],c[1])?c=[]:p>2&&ln(c[0],c[1],c[2])&&(c=[c[0]]),Dg(a,Gt(c,1),[])}),sl=I1||function(){return Ft.Date.now()};function eA(a,c){if(typeof c!="function")throw new Dn(i);return a=Re(a),function(){if(--a<1)return c.apply(this,arguments)}}function Ab(a,c,p){return c=p?t:c,c=a&&c==null?a.length:c,Cr(a,z,t,t,t,t,c)}function kb(a,c){var p;if(typeof c!="function")throw new Dn(i);return a=Re(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=t),p}}var Nd=Fe(function(a,c,p){var g=y;if(p.length){var E=jr(p,No(Nd));g|=D}return Cr(a,g,c,p,E)}),Nb=Fe(function(a,c,p){var g=y|w;if(p.length){var E=jr(p,No(Nb));g|=D}return Cr(c,g,a,p,E)});function Ob(a,c,p){c=p?t:c;var g=Cr(a,M,t,t,t,t,t,c);return g.placeholder=Ob.placeholder,g}function Rb(a,c,p){c=p?t:c;var g=Cr(a,L,t,t,t,t,t,c);return g.placeholder=Rb.placeholder,g}function Ib(a,c,p){var g,E,_,T,C,k,U=0,$=!1,G=!1,ne=!0;if(typeof a!="function")throw new Dn(i);c=Hn(c)||0,pt(p)&&($=!!p.leading,G="maxWait"in p,_=G?It(Hn(p.maxWait)||0,c):_,ne="trailing"in p?!!p.trailing:ne);function de(vt){var er=g,Rr=E;return g=E=t,U=vt,T=a.apply(Rr,er),T}function Ee(vt){return U=vt,C=ks(ze,c),$?de(vt):T}function Le(vt){var er=vt-k,Rr=vt-U,jb=c-er;return G?jt(jb,_-Rr):jb}function ve(vt){var er=vt-k,Rr=vt-U;return k===t||er>=c||er<0||G&&Rr>=_}function ze(){var vt=sl();if(ve(vt))return Ge(vt);C=ks(ze,Le(vt))}function Ge(vt){return C=t,ne&&g?de(vt):(g=E=t,T)}function kn(){C!==t&&Wg(C),U=0,g=k=E=C=t}function cn(){return C===t?T:Ge(sl())}function Nn(){var vt=sl(),er=ve(vt);if(g=arguments,E=this,k=vt,er){if(C===t)return Ee(k);if(G)return Wg(C),C=ks(ze,c),de(k)}return C===t&&(C=ks(ze,c)),T}return Nn.cancel=kn,Nn.flush=cn,Nn}var tA=Fe(function(a,c){return xg(a,1,c)}),nA=Fe(function(a,c,p){return xg(a,Hn(c)||0,p)});function rA(a){return Cr(a,q)}function al(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Dn(i);var p=function(){var g=arguments,E=c?c.apply(this,g):g[0],_=p.cache;if(_.has(E))return _.get(E);var T=a.apply(this,g);return p.cache=_.set(E,T)||_,T};return p.cache=new(al.Cache||Tr),p}al.Cache=Tr;function ll(a){if(typeof a!="function")throw new Dn(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 iA(a){return kb(2,a)}var oA=VT(function(a,c){c=c.length==1&&Ne(c[0])?ut(c[0],Mn(be())):ut(Gt(c,1),Mn(be()));var p=c.length;return Fe(function(g){for(var E=-1,_=jt(g.length,p);++E<_;)g[E]=c[E].call(this,g[E]);return Tn(a,this,g)})}),Od=Fe(function(a,c){var p=jr(c,No(Od));return Cr(a,D,t,c,p)}),Db=Fe(function(a,c){var p=jr(c,No(Db));return Cr(a,S,t,c,p)}),sA=Ar(function(a,c){return Cr(a,O,t,t,t,c)});function aA(a,c){if(typeof a!="function")throw new Dn(i);return c=c===t?c:Re(c),Fe(a,c)}function lA(a,c){if(typeof a!="function")throw new Dn(i);return c=c==null?0:It(Re(c),0),Fe(function(p){var g=p[c],E=ii(p,0,c);return g&&Zr(E,g),Tn(a,this,E)})}function cA(a,c,p){var g=!0,E=!0;if(typeof a!="function")throw new Dn(i);return pt(p)&&(g="leading"in p?!!p.leading:g,E="trailing"in p?!!p.trailing:E),Ib(a,c,{leading:g,maxWait:c,trailing:E})}function uA(a){return Ab(a,1)}function dA(a,c){return Od(md(c),a)}function fA(){if(!arguments.length)return[];var a=arguments[0];return Ne(a)?a:[a]}function pA(a){return Pn(a,h)}function hA(a,c){return c=typeof c=="function"?c:t,Pn(a,h,c)}function mA(a){return Pn(a,d|h)}function gA(a,c){return c=typeof c=="function"?c:t,Pn(a,d|h,c)}function bA(a,c){return c==null||wg(a,c,Ht(c))}function Qn(a,c){return a===c||a!==a&&c!==c}var yA=el(rd),EA=el(function(a,c){return a>=c}),Bi=Cg(function(){return arguments}())?Cg:function(a){return gt(a)&&et.call(a,"callee")&&!pg.call(a,"callee")},Ne=I.isArray,vA=Ym?Mn(Ym):AT;function yn(a){return a!=null&&cl(a.length)&&!Nr(a)}function Et(a){return gt(a)&&yn(a)}function wA(a){return a===!0||a===!1||gt(a)&&an(a)==Je}var oi=L1||$d,xA=Jm?Mn(Jm):kT;function _A(a){return gt(a)&&a.nodeType===1&&!Ns(a)}function SA(a){if(a==null)return!0;if(yn(a)&&(Ne(a)||typeof a=="string"||typeof a.splice=="function"||oi(a)||Oo(a)||Bi(a)))return!a.length;var c=Qt(a);if(c==st||c==ee)return!a.size;if(As(a))return!sd(a).length;for(var p in a)if(et.call(a,p))return!1;return!0}function TA(a,c){return Ts(a,c)}function MA(a,c,p){p=typeof p=="function"?p:t;var g=p?p(a,c):t;return g===t?Ts(a,c,t,p):!!g}function Rd(a){if(!gt(a))return!1;var c=an(a);return c==De||c==Pt||typeof a.message=="string"&&typeof a.name=="string"&&!Ns(a)}function CA(a){return typeof a=="number"&&mg(a)}function Nr(a){if(!pt(a))return!1;var c=an(a);return c==_t||c==Xt||c==He||c==me}function Lb(a){return typeof a=="number"&&a==Re(a)}function cl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=P}function pt(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function gt(a){return a!=null&&typeof a=="object"}var Pb=Xm?Mn(Xm):OT;function AA(a,c){return a===c||od(a,c,xd(c))}function kA(a,c,p){return p=typeof p=="function"?p:t,od(a,c,xd(c),p)}function NA(a){return Bb(a)&&a!=+a}function OA(a){if(hM(a))throw new ke(r);return Ag(a)}function RA(a){return a===null}function IA(a){return a==null}function Bb(a){return typeof a=="number"||gt(a)&&an(a)==Zt}function Ns(a){if(!gt(a)||an(a)!=Nt)return!1;var c=Pa(a);if(c===null)return!0;var p=et.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Ra.call(p)==k1}var Id=Zm?Mn(Zm):RT;function DA(a){return Lb(a)&&a>=-P&&a<=P}var Fb=jm?Mn(jm):IT;function ul(a){return typeof a=="string"||!Ne(a)&>(a)&&an(a)==Ae}function An(a){return typeof a=="symbol"||gt(a)&&an(a)==We}var Oo=Qm?Mn(Qm):DT;function LA(a){return a===t}function PA(a){return gt(a)&&Qt(a)==mt}function BA(a){return gt(a)&&an(a)==Ot}var FA=el(ad),HA=el(function(a,c){return a<=c});function Hb(a){if(!a)return[];if(yn(a))return ul(a)?Zn(a):bn(a);if(bs&&a[bs])return b1(a[bs]());var c=Qt(a),p=c==st?Yu:c==ee?ka:Ro;return p(a)}function Or(a){if(!a)return a===0?a:0;if(a=Hn(a),a===xe||a===-xe){var c=a<0?-1:1;return c*N}return a===a?a:0}function Re(a){var c=Or(a),p=c%1;return c===c?p?c-p:c:0}function zb(a){return a?Ii(Re(a),0,K):0}function Hn(a){if(typeof a=="number")return a;if(An(a))return R;if(pt(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=pt(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=og(a);var p=vS.test(a);return p||xS.test(a)?e1(a.slice(2),p?2:8):ES.test(a)?R:+a}function Ub(a){return dr(a,En(a))}function zA(a){return a?Ii(Re(a),-P,P):a===0?a:0}function je(a){return a==null?"":Cn(a)}var UA=Ao(function(a,c){if(As(c)||yn(c)){dr(c,Ht(c),a);return}for(var p in c)et.call(c,p)&&xs(a,p,c[p])}),$b=Ao(function(a,c){dr(c,En(c),a)}),dl=Ao(function(a,c,p,g){dr(c,En(c),a,g)}),$A=Ao(function(a,c,p,g){dr(c,Ht(c),a,g)}),WA=Ar(ed);function KA(a,c){var p=Co(a);return c==null?p:vg(p,c)}var VA=Fe(function(a,c){a=nt(a);var p=-1,g=c.length,E=g>2?c[2]:t;for(E&&ln(c[0],c[1],E)&&(g=1);++p1),_}),dr(a,vd(a),p),g&&(p=Pn(p,d|f|h,nM));for(var E=c.length;E--;)fd(p,c[E]);return p});function ck(a,c){return Kb(a,ll(be(c)))}var uk=Ar(function(a,c){return a==null?{}:BT(a,c)});function Kb(a,c){if(a==null)return{};var p=ut(vd(a),function(g){return[g]});return c=be(c),Lg(a,p,function(g,E){return c(g,E[0])})}function dk(a,c,p){c=ri(c,a);var g=-1,E=c.length;for(E||(E=1,a=t);++gc){var g=a;a=c,c=g}if(p||a%1||c%1){var E=gg();return jt(a+E*(c-a+QS("1e-"+((E+"").length-1))),c)}return cd(a,c)}var xk=ko(function(a,c,p){return c=c.toLowerCase(),a+(p?qb(c):c)});function qb(a){return Pd(je(a).toLowerCase())}function Yb(a){return a=je(a),a&&a.replace(SS,f1).replace(WS,"")}function _k(a,c,p){a=je(a),c=Cn(c);var g=a.length;p=p===t?g:Ii(Re(p),0,g);var E=p;return p-=c.length,p>=0&&a.slice(p,E)==c}function Sk(a){return a=je(a),a&&_a.test(a)?a.replace(sn,p1):a}function Tk(a){return a=je(a),a&&uS.test(a)?a.replace(Jr,"\\$&"):a}var Mk=ko(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),Ck=ko(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),Ak=Zg("toLowerCase");function kk(a,c,p){a=je(a),c=Re(c);var g=c?_o(a):0;if(!c||g>=c)return a;var E=(c-g)/2;return Qa(za(E),p)+a+Qa(Ha(E),p)}function Nk(a,c,p){a=je(a),c=Re(c);var g=c?_o(a):0;return c&&g>>0,p?(a=je(a),a&&(typeof c=="string"||c!=null&&!Id(c))&&(c=Cn(c),!c&&xo(a))?ii(Zn(a),0,p):a.split(c,p)):[]}var Bk=ko(function(a,c,p){return a+(p?" ":"")+Pd(c)});function Fk(a,c,p){return a=je(a),p=p==null?0:Ii(Re(p),0,a.length),c=Cn(c),a.slice(p,p+c.length)==c}function Hk(a,c,p){var g=v.templateSettings;p&&ln(a,c,p)&&(c=t),a=je(a),c=dl({},c,g,ib);var E=dl({},c.imports,g.imports,ib),_=Ht(E),T=qu(E,_),C,k,U=0,$=c.interpolate||Sa,G="__p += '",ne=Ju((c.escape||Sa).source+"|"+$.source+"|"+($===Ai?yS:Sa).source+"|"+(c.evaluate||Sa).source+"|$","g"),de="//# sourceURL="+(et.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++YS+"]")+` +`)}function dM(a){return Ne(a)||Bi(a)||!!(hg&&a&&a[hg])}function kr(a,c){var p=typeof a;return c=c??P,!!c&&(p=="number"||p!="symbol"&&_S.test(a))&&a>-1&&a%1==0&&a0){if(++c>=ue)return arguments[0]}else c=0;return a.apply(t,arguments)}}function rl(a,c){var p=-1,g=a.length,E=g-1;for(c=c===t?g:c;++p1?a[c-1]:t;return p=typeof p=="function"?(a.pop(),p):t,Sb(a,p)});function Tb(a){var c=v(a);return c.__chain__=!0,c}function xC(a,c){return c(a),a}function il(a,c){return c(a)}var _C=Ar(function(a){var c=a.length,p=c?a[0]:0,g=this.__wrapped__,E=function(_){return ed(_,a)};return c>1||this.__actions__.length||!(g instanceof Ke)||!kr(p)?this.thru(E):(g=g.slice(p,+p+(c?1:0)),g.__actions__.push({func:il,args:[E],thisArg:t}),new Dn(g,this.__chain__).thru(function(_){return c&&!_.length&&_.push(t),_}))});function SC(){return Tb(this)}function TC(){return new Dn(this.value(),this.__chain__)}function MC(){this.__values__===t&&(this.__values__=Hb(this.value()));var a=this.__index__>=this.__values__.length,c=a?t:this.__values__[this.__index__++];return{done:a,value:c}}function CC(){return this}function AC(a){for(var c,p=this;p instanceof Wa;){var g=yb(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 kC(){var a=this.__wrapped__;if(a instanceof Ke){var c=a;return this.__actions__.length&&(c=new Ke(this)),c=c.reverse(),c.__actions__.push({func:il,args:[Ad],thisArg:t}),new Dn(c,this.__chain__)}return this.thru(Ad)}function NC(){return Ug(this.__wrapped__,this.__actions__)}var OC=Xa(function(a,c,p){et.call(a,p)?++a[p]:Mr(a,p,1)});function RC(a,c,p){var g=Ne(a)?eg:xT;return p&&ln(a,c,p)&&(c=t),g(a,be(c,3))}function IC(a,c){var p=Ne(a)?Xr:Sg;return p(a,be(c,3))}var LC=jg(Eb),DC=jg(vb);function PC(a,c){return Gt(ol(a,c),1)}function BC(a,c){return Gt(ol(a,c),xe)}function FC(a,c,p){return p=p===t?1:Re(p),Gt(ol(a,c),p)}function Mb(a,c){var p=Ne(a)?In:ti;return p(a,be(c,3))}function Cb(a,c){var p=Ne(a)?r1:_g;return p(a,be(c,3))}var HC=Xa(function(a,c,p){et.call(a,p)?a[p].push(c):Mr(a,p,[c])});function zC(a,c,p,g){a=yn(a)?a:Ro(a),p=p&&!g?Re(p):0;var E=a.length;return p<0&&(p=It(E+p,0)),ul(a)?p<=E&&a.indexOf(c,p)>-1:!!E&&wo(a,c,p)>-1}var UC=Fe(function(a,c,p){var g=-1,E=typeof c=="function",_=yn(a)?I(a.length):[];return ti(a,function(T){_[++g]=E?Tn(c,T,p):Ss(T,c,p)}),_}),$C=Xa(function(a,c,p){Mr(a,p,c)});function ol(a,c){var p=Ne(a)?ut:Ng;return p(a,be(c,3))}function WC(a,c,p,g){return a==null?[]:(Ne(c)||(c=c==null?[]:[c]),p=g?t:p,Ne(p)||(p=p==null?[]:[p]),Lg(a,c,p))}var KC=Xa(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function VC(a,c,p){var g=Ne(a)?Uu:ig,E=arguments.length<3;return g(a,be(c,4),p,E,ti)}function GC(a,c,p){var g=Ne(a)?i1:ig,E=arguments.length<3;return g(a,be(c,4),p,E,_g)}function qC(a,c){var p=Ne(a)?Xr:Sg;return p(a,ll(be(c,3)))}function YC(a){var c=Ne(a)?Eg:zT;return c(a)}function JC(a,c,p){(p?ln(a,c,p):c===t)?c=1:c=Re(c);var g=Ne(a)?bT:UT;return g(a,c)}function XC(a){var c=Ne(a)?yT:WT;return c(a)}function ZC(a){if(a==null)return 0;if(yn(a))return ul(a)?_o(a):a.length;var c=Qt(a);return c==st||c==ee?a.size:sd(a).length}function jC(a,c,p){var g=Ne(a)?$u:KT;return p&&ln(a,c,p)&&(c=t),g(a,be(c,3))}var QC=Fe(function(a,c){if(a==null)return[];var p=c.length;return p>1&&ln(a,c[0],c[1])?c=[]:p>2&&ln(c[0],c[1],c[2])&&(c=[c[0]]),Lg(a,Gt(c,1),[])}),sl=I1||function(){return Ft.Date.now()};function eA(a,c){if(typeof c!="function")throw new Ln(i);return a=Re(a),function(){if(--a<1)return c.apply(this,arguments)}}function Ab(a,c,p){return c=p?t:c,c=a&&c==null?a.length:c,Cr(a,z,t,t,t,t,c)}function kb(a,c){var p;if(typeof c!="function")throw new Ln(i);return a=Re(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=t),p}}var Nd=Fe(function(a,c,p){var g=y;if(p.length){var E=jr(p,No(Nd));g|=L}return Cr(a,g,c,p,E)}),Nb=Fe(function(a,c,p){var g=y|w;if(p.length){var E=jr(p,No(Nb));g|=L}return Cr(c,g,a,p,E)});function Ob(a,c,p){c=p?t:c;var g=Cr(a,M,t,t,t,t,t,c);return g.placeholder=Ob.placeholder,g}function Rb(a,c,p){c=p?t:c;var g=Cr(a,D,t,t,t,t,t,c);return g.placeholder=Rb.placeholder,g}function Ib(a,c,p){var g,E,_,T,C,k,U=0,$=!1,G=!1,ne=!0;if(typeof a!="function")throw new Ln(i);c=Hn(c)||0,pt(p)&&($=!!p.leading,G="maxWait"in p,_=G?It(Hn(p.maxWait)||0,c):_,ne="trailing"in p?!!p.trailing:ne);function de(vt){var er=g,Rr=E;return g=E=t,U=vt,T=a.apply(Rr,er),T}function Ee(vt){return U=vt,C=ks(ze,c),$?de(vt):T}function De(vt){var er=vt-k,Rr=vt-U,jb=c-er;return G?jt(jb,_-Rr):jb}function ve(vt){var er=vt-k,Rr=vt-U;return k===t||er>=c||er<0||G&&Rr>=_}function ze(){var vt=sl();if(ve(vt))return Ge(vt);C=ks(ze,De(vt))}function Ge(vt){return C=t,ne&&g?de(vt):(g=E=t,T)}function kn(){C!==t&&Wg(C),U=0,g=k=E=C=t}function cn(){return C===t?T:Ge(sl())}function Nn(){var vt=sl(),er=ve(vt);if(g=arguments,E=this,k=vt,er){if(C===t)return Ee(k);if(G)return Wg(C),C=ks(ze,c),de(k)}return C===t&&(C=ks(ze,c)),T}return Nn.cancel=kn,Nn.flush=cn,Nn}var tA=Fe(function(a,c){return xg(a,1,c)}),nA=Fe(function(a,c,p){return xg(a,Hn(c)||0,p)});function rA(a){return Cr(a,q)}function al(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Ln(i);var p=function(){var g=arguments,E=c?c.apply(this,g):g[0],_=p.cache;if(_.has(E))return _.get(E);var T=a.apply(this,g);return p.cache=_.set(E,T)||_,T};return p.cache=new(al.Cache||Tr),p}al.Cache=Tr;function ll(a){if(typeof a!="function")throw new Ln(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 iA(a){return kb(2,a)}var oA=VT(function(a,c){c=c.length==1&&Ne(c[0])?ut(c[0],Mn(be())):ut(Gt(c,1),Mn(be()));var p=c.length;return Fe(function(g){for(var E=-1,_=jt(g.length,p);++E<_;)g[E]=c[E].call(this,g[E]);return Tn(a,this,g)})}),Od=Fe(function(a,c){var p=jr(c,No(Od));return Cr(a,L,t,c,p)}),Lb=Fe(function(a,c){var p=jr(c,No(Lb));return Cr(a,S,t,c,p)}),sA=Ar(function(a,c){return Cr(a,O,t,t,t,c)});function aA(a,c){if(typeof a!="function")throw new Ln(i);return c=c===t?c:Re(c),Fe(a,c)}function lA(a,c){if(typeof a!="function")throw new Ln(i);return c=c==null?0:It(Re(c),0),Fe(function(p){var g=p[c],E=ii(p,0,c);return g&&Zr(E,g),Tn(a,this,E)})}function cA(a,c,p){var g=!0,E=!0;if(typeof a!="function")throw new Ln(i);return pt(p)&&(g="leading"in p?!!p.leading:g,E="trailing"in p?!!p.trailing:E),Ib(a,c,{leading:g,maxWait:c,trailing:E})}function uA(a){return Ab(a,1)}function dA(a,c){return Od(md(c),a)}function fA(){if(!arguments.length)return[];var a=arguments[0];return Ne(a)?a:[a]}function pA(a){return Pn(a,h)}function hA(a,c){return c=typeof c=="function"?c:t,Pn(a,h,c)}function mA(a){return Pn(a,d|h)}function gA(a,c){return c=typeof c=="function"?c:t,Pn(a,d|h,c)}function bA(a,c){return c==null||wg(a,c,Ht(c))}function Qn(a,c){return a===c||a!==a&&c!==c}var yA=el(rd),EA=el(function(a,c){return a>=c}),Bi=Cg(function(){return arguments}())?Cg:function(a){return gt(a)&&et.call(a,"callee")&&!pg.call(a,"callee")},Ne=I.isArray,vA=Ym?Mn(Ym):AT;function yn(a){return a!=null&&cl(a.length)&&!Nr(a)}function Et(a){return gt(a)&&yn(a)}function wA(a){return a===!0||a===!1||gt(a)&&an(a)==Je}var oi=D1||$d,xA=Jm?Mn(Jm):kT;function _A(a){return gt(a)&&a.nodeType===1&&!Ns(a)}function SA(a){if(a==null)return!0;if(yn(a)&&(Ne(a)||typeof a=="string"||typeof a.splice=="function"||oi(a)||Oo(a)||Bi(a)))return!a.length;var c=Qt(a);if(c==st||c==ee)return!a.size;if(As(a))return!sd(a).length;for(var p in a)if(et.call(a,p))return!1;return!0}function TA(a,c){return Ts(a,c)}function MA(a,c,p){p=typeof p=="function"?p:t;var g=p?p(a,c):t;return g===t?Ts(a,c,t,p):!!g}function Rd(a){if(!gt(a))return!1;var c=an(a);return c==Le||c==Pt||typeof a.message=="string"&&typeof a.name=="string"&&!Ns(a)}function CA(a){return typeof a=="number"&&mg(a)}function Nr(a){if(!pt(a))return!1;var c=an(a);return c==_t||c==Xt||c==He||c==me}function Db(a){return typeof a=="number"&&a==Re(a)}function cl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=P}function pt(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function gt(a){return a!=null&&typeof a=="object"}var Pb=Xm?Mn(Xm):OT;function AA(a,c){return a===c||od(a,c,xd(c))}function kA(a,c,p){return p=typeof p=="function"?p:t,od(a,c,xd(c),p)}function NA(a){return Bb(a)&&a!=+a}function OA(a){if(hM(a))throw new ke(r);return Ag(a)}function RA(a){return a===null}function IA(a){return a==null}function Bb(a){return typeof a=="number"||gt(a)&&an(a)==Zt}function Ns(a){if(!gt(a)||an(a)!=Nt)return!1;var c=Pa(a);if(c===null)return!0;var p=et.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Ra.call(p)==k1}var Id=Zm?Mn(Zm):RT;function LA(a){return Db(a)&&a>=-P&&a<=P}var Fb=jm?Mn(jm):IT;function ul(a){return typeof a=="string"||!Ne(a)&>(a)&&an(a)==Ae}function An(a){return typeof a=="symbol"||gt(a)&&an(a)==We}var Oo=Qm?Mn(Qm):LT;function DA(a){return a===t}function PA(a){return gt(a)&&Qt(a)==mt}function BA(a){return gt(a)&&an(a)==Ot}var FA=el(ad),HA=el(function(a,c){return a<=c});function Hb(a){if(!a)return[];if(yn(a))return ul(a)?Zn(a):bn(a);if(bs&&a[bs])return b1(a[bs]());var c=Qt(a),p=c==st?Yu:c==ee?ka:Ro;return p(a)}function Or(a){if(!a)return a===0?a:0;if(a=Hn(a),a===xe||a===-xe){var c=a<0?-1:1;return c*N}return a===a?a:0}function Re(a){var c=Or(a),p=c%1;return c===c?p?c-p:c:0}function zb(a){return a?Ii(Re(a),0,K):0}function Hn(a){if(typeof a=="number")return a;if(An(a))return R;if(pt(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=pt(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=og(a);var p=vS.test(a);return p||xS.test(a)?e1(a.slice(2),p?2:8):ES.test(a)?R:+a}function Ub(a){return dr(a,En(a))}function zA(a){return a?Ii(Re(a),-P,P):a===0?a:0}function je(a){return a==null?"":Cn(a)}var UA=Ao(function(a,c){if(As(c)||yn(c)){dr(c,Ht(c),a);return}for(var p in c)et.call(c,p)&&xs(a,p,c[p])}),$b=Ao(function(a,c){dr(c,En(c),a)}),dl=Ao(function(a,c,p,g){dr(c,En(c),a,g)}),$A=Ao(function(a,c,p,g){dr(c,Ht(c),a,g)}),WA=Ar(ed);function KA(a,c){var p=Co(a);return c==null?p:vg(p,c)}var VA=Fe(function(a,c){a=nt(a);var p=-1,g=c.length,E=g>2?c[2]:t;for(E&&ln(c[0],c[1],E)&&(g=1);++p1),_}),dr(a,vd(a),p),g&&(p=Pn(p,d|f|h,nM));for(var E=c.length;E--;)fd(p,c[E]);return p});function ck(a,c){return Kb(a,ll(be(c)))}var uk=Ar(function(a,c){return a==null?{}:BT(a,c)});function Kb(a,c){if(a==null)return{};var p=ut(vd(a),function(g){return[g]});return c=be(c),Dg(a,p,function(g,E){return c(g,E[0])})}function dk(a,c,p){c=ri(c,a);var g=-1,E=c.length;for(E||(E=1,a=t);++gc){var g=a;a=c,c=g}if(p||a%1||c%1){var E=gg();return jt(a+E*(c-a+QS("1e-"+((E+"").length-1))),c)}return cd(a,c)}var xk=ko(function(a,c,p){return c=c.toLowerCase(),a+(p?qb(c):c)});function qb(a){return Pd(je(a).toLowerCase())}function Yb(a){return a=je(a),a&&a.replace(SS,f1).replace(WS,"")}function _k(a,c,p){a=je(a),c=Cn(c);var g=a.length;p=p===t?g:Ii(Re(p),0,g);var E=p;return p-=c.length,p>=0&&a.slice(p,E)==c}function Sk(a){return a=je(a),a&&_a.test(a)?a.replace(sn,p1):a}function Tk(a){return a=je(a),a&&uS.test(a)?a.replace(Jr,"\\$&"):a}var Mk=ko(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),Ck=ko(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),Ak=Zg("toLowerCase");function kk(a,c,p){a=je(a),c=Re(c);var g=c?_o(a):0;if(!c||g>=c)return a;var E=(c-g)/2;return Qa(za(E),p)+a+Qa(Ha(E),p)}function Nk(a,c,p){a=je(a),c=Re(c);var g=c?_o(a):0;return c&&g>>0,p?(a=je(a),a&&(typeof c=="string"||c!=null&&!Id(c))&&(c=Cn(c),!c&&xo(a))?ii(Zn(a),0,p):a.split(c,p)):[]}var Bk=ko(function(a,c,p){return a+(p?" ":"")+Pd(c)});function Fk(a,c,p){return a=je(a),p=p==null?0:Ii(Re(p),0,a.length),c=Cn(c),a.slice(p,p+c.length)==c}function Hk(a,c,p){var g=v.templateSettings;p&&ln(a,c,p)&&(c=t),a=je(a),c=dl({},c,g,ib);var E=dl({},c.imports,g.imports,ib),_=Ht(E),T=qu(E,_),C,k,U=0,$=c.interpolate||Sa,G="__p += '",ne=Ju((c.escape||Sa).source+"|"+$.source+"|"+($===Ai?yS:Sa).source+"|"+(c.evaluate||Sa).source+"|$","g"),de="//# sourceURL="+(et.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++YS+"]")+` `;a.replace(ne,function(ve,ze,Ge,kn,cn,Nn){return Ge||(Ge=kn),G+=a.slice(U,Nn).replace(TS,h1),ze&&(C=!0,G+=`' + __e(`+ze+`) + '`),cn&&(k=!0,G+=`'; @@ -18,18 +18,18 @@ __p += '`),Ge&&(G+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+G+`return __p -}`;var Le=Xb(function(){return Ze(_,de+"return "+G).apply(t,T)});if(Le.source=G,Rd(Le))throw Le;return Le}function zk(a){return je(a).toLowerCase()}function Uk(a){return je(a).toUpperCase()}function $k(a,c,p){if(a=je(a),a&&(p||c===t))return og(a);if(!a||!(c=Cn(c)))return a;var g=Zn(a),E=Zn(c),_=sg(g,E),T=ag(g,E)+1;return ii(g,_,T).join("")}function Wk(a,c,p){if(a=je(a),a&&(p||c===t))return a.slice(0,cg(a)+1);if(!a||!(c=Cn(c)))return a;var g=Zn(a),E=ag(g,Zn(c))+1;return ii(g,0,E).join("")}function Kk(a,c,p){if(a=je(a),a&&(p||c===t))return a.replace(Ru,"");if(!a||!(c=Cn(c)))return a;var g=Zn(a),E=sg(g,Zn(c));return ii(g,E).join("")}function Vk(a,c){var p=J,g=W;if(pt(c)){var E="separator"in c?c.separator:E;p="length"in c?Re(c.length):p,g="omission"in c?Cn(c.omission):g}a=je(a);var _=a.length;if(xo(a)){var T=Zn(a);_=T.length}if(p>=_)return a;var C=p-_o(g);if(C<1)return g;var k=T?ii(T,0,C).join(""):a.slice(0,C);if(E===t)return k+g;if(T&&(C+=k.length-C),Id(E)){if(a.slice(C).search(E)){var U,$=k;for(E.global||(E=Ju(E.source,je(Cm.exec(E))+"g")),E.lastIndex=0;U=E.exec($);)var G=U.index;k=k.slice(0,G===t?C:G)}}else if(a.indexOf(Cn(E),C)!=C){var ne=k.lastIndexOf(E);ne>-1&&(k=k.slice(0,ne))}return k+g}function Gk(a){return a=je(a),a&&qr.test(a)?a.replace(Bt,w1):a}var qk=ko(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Pd=Zg("toUpperCase");function Jb(a,c,p){return a=je(a),c=p?t:c,c===t?g1(a)?S1(a):a1(a):a.match(c)||[]}var Xb=Fe(function(a,c){try{return Tn(a,t,c)}catch(p){return Rd(p)?p:new ke(p)}}),Yk=Ar(function(a,c){return In(c,function(p){p=fr(p),Mr(a,p,Nd(a[p],a))}),a});function Jk(a){var c=a==null?0:a.length,p=be();return a=c?ut(a,function(g){if(typeof g[1]!="function")throw new Dn(i);return[p(g[0]),g[1]]}):[],Fe(function(g){for(var E=-1;++EP)return[];var p=K,g=jt(a,K);c=be(c),a-=K;for(var E=Gu(g,c);++p0||c<0)?new Ke(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==t&&(c=Re(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Ke.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ke.prototype.toArray=function(){return this.take(K)},ur(Ke.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],_=g||/^find/.test(c);E&&(v.prototype[c]=function(){var T=this.__wrapped__,C=g?[1]:arguments,k=T instanceof Ke,U=C[0],$=k||Ne(T),G=function(ze){var Ge=E.apply(v,Zr([ze],C));return g&&ne?Ge[0]:Ge};$&&p&&typeof U=="function"&&U.length!=1&&(k=$=!1);var ne=this.__chain__,de=!!this.__actions__.length,Ee=_&&!ne,Le=k&&!de;if(!_&&$){T=Le?T:new Ke(this);var ve=a.apply(T,C);return ve.__actions__.push({func:il,args:[G],thisArg:t}),new Ln(ve,ne)}return Ee&&Le?a.apply(this,C):(ve=this.thru(G),Ee?g?ve.value()[0]:ve.value():ve)})}),In(["pop","push","shift","sort","splice","unshift"],function(a){var c=Na[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 _=this.value();return c.apply(Ne(_)?_:[],E)}return this[p](function(T){return c.apply(Ne(T)?T:[],E)})}}),ur(Ke.prototype,function(a,c){var p=v[c];if(p){var g=p.name+"";et.call(Mo,g)||(Mo[g]=[]),Mo[g].push({name:c,func:p})}}),Mo[Za(t,w).name]=[{name:"wrapper",func:t}],Ke.prototype.clone=G1,Ke.prototype.reverse=q1,Ke.prototype.value=Y1,v.prototype.at=_C,v.prototype.chain=SC,v.prototype.commit=TC,v.prototype.next=MC,v.prototype.plant=AC,v.prototype.reverse=kC,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=NC,v.prototype.first=v.prototype.head,bs&&(v.prototype[bs]=CC),v},Qr=T1();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ft._=Qr,define(function(){return Qr})):ki?((ki.exports=Qr)._=Qr,Fu._=Qr):Ft._=Qr}).call(ps)});function en(t){this.content=t}en.prototype={constructor:en,find:function(t){for(var e=0;e>1}};en.from=function(t){if(t instanceof en)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new en(e)};var Gd=en;function oy(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=oy(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function sy(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(;de&&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)=>{l.isText?(o+=l.text.slice(Math.max(e,u)-u,n-u),s=!r):l.isLeaf?(i?o+=typeof i=="function"?i(l):i:l.type.spec.leafText&&(o+=l.type.spec.leafText(l)),s=!r):!s&&l.isBlock&&(o+=r,s=!0)},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);oe)for(let o=0,s=0;se&&((sn)&&(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;nthis.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?fl(r+1,s):fl(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;ithis.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;nr.type.rank-i.type.rank),n}};Ye.none=[];var zi=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=ly(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(ay(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(V.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(V.empty,0,0);function ay(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(ay(o.content,e-i-1,n-i-1)))}function ly(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=ly(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function zN(t,e,n){if(n.openStart>t.depth)throw new zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new zi("Inconsistent open depths");return cy(t,e,n,0)}function cy(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Os(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;li&&Zd(t,e,i+1),s=r.depth>i&&Zd(n,r,i+1),l=[];return Os(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(uy(o,s),Fi(Hi(o,dy(t,e,n,r,i+1)),l)):(o&&Fi(Hi(o,hl(t,e,i+1)),l),Os(e,n,i,l),s&&Fi(Hi(s,hl(n,r,i+1)),l)),Os(r,null,i,l),new V(l)}function hl(t,e,n){let r=[];if(Os(null,t,n,r),t.depth>n){let i=Zd(t,e,n+1);Fi(Hi(i,hl(t,e,n+1)),r)}return Os(e,null,n,r),new V(r)}function UN(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(V.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var ml=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;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ui(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=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){for(let i=0;ie&&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()+")"),fy(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=V.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;un.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=null;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=V.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};tr.prototype.text=void 0;var jd=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):fy(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 fy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var $i=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Qd(e,n);if(r.next==null)return t.empty;let i=py(r);r.next&&r.err("Unexpected trailing text");let o=XN(JN(i));return ZN(o,r),o}matchType(e){for(let n=0;nd.createAndFill()));for(let d=0;d=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{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +}`;var De=Xb(function(){return Ze(_,de+"return "+G).apply(t,T)});if(De.source=G,Rd(De))throw De;return De}function zk(a){return je(a).toLowerCase()}function Uk(a){return je(a).toUpperCase()}function $k(a,c,p){if(a=je(a),a&&(p||c===t))return og(a);if(!a||!(c=Cn(c)))return a;var g=Zn(a),E=Zn(c),_=sg(g,E),T=ag(g,E)+1;return ii(g,_,T).join("")}function Wk(a,c,p){if(a=je(a),a&&(p||c===t))return a.slice(0,cg(a)+1);if(!a||!(c=Cn(c)))return a;var g=Zn(a),E=ag(g,Zn(c))+1;return ii(g,0,E).join("")}function Kk(a,c,p){if(a=je(a),a&&(p||c===t))return a.replace(Ru,"");if(!a||!(c=Cn(c)))return a;var g=Zn(a),E=sg(g,Zn(c));return ii(g,E).join("")}function Vk(a,c){var p=J,g=W;if(pt(c)){var E="separator"in c?c.separator:E;p="length"in c?Re(c.length):p,g="omission"in c?Cn(c.omission):g}a=je(a);var _=a.length;if(xo(a)){var T=Zn(a);_=T.length}if(p>=_)return a;var C=p-_o(g);if(C<1)return g;var k=T?ii(T,0,C).join(""):a.slice(0,C);if(E===t)return k+g;if(T&&(C+=k.length-C),Id(E)){if(a.slice(C).search(E)){var U,$=k;for(E.global||(E=Ju(E.source,je(Cm.exec(E))+"g")),E.lastIndex=0;U=E.exec($);)var G=U.index;k=k.slice(0,G===t?C:G)}}else if(a.indexOf(Cn(E),C)!=C){var ne=k.lastIndexOf(E);ne>-1&&(k=k.slice(0,ne))}return k+g}function Gk(a){return a=je(a),a&&qr.test(a)?a.replace(Bt,w1):a}var qk=ko(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Pd=Zg("toUpperCase");function Jb(a,c,p){return a=je(a),c=p?t:c,c===t?g1(a)?S1(a):a1(a):a.match(c)||[]}var Xb=Fe(function(a,c){try{return Tn(a,t,c)}catch(p){return Rd(p)?p:new ke(p)}}),Yk=Ar(function(a,c){return In(c,function(p){p=fr(p),Mr(a,p,Nd(a[p],a))}),a});function Jk(a){var c=a==null?0:a.length,p=be();return a=c?ut(a,function(g){if(typeof g[1]!="function")throw new Ln(i);return[p(g[0]),g[1]]}):[],Fe(function(g){for(var E=-1;++EP)return[];var p=K,g=jt(a,K);c=be(c),a-=K;for(var E=Gu(g,c);++p0||c<0)?new Ke(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==t&&(c=Re(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Ke.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ke.prototype.toArray=function(){return this.take(K)},ur(Ke.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],_=g||/^find/.test(c);E&&(v.prototype[c]=function(){var T=this.__wrapped__,C=g?[1]:arguments,k=T instanceof Ke,U=C[0],$=k||Ne(T),G=function(ze){var Ge=E.apply(v,Zr([ze],C));return g&&ne?Ge[0]:Ge};$&&p&&typeof U=="function"&&U.length!=1&&(k=$=!1);var ne=this.__chain__,de=!!this.__actions__.length,Ee=_&&!ne,De=k&&!de;if(!_&&$){T=De?T:new Ke(this);var ve=a.apply(T,C);return ve.__actions__.push({func:il,args:[G],thisArg:t}),new Dn(ve,ne)}return Ee&&De?a.apply(this,C):(ve=this.thru(G),Ee?g?ve.value()[0]:ve.value():ve)})}),In(["pop","push","shift","sort","splice","unshift"],function(a){var c=Na[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 _=this.value();return c.apply(Ne(_)?_:[],E)}return this[p](function(T){return c.apply(Ne(T)?T:[],E)})}}),ur(Ke.prototype,function(a,c){var p=v[c];if(p){var g=p.name+"";et.call(Mo,g)||(Mo[g]=[]),Mo[g].push({name:c,func:p})}}),Mo[Za(t,w).name]=[{name:"wrapper",func:t}],Ke.prototype.clone=G1,Ke.prototype.reverse=q1,Ke.prototype.value=Y1,v.prototype.at=_C,v.prototype.chain=SC,v.prototype.commit=TC,v.prototype.next=MC,v.prototype.plant=AC,v.prototype.reverse=kC,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=NC,v.prototype.first=v.prototype.head,bs&&(v.prototype[bs]=CC),v},Qr=T1();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ft._=Qr,define(function(){return Qr})):ki?((ki.exports=Qr)._=Qr,Fu._=Qr):Ft._=Qr}).call(ps)});function en(t){this.content=t}en.prototype={constructor:en,find:function(t){for(var e=0;e>1}};en.from=function(t){if(t instanceof en)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new en(e)};var Gd=en;function oy(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=oy(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function sy(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(;de&&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)=>{l.isText?(o+=l.text.slice(Math.max(e,u)-u,n-u),s=!r):l.isLeaf?(i?o+=typeof i=="function"?i(l):i:l.type.spec.leafText&&(o+=l.type.spec.leafText(l)),s=!r):!s&&l.isBlock&&(o+=r,s=!0)},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);oe)for(let o=0,s=0;se&&((sn)&&(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;nthis.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?fl(r+1,s):fl(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;ithis.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;nr.type.rank-i.type.rank),n}};Ye.none=[];var zi=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=ly(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(ay(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(V.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(V.empty,0,0);function ay(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(ay(o.content,e-i-1,n-i-1)))}function ly(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=ly(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function zN(t,e,n){if(n.openStart>t.depth)throw new zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new zi("Inconsistent open depths");return cy(t,e,n,0)}function cy(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Os(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;li&&Zd(t,e,i+1),s=r.depth>i&&Zd(n,r,i+1),l=[];return Os(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(uy(o,s),Fi(Hi(o,dy(t,e,n,r,i+1)),l)):(o&&Fi(Hi(o,hl(t,e,i+1)),l),Os(e,n,i,l),s&&Fi(Hi(s,hl(n,r,i+1)),l)),Os(r,null,i,l),new V(l)}function hl(t,e,n){let r=[];if(Os(null,t,n,r),t.depth>n){let i=Zd(t,e,n+1);Fi(Hi(i,hl(t,e,n+1)),r)}return Os(e,null,n,r),new V(r)}function UN(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(V.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var ml=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;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ui(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=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){for(let i=0;ie&&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()+")"),fy(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=V.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;un.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=null;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=V.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};tr.prototype.text=void 0;var jd=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):fy(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 fy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var $i=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Qd(e,n);if(r.next==null)return t.empty;let i=py(r);r.next&&r.err("Unexpected trailing text");let o=XN(JN(i));return ZN(o,r),o}matchType(e){for(let n=0;nd.createAndFill()));for(let d=0;d=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{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` `)}};$i.empty=new $i(!0);var Qd=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 py(t){let e=[];do e.push(KN(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function KN(t){let e=[];do e.push(VN(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function VN(t){let e=YN(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=GN(t,e);else break;return e}function Qb(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function GN(t,e){let n=Qb(t),r=n;return t.eat(",")&&(t.next!="}"?r=Qb(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function qN(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 YN(t){if(t.eat("(")){let e=py(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=qN(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 JN(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{t[s].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let f=0;f{d||i.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let o=e[r.join(",")]=new $i(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[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}},ef=class{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}},Is=class t{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=by(i.attrs),this.excluded=null;let o=my(this.attrs);this.instance=o?new Ye(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ye(this,gy(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-1}},bl=class{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Gd.from(e.nodes),n.marks=Gd.from(e.marks||{}),this.nodes=gl.compile(this.spec.nodes,this),this.marks=Is.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;o.contentMatch=r[s]||(r[s]=$i.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=l=="_"?null:l?ty(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==""?[]:ty(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 gl){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 jd(r,r.defaultAttrs,e,Ye.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 Ye.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function ty(t,e){let n=[];for(let r=0;r-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var Wi=class t{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new vl(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new vl(this,n,!0);return r.addAll(e,n.from,n.to),Z.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.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{r(s=ry(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=ry(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)))}},yy={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},jN={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ey={ol:!0,ul:!0},yl=1,El=2,Rs=4;function ny(t,e,n){return e!=null?(e?yl:0)|(e==="full"?El:0):t&&t.whitespace=="pre"?yl|El:n&~Rs}var Io=class{constructor(e,n,r,i,o,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=Ye.none,this.stashMarks=[],this.match=s||(l&Rs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(V.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&yl)){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=V.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(l),this.needsBlock=u}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=Ye.none,r=Ye.none;for(let i=0;i{s.clearMark(l)&&(r=l.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u));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)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.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-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}}addPendingMark(e){let n=rO(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}};function QN(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ey.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 tO(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function ry(t){let e={};for(let n in t)e[n]=t[n];return e}function nO(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{if(o.length||s.marks.length){let l=0,u=0;for(;l=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&&t.renderSpec(Xd(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),u=n[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let f in u)if(u[f]!=null){let h=f.indexOf(" ");h>0?l.setAttributeNS(f.slice(0,h),f.slice(h+1),u[f]):l.setAttribute(f,u[f])}}for(let f=d;fd)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:b}=t.renderSpec(e,h,r);if(l.appendChild(m),b){if(s)throw new RangeError("Multiple content holes");s=b}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=iy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return iy(e.marks)}};function iy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Xd(t){return t.document||window.document}var xy=65535,_y=Math.pow(2,16);function iO(t,e){return t+e*_y}function vy(t){return t&xy}function oO(t){return(t-(t&xy))/_y}var Sy=1,Ty=2,wl=4,My=8,Ps=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&My)>0}get deletedBefore(){return(this.delInfo&(Sy|wl))>0}get deletedAfter(){return(this.delInfo&(Ty|wl))>0}get deletedAcross(){return(this.delInfo&wl)>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=vy(e);if(!this.inverted)for(let i=0;ie)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,b=u+i+(m<0?0:f);if(r)return b;let y=e==(n<0?u:h)?null:iO(l/3,e-u),w=e==u?Ty:e==h?Sy:wl;return(n<0?e!=u:e!=h)&&(w|=My),new Ps(b,w,y)}i+=f-d}return r?e+i:new Ps(e+i,0,null)}touches(e,n){let r=0,i=vy(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)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=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;ro&&u!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return qt.fromReplace(e,this.from,this.to,o)}invert(){return new Ki(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))}};zt.jsonID("addMark",Fs);var Ki=class t extends zt{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(af(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return qt.fromReplace(e,this.from,this.to,r)}invert(){return new Fs(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))}};zt.jsonID("removeMark",Ki);var Hs=class t extends zt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return qt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return qt.fromReplace(e,this.pos,this.pos+1,new Z(V.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;ir.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)}};zt.jsonID("replaceAround",Tt);function of(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),b=Math.min(d+u.nodeSize,n),y=r.addToSet(h);for(let w=0;wt.step(u)),o.forEach(u=>t.step(u))}function aO(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 Is){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;ft.step(new Ki(s.from,s.to,s.style)))}function lO(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)t.step(o[l])}function cO(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Lr(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(rn;y--)w||r.index(y)>0?(w=!0,f=V.from(r.node(y).copy(f)),h++):u--;let m=V.empty,b=0;for(let y=o,w=!1;y>n;y--)w||i.after(y+1)=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=V.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Tt(i,o,i,o,new Z(r,0,0),n.length,!0))}function hO(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)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&mO(t.doc,t.mapping.slice(o).map(l),r)){t.clearIncompatible(t.mapping.slice(o).map(l,1),r);let u=t.mapping.slice(o),d=u.map(l,1),f=u.map(l+s.nodeSize,1);return t.step(new Tt(d,f,d+1,f-1,new Z(V.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function mO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function gO(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 Tt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Z(V.from(s),0,0),1,!0))}function zn(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 b=h.content.cutByIndex(m,h.childCount),y=r&&r[f+1];y&&(b=b.replaceChild(0,y.type.create(y.attrs)));let w=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!w.type.validContent(b))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 bO(t,e,n=1,r){let i=t.doc.resolve(e),o=V.empty,s=V.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){o=V.from(i.node(l).copy(o));let f=r&&r[d];s=V.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new dn(e,e,new Z(o.append(s),n,n),!0))}function nr(t,e){let n=t.resolve(e),r=n.index();return Cy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Cy(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&&Cy(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 yO(t,e,n){let r=new dn(e-n,e+n,Z.empty,!0);t.step(r)}function EO(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=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 Tl(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Ay(i,o,r)?new dn(e,n,r):new sf(i,o,r).fit()}function Ay(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var sf=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=V.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=V.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 Tt(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new dn(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(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=nf(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(V.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=nf(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=nf(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Z(Ds(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Ds(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;w1||u==0||w.content.size)&&(h=x,f.push(ky(w.mark(m.allowedMarks(w.marks)),d==1?u:0,d==l.childCount?b:-1)))}let y=d==l.childCount;y||(b=-1),this.placed=Ls(this.placed,n,V.from(f)),this.frontier[n].match=h,y&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,x=l;w1&&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=0;l--){let{match:u,type:d}=this.frontier[l],f=rf(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=Ls(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=Ls(this.placed,this.depth,V.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(V.empty,!0);n.childCount&&(this.placed=Ls(this.placed,this.frontier.length,n))}};function Ds(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ds(t.firstChild.content,e-1,n)))}function Ls(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ls(t.lastChild.content,e-1,n)))}function nf(t,e){for(let n=0;n1&&(r=r.replaceChild(0,ky(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(V.empty,!0)))),t.copy(r)}function rf(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&&!vO(n,o.content,s)?l:null}function vO(t,e,n){for(let r=n;r0;m--,b--){let y=i.node(m).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;s.indexOf(m)>-1?l=m:i.before(m)==b&&s.splice(1,0,-m)}let u=s.indexOf(l),d=[],f=r.openStart;for(let m=r.content,b=0;;b++){let y=m.firstChild;if(d.push(y),b==r.openStart)break;m=y.content}for(let m=f-1;m>=0;m--){let b=d[m],y=wO(b.type);if(y&&!b.sameMarkup(i.node(Math.abs(l)-1)))f=m;else if(y||!b.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let b=(m+f+1)%(r.openStart+1),y=d[b];if(y)for(let w=0;w=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let b=s[m];b<0||(e=i.before(b),n=o.after(b))}}function Ny(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(V.empty,!0))}return t}function _O(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=EO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(V.from(r),0,0))}function SO(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Oy(r,i);for(let s=0;s0&&(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 Oy(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.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 xl=class t extends zt{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 qt.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 qt.fromReplace(e,this.pos,this.pos+1,new Z(V.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)}};zt.jsonID("attr",xl);var _l=class t extends zt{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 qt.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)}};zt.jsonID("docAttr",_l);var Do=class extends Error{};Do=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Do.prototype=Object.create(Error.prototype);Do.prototype.constructor=Do;Do.prototype.name="TransformError";var si=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Bs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Do(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=Tl(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(V.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 xO(this,e,n,r),this}replaceRangeWith(e,n,r){return _O(this,e,n,r),this}deleteRange(e,n){return SO(this,e,n),this}lift(e,n){return uO(this,e,n),this}join(e,n=1){return yO(this,e,n),this}wrap(e,n){return pO(this,e,n),this}setBlockType(e,n=e,r,i=null){return hO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return gO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new xl(e,n,r)),this}setDocAttribute(e,n){return this.step(new _l(e,n)),this}addNodeMark(e,n){return this.step(new Hs(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ye)){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 zs(e,n)),this}split(e,n=1,r){return bO(this,e,n,r),this}addMark(e,n,r){return sO(this,e,n,r),this}removeMark(e,n,r){return aO(this,e,n,r),this}clearIncompatible(e,n,r){return lO(this,e,n,r),this}};var lf=Object.create(null),fe=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new $s(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=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 On(e.node(0))}static atStart(e){return Bo(e,e,0,0,1)||new On(e)}static atEnd(e){return Bo(e,e,e.content.size,e.childCount,-1)||new On(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=lf[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 lf)throw new RangeError("Duplicate use of selection JSON ID "+e);return lf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}};fe.prototype.visible=!0;var $s=class{constructor(e,n){this.$from=e,this.$to=n}},Ry=!1;function Iy(t){!Ry&&!t.parent.inlineContent&&(Ry=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var ce=class t extends fe{constructor(e,n=e){Iy(e),Iy(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 fe.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 Cl(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=fe.findFrom(n,r,!0)||fe.findFrom(n,-r,!0);if(o)n=o.$head;else return fe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(fe.findFrom(e,-r,!0)||fe.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&he.isSelectable(l))return he.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 Dy(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=f)}),t.setSelection(fe.near(t.doc.resolve(s),n))}var Ly=1,Ml=2,Py=4,df=class extends si{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ml,this}ensureMarks(e){return Ye.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)||Ye.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(fe.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|=Py,this}get scrolledIntoView(){return(this.updated&Py)>0}};function By(t,e){return!e||!t?t:t.bind(e)}var Vi=class{constructor(e,n,r){this.name=e,this.init=By(n.init,r),this.apply=By(n.apply,r)}},MO=[new Vi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Vi("selection",{init(t,e){return t.selection||fe.atStart(e.doc)},apply(t){return t.selection}}),new Vi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Vi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],Us=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=MO.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 Vi(r.key,r.spec.state,r))})}},Al=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;rr.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 Us(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=fe.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 Fy(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Fy(i,e,{})),n[r]=i}return n}var Pe=class{constructor(e){this.spec=e,this.props={},e.props&&Fy(e.props,this,this.props),this.key=e.key?e.key.key:Hy("plugin")}getState(e){return e[this.key]}},cf=Object.create(null);function Hy(t){return t in cf?t+"$"+ ++cf[t]:(cf[t]=0,t+"$")}var qe=class{constructor(e="key"){this.key=Hy(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var fn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Gs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},zy=null,Br=function(t,e,n){let r=zy||(zy=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},ji=function(t,e,n,r){return n&&(Uy(t,e,n,r,-1)||Uy(t,e,n,r,1))},CO=/^(img|br|input|textarea|hr)$/i;function Uy(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:pr(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Df(t)||CO.test(t.nodeName)||t.contentEditable=="false")return!1;e=fn(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?pr(t):0}else return!1}}function pr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function AO(t,e,n){for(let r=e==0,i=e==pr(t);r||i;){if(t==n)return!0;let o=fn(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==pr(t)}}function Df(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 Hl=function(t){return t.focusNode&&ji(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Gi(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function kO(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function NO(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}var hr=typeof navigator<"u"?navigator:null,$y=typeof document<"u"?document:null,fi=hr&&hr.userAgent||"",gf=/Edge\/(\d+)/.exec(fi),E0=/MSIE \d/.exec(fi),bf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fi),wn=!!(E0||bf||gf),ui=E0?document.documentMode:bf?+bf[1]:gf?+gf[1]:0,ir=!wn&&/gecko\/(\d+)/i.test(fi);ir&&+(/Firefox\/(\d+)/.exec(fi)||[0,0])[1];var yf=!wn&&/Chrome\/(\d+)/.exec(fi),nn=!!yf,OO=yf?+yf[1]:0,pn=!wn&&!!hr&&/Apple Computer/.test(hr.vendor),$o=pn&&(/Mobile\/\w+/.test(fi)||!!hr&&hr.maxTouchPoints>2),Un=$o||(hr?/Mac/.test(hr.platform):!1),RO=hr?/Win/.test(hr.platform):!1,rr=/Android \d/.test(fi),Xs=!!$y&&"webkitFontSmoothing"in $y.documentElement.style,IO=Xs?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function DO(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pr(t,e){return typeof t=="number"?t:t[e]}function LO(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 Wy(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=Gs(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,d=u?DO(o):LO(l),f=0,h=0;if(e.topd.bottom-Pr(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+Pr(i,"top")-d.top:e.bottom-d.bottom+Pr(i,"bottom")),e.leftd.right-Pr(r,"right")&&(f=e.right-d.right+Pr(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let m=l.scrollLeft,b=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let y=l.scrollLeft-m,w=l.scrollTop-b;e={left:e.left-y,top:e.top-w,right:e.right-y,bottom:e.bottom-w}}if(u||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function PO(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=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:v0(t.dom)}}function v0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Gs(r));return e}function BO({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;w0(n,r==0?0:r-e)}function w0(t,e){for(let n=0;n=l){s=Math.max(y.bottom,s),l=Math.min(y.top,l);let w=y.left>e.left?y.left-e.left:y.right=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!u&&y.left<=e.left&&y.right>=e.left&&(u=f,d={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?HO(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:x0(n,i)}function HO(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Lf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function zO(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function $O(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&&!s||!l.contentDOM)){let u=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,u.left>r.left||u.top>r.top?i=l.posBefore:(u.right-1?i:t.docView.posFromDOM(e,n,-1)}function _0(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let d;Xs&&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=$O(t,r,i,e))}l==null&&(l=UO(t,s,e));let u=t.docView.nearestDesc(s,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function Ky(t){return t.top=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,Ws(ai(Br(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==pr(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return ff(u.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==pr(r))){let u=r.childNodes[i-1],d=u.nodeType==3?Br(u,pr(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return Ws(ai(d,1),!1)}if(o==null&&i=0)}function Ws(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 ff(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 T0(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 VO(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return T0(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=S0(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=Br(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;df.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 GO=/[\u0590-\u08ac]/;function qO(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!GO.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:T0(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let b=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:y,focusOffset:w}=t.domSelectionRange(),x=y&&!b.contains(y.nodeType==1?y:y.parentNode)||u==y&&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),x})}var Vy=null,Gy=null,qy=!1;function YO(t,e,n){return Vy==e&&Gy==n?qy:(Vy=e,Gy=n,qy=n=="up"||n=="down"?VO(t,e,n):qO(t,e,n))}var $n=0,Yy=1,qi=2,mr=3,Qi=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=$n,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;nfn(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;ne||s instanceof Ol){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 kl&&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?fn(o.dom)+1:0}}else{let o,s=!0;for(;o=r=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=fn(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;fb&&sn){let b=l;l=u,u=b}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=r:er){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?qi:Yy,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=mr:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?qi:mr}r=s}this.dirty=qi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?qi:Yy;n.dirty{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==$n&&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}},Ef=class extends Qi{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}},Wo=class t extends Qi{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=Ir.renderSpec(document,n.type.spec.toDOM(n,r))),new t(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&mr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=mr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=$n){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Sf(o,0,e,r));for(let l=0;l{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}=Ir.renderSpec(document,n.type.spec.toDOM(n)));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=A0(f,r,n),d?u=new vf(e,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Nl(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=()=>V.empty)}return e}matchesNode(e,n,r){return this.dirty==$n&&e.eq(this.node)&&xf(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 _f(this,s&&s.node,e);jO(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?Ye.none:this.node.child(f).marks,r,e),u.placeWidget(d,e,i)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,e);let b;u.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>i&&e.state.selection.to-1&&u.updateNodeAt(d,f,h,b,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==qi)&&(s&&this.protectLocalComposition(e,s),M0(this.contentDOM,this.children,e),$o&&QO(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ce)||rn+this.node.content.size)return null;let o=e.domSelectionRange(),s=eR(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,u=tR(this.node.content,l,r-n,i-n);return u<0?null:{node:s,pos:u,text:l}}else return{node:s,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 Ef(this,o,n,i);e.input.compositionNodes.push(s),this.children=Sf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==mr||!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=$n}updateOuterDeco(e){if(xf(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=C0(this.dom,this.nodeDOM,wf(this.outerDeco,this.node,n),wf(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 Jy(t,e,n,r,i){A0(r,e,t);let o=new di(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Nl=class t extends di{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==mr||this.dirty!=$n&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=$n||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=$n,!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=mr)}get domAtom(){return!1}},Ol=class extends Qi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$n&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},vf=class extends di{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==mr)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 M0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Wo.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);l0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Wo)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 ZO(t,e){return t.type.side-e.type.side}function jO(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;do;)l.push(i[s++]);let y=o+m.nodeSize;if(m.isText){let x=y;s!x.inline):l.slice();r(m,w,e.forChild(o,m),b),o=y}}function QO(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 eR(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=pr(t)}else if(t.nodeType==1&&e=n){if(o>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l=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 Sf(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||f<=e?o.push(u):(dn&&o.push(u.slice(n-d,u.size,r)))}return o}function Pf(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(Hl(n)){for(u=l;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&he.isSelectable(f)&&i.parent&&!(f.isInline&&AO(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new he(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{(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 rR(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,fn(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&wn&&ui<=11&&(r.disabled=!0,r.disabled=!1)}function N0(t,e){if(e instanceof he){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(e0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else e0(t)}function e0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Bf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ce.between(e,n,r)}function t0(t){return t.editable&&!t.hasFocus()?!1:O0(t)}function O0(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 iR(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ji(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Tf(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&&fe.findFrom(o,e)}function li(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function n0(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 li(t,new ce(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Tf(t.state,e);return i&&i instanceof he?li(t,i):!1}else if(!(Un&&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?he.isSelectable(o)?li(t,new he(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Xs?li(t,new ce(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof he&&r.node.isInline)return li(t,new ce(e>0?r.$to:r.$from));{let i=Tf(t.state,e);return i?li(t,i):!1}}}function Rl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Vs(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ho(t,e){return e<0?oR(t):sR(t)}function oR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(ir&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Vs(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(R0(n))break;{let l=n.previousSibling;for(;l&&Vs(l,-1);)i=n.parentNode,o=fn(l),l=l.previousSibling;if(l)n=l,r=Rl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Mf(t,n,r):i&&Mf(t,i,o)}function sR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Rl(n),o,s;for(;;)if(r{t.state==i&&Fr(t)},50)}function r0(t,e){let n=t.state.doc.resolve(e);if(!(nn||RO)&&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&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function i0(t,e,n){let r=t.state.selection;if(r instanceof ce&&!r.empty||n.indexOf("s")>-1||Un&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Tf(t.state,e);if(s&&s instanceof he)return li(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof On?fe.near(s,e):fe.findFrom(s,e);return l?li(t,l):!1}return!1}function o0(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 s0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function cR(t){if(!pn||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;s0(t,r,"true"),setTimeout(()=>s0(t,r,"false"),20)}return!1}function uR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function dR(t,e){let n=e.keyCode,r=uR(e);if(n==8||Un&&n==72&&r=="c")return o0(t,-1)||Ho(t,-1);if(n==46&&!e.shiftKey||Un&&n==68&&r=="c")return o0(t,1)||Ho(t,1);if(n==13||n==27)return!0;if(n==37||Un&&n==66&&r=="c"){let i=n==37?r0(t,t.state.selection.from)=="ltr"?-1:1:-1;return n0(t,i,r)||Ho(t,i)}else if(n==39||Un&&n==70&&r=="c"){let i=n==39?r0(t,t.state.selection.from)=="ltr"?1:-1:1;return n0(t,i,r)||Ho(t,i)}else{if(n==38||Un&&n==80&&r=="c")return i0(t,-1,r)||Ho(t,-1);if(n==40||Un&&n==78&&r=="c")return cR(t)||i0(t,1,r)||Ho(t,1);if(r==(Un?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function I0(t,e){t.someProp("transformCopied",b=>{e=b(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 b=r.firstChild;n.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let s=t.someProp("clipboardSerializer")||Ir.fromSchema(t.state.schema),l=H0(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=F0[d.nodeName.toLowerCase()]);){for(let b=f.length-1;b>=0;b--){let y=l.createElement(f[b]);for(;u.firstChild;)y.appendChild(u.firstChild);u.appendChild(y),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",b=>b(e,t))||e.content.textBetween(0,e.content.size,` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=Ye.none,r=Ye.none;for(let i=0;i{s.clearMark(l)&&(r=l.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u));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)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.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-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}}addPendingMark(e){let n=rO(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}};function QN(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ey.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 tO(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function ry(t){let e={};for(let n in t)e[n]=t[n];return e}function nO(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{if(o.length||s.marks.length){let l=0,u=0;for(;l=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&&t.renderSpec(Xd(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),u=n[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let f in u)if(u[f]!=null){let h=f.indexOf(" ");h>0?l.setAttributeNS(f.slice(0,h),f.slice(h+1),u[f]):l.setAttribute(f,u[f])}}for(let f=d;fd)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:b}=t.renderSpec(e,h,r);if(l.appendChild(m),b){if(s)throw new RangeError("Multiple content holes");s=b}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=iy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return iy(e.marks)}};function iy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Xd(t){return t.document||window.document}var xy=65535,_y=Math.pow(2,16);function iO(t,e){return t+e*_y}function vy(t){return t&xy}function oO(t){return(t-(t&xy))/_y}var Sy=1,Ty=2,wl=4,My=8,Ps=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&My)>0}get deletedBefore(){return(this.delInfo&(Sy|wl))>0}get deletedAfter(){return(this.delInfo&(Ty|wl))>0}get deletedAcross(){return(this.delInfo&wl)>0}},Lr=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=vy(e);if(!this.inverted)for(let i=0;ie)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,b=u+i+(m<0?0:f);if(r)return b;let y=e==(n<0?u:h)?null:iO(l/3,e-u),w=e==u?Ty:e==h?Sy:wl;return(n<0?e!=u:e!=h)&&(w|=My),new Ps(b,w,y)}i+=f-d}return r?e+i:new Ps(e+i,0,null)}touches(e,n){let r=0,i=vy(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)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=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;ro&&u!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return qt.fromReplace(e,this.from,this.to,o)}invert(){return new Ki(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))}};zt.jsonID("addMark",Fs);var Ki=class t extends zt{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(af(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return qt.fromReplace(e,this.from,this.to,r)}invert(){return new Fs(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))}};zt.jsonID("removeMark",Ki);var Hs=class t extends zt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return qt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return qt.fromReplace(e,this.pos,this.pos+1,new Z(V.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;ir.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)}};zt.jsonID("replaceAround",Tt);function of(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),b=Math.min(d+u.nodeSize,n),y=r.addToSet(h);for(let w=0;wt.step(u)),o.forEach(u=>t.step(u))}function aO(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 Is){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;ft.step(new Ki(s.from,s.to,s.style)))}function lO(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)t.step(o[l])}function cO(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Dr(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(rn;y--)w||r.index(y)>0?(w=!0,f=V.from(r.node(y).copy(f)),h++):u--;let m=V.empty,b=0;for(let y=o,w=!1;y>n;y--)w||i.after(y+1)=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=V.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Tt(i,o,i,o,new Z(r,0,0),n.length,!0))}function hO(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)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&mO(t.doc,t.mapping.slice(o).map(l),r)){t.clearIncompatible(t.mapping.slice(o).map(l,1),r);let u=t.mapping.slice(o),d=u.map(l,1),f=u.map(l+s.nodeSize,1);return t.step(new Tt(d,f,d+1,f-1,new Z(V.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function mO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function gO(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 Tt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Z(V.from(s),0,0),1,!0))}function zn(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 b=h.content.cutByIndex(m,h.childCount),y=r&&r[f+1];y&&(b=b.replaceChild(0,y.type.create(y.attrs)));let w=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!w.type.validContent(b))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 bO(t,e,n=1,r){let i=t.doc.resolve(e),o=V.empty,s=V.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){o=V.from(i.node(l).copy(o));let f=r&&r[d];s=V.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new dn(e,e,new Z(o.append(s),n,n),!0))}function nr(t,e){let n=t.resolve(e),r=n.index();return Cy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Cy(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&&Cy(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 yO(t,e,n){let r=new dn(e-n,e+n,Z.empty,!0);t.step(r)}function EO(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=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 Tl(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Ay(i,o,r)?new dn(e,n,r):new sf(i,o,r).fit()}function Ay(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var sf=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=V.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=V.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 Tt(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new dn(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(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=nf(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(V.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=nf(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=nf(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Z(Ls(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Ls(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;w1||u==0||w.content.size)&&(h=x,f.push(ky(w.mark(m.allowedMarks(w.marks)),d==1?u:0,d==l.childCount?b:-1)))}let y=d==l.childCount;y||(b=-1),this.placed=Ds(this.placed,n,V.from(f)),this.frontier[n].match=h,y&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,x=l;w1&&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=0;l--){let{match:u,type:d}=this.frontier[l],f=rf(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=Ds(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=Ds(this.placed,this.depth,V.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(V.empty,!0);n.childCount&&(this.placed=Ds(this.placed,this.frontier.length,n))}};function Ls(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ls(t.firstChild.content,e-1,n)))}function Ds(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ds(t.lastChild.content,e-1,n)))}function nf(t,e){for(let n=0;n1&&(r=r.replaceChild(0,ky(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(V.empty,!0)))),t.copy(r)}function rf(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&&!vO(n,o.content,s)?l:null}function vO(t,e,n){for(let r=n;r0;m--,b--){let y=i.node(m).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;s.indexOf(m)>-1?l=m:i.before(m)==b&&s.splice(1,0,-m)}let u=s.indexOf(l),d=[],f=r.openStart;for(let m=r.content,b=0;;b++){let y=m.firstChild;if(d.push(y),b==r.openStart)break;m=y.content}for(let m=f-1;m>=0;m--){let b=d[m],y=wO(b.type);if(y&&!b.sameMarkup(i.node(Math.abs(l)-1)))f=m;else if(y||!b.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let b=(m+f+1)%(r.openStart+1),y=d[b];if(y)for(let w=0;w=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let b=s[m];b<0||(e=i.before(b),n=o.after(b))}}function Ny(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(V.empty,!0))}return t}function _O(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=EO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(V.from(r),0,0))}function SO(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Oy(r,i);for(let s=0;s0&&(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 Oy(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.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 xl=class t extends zt{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 qt.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 qt.fromReplace(e,this.pos,this.pos+1,new Z(V.from(i),0,n.isLeaf?0:1))}getMap(){return Lr.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)}};zt.jsonID("attr",xl);var _l=class t extends zt{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 qt.ok(r)}getMap(){return Lr.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)}};zt.jsonID("docAttr",_l);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 si=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Bs}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=Tl(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(V.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 xO(this,e,n,r),this}replaceRangeWith(e,n,r){return _O(this,e,n,r),this}deleteRange(e,n){return SO(this,e,n),this}lift(e,n){return uO(this,e,n),this}join(e,n=1){return yO(this,e,n),this}wrap(e,n){return pO(this,e,n),this}setBlockType(e,n=e,r,i=null){return hO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return gO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new xl(e,n,r)),this}setDocAttribute(e,n){return this.step(new _l(e,n)),this}addNodeMark(e,n){return this.step(new Hs(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ye)){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 zs(e,n)),this}split(e,n=1,r){return bO(this,e,n,r),this}addMark(e,n,r){return sO(this,e,n,r),this}removeMark(e,n,r){return aO(this,e,n,r),this}clearIncompatible(e,n,r){return lO(this,e,n,r),this}};var lf=Object.create(null),fe=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new $s(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=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 On(e.node(0))}static atStart(e){return Bo(e,e,0,0,1)||new On(e)}static atEnd(e){return Bo(e,e,e.content.size,e.childCount,-1)||new On(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=lf[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 lf)throw new RangeError("Duplicate use of selection JSON ID "+e);return lf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ce.between(this.$anchor,this.$head).getBookmark()}};fe.prototype.visible=!0;var $s=class{constructor(e,n){this.$from=e,this.$to=n}},Ry=!1;function Iy(t){!Ry&&!t.parent.inlineContent&&(Ry=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var ce=class t extends fe{constructor(e,n=e){Iy(e),Iy(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 fe.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 Cl(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=fe.findFrom(n,r,!0)||fe.findFrom(n,-r,!0);if(o)n=o.$head;else return fe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(fe.findFrom(e,-r,!0)||fe.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&he.isSelectable(l))return he.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 Ly(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=f)}),t.setSelection(fe.near(t.doc.resolve(s),n))}var Dy=1,Ml=2,Py=4,df=class extends si{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ml,this}ensureMarks(e){return Ye.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)||Ye.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(fe.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|=Py,this}get scrolledIntoView(){return(this.updated&Py)>0}};function By(t,e){return!e||!t?t:t.bind(e)}var Vi=class{constructor(e,n,r){this.name=e,this.init=By(n.init,r),this.apply=By(n.apply,r)}},MO=[new Vi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Vi("selection",{init(t,e){return t.selection||fe.atStart(e.doc)},apply(t){return t.selection}}),new Vi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Vi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],Us=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=MO.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 Vi(r.key,r.spec.state,r))})}},Al=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;rr.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 Us(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=fe.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 Fy(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Fy(i,e,{})),n[r]=i}return n}var Pe=class{constructor(e){this.spec=e,this.props={},e.props&&Fy(e.props,this,this.props),this.key=e.key?e.key.key:Hy("plugin")}getState(e){return e[this.key]}},cf=Object.create(null);function Hy(t){return t in cf?t+"$"+ ++cf[t]:(cf[t]=0,t+"$")}var qe=class{constructor(e="key"){this.key=Hy(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var fn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Gs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},zy=null,Br=function(t,e,n){let r=zy||(zy=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},ji=function(t,e,n,r){return n&&(Uy(t,e,n,r,-1)||Uy(t,e,n,r,1))},CO=/^(img|br|input|textarea|hr)$/i;function Uy(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:pr(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Lf(t)||CO.test(t.nodeName)||t.contentEditable=="false")return!1;e=fn(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?pr(t):0}else return!1}}function pr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function AO(t,e,n){for(let r=e==0,i=e==pr(t);r||i;){if(t==n)return!0;let o=fn(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==pr(t)}}function Lf(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 Hl=function(t){return t.focusNode&&ji(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Gi(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function kO(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function NO(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}var hr=typeof navigator<"u"?navigator:null,$y=typeof document<"u"?document:null,fi=hr&&hr.userAgent||"",gf=/Edge\/(\d+)/.exec(fi),E0=/MSIE \d/.exec(fi),bf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fi),wn=!!(E0||bf||gf),ui=E0?document.documentMode:bf?+bf[1]:gf?+gf[1]:0,ir=!wn&&/gecko\/(\d+)/i.test(fi);ir&&+(/Firefox\/(\d+)/.exec(fi)||[0,0])[1];var yf=!wn&&/Chrome\/(\d+)/.exec(fi),nn=!!yf,OO=yf?+yf[1]:0,pn=!wn&&!!hr&&/Apple Computer/.test(hr.vendor),$o=pn&&(/Mobile\/\w+/.test(fi)||!!hr&&hr.maxTouchPoints>2),Un=$o||(hr?/Mac/.test(hr.platform):!1),RO=hr?/Win/.test(hr.platform):!1,rr=/Android \d/.test(fi),Xs=!!$y&&"webkitFontSmoothing"in $y.documentElement.style,IO=Xs?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function LO(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pr(t,e){return typeof t=="number"?t:t[e]}function DO(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 Wy(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=Gs(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,d=u?LO(o):DO(l),f=0,h=0;if(e.topd.bottom-Pr(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+Pr(i,"top")-d.top:e.bottom-d.bottom+Pr(i,"bottom")),e.leftd.right-Pr(r,"right")&&(f=e.right-d.right+Pr(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let m=l.scrollLeft,b=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let y=l.scrollLeft-m,w=l.scrollTop-b;e={left:e.left-y,top:e.top-w,right:e.right-y,bottom:e.bottom-w}}if(u||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function PO(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=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:v0(t.dom)}}function v0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Gs(r));return e}function BO({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;w0(n,r==0?0:r-e)}function w0(t,e){for(let n=0;n=l){s=Math.max(y.bottom,s),l=Math.min(y.top,l);let w=y.left>e.left?y.left-e.left:y.right=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!u&&y.left<=e.left&&y.right>=e.left&&(u=f,d={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?HO(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:x0(n,i)}function HO(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Df(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function zO(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function $O(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&&!s||!l.contentDOM)){let u=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,u.left>r.left||u.top>r.top?i=l.posBefore:(u.right-1?i:t.docView.posFromDOM(e,n,-1)}function _0(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let d;Xs&&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=$O(t,r,i,e))}l==null&&(l=UO(t,s,e));let u=t.docView.nearestDesc(s,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function Ky(t){return t.top=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,Ws(ai(Br(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==pr(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return ff(u.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==pr(r))){let u=r.childNodes[i-1],d=u.nodeType==3?Br(u,pr(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return Ws(ai(d,1),!1)}if(o==null&&i=0)}function Ws(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 ff(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 T0(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 VO(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return T0(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=S0(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=Br(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;df.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 GO=/[\u0590-\u08ac]/;function qO(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!GO.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:T0(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let b=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:y,focusOffset:w}=t.domSelectionRange(),x=y&&!b.contains(y.nodeType==1?y:y.parentNode)||u==y&&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),x})}var Vy=null,Gy=null,qy=!1;function YO(t,e,n){return Vy==e&&Gy==n?qy:(Vy=e,Gy=n,qy=n=="up"||n=="down"?VO(t,e,n):qO(t,e,n))}var $n=0,Yy=1,qi=2,mr=3,Qi=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=$n,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;nfn(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;ne||s instanceof Ol){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 kl&&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?fn(o.dom)+1:0}}else{let o,s=!0;for(;o=r=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=fn(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;fb&&sn){let b=l;l=u,u=b}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=r:er){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?qi:Yy,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=mr:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?qi:mr}r=s}this.dirty=qi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?qi:Yy;n.dirty{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==$n&&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}},Ef=class extends Qi{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}},Wo=class t extends Qi{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=Ir.renderSpec(document,n.type.spec.toDOM(n,r))),new t(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&mr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=mr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=$n){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Sf(o,0,e,r));for(let l=0;l{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}=Ir.renderSpec(document,n.type.spec.toDOM(n)));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=A0(f,r,n),d?u=new vf(e,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Nl(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=()=>V.empty)}return e}matchesNode(e,n,r){return this.dirty==$n&&e.eq(this.node)&&xf(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 _f(this,s&&s.node,e);jO(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?Ye.none:this.node.child(f).marks,r,e),u.placeWidget(d,e,i)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,e);let b;u.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>i&&e.state.selection.to-1&&u.updateNodeAt(d,f,h,b,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==qi)&&(s&&this.protectLocalComposition(e,s),M0(this.contentDOM,this.children,e),$o&&QO(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ce)||rn+this.node.content.size)return null;let o=e.domSelectionRange(),s=eR(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,u=tR(this.node.content,l,r-n,i-n);return u<0?null:{node:s,pos:u,text:l}}else return{node:s,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 Ef(this,o,n,i);e.input.compositionNodes.push(s),this.children=Sf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==mr||!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=$n}updateOuterDeco(e){if(xf(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=C0(this.dom,this.nodeDOM,wf(this.outerDeco,this.node,n),wf(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 Jy(t,e,n,r,i){A0(r,e,t);let o=new di(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Nl=class t extends di{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==mr||this.dirty!=$n&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=$n||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=$n,!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=mr)}get domAtom(){return!1}},Ol=class extends Qi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$n&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},vf=class extends di{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==mr)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 M0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Wo.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);l0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Wo)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 ZO(t,e){return t.type.side-e.type.side}function jO(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;do;)l.push(i[s++]);let y=o+m.nodeSize;if(m.isText){let x=y;s!x.inline):l.slice();r(m,w,e.forChild(o,m),b),o=y}}function QO(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 eR(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=pr(t)}else if(t.nodeType==1&&e=n){if(o>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l=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 Sf(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||f<=e?o.push(u):(dn&&o.push(u.slice(n-d,u.size,r)))}return o}function Pf(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(Hl(n)){for(u=l;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&he.isSelectable(f)&&i.parent&&!(f.isInline&&AO(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new he(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{(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 rR(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,fn(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&wn&&ui<=11&&(r.disabled=!0,r.disabled=!1)}function N0(t,e){if(e instanceof he){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(e0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else e0(t)}function e0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Bf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ce.between(e,n,r)}function t0(t){return t.editable&&!t.hasFocus()?!1:O0(t)}function O0(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 iR(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ji(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Tf(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&&fe.findFrom(o,e)}function li(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function n0(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 li(t,new ce(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Tf(t.state,e);return i&&i instanceof he?li(t,i):!1}else if(!(Un&&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?he.isSelectable(o)?li(t,new he(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Xs?li(t,new ce(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof he&&r.node.isInline)return li(t,new ce(e>0?r.$to:r.$from));{let i=Tf(t.state,e);return i?li(t,i):!1}}}function Rl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Vs(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ho(t,e){return e<0?oR(t):sR(t)}function oR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(ir&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Vs(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(R0(n))break;{let l=n.previousSibling;for(;l&&Vs(l,-1);)i=n.parentNode,o=fn(l),l=l.previousSibling;if(l)n=l,r=Rl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Mf(t,n,r):i&&Mf(t,i,o)}function sR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Rl(n),o,s;for(;;)if(r{t.state==i&&Fr(t)},50)}function r0(t,e){let n=t.state.doc.resolve(e);if(!(nn||RO)&&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&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function i0(t,e,n){let r=t.state.selection;if(r instanceof ce&&!r.empty||n.indexOf("s")>-1||Un&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Tf(t.state,e);if(s&&s instanceof he)return li(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof On?fe.near(s,e):fe.findFrom(s,e);return l?li(t,l):!1}return!1}function o0(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 s0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function cR(t){if(!pn||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;s0(t,r,"true"),setTimeout(()=>s0(t,r,"false"),20)}return!1}function uR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function dR(t,e){let n=e.keyCode,r=uR(e);if(n==8||Un&&n==72&&r=="c")return o0(t,-1)||Ho(t,-1);if(n==46&&!e.shiftKey||Un&&n==68&&r=="c")return o0(t,1)||Ho(t,1);if(n==13||n==27)return!0;if(n==37||Un&&n==66&&r=="c"){let i=n==37?r0(t,t.state.selection.from)=="ltr"?-1:1:-1;return n0(t,i,r)||Ho(t,i)}else if(n==39||Un&&n==70&&r=="c"){let i=n==39?r0(t,t.state.selection.from)=="ltr"?1:-1:1;return n0(t,i,r)||Ho(t,i)}else{if(n==38||Un&&n==80&&r=="c")return i0(t,-1,r)||Ho(t,-1);if(n==40||Un&&n==78&&r=="c")return cR(t)||i0(t,1,r)||Ho(t,1);if(r==(Un?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function I0(t,e){t.someProp("transformCopied",b=>{e=b(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 b=r.firstChild;n.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let s=t.someProp("clipboardSerializer")||Ir.fromSchema(t.state.schema),l=H0(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=F0[d.nodeName.toLowerCase()]);){for(let b=f.length-1;b>=0;b--){let y=l.createElement(f[b]);for(;u.firstChild;)y.appendChild(u.firstChild);u.appendChild(y),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",b=>b(e,t))||e.content.textBetween(0,e.content.size,` -`);return{dom:u,text:m}}function D0(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(V.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:b}=t.state,y=Ir.fromSchema(b);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(w=>{let x=s.appendChild(document.createElement("p"));w&&x.appendChild(y.serializeNode(b.text(w,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),s=hR(n),Xs&&mR(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")||Wi.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!fR.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=gR(a0(l,+f[1],+f[2]),f[4]);else if(l=Z.maxOpen(pR(l.content,i),!0),l.openStart||l.openEnd){let h=0,m=0;for(let b=l.content.firstChild;h{l=h(l,t)}),l}var fR=/^(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 pR(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&&P0(u,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=B0(s[s.length-1],o.length));let f=L0(l,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return V.from(s)}return t}function L0(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,V.from(t));return t}function P0(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(V.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function a0(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=H0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&F0[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=V.from(u.create(r[l+1],i)),o++,s++}return new Z(i,o,s)}var hn={},mn={},bR={touchstart:!0,touchmove:!0},Af=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.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 yR(t){for(let e in hn){let n=hn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{vR(t,r)&&!Ff(t,r)&&(t.editable||!(r.type in mn))&&n(t,r)},bR[e]?{passive:!0}:void 0)}pn&&t.dom.addEventListener("input",()=>null),kf(t)}function ci(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function ER(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 kf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ff(t,r))})}function Ff(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function vR(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 wR(t,e){!Ff(t,e)&&hn[e.type]&&(t.editable||!(e.type in mn))&&hn[e.type](t,e)}mn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!U0(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rr&&nn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),$o&&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,Gi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||dR(t,n)?n.preventDefault():ci(t,"key")};mn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};mn.keypress=(t,e)=>{let n=e;if(U0(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Un&&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 zl(t){return{left:t.clientX,top:t.clientY}}function xR(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Hf(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){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function _R(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(Uo(t,new he(n),"pointer"),!0):!1}function SR(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof he&&(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(he.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,he.create(t.state.doc,i),"pointer"),!0):!1}function TR(t,e,n,r,i){return Hf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?SR(t,n):_R(t,n))}function MR(t,e,n,r){return Hf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function CR(t,e,n,r){return Hf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||AR(t,n,r)}function AR(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(he.isSelectable(s))Uo(t,he.create(r,l),"pointer");else continue;return!0}}function zf(t){return Il(t)}var z0=Un?"metaKey":"ctrlKey";hn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=zf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&xR(n,t.input.lastClick)&&!n[z0]&&(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(zl(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Nf(t,s,n,!!r)):(o=="doubleClick"?MR:CR)(t,s.pos,s.inside,n)?n.preventDefault():ci(t,"pointer"))};var Nf=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[z0],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:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof he&&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)),ci(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(()=>Fr(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(zl(e))),this.updateAllowDefault(e),this.allowDefault||!n?ci(this.view,"pointer"):TR(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pn&&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,fe.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):ci(this.view,"pointer")}move(e){this.updateAllowDefault(e),ci(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)}};hn.touchstart=t=>{t.input.lastTouch=Date.now(),zf(t),ci(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),ci(t,"pointer")};hn.contextmenu=t=>zf(t);function U0(t,e){return t.composing?!0:pn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var kR=rr?5e3:-1;mn.compositionstart=mn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Il(t,!0),t.markCursor=null;else if(Il(t),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){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}$0(t,kR)};mn.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.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,$0(t,20))};function $0(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Il(t),e))}function W0(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=NR());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function NR(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Il(t,e=!1){if(!(rr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),W0(t),e||t.docView&&t.docView.dirty){let n=Pf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function OR(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 qs=wn&&ui<15||$o&&IO<604;hn.copy=mn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=qs?null:n.clipboardData,s=r.content(),{dom:l,text:u}=I0(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):OR(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function RR(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function IR(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?Ys(t,r.value,null,i,e):Ys(t,r.textContent,r.innerHTML,i,e)},50)}function Ys(t,e,n,r,i){let o=D0(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=RR(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 K0(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," "):""}mn.paste=(t,e)=>{let n=e;if(t.composing&&!rr)return;let r=qs?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Ys(t,K0(r),r.getData("text/html"),i,n)?n.preventDefault():IR(t,n)};var Dl=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},V0=Un?"altKey":"ctrlKey";hn.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(zl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof he?i.to-1:i.to))){if(r&&r.mightDrag)s=he.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=he.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:u,text:d}=I0(t,l);n.dataTransfer.clearData(),n.dataTransfer.setData(qs?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",qs||n.dataTransfer.setData("text/plain",d),t.dragging=new Dl(l,!n[V0],s)};hn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};mn.dragover=mn.dragenter=(t,e)=>e.preventDefault();mn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(zl(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",y=>{s=y(s,t)}):s=D0(t,K0(n.dataTransfer),qs?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[V0]);if(t.someProp("handleDrop",y=>y(t,n,s||Z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?Sl(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let d=t.state.tr;if(l){let{node:y}=r;y?y.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 b=d.doc.resolve(f);if(h&&he.isSelectable(s.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new he(b));else{let y=d.mapping.map(u);d.mapping.maps[d.mapping.maps.length-1].forEach((w,x,M,L)=>y=L),d.setSelection(Bf(t,b,d.doc.resolve(y)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))};hn.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())&&Fr(t)},20))};hn.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)};hn.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,Gi(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 mn)hn[t]=mn[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 Ll=class t{constructor(e,n){this.toDOM=e,this.spec=n||Xi,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 Mt(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)}},Ji=class t{constructor(e,n){this.attrs=e,this.spec=n||Xi}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 Mt(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){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||Xi)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let d=u+r,f;if(f=q0(n,l,d)){for(i||(i=this.children.slice());ol&&h.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&u.type instanceof Ji){let d=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;di.map(e,n,Xi));return t.from(r)}forChild(e,n){if(n.isLeaf)return lt.empty;let r=[];for(let i=0;in instanceof lt)?e:e.reduce((n,r)=>n.concat(r instanceof lt?r:r.members),[]))}}};function DR(t,e,n,r,i,o,s){let l=t.slice();for(let d=0,f=o;d{let x=w-y-(b-m);for(let M=0;ML+f-h)continue;let D=l[M]+f-h;b>=D?l[M+1]=m<=D?-2:-1:m>=f&&x&&(l[M]+=x,l[M+1]+=x)}h+=x}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d=r.content.size){u=!0;continue}let m=n.map(t[d+1]+o,-1),b=m-i,{index:y,offset:w}=r.content.findIndex(h),x=r.maybeChild(y);if(x&&w==h&&w+x.nodeSize==b){let M=l[d+2].mapInner(n,x,f+1,t[d]+o+1,s);M!=tn?(l[d]=h,l[d+1]=b,l[d+2]=M):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=LR(l,t,e,n,i,o,s),f=Bl(d,r,0,s);e=f.local;for(let h=0;hn&&s.to{let d=q0(t,l,u+n);if(d){o=!0;let f=Bl(d,l,n+u+1,r);f!=tn&&i.push(u,u+l.nodeSize,f)}});let s=G0(o?Y0(t):t,-n).sort(Zi);for(let l=0;l0;)e++;t.splice(e,0,n)}function hf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=tn&&e.push(r)}),t.cursorWrapper&&e.push(lt.create(t.state.doc,[t.cursorWrapper.deco])),Pl.from(e)}var PR={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},BR=wn&&ui<=11,Rf=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}},If=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Rf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),BR&&(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,PR)),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;nthis.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(t0(this.view)){if(this.suppressingSelectionUpdates)return Fr(this.view);if(wn&&ui<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ji(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=Gs(o))n.add(o);for(let o=e.anchorNode;o;o=Gs(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}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.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&t0(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let f=0;f1){let f=u.filter(h=>h.nodeName=="BR");if(f.length==2){let h=f[0],m=f[1];h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),FR(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Fr(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;fi;x--){let M=r.childNodes[x-1],L=M.pmViewDesc;if(M.nodeName=="BR"&&!L){o=x;break}if(!L||L.size)break}let h=t.state.doc,m=t.someProp("domParser")||Wi.fromSchema(t.state.schema),b=h.resolve(s),y=null,w=m.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:i,to:o,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:UR,context:b});if(d&&d[0].pos!=null){let x=d[0].pos,M=d[1]&&d[1].pos;M==null&&(M=x),y={anchor:x+s,head:M+s}}return{doc:w,sel:y,from:s,to:l}}function UR(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pn&&/^(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||pn&&/^(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 $R=/^(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 WR(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let W=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,ue=Pf(t,W);if(ue&&!t.state.selection.eq(ue)){if(nn&&rr&&t.input.lastKeyCode===13&&Date.now()-100Te(t,Gi(13,"Enter"))))return;let ye=t.state.tr.setSelection(ue);W=="pointer"?ye.setMeta("pointer",!0):W=="key"&&ye.scrollIntoView(),o&&ye.setMeta("composition",o),t.dispatch(ye)}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=zR(t,e,n),f=t.state.doc,h=f.slice(d.from,d.to),m,b;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||rr)&&i.some(W=>W.nodeType==1&&!$R.test(W.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",W=>W(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&u instanceof ce&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let W=f0(t,t.state.doc,d.sel);if(W&&!W.eq(t.state.selection)){let ue=t.state.tr.setSelection(W);o&&ue.setMeta("composition",o),t.dispatch(ue)}}return}if(nn&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let W=y.endB-y.start;d.sel={anchor:d.sel.anchor+W,head:d.sel.anchor+W}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),wn&&ui<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)==" \xA0"&&(y.start--,y.endA--,y.endB--);let w=d.doc.resolveNoCache(y.start-d.from),x=d.doc.resolveNoCache(y.endB-d.from),M=f.resolve(y.start),L=w.sameParent(x)&&w.parent.inlineContent&&M.end()>=y.endA,D;if(($o&&t.input.lastIOSEnter>Date.now()-225&&(!L||i.some(W=>W.nodeName=="DIV"||W.nodeName=="P"))||!L&&w.posW(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&VR(f,y.start,y.endA,w,x)&&t.someProp("handleKeyDown",W=>W(t,Gi(8,"Backspace")))){rr&&nn&&t.domObserver.suppressSelectionUpdates();return}nn&&rr&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),rr&&!L&&w.start()!=x.start()&&x.parentOffset==0&&w.depth==x.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,x=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(W){return W(t,Gi(13,"Enter"))})},20));let S=y.start,z=y.endA,O,q,J;if(L){if(w.pos==x.pos)wn&&ui<=11&&w.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Fr(t),20)),O=t.state.tr.delete(S,z),q=f.resolve(y.start).marksAcross(f.resolve(y.endA));else if(y.endA==y.endB&&(J=KR(w.parent.content.cut(w.parentOffset,x.parentOffset),M.parent.content.cut(M.parentOffset,y.endA-M.start()))))O=t.state.tr,J.type=="add"?O.addMark(S,z,J.mark):O.removeMark(S,z,J.mark);else if(w.parent.child(w.index()).isText&&w.index()==x.index()-(x.textOffset?0:1)){let W=w.parent.textBetween(w.parentOffset,x.parentOffset);if(t.someProp("handleTextInput",ue=>ue(t,S,z,W)))return;O=t.state.tr.insertText(W,S,z)}}if(O||(O=t.state.tr.replace(S,z,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let W=f0(t,O.doc,d.sel);W&&!(nn&&rr&&t.composing&&W.empty&&(y.start!=y.endB||t.input.lastAndroidDeletee.content.size?null:Bf(t,e.resolve(n.anchor),e.resolve(n.head))}function KR(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let f=0;ff.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;fn||mf(s,!0,!1)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 GR(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=s?o-r:0;o-=u,o&&o=l?o-r:0;o-=u,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}var Fl=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 Af,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(y0),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=g0(this),m0(this),this.nodeViews=b0(this),this.docView=Jy(this.state.doc,h0(this),hf(this),this.dom,this),this.domObserver=new If(this,(r,i,o,s)=>WR(this,r,i,o,s)),this.domObserver.start(),yR(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&&kf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(y0),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&&(W0(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 b=b0(this);YR(b,this.nodeViews)&&(this.nodeViews=b,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&kf(this),this.editable=g0(this),m0(this);let u=hf(this),d=h0(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&&PO(this);if(s){this.domObserver.stop();let b=h&&(wn||nn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&qR(i.selection,e.selection);if(h){let y=nn?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Jy(e.doc,d,u,this.dom,this)),y&&!this.trackWrites&&(b=!0)}b||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&iR(this))?Fr(this,b):(N0(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&&BO(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Wy(this,n.getBoundingClientRect(),e)}else Wy(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;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Dl(e.slice,e.move,i<0?void 0:he.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;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return WO(this,e)}coordsAtPos(e,n=1){return S0(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 YO(this,n||this.state,e)}pasteHTML(e,n){return Ys(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Ys(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(ER(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return wR(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return pn&&this.root.nodeType===11&&kO(this.dom.ownerDocument)==this.dom?HR(this):this.domSelection()}domSelection(){return this.root.getSelection()}};function h0(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"),[Mt.node(0,t.state.doc.content.size,e)]}function m0(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:Mt.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function g0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function qR(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 b0(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 YR(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 y0(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 Hr={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:"'"},$l={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},JR=typeof navigator<"u"&&/Mac/.test(navigator.platform),XR=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Ct=0;Ct<10;Ct++)Hr[48+Ct]=Hr[96+Ct]=String(Ct);var Ct;for(Ct=1;Ct<=24;Ct++)Hr[Ct+111]="F"+Ct;var Ct;for(Ct=65;Ct<=90;Ct++)Hr[Ct]=String.fromCharCode(Ct+32),$l[Ct]=String.fromCharCode(Ct);var Ct;for(Ul in Hr)$l.hasOwnProperty(Ul)||($l[Ul]=Hr[Ul]);var Ul;function J0(t){var e=JR&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||XR&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?$l:Hr)[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 ZR=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function jR(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=Hr[r.keyCode])&&o!=i){let l=e[$f(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Wl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function eI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var Kf=(t,e,n)=>{let r=eI(t,n);if(!r)return!1;let i=j0(r);if(!i){let s=r.blockRange(),l=s&&Lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&iE(t,i,e))return!0;if(r.parent.content.size==0&&(Ko(o,"end")||he.isSelectable(o))){let s=Tl(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{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=j0(r)}let s=o&&o.nodeBefore;return!s||!he.isSelectable(s)?!1:(e&&e(t.tr.setSelection(he.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function j0(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 tI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=tI(t,n);if(!r)return!1;let i=Q0(r);if(!i)return!1;let o=i.nodeAfter;if(iE(t,i,e))return!0;if(r.parent.content.size==0&&(Ko(o,"start")||he.isSelectable(o))){let s=Tl(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{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=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof he,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(he.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},tE=(t,e)=>{let n=t.selection,r;if(n instanceof he){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},nE=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Yf=(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 Jf(t){for(let e=0;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=Jf(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(fe.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},Zf=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof On||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Jf(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){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(zn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function nI(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof he&&e.selection.node.isBlock)return!r.parentOffset||!zn(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 On)&&s.deleteSelection();let l=r.depth==0?null:Jf(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=t&&t(i.parent,o),d=u?[u]:o&&l?[{type:l}]:void 0,f=zn(s.doc,s.mapping.map(r.pos),1,d);if(!d&&!f&&zn(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 rI=nI();var rE=(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(he.create(t.doc,i))),!0)},iI=(t,e)=>(e&&e(t.tr.setSelection(new On(t.doc))),!0);function oI(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 iE(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(oI(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,m=V.empty;for(let w=o.length-1;w>=0;w--)m=V.from(o[w].create(null,m));m=V.from(r.copy(m));let b=t.tr.step(new Tt(e.pos-1,h,e.pos,h,new Z(m,1,0),o.length,!0)),y=h+2*o.length;nr(b.doc,y)&&b.join(y),n(b.scrollIntoView())}return!0}let u=fe.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Lr(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(l&&Ko(i,"start",!0)&&Ko(r,"end")){let h=r,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let b=i,y=1;for(;!b.isTextblock;b=b.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,b.content)){if(n){let w=V.empty;for(let M=m.length-1;M>=0;M--)w=V.from(m[M].copy(w));let x=t.tr.step(new Tt(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new Z(w,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function oE(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 Qf=oE(-1),ep=oE(1);function sE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Lo(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function tp(t,e=null){return function(n,r){let i=!1;for(let o=0;o{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=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 Ui(f,f,s.depth),s.endIndex=0;f--)o=V.from(n[f].type.create(n[f].attrs,o));t.step(new Tt(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;fs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?lI(e,n,t,o):cI(e,n,o):!0:!1}}function lI(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);ow;y--)b-=i.child(y).nodeSize,r.delete(b-1,b+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?V.empty:V.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new Tt(h-(l?1:0),m+(u?1:0),h+1,m-1,new Z((l?V.empty:V.from(i.copy(V.empty))).append(u?V.empty:V.from(i.copy(V.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function cE(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=V.from(d?t.create():null),h=new Z(V.from(t.create(null,V.from(l.type.create(null,f)))),d?3:1,0),m=o.start,b=o.end;n(e.tr.step(new Tt(m-(d?3:1),b,m,b,h,1,!0)).scrollIntoView())}return!0}}function Yl(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),filterTransaction:e.filterTransaction,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 Vo=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,b])=>[m,(...w)=>{let x=this.buildProps(d,n),M=b(...w)(x);return l.push(M),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:Yl({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}},lp=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 ie(t,e,n){return t.config[e]===void 0&&t.parent?ie(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ie(t.parent,e,n):null}):t.config[e]}function Jl(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 bE(t){let e=[],{nodeExtensions:n,markExtensions:r}=Jl(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},u=ie(s,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,b])=>{e.push({type:h,name:m,attribute:{...o,...b}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},u=ie(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 Ut(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 cp(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 yE(t){return typeof t=="function"}function Se(t,e=void 0,...n){return yE(t)?e?t.bind(e)(...n):t(...n):t}function uI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function dI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function uE(t,e){return t.style?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):dI(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function dE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&uI(n)?!1:n!=null))}function fI(t,e){var n;let r=bE(t),{nodeExtensions:i,markExtensions:o}=Jl(t),s=(n=i.find(d=>ie(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{let f=r.filter(M=>M.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((M,L)=>{let D=ie(L,"extendNodeSchema",h);return{...M,...D?D(d):{}}},{}),b=dE({...m,content:Se(ie(d,"content",h)),marks:Se(ie(d,"marks",h)),group:Se(ie(d,"group",h)),inline:Se(ie(d,"inline",h)),atom:Se(ie(d,"atom",h)),selectable:Se(ie(d,"selectable",h)),draggable:Se(ie(d,"draggable",h)),code:Se(ie(d,"code",h)),defining:Se(ie(d,"defining",h)),isolating:Se(ie(d,"isolating",h)),attrs:Object.fromEntries(f.map(M=>{var L;return[M.name,{default:(L=M?.attribute)===null||L===void 0?void 0:L.default}]}))}),y=Se(ie(d,"parseHTML",h));y&&(b.parseDOM=y.map(M=>uE(M,f)));let w=ie(d,"renderHTML",h);w&&(b.toDOM=M=>w({node:M,HTMLAttributes:cp(M,f)}));let x=ie(d,"renderText",h);return x&&(b.toText=x),[d.name,b]})),u=Object.fromEntries(o.map(d=>{let f=r.filter(x=>x.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((x,M)=>{let L=ie(M,"extendMarkSchema",h);return{...x,...L?L(d):{}}},{}),b=dE({...m,inclusive:Se(ie(d,"inclusive",h)),excludes:Se(ie(d,"excludes",h)),group:Se(ie(d,"group",h)),spanning:Se(ie(d,"spanning",h)),code:Se(ie(d,"code",h)),attrs:Object.fromEntries(f.map(x=>{var M;return[x.name,{default:(M=x?.attribute)===null||M===void 0?void 0:M.default}]}))}),y=Se(ie(d,"parseHTML",h));y&&(b.parseDOM=y.map(x=>uE(x,f)));let w=ie(d,"renderHTML",h);return w&&(b.toDOM=x=>w({mark:x,HTMLAttributes:cp(x,f)})),[d.name,b]}));return new bl({topNode:s,nodes:l,marks:u})}function rp(t,e){return e.nodes[t]||e.marks[t]||null}function fE(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}var pI=(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+=f.slice(0,Math.max(0,r-o))}),n};function hp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Go=class{constructor(e){this.find=e.find,this.handler=e.handler}},hI=(t,e)=>{if(hp(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 ip(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=pI(d)+o;return s.forEach(m=>{if(f)return;let b=hI(h,m.find);if(!b)return;let y=u.state.tr,w=Yl({state:u.state,transaction:y}),x={from:r-(b[0].length-o.length),to:i},{commands:M,chain:L,can:D}=new Vo({editor:n,state:w});m.handler({state:w,range:x,match:b,commands:M,chain:L,can:D})===null||!y.steps.length||(y.setMeta(l,{transform:y,from:r,to:i,text:o}),u.dispatch(y),f=!0)}),f}function mI(t){let{editor:e,rules:n}=t,r=new Pe({state:{init(){return null},apply(i,o){let s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,l){return ip({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&ip({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?ip({editor:e,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function gI(t){return typeof t=="number"}var up=class{constructor(e){this.find=e.find,this.handler=e.handler}},bI=(t,e)=>{if(hp(e))return[...t.matchAll(e)];let n=e(t);return n?n.map(r=>{let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function yI(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Vo({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(b,y)=>{if(!b.isTextblock||b.type.spec.code)return;let w=Math.max(r,y),x=Math.min(i,y+b.content.size),M=b.textBetween(w-y,x-y,void 0,"\uFFFC");bI(M,o.find).forEach(D=>{if(D.index===void 0)return;let S=w+D.index+1,z=S+D[0].length,O={from:n.tr.mapping.map(S),to:n.tr.mapping.map(z)},q=o.handler({state:n,range:O,match:D,commands:u,chain:d,can:f,pasteEvent:s,dropEvent:l});h.push(q)})}),h.every(b=>b!==null)}function EI(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=new ClipboardEvent("paste"),l=new DragEvent("drop");return n.map(d=>new Pe({view(f){let h=m=>{var b;r=!((b=f.dom.parentElement)===null||b===void 0)&&b.contains(m.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",h),{destroy(){window.removeEventListener("dragstart",h)}}},props:{handleDOMEvents:{drop:(f,h)=>(o=r===f.dom.parentElement,l=h,!1),paste:(f,h)=>{var m;let b=(m=h.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return s=h,i=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(f,h,m)=>{let b=f[0],y=b.getMeta("uiEvent")==="paste"&&!i,w=b.getMeta("uiEvent")==="drop"&&!o;if(!y&&!w)return;let x=h.doc.content.findDiffStart(m.doc.content),M=h.doc.content.findDiffEnd(m.doc.content);if(!gI(x)||!M||x===M.b)return;let L=m.tr,D=Yl({state:m,transaction:L});if(!(!yI({editor:e,state:D,from:Math.max(x-1,0),to:M.b-1,rule:d,pasteEvent:s,dropEvent:l})||!L.steps.length))return l=new DragEvent("drop"),s=new ClipboardEvent("paste"),L}}))}function vI(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}var dp=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=fI(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;let o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:rp(r.name,this.schema)};r.type==="mark"&&(!((i=Se(ie(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);let s=ie(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);let l=ie(r,"onCreate",o);l&&this.editor.on("create",l);let u=ie(r,"onUpdate",o);u&&this.editor.on("update",u);let d=ie(r,"onSelectionUpdate",o);d&&this.editor.on("selectionUpdate",d);let f=ie(r,"onTransaction",o);f&&this.editor.on("transaction",f);let h=ie(r,"onFocus",o);h&&this.editor.on("focus",h);let m=ie(r,"onBlur",o);m&&this.editor.on("blur",m);let b=ie(r,"onDestroy",o);b&&this.editor.on("destroy",b)})}static resolve(e){let n=t.sort(t.flatten(e)),r=vI(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=ie(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=ie(r,"priority")||100,s=ie(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:rp(n.name,this.schema)},i=ie(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:rp(s.name,this.schema)},u=[],d=ie(s,"addKeyboardShortcuts",l),f={};if(s.type==="mark"&&s.config.exitable&&(f.ArrowRight=()=>tt.handleExit({editor:e,mark:s})),d){let w=Object.fromEntries(Object.entries(d()).map(([x,M])=>[x,()=>M({editor:e})]));f={...f,...w}}let h=X0(f);u.push(h);let m=ie(s,"addInputRules",l);fE(s,e.options.enableInputRules)&&m&&r.push(...m());let b=ie(s,"addPasteRules",l);fE(s,e.options.enablePasteRules)&&b&&i.push(...b());let y=ie(s,"addProseMirrorPlugins",l);if(y){let w=y();u.push(...w)}return u}).flat();return[mI({editor:e,rules:r}),...EI({editor:e,rules:i}),...o]}get attributes(){return bE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=Jl(this.extensions);return Object.fromEntries(n.filter(r=>!!ie(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:Ut(r.name,this.schema)},s=ie(r,"addNodeView",o);if(!s)return[];let l=(u,d,f,h)=>{let m=cp(u,i);return s()({editor:e,node:u,getPos:f,decorations:h,HTMLAttributes:m,extension:r})};return[r.name,l]}))}};function wI(t){return Object.prototype.toString.call(t).slice(8,-1)}function op(t){return wI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Xl(t,e){let n={...t};return op(t)&&op(e)&&Object.keys(e).forEach(r=>{op(e[r])?r in t?n[r]=Xl(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}var Qe=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&&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=Se(ie(this,"addOptions",{name:this.name}))),this.storage=Se(ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Xl(this.options,e),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),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&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(ie(n,"addOptions",{name:n.name})),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),n}};function EE(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` +`);return{dom:u,text:m}}function L0(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(V.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:b}=t.state,y=Ir.fromSchema(b);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(w=>{let x=s.appendChild(document.createElement("p"));w&&x.appendChild(y.serializeNode(b.text(w,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),s=hR(n),Xs&&mR(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")||Wi.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!fR.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=gR(a0(l,+f[1],+f[2]),f[4]);else if(l=Z.maxOpen(pR(l.content,i),!0),l.openStart||l.openEnd){let h=0,m=0;for(let b=l.content.firstChild;h{l=h(l,t)}),l}var fR=/^(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 pR(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&&P0(u,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=B0(s[s.length-1],o.length));let f=D0(l,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return V.from(s)}return t}function D0(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,V.from(t));return t}function P0(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(V.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function a0(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=H0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&F0[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=V.from(u.create(r[l+1],i)),o++,s++}return new Z(i,o,s)}var hn={},mn={},bR={touchstart:!0,touchmove:!0},Af=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.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 yR(t){for(let e in hn){let n=hn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{vR(t,r)&&!Ff(t,r)&&(t.editable||!(r.type in mn))&&n(t,r)},bR[e]?{passive:!0}:void 0)}pn&&t.dom.addEventListener("input",()=>null),kf(t)}function ci(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function ER(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 kf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ff(t,r))})}function Ff(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function vR(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 wR(t,e){!Ff(t,e)&&hn[e.type]&&(t.editable||!(e.type in mn))&&hn[e.type](t,e)}mn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!U0(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rr&&nn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),$o&&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,Gi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||dR(t,n)?n.preventDefault():ci(t,"key")};mn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};mn.keypress=(t,e)=>{let n=e;if(U0(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Un&&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 zl(t){return{left:t.clientX,top:t.clientY}}function xR(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Hf(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){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function _R(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(Uo(t,new he(n),"pointer"),!0):!1}function SR(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof he&&(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(he.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,he.create(t.state.doc,i),"pointer"),!0):!1}function TR(t,e,n,r,i){return Hf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?SR(t,n):_R(t,n))}function MR(t,e,n,r){return Hf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function CR(t,e,n,r){return Hf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||AR(t,n,r)}function AR(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(he.isSelectable(s))Uo(t,he.create(r,l),"pointer");else continue;return!0}}function zf(t){return Il(t)}var z0=Un?"metaKey":"ctrlKey";hn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=zf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&xR(n,t.input.lastClick)&&!n[z0]&&(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(zl(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Nf(t,s,n,!!r)):(o=="doubleClick"?MR:CR)(t,s.pos,s.inside,n)?n.preventDefault():ci(t,"pointer"))};var Nf=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[z0],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:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof he&&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)),ci(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(()=>Fr(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(zl(e))),this.updateAllowDefault(e),this.allowDefault||!n?ci(this.view,"pointer"):TR(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pn&&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,fe.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):ci(this.view,"pointer")}move(e){this.updateAllowDefault(e),ci(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)}};hn.touchstart=t=>{t.input.lastTouch=Date.now(),zf(t),ci(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),ci(t,"pointer")};hn.contextmenu=t=>zf(t);function U0(t,e){return t.composing?!0:pn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var kR=rr?5e3:-1;mn.compositionstart=mn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Il(t,!0),t.markCursor=null;else if(Il(t),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){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}$0(t,kR)};mn.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.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,$0(t,20))};function $0(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Il(t),e))}function W0(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=NR());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function NR(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Il(t,e=!1){if(!(rr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),W0(t),e||t.docView&&t.docView.dirty){let n=Pf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function OR(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 qs=wn&&ui<15||$o&&IO<604;hn.copy=mn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=qs?null:n.clipboardData,s=r.content(),{dom:l,text:u}=I0(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):OR(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function RR(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function IR(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?Ys(t,r.value,null,i,e):Ys(t,r.textContent,r.innerHTML,i,e)},50)}function Ys(t,e,n,r,i){let o=L0(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=RR(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 K0(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," "):""}mn.paste=(t,e)=>{let n=e;if(t.composing&&!rr)return;let r=qs?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Ys(t,K0(r),r.getData("text/html"),i,n)?n.preventDefault():IR(t,n)};var Ll=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},V0=Un?"altKey":"ctrlKey";hn.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(zl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof he?i.to-1:i.to))){if(r&&r.mightDrag)s=he.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=he.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:u,text:d}=I0(t,l);n.dataTransfer.clearData(),n.dataTransfer.setData(qs?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",qs||n.dataTransfer.setData("text/plain",d),t.dragging=new Ll(l,!n[V0],s)};hn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};mn.dragover=mn.dragenter=(t,e)=>e.preventDefault();mn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(zl(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",y=>{s=y(s,t)}):s=L0(t,K0(n.dataTransfer),qs?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[V0]);if(t.someProp("handleDrop",y=>y(t,n,s||Z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?Sl(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let d=t.state.tr;if(l){let{node:y}=r;y?y.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 b=d.doc.resolve(f);if(h&&he.isSelectable(s.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new he(b));else{let y=d.mapping.map(u);d.mapping.maps[d.mapping.maps.length-1].forEach((w,x,M,D)=>y=D),d.setSelection(Bf(t,b,d.doc.resolve(y)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))};hn.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())&&Fr(t)},20))};hn.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)};hn.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,Gi(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 mn)hn[t]=mn[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 Dl=class t{constructor(e,n){this.toDOM=e,this.spec=n||Xi,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 Mt(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)}},Ji=class t{constructor(e,n){this.attrs=e,this.spec=n||Xi}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 Mt(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){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||Xi)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let d=u+r,f;if(f=q0(n,l,d)){for(i||(i=this.children.slice());ol&&h.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&u.type instanceof Ji){let d=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;di.map(e,n,Xi));return t.from(r)}forChild(e,n){if(n.isLeaf)return lt.empty;let r=[];for(let i=0;in instanceof lt)?e:e.reduce((n,r)=>n.concat(r instanceof lt?r:r.members),[]))}}};function LR(t,e,n,r,i,o,s){let l=t.slice();for(let d=0,f=o;d{let x=w-y-(b-m);for(let M=0;MD+f-h)continue;let L=l[M]+f-h;b>=L?l[M+1]=m<=L?-2:-1:m>=f&&x&&(l[M]+=x,l[M+1]+=x)}h+=x}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d=r.content.size){u=!0;continue}let m=n.map(t[d+1]+o,-1),b=m-i,{index:y,offset:w}=r.content.findIndex(h),x=r.maybeChild(y);if(x&&w==h&&w+x.nodeSize==b){let M=l[d+2].mapInner(n,x,f+1,t[d]+o+1,s);M!=tn?(l[d]=h,l[d+1]=b,l[d+2]=M):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=DR(l,t,e,n,i,o,s),f=Bl(d,r,0,s);e=f.local;for(let h=0;hn&&s.to{let d=q0(t,l,u+n);if(d){o=!0;let f=Bl(d,l,n+u+1,r);f!=tn&&i.push(u,u+l.nodeSize,f)}});let s=G0(o?Y0(t):t,-n).sort(Zi);for(let l=0;l0;)e++;t.splice(e,0,n)}function hf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=tn&&e.push(r)}),t.cursorWrapper&&e.push(lt.create(t.state.doc,[t.cursorWrapper.deco])),Pl.from(e)}var PR={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},BR=wn&&ui<=11,Rf=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}},If=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Rf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),BR&&(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,PR)),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;nthis.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(t0(this.view)){if(this.suppressingSelectionUpdates)return Fr(this.view);if(wn&&ui<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ji(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=Gs(o))n.add(o);for(let o=e.anchorNode;o;o=Gs(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}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.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&t0(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let f=0;f1){let f=u.filter(h=>h.nodeName=="BR");if(f.length==2){let h=f[0],m=f[1];h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),FR(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Fr(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;fi;x--){let M=r.childNodes[x-1],D=M.pmViewDesc;if(M.nodeName=="BR"&&!D){o=x;break}if(!D||D.size)break}let h=t.state.doc,m=t.someProp("domParser")||Wi.fromSchema(t.state.schema),b=h.resolve(s),y=null,w=m.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:i,to:o,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:UR,context:b});if(d&&d[0].pos!=null){let x=d[0].pos,M=d[1]&&d[1].pos;M==null&&(M=x),y={anchor:x+s,head:M+s}}return{doc:w,sel:y,from:s,to:l}}function UR(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pn&&/^(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||pn&&/^(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 $R=/^(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 WR(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let W=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,ue=Pf(t,W);if(ue&&!t.state.selection.eq(ue)){if(nn&&rr&&t.input.lastKeyCode===13&&Date.now()-100Te(t,Gi(13,"Enter"))))return;let ye=t.state.tr.setSelection(ue);W=="pointer"?ye.setMeta("pointer",!0):W=="key"&&ye.scrollIntoView(),o&&ye.setMeta("composition",o),t.dispatch(ye)}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=zR(t,e,n),f=t.state.doc,h=f.slice(d.from,d.to),m,b;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||rr)&&i.some(W=>W.nodeType==1&&!$R.test(W.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",W=>W(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&u instanceof ce&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let W=f0(t,t.state.doc,d.sel);if(W&&!W.eq(t.state.selection)){let ue=t.state.tr.setSelection(W);o&&ue.setMeta("composition",o),t.dispatch(ue)}}return}if(nn&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let W=y.endB-y.start;d.sel={anchor:d.sel.anchor+W,head:d.sel.anchor+W}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),wn&&ui<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)==" \xA0"&&(y.start--,y.endA--,y.endB--);let w=d.doc.resolveNoCache(y.start-d.from),x=d.doc.resolveNoCache(y.endB-d.from),M=f.resolve(y.start),D=w.sameParent(x)&&w.parent.inlineContent&&M.end()>=y.endA,L;if(($o&&t.input.lastIOSEnter>Date.now()-225&&(!D||i.some(W=>W.nodeName=="DIV"||W.nodeName=="P"))||!D&&w.posW(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&VR(f,y.start,y.endA,w,x)&&t.someProp("handleKeyDown",W=>W(t,Gi(8,"Backspace")))){rr&&nn&&t.domObserver.suppressSelectionUpdates();return}nn&&rr&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),rr&&!D&&w.start()!=x.start()&&x.parentOffset==0&&w.depth==x.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,x=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(W){return W(t,Gi(13,"Enter"))})},20));let S=y.start,z=y.endA,O,q,J;if(D){if(w.pos==x.pos)wn&&ui<=11&&w.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Fr(t),20)),O=t.state.tr.delete(S,z),q=f.resolve(y.start).marksAcross(f.resolve(y.endA));else if(y.endA==y.endB&&(J=KR(w.parent.content.cut(w.parentOffset,x.parentOffset),M.parent.content.cut(M.parentOffset,y.endA-M.start()))))O=t.state.tr,J.type=="add"?O.addMark(S,z,J.mark):O.removeMark(S,z,J.mark);else if(w.parent.child(w.index()).isText&&w.index()==x.index()-(x.textOffset?0:1)){let W=w.parent.textBetween(w.parentOffset,x.parentOffset);if(t.someProp("handleTextInput",ue=>ue(t,S,z,W)))return;O=t.state.tr.insertText(W,S,z)}}if(O||(O=t.state.tr.replace(S,z,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let W=f0(t,O.doc,d.sel);W&&!(nn&&rr&&t.composing&&W.empty&&(y.start!=y.endB||t.input.lastAndroidDeletee.content.size?null:Bf(t,e.resolve(n.anchor),e.resolve(n.head))}function KR(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let f=0;ff.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;fn||mf(s,!0,!1)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 GR(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=s?o-r:0;o-=u,o&&o=l?o-r:0;o-=u,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}var Fl=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 Af,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(y0),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=g0(this),m0(this),this.nodeViews=b0(this),this.docView=Jy(this.state.doc,h0(this),hf(this),this.dom,this),this.domObserver=new If(this,(r,i,o,s)=>WR(this,r,i,o,s)),this.domObserver.start(),yR(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&&kf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(y0),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&&(W0(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 b=b0(this);YR(b,this.nodeViews)&&(this.nodeViews=b,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&kf(this),this.editable=g0(this),m0(this);let u=hf(this),d=h0(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&&PO(this);if(s){this.domObserver.stop();let b=h&&(wn||nn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&qR(i.selection,e.selection);if(h){let y=nn?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Jy(e.doc,d,u,this.dom,this)),y&&!this.trackWrites&&(b=!0)}b||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&iR(this))?Fr(this,b):(N0(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&&BO(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Wy(this,n.getBoundingClientRect(),e)}else Wy(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;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Ll(e.slice,e.move,i<0?void 0:he.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;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return WO(this,e)}coordsAtPos(e,n=1){return S0(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 YO(this,n||this.state,e)}pasteHTML(e,n){return Ys(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Ys(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(ER(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return wR(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return pn&&this.root.nodeType===11&&kO(this.dom.ownerDocument)==this.dom?HR(this):this.domSelection()}domSelection(){return this.root.getSelection()}};function h0(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"),[Mt.node(0,t.state.doc.content.size,e)]}function m0(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:Mt.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function g0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function qR(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 b0(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 YR(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 y0(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 Hr={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:"'"},$l={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},JR=typeof navigator<"u"&&/Mac/.test(navigator.platform),XR=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Ct=0;Ct<10;Ct++)Hr[48+Ct]=Hr[96+Ct]=String(Ct);var Ct;for(Ct=1;Ct<=24;Ct++)Hr[Ct+111]="F"+Ct;var Ct;for(Ct=65;Ct<=90;Ct++)Hr[Ct]=String.fromCharCode(Ct+32),$l[Ct]=String.fromCharCode(Ct);var Ct;for(Ul in Hr)$l.hasOwnProperty(Ul)||($l[Ul]=Hr[Ul]);var Ul;function J0(t){var e=JR&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||XR&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?$l:Hr)[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 ZR=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function jR(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=Hr[r.keyCode])&&o!=i){let l=e[$f(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Wl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function eI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var Kf=(t,e,n)=>{let r=eI(t,n);if(!r)return!1;let i=j0(r);if(!i){let s=r.blockRange(),l=s&&Dr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&iE(t,i,e))return!0;if(r.parent.content.size==0&&(Ko(o,"end")||he.isSelectable(o))){let s=Tl(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{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=j0(r)}let s=o&&o.nodeBefore;return!s||!he.isSelectable(s)?!1:(e&&e(t.tr.setSelection(he.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function j0(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 tI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=tI(t,n);if(!r)return!1;let i=Q0(r);if(!i)return!1;let o=i.nodeAfter;if(iE(t,i,e))return!0;if(r.parent.content.size==0&&(Ko(o,"start")||he.isSelectable(o))){let s=Tl(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{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=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof he,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(he.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},tE=(t,e)=>{let n=t.selection,r;if(n instanceof he){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},nE=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Dr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Yf=(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 Jf(t){for(let e=0;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=Jf(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(fe.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},Zf=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof On||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Jf(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){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(zn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Dr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function nI(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof he&&e.selection.node.isBlock)return!r.parentOffset||!zn(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 On)&&s.deleteSelection();let l=r.depth==0?null:Jf(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=t&&t(i.parent,o),d=u?[u]:o&&l?[{type:l}]:void 0,f=zn(s.doc,s.mapping.map(r.pos),1,d);if(!d&&!f&&zn(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 rI=nI();var rE=(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(he.create(t.doc,i))),!0)},iI=(t,e)=>(e&&e(t.tr.setSelection(new On(t.doc))),!0);function oI(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 iE(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(oI(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,m=V.empty;for(let w=o.length-1;w>=0;w--)m=V.from(o[w].create(null,m));m=V.from(r.copy(m));let b=t.tr.step(new Tt(e.pos-1,h,e.pos,h,new Z(m,1,0),o.length,!0)),y=h+2*o.length;nr(b.doc,y)&&b.join(y),n(b.scrollIntoView())}return!0}let u=fe.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Dr(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(l&&Ko(i,"start",!0)&&Ko(r,"end")){let h=r,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let b=i,y=1;for(;!b.isTextblock;b=b.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,b.content)){if(n){let w=V.empty;for(let M=m.length-1;M>=0;M--)w=V.from(m[M].copy(w));let x=t.tr.step(new Tt(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new Z(w,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function oE(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 Qf=oE(-1),ep=oE(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 tp(t,e=null){return function(n,r){let i=!1;for(let o=0;o{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=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 Ui(f,f,s.depth),s.endIndex=0;f--)o=V.from(n[f].type.create(n[f].attrs,o));t.step(new Tt(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;fs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?lI(e,n,t,o):cI(e,n,o):!0:!1}}function lI(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);ow;y--)b-=i.child(y).nodeSize,r.delete(b-1,b+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?V.empty:V.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new Tt(h-(l?1:0),m+(u?1:0),h+1,m-1,new Z((l?V.empty:V.from(i.copy(V.empty))).append(u?V.empty:V.from(i.copy(V.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function cE(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=V.from(d?t.create():null),h=new Z(V.from(t.create(null,V.from(l.type.create(null,f)))),d?3:1,0),m=o.start,b=o.end;n(e.tr.step(new Tt(m-(d?3:1),b,m,b,h,1,!0)).scrollIntoView())}return!0}}function Yl(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),filterTransaction:e.filterTransaction,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 Vo=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,b])=>[m,(...w)=>{let x=this.buildProps(d,n),M=b(...w)(x);return l.push(M),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:Yl({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}},lp=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 ie(t,e,n){return t.config[e]===void 0&&t.parent?ie(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ie(t.parent,e,n):null}):t.config[e]}function Jl(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 bE(t){let e=[],{nodeExtensions:n,markExtensions:r}=Jl(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},u=ie(s,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,b])=>{e.push({type:h,name:m,attribute:{...o,...b}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},u=ie(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 Ut(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 cp(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 yE(t){return typeof t=="function"}function Se(t,e=void 0,...n){return yE(t)?e?t.bind(e)(...n):t(...n):t}function uI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function dI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function uE(t,e){return t.style?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):dI(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function dE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&uI(n)?!1:n!=null))}function fI(t,e){var n;let r=bE(t),{nodeExtensions:i,markExtensions:o}=Jl(t),s=(n=i.find(d=>ie(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{let f=r.filter(M=>M.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((M,D)=>{let L=ie(D,"extendNodeSchema",h);return{...M,...L?L(d):{}}},{}),b=dE({...m,content:Se(ie(d,"content",h)),marks:Se(ie(d,"marks",h)),group:Se(ie(d,"group",h)),inline:Se(ie(d,"inline",h)),atom:Se(ie(d,"atom",h)),selectable:Se(ie(d,"selectable",h)),draggable:Se(ie(d,"draggable",h)),code:Se(ie(d,"code",h)),defining:Se(ie(d,"defining",h)),isolating:Se(ie(d,"isolating",h)),attrs:Object.fromEntries(f.map(M=>{var D;return[M.name,{default:(D=M?.attribute)===null||D===void 0?void 0:D.default}]}))}),y=Se(ie(d,"parseHTML",h));y&&(b.parseDOM=y.map(M=>uE(M,f)));let w=ie(d,"renderHTML",h);w&&(b.toDOM=M=>w({node:M,HTMLAttributes:cp(M,f)}));let x=ie(d,"renderText",h);return x&&(b.toText=x),[d.name,b]})),u=Object.fromEntries(o.map(d=>{let f=r.filter(x=>x.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((x,M)=>{let D=ie(M,"extendMarkSchema",h);return{...x,...D?D(d):{}}},{}),b=dE({...m,inclusive:Se(ie(d,"inclusive",h)),excludes:Se(ie(d,"excludes",h)),group:Se(ie(d,"group",h)),spanning:Se(ie(d,"spanning",h)),code:Se(ie(d,"code",h)),attrs:Object.fromEntries(f.map(x=>{var M;return[x.name,{default:(M=x?.attribute)===null||M===void 0?void 0:M.default}]}))}),y=Se(ie(d,"parseHTML",h));y&&(b.parseDOM=y.map(x=>uE(x,f)));let w=ie(d,"renderHTML",h);return w&&(b.toDOM=x=>w({mark:x,HTMLAttributes:cp(x,f)})),[d.name,b]}));return new bl({topNode:s,nodes:l,marks:u})}function rp(t,e){return e.nodes[t]||e.marks[t]||null}function fE(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}var pI=(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+=f.slice(0,Math.max(0,r-o))}),n};function hp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Go=class{constructor(e){this.find=e.find,this.handler=e.handler}},hI=(t,e)=>{if(hp(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 ip(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=pI(d)+o;return s.forEach(m=>{if(f)return;let b=hI(h,m.find);if(!b)return;let y=u.state.tr,w=Yl({state:u.state,transaction:y}),x={from:r-(b[0].length-o.length),to:i},{commands:M,chain:D,can:L}=new Vo({editor:n,state:w});m.handler({state:w,range:x,match:b,commands:M,chain:D,can:L})===null||!y.steps.length||(y.setMeta(l,{transform:y,from:r,to:i,text:o}),u.dispatch(y),f=!0)}),f}function mI(t){let{editor:e,rules:n}=t,r=new Pe({state:{init(){return null},apply(i,o){let s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,l){return ip({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&ip({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?ip({editor:e,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function gI(t){return typeof t=="number"}var up=class{constructor(e){this.find=e.find,this.handler=e.handler}},bI=(t,e)=>{if(hp(e))return[...t.matchAll(e)];let n=e(t);return n?n.map(r=>{let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function yI(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Vo({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(b,y)=>{if(!b.isTextblock||b.type.spec.code)return;let w=Math.max(r,y),x=Math.min(i,y+b.content.size),M=b.textBetween(w-y,x-y,void 0,"\uFFFC");bI(M,o.find).forEach(L=>{if(L.index===void 0)return;let S=w+L.index+1,z=S+L[0].length,O={from:n.tr.mapping.map(S),to:n.tr.mapping.map(z)},q=o.handler({state:n,range:O,match:L,commands:u,chain:d,can:f,pasteEvent:s,dropEvent:l});h.push(q)})}),h.every(b=>b!==null)}function EI(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=new ClipboardEvent("paste"),l=new DragEvent("drop");return n.map(d=>new Pe({view(f){let h=m=>{var b;r=!((b=f.dom.parentElement)===null||b===void 0)&&b.contains(m.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",h),{destroy(){window.removeEventListener("dragstart",h)}}},props:{handleDOMEvents:{drop:(f,h)=>(o=r===f.dom.parentElement,l=h,!1),paste:(f,h)=>{var m;let b=(m=h.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return s=h,i=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(f,h,m)=>{let b=f[0],y=b.getMeta("uiEvent")==="paste"&&!i,w=b.getMeta("uiEvent")==="drop"&&!o;if(!y&&!w)return;let x=h.doc.content.findDiffStart(m.doc.content),M=h.doc.content.findDiffEnd(m.doc.content);if(!gI(x)||!M||x===M.b)return;let D=m.tr,L=Yl({state:m,transaction:D});if(!(!yI({editor:e,state:L,from:Math.max(x-1,0),to:M.b-1,rule:d,pasteEvent:s,dropEvent:l})||!D.steps.length))return l=new DragEvent("drop"),s=new ClipboardEvent("paste"),D}}))}function vI(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}var dp=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=fI(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;let o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:rp(r.name,this.schema)};r.type==="mark"&&(!((i=Se(ie(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);let s=ie(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);let l=ie(r,"onCreate",o);l&&this.editor.on("create",l);let u=ie(r,"onUpdate",o);u&&this.editor.on("update",u);let d=ie(r,"onSelectionUpdate",o);d&&this.editor.on("selectionUpdate",d);let f=ie(r,"onTransaction",o);f&&this.editor.on("transaction",f);let h=ie(r,"onFocus",o);h&&this.editor.on("focus",h);let m=ie(r,"onBlur",o);m&&this.editor.on("blur",m);let b=ie(r,"onDestroy",o);b&&this.editor.on("destroy",b)})}static resolve(e){let n=t.sort(t.flatten(e)),r=vI(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=ie(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=ie(r,"priority")||100,s=ie(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:rp(n.name,this.schema)},i=ie(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:rp(s.name,this.schema)},u=[],d=ie(s,"addKeyboardShortcuts",l),f={};if(s.type==="mark"&&s.config.exitable&&(f.ArrowRight=()=>tt.handleExit({editor:e,mark:s})),d){let w=Object.fromEntries(Object.entries(d()).map(([x,M])=>[x,()=>M({editor:e})]));f={...f,...w}}let h=X0(f);u.push(h);let m=ie(s,"addInputRules",l);fE(s,e.options.enableInputRules)&&m&&r.push(...m());let b=ie(s,"addPasteRules",l);fE(s,e.options.enablePasteRules)&&b&&i.push(...b());let y=ie(s,"addProseMirrorPlugins",l);if(y){let w=y();u.push(...w)}return u}).flat();return[mI({editor:e,rules:r}),...EI({editor:e,rules:i}),...o]}get attributes(){return bE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=Jl(this.extensions);return Object.fromEntries(n.filter(r=>!!ie(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:Ut(r.name,this.schema)},s=ie(r,"addNodeView",o);if(!s)return[];let l=(u,d,f,h)=>{let m=cp(u,i);return s()({editor:e,node:u,getPos:f,decorations:h,HTMLAttributes:m,extension:r})};return[r.name,l]}))}};function wI(t){return Object.prototype.toString.call(t).slice(8,-1)}function op(t){return wI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Xl(t,e){let n={...t};return op(t)&&op(e)&&Object.keys(e).forEach(r=>{op(e[r])?r in t?n[r]=Xl(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}var Qe=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&&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=Se(ie(this,"addOptions",{name:this.name}))),this.storage=Se(ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Xl(this.options,e),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),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&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(ie(n,"addOptions",{name:n.name})),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),n}};function EE(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` -`,textSerializers:s={}}=n||{},l="",u=!0;return t.nodesBetween(r,i,(d,f,h,m)=>{var b;let y=s?.[d.type.name];y?(d.isBlock&&!u&&(l+=o,u=!0),h&&(l+=y({node:d,pos:f,parent:h,index:m,range:e}))):d.isText?(l+=(b=d?.text)===null||b===void 0?void 0:b.slice(Math.max(r,f)-f,i-f),u=!1):d.isBlock&&!u&&(l+=o,u=!0)}),l}function vE(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var xI=Qe.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Pe({key:new qe("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=vE(n);return EE(r,{from:s,to:l},{textSerializers:u})}}})]}}),_I=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),SI=(t=!1)=>({commands:e})=>e.setContent("",t),TI=()=>({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)),b=h.blockRange(m);if(!b)return;let y=Lr(b);if(l.type.isTextblock){let{defaultType:w}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(b.start,w)}(y||y===0)&&e.lift(b,y)})}),!0},MI=t=>e=>t(e),CI=()=>({state:t,dispatch:e})=>Zf(t,e),AI=(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},kI=()=>({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},NI=t=>({tr:e,state:n,dispatch:r})=>{let i=Ut(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},OI=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},RI=()=>({state:t,dispatch:e})=>Wl(t,e),II=()=>({commands:t})=>t.keyboardShortcut("Enter"),DI=()=>({state:t,dispatch:e})=>Xf(t,e);function Vl(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:hp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function fp(t,e,n={}){return t.find(r=>r.type===e&&Vl(r.attrs,n))}function LI(t,e,n={}){return!!fp(t,e,n)}function mp(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=fp([...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(fp([...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({tr:n,state:r,dispatch:i})=>{let o=hi(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:d,to:f}=l;if(i){let h=mp(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},BI=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{gp()&&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&&!Zl(n.state.selection))return s(),!0;let l=wE(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},HI=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),zI=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e);function pE(t){let e=`${t}`;return new window.DOMParser().parseFromString(e,"text/html").body}function Gl(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?V.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Gl("",e,n)}if(typeof t=="string"){let r=Wi.fromSchema(e);return n.slice?r.parseSlice(pE(t),n.parseOptions).content:r.parse(pE(t),n.parseOptions)}return Gl("",e,n)}function UI(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=f)}),t.setSelection(fe.near(t.doc.resolve(s),n))}var $I=t=>t.toString().startsWith("<"),WI=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};let s=Gl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,f=!0;if(($I(s)?s:[s]).forEach(m=>{m.check(),d=d?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),l===u&&f){let{parent:m}=r.doc.resolve(l);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(l-=1,u+=1)}d?Array.isArray(e)?r.insertText(e.map(m=>m.text||"").join(""),l,u):typeof e=="object"&&e&&e.text?r.insertText(e.text,l,u):r.insertText(e,l,u):r.replaceWith(l,u,s),n.updateSelection&&UI(r,r.steps.length-1,-1)}return!0},KI=()=>({state:t,dispatch:e})=>eE(t,e),VI=()=>({state:t,dispatch:e})=>tE(t,e),GI=()=>({state:t,dispatch:e})=>Kf(t,e),qI=()=>({state:t,dispatch:e})=>Gf(t,e),YI=()=>({tr:t,state:e,dispatch:n})=>{try{let r=Po(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},JI=()=>({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}};function jl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function XI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{let o=XI(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 js(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?Ut(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;let b=Math.max(r,m),y=Math.min(i,m+h.nodeSize);l.push({node:h,from:b,to:y})});let u=i-r,d=l.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>Vl(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var jI=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return js(n,i,e)?nE(n,r):!1},QI=()=>({state:t,dispatch:e})=>jf(t,e),eD=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return lE(r)(e,n)},tD=()=>({state:t,dispatch:e})=>Yf(t,e);function Ql(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function hE(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 nD=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=Ql(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=hi(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,hE(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&n.addMark(f,f+d.nodeSize,s.create(hE(h.attrs,e)))})})}),!0):!1},rD=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),iD=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),oD=()=>({state:t,dispatch:e})=>Vf(t,e),sD=()=>({state:t,dispatch:e})=>qf(t,e),aD=()=>({state:t,dispatch:e})=>rE(t,e),lD=()=>({state:t,dispatch:e})=>ep(t,e),cD=()=>({state:t,dispatch:e})=>Qf(t,e);function xE(t,e,n={}){return Gl(t,e,{slice:!1,parseOptions:n})}var uD=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{let{doc:s}=r,l=xE(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!e),!0};function mi(t,e){let n=hi(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 _E(t,e){let n=new si(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function bp(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function SE(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function yp(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 to(t){return e=>yp(e.$from,t)}function dD(t,e){let n=Ir.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function fD(t,e){let n={from:0,to:t.content.size};return EE(t,n,e)}function pD(t,e){let n=Ut(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 Ep(t,e){let n=Ql(typeof e=="string"?e:e.name,t.schema);return n==="node"?pD(t,e):n==="mark"?mi(t,e):{}}function hD(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 mD(t){let e=hD(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 TE(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}})})}),mD(r)}function ec(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t-1),s=mp(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Kl(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 pp(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?hi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>Vl(h.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:h,$to:m})=>{let b=h.pos,y=m.pos;t.doc.nodesBetween(b,y,(w,x)=>{if(!w.isText&&!w.marks.length)return;let M=Math.max(b,x),L=Math.min(y,x+w.nodeSize),D=L-M;s+=D,l.push(...w.marks.map(S=>({mark:S,from:M,to:L})))})}),s===0)return!1;let u=l.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>Vl(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 gD(t,e,n={}){if(!e)return js(t,null,n)||pp(t,null,n);let r=Ql(e,t.schema);return r==="node"?js(t,e,n):r==="mark"?pp(t,e,n):!1}function mE(t,e){let{nodeExtensions:n}=Jl(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Se(ie(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function bD(t){var e;let n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function ME(t){return t instanceof he}function tc(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),b=m-h,y=f-d,M={top:d,bottom:f,left:h,right:m,width:b,height:y,x:h,y:d};return{...M,toJSON:()=>M}}function yD(t,e,n){var r;let{selection:i}=e,o=null;if(Zl(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 b=!m||m.type.allowsMarkType(n),y=!!n.isInSet(f.marks)||!f.marks.some(w=>w.type.excludes(n));d=b&&y}return!d}),d})}var ED=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,u=hi(t,r.schema);if(i)if(s){let d=mi(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,b)=>{let y=Math.max(b,f),w=Math.min(b+m.nodeSize,h);m.marks.find(M=>M.type===u)?m.marks.forEach(M=>{u===M.type&&n.addMark(y,w,u.create({...M.attrs,...e}))}):n.addMark(y,w,u.create(e))})});return yD(r,n,u)},vD=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),wD=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=Ut(t,n.schema);return o.isTextblock?i().command(({commands:s})=>tp(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>tp(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},xD=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=zr(t,0,r.content.size),o=he.create(r,i);e.setSelection(o)}return!0},_D=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},SD=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return cE(r)(e,n)};function gE(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 TD=({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=Kl(d,l.node().type.name,l.node().attrs);if(o instanceof he&&o.node.isBlock)return!l.parentOffset||!zn(s,l.pos)?!1:(r&&(t&&gE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){let h=u.parentOffset===u.parent.content.size;o instanceof ce&&e.deleteSelection();let m=l.depth===0?void 0:bp(l.node(-1).contentMatchAt(l.indexAfter(-1))),b=h&&m?[{type:m,attrs:f}]:void 0,y=zn(e.doc,e.mapping.map(l.pos),1,b);if(!b&&!y&&zn(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(y=!0,b=m?[{type:m,attrs:f}]:void 0),y&&(e.split(e.mapping.map(l.pos),1,b),m&&!h&&!l.parentOffset&&l.parent.type!==m)){let w=e.mapping.map(l.before()),x=e.doc.resolve(w);l.node(-1).canReplaceWith(x.index(),x.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&gE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},MD=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;let s=Ut(t,n.schema),{$from:l,$to:u}=n.selection,d=n.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;let f=l.node(-1);if(f.type!==s)return!1;let h=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let x=V.empty,M=l.index(-1)?1:l.index(-2)?2:3;for(let q=l.depth-M;q>=l.depth-3;q-=1)x=V.from(l.node(q).copy(x));let L=l.indexAfter(-1){if(O>-1)return!1;q.isTextblock&&q.content.size===0&&(O=J+1)}),O>-1&&e.setSelection(ce.near(e.doc.resolve(O))),e.scrollIntoView()}return!0}let m=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,b=Kl(h,f.type.name,f.attrs),y=Kl(h,l.node().type.name,l.node().attrs);e.delete(l.pos,u.pos);let w=m?[{type:s,attrs:b},{type:m,attrs:y}]:[{type:s,attrs:b}];if(!zn(e.doc,l.pos,2))return!1;if(r){let{selection:x,storedMarks:M}=n,{splittableMarks:L}=i.extensionManager,D=M||x.$to.parentOffset&&x.$from.marks();if(e.split(l.pos,2,w).scrollIntoView(),!D||!r)return!0;let S=D.filter(z=>L.includes(z.type.name));e.ensureMarks(S)}return!0},sp=(t,e)=>{let n=to(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},ap=(t,e)=>{let n=to(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},CD=(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,b=Ut(t,s.schema),y=Ut(e,s.schema),{selection:w,storedMarks:x}=s,{$from:M,$to:L}=w,D=M.blockRange(L),S=x||w.$to.parentOffset&&w.$from.marks();if(!D)return!1;let z=to(O=>mE(O.type.name,h))(w);if(D.depth>=1&&z&&D.depth-z.depth<=1){if(z.node.type===b)return d.liftListItem(y);if(mE(z.node.type.name,h)&&b.validContent(z.node.content)&&l)return u().command(()=>(o.setNodeMarkup(z.pos,b),!0)).command(()=>sp(o,b)).command(()=>ap(o,b)).run()}return!n||!S||!l?u().command(()=>f().wrapInList(b,r)?!0:d.clearNodes()).wrapInList(b,r).command(()=>sp(o,b)).command(()=>ap(o,b)).run():u().command(()=>{let O=f().wrapInList(b,r),q=S.filter(J=>m.includes(J.type.name));return o.ensureMarks(q),O?!0:d.clearNodes()}).wrapInList(b,r).command(()=>sp(o,b)).command(()=>ap(o,b)).run()},AD=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=hi(t,r.schema);return pp(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},kD=(t,e,n={})=>({state:r,commands:i})=>{let o=Ut(t,r.schema),s=Ut(e,r.schema);return js(r,o,n)?i.setNode(s):i.setNode(o,n)},ND=(t,e={})=>({state:n,commands:r})=>{let i=Ut(t,n.schema);return js(n,i,e)?r.lift(i):r.wrapIn(i,e)},OD=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=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},RD=()=>({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},ID=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=hi(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!i)return!0;if(f&&s){let{from:m,to:b}=l,y=(o=d.marks().find(x=>x.type===u))===null||o===void 0?void 0:o.attrs,w=mp(d,u,y);w&&(m=w.from,b=w.to),n.removeMark(m,b,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},DD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=Ql(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=hi(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(b=>{if(s===b.type){let y=Math.max(m,d),w=Math.min(m+h.nodeSize,f);n.addMark(y,w,s.create({...b.attrs,...e}))}})})}),!0):!1},LD=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return sE(i,e)(n,r)},PD=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return aE(i,e)(n,r)},BD=Object.freeze({__proto__:null,blur:_I,clearContent:SI,clearNodes:TI,command:MI,createParagraphNear:CI,cut:AI,deleteCurrentNode:kI,deleteNode:NI,deleteRange:OI,deleteSelection:RI,enter:II,exitCode:DI,extendMarkRange:PI,first:BI,focus:FI,forEach:HI,insertContent:zI,insertContentAt:WI,joinUp:KI,joinDown:VI,joinBackward:GI,joinForward:qI,joinItemBackward:YI,joinItemForward:JI,keyboardShortcut:ZI,lift:jI,liftEmptyBlock:QI,liftListItem:eD,newlineInCode:tD,resetAttributes:nD,scrollIntoView:rD,selectAll:iD,selectNodeBackward:oD,selectNodeForward:sD,selectParentNode:aD,selectTextblockEnd:lD,selectTextblockStart:cD,setContent:uD,setMark:ED,setMeta:vD,setNode:wD,setNodeSelection:xD,setTextSelection:_D,sinkListItem:SD,splitBlock:TD,splitListItem:MD,toggleList:CD,toggleMark:AD,toggleNode:kD,toggleWrap:ND,undoInputRule:OD,unsetAllMarks:RD,unsetMark:ID,updateAttributes:DD,wrapIn:LD,wrapInList:PD}),FD=Qe.create({name:"commands",addCommands(){return{...BD}}}),HD=Qe.create({name:"editable",addProseMirrorPlugins(){return[new Pe({key:new qe("editable"),props:{editable:()=>this.editor.options.editable}})]}}),zD=Qe.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Pe({key:new qe("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}}}})]}}),UD=Qe.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:b}=h,y=h.parent.isTextblock?l.doc.resolve(m-1):h,w=y.parent.type.spec.isolating,x=h.pos-h.parentOffset,M=w&&y.parent.childCount===1?x===h.pos:fe.atStart(d).from===m;return!f||!M||!b.type.isTextblock||b.textContent.length?!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 gp()||jl()?o:i},addProseMirrorPlugins(){return[new Pe({key:new qe("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(y=>y.docChanged)&&!e.doc.eq(n.doc)))return;let{empty:i,from:o,to:s}=e.selection,l=fe.atStart(e.doc).from,u=fe.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=Yl({state:n,transaction:h}),{commands:b}=new Vo({editor:this.editor,state:m});if(b.clearNodes(),!!h.steps.length)return h}})]}}),$D=Qe.create({name:"tabindex",addProseMirrorPlugins(){return[new Pe({key:new qe("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),WD=Object.freeze({__proto__:null,ClipboardTextSerializer:xI,Commands:FD,Editable:HD,FocusEvents:zD,Keymap:UD,Tabindex:$D}),KD=`.ProseMirror { +`,textSerializers:s={}}=n||{},l="",u=!0;return t.nodesBetween(r,i,(d,f,h,m)=>{var b;let y=s?.[d.type.name];y?(d.isBlock&&!u&&(l+=o,u=!0),h&&(l+=y({node:d,pos:f,parent:h,index:m,range:e}))):d.isText?(l+=(b=d?.text)===null||b===void 0?void 0:b.slice(Math.max(r,f)-f,i-f),u=!1):d.isBlock&&!u&&(l+=o,u=!0)}),l}function vE(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var xI=Qe.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Pe({key:new qe("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=vE(n);return EE(r,{from:s,to:l},{textSerializers:u})}}})]}}),_I=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),SI=(t=!1)=>({commands:e})=>e.setContent("",t),TI=()=>({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)),b=h.blockRange(m);if(!b)return;let y=Dr(b);if(l.type.isTextblock){let{defaultType:w}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(b.start,w)}(y||y===0)&&e.lift(b,y)})}),!0},MI=t=>e=>t(e),CI=()=>({state:t,dispatch:e})=>Zf(t,e),AI=(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},kI=()=>({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},NI=t=>({tr:e,state:n,dispatch:r})=>{let i=Ut(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},OI=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},RI=()=>({state:t,dispatch:e})=>Wl(t,e),II=()=>({commands:t})=>t.keyboardShortcut("Enter"),LI=()=>({state:t,dispatch:e})=>Xf(t,e);function Vl(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:hp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function fp(t,e,n={}){return t.find(r=>r.type===e&&Vl(r.attrs,n))}function DI(t,e,n={}){return!!fp(t,e,n)}function mp(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=fp([...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(fp([...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({tr:n,state:r,dispatch:i})=>{let o=hi(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:d,to:f}=l;if(i){let h=mp(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},BI=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{gp()&&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&&!Zl(n.state.selection))return s(),!0;let l=wE(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},HI=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),zI=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e);function pE(t){let e=`${t}`;return new window.DOMParser().parseFromString(e,"text/html").body}function Gl(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?V.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Gl("",e,n)}if(typeof t=="string"){let r=Wi.fromSchema(e);return n.slice?r.parseSlice(pE(t),n.parseOptions).content:r.parse(pE(t),n.parseOptions)}return Gl("",e,n)}function UI(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=f)}),t.setSelection(fe.near(t.doc.resolve(s),n))}var $I=t=>t.toString().startsWith("<"),WI=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};let s=Gl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,f=!0;if(($I(s)?s:[s]).forEach(m=>{m.check(),d=d?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),l===u&&f){let{parent:m}=r.doc.resolve(l);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(l-=1,u+=1)}d?Array.isArray(e)?r.insertText(e.map(m=>m.text||"").join(""),l,u):typeof e=="object"&&e&&e.text?r.insertText(e.text,l,u):r.insertText(e,l,u):r.replaceWith(l,u,s),n.updateSelection&&UI(r,r.steps.length-1,-1)}return!0},KI=()=>({state:t,dispatch:e})=>eE(t,e),VI=()=>({state:t,dispatch:e})=>tE(t,e),GI=()=>({state:t,dispatch:e})=>Kf(t,e),qI=()=>({state:t,dispatch:e})=>Gf(t,e),YI=()=>({tr:t,state:e,dispatch:n})=>{try{let r=Po(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},JI=()=>({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}};function jl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function XI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{let o=XI(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 js(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?Ut(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;let b=Math.max(r,m),y=Math.min(i,m+h.nodeSize);l.push({node:h,from:b,to:y})});let u=i-r,d=l.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>Vl(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var jI=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return js(n,i,e)?nE(n,r):!1},QI=()=>({state:t,dispatch:e})=>jf(t,e),eL=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return lE(r)(e,n)},tL=()=>({state:t,dispatch:e})=>Yf(t,e);function Ql(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function hE(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 nL=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=Ql(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=hi(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,hE(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&n.addMark(f,f+d.nodeSize,s.create(hE(h.attrs,e)))})})}),!0):!1},rL=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),iL=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),oL=()=>({state:t,dispatch:e})=>Vf(t,e),sL=()=>({state:t,dispatch:e})=>qf(t,e),aL=()=>({state:t,dispatch:e})=>rE(t,e),lL=()=>({state:t,dispatch:e})=>ep(t,e),cL=()=>({state:t,dispatch:e})=>Qf(t,e);function xE(t,e,n={}){return Gl(t,e,{slice:!1,parseOptions:n})}var uL=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{let{doc:s}=r,l=xE(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!e),!0};function mi(t,e){let n=hi(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 _E(t,e){let n=new si(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function bp(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function SE(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function yp(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 to(t){return e=>yp(e.$from,t)}function dL(t,e){let n=Ir.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function fL(t,e){let n={from:0,to:t.content.size};return EE(t,n,e)}function pL(t,e){let n=Ut(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 Ep(t,e){let n=Ql(typeof e=="string"?e:e.name,t.schema);return n==="node"?pL(t,e):n==="mark"?mi(t,e):{}}function hL(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 mL(t){let e=hL(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 TE(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}})})}),mL(r)}function ec(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t-1),s=mp(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Kl(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 pp(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?hi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>Vl(h.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:h,$to:m})=>{let b=h.pos,y=m.pos;t.doc.nodesBetween(b,y,(w,x)=>{if(!w.isText&&!w.marks.length)return;let M=Math.max(b,x),D=Math.min(y,x+w.nodeSize),L=D-M;s+=L,l.push(...w.marks.map(S=>({mark:S,from:M,to:D})))})}),s===0)return!1;let u=l.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>Vl(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 gL(t,e,n={}){if(!e)return js(t,null,n)||pp(t,null,n);let r=Ql(e,t.schema);return r==="node"?js(t,e,n):r==="mark"?pp(t,e,n):!1}function mE(t,e){let{nodeExtensions:n}=Jl(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Se(ie(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function bL(t){var e;let n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function ME(t){return t instanceof he}function tc(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),b=m-h,y=f-d,M={top:d,bottom:f,left:h,right:m,width:b,height:y,x:h,y:d};return{...M,toJSON:()=>M}}function yL(t,e,n){var r;let{selection:i}=e,o=null;if(Zl(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 b=!m||m.type.allowsMarkType(n),y=!!n.isInSet(f.marks)||!f.marks.some(w=>w.type.excludes(n));d=b&&y}return!d}),d})}var EL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,u=hi(t,r.schema);if(i)if(s){let d=mi(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,b)=>{let y=Math.max(b,f),w=Math.min(b+m.nodeSize,h);m.marks.find(M=>M.type===u)?m.marks.forEach(M=>{u===M.type&&n.addMark(y,w,u.create({...M.attrs,...e}))}):n.addMark(y,w,u.create(e))})});return yL(r,n,u)},vL=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),wL=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=Ut(t,n.schema);return o.isTextblock?i().command(({commands:s})=>tp(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>tp(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},xL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=zr(t,0,r.content.size),o=he.create(r,i);e.setSelection(o)}return!0},_L=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},SL=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return cE(r)(e,n)};function gE(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 TL=({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=Kl(d,l.node().type.name,l.node().attrs);if(o instanceof he&&o.node.isBlock)return!l.parentOffset||!zn(s,l.pos)?!1:(r&&(t&&gE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){let h=u.parentOffset===u.parent.content.size;o instanceof ce&&e.deleteSelection();let m=l.depth===0?void 0:bp(l.node(-1).contentMatchAt(l.indexAfter(-1))),b=h&&m?[{type:m,attrs:f}]:void 0,y=zn(e.doc,e.mapping.map(l.pos),1,b);if(!b&&!y&&zn(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(y=!0,b=m?[{type:m,attrs:f}]:void 0),y&&(e.split(e.mapping.map(l.pos),1,b),m&&!h&&!l.parentOffset&&l.parent.type!==m)){let w=e.mapping.map(l.before()),x=e.doc.resolve(w);l.node(-1).canReplaceWith(x.index(),x.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&gE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},ML=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;let s=Ut(t,n.schema),{$from:l,$to:u}=n.selection,d=n.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;let f=l.node(-1);if(f.type!==s)return!1;let h=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let x=V.empty,M=l.index(-1)?1:l.index(-2)?2:3;for(let q=l.depth-M;q>=l.depth-3;q-=1)x=V.from(l.node(q).copy(x));let D=l.indexAfter(-1){if(O>-1)return!1;q.isTextblock&&q.content.size===0&&(O=J+1)}),O>-1&&e.setSelection(ce.near(e.doc.resolve(O))),e.scrollIntoView()}return!0}let m=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,b=Kl(h,f.type.name,f.attrs),y=Kl(h,l.node().type.name,l.node().attrs);e.delete(l.pos,u.pos);let w=m?[{type:s,attrs:b},{type:m,attrs:y}]:[{type:s,attrs:b}];if(!zn(e.doc,l.pos,2))return!1;if(r){let{selection:x,storedMarks:M}=n,{splittableMarks:D}=i.extensionManager,L=M||x.$to.parentOffset&&x.$from.marks();if(e.split(l.pos,2,w).scrollIntoView(),!L||!r)return!0;let S=L.filter(z=>D.includes(z.type.name));e.ensureMarks(S)}return!0},sp=(t,e)=>{let n=to(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},ap=(t,e)=>{let n=to(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},CL=(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,b=Ut(t,s.schema),y=Ut(e,s.schema),{selection:w,storedMarks:x}=s,{$from:M,$to:D}=w,L=M.blockRange(D),S=x||w.$to.parentOffset&&w.$from.marks();if(!L)return!1;let z=to(O=>mE(O.type.name,h))(w);if(L.depth>=1&&z&&L.depth-z.depth<=1){if(z.node.type===b)return d.liftListItem(y);if(mE(z.node.type.name,h)&&b.validContent(z.node.content)&&l)return u().command(()=>(o.setNodeMarkup(z.pos,b),!0)).command(()=>sp(o,b)).command(()=>ap(o,b)).run()}return!n||!S||!l?u().command(()=>f().wrapInList(b,r)?!0:d.clearNodes()).wrapInList(b,r).command(()=>sp(o,b)).command(()=>ap(o,b)).run():u().command(()=>{let O=f().wrapInList(b,r),q=S.filter(J=>m.includes(J.type.name));return o.ensureMarks(q),O?!0:d.clearNodes()}).wrapInList(b,r).command(()=>sp(o,b)).command(()=>ap(o,b)).run()},AL=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=hi(t,r.schema);return pp(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},kL=(t,e,n={})=>({state:r,commands:i})=>{let o=Ut(t,r.schema),s=Ut(e,r.schema);return js(r,o,n)?i.setNode(s):i.setNode(o,n)},NL=(t,e={})=>({state:n,commands:r})=>{let i=Ut(t,n.schema);return js(n,i,e)?r.lift(i):r.wrapIn(i,e)},OL=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=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},RL=()=>({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},IL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=hi(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!i)return!0;if(f&&s){let{from:m,to:b}=l,y=(o=d.marks().find(x=>x.type===u))===null||o===void 0?void 0:o.attrs,w=mp(d,u,y);w&&(m=w.from,b=w.to),n.removeMark(m,b,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},LL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=Ql(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=hi(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(b=>{if(s===b.type){let y=Math.max(m,d),w=Math.min(m+h.nodeSize,f);n.addMark(y,w,s.create({...b.attrs,...e}))}})})}),!0):!1},DL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return sE(i,e)(n,r)},PL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return aE(i,e)(n,r)},BL=Object.freeze({__proto__:null,blur:_I,clearContent:SI,clearNodes:TI,command:MI,createParagraphNear:CI,cut:AI,deleteCurrentNode:kI,deleteNode:NI,deleteRange:OI,deleteSelection:RI,enter:II,exitCode:LI,extendMarkRange:PI,first:BI,focus:FI,forEach:HI,insertContent:zI,insertContentAt:WI,joinUp:KI,joinDown:VI,joinBackward:GI,joinForward:qI,joinItemBackward:YI,joinItemForward:JI,keyboardShortcut:ZI,lift:jI,liftEmptyBlock:QI,liftListItem:eL,newlineInCode:tL,resetAttributes:nL,scrollIntoView:rL,selectAll:iL,selectNodeBackward:oL,selectNodeForward:sL,selectParentNode:aL,selectTextblockEnd:lL,selectTextblockStart:cL,setContent:uL,setMark:EL,setMeta:vL,setNode:wL,setNodeSelection:xL,setTextSelection:_L,sinkListItem:SL,splitBlock:TL,splitListItem:ML,toggleList:CL,toggleMark:AL,toggleNode:kL,toggleWrap:NL,undoInputRule:OL,unsetAllMarks:RL,unsetMark:IL,updateAttributes:LL,wrapIn:DL,wrapInList:PL}),FL=Qe.create({name:"commands",addCommands(){return{...BL}}}),HL=Qe.create({name:"editable",addProseMirrorPlugins(){return[new Pe({key:new qe("editable"),props:{editable:()=>this.editor.options.editable}})]}}),zL=Qe.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Pe({key:new qe("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}}}})]}}),UL=Qe.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:b}=h,y=h.parent.isTextblock?l.doc.resolve(m-1):h,w=y.parent.type.spec.isolating,x=h.pos-h.parentOffset,M=w&&y.parent.childCount===1?x===h.pos:fe.atStart(d).from===m;return!f||!M||!b.type.isTextblock||b.textContent.length?!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 gp()||jl()?o:i},addProseMirrorPlugins(){return[new Pe({key:new qe("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(y=>y.docChanged)&&!e.doc.eq(n.doc)))return;let{empty:i,from:o,to:s}=e.selection,l=fe.atStart(e.doc).from,u=fe.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=Yl({state:n,transaction:h}),{commands:b}=new Vo({editor:this.editor,state:m});if(b.clearNodes(),!!h.steps.length)return h}})]}}),$L=Qe.create({name:"tabindex",addProseMirrorPlugins(){return[new Pe({key:new qe("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),WL=Object.freeze({__proto__:null,ClipboardTextSerializer:xI,Commands:FL,Editable:HL,FocusEvents:zL,Keymap:UL,Tabindex:$L}),KL=`.ProseMirror { position: relative; } @@ -103,18 +103,18 @@ img.ProseMirror-separator { .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 -}`;function VD(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 ql=class extends lp{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=VD(KD,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=yE(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(){let n=[...this.options.enableCoreExtensions?Object.values(WD):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new dp(n,this)}createCommandManager(){this.commandManager=new Vo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e=xE(this.options.content,this.schema,this.options.parseOptions),n=wE(e,this.options.autofocus);this.view=new Fl(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Al.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.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.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 Ep(this.state,e)}isActive(e,n){let r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return gD(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return dD(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:n=` +}`;function VL(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 ql=class extends lp{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=VL(KL,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=yE(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(){let n=[...this.options.enableCoreExtensions?Object.values(WL):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new dp(n,this)}createCommandManager(){this.commandManager=new Vo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e=xE(this.options.content,this.schema,this.options.parseOptions),n=wE(e,this.options.autofocus);this.view=new Fl(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Al.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.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.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 Ep(this.state,e)}isActive(e,n){let r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return gL(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 fD(this.state.doc,{blockSeparator:n,textSerializers:{...vE(this.schema),...r}})}get isEmpty(){return bD(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)}};function Wn(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Se(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(ec(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(w=>w===t.type&&w!==b.mark.type)).filter(b=>b.to>d).length)return null;fn.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 nc(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Se(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 r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l));o.scrollIntoView()}})}function Qs(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Se(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 gi(t){return new Go({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Se(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),d=u&&Lo(u,t.type,o);if(!d)return null;if(s.wrap(u,d),t.keepMarks&&t.editor){let{selection:h,storedMarks:m}=e,{splittableMarks:b}=t.editor.extensionManager,y=m||h.$to.parentOffset&&h.$from.marks();if(y){let w=y.filter(x=>b.includes(x.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 tt=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&&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=Se(ie(this,"addOptions",{name:this.name}))),this.storage=Se(ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Xl(this.options,e),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),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&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(ie(n,"addOptions",{name:n.name})),n.storage=Se(ie(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}},se=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&&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=Se(ie(this,"addOptions",{name:this.name}))),this.storage=Se(ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Xl(this.options,e),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),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&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(ie(n,"addOptions",{name:n.name})),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),n}};function xn(t){return new up({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Se(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(ec(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(x=>x===t.type&&x!==y.mark.type)).filter(y=>y.to>h).length)return null;mn.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 CE(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var GD=/^\s*>\s$/,AE=se.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[gi({find:GD,type:this.type})]}});var qD=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,YD=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,JD=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,XD=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,kE=tt.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[Wn({find:qD,type:this.type}),Wn({find:JD,type:this.type})]},addPasteRules(){return[xn({find:YD,type:this.type}),xn({find:XD,type:this.type})]}});var ZD=se.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)}}}),NE=tt.create({name:"textStyle",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=mi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),OE=/^\s*([-+*])\s$/,RE=se.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(ZD.name,this.editor.getAttributes(NE.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=gi({find:OE,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=gi({find:OE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(NE.name),editor:this.editor})),[t]}});var jD=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,QD=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,IE=tt.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[Wn({find:jD,type:this.type})]},addPasteRules(){return[xn({find:QD,type:this.type})]}});var DE=tt.create({name:"textStyle",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=mi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}});var LE=Qe.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 PE=se.create({name:"doc",topNode:!0,content:"block+"});function BE(t={}){return new Pe({view(e){return new vp(e,t)}})}var vp=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=Sl(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 FE=Qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[BE(this.options)]}});var rn=class t extends fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):fe.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 wp(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!eL(e)||!tL(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)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&&!he.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;fe.jsonID("gapcursor",rn);var wp=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):fe.near(n)}};function eL(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 tL(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 HE(){return new Pe({props:{decorations:oL,createSelectionBetween(t,e,n){return e.pos==n.pos&&rn.valid(n)?new rn(n):null},handleClick:rL,handleKeyDown:nL,handleDOMEvents:{beforeinput:iL}}})}var nL=Zs({ArrowLeft:rc("horiz",-1),ArrowRight:rc("horiz",1),ArrowUp:rc("vert",-1),ArrowDown:rc("vert",1)});function rc(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 rL(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&&he.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new rn(r))),!0)}function iL(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=V.empty;for(let s=r.length-1;s>=0;s--)i=V.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 oL(t){if(!(t.selection instanceof rn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",lt.create(t.doc,[Mt.widget(t.selection.head,e,{key:"gapcursor"})])}var zE=Qe.create({name:"gapCursor",addProseMirrorPlugins(){return[HE()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Se(ie(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var UE=se.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 $E=se.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=>Qs({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var ic=200,Yt=function(){};Yt.prototype.append=function(e){return e.length?(e=Yt.from(e),!this.length&&e||e.length=n?Yt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Yt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Yt.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)};Yt.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};Yt.from=function(e){return e instanceof Yt?e:e&&e.length?new WE(e):Yt.empty};var WE=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.leafAppend=function(i){if(this.length+i.length<=ic)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=ic)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}(Yt);Yt.empty=new WE([]);var sL=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 rl&&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=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}(Yt),xp=Yt;var aL=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 gr(h.map));let b=h.step.map(i.slice(o)),y;b&&s.maybeStep(b).doc&&(y=s.mapping.maps[s.mapping.maps.length-1],d.push(new gr(y,void 0,void 0,d.length+f.length))),o--,y&&i.appendMap(y,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;fcL&&(l=lL(l,d),s-=d),new t(l.append(o),s)}remapping(e,n){let r=new Bs;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 gr(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 b=o.getMirror(--u);if(b==null)return;s=Math.min(s,b);let y=o.maps[b];if(m.step){let w=e.steps[b].invert(e.docs[b]),x=m.selection&&m.selection.map(o.slice(u+1,b));x&&l++,r.push(new gr(y,w,x))}else r.push(new gr(y))},i);let d=[];for(let m=n;maL&&(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 gr(d.invert(),u,f),m,b=i.length-1;(m=i.length&&i[b].merge(h))?i[b]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new t(xp.from(i.reverse()),o)}};no.empty=new no(xp.empty,0);function lL(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var gr=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)}}},br=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},cL=20;function uL(t,e,n,r){let i=n.getMeta(bi),o;if(i)return i.historyState;n.getMeta(fL)&&(t=new br(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(bi))return s.getMeta(bi).redo?new br(t.done.addTransform(n,void 0,r,oc(e)),t.undone,KE(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new br(t.done,t.undone.addTransform(n,void 0,r,oc(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||!dL(n,t.prevRanges)),d=s?_p(t.prevRanges,n.mapping):KE(n.mapping.maps[n.steps.length-1]);return new br(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,oc(e)),no.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new br(t.done.rebased(n,o),t.undone.rebased(n,o),_p(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new br(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),_p(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function dL(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[o]&&(n=!0)}),n}function KE(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function _p(t,e){if(!t)return null;let n=[];for(let r=0;r{let n=bi.getState(t);return!n||n.done.eventCount==0?!1:(e&&GE(n,t,e,!1),!0)},Mp=(t,e)=>{let n=bi.getState(t);return!n||n.undone.eventCount==0?!1:(e&&GE(n,t,e,!0),!0)};var YE=Qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Tp(t,e),redo:()=>({state:t,dispatch:e})=>Mp(t,e)}},addProseMirrorPlugins(){return[qE(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var JE=se.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{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){let{$to:l}=i.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(ce.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(he.create(i.doc,l.pos)):i.setSelection(ce.create(i.doc,l.pos));else{let d=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(u,d),i.setSelection(ce.create(i.doc,u+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[nc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var pL=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,hL=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,mL=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,gL=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,XE=tt.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[Wn({find:pL,type:this.type}),Wn({find:mL,type:this.type})]},addPasteRules(){return[xn({find:hL,type:this.type}),xn({find:gL,type:this.type})]}});var Cp=se.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 bL=se.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)}}}),ZE=tt.create({name:"textStyle",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=mi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),jE=/^(\d+)\.\s$/,QE=se.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}}},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(bL.name,this.editor.getAttributes(ZE.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=gi({find:jE,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=gi({find:jE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ZE.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var sc=se.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 ev=Qe.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 Pe({key:new qe("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=t.type.createAndFill(),s=o?.sameMarkup(t)&&o.content.findDiffStart(t.content)===null;return t.descendants((l,u)=>{let d=r>=u&&r<=u+l.nodeSize,f=!l.isLeaf&&!l.childCount;if((d||!this.options.showOnlyCurrent)&&f){let h=[this.options.emptyNodeClass];s&&h.push(this.options.emptyEditorClass);let m=Mt.node(u,u+l.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:u,hasAnchor:d}):this.options.placeholder});i.push(m)}return this.options.includeChildren}),lt.create(t,i)}}})]}});var yL=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,EL=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,tv=tt.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(){let t={};return jl()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[Wn({find:yL,type:this.type})]},addPasteRules(){return[xn({find:EL,type:this.type})]}});var nv=tt.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 rv=tt.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 kp,Np;if(typeof WeakMap<"u"){let t=new WeakMap;kp=e=>t.get(e),Np=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;kp=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var bt=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=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:M-D});break}let S=i+D*e;for(let z=0;zr&&(o+=d.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function xL(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function SL(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 fc(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=qo(e.$head)||TL(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function TL(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 Op(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function ML(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Dp(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function fv(t,e,n){let r=t.node(-1),i=bt.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 pv(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=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 $s(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(Op(r)&&Op(i)&&Dp(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Ur.rowSelection(r,i):o&&this.isColSelection()?Ur.colSelection(r,i):new Ur(r,i)}return ce.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=bt.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;u0||x>0){let M=y.attrs;if(w>0&&(M=ro(M,0,w)),x>0&&(M=ro(M,M.colspan-x,x)),b.lefti.bottom){let M={...y.attrs,rowspan:Math.min(b.bottom,i.bottom)-Math.max(b.top,i.top)};b.top0)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=bt.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.bottom0&&(n=u.resolve(o+i.map[l.left])),s.bottom0)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 Ur&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=bt.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.right0&&(n=u.resolve(o+i.map[l.top*i.width])),s.right{e.push(Mt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),lt.create(t.doc,e)}function NL({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function OL({$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 RL(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof he&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=rt.create(i,r.from);else if(s=="row"){let l=i.resolve(r.from+1);o=rt.rowSelection(l,l)}else if(!n){let l=bt.get(r.node),u=r.from+1,d=u+l.map[l.width*l.height-1];o=rt.create(i,u+1,d)}}else r instanceof ce&&NL(r)?o=ce.create(i,r.from):r instanceof ce&&OL(r)&&(o=ce.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var IL=new qe("fix-tables");function mv(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=DL(t,i,o,n))};return e?e.doc!=t.doc&&mv(e.doc,t.doc,0,r):t.doc.descendants(r),n}function DL(t,e,n,r){let i=bt.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let u=0;u0){let b="cell";f.firstChild&&(b=f.firstChild.type.spec.tableRole);let y=[];for(let x=0;x0&&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=0;s--){let{rowspan:l,colspan:u}=o.child(s).attrs;for(let d=i;d=e.length&&e.push(V.empty),n[i]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 b=1;bi&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),u.push(h)}o.push(V.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function FL(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;he.height){let h=[];for(let y=0,w=(e.height-1)*e.width;y=e.width?!1:n.nodeAt(e.map[w+y]).type==u.header_cell;h.push(x?f||(f=u.header_cell.createAndFill()):d||(d=u.cell.createAndFill()))}let m=u.row.create(null,V.from(h)),b=[];for(let y=e.height;y{if(!i)return!1;let o=n.selection;if(o instanceof rt)return uc(n,r,fe.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=gv(i,t,e);if(s==null)return!1;if(t=="horiz")return uc(n,r,fe.near(n.doc.resolve(o.head+e),e));{let l=n.doc.resolve(s),u=fv(l,t,e),d;return u?d=fe.near(u,1):e<0?d=fe.near(n.doc.resolve(l.before(-1)),-1):d=fe.near(n.doc.resolve(l.after(-1)),1),uc(n,r,d)}}}function lc(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof rt)s=o;else{let u=gv(i,t,e);if(u==null)return!1;s=new rt(n.doc.resolve(u))}let l=fv(s.$headCell,t,e);return l?uc(n,r,new rt(s.$anchorCell,l)):!1}}function cc(t,e){let n=t.selection;if(!(n instanceof rt))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 zL(t,e){let n=t.state.doc,r=qo(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new rt(r))),!0):!1}function UL(t,e,n){if(!or(t.state))return!1;let r=LL(n),i=t.state.selection;if(i instanceof rt){r||(r={width:1,height:1,rows:[V.from(Rp(on(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=bt.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=BL(r,l.right-l.left,l.bottom-l.top),sv(t.state,t.dispatch,s,l,r),!0}else if(r){let o=fc(t.state),s=o.start(-1);return sv(t.state,t.dispatch,s,bt.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function $L(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=av(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof rt)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=qo(t.state.selection.$anchor))!=null&&((n=Ap(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,d){let f=Ap(t,d),h=yi.getState(t.state)==null;if(!f||!Dp(u,f))if(h)f=u;else return;let m=new rt(u,f);if(h||!t.state.selection.eq(m)){let b=t.state.tr.setSelection(m);h&&b.setMeta(yi,u.pos),t.dispatch(b)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),yi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(yi,-1))}function l(u){let d=u,f=yi.getState(t.state),h;if(f!=null)h=t.state.doc.resolve(f);else if(av(t,d.target)!=r&&(h=Ap(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 gv(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 av(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Ap(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?qo(t.state.doc.resolve(n.pos)):null}var WL=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")),Ip(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,Ip(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Ip(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;hnew n(l,e,u),new KL(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{let s=Kn.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{VL(o,s,t,e,r)},mouseleave:o=>{GL(o)},mousedown:(o,s)=>{qL(o,s,e)}},decorations:o=>{let s=Kn.getState(o);if(s&&s.activeHandle>-1)return QL(o,s.activeHandle)},nodeViews:{}}});return i}var KL=class dc{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(Kn);if(r&&r.setHandle!=null)return new dc(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new dc(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Op(e.doc.resolve(i))||(i=-1),new dc(i,n.dragging)}return n}};function VL(t,e,n,r,i){let o=Kn.getState(t.state);if(o&&!o.dragging){let s=JL(e.target),l=-1;if(s){let{left:u,right:d}=s.getBoundingClientRect();e.clientX-u<=n?l=lv(t,e,"left",n):d-e.clientX<=n&&(l=lv(t,e,"right",n))}if(l!=o.activeHandle){if(!i&&l!==-1){let u=t.state.doc.resolve(l),d=u.node(-1),f=bt.get(d),h=u.start(-1);if(f.colCount(u.pos-h)+u.nodeAfter.attrs.colspan-1==f.width-1)return}yv(t,l)}}}function GL(t){let e=Kn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&yv(t,-1)}function qL(t,e,n){let r=Kn.getState(t.state);if(!r||r.activeHandle==-1||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),o=YL(t,r.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(Kn,{setDragging:{startX:e.clientX,startWidth:o}}));function s(u){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",l);let d=Kn.getState(t.state);d?.dragging&&(XL(t,d.activeHandle,cv(d.dragging,u,n)),t.dispatch(t.state.tr.setMeta(Kn,{setDragging:null})))}function l(u){if(!u.which)return s(u);let d=Kn.getState(t.state);if(d&&d.dragging){let f=cv(d.dragging,u,n);ZL(t,d.activeHandle,f,n)}}return window.addEventListener("mouseup",s),window.addEventListener("mousemove",l),e.preventDefault(),!0}function YL(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;d0?-1:0;CL(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==u||i0?-1:0;tP(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let d=0,f=e.width*i;d0&&i0&&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(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function iP(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof rt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=SL(i.$from),!o)return!1;s=(r=qo(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=yr(e),h=e.tr;for(let b=0;b{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 oP(t){return function(e,n){if(!or(e))return!1;if(n){let r=on(e.schema),i=yr(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{let y=b+o.tableStart,w=s.doc.nodeAt(y);w&&s.setNodeMarkup(y,m,w.attrs)}),r(s)}return!0}}var WU=Yo("row",{useDeprecatedLogic:!0}),KU=Yo("column",{useDeprecatedLogic:!0}),Av=Yo("cell",{useDeprecatedLogic:!0});function sP(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()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 Nv({allowTableNodeSelection:t=!1}={}){return new Pe({key:yi,state:{init(){return null},apply(e,n){let r=e.getMeta(yi);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:kL,handleDOMEvents:{mousedown:$L},createSelectionBetween(e){return yi.getState(e.state)!=null?e.state.selection:null},handleTripleClick:zL,handleKeyDown:HL,handlePaste:UL},appendTransaction(e,n,r){return RL(r,Lp(r,n),t)}})}function Ov(t,e,n,r,i,o){let s=0,l=!0,u=e.firstChild,d=t.firstChild;for(let f=0,h=0;f{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function lP(t,e,n,r,i){let o=aP(t),s=[],l=[];for(let d=0;d{let{selection:e}=t.state;if(!cP(e))return!1;let n=0,r=yp(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},Iv=se.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Hp,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:t}){return["table",j(this.options.HTMLAttributes,t),["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=lP(o.schema,t,e,n);if(i){let l=r.selection.anchor+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(ce.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>vv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>wv(t,e),deleteColumn:()=>({state:t,dispatch:e})=>xv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Sv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Tv(t,e),deleteRow:()=>({state:t,dispatch:e})=>Mv(t,e),deleteTable:()=>({state:t,dispatch:e})=>kv(t,e),mergeCells:()=>({state:t,dispatch:e})=>Pp(t,e),splitCell:()=>({state:t,dispatch:e})=>Bp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Yo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Yo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>Av(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Pp(t,e)?!0:Bp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>Cv(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Fp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Fp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Lp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=rt.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:pc,"Mod-Backspace":pc,Delete:pc,"Mod-Delete":pc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[bv({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Nv({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Se(ie(t,"tableRole",e))}}});var Dv=se.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 Lv=se.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 Pv=se.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 Bv=se.create({name:"text",group:"inline"});var Fv=tt.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 uP=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,dP=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,Hv=tt.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[Wn({find:uP,type:this.type})]},addPasteRules(){return[xn({find:dP,type:this.type})]}});var zp=se.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 Up=se.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 fP="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",pP="\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",Zo=(t,e)=>{for(let n in e)t[n]=e[n];return t},Gp="numeric",qp="ascii",Yp="alpha",yc="asciinumeric",hc="alphanumeric",Jp="domain",Yv="emoji",hP="scheme",mP="slashscheme",zv="whitespace";function gP(t,e){return t in e||(e[t]=[]),e[t]}function io(t,e,n){e[Gp]&&(e[yc]=!0,e[hc]=!0),e[qp]&&(e[yc]=!0,e[Yp]=!0),e[yc]&&(e[hc]=!0),e[Yp]&&(e[hc]=!0),e[hc]&&(e[Jp]=!0),e[Yv]&&(e[Jp]=!0);for(let r in e){let i=gP(r,n);i.indexOf(t)<0&&i.push(t)}}function bP(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function _n(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}_n.groups={};_n.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),Vn=(t,e,n,r,i)=>t.tr(e,n,r,i),Uv=(t,e,n,r,i)=>t.ts(e,n,r,i),Q=(t,e,n,r,i)=>t.tt(e,n,r,i),$r="WORD",Xp="UWORD",ra="LOCALHOST",Zp="TLD",jp="UTLD",Ec="SCHEME",Xo="SLASH_SCHEME",Qp="NUM",Jv="WS",eh="NL",ea="OPENBRACE",ta="CLOSEBRACE",vc="OPENBRACKET",wc="CLOSEBRACKET",xc="OPENPAREN",_c="CLOSEPAREN",Sc="OPENANGLEBRACKET",Tc="CLOSEANGLEBRACKET",Mc="FULLWIDTHLEFTPAREN",Cc="FULLWIDTHRIGHTPAREN",Ac="LEFTCORNERBRACKET",kc="RIGHTCORNERBRACKET",Nc="LEFTWHITECORNERBRACKET",Oc="RIGHTWHITECORNERBRACKET",Rc="FULLWIDTHLESSTHAN",Ic="FULLWIDTHGREATERTHAN",Dc="AMPERSAND",Lc="APOSTROPHE",Pc="ASTERISK",vi="AT",Bc="BACKSLASH",Fc="BACKTICK",Hc="CARET",wi="COLON",th="COMMA",zc="DOLLAR",Er="DOT",Uc="EQUALS",nh="EXCLAMATION",vr="HYPHEN",$c="PERCENT",Wc="PIPE",Kc="PLUS",Vc="POUND",Gc="QUERY",rh="QUOTE",ih="SEMI",wr="SLASH",na="TILDE",qc="UNDERSCORE",Xv="EMOJI",Yc="SYM",Zv=Object.freeze({__proto__:null,WORD:$r,UWORD:Xp,LOCALHOST:ra,TLD:Zp,UTLD:jp,SCHEME:Ec,SLASH_SCHEME:Xo,NUM:Qp,WS:Jv,NL:eh,OPENBRACE:ea,CLOSEBRACE:ta,OPENBRACKET:vc,CLOSEBRACKET:wc,OPENPAREN:xc,CLOSEPAREN:_c,OPENANGLEBRACKET:Sc,CLOSEANGLEBRACKET:Tc,FULLWIDTHLEFTPAREN:Mc,FULLWIDTHRIGHTPAREN:Cc,LEFTCORNERBRACKET:Ac,RIGHTCORNERBRACKET:kc,LEFTWHITECORNERBRACKET:Nc,RIGHTWHITECORNERBRACKET:Oc,FULLWIDTHLESSTHAN:Rc,FULLWIDTHGREATERTHAN:Ic,AMPERSAND:Dc,APOSTROPHE:Lc,ASTERISK:Pc,AT:vi,BACKSLASH:Bc,BACKTICK:Fc,CARET:Hc,COLON:wi,COMMA:th,DOLLAR:zc,DOT:Er,EQUALS:Uc,EXCLAMATION:nh,HYPHEN:vr,PERCENT:$c,PIPE:Wc,PLUS:Kc,POUND:Vc,QUERY:Gc,QUOTE:rh,SEMI:ih,SLASH:wr,TILDE:na,UNDERSCORE:qc,EMOJI:Xv,SYM:Yc}),Jo=/[a-z]/,$p=/\p{L}/u,Wp=/\p{Emoji}/u;var Kp=/\d/,$v=/\s/;var Wv=` -`,yP="\uFE0F",EP="\u200D",mc=null,gc=null;function vP(t){t===void 0&&(t=[]);let e={};_n.groups=e;let n=new _n;mc==null&&(mc=Kv(fP)),gc==null&&(gc=Kv(pP)),Q(n,"'",Lc),Q(n,"{",ea),Q(n,"}",ta),Q(n,"[",vc),Q(n,"]",wc),Q(n,"(",xc),Q(n,")",_c),Q(n,"<",Sc),Q(n,">",Tc),Q(n,"\uFF08",Mc),Q(n,"\uFF09",Cc),Q(n,"\u300C",Ac),Q(n,"\u300D",kc),Q(n,"\u300E",Nc),Q(n,"\u300F",Oc),Q(n,"\uFF1C",Rc),Q(n,"\uFF1E",Ic),Q(n,"&",Dc),Q(n,"*",Pc),Q(n,"@",vi),Q(n,"`",Fc),Q(n,"^",Hc),Q(n,":",wi),Q(n,",",th),Q(n,"$",zc),Q(n,".",Er),Q(n,"=",Uc),Q(n,"!",nh),Q(n,"-",vr),Q(n,"%",$c),Q(n,"|",Wc),Q(n,"+",Kc),Q(n,"#",Vc),Q(n,"?",Gc),Q(n,'"',rh),Q(n,"/",wr),Q(n,";",ih),Q(n,"~",na),Q(n,"_",qc),Q(n,"\\",Bc);let r=Vn(n,Kp,Qp,{[Gp]:!0});Vn(r,Kp,r);let i=Vn(n,Jo,$r,{[qp]:!0});Vn(i,Jo,i);let o=Vn(n,$p,Xp,{[Yp]:!0});Vn(o,Jo),Vn(o,$p,o);let s=Vn(n,$v,Jv,{[zv]:!0});Q(n,Wv,eh,{[zv]:!0}),Q(s,Wv),Vn(s,$v,s);let l=Vn(n,Wp,Xv,{[Yv]:!0});Vn(l,Wp,l),Q(l,yP,l);let u=Q(l,EP);Vn(u,Wp,l);let d=[[Jo,i]],f=[[Jo,null],[$p,o]];for(let h=0;hh[0]>m[0]?1:-1);for(let h=0;h=0?y[Jp]=!0:Jo.test(m)?Kp.test(m)?y[yc]=!0:y[qp]=!0:y[Gp]=!0,Uv(n,m,m,y)}return Uv(n,"localhost",ra,{ascii:!0}),n.jd=new _n(Yc),{start:n,tokens:Zo({groups:e},Zv)}}function wP(t,e){let n=xP(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=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 xP(t){let e=[],n=t.length,r=0;for(;r56319||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 Ei(t,e,n,r,i){let o,s=e.length;for(let l=0;l=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 ia={defaultProtocol:"http",events:null,format:Vv,formatHref:Vv,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function oh(t,e){e===void 0&&(e=null);let n=Zo({},ia);t&&(n=Zo(n,t instanceof oh?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?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=ia.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&&Zo(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function Jc(t,e){class n extends jv{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 Gv=Jc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),qv=Jc("text"),_P=Jc("nl"),bc=Jc("url",{isLink:!0,toHref(t){return t===void 0&&(t=ia.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==ra&&t[1].t===wi}});var Gn=t=>new _n(t);function SP(t){let{groups:e}=t,n=e.domain.concat([Dc,Pc,vi,Bc,Fc,Hc,zc,Uc,vr,Qp,$c,Wc,Kc,Vc,wr,Yc,na,qc]),r=[Lc,wi,th,Er,nh,Gc,rh,ih,Sc,Tc,ea,ta,wc,vc,xc,_c,Mc,Cc,Ac,kc,Nc,Oc,Rc,Ic],i=[Dc,Lc,Pc,Bc,Fc,Hc,zc,Uc,vr,ea,ta,$c,Wc,Kc,Vc,Gc,wr,Yc,na,qc],o=Gn(),s=Q(o,na);Be(s,i,s),Be(s,e.domain,s);let l=Gn(),u=Gn(),d=Gn();Be(o,e.domain,l),Be(o,e.scheme,u),Be(o,e.slashscheme,d),Be(l,i,s),Be(l,e.domain,l);let f=Q(l,vi);Q(s,vi,f),Q(u,vi,f),Q(d,vi,f);let h=Q(s,Er);Be(h,i,s),Be(h,e.domain,s);let m=Gn();Be(f,e.domain,m),Be(m,e.domain,m);let b=Q(m,Er);Be(b,e.domain,m);let y=Gn(Gv);Be(b,e.tld,y),Be(b,e.utld,y),Q(f,ra,y);let w=Q(m,vr);Be(w,e.domain,m),Be(y,e.domain,m),Q(y,Er,b),Q(y,vr,w);let x=Q(y,wi);Be(x,e.numeric,Gv);let M=Q(l,vr),L=Q(l,Er);Be(M,e.domain,l),Be(L,i,s),Be(L,e.domain,l);let D=Gn(bc);Be(L,e.tld,D),Be(L,e.utld,D),Be(D,e.domain,l),Be(D,i,s),Q(D,Er,L),Q(D,vr,M),Q(D,vi,f);let S=Q(D,wi),z=Gn(bc);Be(S,e.numeric,z);let O=Gn(bc),q=Gn();Be(O,n,O),Be(O,r,q),Be(q,n,O),Be(q,r,q),Q(D,wr,O),Q(z,wr,O);let J=Q(u,wi),W=Q(d,wi),ue=Q(W,wr),ye=Q(ue,wr);Be(u,e.domain,l),Q(u,Er,L),Q(u,vr,M),Be(d,e.domain,l),Q(d,Er,L),Q(d,vr,M),Be(J,e.domain,O),Q(J,wr,O),Be(ye,e.domain,O),Be(ye,n,O),Q(ye,wr,O);let Te=[[ea,ta],[vc,wc],[xc,_c],[Sc,Tc],[Mc,Cc],[Ac,kc],[Nc,Oc],[Rc,Ic]];for(let ge=0;ge=0&&m++,i++,f++;if(m<0)i-=f,i0&&(o.push(Vp(qv,e,s)),s=[]),i-=m,f-=m;let b=h.t,y=n.slice(i-f,i);o.push(Vp(b,e,y))}}return s.length>0&&o.push(Vp(qv,e,s)),o}function Vp(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 MP=typeof console<"u"&&console&&console.warn||(()=>{}),CP="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ht={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Qv(){_n.groups={},ht.scanner=null,ht.parser=null,ht.tokenQueue=[],ht.pluginQueue=[],ht.customSchemes=[],ht.initialized=!1}function sh(t,e){if(e===void 0&&(e=!1),ht.initialized&&MP(`linkifyjs: already initialized - will not register custom scheme "${t}" ${CP}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +`,textSerializers:r={}}=e||{};return fL(this.state.doc,{blockSeparator:n,textSerializers:{...vE(this.schema),...r}})}get isEmpty(){return bL(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)}};function Wn(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Se(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(ec(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(w=>w===t.type&&w!==b.mark.type)).filter(b=>b.to>d).length)return null;fn.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 nc(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Se(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 r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l));o.scrollIntoView()}})}function Qs(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Se(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 gi(t){return new Go({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Se(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:b}=t.editor.extensionManager,y=m||h.$to.parentOffset&&h.$from.marks();if(y){let w=y.filter(x=>b.includes(x.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 tt=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&&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=Se(ie(this,"addOptions",{name:this.name}))),this.storage=Se(ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Xl(this.options,e),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),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&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(ie(n,"addOptions",{name:n.name})),n.storage=Se(ie(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}},se=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&&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=Se(ie(this,"addOptions",{name:this.name}))),this.storage=Se(ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend();return n.options=Xl(this.options,e),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),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&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(ie(n,"addOptions",{name:n.name})),n.storage=Se(ie(n,"addStorage",{name:n.name,options:n.options})),n}};function xn(t){return new up({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Se(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(ec(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(x=>x===t.type&&x!==y.mark.type)).filter(y=>y.to>h).length)return null;mn.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 CE(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var GL=/^\s*>\s$/,AE=se.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[gi({find:GL,type:this.type})]}});var qL=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,YL=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,JL=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,XL=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,kE=tt.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[Wn({find:qL,type:this.type}),Wn({find:JL,type:this.type})]},addPasteRules(){return[xn({find:YL,type:this.type}),xn({find:XL,type:this.type})]}});var ZL=se.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)}}}),NE=tt.create({name:"textStyle",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=mi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),OE=/^\s*([-+*])\s$/,RE=se.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(ZL.name,this.editor.getAttributes(NE.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=gi({find:OE,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=gi({find:OE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(NE.name),editor:this.editor})),[t]}});var jL=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,QL=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,IE=tt.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[Wn({find:jL,type:this.type})]},addPasteRules(){return[xn({find:QL,type:this.type})]}});var LE=tt.create({name:"textStyle",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=mi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}});var DE=Qe.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 PE=se.create({name:"doc",topNode:!0,content:"block+"});function BE(t={}){return new Pe({view(e){return new vp(e,t)}})}var vp=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=Sl(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 FE=Qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[BE(this.options)]}});var rn=class t extends fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):fe.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 wp(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!eD(e)||!tD(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)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&&!he.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;fe.jsonID("gapcursor",rn);var wp=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):fe.near(n)}};function eD(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 tD(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 HE(){return new Pe({props:{decorations:oD,createSelectionBetween(t,e,n){return e.pos==n.pos&&rn.valid(n)?new rn(n):null},handleClick:rD,handleKeyDown:nD,handleDOMEvents:{beforeinput:iD}}})}var nD=Zs({ArrowLeft:rc("horiz",-1),ArrowRight:rc("horiz",1),ArrowUp:rc("vert",-1),ArrowDown:rc("vert",1)});function rc(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 rD(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&&he.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new rn(r))),!0)}function iD(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=V.empty;for(let s=r.length-1;s>=0;s--)i=V.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 oD(t){if(!(t.selection instanceof rn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",lt.create(t.doc,[Mt.widget(t.selection.head,e,{key:"gapcursor"})])}var zE=Qe.create({name:"gapCursor",addProseMirrorPlugins(){return[HE()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Se(ie(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var UE=se.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 $E=se.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=>Qs({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var ic=200,Yt=function(){};Yt.prototype.append=function(e){return e.length?(e=Yt.from(e),!this.length&&e||e.length=n?Yt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Yt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Yt.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)};Yt.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};Yt.from=function(e){return e instanceof Yt?e:e&&e.length?new WE(e):Yt.empty};var WE=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.leafAppend=function(i){if(this.length+i.length<=ic)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=ic)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}(Yt);Yt.empty=new WE([]);var sD=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 rl&&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=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}(Yt),xp=Yt;var aD=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 gr(h.map));let b=h.step.map(i.slice(o)),y;b&&s.maybeStep(b).doc&&(y=s.mapping.maps[s.mapping.maps.length-1],d.push(new gr(y,void 0,void 0,d.length+f.length))),o--,y&&i.appendMap(y,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;fcD&&(l=lD(l,d),s-=d),new t(l.append(o),s)}remapping(e,n){let r=new Bs;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 gr(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 b=o.getMirror(--u);if(b==null)return;s=Math.min(s,b);let y=o.maps[b];if(m.step){let w=e.steps[b].invert(e.docs[b]),x=m.selection&&m.selection.map(o.slice(u+1,b));x&&l++,r.push(new gr(y,w,x))}else r.push(new gr(y))},i);let d=[];for(let m=n;maD&&(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 gr(d.invert(),u,f),m,b=i.length-1;(m=i.length&&i[b].merge(h))?i[b]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new t(xp.from(i.reverse()),o)}};no.empty=new no(xp.empty,0);function lD(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var gr=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)}}},br=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},cD=20;function uD(t,e,n,r){let i=n.getMeta(bi),o;if(i)return i.historyState;n.getMeta(fD)&&(t=new br(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(bi))return s.getMeta(bi).redo?new br(t.done.addTransform(n,void 0,r,oc(e)),t.undone,KE(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new br(t.done,t.undone.addTransform(n,void 0,r,oc(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||!dD(n,t.prevRanges)),d=s?_p(t.prevRanges,n.mapping):KE(n.mapping.maps[n.steps.length-1]);return new br(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,oc(e)),no.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new br(t.done.rebased(n,o),t.undone.rebased(n,o),_p(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new br(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),_p(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function dD(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[o]&&(n=!0)}),n}function KE(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function _p(t,e){if(!t)return null;let n=[];for(let r=0;r{let n=bi.getState(t);return!n||n.done.eventCount==0?!1:(e&&GE(n,t,e,!1),!0)},Mp=(t,e)=>{let n=bi.getState(t);return!n||n.undone.eventCount==0?!1:(e&&GE(n,t,e,!0),!0)};var YE=Qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Tp(t,e),redo:()=>({state:t,dispatch:e})=>Mp(t,e)}},addProseMirrorPlugins(){return[qE(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var JE=se.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{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){let{$to:l}=i.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(ce.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(he.create(i.doc,l.pos)):i.setSelection(ce.create(i.doc,l.pos));else{let d=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(u,d),i.setSelection(ce.create(i.doc,u+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[nc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var pD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,hD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,mD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,gD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,XE=tt.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[Wn({find:pD,type:this.type}),Wn({find:mD,type:this.type})]},addPasteRules(){return[xn({find:hD,type:this.type}),xn({find:gD,type:this.type})]}});var Cp=se.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 bD=se.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)}}}),ZE=tt.create({name:"textStyle",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=mi(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),jE=/^(\d+)\.\s$/,QE=se.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}}},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(bD.name,this.editor.getAttributes(ZE.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=gi({find:jE,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=gi({find:jE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ZE.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var sc=se.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 ev=Qe.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 Pe({key:new qe("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=t.type.createAndFill(),s=o?.sameMarkup(t)&&o.content.findDiffStart(t.content)===null;return t.descendants((l,u)=>{let d=r>=u&&r<=u+l.nodeSize,f=!l.isLeaf&&!l.childCount;if((d||!this.options.showOnlyCurrent)&&f){let h=[this.options.emptyNodeClass];s&&h.push(this.options.emptyEditorClass);let m=Mt.node(u,u+l.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:u,hasAnchor:d}):this.options.placeholder});i.push(m)}return this.options.includeChildren}),lt.create(t,i)}}})]}});var yD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,ED=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,tv=tt.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(){let t={};return jl()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[Wn({find:yD,type:this.type})]},addPasteRules(){return[xn({find:ED,type:this.type})]}});var nv=tt.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 rv=tt.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 kp,Np;if(typeof WeakMap<"u"){let t=new WeakMap;kp=e=>t.get(e),Np=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;kp=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var bt=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=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:M-L});break}let S=i+L*e;for(let z=0;zr&&(o+=d.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function xD(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function SD(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 fc(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=qo(e.$head)||TD(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function TD(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 Op(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function MD(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Lp(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function fv(t,e,n){let r=t.node(-1),i=bt.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 pv(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=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 $s(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(Op(r)&&Op(i)&&Lp(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Ur.rowSelection(r,i):o&&this.isColSelection()?Ur.colSelection(r,i):new Ur(r,i)}return ce.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=bt.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;u0||x>0){let M=y.attrs;if(w>0&&(M=ro(M,0,w)),x>0&&(M=ro(M,M.colspan-x,x)),b.lefti.bottom){let M={...y.attrs,rowspan:Math.min(b.bottom,i.bottom)-Math.max(b.top,i.top)};b.top0)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=bt.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.bottom0&&(n=u.resolve(o+i.map[l.left])),s.bottom0)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 Ur&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=bt.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.right0&&(n=u.resolve(o+i.map[l.top*i.width])),s.right{e.push(Mt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),lt.create(t.doc,e)}function ND({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function OD({$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 RD(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof he&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=rt.create(i,r.from);else if(s=="row"){let l=i.resolve(r.from+1);o=rt.rowSelection(l,l)}else if(!n){let l=bt.get(r.node),u=r.from+1,d=u+l.map[l.width*l.height-1];o=rt.create(i,u+1,d)}}else r instanceof ce&&ND(r)?o=ce.create(i,r.from):r instanceof ce&&OD(r)&&(o=ce.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var ID=new qe("fix-tables");function mv(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=LD(t,i,o,n))};return e?e.doc!=t.doc&&mv(e.doc,t.doc,0,r):t.doc.descendants(r),n}function LD(t,e,n,r){let i=bt.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let u=0;u0){let b="cell";f.firstChild&&(b=f.firstChild.type.spec.tableRole);let y=[];for(let x=0;x0&&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=0;s--){let{rowspan:l,colspan:u}=o.child(s).attrs;for(let d=i;d=e.length&&e.push(V.empty),n[i]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 b=1;bi&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),u.push(h)}o.push(V.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function FD(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;he.height){let h=[];for(let y=0,w=(e.height-1)*e.width;y=e.width?!1:n.nodeAt(e.map[w+y]).type==u.header_cell;h.push(x?f||(f=u.header_cell.createAndFill()):d||(d=u.cell.createAndFill()))}let m=u.row.create(null,V.from(h)),b=[];for(let y=e.height;y{if(!i)return!1;let o=n.selection;if(o instanceof rt)return uc(n,r,fe.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=gv(i,t,e);if(s==null)return!1;if(t=="horiz")return uc(n,r,fe.near(n.doc.resolve(o.head+e),e));{let l=n.doc.resolve(s),u=fv(l,t,e),d;return u?d=fe.near(u,1):e<0?d=fe.near(n.doc.resolve(l.before(-1)),-1):d=fe.near(n.doc.resolve(l.after(-1)),1),uc(n,r,d)}}}function lc(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof rt)s=o;else{let u=gv(i,t,e);if(u==null)return!1;s=new rt(n.doc.resolve(u))}let l=fv(s.$headCell,t,e);return l?uc(n,r,new rt(s.$anchorCell,l)):!1}}function cc(t,e){let n=t.selection;if(!(n instanceof rt))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 zD(t,e){let n=t.state.doc,r=qo(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new rt(r))),!0):!1}function UD(t,e,n){if(!or(t.state))return!1;let r=DD(n),i=t.state.selection;if(i instanceof rt){r||(r={width:1,height:1,rows:[V.from(Rp(on(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=bt.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=BD(r,l.right-l.left,l.bottom-l.top),sv(t.state,t.dispatch,s,l,r),!0}else if(r){let o=fc(t.state),s=o.start(-1);return sv(t.state,t.dispatch,s,bt.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function $D(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=av(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof rt)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=qo(t.state.selection.$anchor))!=null&&((n=Ap(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,d){let f=Ap(t,d),h=yi.getState(t.state)==null;if(!f||!Lp(u,f))if(h)f=u;else return;let m=new rt(u,f);if(h||!t.state.selection.eq(m)){let b=t.state.tr.setSelection(m);h&&b.setMeta(yi,u.pos),t.dispatch(b)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),yi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(yi,-1))}function l(u){let d=u,f=yi.getState(t.state),h;if(f!=null)h=t.state.doc.resolve(f);else if(av(t,d.target)!=r&&(h=Ap(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 gv(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 av(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Ap(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?qo(t.state.doc.resolve(n.pos)):null}var WD=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")),Ip(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,Ip(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Ip(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;hnew n(l,e,u),new KD(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{let s=Kn.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{VD(o,s,t,e,r)},mouseleave:o=>{GD(o)},mousedown:(o,s)=>{qD(o,s,e)}},decorations:o=>{let s=Kn.getState(o);if(s&&s.activeHandle>-1)return QD(o,s.activeHandle)},nodeViews:{}}});return i}var KD=class dc{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(Kn);if(r&&r.setHandle!=null)return new dc(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new dc(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Op(e.doc.resolve(i))||(i=-1),new dc(i,n.dragging)}return n}};function VD(t,e,n,r,i){let o=Kn.getState(t.state);if(o&&!o.dragging){let s=JD(e.target),l=-1;if(s){let{left:u,right:d}=s.getBoundingClientRect();e.clientX-u<=n?l=lv(t,e,"left",n):d-e.clientX<=n&&(l=lv(t,e,"right",n))}if(l!=o.activeHandle){if(!i&&l!==-1){let u=t.state.doc.resolve(l),d=u.node(-1),f=bt.get(d),h=u.start(-1);if(f.colCount(u.pos-h)+u.nodeAfter.attrs.colspan-1==f.width-1)return}yv(t,l)}}}function GD(t){let e=Kn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&yv(t,-1)}function qD(t,e,n){let r=Kn.getState(t.state);if(!r||r.activeHandle==-1||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),o=YD(t,r.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(Kn,{setDragging:{startX:e.clientX,startWidth:o}}));function s(u){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",l);let d=Kn.getState(t.state);d?.dragging&&(XD(t,d.activeHandle,cv(d.dragging,u,n)),t.dispatch(t.state.tr.setMeta(Kn,{setDragging:null})))}function l(u){if(!u.which)return s(u);let d=Kn.getState(t.state);if(d&&d.dragging){let f=cv(d.dragging,u,n);ZD(t,d.activeHandle,f,n)}}return window.addEventListener("mouseup",s),window.addEventListener("mousemove",l),e.preventDefault(),!0}function YD(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;d0?-1:0;CD(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==u||i0?-1:0;tP(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let d=0,f=e.width*i;d0&&i0&&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(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function iP(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof rt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=SD(i.$from),!o)return!1;s=(r=qo(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=yr(e),h=e.tr;for(let b=0;b{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 oP(t){return function(e,n){if(!or(e))return!1;if(n){let r=on(e.schema),i=yr(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{let y=b+o.tableStart,w=s.doc.nodeAt(y);w&&s.setNodeMarkup(y,m,w.attrs)}),r(s)}return!0}}var WU=Yo("row",{useDeprecatedLogic:!0}),KU=Yo("column",{useDeprecatedLogic:!0}),Av=Yo("cell",{useDeprecatedLogic:!0});function sP(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()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 Nv({allowTableNodeSelection:t=!1}={}){return new Pe({key:yi,state:{init(){return null},apply(e,n){let r=e.getMeta(yi);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:kD,handleDOMEvents:{mousedown:$D},createSelectionBetween(e){return yi.getState(e.state)!=null?e.state.selection:null},handleTripleClick:zD,handleKeyDown:HD,handlePaste:UD},appendTransaction(e,n,r){return RD(r,Dp(r,n),t)}})}function Ov(t,e,n,r,i,o){let s=0,l=!0,u=e.firstChild,d=t.firstChild;for(let f=0,h=0;f{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function lP(t,e,n,r,i){let o=aP(t),s=[],l=[];for(let d=0;d{let{selection:e}=t.state;if(!cP(e))return!1;let n=0,r=yp(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},Iv=se.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Hp,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:t}){return["table",j(this.options.HTMLAttributes,t),["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=lP(o.schema,t,e,n);if(i){let l=r.selection.anchor+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(ce.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>vv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>wv(t,e),deleteColumn:()=>({state:t,dispatch:e})=>xv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Sv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Tv(t,e),deleteRow:()=>({state:t,dispatch:e})=>Mv(t,e),deleteTable:()=>({state:t,dispatch:e})=>kv(t,e),mergeCells:()=>({state:t,dispatch:e})=>Pp(t,e),splitCell:()=>({state:t,dispatch:e})=>Bp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Yo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Yo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>Av(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Pp(t,e)?!0:Bp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>Cv(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Fp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Fp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Dp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=rt.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:pc,"Mod-Backspace":pc,Delete:pc,"Mod-Delete":pc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[bv({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Nv({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Se(ie(t,"tableRole",e))}}});var Lv=se.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 Dv=se.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 Pv=se.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 Bv=se.create({name:"text",group:"inline"});var Fv=tt.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 uP=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,dP=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,Hv=tt.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[Wn({find:uP,type:this.type})]},addPasteRules(){return[xn({find:dP,type:this.type})]}});var zp=se.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 Up=se.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 fP="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",pP="\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",Zo=(t,e)=>{for(let n in e)t[n]=e[n];return t},Gp="numeric",qp="ascii",Yp="alpha",yc="asciinumeric",hc="alphanumeric",Jp="domain",Yv="emoji",hP="scheme",mP="slashscheme",zv="whitespace";function gP(t,e){return t in e||(e[t]=[]),e[t]}function io(t,e,n){e[Gp]&&(e[yc]=!0,e[hc]=!0),e[qp]&&(e[yc]=!0,e[Yp]=!0),e[yc]&&(e[hc]=!0),e[Yp]&&(e[hc]=!0),e[hc]&&(e[Jp]=!0),e[Yv]&&(e[Jp]=!0);for(let r in e){let i=gP(r,n);i.indexOf(t)<0&&i.push(t)}}function bP(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function _n(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}_n.groups={};_n.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),Vn=(t,e,n,r,i)=>t.tr(e,n,r,i),Uv=(t,e,n,r,i)=>t.ts(e,n,r,i),Q=(t,e,n,r,i)=>t.tt(e,n,r,i),$r="WORD",Xp="UWORD",ra="LOCALHOST",Zp="TLD",jp="UTLD",Ec="SCHEME",Xo="SLASH_SCHEME",Qp="NUM",Jv="WS",eh="NL",ea="OPENBRACE",ta="CLOSEBRACE",vc="OPENBRACKET",wc="CLOSEBRACKET",xc="OPENPAREN",_c="CLOSEPAREN",Sc="OPENANGLEBRACKET",Tc="CLOSEANGLEBRACKET",Mc="FULLWIDTHLEFTPAREN",Cc="FULLWIDTHRIGHTPAREN",Ac="LEFTCORNERBRACKET",kc="RIGHTCORNERBRACKET",Nc="LEFTWHITECORNERBRACKET",Oc="RIGHTWHITECORNERBRACKET",Rc="FULLWIDTHLESSTHAN",Ic="FULLWIDTHGREATERTHAN",Lc="AMPERSAND",Dc="APOSTROPHE",Pc="ASTERISK",vi="AT",Bc="BACKSLASH",Fc="BACKTICK",Hc="CARET",wi="COLON",th="COMMA",zc="DOLLAR",Er="DOT",Uc="EQUALS",nh="EXCLAMATION",vr="HYPHEN",$c="PERCENT",Wc="PIPE",Kc="PLUS",Vc="POUND",Gc="QUERY",rh="QUOTE",ih="SEMI",wr="SLASH",na="TILDE",qc="UNDERSCORE",Xv="EMOJI",Yc="SYM",Zv=Object.freeze({__proto__:null,WORD:$r,UWORD:Xp,LOCALHOST:ra,TLD:Zp,UTLD:jp,SCHEME:Ec,SLASH_SCHEME:Xo,NUM:Qp,WS:Jv,NL:eh,OPENBRACE:ea,CLOSEBRACE:ta,OPENBRACKET:vc,CLOSEBRACKET:wc,OPENPAREN:xc,CLOSEPAREN:_c,OPENANGLEBRACKET:Sc,CLOSEANGLEBRACKET:Tc,FULLWIDTHLEFTPAREN:Mc,FULLWIDTHRIGHTPAREN:Cc,LEFTCORNERBRACKET:Ac,RIGHTCORNERBRACKET:kc,LEFTWHITECORNERBRACKET:Nc,RIGHTWHITECORNERBRACKET:Oc,FULLWIDTHLESSTHAN:Rc,FULLWIDTHGREATERTHAN:Ic,AMPERSAND:Lc,APOSTROPHE:Dc,ASTERISK:Pc,AT:vi,BACKSLASH:Bc,BACKTICK:Fc,CARET:Hc,COLON:wi,COMMA:th,DOLLAR:zc,DOT:Er,EQUALS:Uc,EXCLAMATION:nh,HYPHEN:vr,PERCENT:$c,PIPE:Wc,PLUS:Kc,POUND:Vc,QUERY:Gc,QUOTE:rh,SEMI:ih,SLASH:wr,TILDE:na,UNDERSCORE:qc,EMOJI:Xv,SYM:Yc}),Jo=/[a-z]/,$p=/\p{L}/u,Wp=/\p{Emoji}/u;var Kp=/\d/,$v=/\s/;var Wv=` +`,yP="\uFE0F",EP="\u200D",mc=null,gc=null;function vP(t){t===void 0&&(t=[]);let e={};_n.groups=e;let n=new _n;mc==null&&(mc=Kv(fP)),gc==null&&(gc=Kv(pP)),Q(n,"'",Dc),Q(n,"{",ea),Q(n,"}",ta),Q(n,"[",vc),Q(n,"]",wc),Q(n,"(",xc),Q(n,")",_c),Q(n,"<",Sc),Q(n,">",Tc),Q(n,"\uFF08",Mc),Q(n,"\uFF09",Cc),Q(n,"\u300C",Ac),Q(n,"\u300D",kc),Q(n,"\u300E",Nc),Q(n,"\u300F",Oc),Q(n,"\uFF1C",Rc),Q(n,"\uFF1E",Ic),Q(n,"&",Lc),Q(n,"*",Pc),Q(n,"@",vi),Q(n,"`",Fc),Q(n,"^",Hc),Q(n,":",wi),Q(n,",",th),Q(n,"$",zc),Q(n,".",Er),Q(n,"=",Uc),Q(n,"!",nh),Q(n,"-",vr),Q(n,"%",$c),Q(n,"|",Wc),Q(n,"+",Kc),Q(n,"#",Vc),Q(n,"?",Gc),Q(n,'"',rh),Q(n,"/",wr),Q(n,";",ih),Q(n,"~",na),Q(n,"_",qc),Q(n,"\\",Bc);let r=Vn(n,Kp,Qp,{[Gp]:!0});Vn(r,Kp,r);let i=Vn(n,Jo,$r,{[qp]:!0});Vn(i,Jo,i);let o=Vn(n,$p,Xp,{[Yp]:!0});Vn(o,Jo),Vn(o,$p,o);let s=Vn(n,$v,Jv,{[zv]:!0});Q(n,Wv,eh,{[zv]:!0}),Q(s,Wv),Vn(s,$v,s);let l=Vn(n,Wp,Xv,{[Yv]:!0});Vn(l,Wp,l),Q(l,yP,l);let u=Q(l,EP);Vn(u,Wp,l);let d=[[Jo,i]],f=[[Jo,null],[$p,o]];for(let h=0;hh[0]>m[0]?1:-1);for(let h=0;h=0?y[Jp]=!0:Jo.test(m)?Kp.test(m)?y[yc]=!0:y[qp]=!0:y[Gp]=!0,Uv(n,m,m,y)}return Uv(n,"localhost",ra,{ascii:!0}),n.jd=new _n(Yc),{start:n,tokens:Zo({groups:e},Zv)}}function wP(t,e){let n=xP(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=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 xP(t){let e=[],n=t.length,r=0;for(;r56319||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 Ei(t,e,n,r,i){let o,s=e.length;for(let l=0;l=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 ia={defaultProtocol:"http",events:null,format:Vv,formatHref:Vv,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function oh(t,e){e===void 0&&(e=null);let n=Zo({},ia);t&&(n=Zo(n,t instanceof oh?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?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=ia.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&&Zo(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function Jc(t,e){class n extends jv{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 Gv=Jc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),qv=Jc("text"),_P=Jc("nl"),bc=Jc("url",{isLink:!0,toHref(t){return t===void 0&&(t=ia.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==ra&&t[1].t===wi}});var Gn=t=>new _n(t);function SP(t){let{groups:e}=t,n=e.domain.concat([Lc,Pc,vi,Bc,Fc,Hc,zc,Uc,vr,Qp,$c,Wc,Kc,Vc,wr,Yc,na,qc]),r=[Dc,wi,th,Er,nh,Gc,rh,ih,Sc,Tc,ea,ta,wc,vc,xc,_c,Mc,Cc,Ac,kc,Nc,Oc,Rc,Ic],i=[Lc,Dc,Pc,Bc,Fc,Hc,zc,Uc,vr,ea,ta,$c,Wc,Kc,Vc,Gc,wr,Yc,na,qc],o=Gn(),s=Q(o,na);Be(s,i,s),Be(s,e.domain,s);let l=Gn(),u=Gn(),d=Gn();Be(o,e.domain,l),Be(o,e.scheme,u),Be(o,e.slashscheme,d),Be(l,i,s),Be(l,e.domain,l);let f=Q(l,vi);Q(s,vi,f),Q(u,vi,f),Q(d,vi,f);let h=Q(s,Er);Be(h,i,s),Be(h,e.domain,s);let m=Gn();Be(f,e.domain,m),Be(m,e.domain,m);let b=Q(m,Er);Be(b,e.domain,m);let y=Gn(Gv);Be(b,e.tld,y),Be(b,e.utld,y),Q(f,ra,y);let w=Q(m,vr);Be(w,e.domain,m),Be(y,e.domain,m),Q(y,Er,b),Q(y,vr,w);let x=Q(y,wi);Be(x,e.numeric,Gv);let M=Q(l,vr),D=Q(l,Er);Be(M,e.domain,l),Be(D,i,s),Be(D,e.domain,l);let L=Gn(bc);Be(D,e.tld,L),Be(D,e.utld,L),Be(L,e.domain,l),Be(L,i,s),Q(L,Er,D),Q(L,vr,M),Q(L,vi,f);let S=Q(L,wi),z=Gn(bc);Be(S,e.numeric,z);let O=Gn(bc),q=Gn();Be(O,n,O),Be(O,r,q),Be(q,n,O),Be(q,r,q),Q(L,wr,O),Q(z,wr,O);let J=Q(u,wi),W=Q(d,wi),ue=Q(W,wr),ye=Q(ue,wr);Be(u,e.domain,l),Q(u,Er,D),Q(u,vr,M),Be(d,e.domain,l),Q(d,Er,D),Q(d,vr,M),Be(J,e.domain,O),Q(J,wr,O),Be(ye,e.domain,O),Be(ye,n,O),Q(ye,wr,O);let Te=[[ea,ta],[vc,wc],[xc,_c],[Sc,Tc],[Mc,Cc],[Ac,kc],[Nc,Oc],[Rc,Ic]];for(let ge=0;ge=0&&m++,i++,f++;if(m<0)i-=f,i0&&(o.push(Vp(qv,e,s)),s=[]),i-=m,f-=m;let b=h.t,y=n.slice(i-f,i);o.push(Vp(b,e,y))}}return s.length>0&&o.push(Vp(qv,e,s)),o}function Vp(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 MP=typeof console<"u"&&console&&console.warn||(()=>{}),CP="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ht={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Qv(){_n.groups={},ht.scanner=null,ht.parser=null,ht.tokenQueue=[],ht.pluginQueue=[],ht.customSchemes=[],ht.initialized=!1}function sh(t,e){if(e===void 0&&(e=!1),ht.initialized&&MP(`linkifyjs: already initialized - will not register custom scheme "${t}" ${CP}`),!/^[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`);ht.customSchemes.push([t,e])}function AP(){ht.scanner=vP(ht.customSchemes);for(let t=0;t{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=_E(n.doc,[...e]);if(TE(l).forEach(({newRange:d})=>{let f=SE(r.doc,d,b=>b.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 b=m.split(" ").filter(x=>x!=="");if(b.length<=0)return!1;let y=b[b.length-1],w=h.pos+m.lastIndexOf(y);if(!y)return!1;Xc(y).filter(x=>x.isLink).map(x=>({...x,from:w+x.start+1,to:w+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate?t.validate(x.value):!0).forEach(x=>{ec(x.from,x.to,r.doc).some(M=>M.mark.type===t.type)||s.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!s.steps.length)return s}})}function OP(t){return new Pe({key:new qe("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;let l=Ep(e.state,t.type.name),u=r.target,d=(i=u?.href)!==null&&i!==void 0?i:l.href,f=(o=u?.target)!==null&&o!==void 0?o:l.target;return u&&d?(e.editable&&window.open(d,f),!0):!1}}})}function RP(t){return new Pe({key:new qe("handlePasteLink"),props:{handlePaste:(e,n,r)=>{var i;let{state:o}=e,{selection:s}=o,{empty:l}=s;if(l)return!1;let u="";r.content.forEach(y=>{u+=y.textContent});let d=Xc(u).find(y=>y.isLink&&y.value===u);if(!u||!d)return!1;let f=(i=n.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),h=/href="([^"]*)"/,m=f?.match(h),b=m?m[1]:d.href;return t.editor.commands.setMark(t.type,{href:b}),!0}}})}var ew=tt.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){sh(t);return}sh(t.scheme,t.optionalSlashes)})},onDestroy(){Qv()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){var e;return!((e=t.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",j(this.options.HTMLAttributes,{...t,href:""}),0]:["a",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xn({find:t=>Xc(t).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:(t,e)=>{var n,r;let i=(n=e?.clipboardData)===null||n===void 0?void 0:n.getData("text/html"),o=/href="([^"]*)"/,s=i?.match(o);return s?{href:s[1]}:{href:(r=t.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){let t=[];return this.options.autolink&&t.push(NP({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push(OP({type:this.type})),this.options.linkOnPaste&&t.push(RP({editor:this.editor,type:this.type})),t}});var ah=ew.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 IP=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,tw=se.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[nc({find:IP,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var lh=tw.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},lazy:{default:!1,getAttrs:t=>t?{"data-lazy":t}:null,renderHTML:t=>{if(t.lazy)return{"data-lazy":t.lazy}}}}}});var DP=sc.extend({addAttributes(){return{class:{default:null}}}});var ch=tt.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 nw(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function rw(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 iw(t,e,n,r){let i=rw(t),o=[];for(let s=0;st.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=iw(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:Se(ie(t,"gridRole",e))}}});var dh=se.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 sw=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),ow=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",aw=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?`${ow(r)}${d}`:null}let s=/v=([-\w]+)/gm.exec(e);if(!s||!s[1])return null;let l=`${ow(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 fh=se.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})=>sw(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},renderHTML({HTMLAttributes:t}){let e=aw({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 lw=t=>t.match(/(vimeo\.com)(.+)?$/),cw=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 ph=se.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})=>lw(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},renderHTML({HTMLAttributes:t}){let e=cw({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 hh=se.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 mh=se.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=to(M=>M.type===this.type)(n);if(!i)return!1;let o=eo(i.node,M=>M.type===r.nodes.detailsSummary),s=eo(i.node,M=>M.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},b=u.node.content.toJSON()||[],y=f.parent.type.contentMatch.defaultType,x=[y?.create(null,l.node.content).toJSON(),...b];return e().insertContentAt(m,x).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 gh=se.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 bh=se.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=to(ye=>ye.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),b=u-1,y=s.node.child(b),w=m.posAtIndex(b,s.depth);if(!y.eq(h))return!1;let M=i.node(-3);if(!M)return!1;let L=i.indexAfter(-3),D=bp(M.contentMatchAt(L));if(!D||!M.canReplaceWith(L,L,D))return!1;let S=D.createAndFill();if(!S)return!1;let{tr:z}=e,O=i.after(-2);z.replaceWith(O,O,S);let q=z.doc.resolve(O),J=fe.near(q,1);z.setSelection(J);let W=w,ue=w+y.nodeSize;return z.delete(W,ue),z.scrollIntoView(),n.dispatch(z),!0}}}});var LP=/^```([a-z]+)?[\s\n]$/,PP=/^~~~([a-z]+)?[\s\n]$/,uw=se.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,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(` +3. "-" cannot repeat`);ht.customSchemes.push([t,e])}function AP(){ht.scanner=vP(ht.customSchemes);for(let t=0;t{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=_E(n.doc,[...e]);if(TE(l).forEach(({newRange:d})=>{let f=SE(r.doc,d,b=>b.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 b=m.split(" ").filter(x=>x!=="");if(b.length<=0)return!1;let y=b[b.length-1],w=h.pos+m.lastIndexOf(y);if(!y)return!1;Xc(y).filter(x=>x.isLink).map(x=>({...x,from:w+x.start+1,to:w+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate?t.validate(x.value):!0).forEach(x=>{ec(x.from,x.to,r.doc).some(M=>M.mark.type===t.type)||s.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!s.steps.length)return s}})}function OP(t){return new Pe({key:new qe("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;let l=Ep(e.state,t.type.name),u=r.target,d=(i=u?.href)!==null&&i!==void 0?i:l.href,f=(o=u?.target)!==null&&o!==void 0?o:l.target;return u&&d?(e.editable&&window.open(d,f),!0):!1}}})}function RP(t){return new Pe({key:new qe("handlePasteLink"),props:{handlePaste:(e,n,r)=>{var i;let{state:o}=e,{selection:s}=o,{empty:l}=s;if(l)return!1;let u="";r.content.forEach(y=>{u+=y.textContent});let d=Xc(u).find(y=>y.isLink&&y.value===u);if(!u||!d)return!1;let f=(i=n.clipboardData)===null||i===void 0?void 0:i.getData("text/html"),h=/href="([^"]*)"/,m=f?.match(h),b=m?m[1]:d.href;return t.editor.commands.setMark(t.type,{href:b}),!0}}})}var ew=tt.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){sh(t);return}sh(t.scheme,t.optionalSlashes)})},onDestroy(){Qv()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){var e;return!((e=t.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",j(this.options.HTMLAttributes,{...t,href:""}),0]:["a",j(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xn({find:t=>Xc(t).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:(t,e)=>{var n,r;let i=(n=e?.clipboardData)===null||n===void 0?void 0:n.getData("text/html"),o=/href="([^"]*)"/,s=i?.match(o);return s?{href:s[1]}:{href:(r=t.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){let t=[];return this.options.autolink&&t.push(NP({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push(OP({type:this.type})),this.options.linkOnPaste&&t.push(RP({editor:this.editor,type:this.type})),t}});var ah=ew.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 IP=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,tw=se.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[nc({find:IP,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var lh=tw.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(console.log(t),t.lazy)return{"data-lazy":t.lazy,loading:"lazy"}}}}}});var LP=sc.extend({addAttributes(){return{class:{default:null}}}});var ch=tt.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 nw(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function rw(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 iw(t,e,n,r){let i=rw(t),o=[];for(let s=0;st.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=iw(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:Se(ie(t,"gridRole",e))}}});var dh=se.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 sw=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),ow=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",aw=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?`${ow(r)}${d}`:null}let s=/v=([-\w]+)/gm.exec(e);if(!s||!s[1])return null;let l=`${ow(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 fh=se.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})=>sw(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},renderHTML({HTMLAttributes:t}){let e=aw({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 lw=t=>t.match(/(vimeo\.com)(.+)?$/),cw=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 ph=se.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})=>lw(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},renderHTML({HTMLAttributes:t}){let e=cw({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 hh=se.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 mh=se.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=to(M=>M.type===this.type)(n);if(!i)return!1;let o=eo(i.node,M=>M.type===r.nodes.detailsSummary),s=eo(i.node,M=>M.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},b=u.node.content.toJSON()||[],y=f.parent.type.contentMatch.defaultType,x=[y?.create(null,l.node.content).toJSON(),...b];return e().insertContentAt(m,x).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 gh=se.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 bh=se.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=to(ye=>ye.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),b=u-1,y=s.node.child(b),w=m.posAtIndex(b,s.depth);if(!y.eq(h))return!1;let M=i.node(-3);if(!M)return!1;let D=i.indexAfter(-3),L=bp(M.contentMatchAt(D));if(!L||!M.canReplaceWith(D,D,L))return!1;let S=L.createAndFill();if(!S)return!1;let{tr:z}=e,O=i.after(-2);z.replaceWith(O,O,S);let q=z.doc.resolve(O),J=fe.near(q,1);z.setSelection(J);let W=w,ue=w+y.nodeSize;return z.delete(W,ue),z.scrollIntoView(),n.dispatch(z),!0}}}});var DP=/^```([a-z]+)?[\s\n]$/,PP=/^~~~([a-z]+)?[\s\n]$/,uw=se.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,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||r.nodeAt(l)?!1:t.commands.exitCode()}}},addInputRules(){return[Qs({find:LP,type:this.type,getAttributes:t=>({language:t[1]})}),Qs({find:PP,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Pe({key:new qe("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}=t.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(ce.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,` +`);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||r.nodeAt(l)?!1:t.commands.exitCode()}}},addInputRules(){return[Qs({find:DP,type:this.type,getAttributes:t=>({language:t[1]})}),Qs({find:PP,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Pe({key:new qe("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}=t.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(ce.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,` `)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});var _h={exports:{}};function Sh(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(function(e){var n=t[e];typeof n=="object"&&!Object.isFrozen(n)&&Sh(n)}),t}_h.exports=Sh;_h.exports.default=Sh;var jc=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Ew(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function xi(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 BP="",dw=t=>!!t.scope||t.sublanguage&&t.language,FP=(t,{prefix:e})=>{if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Eh=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Ew(e)}openNode(e){if(!dw(e))return;let n="";e.sublanguage?n=`language-${e.language}`:n=FP(e.scope,{prefix:this.classPrefix}),this.span(n)}closeNode(e){dw(e)&&(this.buffer+=BP)}value(){return this.buffer}span(e){this.buffer+=``}},fw=(t={})=>{let e={children:[]};return Object.assign(e,t),e},vh=class t{constructor(){this.rootNode=fw(),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=fw({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)}))}},wh=class extends vh{constructor(e){super(),this.options=e}addKeyword(e,n){e!==""&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,n){let r=e.root;r.sublanguage=!0,r.language=n,this.add(r)}toHTML(){return new Eh(this,this.options).value()}finalize(){return!0}};function oa(t){return t?typeof t=="string"?t:t.source:null}function vw(t){return so("(?=",t,")")}function HP(t){return so("(?:",t,")*")}function zP(t){return so("(?:",t,")?")}function so(...t){return t.map(n=>oa(n)).join("")}function UP(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Th(...t){return"("+(UP(t).capture?"":"?:")+t.map(r=>oa(r)).join("|")+")"}function ww(t){return new RegExp(t.toString()+"|").exec("").length-1}function $P(t,e){let n=t&&t.exec(e);return n&&n.index===0}var WP=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Mh(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=oa(r),s="";for(;o.length>0;){let l=WP.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 KP=/\b\B/,xw="[a-zA-Z]\\w*",Ch="[a-zA-Z_]\\w*",_w="\\b\\d+(\\.\\d+)?",Sw="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Tw="\\b(0b[01]+)",VP="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",GP=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=so(e,/.*\b/,t.binary,/\b.*/)),xi({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},sa={begin:"\\\\[\\s\\S]",relevance:0},qP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[sa]},YP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[sa]},JP={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/},eu=function(t,e,n={}){let r=xi({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=Th("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:so(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},XP=eu("//","$"),ZP=eu("/\\*","\\*/"),jP=eu("#","$"),QP={scope:"number",begin:_w,relevance:0},eB={scope:"number",begin:Sw,relevance:0},tB={scope:"number",begin:Tw,relevance:0},nB={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[sa,{begin:/\[/,end:/\]/,relevance:0,contains:[sa]}]}]},rB={scope:"title",begin:xw,relevance:0},iB={scope:"title",begin:Ch,relevance:0},oB={begin:"\\.\\s*"+Ch,relevance:0},sB=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()}})},Zc=Object.freeze({__proto__:null,MATCH_NOTHING_RE:KP,IDENT_RE:xw,UNDERSCORE_IDENT_RE:Ch,NUMBER_RE:_w,C_NUMBER_RE:Sw,BINARY_NUMBER_RE:Tw,RE_STARTERS_RE:VP,SHEBANG:GP,BACKSLASH_ESCAPE:sa,APOS_STRING_MODE:qP,QUOTE_STRING_MODE:YP,PHRASAL_WORDS_MODE:JP,COMMENT:eu,C_LINE_COMMENT_MODE:XP,C_BLOCK_COMMENT_MODE:ZP,HASH_COMMENT_MODE:jP,NUMBER_MODE:QP,C_NUMBER_MODE:eB,BINARY_NUMBER_MODE:tB,REGEXP_MODE:nB,TITLE_MODE:rB,UNDERSCORE_TITLE_MODE:iB,METHOD_GUARD:oB,END_SAME_AS_BEGIN:sB});function aB(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function lB(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function cB(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=aB,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function uB(t,e){Array.isArray(t.illegal)&&(t.illegal=Th(...t.illegal))}function dB(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 fB(t,e){t.relevance===void 0&&(t.relevance=1)}var pB=(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=so(n.beforeMatch,vw(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},hB=["of","and","for","in","not","or","if","then","parent","list","value"],mB="keyword";function Mw(t,e,n=mB){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,Mw(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,gB(u[0],u[1])]})}}function gB(t,e){return e?Number(e):bB(t)?0:1}function bB(t){return hB.includes(t.toLowerCase())}var pw={},oo=t=>{console.error(t)},hw=(t,...e)=>{console.log(`WARN: ${t}`,...e)},jo=(t,e)=>{pw[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),pw[`${t}/${e}`]=!0)},Qc=new Error;function Cw(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+=ww(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function yB(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw oo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qc;if(typeof t.beginScope!="object"||t.beginScope===null)throw oo("beginScope must be object"),Qc;Cw(t,t.begin,{key:"beginScope"}),t.begin=Mh(t.begin,{joinWith:""})}}function EB(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw oo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qc;if(typeof t.endScope!="object"||t.endScope===null)throw oo("endScope must be object"),Qc;Cw(t,t.end,{key:"endScope"}),t.end=Mh(t.end,{joinWith:""})}}function vB(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function wB(t){vB(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),yB(t),EB(t)}function xB(t){function e(s,l){return new RegExp(oa(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+=ww(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(Mh(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;[lB,dB,wB,pB].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[cB,uB,fB].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=Mw(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=oa(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 _B(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=xi(t.classNameAliases||{}),o(t)}function Aw(t){return t?t.endsWithParent||Aw(t.starts):!1}function _B(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return xi(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Aw(t)?xi(t,{starts:t.starts?xi(t.starts):null}):Object.isFrozen(t)?xi(t):t}var SB="11.6.0",xh=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},yh=Ew,mw=xi,gw=Symbol("nomatch"),TB=7,MB=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:wh};function u(P){return l.noHighlightRe.test(P)}function d(P){let N=P.className+" ";N+=P.parentNode?P.parentNode.className:"";let R=l.languageDetectRe.exec(N);if(R){let K=W(R[1]);return K||(hw(o.replace("{}",R[1])),hw("Falling back to no-highlight mode for this block.",P)),K?R[1]:"no-highlight"}return N.split(/\s+/).find(K=>u(K)||W(K))}function f(P,N,R){let K="",te="";typeof N=="object"?(K=P,R=N.ignoreIllegals,te=N.language):(jo("10.7.0","highlight(lang, code, ...args) has been deprecated."),jo("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),te=P,K=N),R===void 0&&(R=!0);let pe={code:K,language:te};we("before:highlight",pe);let Ce=pe.result?pe.result:h(pe.language,pe.code,R);return Ce.code=pe.code,we("after:highlight",Ce),Ce}function h(P,N,R,K){let te=Object.create(null);function pe(X,re){return X.keywords[re]}function Ce(){if(!me.keywords){ee.addText(Ae);return}let X=0;me.keywordPatternRe.lastIndex=0;let re=me.keywordPatternRe.exec(Ae),H="";for(;re;){H+=Ae.substring(X,re.index);let Y=St.case_insensitive?re[0].toLowerCase():re[0],le=pe(me,Y);if(le){let[Me,ct]=le;if(ee.addText(H),H="",te[Y]=(te[Y]||0)+1,te[Y]<=TB&&(We+=ct),Me.startsWith("_"))H+=re[0];else{let Vt=St.classNameAliases[Me]||Me;ee.addKeyword(re[0],Vt)}}else H+=re[0];X=me.keywordPatternRe.lastIndex,re=me.keywordPatternRe.exec(Ae)}H+=Ae.substring(X),ee.addText(H)}function Ue(){if(Ae==="")return;let X=null;if(typeof me.subLanguage=="string"){if(!e[me.subLanguage]){ee.addText(Ae);return}X=h(me.subLanguage,Ae,!0,Kt[me.subLanguage]),Kt[me.subLanguage]=X._top}else X=b(Ae,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(We+=X.relevance),ee.addSublanguage(X._emitter,X.language)}function $e(){me.subLanguage!=null?Ue():Ce(),Ae=""}function He(X,re){let H=1,Y=re.length-1;for(;H<=Y;){if(!X._emit[H]){H++;continue}let le=St.classNameAliases[X[H]]||X[H],Me=re[H];le?ee.addKeyword(Me,le):(Ae=Me,Ce(),Ae=""),H++}}function Je(X,re){return X.scope&&typeof X.scope=="string"&&ee.openNode(St.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(ee.addKeyword(Ae,St.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),Ae=""):X.beginScope._multi&&(He(X.beginScope,re),Ae="")),me=Object.create(X,{parent:{value:me}}),me}function xt(X,re,H){let Y=$P(X.endRe,H);if(Y){if(X["on:end"]){let le=new jc(X);X["on:end"](re,le),le.isMatchIgnored&&(Y=!1)}if(Y){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return xt(X.parent,re,H)}function Pt(X){return me.matcher.regexIndex===0?(Ae+=X[0],1):(Ot=!0,0)}function De(X){let re=X[0],H=X.rule,Y=new jc(H),le=[H.__beforeBegin,H["on:begin"]];for(let Me of le)if(Me&&(Me(X,Y),Y.isMatchIgnored))return Pt(re);return H.skip?Ae+=re:(H.excludeBegin&&(Ae+=re),$e(),!H.returnBegin&&!H.excludeBegin&&(Ae=re)),Je(H,X),H.returnBegin?0:re.length}function _t(X){let re=X[0],H=N.substring(X.index),Y=xt(me,X,H);if(!Y)return gw;let le=me;me.endScope&&me.endScope._wrap?($e(),ee.addKeyword(re,me.endScope._wrap)):me.endScope&&me.endScope._multi?($e(),He(me.endScope,X)):le.skip?Ae+=re:(le.returnEnd||le.excludeEnd||(Ae+=re),$e(),le.excludeEnd&&(Ae=re));do me.scope&&ee.closeNode(),!me.skip&&!me.subLanguage&&(We+=me.relevance),me=me.parent;while(me!==Y.parent);return Y.starts&&Je(Y.starts,X),le.returnEnd?0:re.length}function Xt(){let X=[];for(let re=me;re!==St;re=re.parent)re.scope&&X.unshift(re.scope);X.forEach(re=>ee.openNode(re))}let st={};function Zt(X,re){let H=re&&re[0];if(Ae+=X,H==null)return $e(),0;if(st.type==="begin"&&re.type==="end"&&st.index===re.index&&H===""){if(Ae+=N.slice(re.index,re.index+1),!i){let Y=new Error(`0 width match regex (${P})`);throw Y.languageName=P,Y.badRule=st.rule,Y}return 1}if(st=re,re.type==="begin")return De(re);if(re.type==="illegal"&&!R){let Y=new Error('Illegal lexeme "'+H+'" for mode "'+(me.scope||"")+'"');throw Y.mode=me,Y}else if(re.type==="end"){let Y=_t(re);if(Y!==gw)return Y}if(re.type==="illegal"&&H==="")return 1;if(mt>1e5&&mt>re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ae+=H,H.length}let St=W(P);if(!St)throw oo(o.replace("{}",P)),new Error('Unknown language: "'+P+'"');let Nt=xB(St),ft="",me=K||Nt,Kt={},ee=new l.__emitter(l);Xt();let Ae="",We=0,Oe=0,mt=0,Ot=!1;try{for(me.matcher.considerAll();;){mt++,Ot?Ot=!1:me.matcher.considerAll(),me.matcher.lastIndex=Oe;let X=me.matcher.exec(N);if(!X)break;let re=N.substring(Oe,X.index),H=Zt(re,X);Oe=X.index+H}return Zt(N.substring(Oe)),ee.closeAllNodes(),ee.finalize(),ft=ee.toHTML(),{language:P,value:ft,relevance:We,illegal:!1,_emitter:ee,_top:me}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:P,value:yh(N),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:Oe,context:N.slice(Oe-100,Oe+100),mode:X.mode,resultSoFar:ft},_emitter:ee};if(i)return{language:P,value:yh(N),illegal:!1,relevance:0,errorRaised:X,_emitter:ee,_top:me};throw X}}function m(P){let N={value:yh(P),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return N._emitter.addText(P),N}function b(P,N){N=N||l.languages||Object.keys(e);let R=m(P),K=N.filter(W).filter(ye).map($e=>h($e,P,!1));K.unshift(R);let te=K.sort(($e,He)=>{if($e.relevance!==He.relevance)return He.relevance-$e.relevance;if($e.language&&He.language){if(W($e.language).supersetOf===He.language)return 1;if(W(He.language).supersetOf===$e.language)return-1}return 0}),[pe,Ce]=te,Ue=pe;return Ue.secondBest=Ce,Ue}function y(P,N,R){let K=N&&n[N]||R;P.classList.add("hljs"),P.classList.add(`language-${K}`)}function w(P){let N=null,R=d(P);if(u(R))return;if(we("before:highlightElement",{el:P,language:R}),P.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(P)),l.throwUnescapedHTML))throw new xh("One of your code blocks includes unescaped HTML.",P.innerHTML);N=P;let K=N.textContent,te=R?f(K,{language:R,ignoreIllegals:!0}):b(K);P.innerHTML=te.value,y(P,R,te.language),P.result={language:te.language,re:te.relevance,relevance:te.relevance},te.secondBest&&(P.secondBest={language:te.secondBest.language,relevance:te.secondBest.relevance}),we("after:highlightElement",{el:P,result:te,text:K})}function x(P){l=mw(l,P)}let M=()=>{S(),jo("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function L(){S(),jo("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function S(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function z(){D&&S()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",z,!1);function O(P,N){let R=null;try{R=N(t)}catch(K){if(oo("Language definition for '{}' could not be registered.".replace("{}",P)),i)oo(K);else throw K;R=s}R.name||(R.name=P),e[P]=R,R.rawDefinition=N.bind(null,t),R.aliases&&ue(R.aliases,{languageName:P})}function q(P){delete e[P];for(let N of Object.keys(n))n[N]===P&&delete n[N]}function J(){return Object.keys(e)}function W(P){return P=(P||"").toLowerCase(),e[P]||e[n[P]]}function ue(P,{languageName:N}){typeof P=="string"&&(P=[P]),P.forEach(R=>{n[R.toLowerCase()]=N})}function ye(P){let N=W(P);return N&&!N.disableAutodetect}function Te(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=N=>{P["before:highlightBlock"](Object.assign({block:N.el},N))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=N=>{P["after:highlightBlock"](Object.assign({block:N.el},N))})}function ge(P){Te(P),r.push(P)}function we(P,N){let R=P;r.forEach(function(K){K[R]&&K[R](N)})}function xe(P){return jo("10.7.0","highlightBlock will be removed entirely in v12.0"),jo("10.7.0","Please use highlightElement now."),w(P)}Object.assign(t,{highlight:f,highlightAuto:b,highlightAll:S,highlightElement:w,highlightBlock:xe,configure:x,initHighlighting:M,initHighlightingOnLoad:L,registerLanguage:O,unregisterLanguage:q,listLanguages:J,getLanguage:W,registerAliases:ue,autoDetection:ye,inherit:mw,addPlugin:ge}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=SB,t.regex={concat:so,lookahead:vw,either:Th,optional:zP,anyNumberOfTimes:HP};for(let P in Zc)typeof Zc[P]=="object"&&_h.exports(Zc[P]);return Object.assign(t,Zc),t},aa=MB({}),CB=aa;aa.HighlightJS=aa;aa.default=aa;var AB=CB;function kw(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?kw(n.children,r):{text:n.value,classes:r}}).flat()}function bw(t){return t.value||t.children||[]}function kB(t){return!!AB.getLanguage(t)}function yw({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return eo(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)||kB(l))?bw(n.highlight(l,o.node.textContent)):bw(n.highlightAuto(o.node.textContent));kw(d).forEach(f=>{let h=s+f.text.length;if(f.classes.length){let m=Mt.inline(s,h,{class:f.classes.join(" ")});i.push(m)}s=h})}),lt.create(t,i)}function NB(t){return typeof t=="function"}function OB({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>NB(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new Pe({key:new qe("lowlight"),state:{init:(i,{doc:o})=>yw({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=eo(s.doc,m=>m.type.name===t),h=eo(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(b=>b.pos>=m.from&&b.pos+b.node.nodeSize<=m.to)))?yw({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 Nw=uw.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],OB({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var Ah=Nw.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 kh=se.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 Nh=Qe.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.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")}}});var yt="top",Dt="bottom",At="right",wt="left",tu="auto",_i=[yt,Dt,At,wt],Wr="start",ao="end",Ow="clippingParents",nu="viewport",Qo="popper",Rw="reference",Oh=_i.reduce(function(t,e){return t.concat([e+"-"+Wr,e+"-"+ao])},[]),ru=[].concat(_i,[tu]).reduce(function(t,e){return t.concat([e,e+"-"+Wr,e+"-"+ao])},[]),RB="beforeRead",IB="read",DB="afterRead",LB="beforeMain",PB="main",BB="afterMain",FB="beforeWrite",HB="write",zB="afterWrite",Iw=[RB,IB,DB,LB,PB,BB,FB,HB,zB];function $t(t){return t?(t.nodeName||"").toLowerCase():null}function dt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function qn(t){var e=dt(t).Element;return t instanceof e||t instanceof Element}function Lt(t){var e=dt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function es(t){if(typeof ShadowRoot>"u")return!1;var e=dt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function UB(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)||!$t(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 $B(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)||!$t(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var la={name:"applyStyles",enabled:!0,phase:"write",fn:UB,effect:$B,requires:["computeStyles"]};function Wt(t){return t.split("-")[0]}var sr=Math.max,lo=Math.min,Kr=Math.round;function ts(){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 ca(){return!/^((?!chrome|android).)*safari/i.test(ts())}function Yn(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&&Kr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Kr(r.height)/t.offsetHeight||1);var s=qn(t)?dt(t):window,l=s.visualViewport,u=!ca()&&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 co(t){var e=Yn(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 ua(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&es(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return dt(t).getComputedStyle(t)}function Rh(t){return["table","td","th"].indexOf($t(t))>=0}function Jt(t){return((qn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Vr(t){return $t(t)==="html"?t:t.assignedSlot||t.parentNode||(es(t)?t.host:null)||Jt(t)}function Dw(t){return!Lt(t)||gn(t).position==="fixed"?null:t.offsetParent}function WB(t){var e=/firefox/i.test(ts()),n=/Trident/i.test(ts());if(n&&Lt(t)){var r=gn(t);if(r.position==="fixed")return null}var i=Vr(t);for(es(i)&&(i=i.host);Lt(i)&&["html","body"].indexOf($t(i))<0;){var o=gn(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=dt(t),n=Dw(t);n&&Rh(n)&&gn(n).position==="static";)n=Dw(n);return n&&($t(n)==="html"||$t(n)==="body"&&gn(n).position==="static")?e:n||WB(t)||e}function uo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function fo(t,e,n){return sr(t,lo(e,n))}function Lw(t,e,n){var r=fo(t,e,n);return r>n?n:r}function da(){return{top:0,right:0,bottom:0,left:0}}function fa(t){return Object.assign({},da(),t)}function pa(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var KB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,fa(typeof e!="number"?e:pa(e,_i))};function VB(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=uo(l),d=[wt,At].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=KB(i.padding,n),m=co(o),b=u==="y"?yt:wt,y=u==="y"?Dt:At,w=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],x=s[u]-n.rects.reference[u],M=ar(o),L=M?u==="y"?M.clientHeight||0:M.clientWidth||0:0,D=w/2-x/2,S=h[b],z=L-m[f]-h[y],O=L/2-m[f]/2+D,q=fo(S,O,z),J=u;n.modifiersData[r]=(e={},e[J]=q,e.centerOffset=q-O,e)}}function GB(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)||ua(e.elements.popper,i)&&(e.elements.arrow=i))}var Pw={name:"arrow",enabled:!0,phase:"main",fn:VB,effect:GB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Jn(t){return t.split("-")[1]}var qB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function YB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Kr(n*i)/i||0,y:Kr(r*i)/i||0}}function Bw(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,b=m===void 0?0:m,y=s.y,w=y===void 0?0:y,x=typeof f=="function"?f({x:b,y:w}):{x:b,y:w};b=x.x,w=x.y;var M=s.hasOwnProperty("x"),L=s.hasOwnProperty("y"),D=wt,S=yt,z=window;if(d){var O=ar(n),q="clientHeight",J="clientWidth";if(O===dt(n)&&(O=Jt(n),gn(O).position!=="static"&&l==="absolute"&&(q="scrollHeight",J="scrollWidth")),O=O,i===yt||(i===wt||i===At)&&o===ao){S=Dt;var W=h&&O===z&&z.visualViewport?z.visualViewport.height:O[q];w-=W-r.height,w*=u?1:-1}if(i===wt||(i===yt||i===Dt)&&o===ao){D=At;var ue=h&&O===z&&z.visualViewport?z.visualViewport.width:O[J];b-=ue-r.width,b*=u?1:-1}}var ye=Object.assign({position:l},d&&qB),Te=f===!0?YB({x:b,y:w},dt(n)):{x:b,y:w};if(b=Te.x,w=Te.y,u){var ge;return Object.assign({},ye,(ge={},ge[S]=L?"0":"",ge[D]=M?"0":"",ge.transform=(z.devicePixelRatio||1)<=1?"translate("+b+"px, "+w+"px)":"translate3d("+b+"px, "+w+"px, 0)",ge))}return Object.assign({},ye,(e={},e[S]=L?w+"px":"",e[D]=M?b+"px":"",e.transform="",e))}function JB(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:Jn(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,Bw(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,Bw(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 Fw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JB,data:{}};var iu={passive:!0};function XB(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=dt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,iu)}),l&&u.addEventListener("resize",n.update,iu),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,iu)}),l&&u.removeEventListener("resize",n.update,iu)}}var Hw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:XB,data:{}};var ZB={left:"right",right:"left",bottom:"top",top:"bottom"};function ns(t){return t.replace(/left|right|bottom|top/g,function(e){return ZB[e]})}var jB={start:"end",end:"start"};function ou(t){return t.replace(/start|end/g,function(e){return jB[e]})}function po(t){var e=dt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ho(t){return Yn(Jt(t)).left+po(t).scrollLeft}function Ih(t,e){var n=dt(t),r=Jt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var d=ca();(d||!d&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+ho(t),y:u}}function Dh(t){var e,n=Jt(t),r=po(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+ho(t),u=-r.scrollTop;return gn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function mo(t){var e=gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function su(t){return["html","body","#document"].indexOf($t(t))>=0?t.ownerDocument.body:Lt(t)&&mo(t)?t:su(Vr(t))}function Si(t,e){var n;e===void 0&&(e=[]);var r=su(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=dt(r),s=i?[o].concat(o.visualViewport||[],mo(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Si(Vr(s)))}function rs(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function QB(t,e){var n=Yn(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 zw(t,e,n){return e===nu?rs(Ih(t,n)):qn(e)?QB(e,n):rs(Dh(Jt(t)))}function e2(t){var e=Si(Vr(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Lt(t)?ar(t):t;return qn(r)?e.filter(function(i){return qn(i)&&ua(i,r)&&$t(i)!=="body"}):[]}function Lh(t,e,n,r){var i=e==="clippingParents"?e2(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,d){var f=zw(t,d,r);return u.top=sr(f.top,u.top),u.right=lo(f.right,u.right),u.bottom=lo(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},zw(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 ha(t){var e=t.reference,n=t.element,r=t.placement,i=r?Wt(r):null,o=r?Jn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case yt:u={x:s,y:e.y-n.height};break;case Dt:u={x:s,y:e.y+e.height};break;case At:u={x:e.x+e.width,y:l};break;case wt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var d=i?uo(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Wr:u[d]=u[d]-(e[f]/2-n[f]/2);break;case ao: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?Ow:l,d=n.rootBoundary,f=d===void 0?nu:d,h=n.elementContext,m=h===void 0?Qo:h,b=n.altBoundary,y=b===void 0?!1:b,w=n.padding,x=w===void 0?0:w,M=fa(typeof x!="number"?x:pa(x,_i)),L=m===Qo?Rw:Qo,D=t.rects.popper,S=t.elements[y?L:m],z=Lh(qn(S)?S:S.contextElement||Jt(t.elements.popper),u,f,s),O=Yn(t.elements.reference),q=ha({reference:O,element:D,strategy:"absolute",placement:i}),J=rs(Object.assign({},D,q)),W=m===Qo?J:O,ue={top:z.top-W.top+M.top,bottom:W.bottom-z.bottom+M.bottom,left:z.left-W.left+M.left,right:W.right-z.right+M.right},ye=t.modifiersData.offset;if(m===Qo&&ye){var Te=ye[i];Object.keys(ue).forEach(function(ge){var we=[At,Dt].indexOf(ge)>=0?1:-1,xe=[yt,Dt].indexOf(ge)>=0?"y":"x";ue[ge]+=Te[xe]*we})}return ue}function Ph(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?ru:u,f=Jn(r),h=f?l?Oh:Oh.filter(function(y){return Jn(y)===f}):_i,m=h.filter(function(y){return d.indexOf(y)>=0});m.length===0&&(m=h);var b=m.reduce(function(y,w){return y[w]=lr(t,{placement:w,boundary:i,rootBoundary:o,padding:s})[Wt(w)],y},{});return Object.keys(b).sort(function(y,w){return b[y]-b[w]})}function t2(t){if(Wt(t)===tu)return[];var e=ns(t);return[ou(t),e,ou(e)]}function n2(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,b=n.flipVariations,y=b===void 0?!0:b,w=n.allowedAutoPlacements,x=e.options.placement,M=Wt(x),L=M===x,D=u||(L||!y?[ns(x)]:t2(x)),S=[x].concat(D).reduce(function($e,He){return $e.concat(Wt(He)===tu?Ph(e,{placement:He,boundary:f,rootBoundary:h,padding:d,flipVariations:y,allowedAutoPlacements:w}):He)},[]),z=e.rects.reference,O=e.rects.popper,q=new Map,J=!0,W=S[0],ue=0;ue=0,xe=we?"width":"height",P=lr(e,{placement:ye,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),N=we?ge?At:wt:ge?Dt:yt;z[xe]>O[xe]&&(N=ns(N));var R=ns(N),K=[];if(o&&K.push(P[Te]<=0),l&&K.push(P[N]<=0,P[R]<=0),K.every(function($e){return $e})){W=ye,J=!1;break}q.set(ye,K)}if(J)for(var te=y?3:1,pe=function(He){var Je=S.find(function(xt){var Pt=q.get(xt);if(Pt)return Pt.slice(0,He).every(function(De){return De})});if(Je)return W=Je,"break"},Ce=te;Ce>0;Ce--){var Ue=pe(Ce);if(Ue==="break")break}e.placement!==W&&(e.modifiersData[r]._skip=!0,e.placement=W,e.reset=!0)}}var Uw={name:"flip",enabled:!0,phase:"main",fn:n2,requiresIfExists:["offset"],data:{_skip:!1}};function $w(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 Ww(t){return[yt,At,Dt,wt].some(function(e){return t[e]>=0})}function r2(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=$w(s,r),d=$w(l,i,o),f=Ww(u),h=Ww(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 Kw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:r2};function i2(t,e,n){var r=Wt(t),i=[wt,yt].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,[wt,At].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function o2(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=ru.reduce(function(f,h){return f[h]=i2(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 Vw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:o2};function s2(t){var e=t.state,n=t.name;e.modifiersData[n]=ha({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Gw={name:"popperOffsets",enabled:!0,phase:"read",fn:s2,data:{}};function Bh(t){return t==="x"?"y":"x"}function a2(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,b=m===void 0?!0:m,y=n.tetherOffset,w=y===void 0?0:y,x=lr(e,{boundary:u,rootBoundary:d,padding:h,altBoundary:f}),M=Wt(e.placement),L=Jn(e.placement),D=!L,S=uo(M),z=Bh(S),O=e.modifiersData.popperOffsets,q=e.rects.reference,J=e.rects.popper,W=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,ue=typeof W=="number"?{mainAxis:W,altAxis:W}:Object.assign({mainAxis:0,altAxis:0},W),ye=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Te={x:0,y:0};if(O){if(o){var ge,we=S==="y"?yt:wt,xe=S==="y"?Dt:At,P=S==="y"?"height":"width",N=O[S],R=N+x[we],K=N-x[xe],te=b?-J[P]/2:0,pe=L===Wr?q[P]:J[P],Ce=L===Wr?-J[P]:-q[P],Ue=e.elements.arrow,$e=b&&Ue?co(Ue):{width:0,height:0},He=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:da(),Je=He[we],xt=He[xe],Pt=fo(0,q[P],$e[P]),De=D?q[P]/2-te-Pt-Je-ue.mainAxis:pe-Pt-Je-ue.mainAxis,_t=D?-q[P]/2+te+Pt+xt+ue.mainAxis:Ce+Pt+xt+ue.mainAxis,Xt=e.elements.arrow&&ar(e.elements.arrow),st=Xt?S==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,Zt=(ge=ye?.[S])!=null?ge:0,St=N+De-Zt-st,Nt=N+_t-Zt,ft=fo(b?lo(R,St):R,N,b?sr(K,Nt):K);O[S]=ft,Te[S]=ft-N}if(l){var me,Kt=S==="x"?yt:wt,ee=S==="x"?Dt:At,Ae=O[z],We=z==="y"?"height":"width",Oe=Ae+x[Kt],mt=Ae-x[ee],Ot=[yt,wt].indexOf(M)!==-1,X=(me=ye?.[z])!=null?me:0,re=Ot?Oe:Ae-q[We]-J[We]-X+ue.altAxis,H=Ot?Ae+q[We]+J[We]-X-ue.altAxis:mt,Y=b&&Ot?Lw(re,Ae,H):fo(b?re:Oe,Ae,b?H:mt);O[z]=Y,Te[z]=Y-Ae}e.modifiersData[r]=Te}}var qw={name:"preventOverflow",enabled:!0,phase:"main",fn:a2,requiresIfExists:["offset"]};function Fh(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Hh(t){return t===dt(t)||!Lt(t)?po(t):Fh(t)}function l2(t){var e=t.getBoundingClientRect(),n=Kr(e.width)/t.offsetWidth||1,r=Kr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function zh(t,e,n){n===void 0&&(n=!1);var r=Lt(e),i=Lt(e)&&l2(e),o=Jt(e),s=Yn(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(($t(e)!=="body"||mo(o))&&(l=Hh(e)),Lt(e)?(u=Yn(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=ho(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function c2(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 Uh(t){var e=c2(t);return Iw.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function $h(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Wh(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 Yw={placement:"bottom",modifiers:[],strategy:"absolute"};function Jw(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function ux(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Zw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function p2(t){return t.split(/\s+/).filter(Boolean)}function is(t){return[].concat(t)}function jw(t,e){t.indexOf(e)===-1&&t.push(e)}function h2(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function m2(t){return t.split("-")[0]}function lu(t){return[].slice.call(t)}function Qw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ma(){return document.createElement("div")}function cu(t){return["Element","Fragment"].some(function(e){return Zh(t,e)})}function g2(t){return Zh(t,"NodeList")}function b2(t){return Zh(t,"MouseEvent")}function y2(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function E2(t){return cu(t)?[t]:g2(t)?lu(t):Array.isArray(t)?t:lu(document.querySelectorAll(t))}function Gh(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function ex(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function v2(t){var e,n=is(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function w2(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=m2(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,b=d==="right"?f.left.x:0,y=d==="left"?f.right.x:0,w=o.top-r+h>u,x=r-o.bottom-m>u,M=o.left-n+b>u,L=n-o.right-y>u;return w||x||M||L})}function qh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function tx(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 xr={isTouch:!1},nx=0;function x2(){xr.isTouch||(xr.isTouch=!0,window.performance&&document.addEventListener("mousemove",dx))}function dx(){var t=performance.now();t-nx<20&&(xr.isTouch=!1,document.removeEventListener("mousemove",dx)),nx=t}function _2(){var t=document.activeElement;if(y2(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function S2(){document.addEventListener("touchstart",x2,go),window.addEventListener("blur",_2)}var T2=typeof window<"u"&&typeof document<"u",M2=T2?!!window.msCrypto:!1;var C2={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},A2={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:cx,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},C2,A2),k2=Object.keys(cr),N2=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function fx(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 O2(t,e){var n=e?Object.keys(fx(Object.assign({},cr,{plugins:e}))):k2,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 rx(t,e){var n=Object.assign({},e,{content:ux(e.content,[t])},e.ignoreAttributes?{}:O2(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 R2=function(){return"innerHTML"};function Jh(t,e){t[R2()]=e}function ix(t){var e=ma();return t===!0?e.className=ax:(e.className=lx,cu(t)?e.appendChild(t):Jh(e,t)),e}function ox(t,e){cu(e.content)?(Jh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Jh(t,e.content):t.textContent=e.content)}function Xh(t){var e=t.firstElementChild,n=lu(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(sx)}),arrow:n.find(function(r){return r.classList.contains(ax)||r.classList.contains(lx)}),backdrop:n.find(function(r){return r.classList.contains(f2)})}}function px(t){var e=ma(),n=ma();n.className=d2,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ma();r.className=sx,r.setAttribute("data-state","hidden"),ox(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Xh(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)&&ox(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(u.removeChild(f),u.appendChild(ix(s.arrow))):u.appendChild(ix(s.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}px.$$tippy=!0;var I2=1,au=[],Yh=[];function D2(t,e){var n=rx(t,Object.assign({},cr,fx(Qw(e)))),r,i,o,s=!1,l=!1,u=!1,d=!1,f,h,m,b=[],y=Zw(St,n.interactiveDebounce),w,x=I2++,M=null,L=h2(n.plugins),D={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},S={id:x,reference:t,popper:ma(),popperInstance:M,props:n,state:D,plugins:L,clearDelayTimeouts:re,setProps:H,setContent:Y,show:le,hide:Me,hideWithInteractivity:ct,enable:Ot,disable:X,unmount:Vt,destroy:Ci};if(!n.render)return S;var z=n.render(S),O=z.popper,q=z.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+S.id,S.popper=O,t._tippy=S,O._tippy=S;var J=L.map(function(B){return B.fn(S)}),W=t.hasAttribute("aria-expanded");return Xt(),te(),N(),R("onCreate",[S]),n.showOnCreate&&Oe(),O.addEventListener("mouseenter",function(){S.props.interactive&&S.state.isVisible&&S.clearDelayTimeouts()}),O.addEventListener("mouseleave",function(){S.props.interactive&&S.props.trigger.indexOf("mouseenter")>=0&&we().addEventListener("mousemove",y)}),S;function ue(){var B=S.props.touch;return Array.isArray(B)?B:[B,0]}function ye(){return ue()[0]==="hold"}function Te(){var B;return!!((B=S.props.render)!=null&&B.$$tippy)}function ge(){return w||t}function we(){var B=ge().parentNode;return B?v2(B):document}function xe(){return Xh(O)}function P(B){return S.state.isMounted&&!S.state.isVisible||xr.isTouch||f&&f.type==="focus"?0:Vh(S.props.delay,B?0:1,cr.delay)}function N(B){B===void 0&&(B=!1),O.style.pointerEvents=S.props.interactive&&!B?"":"none",O.style.zIndex=""+S.props.zIndex}function R(B,ae,_e){if(_e===void 0&&(_e=!0),J.forEach(function(Ve){Ve[B]&&Ve[B].apply(Ve,ae)}),_e){var Xe;(Xe=S.props)[B].apply(Xe,ae)}}function K(){var B=S.props.aria;if(B.content){var ae="aria-"+B.content,_e=O.id,Xe=is(S.props.triggerTarget||t);Xe.forEach(function(Ve){var Bt=Ve.getAttribute(ae);if(S.state.isVisible)Ve.setAttribute(ae,Bt?Bt+" "+_e:_e);else{var sn=Bt&&Bt.replace(_e,"").trim();sn?Ve.setAttribute(ae,sn):Ve.removeAttribute(ae)}})}}function te(){if(!(W||!S.props.aria.expanded)){var B=is(S.props.triggerTarget||t);B.forEach(function(ae){S.props.interactive?ae.setAttribute("aria-expanded",S.state.isVisible&&ae===ge()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function pe(){we().removeEventListener("mousemove",y),au=au.filter(function(B){return B!==y})}function Ce(B){if(!(xr.isTouch&&(u||B.type==="mousedown"))){var ae=B.composedPath&&B.composedPath()[0]||B.target;if(!(S.props.interactive&&tx(O,ae))){if(is(S.props.triggerTarget||t).some(function(_e){return tx(_e,ae)})){if(xr.isTouch||S.state.isVisible&&S.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[S,B]);S.props.hideOnClick===!0&&(S.clearDelayTimeouts(),S.hide(),l=!0,setTimeout(function(){l=!1}),S.state.isMounted||Je())}}}function Ue(){u=!0}function $e(){u=!1}function He(){var B=we();B.addEventListener("mousedown",Ce,!0),B.addEventListener("touchend",Ce,go),B.addEventListener("touchstart",$e,go),B.addEventListener("touchmove",Ue,go)}function Je(){var B=we();B.removeEventListener("mousedown",Ce,!0),B.removeEventListener("touchend",Ce,go),B.removeEventListener("touchstart",$e,go),B.removeEventListener("touchmove",Ue,go)}function xt(B,ae){De(B,function(){!S.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&ae()})}function Pt(B,ae){De(B,ae)}function De(B,ae){var _e=xe().box;function Xe(Ve){Ve.target===_e&&(qh(_e,"remove",Xe),ae())}if(B===0)return ae();qh(_e,"remove",h),qh(_e,"add",Xe),h=Xe}function _t(B,ae,_e){_e===void 0&&(_e=!1);var Xe=is(S.props.triggerTarget||t);Xe.forEach(function(Ve){Ve.addEventListener(B,ae,_e),b.push({node:Ve,eventType:B,handler:ae,options:_e})})}function Xt(){ye()&&(_t("touchstart",Zt,{passive:!0}),_t("touchend",Nt,{passive:!0})),p2(S.props.trigger).forEach(function(B){if(B!=="manual")switch(_t(B,Zt),B){case"mouseenter":_t("mouseleave",Nt);break;case"focus":_t(M2?"focusout":"blur",ft);break;case"focusin":_t("focusout",ft);break}})}function st(){b.forEach(function(B){var ae=B.node,_e=B.eventType,Xe=B.handler,Ve=B.options;ae.removeEventListener(_e,Xe,Ve)}),b=[]}function Zt(B){var ae,_e=!1;if(!(!S.state.isEnabled||me(B)||l)){var Xe=((ae=f)==null?void 0:ae.type)==="focus";f=B,w=B.currentTarget,te(),!S.state.isVisible&&b2(B)&&au.forEach(function(Ve){return Ve(B)}),B.type==="click"&&(S.props.trigger.indexOf("mouseenter")<0||s)&&S.props.hideOnClick!==!1&&S.state.isVisible?_e=!0:Oe(B),B.type==="click"&&(s=!_e),_e&&!Xe&&mt(B)}}function St(B){var ae=B.target,_e=ge().contains(ae)||O.contains(ae);if(!(B.type==="mousemove"&&_e)){var Xe=We().concat(O).map(function(Ve){var Bt,sn=Ve._tippy,qr=(Bt=sn.popperInstance)==null?void 0:Bt.state;return qr?{popperRect:Ve.getBoundingClientRect(),popperState:qr,props:n}:null}).filter(Boolean);w2(Xe,B)&&(pe(),mt(B))}}function Nt(B){var ae=me(B)||S.props.trigger.indexOf("click")>=0&&s;if(!ae){if(S.props.interactive){S.hideWithInteractivity(B);return}mt(B)}}function ft(B){S.props.trigger.indexOf("focusin")<0&&B.target!==ge()||S.props.interactive&&B.relatedTarget&&O.contains(B.relatedTarget)||mt(B)}function me(B){return xr.isTouch?ye()!==B.type.indexOf("touch")>=0:!1}function Kt(){ee();var B=S.props,ae=B.popperOptions,_e=B.placement,Xe=B.offset,Ve=B.getReferenceClientRect,Bt=B.moveTransition,sn=Te()?Xh(O).arrow:null,qr=Ve?{getBoundingClientRect:Ve,contextElement:Ve.contextElement||ge()}:t,_a={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ai){var Yr=Ai.state;if(Te()){var Ou=xe(),ms=Ou.box;["placement","reference-hidden","escaped"].forEach(function(Jr){Jr==="placement"?ms.setAttribute("data-placement",Yr.placement):Yr.attributes.popper["data-popper-"+Jr]?ms.setAttribute("data-"+Jr,""):ms.removeAttribute("data-"+Jr)}),Yr.attributes.popper={}}}},_r=[{name:"offset",options:{offset:Xe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Bt}},_a];Te()&&sn&&_r.push({name:"arrow",options:{element:sn,padding:3}}),_r.push.apply(_r,ae?.modifiers||[]),S.popperInstance=Kh(qr,O,Object.assign({},ae,{placement:_e,onFirstUpdate:m,modifiers:_r}))}function ee(){S.popperInstance&&(S.popperInstance.destroy(),S.popperInstance=null)}function Ae(){var B=S.props.appendTo,ae,_e=ge();S.props.interactive&&B===cx||B==="parent"?ae=_e.parentNode:ae=ux(B,[_e]),ae.contains(O)||ae.appendChild(O),S.state.isMounted=!0,Kt()}function We(){return lu(O.querySelectorAll("[data-tippy-root]"))}function Oe(B){S.clearDelayTimeouts(),B&&R("onTrigger",[S,B]),He();var ae=P(!0),_e=ue(),Xe=_e[0],Ve=_e[1];xr.isTouch&&Xe==="hold"&&Ve&&(ae=Ve),ae?r=setTimeout(function(){S.show()},ae):S.show()}function mt(B){if(S.clearDelayTimeouts(),R("onUntrigger",[S,B]),!S.state.isVisible){Je();return}if(!(S.props.trigger.indexOf("mouseenter")>=0&&S.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&s)){var ae=P(!1);ae?i=setTimeout(function(){S.state.isVisible&&S.hide()},ae):o=requestAnimationFrame(function(){S.hide()})}}function Ot(){S.state.isEnabled=!0}function X(){S.hide(),S.state.isEnabled=!1}function re(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function H(B){if(!S.state.isDestroyed){R("onBeforeUpdate",[S,B]),st();var ae=S.props,_e=rx(t,Object.assign({},ae,Qw(B),{ignoreAttributes:!0}));S.props=_e,Xt(),ae.interactiveDebounce!==_e.interactiveDebounce&&(pe(),y=Zw(St,_e.interactiveDebounce)),ae.triggerTarget&&!_e.triggerTarget?is(ae.triggerTarget).forEach(function(Xe){Xe.removeAttribute("aria-expanded")}):_e.triggerTarget&&t.removeAttribute("aria-expanded"),te(),N(),q&&q(ae,_e),S.popperInstance&&(Kt(),We().forEach(function(Xe){requestAnimationFrame(Xe._tippy.popperInstance.forceUpdate)})),R("onAfterUpdate",[S,B])}}function Y(B){S.setProps({content:B})}function le(){var B=S.state.isVisible,ae=S.state.isDestroyed,_e=!S.state.isEnabled,Xe=xr.isTouch&&!S.props.touch,Ve=Vh(S.props.duration,0,cr.duration);if(!(B||ae||_e||Xe)&&!ge().hasAttribute("disabled")&&(R("onShow",[S],!1),S.props.onShow(S)!==!1)){if(S.state.isVisible=!0,Te()&&(O.style.visibility="visible"),N(),He(),S.state.isMounted||(O.style.transition="none"),Te()){var Bt=xe(),sn=Bt.box,qr=Bt.content;Gh([sn,qr],0)}m=function(){var _r;if(!(!S.state.isVisible||d)){if(d=!0,O.offsetHeight,O.style.transition=S.props.moveTransition,Te()&&S.props.animation){var hs=xe(),Ai=hs.box,Yr=hs.content;Gh([Ai,Yr],Ve),ex([Ai,Yr],"visible")}K(),te(),jw(Yh,S),(_r=S.popperInstance)==null||_r.forceUpdate(),R("onMount",[S]),S.props.animation&&Te()&&Pt(Ve,function(){S.state.isShown=!0,R("onShown",[S])})}},Ae()}}function Me(){var B=!S.state.isVisible,ae=S.state.isDestroyed,_e=!S.state.isEnabled,Xe=Vh(S.props.duration,1,cr.duration);if(!(B||ae||_e)&&(R("onHide",[S],!1),S.props.onHide(S)!==!1)){if(S.state.isVisible=!1,S.state.isShown=!1,d=!1,s=!1,Te()&&(O.style.visibility="hidden"),pe(),Je(),N(!0),Te()){var Ve=xe(),Bt=Ve.box,sn=Ve.content;S.props.animation&&(Gh([Bt,sn],Xe),ex([Bt,sn],"hidden"))}K(),te(),S.props.animation?Te()&&xt(Xe,S.unmount):S.unmount()}}function ct(B){we().addEventListener("mousemove",y),jw(au,y),y(B)}function Vt(){S.state.isVisible&&S.hide(),S.state.isMounted&&(ee(),We().forEach(function(B){B._tippy.unmount()}),O.parentNode&&O.parentNode.removeChild(O),Yh=Yh.filter(function(B){return B!==S}),S.state.isMounted=!1,R("onHidden",[S]))}function Ci(){S.state.isDestroyed||(S.clearDelayTimeouts(),S.unmount(),st(),delete t._tippy,S.state.isDestroyed=!0,R("onDestroy",[S]))}}function ga(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);S2();var r=Object.assign({},e,{plugins:n}),i=E2(t);if(0)var o,s;var l=i.reduce(function(u,d){var f=d&&D2(d,r);return f&&u.push(f),u},[]);return cu(t)?l[0]:l}ga.defaultProps=cr;ga.setDefaultProps=N2;ga.currentInput=xr;var TV=Object.assign({},la,{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)}});ga.setDefaultProps({render:px});var ss=ga;var jh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){un(this,"shouldShow",({view:e,state:n,from:r,to:i})=>{let{doc:o,selection:s}=n,{empty:l}=s,u=!o.textBetween(r,i).length&&Zl(n.selection),d=this.element.contains(document.activeElement);return!(!(e.hasFocus()||d)||l||u||!this.editor.isEditable)});un(this,"mousedownHandler",()=>{this.preventHide=!0});un(this,"dragstartHandler",()=>{this.hide()});un(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});un(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});un(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});un(this,"handleDebouncedUpdate",(e,n)=>{let r=!n?.selection.eq(e.state.selection),i=!n?.doc.eq(e.state.doc);!r&&!i||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,r,i,n)},this.updateDelay))});un(this,"updateHandler",(e,n,r,i)=>{let{state:o,composing:s}=e,{selection:l}=o;if(s||!n&&!r)return;this.createTooltip();let{ranges:d}=l,f=Math.min(...d.map(b=>b.$from.pos)),h=Math.max(...d.map(b=>b.$to.pos));if(!this.shouldShow?.({editor:this.editor,view:e,state:o,oldState:i,from:f,to:h})){this.hide();return}o.selection.$anchor.pos!==i?.selection.$anchor.pos&&this.update(e,o),this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>{if(ME(o.selection)){let b=e.nodeDOM(f),y=b.dataset.nodeViewWrapper?b:b.querySelector("[data-node-view-wrapper]");if(y&&(b=y.firstChild),b)return b.getBoundingClientRect()}return tc(e,f,h)})}),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.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ss(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.pos!==r.selection.$to.pos;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(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.element.style.position="absolute",this.element.style.visibility="hidden",this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.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)}},hx=t=>new Pe({key:typeof t.pluginKey=="string"?new qe(t.pluginKey):t.pluginKey,view:e=>new jh({view:e,...t})});var Qh=Qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[hx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var em=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){un(this,"shouldShow",({view:e,state:n})=>{let{selection:r}=n,{$anchor:i,empty:o}=r,s=i.depth===1,l=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;return!(!e.hasFocus()||!o||!s||!l||!this.editor.isEditable)});un(this,"mousedownHandler",()=>{this.preventHide=!0});un(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});un(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});un(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});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.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ss(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){let{state:r}=e,{doc:i,selection:o}=r,{from:s,to:l}=o;if(n&&n.doc.eq(i)&&n.selection.eq(o))return;if(this.createTooltip(),!this.shouldShow?.({editor:this.editor,view:e,state:r,oldState:n})){this.hide();return}this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>tc(e,s,l))}),this.show()}show(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},mx=t=>new Pe({key:typeof t.pluginKey=="string"?new qe(t.pluginKey):t.pluginKey,view:e=>new em({view:e,...t})});var tm=Qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function uu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function gx(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 bx(t,e,n,r,i,o,s){let l=gx(t),u=[];if(n==="asymmetric")u.push(uu(l.builderColumn,i,s)),u.push(uu(l.builderColumn,o,s));else for(let d=0;dt.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=bx(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:Se(ie(t,"gridBuilderRole",e))}}});var rm=se.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 im=Qe.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new Pe({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 om=se.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({node:t})=>{let e=document.createElement("div");e.contentEditable="false",e.classList.add("tiptap-block-wrapper");let n=typeof t.attrs.data=="object"?JSON.stringify(t.attrs.data):t.attrs.data;return e.innerHTML=` +https://github.com/highlightjs/highlight.js/issues/2277`),te=P,K=N),R===void 0&&(R=!0);let pe={code:K,language:te};we("before:highlight",pe);let Ce=pe.result?pe.result:h(pe.language,pe.code,R);return Ce.code=pe.code,we("after:highlight",Ce),Ce}function h(P,N,R,K){let te=Object.create(null);function pe(X,re){return X.keywords[re]}function Ce(){if(!me.keywords){ee.addText(Ae);return}let X=0;me.keywordPatternRe.lastIndex=0;let re=me.keywordPatternRe.exec(Ae),H="";for(;re;){H+=Ae.substring(X,re.index);let Y=St.case_insensitive?re[0].toLowerCase():re[0],le=pe(me,Y);if(le){let[Me,ct]=le;if(ee.addText(H),H="",te[Y]=(te[Y]||0)+1,te[Y]<=TB&&(We+=ct),Me.startsWith("_"))H+=re[0];else{let Vt=St.classNameAliases[Me]||Me;ee.addKeyword(re[0],Vt)}}else H+=re[0];X=me.keywordPatternRe.lastIndex,re=me.keywordPatternRe.exec(Ae)}H+=Ae.substring(X),ee.addText(H)}function Ue(){if(Ae==="")return;let X=null;if(typeof me.subLanguage=="string"){if(!e[me.subLanguage]){ee.addText(Ae);return}X=h(me.subLanguage,Ae,!0,Kt[me.subLanguage]),Kt[me.subLanguage]=X._top}else X=b(Ae,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(We+=X.relevance),ee.addSublanguage(X._emitter,X.language)}function $e(){me.subLanguage!=null?Ue():Ce(),Ae=""}function He(X,re){let H=1,Y=re.length-1;for(;H<=Y;){if(!X._emit[H]){H++;continue}let le=St.classNameAliases[X[H]]||X[H],Me=re[H];le?ee.addKeyword(Me,le):(Ae=Me,Ce(),Ae=""),H++}}function Je(X,re){return X.scope&&typeof X.scope=="string"&&ee.openNode(St.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(ee.addKeyword(Ae,St.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),Ae=""):X.beginScope._multi&&(He(X.beginScope,re),Ae="")),me=Object.create(X,{parent:{value:me}}),me}function xt(X,re,H){let Y=$P(X.endRe,H);if(Y){if(X["on:end"]){let le=new jc(X);X["on:end"](re,le),le.isMatchIgnored&&(Y=!1)}if(Y){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return xt(X.parent,re,H)}function Pt(X){return me.matcher.regexIndex===0?(Ae+=X[0],1):(Ot=!0,0)}function Le(X){let re=X[0],H=X.rule,Y=new jc(H),le=[H.__beforeBegin,H["on:begin"]];for(let Me of le)if(Me&&(Me(X,Y),Y.isMatchIgnored))return Pt(re);return H.skip?Ae+=re:(H.excludeBegin&&(Ae+=re),$e(),!H.returnBegin&&!H.excludeBegin&&(Ae=re)),Je(H,X),H.returnBegin?0:re.length}function _t(X){let re=X[0],H=N.substring(X.index),Y=xt(me,X,H);if(!Y)return gw;let le=me;me.endScope&&me.endScope._wrap?($e(),ee.addKeyword(re,me.endScope._wrap)):me.endScope&&me.endScope._multi?($e(),He(me.endScope,X)):le.skip?Ae+=re:(le.returnEnd||le.excludeEnd||(Ae+=re),$e(),le.excludeEnd&&(Ae=re));do me.scope&&ee.closeNode(),!me.skip&&!me.subLanguage&&(We+=me.relevance),me=me.parent;while(me!==Y.parent);return Y.starts&&Je(Y.starts,X),le.returnEnd?0:re.length}function Xt(){let X=[];for(let re=me;re!==St;re=re.parent)re.scope&&X.unshift(re.scope);X.forEach(re=>ee.openNode(re))}let st={};function Zt(X,re){let H=re&&re[0];if(Ae+=X,H==null)return $e(),0;if(st.type==="begin"&&re.type==="end"&&st.index===re.index&&H===""){if(Ae+=N.slice(re.index,re.index+1),!i){let Y=new Error(`0 width match regex (${P})`);throw Y.languageName=P,Y.badRule=st.rule,Y}return 1}if(st=re,re.type==="begin")return Le(re);if(re.type==="illegal"&&!R){let Y=new Error('Illegal lexeme "'+H+'" for mode "'+(me.scope||"")+'"');throw Y.mode=me,Y}else if(re.type==="end"){let Y=_t(re);if(Y!==gw)return Y}if(re.type==="illegal"&&H==="")return 1;if(mt>1e5&&mt>re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ae+=H,H.length}let St=W(P);if(!St)throw oo(o.replace("{}",P)),new Error('Unknown language: "'+P+'"');let Nt=xB(St),ft="",me=K||Nt,Kt={},ee=new l.__emitter(l);Xt();let Ae="",We=0,Oe=0,mt=0,Ot=!1;try{for(me.matcher.considerAll();;){mt++,Ot?Ot=!1:me.matcher.considerAll(),me.matcher.lastIndex=Oe;let X=me.matcher.exec(N);if(!X)break;let re=N.substring(Oe,X.index),H=Zt(re,X);Oe=X.index+H}return Zt(N.substring(Oe)),ee.closeAllNodes(),ee.finalize(),ft=ee.toHTML(),{language:P,value:ft,relevance:We,illegal:!1,_emitter:ee,_top:me}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:P,value:yh(N),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:Oe,context:N.slice(Oe-100,Oe+100),mode:X.mode,resultSoFar:ft},_emitter:ee};if(i)return{language:P,value:yh(N),illegal:!1,relevance:0,errorRaised:X,_emitter:ee,_top:me};throw X}}function m(P){let N={value:yh(P),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return N._emitter.addText(P),N}function b(P,N){N=N||l.languages||Object.keys(e);let R=m(P),K=N.filter(W).filter(ye).map($e=>h($e,P,!1));K.unshift(R);let te=K.sort(($e,He)=>{if($e.relevance!==He.relevance)return He.relevance-$e.relevance;if($e.language&&He.language){if(W($e.language).supersetOf===He.language)return 1;if(W(He.language).supersetOf===$e.language)return-1}return 0}),[pe,Ce]=te,Ue=pe;return Ue.secondBest=Ce,Ue}function y(P,N,R){let K=N&&n[N]||R;P.classList.add("hljs"),P.classList.add(`language-${K}`)}function w(P){let N=null,R=d(P);if(u(R))return;if(we("before:highlightElement",{el:P,language:R}),P.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(P)),l.throwUnescapedHTML))throw new xh("One of your code blocks includes unescaped HTML.",P.innerHTML);N=P;let K=N.textContent,te=R?f(K,{language:R,ignoreIllegals:!0}):b(K);P.innerHTML=te.value,y(P,R,te.language),P.result={language:te.language,re:te.relevance,relevance:te.relevance},te.secondBest&&(P.secondBest={language:te.secondBest.language,relevance:te.secondBest.relevance}),we("after:highlightElement",{el:P,result:te,text:K})}function x(P){l=mw(l,P)}let M=()=>{S(),jo("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){S(),jo("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function S(){if(document.readyState==="loading"){L=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function z(){L&&S()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",z,!1);function O(P,N){let R=null;try{R=N(t)}catch(K){if(oo("Language definition for '{}' could not be registered.".replace("{}",P)),i)oo(K);else throw K;R=s}R.name||(R.name=P),e[P]=R,R.rawDefinition=N.bind(null,t),R.aliases&&ue(R.aliases,{languageName:P})}function q(P){delete e[P];for(let N of Object.keys(n))n[N]===P&&delete n[N]}function J(){return Object.keys(e)}function W(P){return P=(P||"").toLowerCase(),e[P]||e[n[P]]}function ue(P,{languageName:N}){typeof P=="string"&&(P=[P]),P.forEach(R=>{n[R.toLowerCase()]=N})}function ye(P){let N=W(P);return N&&!N.disableAutodetect}function Te(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=N=>{P["before:highlightBlock"](Object.assign({block:N.el},N))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=N=>{P["after:highlightBlock"](Object.assign({block:N.el},N))})}function ge(P){Te(P),r.push(P)}function we(P,N){let R=P;r.forEach(function(K){K[R]&&K[R](N)})}function xe(P){return jo("10.7.0","highlightBlock will be removed entirely in v12.0"),jo("10.7.0","Please use highlightElement now."),w(P)}Object.assign(t,{highlight:f,highlightAuto:b,highlightAll:S,highlightElement:w,highlightBlock:xe,configure:x,initHighlighting:M,initHighlightingOnLoad:D,registerLanguage:O,unregisterLanguage:q,listLanguages:J,getLanguage:W,registerAliases:ue,autoDetection:ye,inherit:mw,addPlugin:ge}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=SB,t.regex={concat:so,lookahead:vw,either:Th,optional:zP,anyNumberOfTimes:HP};for(let P in Zc)typeof Zc[P]=="object"&&_h.exports(Zc[P]);return Object.assign(t,Zc),t},aa=MB({}),CB=aa;aa.HighlightJS=aa;aa.default=aa;var AB=CB;function kw(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?kw(n.children,r):{text:n.value,classes:r}}).flat()}function bw(t){return t.value||t.children||[]}function kB(t){return!!AB.getLanguage(t)}function yw({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return eo(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)||kB(l))?bw(n.highlight(l,o.node.textContent)):bw(n.highlightAuto(o.node.textContent));kw(d).forEach(f=>{let h=s+f.text.length;if(f.classes.length){let m=Mt.inline(s,h,{class:f.classes.join(" ")});i.push(m)}s=h})}),lt.create(t,i)}function NB(t){return typeof t=="function"}function OB({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>NB(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new Pe({key:new qe("lowlight"),state:{init:(i,{doc:o})=>yw({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=eo(s.doc,m=>m.type.name===t),h=eo(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(b=>b.pos>=m.from&&b.pos+b.node.nodeSize<=m.to)))?yw({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 Nw=uw.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],OB({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var Ah=Nw.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 kh=se.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 Nh=Qe.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.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")}}});var yt="top",Lt="bottom",At="right",wt="left",tu="auto",_i=[yt,Lt,At,wt],Wr="start",ao="end",Ow="clippingParents",nu="viewport",Qo="popper",Rw="reference",Oh=_i.reduce(function(t,e){return t.concat([e+"-"+Wr,e+"-"+ao])},[]),ru=[].concat(_i,[tu]).reduce(function(t,e){return t.concat([e,e+"-"+Wr,e+"-"+ao])},[]),RB="beforeRead",IB="read",LB="afterRead",DB="beforeMain",PB="main",BB="afterMain",FB="beforeWrite",HB="write",zB="afterWrite",Iw=[RB,IB,LB,DB,PB,BB,FB,HB,zB];function $t(t){return t?(t.nodeName||"").toLowerCase():null}function dt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function qn(t){var e=dt(t).Element;return t instanceof e||t instanceof Element}function Dt(t){var e=dt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function es(t){if(typeof ShadowRoot>"u")return!1;var e=dt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function UB(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];!Dt(o)||!$t(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 $B(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},{});!Dt(i)||!$t(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var la={name:"applyStyles",enabled:!0,phase:"write",fn:UB,effect:$B,requires:["computeStyles"]};function Wt(t){return t.split("-")[0]}var sr=Math.max,lo=Math.min,Kr=Math.round;function ts(){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 ca(){return!/^((?!chrome|android).)*safari/i.test(ts())}function Yn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Dt(t)&&(i=t.offsetWidth>0&&Kr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Kr(r.height)/t.offsetHeight||1);var s=qn(t)?dt(t):window,l=s.visualViewport,u=!ca()&&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 co(t){var e=Yn(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 ua(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&es(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return dt(t).getComputedStyle(t)}function Rh(t){return["table","td","th"].indexOf($t(t))>=0}function Jt(t){return((qn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Vr(t){return $t(t)==="html"?t:t.assignedSlot||t.parentNode||(es(t)?t.host:null)||Jt(t)}function Lw(t){return!Dt(t)||gn(t).position==="fixed"?null:t.offsetParent}function WB(t){var e=/firefox/i.test(ts()),n=/Trident/i.test(ts());if(n&&Dt(t)){var r=gn(t);if(r.position==="fixed")return null}var i=Vr(t);for(es(i)&&(i=i.host);Dt(i)&&["html","body"].indexOf($t(i))<0;){var o=gn(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=dt(t),n=Lw(t);n&&Rh(n)&&gn(n).position==="static";)n=Lw(n);return n&&($t(n)==="html"||$t(n)==="body"&&gn(n).position==="static")?e:n||WB(t)||e}function uo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function fo(t,e,n){return sr(t,lo(e,n))}function Dw(t,e,n){var r=fo(t,e,n);return r>n?n:r}function da(){return{top:0,right:0,bottom:0,left:0}}function fa(t){return Object.assign({},da(),t)}function pa(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var KB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,fa(typeof e!="number"?e:pa(e,_i))};function VB(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=uo(l),d=[wt,At].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=KB(i.padding,n),m=co(o),b=u==="y"?yt:wt,y=u==="y"?Lt:At,w=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],x=s[u]-n.rects.reference[u],M=ar(o),D=M?u==="y"?M.clientHeight||0:M.clientWidth||0:0,L=w/2-x/2,S=h[b],z=D-m[f]-h[y],O=D/2-m[f]/2+L,q=fo(S,O,z),J=u;n.modifiersData[r]=(e={},e[J]=q,e.centerOffset=q-O,e)}}function GB(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)||ua(e.elements.popper,i)&&(e.elements.arrow=i))}var Pw={name:"arrow",enabled:!0,phase:"main",fn:VB,effect:GB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Jn(t){return t.split("-")[1]}var qB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function YB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Kr(n*i)/i||0,y:Kr(r*i)/i||0}}function Bw(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,b=m===void 0?0:m,y=s.y,w=y===void 0?0:y,x=typeof f=="function"?f({x:b,y:w}):{x:b,y:w};b=x.x,w=x.y;var M=s.hasOwnProperty("x"),D=s.hasOwnProperty("y"),L=wt,S=yt,z=window;if(d){var O=ar(n),q="clientHeight",J="clientWidth";if(O===dt(n)&&(O=Jt(n),gn(O).position!=="static"&&l==="absolute"&&(q="scrollHeight",J="scrollWidth")),O=O,i===yt||(i===wt||i===At)&&o===ao){S=Lt;var W=h&&O===z&&z.visualViewport?z.visualViewport.height:O[q];w-=W-r.height,w*=u?1:-1}if(i===wt||(i===yt||i===Lt)&&o===ao){L=At;var ue=h&&O===z&&z.visualViewport?z.visualViewport.width:O[J];b-=ue-r.width,b*=u?1:-1}}var ye=Object.assign({position:l},d&&qB),Te=f===!0?YB({x:b,y:w},dt(n)):{x:b,y:w};if(b=Te.x,w=Te.y,u){var ge;return Object.assign({},ye,(ge={},ge[S]=D?"0":"",ge[L]=M?"0":"",ge.transform=(z.devicePixelRatio||1)<=1?"translate("+b+"px, "+w+"px)":"translate3d("+b+"px, "+w+"px, 0)",ge))}return Object.assign({},ye,(e={},e[S]=D?w+"px":"",e[L]=M?b+"px":"",e.transform="",e))}function JB(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:Jn(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,Bw(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,Bw(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 Fw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JB,data:{}};var iu={passive:!0};function XB(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=dt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,iu)}),l&&u.addEventListener("resize",n.update,iu),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,iu)}),l&&u.removeEventListener("resize",n.update,iu)}}var Hw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:XB,data:{}};var ZB={left:"right",right:"left",bottom:"top",top:"bottom"};function ns(t){return t.replace(/left|right|bottom|top/g,function(e){return ZB[e]})}var jB={start:"end",end:"start"};function ou(t){return t.replace(/start|end/g,function(e){return jB[e]})}function po(t){var e=dt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ho(t){return Yn(Jt(t)).left+po(t).scrollLeft}function Ih(t,e){var n=dt(t),r=Jt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var d=ca();(d||!d&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+ho(t),y:u}}function Lh(t){var e,n=Jt(t),r=po(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+ho(t),u=-r.scrollTop;return gn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function mo(t){var e=gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function su(t){return["html","body","#document"].indexOf($t(t))>=0?t.ownerDocument.body:Dt(t)&&mo(t)?t:su(Vr(t))}function Si(t,e){var n;e===void 0&&(e=[]);var r=su(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=dt(r),s=i?[o].concat(o.visualViewport||[],mo(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Si(Vr(s)))}function rs(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function QB(t,e){var n=Yn(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 zw(t,e,n){return e===nu?rs(Ih(t,n)):qn(e)?QB(e,n):rs(Lh(Jt(t)))}function e2(t){var e=Si(Vr(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Dt(t)?ar(t):t;return qn(r)?e.filter(function(i){return qn(i)&&ua(i,r)&&$t(i)!=="body"}):[]}function Dh(t,e,n,r){var i=e==="clippingParents"?e2(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,d){var f=zw(t,d,r);return u.top=sr(f.top,u.top),u.right=lo(f.right,u.right),u.bottom=lo(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},zw(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 ha(t){var e=t.reference,n=t.element,r=t.placement,i=r?Wt(r):null,o=r?Jn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case yt:u={x:s,y:e.y-n.height};break;case Lt:u={x:s,y:e.y+e.height};break;case At:u={x:e.x+e.width,y:l};break;case wt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var d=i?uo(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Wr:u[d]=u[d]-(e[f]/2-n[f]/2);break;case ao: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?Ow:l,d=n.rootBoundary,f=d===void 0?nu:d,h=n.elementContext,m=h===void 0?Qo:h,b=n.altBoundary,y=b===void 0?!1:b,w=n.padding,x=w===void 0?0:w,M=fa(typeof x!="number"?x:pa(x,_i)),D=m===Qo?Rw:Qo,L=t.rects.popper,S=t.elements[y?D:m],z=Dh(qn(S)?S:S.contextElement||Jt(t.elements.popper),u,f,s),O=Yn(t.elements.reference),q=ha({reference:O,element:L,strategy:"absolute",placement:i}),J=rs(Object.assign({},L,q)),W=m===Qo?J:O,ue={top:z.top-W.top+M.top,bottom:W.bottom-z.bottom+M.bottom,left:z.left-W.left+M.left,right:W.right-z.right+M.right},ye=t.modifiersData.offset;if(m===Qo&&ye){var Te=ye[i];Object.keys(ue).forEach(function(ge){var we=[At,Lt].indexOf(ge)>=0?1:-1,xe=[yt,Lt].indexOf(ge)>=0?"y":"x";ue[ge]+=Te[xe]*we})}return ue}function Ph(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?ru:u,f=Jn(r),h=f?l?Oh:Oh.filter(function(y){return Jn(y)===f}):_i,m=h.filter(function(y){return d.indexOf(y)>=0});m.length===0&&(m=h);var b=m.reduce(function(y,w){return y[w]=lr(t,{placement:w,boundary:i,rootBoundary:o,padding:s})[Wt(w)],y},{});return Object.keys(b).sort(function(y,w){return b[y]-b[w]})}function t2(t){if(Wt(t)===tu)return[];var e=ns(t);return[ou(t),e,ou(e)]}function n2(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,b=n.flipVariations,y=b===void 0?!0:b,w=n.allowedAutoPlacements,x=e.options.placement,M=Wt(x),D=M===x,L=u||(D||!y?[ns(x)]:t2(x)),S=[x].concat(L).reduce(function($e,He){return $e.concat(Wt(He)===tu?Ph(e,{placement:He,boundary:f,rootBoundary:h,padding:d,flipVariations:y,allowedAutoPlacements:w}):He)},[]),z=e.rects.reference,O=e.rects.popper,q=new Map,J=!0,W=S[0],ue=0;ue=0,xe=we?"width":"height",P=lr(e,{placement:ye,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),N=we?ge?At:wt:ge?Lt:yt;z[xe]>O[xe]&&(N=ns(N));var R=ns(N),K=[];if(o&&K.push(P[Te]<=0),l&&K.push(P[N]<=0,P[R]<=0),K.every(function($e){return $e})){W=ye,J=!1;break}q.set(ye,K)}if(J)for(var te=y?3:1,pe=function(He){var Je=S.find(function(xt){var Pt=q.get(xt);if(Pt)return Pt.slice(0,He).every(function(Le){return Le})});if(Je)return W=Je,"break"},Ce=te;Ce>0;Ce--){var Ue=pe(Ce);if(Ue==="break")break}e.placement!==W&&(e.modifiersData[r]._skip=!0,e.placement=W,e.reset=!0)}}var Uw={name:"flip",enabled:!0,phase:"main",fn:n2,requiresIfExists:["offset"],data:{_skip:!1}};function $w(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 Ww(t){return[yt,At,Lt,wt].some(function(e){return t[e]>=0})}function r2(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=$w(s,r),d=$w(l,i,o),f=Ww(u),h=Ww(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 Kw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:r2};function i2(t,e,n){var r=Wt(t),i=[wt,yt].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,[wt,At].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function o2(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=ru.reduce(function(f,h){return f[h]=i2(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 Vw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:o2};function s2(t){var e=t.state,n=t.name;e.modifiersData[n]=ha({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Gw={name:"popperOffsets",enabled:!0,phase:"read",fn:s2,data:{}};function Bh(t){return t==="x"?"y":"x"}function a2(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,b=m===void 0?!0:m,y=n.tetherOffset,w=y===void 0?0:y,x=lr(e,{boundary:u,rootBoundary:d,padding:h,altBoundary:f}),M=Wt(e.placement),D=Jn(e.placement),L=!D,S=uo(M),z=Bh(S),O=e.modifiersData.popperOffsets,q=e.rects.reference,J=e.rects.popper,W=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,ue=typeof W=="number"?{mainAxis:W,altAxis:W}:Object.assign({mainAxis:0,altAxis:0},W),ye=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Te={x:0,y:0};if(O){if(o){var ge,we=S==="y"?yt:wt,xe=S==="y"?Lt:At,P=S==="y"?"height":"width",N=O[S],R=N+x[we],K=N-x[xe],te=b?-J[P]/2:0,pe=D===Wr?q[P]:J[P],Ce=D===Wr?-J[P]:-q[P],Ue=e.elements.arrow,$e=b&&Ue?co(Ue):{width:0,height:0},He=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:da(),Je=He[we],xt=He[xe],Pt=fo(0,q[P],$e[P]),Le=L?q[P]/2-te-Pt-Je-ue.mainAxis:pe-Pt-Je-ue.mainAxis,_t=L?-q[P]/2+te+Pt+xt+ue.mainAxis:Ce+Pt+xt+ue.mainAxis,Xt=e.elements.arrow&&ar(e.elements.arrow),st=Xt?S==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,Zt=(ge=ye?.[S])!=null?ge:0,St=N+Le-Zt-st,Nt=N+_t-Zt,ft=fo(b?lo(R,St):R,N,b?sr(K,Nt):K);O[S]=ft,Te[S]=ft-N}if(l){var me,Kt=S==="x"?yt:wt,ee=S==="x"?Lt:At,Ae=O[z],We=z==="y"?"height":"width",Oe=Ae+x[Kt],mt=Ae-x[ee],Ot=[yt,wt].indexOf(M)!==-1,X=(me=ye?.[z])!=null?me:0,re=Ot?Oe:Ae-q[We]-J[We]-X+ue.altAxis,H=Ot?Ae+q[We]+J[We]-X-ue.altAxis:mt,Y=b&&Ot?Dw(re,Ae,H):fo(b?re:Oe,Ae,b?H:mt);O[z]=Y,Te[z]=Y-Ae}e.modifiersData[r]=Te}}var qw={name:"preventOverflow",enabled:!0,phase:"main",fn:a2,requiresIfExists:["offset"]};function Fh(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Hh(t){return t===dt(t)||!Dt(t)?po(t):Fh(t)}function l2(t){var e=t.getBoundingClientRect(),n=Kr(e.width)/t.offsetWidth||1,r=Kr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function zh(t,e,n){n===void 0&&(n=!1);var r=Dt(e),i=Dt(e)&&l2(e),o=Jt(e),s=Yn(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(($t(e)!=="body"||mo(o))&&(l=Hh(e)),Dt(e)?(u=Yn(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=ho(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function c2(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 Uh(t){var e=c2(t);return Iw.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function $h(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Wh(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 Yw={placement:"bottom",modifiers:[],strategy:"absolute"};function Jw(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function ux(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Zw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function p2(t){return t.split(/\s+/).filter(Boolean)}function is(t){return[].concat(t)}function jw(t,e){t.indexOf(e)===-1&&t.push(e)}function h2(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function m2(t){return t.split("-")[0]}function lu(t){return[].slice.call(t)}function Qw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ma(){return document.createElement("div")}function cu(t){return["Element","Fragment"].some(function(e){return Zh(t,e)})}function g2(t){return Zh(t,"NodeList")}function b2(t){return Zh(t,"MouseEvent")}function y2(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function E2(t){return cu(t)?[t]:g2(t)?lu(t):Array.isArray(t)?t:lu(document.querySelectorAll(t))}function Gh(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function ex(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function v2(t){var e,n=is(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function w2(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=m2(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,b=d==="right"?f.left.x:0,y=d==="left"?f.right.x:0,w=o.top-r+h>u,x=r-o.bottom-m>u,M=o.left-n+b>u,D=n-o.right-y>u;return w||x||M||D})}function qh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function tx(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 xr={isTouch:!1},nx=0;function x2(){xr.isTouch||(xr.isTouch=!0,window.performance&&document.addEventListener("mousemove",dx))}function dx(){var t=performance.now();t-nx<20&&(xr.isTouch=!1,document.removeEventListener("mousemove",dx)),nx=t}function _2(){var t=document.activeElement;if(y2(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function S2(){document.addEventListener("touchstart",x2,go),window.addEventListener("blur",_2)}var T2=typeof window<"u"&&typeof document<"u",M2=T2?!!window.msCrypto:!1;var C2={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},A2={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:cx,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},C2,A2),k2=Object.keys(cr),N2=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function fx(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 O2(t,e){var n=e?Object.keys(fx(Object.assign({},cr,{plugins:e}))):k2,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 rx(t,e){var n=Object.assign({},e,{content:ux(e.content,[t])},e.ignoreAttributes?{}:O2(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 R2=function(){return"innerHTML"};function Jh(t,e){t[R2()]=e}function ix(t){var e=ma();return t===!0?e.className=ax:(e.className=lx,cu(t)?e.appendChild(t):Jh(e,t)),e}function ox(t,e){cu(e.content)?(Jh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Jh(t,e.content):t.textContent=e.content)}function Xh(t){var e=t.firstElementChild,n=lu(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(sx)}),arrow:n.find(function(r){return r.classList.contains(ax)||r.classList.contains(lx)}),backdrop:n.find(function(r){return r.classList.contains(f2)})}}function px(t){var e=ma(),n=ma();n.className=d2,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ma();r.className=sx,r.setAttribute("data-state","hidden"),ox(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Xh(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)&&ox(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(u.removeChild(f),u.appendChild(ix(s.arrow))):u.appendChild(ix(s.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}px.$$tippy=!0;var I2=1,au=[],Yh=[];function L2(t,e){var n=rx(t,Object.assign({},cr,fx(Qw(e)))),r,i,o,s=!1,l=!1,u=!1,d=!1,f,h,m,b=[],y=Zw(St,n.interactiveDebounce),w,x=I2++,M=null,D=h2(n.plugins),L={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},S={id:x,reference:t,popper:ma(),popperInstance:M,props:n,state:L,plugins:D,clearDelayTimeouts:re,setProps:H,setContent:Y,show:le,hide:Me,hideWithInteractivity:ct,enable:Ot,disable:X,unmount:Vt,destroy:Ci};if(!n.render)return S;var z=n.render(S),O=z.popper,q=z.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+S.id,S.popper=O,t._tippy=S,O._tippy=S;var J=D.map(function(B){return B.fn(S)}),W=t.hasAttribute("aria-expanded");return Xt(),te(),N(),R("onCreate",[S]),n.showOnCreate&&Oe(),O.addEventListener("mouseenter",function(){S.props.interactive&&S.state.isVisible&&S.clearDelayTimeouts()}),O.addEventListener("mouseleave",function(){S.props.interactive&&S.props.trigger.indexOf("mouseenter")>=0&&we().addEventListener("mousemove",y)}),S;function ue(){var B=S.props.touch;return Array.isArray(B)?B:[B,0]}function ye(){return ue()[0]==="hold"}function Te(){var B;return!!((B=S.props.render)!=null&&B.$$tippy)}function ge(){return w||t}function we(){var B=ge().parentNode;return B?v2(B):document}function xe(){return Xh(O)}function P(B){return S.state.isMounted&&!S.state.isVisible||xr.isTouch||f&&f.type==="focus"?0:Vh(S.props.delay,B?0:1,cr.delay)}function N(B){B===void 0&&(B=!1),O.style.pointerEvents=S.props.interactive&&!B?"":"none",O.style.zIndex=""+S.props.zIndex}function R(B,ae,_e){if(_e===void 0&&(_e=!0),J.forEach(function(Ve){Ve[B]&&Ve[B].apply(Ve,ae)}),_e){var Xe;(Xe=S.props)[B].apply(Xe,ae)}}function K(){var B=S.props.aria;if(B.content){var ae="aria-"+B.content,_e=O.id,Xe=is(S.props.triggerTarget||t);Xe.forEach(function(Ve){var Bt=Ve.getAttribute(ae);if(S.state.isVisible)Ve.setAttribute(ae,Bt?Bt+" "+_e:_e);else{var sn=Bt&&Bt.replace(_e,"").trim();sn?Ve.setAttribute(ae,sn):Ve.removeAttribute(ae)}})}}function te(){if(!(W||!S.props.aria.expanded)){var B=is(S.props.triggerTarget||t);B.forEach(function(ae){S.props.interactive?ae.setAttribute("aria-expanded",S.state.isVisible&&ae===ge()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function pe(){we().removeEventListener("mousemove",y),au=au.filter(function(B){return B!==y})}function Ce(B){if(!(xr.isTouch&&(u||B.type==="mousedown"))){var ae=B.composedPath&&B.composedPath()[0]||B.target;if(!(S.props.interactive&&tx(O,ae))){if(is(S.props.triggerTarget||t).some(function(_e){return tx(_e,ae)})){if(xr.isTouch||S.state.isVisible&&S.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[S,B]);S.props.hideOnClick===!0&&(S.clearDelayTimeouts(),S.hide(),l=!0,setTimeout(function(){l=!1}),S.state.isMounted||Je())}}}function Ue(){u=!0}function $e(){u=!1}function He(){var B=we();B.addEventListener("mousedown",Ce,!0),B.addEventListener("touchend",Ce,go),B.addEventListener("touchstart",$e,go),B.addEventListener("touchmove",Ue,go)}function Je(){var B=we();B.removeEventListener("mousedown",Ce,!0),B.removeEventListener("touchend",Ce,go),B.removeEventListener("touchstart",$e,go),B.removeEventListener("touchmove",Ue,go)}function xt(B,ae){Le(B,function(){!S.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&ae()})}function Pt(B,ae){Le(B,ae)}function Le(B,ae){var _e=xe().box;function Xe(Ve){Ve.target===_e&&(qh(_e,"remove",Xe),ae())}if(B===0)return ae();qh(_e,"remove",h),qh(_e,"add",Xe),h=Xe}function _t(B,ae,_e){_e===void 0&&(_e=!1);var Xe=is(S.props.triggerTarget||t);Xe.forEach(function(Ve){Ve.addEventListener(B,ae,_e),b.push({node:Ve,eventType:B,handler:ae,options:_e})})}function Xt(){ye()&&(_t("touchstart",Zt,{passive:!0}),_t("touchend",Nt,{passive:!0})),p2(S.props.trigger).forEach(function(B){if(B!=="manual")switch(_t(B,Zt),B){case"mouseenter":_t("mouseleave",Nt);break;case"focus":_t(M2?"focusout":"blur",ft);break;case"focusin":_t("focusout",ft);break}})}function st(){b.forEach(function(B){var ae=B.node,_e=B.eventType,Xe=B.handler,Ve=B.options;ae.removeEventListener(_e,Xe,Ve)}),b=[]}function Zt(B){var ae,_e=!1;if(!(!S.state.isEnabled||me(B)||l)){var Xe=((ae=f)==null?void 0:ae.type)==="focus";f=B,w=B.currentTarget,te(),!S.state.isVisible&&b2(B)&&au.forEach(function(Ve){return Ve(B)}),B.type==="click"&&(S.props.trigger.indexOf("mouseenter")<0||s)&&S.props.hideOnClick!==!1&&S.state.isVisible?_e=!0:Oe(B),B.type==="click"&&(s=!_e),_e&&!Xe&&mt(B)}}function St(B){var ae=B.target,_e=ge().contains(ae)||O.contains(ae);if(!(B.type==="mousemove"&&_e)){var Xe=We().concat(O).map(function(Ve){var Bt,sn=Ve._tippy,qr=(Bt=sn.popperInstance)==null?void 0:Bt.state;return qr?{popperRect:Ve.getBoundingClientRect(),popperState:qr,props:n}:null}).filter(Boolean);w2(Xe,B)&&(pe(),mt(B))}}function Nt(B){var ae=me(B)||S.props.trigger.indexOf("click")>=0&&s;if(!ae){if(S.props.interactive){S.hideWithInteractivity(B);return}mt(B)}}function ft(B){S.props.trigger.indexOf("focusin")<0&&B.target!==ge()||S.props.interactive&&B.relatedTarget&&O.contains(B.relatedTarget)||mt(B)}function me(B){return xr.isTouch?ye()!==B.type.indexOf("touch")>=0:!1}function Kt(){ee();var B=S.props,ae=B.popperOptions,_e=B.placement,Xe=B.offset,Ve=B.getReferenceClientRect,Bt=B.moveTransition,sn=Te()?Xh(O).arrow:null,qr=Ve?{getBoundingClientRect:Ve,contextElement:Ve.contextElement||ge()}:t,_a={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ai){var Yr=Ai.state;if(Te()){var Ou=xe(),ms=Ou.box;["placement","reference-hidden","escaped"].forEach(function(Jr){Jr==="placement"?ms.setAttribute("data-placement",Yr.placement):Yr.attributes.popper["data-popper-"+Jr]?ms.setAttribute("data-"+Jr,""):ms.removeAttribute("data-"+Jr)}),Yr.attributes.popper={}}}},_r=[{name:"offset",options:{offset:Xe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Bt}},_a];Te()&&sn&&_r.push({name:"arrow",options:{element:sn,padding:3}}),_r.push.apply(_r,ae?.modifiers||[]),S.popperInstance=Kh(qr,O,Object.assign({},ae,{placement:_e,onFirstUpdate:m,modifiers:_r}))}function ee(){S.popperInstance&&(S.popperInstance.destroy(),S.popperInstance=null)}function Ae(){var B=S.props.appendTo,ae,_e=ge();S.props.interactive&&B===cx||B==="parent"?ae=_e.parentNode:ae=ux(B,[_e]),ae.contains(O)||ae.appendChild(O),S.state.isMounted=!0,Kt()}function We(){return lu(O.querySelectorAll("[data-tippy-root]"))}function Oe(B){S.clearDelayTimeouts(),B&&R("onTrigger",[S,B]),He();var ae=P(!0),_e=ue(),Xe=_e[0],Ve=_e[1];xr.isTouch&&Xe==="hold"&&Ve&&(ae=Ve),ae?r=setTimeout(function(){S.show()},ae):S.show()}function mt(B){if(S.clearDelayTimeouts(),R("onUntrigger",[S,B]),!S.state.isVisible){Je();return}if(!(S.props.trigger.indexOf("mouseenter")>=0&&S.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&s)){var ae=P(!1);ae?i=setTimeout(function(){S.state.isVisible&&S.hide()},ae):o=requestAnimationFrame(function(){S.hide()})}}function Ot(){S.state.isEnabled=!0}function X(){S.hide(),S.state.isEnabled=!1}function re(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function H(B){if(!S.state.isDestroyed){R("onBeforeUpdate",[S,B]),st();var ae=S.props,_e=rx(t,Object.assign({},ae,Qw(B),{ignoreAttributes:!0}));S.props=_e,Xt(),ae.interactiveDebounce!==_e.interactiveDebounce&&(pe(),y=Zw(St,_e.interactiveDebounce)),ae.triggerTarget&&!_e.triggerTarget?is(ae.triggerTarget).forEach(function(Xe){Xe.removeAttribute("aria-expanded")}):_e.triggerTarget&&t.removeAttribute("aria-expanded"),te(),N(),q&&q(ae,_e),S.popperInstance&&(Kt(),We().forEach(function(Xe){requestAnimationFrame(Xe._tippy.popperInstance.forceUpdate)})),R("onAfterUpdate",[S,B])}}function Y(B){S.setProps({content:B})}function le(){var B=S.state.isVisible,ae=S.state.isDestroyed,_e=!S.state.isEnabled,Xe=xr.isTouch&&!S.props.touch,Ve=Vh(S.props.duration,0,cr.duration);if(!(B||ae||_e||Xe)&&!ge().hasAttribute("disabled")&&(R("onShow",[S],!1),S.props.onShow(S)!==!1)){if(S.state.isVisible=!0,Te()&&(O.style.visibility="visible"),N(),He(),S.state.isMounted||(O.style.transition="none"),Te()){var Bt=xe(),sn=Bt.box,qr=Bt.content;Gh([sn,qr],0)}m=function(){var _r;if(!(!S.state.isVisible||d)){if(d=!0,O.offsetHeight,O.style.transition=S.props.moveTransition,Te()&&S.props.animation){var hs=xe(),Ai=hs.box,Yr=hs.content;Gh([Ai,Yr],Ve),ex([Ai,Yr],"visible")}K(),te(),jw(Yh,S),(_r=S.popperInstance)==null||_r.forceUpdate(),R("onMount",[S]),S.props.animation&&Te()&&Pt(Ve,function(){S.state.isShown=!0,R("onShown",[S])})}},Ae()}}function Me(){var B=!S.state.isVisible,ae=S.state.isDestroyed,_e=!S.state.isEnabled,Xe=Vh(S.props.duration,1,cr.duration);if(!(B||ae||_e)&&(R("onHide",[S],!1),S.props.onHide(S)!==!1)){if(S.state.isVisible=!1,S.state.isShown=!1,d=!1,s=!1,Te()&&(O.style.visibility="hidden"),pe(),Je(),N(!0),Te()){var Ve=xe(),Bt=Ve.box,sn=Ve.content;S.props.animation&&(Gh([Bt,sn],Xe),ex([Bt,sn],"hidden"))}K(),te(),S.props.animation?Te()&&xt(Xe,S.unmount):S.unmount()}}function ct(B){we().addEventListener("mousemove",y),jw(au,y),y(B)}function Vt(){S.state.isVisible&&S.hide(),S.state.isMounted&&(ee(),We().forEach(function(B){B._tippy.unmount()}),O.parentNode&&O.parentNode.removeChild(O),Yh=Yh.filter(function(B){return B!==S}),S.state.isMounted=!1,R("onHidden",[S]))}function Ci(){S.state.isDestroyed||(S.clearDelayTimeouts(),S.unmount(),st(),delete t._tippy,S.state.isDestroyed=!0,R("onDestroy",[S]))}}function ga(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);S2();var r=Object.assign({},e,{plugins:n}),i=E2(t);if(0)var o,s;var l=i.reduce(function(u,d){var f=d&&L2(d,r);return f&&u.push(f),u},[]);return cu(t)?l[0]:l}ga.defaultProps=cr;ga.setDefaultProps=N2;ga.currentInput=xr;var TV=Object.assign({},la,{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)}});ga.setDefaultProps({render:px});var ss=ga;var jh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){un(this,"shouldShow",({view:e,state:n,from:r,to:i})=>{let{doc:o,selection:s}=n,{empty:l}=s,u=!o.textBetween(r,i).length&&Zl(n.selection),d=this.element.contains(document.activeElement);return!(!(e.hasFocus()||d)||l||u||!this.editor.isEditable)});un(this,"mousedownHandler",()=>{this.preventHide=!0});un(this,"dragstartHandler",()=>{this.hide()});un(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});un(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});un(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});un(this,"handleDebouncedUpdate",(e,n)=>{let r=!n?.selection.eq(e.state.selection),i=!n?.doc.eq(e.state.doc);!r&&!i||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,r,i,n)},this.updateDelay))});un(this,"updateHandler",(e,n,r,i)=>{let{state:o,composing:s}=e,{selection:l}=o;if(s||!n&&!r)return;this.createTooltip();let{ranges:d}=l,f=Math.min(...d.map(b=>b.$from.pos)),h=Math.max(...d.map(b=>b.$to.pos));if(!this.shouldShow?.({editor:this.editor,view:e,state:o,oldState:i,from:f,to:h})){this.hide();return}o.selection.$anchor.pos!==i?.selection.$anchor.pos&&this.update(e,o),this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>{if(ME(o.selection)){let b=e.nodeDOM(f),y=b.dataset.nodeViewWrapper?b:b.querySelector("[data-node-view-wrapper]");if(y&&(b=y.firstChild),b)return b.getBoundingClientRect()}return tc(e,f,h)})}),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.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ss(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.pos!==r.selection.$to.pos;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(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.element.style.position="absolute",this.element.style.visibility="hidden",this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.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)}},hx=t=>new Pe({key:typeof t.pluginKey=="string"?new qe(t.pluginKey):t.pluginKey,view:e=>new jh({view:e,...t})});var Qh=Qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[hx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var em=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){un(this,"shouldShow",({view:e,state:n})=>{let{selection:r}=n,{$anchor:i,empty:o}=r,s=i.depth===1,l=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;return!(!e.hasFocus()||!o||!s||!l||!this.editor.isEditable)});un(this,"mousedownHandler",()=>{this.preventHide=!0});un(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});un(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});un(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});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.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ss(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){let{state:r}=e,{doc:i,selection:o}=r,{from:s,to:l}=o;if(n&&n.doc.eq(i)&&n.selection.eq(o))return;if(this.createTooltip(),!this.shouldShow?.({editor:this.editor,view:e,state:r,oldState:n})){this.hide();return}this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>tc(e,s,l))}),this.show()}show(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},mx=t=>new Pe({key:typeof t.pluginKey=="string"?new qe(t.pluginKey):t.pluginKey,view:e=>new em({view:e,...t})});var tm=Qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function uu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function gx(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 bx(t,e,n,r,i,o,s){let l=gx(t),u=[];if(n==="asymmetric")u.push(uu(l.builderColumn,i,s)),u.push(uu(l.builderColumn,o,s));else for(let d=0;dt.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=bx(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:Se(ie(t,"gridBuilderRole",e))}}});var rm=se.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 im=Qe.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new Pe({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 om=se.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({node:t})=>{let e=document.createElement("div");e.contentEditable="false",e.classList.add("tiptap-block-wrapper");let n=typeof t.attrs.data=="object"?JSON.stringify(t.attrs.data):t.attrs.data;return e.innerHTML=`
- `,{dom:e}}},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=>({chain:e,state:n})=>{let{selection:r}=n,{$from:i,$to:o}=r,s=i.blockRange(o);if(!s)return!1;let l=e();return l.insertContentAt({from:s.start,to:s.end},{type:this.name,attrs:t}),l.focus(s.end+1)},removeBlock:()=>({commands:t})=>t.deleteSelection()}}});function L2(t){var e;let{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,l=CE(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,b=Array.from(h.matchAll(f)).pop();if(!b||b.input===void 0||b.index===void 0)return null;let y=b.input.slice(Math.max(0,b.index-1),b.index),w=new RegExp(`^[${i?.join("")}\0]?$`).test(y);if(i!==null&&!w)return null;let x=m+b.index,M=x+b[0].length;return r&&u.test(h.slice(M-1,M+1))&&(b[0]+=" ",M+=1),x=s.pos?{range:{from:x,to:M},query:b[0].slice(n.length),text:b[0]}:null}var P2=new qe("suggestion");function yx({pluginKey:t=P2,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}){let m,b=f?.(),y=new Pe({key:t,view(){return{update:async(w,x)=>{var M,L,D,S,z,O,q;let J=(M=this.key)===null||M===void 0?void 0:M.getState(x),W=(L=this.key)===null||L===void 0?void 0:L.getState(w.state),ue=J.active&&W.active&&J.range.from!==W.range.from,ye=!J.active&&W.active,Te=J.active&&!W.active,ge=!ye&&!Te&&J.query!==W.query,we=ye||ue,xe=ge&&!ue,P=Te||ue;if(!we&&!xe&&!P)return;let N=P&&!we?J:W,R=w.dom.querySelector(`[data-decoration-id="${N.decorationId}"]`);m={editor:e,range:N.range,query:N.query,text:N.text,items:[],command:K=>{u({editor:e,range:N.range,props:K})},decorationNode:R,clientRect:R?()=>{var K;let{decorationId:te}=(K=this.key)===null||K===void 0?void 0:K.getState(e.state),pe=w.dom.querySelector(`[data-decoration-id="${te}"]`);return pe?.getBoundingClientRect()||null}:null},we&&((D=b?.onBeforeStart)===null||D===void 0||D.call(b,m)),xe&&((S=b?.onBeforeUpdate)===null||S===void 0||S.call(b,m)),(xe||we)&&(m.items=await d({editor:e,query:N.query})),P&&((z=b?.onExit)===null||z===void 0||z.call(b,m)),xe&&((O=b?.onUpdate)===null||O===void 0||O.call(b,m)),we&&((q=b?.onStart)===null||q===void 0||q.call(b,m))},destroy:()=>{var w;m&&((w=b?.onExit)===null||w===void 0||w.call(b,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(w,x,M,L){let{isEditable:D}=e,{composing:S}=e.view,{selection:z}=w,{empty:O,from:q}=z,J={...x};if(J.composing=S,D&&(O||e.view.composing)){(qx.range.to)&&!S&&!x.composing&&(J.active=!1);let W=L2({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:z.$from}),ue=`id_${Math.floor(Math.random()*4294967295)}`;W&&h({editor:e,state:L,range:W.range})?(J.active=!0,J.decorationId=x.decorationId?x.decorationId:ue,J.range=W.range,J.query=W.query,J.text=W.text):J.active=!1}else J.active=!1;return J.active||(J.decorationId=null,J.range={from:0,to:0},J.query=null,J.text=null),J}},props:{handleKeyDown(w,x){var M;let{active:L,range:D}=y.getState(w.state);return L&&((M=b?.onKeyDown)===null||M===void 0?void 0:M.call(b,{view:w,event:x,range:D}))||!1},decorations(w){let{active:x,range:M,decorationId:L}=y.getState(w);return x?lt.create(w.doc,[Mt.inline(M.from,M.to,{nodeName:s,class:l,"data-decoration-id":L})]):null}}});return y}var B2=new qe("mergeTag"),sm=se.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[yx({editor:this.editor,char:"{{",items:({query:t})=>this.options.mergeTags.filter(e=>e.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),pluginKey:B2,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=` + `,{dom:e}}},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=>({chain:e,state:n})=>{let{selection:r}=n,{$from:i,$to:o}=r,s=i.blockRange(o);if(!s)return!1;let l=e();return l.insertContentAt({from:s.start,to:s.end},{type:this.name,attrs:t}),l.focus(s.end+1)},removeBlock:()=>({commands:t})=>t.deleteSelection()}}});function D2(t){var e;let{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,l=CE(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,b=Array.from(h.matchAll(f)).pop();if(!b||b.input===void 0||b.index===void 0)return null;let y=b.input.slice(Math.max(0,b.index-1),b.index),w=new RegExp(`^[${i?.join("")}\0]?$`).test(y);if(i!==null&&!w)return null;let x=m+b.index,M=x+b[0].length;return r&&u.test(h.slice(M-1,M+1))&&(b[0]+=" ",M+=1),x=s.pos?{range:{from:x,to:M},query:b[0].slice(n.length),text:b[0]}:null}var P2=new qe("suggestion");function yx({pluginKey:t=P2,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}){let m,b=f?.(),y=new Pe({key:t,view(){return{update:async(w,x)=>{var M,D,L,S,z,O,q;let J=(M=this.key)===null||M===void 0?void 0:M.getState(x),W=(D=this.key)===null||D===void 0?void 0:D.getState(w.state),ue=J.active&&W.active&&J.range.from!==W.range.from,ye=!J.active&&W.active,Te=J.active&&!W.active,ge=!ye&&!Te&&J.query!==W.query,we=ye||ue,xe=ge&&!ue,P=Te||ue;if(!we&&!xe&&!P)return;let N=P&&!we?J:W,R=w.dom.querySelector(`[data-decoration-id="${N.decorationId}"]`);m={editor:e,range:N.range,query:N.query,text:N.text,items:[],command:K=>{u({editor:e,range:N.range,props:K})},decorationNode:R,clientRect:R?()=>{var K;let{decorationId:te}=(K=this.key)===null||K===void 0?void 0:K.getState(e.state),pe=w.dom.querySelector(`[data-decoration-id="${te}"]`);return pe?.getBoundingClientRect()||null}:null},we&&((L=b?.onBeforeStart)===null||L===void 0||L.call(b,m)),xe&&((S=b?.onBeforeUpdate)===null||S===void 0||S.call(b,m)),(xe||we)&&(m.items=await d({editor:e,query:N.query})),P&&((z=b?.onExit)===null||z===void 0||z.call(b,m)),xe&&((O=b?.onUpdate)===null||O===void 0||O.call(b,m)),we&&((q=b?.onStart)===null||q===void 0||q.call(b,m))},destroy:()=>{var w;m&&((w=b?.onExit)===null||w===void 0||w.call(b,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(w,x,M,D){let{isEditable:L}=e,{composing:S}=e.view,{selection:z}=w,{empty:O,from:q}=z,J={...x};if(J.composing=S,L&&(O||e.view.composing)){(qx.range.to)&&!S&&!x.composing&&(J.active=!1);let W=D2({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:z.$from}),ue=`id_${Math.floor(Math.random()*4294967295)}`;W&&h({editor:e,state:D,range:W.range})?(J.active=!0,J.decorationId=x.decorationId?x.decorationId:ue,J.range=W.range,J.query=W.query,J.text=W.text):J.active=!1}else J.active=!1;return J.active||(J.decorationId=null,J.range={from:0,to:0},J.query=null,J.text=null),J}},props:{handleKeyDown(w,x){var M;let{active:D,range:L}=y.getState(w.state);return D&&((M=b?.onKeyDown)===null||M===void 0?void 0:M.call(b,{view:w,event:x,range:L}))||!1},decorations(w){let{active:x,range:M,decorationId:D}=y.getState(w);return x?lt.create(w.doc,[Mt.inline(M.from,M.to,{nodeName:s,class:l,"data-decoration-id":D})]):null}}});return y}var B2=new qe("mergeTag"),sm=se.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[yx({editor:this.editor,char:"{{",items:({query:t})=>this.options.mergeTags.filter(e=>e.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),pluginKey:B2,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=`
{n.command({id:i.detail.item})}),e=ss("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 am=Qe.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"),renderHTML:t=>t.class?{class:t.class}:{}}}}]}});var lm=Qe.create({name:"idExtension",addGlobalAttributes(){return[{types:["heading","link"],attributes:{id:{default:null,parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}}]}});function F2(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+u+"|.)",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},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["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"],x=["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"],M=["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"],S={type:w,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},z={className:"function.dispatch",relevance:0,keywords:{_hint:M},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[z,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:O.concat([{begin:/\(/,end:/\)/,keywords:S,contains:O.concat(["self"]),relevance:0}]),relevance:0},J={className:"function",begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:b,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:S,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:S,illegal:"",keywords:S,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ex(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=F2(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 vx(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},b=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],y=["true","false"],w={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],L=["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"],D=["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:b,literal:y,built_in:[...x,...M,"set","shopt",...L,...D]},contains:[h,t.SHEBANG(),m,d,t.HASH_COMMENT_MODE,o,w,s,l,u,n]}}function wx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+u+"|.)",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},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",x={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"},M=[h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:M.concat([{begin:/\(/,end:/\)/,keywords:x,contains:M.concat(["self"]),relevance:0}]),relevance:0},D={begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:b,returnBegin:!0,contains:[t.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:x,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:x,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:h,strings:d,keywords:x}}}function xx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+u+"|.)",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},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["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"],x=["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"],M=["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"],S={type:w,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},z={className:"function.dispatch",relevance:0,keywords:{_hint:M},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[z,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:O.concat([{begin:/\(/,end:/\)/,keywords:S,contains:O.concat(["self"]),relevance:0}]),relevance:0},J={className:"function",begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:b,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:S,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:S,illegal:"",keywords:S,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:S},{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/}),b={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=t.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[y,b,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],m.contains=[w,b,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let x={variants:[y,b,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},M={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},L=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",D={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:""}]}]}),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"}},x,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,M,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,M,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:"("+L+"\\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,M],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[x,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},D]}}var H2=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_-]*/}}),z2=["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"],U2=["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"],$2=["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"],W2=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],K2=["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 Sx(t){let e=t.regex,n=H2(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:":("+$2.join("|")+")"},{begin:":(:)?("+W2.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+K2.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:U2.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+z2.join("|")+")\\b"}]}}function Tx(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 Mx(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:"Nx(t,e,n-1))}function Ox(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+Nx("(?:<"+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,kx,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},kx,d]}}var Rx="[A-Za-z$_][0-9A-Za-z$_]*",V2=["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"],G2=["true","false","null","undefined","NaN","Infinity"],Ix=["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"],Dx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Lx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],q2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Y2=[].concat(Lx,Ix,Dx);function Px(t){let e=t.regex,n=(R,{after:K})=>{let te="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,K)=>{let te=R[0].length+R.index,pe=R.input[te];if(pe==="<"||pe===","){K.ignoreMatch();return}pe===">"&&(n(R,{after:te})||K.ignoreMatch());let Ce,Ue=R.input.substring(te);if(Ce=Ue.match(/^\s*=/)){K.ignoreMatch();return}if((Ce=Ue.match(/^\s+extends\s+/))&&Ce.index===0){K.ignoreMatch();return}}},l={$pattern:Rx,keyword:V2,literal:G2,built_in:Y2,"variable.language":q2},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:[]},b={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={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"}},x={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},L={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]},D=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,w,x,{match:/\$\d+/},h];m.contains=D.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(D)});let S=[].concat(L,m.contains),z=S.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),O={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:z},q={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"}}]},J={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:{_:[...Ix,...Dx]}},W={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ue={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},ye={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Te(R){return e.concat("(?!",R.join("|"),")")}let ge={match:e.concat(/\b/,Te([...Lx,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},we={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},xe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:J},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),W,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,w,x,L,{match:/\$\d+/},h,J,{className:"attr",begin:r+e.lookahead(":"),relevance:0},N,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,t.REGEXP_MODE,{className:"function",begin:P,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:z}]}]},{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"]}]}]},ue,{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},we,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},ge,ye,q,xe,{match:/\$[(.]/}]}}function Bx(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 ls="[0-9](_*[0-9])*",pu=`\\.(${ls})`,hu="[0-9a-fA-F](_*[0-9a-fA-F])*",J2={className:"number",variants:[{begin:`(\\b(${ls})((${pu})|\\.)?|(${pu}))[eE][+-]?(${ls})[fFdD]?\\b`},{begin:`\\b(${ls})((${pu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pu})[fFdD]?\\b`},{begin:`\\b(${ls})[fFdD]\\b`},{begin:`\\b0[xX]((${hu})\\.?|(${hu})?\\.(${hu}))[pP][+-]?(${ls})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${hu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Fx(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=J2,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://,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://,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 X2=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_-]*/}}),Z2=["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"],j2=["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"],Hx=["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"],zx=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Q2=["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(),eF=Hx.concat(zx);function Ux(t){let e=X2(t),n=eF,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],u=function(D){return{className:"string",begin:"~?"+D+".*?"+D}},d=function(D,S,z){return{className:D,begin:S,relevance:z}},f={$pattern:/[a-z-]+/,keyword:r,attribute:j2.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}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},y={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Q2.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}},x={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},M={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,b,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+Z2.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:":("+Hx.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+zx.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},L={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[M]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,w,x,L,y,M,b,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function $x(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 Wx(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",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 b=[n,u];return[d,f,h,m].forEach(x=>{x.contains=x.contains.concat(b)}),b=b.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},i,r,u,s]}}function Vx(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:"/,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 Gx(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=(b,y,w="\\1")=>{let x=w==="\\1"?w:e.concat(w,y);return e.concat(e.concat("(?:",b,")"),y,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,w,r)},h=(b,y,w)=>e.concat(e.concat("(?:",b,")"),y,/(?:\\.|[^\\\/])*?/,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 qx(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":(ge,we)=>{we.data._beginMatch=ge[1]||ge[2]},"on:end":(ge,we)=>{we.data._beginMatch!==ge[1]&&we.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ -]`,b={scope:"string",variants:[d,u,f,h]},y={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"],x=["__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"],M=["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"],D={keyword:x,literal:(ge=>{let we=[];return ge.forEach(xe=>{we.push(xe),xe.toLowerCase()===xe?we.push(xe.toUpperCase()):we.push(xe.toLowerCase())}),we})(w),built_in:M},S=ge=>ge.map(we=>we.replace(/\|\d+$/,"")),z={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",S(M).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},O=e.concat(r,"\\b(?!\\()"),q={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"}}]},J={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},W={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[J,o,q,t.C_BLOCK_COMMENT_MODE,b,y,z]},ue={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",S(x).join("\\b|"),"|",S(M).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[W]};W.contains.push(ue);let ye=[J,q,t.C_BLOCK_COMMENT_MODE,b,y,z],Te={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",...ye]},...ye,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:D,contains:[Te,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,ue,q,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},z,{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:D,contains:["self",o,q,t.C_BLOCK_COMMENT_MODE,b,y]}]},{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]},b,y]}}function Yx(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 Jx(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Xx(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])*",b=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,y=`\\b|${r.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${b}))[eE][+-]?(${m})[jJ]?(?=${y})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${m})[jJ](?=${y})`}]},x={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},M={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,x,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[M]},{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,M,h]}]}}function Zx(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function jx(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 Qx(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]?/},{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",b="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${b}))?([eE][+-]?(${b})|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},y,{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 q="[>?]>",J="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",W="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",ue=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+q+"|"+J+"|"+W+")(?=[ ])",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(ue).concat(d).concat(O)}}function e_(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:""},n]}}var tF=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_-]*/}}),nF=["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"],rF=["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"],iF=["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"],sF=["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 t_(t){let e=tF(t),n=oF,r=iF,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("+nF.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("+sF.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:rF.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 n_(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function r_(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"],b=f,y=[...d,...u].filter(D=>!f.includes(D)),w={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},x={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},M={begin:e.concat(/\b/,e.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function L(D,{exceptions:S,when:z}={}){let O=z;return S=S||[],D.map(q=>q.match(/\|\d+$/)||S.includes(q)?q:O(q)?`${q}|0`:q)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(y,{when:D=>D.length<3}),literal:o,type:l,built_in:h},contains:[{begin:e.either(...m),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:y.concat(m),literal:o,type:l}},{className:"type",begin:e.either(...s)},M,w,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,x]}}function a_(t){return t?typeof t=="string"?t:t.source:null}function mu(t){return ot("(?=",t,")")}function ot(...t){return t.map(n=>a_(n)).join("")}function aF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Sn(...t){return"("+(aF(t).capture?"":"?:")+t.map(r=>a_(r)).join("|")+")"}var fm=t=>ot(/\b/,t,/\w$/.test(t)?/\b/:/\B/),lF=["Protocol","Type"].map(fm),i_=["init","self"].map(fm),cF=["Any","Self"],cm=["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"],o_=["false","nil","true"],uF=["assignment","associativity","higherThan","left","lowerThan","none","right"],dF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],s_=["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"],l_=Sn(/[/=\-+!*%<>&|^~?]/,/[\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_=Sn(l_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),um=ot(l_,c_,"*"),u_=Sn(/[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]/),gu=Sn(u_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Gr=ot(u_,gu,"*"),dm=ot(/[A-Z]/,gu,"*"),fF=["autoclosure",ot(/convention\(/,Sn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ot(/objc\(/,Gr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],pF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function d_(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,Sn(...lF,...i_)],className:{2:"keyword"}},o={match:ot(/\./,Sn(...cm)),relevance:0},s=cm.filter(De=>typeof De=="string").concat(["_|0"]),l=cm.filter(De=>typeof De!="string").concat(cF).map(fm),u={variants:[{className:"keyword",match:Sn(...l,...i_)}]},d={$pattern:Sn(/\b\w+/,/#\w+/),keyword:s.concat(dF),literal:o_},f=[i,o,u],h={match:ot(/\./,Sn(...s_)),relevance:0},m={className:"built_in",match:ot(/\b/,Sn(...s_),/(?=\()/)},b=[h,m],y={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:um},{match:`\\.(\\.|${c_})+`}]},x=[y,w],M="([0-9]_*)+",L="([0-9a-fA-F]_*)+",D={className:"number",relevance:0,variants:[{match:`\\b(${M})(\\.(${M}))?([eE][+-]?(${M}))?\\b`},{match:`\\b0x(${L})(\\.(${L}))?([pP][+-]?(${M}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(De="")=>({className:"subst",variants:[{match:ot(/\\/,De,/[0\\tnr"']/)},{match:ot(/\\/,De,/u\{[0-9a-fA-F]{1,8}\}/)}]}),z=(De="")=>({className:"subst",match:ot(/\\/,De,/[\t ]*(?:[\r\n]|\r\n)/)}),O=(De="")=>({className:"subst",label:"interpol",begin:ot(/\\/,De,/\(/),end:/\)/}),q=(De="")=>({begin:ot(De,/"""/),end:ot(/"""/,De),contains:[S(De),z(De),O(De)]}),J=(De="")=>({begin:ot(De,/"/),end:ot(/"/,De),contains:[S(De),O(De)]}),W={className:"string",variants:[q(),q("#"),q("##"),q("###"),J(),J("#"),J("##"),J("###")]},ue={match:ot(/`/,Gr,/`/)},ye={className:"variable",match:/\$\d+/},Te={className:"variable",match:`\\$${gu}+`},ge=[ue,ye,Te],we={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:pF,contains:[...x,D,W]}]}},xe={className:"keyword",match:ot(/@/,Sn(...fF))},P={className:"meta",match:ot(/@/,Gr)},N=[we,xe,P],R={match:mu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ot(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,gu,"+")},{className:"type",match:dm,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ot(/\s+&\s+/,mu(dm)),relevance:0}]},K={begin://,keywords:d,contains:[...r,...f,...N,y,R]};R.contains.push(K);let te={match:ot(Gr,/\s*:/),keywords:"_|0",relevance:0},pe={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",te,...r,...f,...b,...x,D,W,...ge,...N,R]},Ce={begin://,contains:[...r,R]},Ue={begin:Sn(mu(ot(Gr,/\s*:/)),mu(ot(Gr,/\s+/,Gr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Gr}]},$e={begin:/\(/,end:/\)/,keywords:d,contains:[Ue,...r,...f,...x,D,W,...N,R,pe],endsParent:!0,illegal:/["']/},He={match:[/func/,/\s+/,Sn(ue.match,Gr,um)],className:{1:"keyword",3:"title.function"},contains:[Ce,$e,e],illegal:[/\[/,/%/]},Je={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ce,$e,e],illegal:/\[|%/},xt={match:[/operator/,/\s+/,um],className:{1:"keyword",3:"title"}},Pt={begin:[/precedencegroup/,/\s+/,dm],className:{1:"keyword",3:"title"},contains:[R],keywords:[...uF,...o_],end:/}/};for(let De of W.variants){let _t=De.contains.find(st=>st.label==="interpol");_t.keywords=d;let Xt=[...f,...b,...x,D,W,...ge];_t.contains=[...Xt,{begin:/\(/,end:/\)/,contains:["self",...Xt]}]}return{name:"Swift",keywords:d,contains:[...r,He,Je,{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]},xt,Pt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...f,...b,...x,D,W,...ge,...N,R,pe]}}var bu="[A-Za-z$_][0-9A-Za-z$_]*",f_=["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"],p_=["true","false","null","undefined","NaN","Infinity"],h_=["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"],m_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],g_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],b_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],y_=[].concat(g_,h_,m_);function hF(t){let e=t.regex,n=(R,{after:K})=>{let te="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,K)=>{let te=R[0].length+R.index,pe=R.input[te];if(pe==="<"||pe===","){K.ignoreMatch();return}pe===">"&&(n(R,{after:te})||K.ignoreMatch());let Ce,Ue=R.input.substring(te);if(Ce=Ue.match(/^\s*=/)){K.ignoreMatch();return}if((Ce=Ue.match(/^\s+extends\s+/))&&Ce.index===0){K.ignoreMatch();return}}},l={$pattern:bu,keyword:f_,literal:p_,built_in:y_,"variable.language":b_},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:[]},b={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={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"}},x={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},L={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]},D=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,w,x,{match:/\$\d+/},h];m.contains=D.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(D)});let S=[].concat(L,m.contains),z=S.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),O={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:z},q={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"}}]},J={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:{_:[...h_,...m_]}},W={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ue={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},ye={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Te(R){return e.concat("(?!",R.join("|"),")")}let ge={match:e.concat(/\b/,Te([...g_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},we={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},xe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:J},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),W,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,w,x,L,{match:/\$\d+/},h,J,{className:"attr",begin:r+e.lookahead(":"),relevance:0},N,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,t.REGEXP_MODE,{className:"function",begin:P,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:z}]}]},{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"]}]}]},ue,{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},we,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},ge,ye,q,xe,{match:/\$[(.]/}]}}function E_(t){let e=hF(t),n=bu,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:bu,keyword:f_.concat(l),literal:p_,built_in:y_.concat(r),"variable.language":b_},d={className:"meta",begin:"@"+n},f=(m,b,y)=>{let w=m.contains.findIndex(x=>x.label===b);if(w===-1)throw new Error("can not find mode to replace");m.contains.splice(w,1,y)};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 v_(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 w_(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 x_(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:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,u,l]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\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,{}[\]]+/}]}),l="[0-9]{4}(-[0-9][0-9]){0,2}",u="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",d="(\\.[0-9]*)?",f="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",h={className:"number",begin:"\\b"+l+u+d+f+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},b={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},y={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},b,y,o],x=[...w];return x.pop(),x.push(s),m.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}var K_=Vd(W_(),1);var Xn=K_.default;var G_=Vd(V_(),1),Ea=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,G_.default)(n,...r);return new t(i)}}var iH={}.hasOwnProperty,q_="hljs-";function Y_(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw Ea("Expected `string` for name, got `%s`",t);if(!Xn.getLanguage(t))throw Ea("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw Ea("Expected `string` for value, got `%s`",e);r==null&&(r=q_),Xn.configure({__emitter:xm,classPrefix:r});let i=Xn.highlight(e,{language:t,ignoreIllegals:!0});if(Xn.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||Xn.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=q_),typeof t!="string")throw Ea("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=l)}return o}function sH(t,e){Xn.registerLanguage(t,e)}var aH=function(t,e){if(typeof t=="string")Xn.registerAliases(e,{languageName:t});else{let n;for(n in t)iH.call(t,n)&&Xn.registerAliases(t[n],{languageName:n})}};function lH(t){return!!Xn.getLanguage(t)}function cH(){return Xn.listLanguages()}var xm=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""}},Ie={highlight:Y_,highlightAuto:oH,registerLanguage:sH,registered:lH,listLanguages:cH,registerAlias:aH};Ie.registerLanguage("arduino",Ex);Ie.registerLanguage("bash",vx);Ie.registerLanguage("c",wx);Ie.registerLanguage("cpp",xx);Ie.registerLanguage("csharp",_x);Ie.registerLanguage("css",Sx);Ie.registerLanguage("diff",Tx);Ie.registerLanguage("go",Mx);Ie.registerLanguage("graphql",Cx);Ie.registerLanguage("ini",Ax);Ie.registerLanguage("java",Ox);Ie.registerLanguage("javascript",Px);Ie.registerLanguage("json",Bx);Ie.registerLanguage("kotlin",Fx);Ie.registerLanguage("less",Ux);Ie.registerLanguage("lua",$x);Ie.registerLanguage("makefile",Wx);Ie.registerLanguage("markdown",Kx);Ie.registerLanguage("objectivec",Vx);Ie.registerLanguage("perl",Gx);Ie.registerLanguage("php",qx);Ie.registerLanguage("php-template",Yx);Ie.registerLanguage("plaintext",Jx);Ie.registerLanguage("python",Xx);Ie.registerLanguage("python-repl",Zx);Ie.registerLanguage("r",jx);Ie.registerLanguage("ruby",Qx);Ie.registerLanguage("rust",e_);Ie.registerLanguage("scss",t_);Ie.registerLanguage("shell",n_);Ie.registerLanguage("sql",r_);Ie.registerLanguage("swift",d_);Ie.registerLanguage("typescript",E_);Ie.registerLanguage("vbnet",v_);Ie.registerLanguage("wasm",w_);Ie.registerLanguage("xml",x_);Ie.registerLanguage("yaml",__);var Mi=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var Cq={grad:360/400,turn:360,rad:360/(Math.PI*2)},J_=t=>pH(_u(t)),_u=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?kt(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?kt(parseInt(t.substring(6,8),16)/255,2):1});var X_=t=>fH(dH(t)),uH=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:kt(t),s:kt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:kt(i/2),a:kt(r,2)}};var va=t=>{let{h:e,s:n,l:r}=uH(t);return`hsl(${e}, ${n}%, ${r}%)`};var dH=({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:kt([n,s,o,o,l,n][u]*255),g:kt([l,n,n,s,o,o][u]*255),b:kt([o,o,l,n,n,s][u]*255),a:kt(r,2)}};var xu=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?xu(kt(r*255)):"";return"#"+xu(t)+xu(e)+xu(n)+i},pH=({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:kt(60*(s<0?s+6:s)),s:kt(i?o/i*100:0),v:kt(i/255*100),a:r}};var _m=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var Z_=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:_m(_u(t),_u(e));var j_={},Su=t=>{let e=j_[t];return e||(e=document.createElement("template"),e.innerHTML=t,j_[t]=e),e},wa=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var ds=!1,Sm=t=>"touches"in t,hH=t=>ds&&!Sm(t)?!1:(ds||(ds=Sm(t)),!0),Q_=(t,e)=>{let n=Sm(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();wa(t.el,"move",t.getMove({x:Mi((n.pageX-(r.left+window.pageXOffset))/r.width),y:Mi((n.pageY-(r.top+window.pageYOffset))/r.height)}))},mH=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),wa(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)))},fs=class{constructor(e,n,r,i){let o=Su(`
`);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(ds?"touchmove":"mousemove",this),n(ds?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!hH(e)||!ds&&e.button!=0)return;this.el.focus(),Q_(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),Q_(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":mH(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Tu=class extends fs{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:va({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${kt(e)}`)}getMove(e,n){return{h:n?Mi(this.h+e.x*360,0,360):360*e.x}}};var Mu=class extends fs{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:va(e)},{"background-color":va({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${kt(e.s)}%, Brightness ${kt(e.v)}%`)}getMove(e,n){return{s:n?Mi(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Mi(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var eS=':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 tS="[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 nS="[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 Cu=Symbol("same"),Tm=Symbol("color"),rS=Symbol("hsva"),Mm=Symbol("update"),iS=Symbol("parts"),oS=Symbol("css"),sS=Symbol("sliders"),Au=class extends HTMLElement{static get observedAttributes(){return["color"]}get[oS](){return[eS,tS,nS]}get[sS](){return[Mu,Tu]}get color(){return this[Tm]}set color(e){if(!this[Cu](e)){let n=this.colorModel.toHsva(e);this[Mm](n),this[Tm]=e}}constructor(){super();let e=Su(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[iS]=this[sS].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[Cu](i)||(this.color=i)}handleEvent(e){let n=this[rS],r={...n,...e.detail};this[Mm](r);let i;!_m(r,n)&&!this[Cu](i=this.colorModel.fromHsva(r))&&(this[Tm]=i,wa(this,"color-changed",{value:i}))}[Cu](e){return this.color&&this.colorModel.equal(e,this.color)}[Mm](e){this[rS]=e,this[iS].forEach(n=>n.update(e))}};var gH={defaultColor:"#000",toHsva:J_,fromHsva:({h:t,s:e,v:n})=>X_({h:t,s:e,v:n,a:1}),equal:Z_,fromAttr:t=>t},ku=class extends Au{get colorModel(){return gH}};var cS=Vd(aS(),1);customElements.define("tiptap-hex-color-picker",ku);var bH={blockquote:[AE],bold:[kE],"bullet-list":[RE],"checked-list":[zp],code:[IE],"code-block":[Ah.configure({lowlight:Ie,HTMLAttributes:{class:"hljs"}})],color:[LE],details:[mh,gh,bh],grid:[uh,dh],"grid-builder":[nm,rm],heading:[$E.configure({levels:[1,2,3,4,5,6]})],highlight:[Hv],hr:[JE],hurdle:[kh],italic:[XE],lead:[Up],link:[ah.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[lh.configure({inline:!0})],oembed:[fh,ph,hh],"ordered-list":[QE],small:[ch],strike:[tv],subscript:[nv],superscript:[rv],table:[Iv.configure({resizable:!0}),Lv,Dv,Pv],underline:[Fv]},yH=window.TiptapEditorExtensions||{},lS={...bH,...yH},Nu=document.getElementById("activeLocale");Nu&&Nu.addEventListener("change",()=>{let t=new CustomEvent("localeChange",{bubbles:!0,detail:{locale:Nu.value}});Nu.dispatchEvent(t)});function EH({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",floatingMenuTools:o=[],placeholder:s=null,mergeTags:l=[]}){let u=window.filamentTiptapEditors||{};return{id:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),disabled:r,locale:i,floatingMenuTools:o,editorInstance:null,get showDefaultBubbleMenu(){return!(this.editor().isActive("link")||this.editor().isActive("table")||this.editor().isActive("image")||this.editor().isActive("oembed")||this.editor().isActive("vimeo")||this.editor().isActive("youtube")||this.editor().isActive("video")||this.editor().isActive("tiptapBlock"))},get showTableBubbleMenu(){return this.editor().isActive("table")},get showLinkBubbleMenu(){return this.editor().isActive("link")},getExtensions(d){let f=this.tools.map(m=>typeof m=="string"?m:m.id),h=[PE,Bv,sc,FE,zE,UE,YE,DE,om,im,am,lm];if(s&&!r&&h.push(ev.configure({placeholder:s})),f.length){let m=Object.keys(lS),b=[],y=["paragraph"];h.push(Qh.configure({pluginKey:`defaultBubbleMenu${d}`,element:this.$refs.defaultBubbleMenu,tippyOptions:{duration:[500,0]},shouldShow:({state:w,from:x,to:M})=>!(x===M||this.editor().isActive("link")||this.editor().isActive("table")||this.editor().isActive("image")||this.editor().isActive("oembed")||this.editor().isActive("vimeo")||this.editor().isActive("youtube")||this.editor().isActive("video")||this.editor().isActive("tiptapBlock"))})),this.floatingMenuTools.length&&(h.push(tm.configure({pluginKey:`defaultFloatingMenu${d}`,element:this.$refs.defaultFloatingMenu,tippyOptions:{duration:[500,0]}})),this.floatingMenuTools.forEach(w=>{f.includes(w)||f.push(w)})),f.forEach(w=>{m.includes(w)?lS[w].forEach(x=>{["ordered-list","bullet-list","checked-list"].includes(w)?(h.push(x),h.includes(Cp)||h.push(Cp)):h.push(x)}):["align-left","align-right","align-center","align-justify"].includes(w)&&(w==="align-left"&&b.push("start"),w==="align-center"&&b.push("center"),w==="align-right"&&b.push("end"),w==="align-justify"&&b.push("justify"),f.includes("heading")&&y.push("heading"),typeof h.find(M=>M.name==="textAlign")>"u"&&h.push(Nh.configure({types:y,alignments:b})))})}return l?.length&&h.push(sm.configure({mergeTags:l})),h},init:async function(){this.initEditor(this.state),document.addEventListener("dblclick",function(f){(f.target&&(f.target.hasAttribute("data-youtube-video")||f.target.hasAttribute("data-vimeo-video"))||f.target.hasAttribute("data-native-video"))&&(f.target.firstChild.style.pointerEvents="all")}),window.addEventListener("localeChange",f=>{this.locale=f.detail.locale});let d=this.$el.parentElement.closest("[x-sortable]");d&&(window.Sortable.utils.on(d,"start",()=>{let f=document.querySelectorAll(".tiptap-wrapper");f.length!==0&&f.forEach(function(h){h._x_dataStack[0].editor().setEditable(!1),h._x_dataStack[0].editor().options.element.style.pointerEvents="none"})}),window.Sortable.utils.on(d,"end",()=>{let f=document.querySelectorAll(".tiptap-wrapper");f.length!==0&&f.forEach(function(h){h._x_dataStack[0].editor().setEditable(!0),h._x_dataStack[0].editor().options.element.style.pointerEvents="all"})})),this.$watch("state",(f,h)=>{typeof f<"u"&&((0,cS.isEqual)(h,Alpine.raw(f))||this.updateEditorContent(f))})},editor(){return Alpine.raw(this.editorInstance)},initEditor(d){let f=this;if(this.$root._editor){this.editorInstance=this.$root._editor;return}this.$root._editor=this.editorInstance=new ql({element:this.$refs.element,extensions:this.getExtensions(this.statePath),editable:!this.disabled,content:d,editorProps:{handlePaste(h,m,b){b.content.descendants(y=>{y.type.name==="tiptapBlock"&&(y.attrs.statePath=f.statePath,y.attrs.data=JSON.parse(y.attrs.data))})}},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()}})},updateEditorContent(d){if(this.editor().isEditable){let{from:f,to:h}=this.editor().state.selection;this.editor().commands.setContent(d,!0),this.editor().chain().focus().setTextSelection({from:f,to:h}).run()}},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},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"],b=/.*\.([a-zA-Z]*)\??/.exec(f);b!==null&&h.includes(b[1])?this.editor().chain().focus().setImage({src:f,alt:d?.alt,title:d?.title,width:d?.width,height:d?.height,lazy:d?.lazy}).run():this.editor().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")?this.editor().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")?this.editor().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():this.editor().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}this.editor().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(){this.editor().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,b=parseInt(f.asymmetric_right)??null;f.fixed&&(h="fixed"),f.asymmetric&&(h="asymmetric"),this.editor().chain().focus().insertGridBuilder({cols:f.columns,type:h,stackAt:f.stack_at,asymmetricLeft:m,asymmetricRight:b}).run()},insertBlock(d){d.detail.statePath===this.statePath&&(this.editor().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}),this.editor().isFocused||this.editor().commands.focus())},insertMergeTag(d){this.editor().commands.insertMergeTag({tag:d.detail.tag,coordinates:d.detail.coordinates}),this.editor().isFocused||this.editor().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&&(this.editor().commands.updateBlock({type:d.detail.type,statePath:d.detail.statePath,data:d.detail.data,preview:d.detail.preview,label:d.detail.label}),this.editor().isFocused||this.editor().commands.focus())},deleteBlock(){this.editor().commands.removeBlock()}}}export{EH as default}; + `;t=document.createElement("div"),t.innerHTML=r,t.addEventListener("merge-tags-select",i=>{n.command({id:i.detail.item})}),e=ss("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 am=Qe.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"),renderHTML:t=>t.class?{class:t.class}:{}}}}]}});var lm=Qe.create({name:"idExtension",addGlobalAttributes(){return[{types:["heading","link"],attributes:{id:{default:null,parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}}]}});function F2(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+u+"|.)",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},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["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"],x=["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"],M=["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"],S={type:w,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},z={className:"function.dispatch",relevance:0,keywords:{_hint:M},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[z,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:O.concat([{begin:/\(/,end:/\)/,keywords:S,contains:O.concat(["self"]),relevance:0}]),relevance:0},J={className:"function",begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:b,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:S,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:S,illegal:"",keywords:S,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ex(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=F2(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 vx(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},b=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],y=["true","false"],w={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["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:b,literal:y,built_in:[...x,...M,"set","shopt",...D,...L]},contains:[h,t.SHEBANG(),m,d,t.HASH_COMMENT_MODE,o,w,s,l,u,n]}}function wx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+u+"|.)",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},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",x={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"},M=[h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:M.concat([{begin:/\(/,end:/\)/,keywords:x,contains:M.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:b,returnBegin:!0,contains:[t.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:x,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:x,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:h,strings:d,keywords:x}}}function xx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+u+"|.)",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},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["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"],x=["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"],M=["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"],S={type:w,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},z={className:"function.dispatch",relevance:0,keywords:{_hint:M},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[z,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:O.concat([{begin:/\(/,end:/\)/,keywords:S,contains:O.concat(["self"]),relevance:0}]),relevance:0},J={className:"function",begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:b,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:S,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:S,illegal:"",keywords:S,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:S},{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/}),b={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=t.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[y,b,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],m.contains=[w,b,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let x={variants:[y,b,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},M={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:""}]}]}),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"}},x,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,M,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,M,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,M],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[x,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},L]}}var H2=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_-]*/}}),z2=["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"],U2=["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"],$2=["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"],W2=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],K2=["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 Sx(t){let e=t.regex,n=H2(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:":("+$2.join("|")+")"},{begin:":(:)?("+W2.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+K2.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:U2.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+z2.join("|")+")\\b"}]}}function Tx(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 Mx(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:"Nx(t,e,n-1))}function Ox(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+Nx("(?:<"+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,kx,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},kx,d]}}var Rx="[A-Za-z$_][0-9A-Za-z$_]*",V2=["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"],G2=["true","false","null","undefined","NaN","Infinity"],Ix=["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"],Lx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Dx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],q2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Y2=[].concat(Dx,Ix,Lx);function Px(t){let e=t.regex,n=(R,{after:K})=>{let te="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,K)=>{let te=R[0].length+R.index,pe=R.input[te];if(pe==="<"||pe===","){K.ignoreMatch();return}pe===">"&&(n(R,{after:te})||K.ignoreMatch());let Ce,Ue=R.input.substring(te);if(Ce=Ue.match(/^\s*=/)){K.ignoreMatch();return}if((Ce=Ue.match(/^\s+extends\s+/))&&Ce.index===0){K.ignoreMatch();return}}},l={$pattern:Rx,keyword:V2,literal:G2,built_in:Y2,"variable.language":q2},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:[]},b={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={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"}},x={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,b,y,w,x,{match:/\$\d+/},h];m.contains=L.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(L)});let S=[].concat(D,m.contains),z=S.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),O={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:z},q={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"}}]},J={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:{_:[...Ix,...Lx]}},W={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ue={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},ye={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Te(R){return e.concat("(?!",R.join("|"),")")}let ge={match:e.concat(/\b/,Te([...Dx,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},we={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},xe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:J},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),W,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,w,x,D,{match:/\$\d+/},h,J,{className:"attr",begin:r+e.lookahead(":"),relevance:0},N,{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:P,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:z}]}]},{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"]}]}]},ue,{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},we,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},ge,ye,q,xe,{match:/\$[(.]/}]}}function Bx(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 ls="[0-9](_*[0-9])*",pu=`\\.(${ls})`,hu="[0-9a-fA-F](_*[0-9a-fA-F])*",J2={className:"number",variants:[{begin:`(\\b(${ls})((${pu})|\\.)?|(${pu}))[eE][+-]?(${ls})[fFdD]?\\b`},{begin:`\\b(${ls})((${pu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pu})[fFdD]?\\b`},{begin:`\\b(${ls})[fFdD]\\b`},{begin:`\\b0[xX]((${hu})\\.?|(${hu})?\\.(${hu}))[pP][+-]?(${ls})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${hu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Fx(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=J2,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://,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://,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 X2=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_-]*/}}),Z2=["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"],j2=["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"],Hx=["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"],zx=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Q2=["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(),eF=Hx.concat(zx);function Ux(t){let e=X2(t),n=eF,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],u=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},d=function(L,S,z){return{className:L,begin:S,relevance:z}},f={$pattern:/[a-z-]+/,keyword:r,attribute:j2.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}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},y={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Q2.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}},x={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},M={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,b,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+Z2.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:":("+Hx.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+zx.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},D={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[M]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,w,x,D,y,M,b,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function $x(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 Wx(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",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 b=[n,u];return[d,f,h,m].forEach(x=>{x.contains=x.contains.concat(b)}),b=b.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},i,r,u,s]}}function Vx(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:"/,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 Gx(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=(b,y,w="\\1")=>{let x=w==="\\1"?w:e.concat(w,y);return e.concat(e.concat("(?:",b,")"),y,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,w,r)},h=(b,y,w)=>e.concat(e.concat("(?:",b,")"),y,/(?:\\.|[^\\\/])*?/,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 qx(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":(ge,we)=>{we.data._beginMatch=ge[1]||ge[2]},"on:end":(ge,we)=>{we.data._beginMatch!==ge[1]&&we.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ +]`,b={scope:"string",variants:[d,u,f,h]},y={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"],x=["__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"],M=["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:x,literal:(ge=>{let we=[];return ge.forEach(xe=>{we.push(xe),xe.toLowerCase()===xe?we.push(xe.toUpperCase()):we.push(xe.toLowerCase())}),we})(w),built_in:M},S=ge=>ge.map(we=>we.replace(/\|\d+$/,"")),z={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",S(M).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},O=e.concat(r,"\\b(?!\\()"),q={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"}}]},J={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},W={relevance:0,begin:/\(/,end:/\)/,keywords:L,contains:[J,o,q,t.C_BLOCK_COMMENT_MODE,b,y,z]},ue={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",S(x).join("\\b|"),"|",S(M).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[W]};W.contains.push(ue);let ye=[J,q,t.C_BLOCK_COMMENT_MODE,b,y,z],Te={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",...ye]},...ye,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:L,contains:[Te,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,ue,q,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},z,{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,q,t.C_BLOCK_COMMENT_MODE,b,y]}]},{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]},b,y]}}function Yx(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 Jx(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Xx(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])*",b=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,y=`\\b|${r.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${b}))[eE][+-]?(${m})[jJ]?(?=${y})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${m})[jJ](?=${y})`}]},x={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},M={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,x,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[M]},{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,M,h]}]}}function Zx(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function jx(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 Qx(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]?/},{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",b="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${b}))?([eE][+-]?(${b})|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},y,{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 q="[>?]>",J="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",W="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",ue=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+q+"|"+J+"|"+W+")(?=[ ])",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(ue).concat(d).concat(O)}}function e_(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:""},n]}}var tF=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_-]*/}}),nF=["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"],rF=["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"],iF=["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"],sF=["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 t_(t){let e=tF(t),n=oF,r=iF,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("+nF.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("+sF.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:rF.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 n_(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function r_(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"],b=f,y=[...d,...u].filter(L=>!f.includes(L)),w={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},x={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},M={begin:e.concat(/\b/,e.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function D(L,{exceptions:S,when:z}={}){let O=z;return S=S||[],L.map(q=>q.match(/\|\d+$/)||S.includes(q)?q:O(q)?`${q}|0`:q)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(y,{when:L=>L.length<3}),literal:o,type:l,built_in:h},contains:[{begin:e.either(...m),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:y.concat(m),literal:o,type:l}},{className:"type",begin:e.either(...s)},M,w,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,x]}}function a_(t){return t?typeof t=="string"?t:t.source:null}function mu(t){return ot("(?=",t,")")}function ot(...t){return t.map(n=>a_(n)).join("")}function aF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Sn(...t){return"("+(aF(t).capture?"":"?:")+t.map(r=>a_(r)).join("|")+")"}var fm=t=>ot(/\b/,t,/\w$/.test(t)?/\b/:/\B/),lF=["Protocol","Type"].map(fm),i_=["init","self"].map(fm),cF=["Any","Self"],cm=["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"],o_=["false","nil","true"],uF=["assignment","associativity","higherThan","left","lowerThan","none","right"],dF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],s_=["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"],l_=Sn(/[/=\-+!*%<>&|^~?]/,/[\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_=Sn(l_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),um=ot(l_,c_,"*"),u_=Sn(/[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]/),gu=Sn(u_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Gr=ot(u_,gu,"*"),dm=ot(/[A-Z]/,gu,"*"),fF=["autoclosure",ot(/convention\(/,Sn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ot(/objc\(/,Gr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],pF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function d_(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,Sn(...lF,...i_)],className:{2:"keyword"}},o={match:ot(/\./,Sn(...cm)),relevance:0},s=cm.filter(Le=>typeof Le=="string").concat(["_|0"]),l=cm.filter(Le=>typeof Le!="string").concat(cF).map(fm),u={variants:[{className:"keyword",match:Sn(...l,...i_)}]},d={$pattern:Sn(/\b\w+/,/#\w+/),keyword:s.concat(dF),literal:o_},f=[i,o,u],h={match:ot(/\./,Sn(...s_)),relevance:0},m={className:"built_in",match:ot(/\b/,Sn(...s_),/(?=\()/)},b=[h,m],y={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:um},{match:`\\.(\\.|${c_})+`}]},x=[y,w],M="([0-9]_*)+",D="([0-9a-fA-F]_*)+",L={className:"number",relevance:0,variants:[{match:`\\b(${M})(\\.(${M}))?([eE][+-]?(${M}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${M}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(Le="")=>({className:"subst",variants:[{match:ot(/\\/,Le,/[0\\tnr"']/)},{match:ot(/\\/,Le,/u\{[0-9a-fA-F]{1,8}\}/)}]}),z=(Le="")=>({className:"subst",match:ot(/\\/,Le,/[\t ]*(?:[\r\n]|\r\n)/)}),O=(Le="")=>({className:"subst",label:"interpol",begin:ot(/\\/,Le,/\(/),end:/\)/}),q=(Le="")=>({begin:ot(Le,/"""/),end:ot(/"""/,Le),contains:[S(Le),z(Le),O(Le)]}),J=(Le="")=>({begin:ot(Le,/"/),end:ot(/"/,Le),contains:[S(Le),O(Le)]}),W={className:"string",variants:[q(),q("#"),q("##"),q("###"),J(),J("#"),J("##"),J("###")]},ue={match:ot(/`/,Gr,/`/)},ye={className:"variable",match:/\$\d+/},Te={className:"variable",match:`\\$${gu}+`},ge=[ue,ye,Te],we={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:pF,contains:[...x,L,W]}]}},xe={className:"keyword",match:ot(/@/,Sn(...fF))},P={className:"meta",match:ot(/@/,Gr)},N=[we,xe,P],R={match:mu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ot(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,gu,"+")},{className:"type",match:dm,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ot(/\s+&\s+/,mu(dm)),relevance:0}]},K={begin://,keywords:d,contains:[...r,...f,...N,y,R]};R.contains.push(K);let te={match:ot(Gr,/\s*:/),keywords:"_|0",relevance:0},pe={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",te,...r,...f,...b,...x,L,W,...ge,...N,R]},Ce={begin://,contains:[...r,R]},Ue={begin:Sn(mu(ot(Gr,/\s*:/)),mu(ot(Gr,/\s+/,Gr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Gr}]},$e={begin:/\(/,end:/\)/,keywords:d,contains:[Ue,...r,...f,...x,L,W,...N,R,pe],endsParent:!0,illegal:/["']/},He={match:[/func/,/\s+/,Sn(ue.match,Gr,um)],className:{1:"keyword",3:"title.function"},contains:[Ce,$e,e],illegal:[/\[/,/%/]},Je={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ce,$e,e],illegal:/\[|%/},xt={match:[/operator/,/\s+/,um],className:{1:"keyword",3:"title"}},Pt={begin:[/precedencegroup/,/\s+/,dm],className:{1:"keyword",3:"title"},contains:[R],keywords:[...uF,...o_],end:/}/};for(let Le of W.variants){let _t=Le.contains.find(st=>st.label==="interpol");_t.keywords=d;let Xt=[...f,...b,...x,L,W,...ge];_t.contains=[...Xt,{begin:/\(/,end:/\)/,contains:["self",...Xt]}]}return{name:"Swift",keywords:d,contains:[...r,He,Je,{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]},xt,Pt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...f,...b,...x,L,W,...ge,...N,R,pe]}}var bu="[A-Za-z$_][0-9A-Za-z$_]*",f_=["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"],p_=["true","false","null","undefined","NaN","Infinity"],h_=["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"],m_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],g_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],b_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],y_=[].concat(g_,h_,m_);function hF(t){let e=t.regex,n=(R,{after:K})=>{let te="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,K)=>{let te=R[0].length+R.index,pe=R.input[te];if(pe==="<"||pe===","){K.ignoreMatch();return}pe===">"&&(n(R,{after:te})||K.ignoreMatch());let Ce,Ue=R.input.substring(te);if(Ce=Ue.match(/^\s*=/)){K.ignoreMatch();return}if((Ce=Ue.match(/^\s+extends\s+/))&&Ce.index===0){K.ignoreMatch();return}}},l={$pattern:bu,keyword:f_,literal:p_,built_in:y_,"variable.language":b_},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:[]},b={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={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"}},x={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,b,y,w,x,{match:/\$\d+/},h];m.contains=L.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(L)});let S=[].concat(D,m.contains),z=S.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),O={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:z},q={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"}}]},J={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:{_:[...h_,...m_]}},W={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ue={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},ye={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Te(R){return e.concat("(?!",R.join("|"),")")}let ge={match:e.concat(/\b/,Te([...g_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},we={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},xe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:J},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),W,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,y,w,x,D,{match:/\$\d+/},h,J,{className:"attr",begin:r+e.lookahead(":"),relevance:0},N,{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:P,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:z}]}]},{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"]}]}]},ue,{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},we,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},ge,ye,q,xe,{match:/\$[(.]/}]}}function E_(t){let e=hF(t),n=bu,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:bu,keyword:f_.concat(l),literal:p_,built_in:y_.concat(r),"variable.language":b_},d={className:"meta",begin:"@"+n},f=(m,b,y)=>{let w=m.contains.findIndex(x=>x.label===b);if(w===-1)throw new Error("can not find mode to replace");m.contains.splice(w,1,y)};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 v_(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 w_(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 x_(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:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,u,l]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\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,{}[\]]+/}]}),l="[0-9]{4}(-[0-9][0-9]){0,2}",u="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",d="(\\.[0-9]*)?",f="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",h={className:"number",begin:"\\b"+l+u+d+f+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},b={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},y={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},b,y,o],x=[...w];return x.pop(),x.push(s),m.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}var K_=Vd(W_(),1);var Xn=K_.default;var G_=Vd(V_(),1),Ea=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,G_.default)(n,...r);return new t(i)}}var iH={}.hasOwnProperty,q_="hljs-";function Y_(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw Ea("Expected `string` for name, got `%s`",t);if(!Xn.getLanguage(t))throw Ea("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw Ea("Expected `string` for value, got `%s`",e);r==null&&(r=q_),Xn.configure({__emitter:xm,classPrefix:r});let i=Xn.highlight(e,{language:t,ignoreIllegals:!0});if(Xn.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||Xn.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=q_),typeof t!="string")throw Ea("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=l)}return o}function sH(t,e){Xn.registerLanguage(t,e)}var aH=function(t,e){if(typeof t=="string")Xn.registerAliases(e,{languageName:t});else{let n;for(n in t)iH.call(t,n)&&Xn.registerAliases(t[n],{languageName:n})}};function lH(t){return!!Xn.getLanguage(t)}function cH(){return Xn.listLanguages()}var xm=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""}},Ie={highlight:Y_,highlightAuto:oH,registerLanguage:sH,registered:lH,listLanguages:cH,registerAlias:aH};Ie.registerLanguage("arduino",Ex);Ie.registerLanguage("bash",vx);Ie.registerLanguage("c",wx);Ie.registerLanguage("cpp",xx);Ie.registerLanguage("csharp",_x);Ie.registerLanguage("css",Sx);Ie.registerLanguage("diff",Tx);Ie.registerLanguage("go",Mx);Ie.registerLanguage("graphql",Cx);Ie.registerLanguage("ini",Ax);Ie.registerLanguage("java",Ox);Ie.registerLanguage("javascript",Px);Ie.registerLanguage("json",Bx);Ie.registerLanguage("kotlin",Fx);Ie.registerLanguage("less",Ux);Ie.registerLanguage("lua",$x);Ie.registerLanguage("makefile",Wx);Ie.registerLanguage("markdown",Kx);Ie.registerLanguage("objectivec",Vx);Ie.registerLanguage("perl",Gx);Ie.registerLanguage("php",qx);Ie.registerLanguage("php-template",Yx);Ie.registerLanguage("plaintext",Jx);Ie.registerLanguage("python",Xx);Ie.registerLanguage("python-repl",Zx);Ie.registerLanguage("r",jx);Ie.registerLanguage("ruby",Qx);Ie.registerLanguage("rust",e_);Ie.registerLanguage("scss",t_);Ie.registerLanguage("shell",n_);Ie.registerLanguage("sql",r_);Ie.registerLanguage("swift",d_);Ie.registerLanguage("typescript",E_);Ie.registerLanguage("vbnet",v_);Ie.registerLanguage("wasm",w_);Ie.registerLanguage("xml",x_);Ie.registerLanguage("yaml",__);var Mi=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var Cq={grad:360/400,turn:360,rad:360/(Math.PI*2)},J_=t=>pH(_u(t)),_u=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?kt(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?kt(parseInt(t.substring(6,8),16)/255,2):1});var X_=t=>fH(dH(t)),uH=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:kt(t),s:kt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:kt(i/2),a:kt(r,2)}};var va=t=>{let{h:e,s:n,l:r}=uH(t);return`hsl(${e}, ${n}%, ${r}%)`};var dH=({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:kt([n,s,o,o,l,n][u]*255),g:kt([l,n,n,s,o,o][u]*255),b:kt([o,o,l,n,n,s][u]*255),a:kt(r,2)}};var xu=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?xu(kt(r*255)):"";return"#"+xu(t)+xu(e)+xu(n)+i},pH=({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:kt(60*(s<0?s+6:s)),s:kt(i?o/i*100:0),v:kt(i/255*100),a:r}};var _m=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var Z_=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:_m(_u(t),_u(e));var j_={},Su=t=>{let e=j_[t];return e||(e=document.createElement("template"),e.innerHTML=t,j_[t]=e),e},wa=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var ds=!1,Sm=t=>"touches"in t,hH=t=>ds&&!Sm(t)?!1:(ds||(ds=Sm(t)),!0),Q_=(t,e)=>{let n=Sm(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();wa(t.el,"move",t.getMove({x:Mi((n.pageX-(r.left+window.pageXOffset))/r.width),y:Mi((n.pageY-(r.top+window.pageYOffset))/r.height)}))},mH=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),wa(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)))},fs=class{constructor(e,n,r,i){let o=Su(`
`);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(ds?"touchmove":"mousemove",this),n(ds?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!hH(e)||!ds&&e.button!=0)return;this.el.focus(),Q_(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),Q_(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":mH(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Tu=class extends fs{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:va({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${kt(e)}`)}getMove(e,n){return{h:n?Mi(this.h+e.x*360,0,360):360*e.x}}};var Mu=class extends fs{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:va(e)},{"background-color":va({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${kt(e.s)}%, Brightness ${kt(e.v)}%`)}getMove(e,n){return{s:n?Mi(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Mi(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var eS=':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 tS="[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 nS="[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 Cu=Symbol("same"),Tm=Symbol("color"),rS=Symbol("hsva"),Mm=Symbol("update"),iS=Symbol("parts"),oS=Symbol("css"),sS=Symbol("sliders"),Au=class extends HTMLElement{static get observedAttributes(){return["color"]}get[oS](){return[eS,tS,nS]}get[sS](){return[Mu,Tu]}get color(){return this[Tm]}set color(e){if(!this[Cu](e)){let n=this.colorModel.toHsva(e);this[Mm](n),this[Tm]=e}}constructor(){super();let e=Su(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[iS]=this[sS].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[Cu](i)||(this.color=i)}handleEvent(e){let n=this[rS],r={...n,...e.detail};this[Mm](r);let i;!_m(r,n)&&!this[Cu](i=this.colorModel.fromHsva(r))&&(this[Tm]=i,wa(this,"color-changed",{value:i}))}[Cu](e){return this.color&&this.colorModel.equal(e,this.color)}[Mm](e){this[rS]=e,this[iS].forEach(n=>n.update(e))}};var gH={defaultColor:"#000",toHsva:J_,fromHsva:({h:t,s:e,v:n})=>X_({h:t,s:e,v:n,a:1}),equal:Z_,fromAttr:t=>t},ku=class extends Au{get colorModel(){return gH}};var cS=Vd(aS(),1);customElements.define("tiptap-hex-color-picker",ku);var bH={blockquote:[AE],bold:[kE],"bullet-list":[RE],"checked-list":[zp],code:[IE],"code-block":[Ah.configure({lowlight:Ie,HTMLAttributes:{class:"hljs"}})],color:[DE],details:[mh,gh,bh],grid:[uh,dh],"grid-builder":[nm,rm],heading:[$E.configure({levels:[1,2,3,4,5,6]})],highlight:[Hv],hr:[JE],hurdle:[kh],italic:[XE],lead:[Up],link:[ah.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[lh.configure({inline:!0})],oembed:[fh,ph,hh],"ordered-list":[QE],small:[ch],strike:[tv],subscript:[nv],superscript:[rv],table:[Iv.configure({resizable:!0}),Dv,Lv,Pv],underline:[Fv]},yH=window.TiptapEditorExtensions||{},lS={...bH,...yH},Nu=document.getElementById("activeLocale");Nu&&Nu.addEventListener("change",()=>{let t=new CustomEvent("localeChange",{bubbles:!0,detail:{locale:Nu.value}});Nu.dispatchEvent(t)});function EH({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",floatingMenuTools:o=[],placeholder:s=null,mergeTags:l=[]}){let u=window.filamentTiptapEditors||{};return{id:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),disabled:r,locale:i,floatingMenuTools:o,editorInstance:null,get showDefaultBubbleMenu(){return!(this.editor().isActive("link")||this.editor().isActive("table")||this.editor().isActive("image")||this.editor().isActive("oembed")||this.editor().isActive("vimeo")||this.editor().isActive("youtube")||this.editor().isActive("video")||this.editor().isActive("tiptapBlock"))},get showTableBubbleMenu(){return this.editor().isActive("table")},get showLinkBubbleMenu(){return this.editor().isActive("link")},getExtensions(d){let f=this.tools.map(m=>typeof m=="string"?m:m.id),h=[PE,Bv,sc,FE,zE,UE,YE,LE,om,im,am,lm];if(s&&!r&&h.push(ev.configure({placeholder:s})),f.length){let m=Object.keys(lS),b=[],y=["paragraph"];h.push(Qh.configure({pluginKey:`defaultBubbleMenu${d}`,element:this.$refs.defaultBubbleMenu,tippyOptions:{duration:[500,0]},shouldShow:({state:w,from:x,to:M})=>!(x===M||this.editor().isActive("link")||this.editor().isActive("table")||this.editor().isActive("image")||this.editor().isActive("oembed")||this.editor().isActive("vimeo")||this.editor().isActive("youtube")||this.editor().isActive("video")||this.editor().isActive("tiptapBlock"))})),this.floatingMenuTools.length&&(h.push(tm.configure({pluginKey:`defaultFloatingMenu${d}`,element:this.$refs.defaultFloatingMenu,tippyOptions:{duration:[500,0]}})),this.floatingMenuTools.forEach(w=>{f.includes(w)||f.push(w)})),f.forEach(w=>{m.includes(w)?lS[w].forEach(x=>{["ordered-list","bullet-list","checked-list"].includes(w)?(h.push(x),h.includes(Cp)||h.push(Cp)):h.push(x)}):["align-left","align-right","align-center","align-justify"].includes(w)&&(w==="align-left"&&b.push("start"),w==="align-center"&&b.push("center"),w==="align-right"&&b.push("end"),w==="align-justify"&&b.push("justify"),f.includes("heading")&&y.push("heading"),typeof h.find(M=>M.name==="textAlign")>"u"&&h.push(Nh.configure({types:y,alignments:b})))})}return l?.length&&h.push(sm.configure({mergeTags:l})),h},init:async function(){this.initEditor(this.state),document.addEventListener("dblclick",function(f){(f.target&&(f.target.hasAttribute("data-youtube-video")||f.target.hasAttribute("data-vimeo-video"))||f.target.hasAttribute("data-native-video"))&&(f.target.firstChild.style.pointerEvents="all")}),window.addEventListener("localeChange",f=>{this.locale=f.detail.locale});let d=this.$el.parentElement.closest("[x-sortable]");d&&(window.Sortable.utils.on(d,"start",()=>{let f=document.querySelectorAll(".tiptap-wrapper");f.length!==0&&f.forEach(function(h){h._x_dataStack[0].editor().setEditable(!1),h._x_dataStack[0].editor().options.element.style.pointerEvents="none"})}),window.Sortable.utils.on(d,"end",()=>{let f=document.querySelectorAll(".tiptap-wrapper");f.length!==0&&f.forEach(function(h){h._x_dataStack[0].editor().setEditable(!0),h._x_dataStack[0].editor().options.element.style.pointerEvents="all"})})),this.$watch("state",(f,h)=>{typeof f<"u"&&((0,cS.isEqual)(h,Alpine.raw(f))||this.updateEditorContent(f))})},editor(){return Alpine.raw(this.editorInstance)},initEditor(d){let f=this;if(this.$root._editor){this.editorInstance=this.$root._editor;return}this.$root._editor=this.editorInstance=new ql({element:this.$refs.element,extensions:this.getExtensions(this.statePath),editable:!this.disabled,content:d,editorProps:{handlePaste(h,m,b){b.content.descendants(y=>{y.type.name==="tiptapBlock"&&(y.attrs.statePath=f.statePath,y.attrs.data=JSON.parse(y.attrs.data))})}},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()}})},updateEditorContent(d){if(this.editor().isEditable){let{from:f,to:h}=this.editor().state.selection;this.editor().commands.setContent(d,!0),this.editor().chain().focus().setTextSelection({from:f,to:h}).run()}},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},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"],b=/.*\.([a-zA-Z]*)\??/.exec(f);b!==null&&h.includes(b[1])?this.editor().chain().focus().setImage({src:f,alt:d?.alt,title:d?.title,width:d?.width,height:d?.height,lazy:d?.lazy}).run():this.editor().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")?this.editor().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")?this.editor().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():this.editor().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}this.editor().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(){this.editor().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,b=parseInt(f.asymmetric_right)??null;f.fixed&&(h="fixed"),f.asymmetric&&(h="asymmetric"),this.editor().chain().focus().insertGridBuilder({cols:f.columns,type:h,stackAt:f.stack_at,asymmetricLeft:m,asymmetricRight:b}).run()},insertBlock(d){d.detail.statePath===this.statePath&&(this.editor().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}),this.editor().isFocused||this.editor().commands.focus())},insertMergeTag(d){this.editor().commands.insertMergeTag({tag:d.detail.tag,coordinates:d.detail.coordinates}),this.editor().isFocused||this.editor().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&&(this.editor().commands.updateBlock({type:d.detail.type,statePath:d.detail.statePath,data:d.detail.data,preview:d.detail.preview,label:d.detail.label}),this.editor().isFocused||this.editor().commands.focus())},deleteBlock(){this.editor().commands.removeBlock()}}}export{EH as default}; /*! Bundled license information: lodash/lodash.js: diff --git a/resources/js/extensions/Image.js b/resources/js/extensions/Image.js index 76321fd8..3b0bca25 100644 --- a/resources/js/extensions/Image.js +++ b/resources/js/extensions/Image.js @@ -19,12 +19,14 @@ export const CustomImage = Image.extend({ default: null, }, lazy: { - default: false, - getAttrs: (value) => (value ? { "data-lazy": value } : null), + default: null, + parseHTML: element => element.getAttribute('loading') === 'lazy' ? element.getAttribute('data-lazy') : null, renderHTML: (attributes) => { + console.log(attributes) if (attributes.lazy) { return { "data-lazy": attributes.lazy, + "loading": "lazy", }; } } diff --git a/src/Extensions/Nodes/Image.php b/src/Extensions/Nodes/Image.php index 85ab3644..96bcb950 100644 --- a/src/Extensions/Nodes/Image.php +++ b/src/Extensions/Nodes/Image.php @@ -27,7 +27,7 @@ public function addAttributes(): array 'lazy' => [ 'default' => false, 'parseHTML' => function ($DOMNode) { - return $DOMNode->hasAttribute('data-loading') && $DOMNode->getAttribute('data-loading') === 'lazy'; + return $DOMNode->hasAttribute('loading') && $DOMNode->getAttribute('loading') === 'lazy'; }, 'renderHTML' => function ($attributes) { return $attributes->lazy diff --git a/src/TiptapConverter.php b/src/TiptapConverter.php index b43627ab..27777ad7 100644 --- a/src/TiptapConverter.php +++ b/src/TiptapConverter.php @@ -143,7 +143,7 @@ public function parseHeadings(Editor $editor, int $maxDepth = 3): Editor if (! property_exists($node->attrs, 'id') || $node->attrs->id === null) { $node->attrs->id = str(collect($node->content)->map(function ($node) { - return $node->text; + return $node?->text ?? null; })->implode(' '))->kebab()->toString(); } @@ -172,7 +172,7 @@ public function parseTocHeadings(array $content, int $maxDepth = 3): array if ($node['type'] === 'heading') { if ($node['attrs']['level'] <= $maxDepth) { $text = collect($node['content'])->map(function ($node) { - return $node['text']; + return $node['text'] ?? null; })->implode(' '); if (!isset($node['attrs']['id'])) {