it-tools/dist/client/assets/chunks/chunk-28360120.js
2024-04-28 00:48:29 +08:00

143 lines
482 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{d as ge,j as ae,D as Ce,E as Pe,a7 as Jt,e as Im,aw as Lm,r as Pm,w as Rm,a1 as zm,h as Vs,T as qm,aD as Hm,n as $m,q as $e,a0 as Vm,G as fc,k as fi,l as Co,m as hn,K as jm,F as vo,U as Wm,B as Um,L as mc,V as Jm,ah as Km,aE as Gm,_ as Ym,g as Xm,aA as Zm,S as Qm}from"./chunk-449c23a2.js";import{_ as eg,b as tg}from"./chunk-a740628f.js";import{I as ng,as as rg,at as ig,au as sg,_ as og}from"../entries/src_pages_Home.page.16dc467b.js";import{_ as gc}from"./chunk-b6d0d6dd.js";import{T as ag}from"./chunk-f1ca2155.js";import"./chunk-cf010ec4.js";import"./chunk-ee54c1e8.js";import"./chunk-fd51fbd2.js";import"./chunk-767079b6.js";import"./chunk-55ba3dae.js";import"./chunk-baa77311.js";import"./chunk-78769b89.js";const lg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ug=Pe("path",{d:"M9 11l-4 4l4 4m-4-4h11a4 4 0 0 0 0-8h-1",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),cg=[ug],dg=ge({name:"ArrowBack",render:function(e,t){return ae(),Ce("svg",lg,cg)}}),hg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},pg=Pe("path",{d:"M15 13l4-4l-4-4m4 4H8a4 4 0 0 0 0 8h1",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),fg=[pg],mg=ge({name:"ArrowForwardUp",render:function(e,t){return ae(),Ce("svg",hg,fg)}}),gg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Dg=Jt('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 15h15"></path><path d="M21 19H6"></path><path d="M15 11h6"></path><path d="M21 7h-6"></path><path d="M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"></path><path d="M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"></path></g>',1),yg=[Dg],bg=ge({name:"Blockquote",render:function(e,t){return ae(),Ce("svg",gg,yg)}}),Cg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},vg=Pe("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Pe("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7H7z"}),Pe("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7H7v-7"})],-1),kg=[vg],Sg=ge({name:"Bold",render:function(e,t){return ae(),Ce("svg",Cg,kg)}}),wg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Eg=Jt('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 15l4 4m0-4l-4 4"></path><path d="M7 6V5h11v1"></path><path d="M7 19h4"></path><path d="M13 5L9 19"></path></g>',1),xg=[Eg],Ag=ge({name:"ClearFormatting",render:function(e,t){return ae(),Ce("svg",wg,xg)}}),Fg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Tg=Jt('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 12h6"></path><path d="M12 9v6"></path><path d="M6 19a2 2 0 0 1-2-2v-4l-1-1l1-1V7a2 2 0 0 1 2-2"></path><path d="M18 19a2 2 0 0 0 2-2v-4l1-1l-1-1V7a2 2 0 0 0-2-2"></path></g>',1),Mg=[Tg],_g=ge({name:"CodePlus",render:function(e,t){return ae(),Ce("svg",Fg,Mg)}}),Bg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ng=Jt('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 18v-8l-2 2"></path><path d="M4 6v12"></path><path d="M12 6v12"></path><path d="M11 18h2"></path><path d="M3 18h2"></path><path d="M4 12h8"></path><path d="M3 6h2"></path><path d="M11 6h2"></path></g>',1),Og=[Ng],Ig=ge({name:"H1",render:function(e,t){return ae(),Ce("svg",Bg,Og)}}),Lg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Pg=Jt('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 12a2 2 0 1 1 4 0c0 .591-.417 1.318-.816 1.858L17 18.001h4"></path><path d="M4 6v12"></path><path d="M12 6v12"></path><path d="M11 18h2"></path><path d="M3 18h2"></path><path d="M4 12h8"></path><path d="M3 6h2"></path><path d="M11 6h2"></path></g>',1),Rg=[Pg],zg=ge({name:"H2",render:function(e,t){return ae(),Ce("svg",Lg,Rg)}}),qg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Hg=Jt('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 14a2 2 0 1 0-2-2"></path><path d="M17 16a2 2 0 1 0 2-2"></path><path d="M4 6v12"></path><path d="M12 6v12"></path><path d="M11 18h2"></path><path d="M3 18h2"></path><path d="M4 12h8"></path><path d="M3 6h2"></path><path d="M11 6h2"></path></g>',1),$g=[Hg],Vg=ge({name:"H3",render:function(e,t){return ae(),Ce("svg",qg,$g)}}),jg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Wg=Jt('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 18v-8l-4 6h5"></path><path d="M4 6v12"></path><path d="M12 6v12"></path><path d="M11 18h2"></path><path d="M3 18h2"></path><path d="M4 12h8"></path><path d="M3 6h2"></path><path d="M11 6h2"></path></g>',1),Ug=[Wg],Jg=ge({name:"H4",render:function(e,t){return ae(),Ce("svg",jg,Ug)}}),Kg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Gg=Pe("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Pe("path",{d:"M11 5h6"}),Pe("path",{d:"M7 19h6"}),Pe("path",{d:"M14 5l-4 14"})],-1),Yg=[Gg],Xg=ge({name:"Italic",render:function(e,t){return ae(),Ce("svg",Kg,Yg)}}),Zg={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Qg=Jt('<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 6h9"></path><path d="M11 12h9"></path><path d="M12 18h8"></path><path d="M4 16a2 2 0 1 1 4 0c0 .591-.5 1-1 1.5L4 20h4"></path><path d="M6 10V4L4 6"></path></g>',1),e2=[Qg],t2=ge({name:"ListNumbers",render:function(e,t){return ae(),Ce("svg",Zg,e2)}}),n2={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},r2=Pe("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[Pe("path",{d:"M5 12h14"}),Pe("path",{d:"M16 6.5A4 2 0 0 0 12 5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1-4-1.5"})],-1),i2=[r2],s2=ge({name:"Strikethrough",render:function(e,t){return ae(),Ce("svg",n2,i2)}});var Dc={exports:{}};(function(n,e){(function(t){function r(){var i=t();return i.default||i}n.exports=r()})(function(){var t=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,l=(u,c)=>()=>(u&&(c=u(u=0)),c),d=(u,c)=>()=>(c||u((c={exports:{}}).exports,c),c.exports),h=(u,c)=>{for(var f in c)r(u,f,{get:c[f],enumerable:!0})},D=(u,c,f,p)=>{if(c&&typeof c=="object"||typeof c=="function")for(let g of s(c))!a.call(u,g)&&g!==f&&r(u,g,{get:()=>c[g],enumerable:!(p=i(c,g))||p.enumerable});return u},y=(u,c,f)=>(f=u!=null?t(o(u)):{},D(c||!u||!u.__esModule?r(f,"default",{value:u,enumerable:!0}):f,u)),b=u=>D(r({},"__esModule",{value:!0}),u),v=(u,c,f)=>{if(!c.has(u))throw TypeError("Cannot "+f)},x=(u,c,f)=>{if(c.has(u))throw TypeError("Cannot add the same private member more than once");c instanceof WeakSet?c.add(u):c.set(u,f)},M=(u,c,f)=>(v(u,c,"access private method"),f),N=d(u=>{Object.defineProperty(u,"__esModule",{value:!0}),u.default=c;function c(){}c.prototype={diff:function(g,m){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},k=C.callback;typeof C=="function"&&(k=C,C={}),this.options=C;var w=this;function S(V){return k?(setTimeout(function(){k(void 0,V)},0),!0):V}g=this.castInput(g),m=this.castInput(m),g=this.removeEmpty(this.tokenize(g)),m=this.removeEmpty(this.tokenize(m));var E=m.length,B=g.length,T=1,A=E+B;C.maxEditLength&&(A=Math.min(A,C.maxEditLength));var F=[{newPos:-1,components:[]}],O=this.extractCommon(F[0],m,g,0);if(F[0].newPos+1>=E&&O+1>=B)return S([{value:this.join(m),count:m.length}]);function L(){for(var V=-1*T;V<=T;V+=2){var Y=void 0,Q=F[V-1],Z=F[V+1],ne=(Z?Z.newPos:0)-V;Q&&(F[V-1]=void 0);var ie=Q&&Q.newPos+1<E,le=Z&&0<=ne&&ne<B;if(!ie&&!le){F[V]=void 0;continue}if(!ie||le&&Q.newPos<Z.newPos?(Y=p(Z),w.pushComponent(Y.components,void 0,!0)):(Y=Q,Y.newPos++,w.pushComponent(Y.components,!0,void 0)),ne=w.extractCommon(Y,m,g,V),Y.newPos+1>=E&&ne+1>=B)return S(f(w,Y.components,m,g,w.useLongestToken));F[V]=Y}T++}if(k)(function V(){setTimeout(function(){if(T>A)return k();L()||V()},0)})();else for(;T<=A;){var z=L();if(z)return z}},pushComponent:function(g,m,C){var k=g[g.length-1];k&&k.added===m&&k.removed===C?g[g.length-1]={count:k.count+1,added:m,removed:C}:g.push({count:1,added:m,removed:C})},extractCommon:function(g,m,C,k){for(var w=m.length,S=C.length,E=g.newPos,B=E-k,T=0;E+1<w&&B+1<S&&this.equals(m[E+1],C[B+1]);)E++,B++,T++;return T&&g.components.push({count:T}),g.newPos=E,B},equals:function(g,m){return this.options.comparator?this.options.comparator(g,m):g===m||this.options.ignoreCase&&g.toLowerCase()===m.toLowerCase()},removeEmpty:function(g){for(var m=[],C=0;C<g.length;C++)g[C]&&m.push(g[C]);return m},castInput:function(g){return g},tokenize:function(g){return g.split("")},join:function(g){return g.join("")}};function f(g,m,C,k,w){for(var S=0,E=m.length,B=0,T=0;S<E;S++){var A=m[S];if(A.removed){if(A.value=g.join(k.slice(T,T+A.count)),T+=A.count,S&&m[S-1].added){var F=m[S-1];m[S-1]=m[S],m[S]=F}}else{if(!A.added&&w){var O=C.slice(B,B+A.count);O=O.map(function(z,V){var Y=k[T+V];return Y.length>z.length?Y:z}),A.value=g.join(O)}else A.value=g.join(C.slice(B,B+A.count));B+=A.count,A.added||(T+=A.count)}}var L=m[E-1];return E>1&&typeof L.value=="string"&&(L.added||L.removed)&&g.equals("",L.value)&&(m[E-2].value+=L.value,m.pop()),m}function p(g){return{newPos:g.newPos,components:g.components.slice(0)}}}),_=d(u=>{Object.defineProperty(u,"__esModule",{value:!0}),u.diffArrays=g,u.arrayDiff=void 0;var c=f(N());function f(m){return m&&m.__esModule?m:{default:m}}var p=new c.default;u.arrayDiff=p,p.tokenize=function(m){return m.slice()},p.join=p.removeEmpty=function(m){return m};function g(m,C,k){return p.diff(m,C,k)}}),P={};h(P,{__assign:()=>Rr,__asyncDelegator:()=>Ph,__asyncGenerator:()=>Lh,__asyncValues:()=>Rh,__await:()=>Qn,__awaiter:()=>Ie,__classPrivateFieldGet:()=>$h,__classPrivateFieldSet:()=>Vh,__createBinding:()=>ps,__decorate:()=>X,__exportStar:()=>Nh,__extends:()=>W,__generator:()=>mt,__importDefault:()=>Hh,__importStar:()=>qh,__makeTemplateObject:()=>zh,__metadata:()=>j,__param:()=>re,__read:()=>_a,__rest:()=>H,__spread:()=>Oh,__spreadArrays:()=>Ih,__values:()=>fs});function W(u,c){Pr(u,c);function f(){this.constructor=u}u.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}function H(u,c){var f={};for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&c.indexOf(p)<0&&(f[p]=u[p]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,p=Object.getOwnPropertySymbols(u);g<p.length;g++)c.indexOf(p[g])<0&&Object.prototype.propertyIsEnumerable.call(u,p[g])&&(f[p[g]]=u[p[g]]);return f}function X(u,c,f,p){var g=arguments.length,m=g<3?c:p===null?p=Object.getOwnPropertyDescriptor(c,f):p,C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(u,c,f,p);else for(var k=u.length-1;k>=0;k--)(C=u[k])&&(m=(g<3?C(m):g>3?C(c,f,m):C(c,f))||m);return g>3&&m&&Object.defineProperty(c,f,m),m}function re(u,c){return function(f,p){c(f,p,u)}}function j(u,c){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(u,c)}function Ie(u,c,f,p){function g(m){return m instanceof f?m:new f(function(C){C(m)})}return new(f||(f=Promise))(function(m,C){function k(E){try{S(p.next(E))}catch(B){C(B)}}function w(E){try{S(p.throw(E))}catch(B){C(B)}}function S(E){E.done?m(E.value):g(E.value).then(k,w)}S((p=p.apply(u,c||[])).next())})}function mt(u,c){var f={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},p,g,m,C;return C={next:k(0),throw:k(1),return:k(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function k(S){return function(E){return w([S,E])}}function w(S){if(p)throw new TypeError("Generator is already executing.");for(;f;)try{if(p=1,g&&(m=S[0]&2?g.return:S[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,S[1])).done)return m;switch(g=0,m&&(S=[S[0]&2,m.value]),S[0]){case 0:case 1:m=S;break;case 4:return f.label++,{value:S[1],done:!1};case 5:f.label++,g=S[1],S=[0];continue;case 7:S=f.ops.pop(),f.trys.pop();continue;default:if(m=f.trys,!(m=m.length>0&&m[m.length-1])&&(S[0]===6||S[0]===2)){f=0;continue}if(S[0]===3&&(!m||S[1]>m[0]&&S[1]<m[3])){f.label=S[1];break}if(S[0]===6&&f.label<m[1]){f.label=m[1],m=S;break}if(m&&f.label<m[2]){f.label=m[2],f.ops.push(S);break}m[2]&&f.ops.pop(),f.trys.pop();continue}S=c.call(u,f)}catch(E){S=[6,E],g=0}finally{p=m=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}}function ps(u,c,f,p){p===void 0&&(p=f),u[p]=c[f]}function Nh(u,c){for(var f in u)f!=="default"&&!c.hasOwnProperty(f)&&(c[f]=u[f])}function fs(u){var c=typeof Symbol=="function"&&Symbol.iterator,f=c&&u[c],p=0;if(f)return f.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&p>=u.length&&(u=void 0),{value:u&&u[p++],done:!u}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}function _a(u,c){var f=typeof Symbol=="function"&&u[Symbol.iterator];if(!f)return u;var p=f.call(u),g,m=[],C;try{for(;(c===void 0||c-- >0)&&!(g=p.next()).done;)m.push(g.value)}catch(k){C={error:k}}finally{try{g&&!g.done&&(f=p.return)&&f.call(p)}finally{if(C)throw C.error}}return m}function Oh(){for(var u=[],c=0;c<arguments.length;c++)u=u.concat(_a(arguments[c]));return u}function Ih(){for(var u=0,c=0,f=arguments.length;c<f;c++)u+=arguments[c].length;for(var p=Array(u),g=0,c=0;c<f;c++)for(var m=arguments[c],C=0,k=m.length;C<k;C++,g++)p[g]=m[C];return p}function Qn(u){return this instanceof Qn?(this.v=u,this):new Qn(u)}function Lh(u,c,f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var p=f.apply(u,c||[]),g,m=[];return g={},C("next"),C("throw"),C("return"),g[Symbol.asyncIterator]=function(){return this},g;function C(T){p[T]&&(g[T]=function(A){return new Promise(function(F,O){m.push([T,A,F,O])>1||k(T,A)})})}function k(T,A){try{w(p[T](A))}catch(F){B(m[0][3],F)}}function w(T){T.value instanceof Qn?Promise.resolve(T.value.v).then(S,E):B(m[0][2],T)}function S(T){k("next",T)}function E(T){k("throw",T)}function B(T,A){T(A),m.shift(),m.length&&k(m[0][0],m[0][1])}}function Ph(u){var c,f;return c={},p("next"),p("throw",function(g){throw g}),p("return"),c[Symbol.iterator]=function(){return this},c;function p(g,m){c[g]=u[g]?function(C){return(f=!f)?{value:Qn(u[g](C)),done:g==="return"}:m?m(C):C}:m}}function Rh(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=u[Symbol.asyncIterator],f;return c?c.call(u):(u=typeof fs=="function"?fs(u):u[Symbol.iterator](),f={},p("next"),p("throw"),p("return"),f[Symbol.asyncIterator]=function(){return this},f);function p(m){f[m]=u[m]&&function(C){return new Promise(function(k,w){C=u[m](C),g(k,w,C.done,C.value)})}}function g(m,C,k,w){Promise.resolve(w).then(function(S){m({value:S,done:k})},C)}}function zh(u,c){return Object.defineProperty?Object.defineProperty(u,"raw",{value:c}):u.raw=c,u}function qh(u){if(u&&u.__esModule)return u;var c={};if(u!=null)for(var f in u)Object.hasOwnProperty.call(u,f)&&(c[f]=u[f]);return c.default=u,c}function Hh(u){return u&&u.__esModule?u:{default:u}}function $h(u,c){if(!c.has(u))throw new TypeError("attempted to get private field on non-instance");return c.get(u)}function Vh(u,c,f){if(!c.has(u))throw new TypeError("attempted to set private field on non-instance");return c.set(u,f),f}var Pr,Rr,Ft=l(()=>{Pr=function(u,c){return Pr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,p){f.__proto__=p}||function(f,p){for(var g in p)p.hasOwnProperty(g)&&(f[g]=p[g])},Pr(u,c)},Rr=function(){return Rr=Object.assign||function(u){for(var c,f=1,p=arguments.length;f<p;f++){c=arguments[f];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&(u[g]=c[g])}return u},Rr.apply(this,arguments)}}),Ba=d(u=>{Object.defineProperty(u,"__esModule",{value:!0}),u.apiDescriptor={key:c=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(c)?c:JSON.stringify(c),value(c){if(c===null||typeof c!="object")return JSON.stringify(c);if(Array.isArray(c))return`[${c.map(p=>u.apiDescriptor.value(p)).join(", ")}]`;let f=Object.keys(c);return f.length===0?"{}":`{ ${f.map(p=>`${u.apiDescriptor.key(p)}: ${u.apiDescriptor.value(c[p])}`).join(", ")} }`},pair:({key:c,value:f})=>u.apiDescriptor.value({[c]:f})}}),jh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(Ft(),b(P));c.__exportStar(Ba(),u)}),zr={};h(zr,{default:()=>ms});var Fe,ms,qr=l(()=>{Fe=u=>u,Fe.grey=Fe,Fe.red=Fe,Fe.bold=Fe,Fe.yellow=Fe,Fe.blue=Fe,Fe.default=Fe,ms=Fe}),Na=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(qr(),b(zr));u.commonDeprecatedHandler=(f,p,{descriptor:g})=>{let m=[`${c.default.yellow(typeof f=="string"?g.key(f):g.pair(f))} is deprecated`];return p&&m.push(`we now treat it as ${c.default.blue(typeof p=="string"?g.key(p):g.pair(p))}`),m.join("; ")+"."}}),Wh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(Ft(),b(P));c.__exportStar(Na(),u)}),Uh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(qr(),b(zr));u.commonInvalidHandler=(f,p,g)=>[`Invalid ${c.default.red(g.descriptor.key(f))} value.`,`Expected ${c.default.blue(g.schemas[f].expected(g))},`,`but received ${c.default.red(g.descriptor.value(p))}.`].join(" ")}),Oa=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(Ft(),b(P));c.__exportStar(Uh(),u)}),Jh=d((u,c)=>{var f=[],p=[];c.exports=function(g,m){if(g===m)return 0;var C=g;g.length>m.length&&(g=m,m=C);var k=g.length,w=m.length;if(k===0)return w;if(w===0)return k;for(;k>0&&g.charCodeAt(~-k)===m.charCodeAt(~-w);)k--,w--;if(k===0)return w;for(var S=0;S<k&&g.charCodeAt(S)===m.charCodeAt(S);)S++;if(k-=S,w-=S,k===0)return w;for(var E,B,T,A,F=0,O=0;F<k;)p[S+F]=g.charCodeAt(S+F),f[F]=++F;for(;O<w;)for(E=m.charCodeAt(S+O),T=O++,B=O,F=0;F<k;F++)A=E===p[S+F]?T:T+1,T=f[F],B=f[F]=T>B?A>B?B+1:A:A>T?T+1:A;return B}}),Ia=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(qr(),b(zr)),f=Jh();u.levenUnknownHandler=(p,g,{descriptor:m,logger:C,schemas:k})=>{let w=[`Ignored unknown option ${c.default.yellow(m.pair({key:p,value:g}))}.`],S=Object.keys(k).sort().find(E=>f(p,E)<3);S&&w.push(`Did you mean ${c.default.blue(m.key(S))}?`),C.warn(w.join(" "))}}),Kh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(Ft(),b(P));c.__exportStar(Ia(),u)}),Gh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(Ft(),b(P));c.__exportStar(Wh(),u),c.__exportStar(Oa(),u),c.__exportStar(Kh(),u)}),Tt=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function f(m,C){let k=new m(C),w=Object.create(k);for(let S of c)S in C&&(w[S]=g(C[S],k,p.prototype[S].length));return w}u.createSchema=f;var p=class{constructor(m){this.name=m.name}static create(m){return f(this,m)}default(m){}expected(m){return"nothing"}validate(m,C){return!1}deprecated(m,C){return!1}forward(m,C){}redirect(m,C){}overlap(m,C,k){return m}preprocess(m,C){return m}postprocess(m,C){return m}};u.Schema=p;function g(m,C,k){return typeof m=="function"?(...w)=>m(...w.slice(0,k-1),C,...w.slice(k-1)):()=>m}}),Yh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=Tt(),f=class extends c.Schema{constructor(p){super(p),this._sourceName=p.sourceName}expected(p){return p.schemas[this._sourceName].expected(p)}validate(p,g){return g.schemas[this._sourceName].validate(p,g)}redirect(p,g){return this._sourceName}};u.AliasSchema=f}),Xh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=Tt(),f=class extends c.Schema{expected(){return"anything"}validate(){return!0}};u.AnySchema=f}),Zh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(Ft(),b(P)),f=Tt(),p=class extends f.Schema{constructor(m){var{valueSchema:C,name:k=C.name}=m,w=c.__rest(m,["valueSchema","name"]);super(Object.assign({},w,{name:k})),this._valueSchema=C}expected(m){return`an array of ${this._valueSchema.expected(m)}`}validate(m,C){if(!Array.isArray(m))return!1;let k=[];for(let w of m){let S=C.normalizeValidateResult(this._valueSchema.validate(w,C),w);S!==!0&&k.push(S.value)}return k.length===0?!0:{value:k}}deprecated(m,C){let k=[];for(let w of m){let S=C.normalizeDeprecatedResult(this._valueSchema.deprecated(w,C),w);S!==!1&&k.push(...S.map(({value:E})=>({value:[E]})))}return k}forward(m,C){let k=[];for(let w of m){let S=C.normalizeForwardResult(this._valueSchema.forward(w,C),w);k.push(...S.map(g))}return k}redirect(m,C){let k=[],w=[];for(let S of m){let E=C.normalizeRedirectResult(this._valueSchema.redirect(S,C),S);"remain"in E&&k.push(E.remain),w.push(...E.redirect.map(g))}return k.length===0?{redirect:w}:{redirect:w,remain:k}}overlap(m,C){return m.concat(C)}};u.ArraySchema=p;function g({from:m,to:C}){return{from:[m],to:C}}}),Qh=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=Tt(),f=class extends c.Schema{expected(){return"true or false"}validate(p){return typeof p=="boolean"}};u.BooleanSchema=f}),gs=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});function c(A,F){let O=Object.create(null);for(let L of A){let z=L[F];if(O[z])throw new Error(`Duplicate ${F} ${JSON.stringify(z)}`);O[z]=L}return O}u.recordFromArray=c;function f(A,F){let O=new Map;for(let L of A){let z=L[F];if(O.has(z))throw new Error(`Duplicate ${F} ${JSON.stringify(z)}`);O.set(z,L)}return O}u.mapFromArray=f;function p(){let A=Object.create(null);return F=>{let O=JSON.stringify(F);return A[O]?!0:(A[O]=!0,!1)}}u.createAutoChecklist=p;function g(A,F){let O=[],L=[];for(let z of A)F(z)?O.push(z):L.push(z);return[O,L]}u.partition=g;function m(A){return A===Math.floor(A)}u.isInt=m;function C(A,F){if(A===F)return 0;let O=typeof A,L=typeof F,z=["undefined","object","boolean","number","string"];return O!==L?z.indexOf(O)-z.indexOf(L):O!=="string"?Number(A)-Number(F):A.localeCompare(F)}u.comparePrimitive=C;function k(A){return A===void 0?{}:A}u.normalizeDefaultResult=k;function w(A,F){return A===!0?!0:A===!1?{value:F}:A}u.normalizeValidateResult=w;function S(A,F,O=!1){return A===!1?!1:A===!0?O?!0:[{value:F}]:"value"in A?[A]:A.length===0?!1:A}u.normalizeDeprecatedResult=S;function E(A,F){return typeof A=="string"||"key"in A?{from:F,to:A}:"from"in A?{from:A.from,to:A.to}:{from:F,to:A.to}}u.normalizeTransferResult=E;function B(A,F){return A===void 0?[]:Array.isArray(A)?A.map(O=>E(O,F)):[E(A,F)]}u.normalizeForwardResult=B;function T(A,F){let O=B(typeof A=="object"&&"redirect"in A?A.redirect:A,F);return O.length===0?{remain:F,redirect:O}:typeof A=="object"&&"remain"in A?{remain:A.remain,redirect:O}:{redirect:O}}u.normalizeRedirectResult=T}),ep=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=Tt(),f=gs(),p=class extends c.Schema{constructor(g){super(g),this._choices=f.mapFromArray(g.choices.map(m=>m&&typeof m=="object"?m:{value:m}),"value")}expected({descriptor:g}){let m=Array.from(this._choices.keys()).map(w=>this._choices.get(w)).filter(w=>!w.deprecated).map(w=>w.value).sort(f.comparePrimitive).map(g.value),C=m.slice(0,-2),k=m.slice(-2);return C.concat(k.join(" or ")).join(", ")}validate(g){return this._choices.has(g)}deprecated(g){let m=this._choices.get(g);return m&&m.deprecated?{value:g}:!1}forward(g){let m=this._choices.get(g);return m?m.forward:void 0}redirect(g){let m=this._choices.get(g);return m?m.redirect:void 0}};u.ChoiceSchema=p}),La=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=Tt(),f=class extends c.Schema{expected(){return"a number"}validate(p,g){return typeof p=="number"}};u.NumberSchema=f}),tp=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=gs(),f=La(),p=class extends f.NumberSchema{expected(){return"an integer"}validate(g,m){return m.normalizeValidateResult(super.validate(g,m),g)===!0&&c.isInt(g)}};u.IntegerSchema=p}),np=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=Tt(),f=class extends c.Schema{expected(){return"a string"}validate(p){return typeof p=="string"}};u.StringSchema=f}),rp=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(Ft(),b(P));c.__exportStar(Yh(),u),c.__exportStar(Xh(),u),c.__exportStar(Zh(),u),c.__exportStar(Qh(),u),c.__exportStar(ep(),u),c.__exportStar(tp(),u),c.__exportStar(La(),u),c.__exportStar(np(),u)}),ip=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=Ba(),f=Na(),p=Oa(),g=Ia();u.defaultDescriptor=c.apiDescriptor,u.defaultUnknownHandler=g.levenUnknownHandler,u.defaultInvalidHandler=p.commonInvalidHandler,u.defaultDeprecatedHandler=f.commonDeprecatedHandler}),sp=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=ip(),f=gs();u.normalize=(g,m,C)=>new p(m,C).normalize(g);var p=class{constructor(g,m){let{logger:C=console,descriptor:k=c.defaultDescriptor,unknown:w=c.defaultUnknownHandler,invalid:S=c.defaultInvalidHandler,deprecated:E=c.defaultDeprecatedHandler}=m||{};this._utils={descriptor:k,logger:C||{warn:()=>{}},schemas:f.recordFromArray(g,"name"),normalizeDefaultResult:f.normalizeDefaultResult,normalizeDeprecatedResult:f.normalizeDeprecatedResult,normalizeForwardResult:f.normalizeForwardResult,normalizeRedirectResult:f.normalizeRedirectResult,normalizeValidateResult:f.normalizeValidateResult},this._unknownHandler=w,this._invalidHandler=S,this._deprecatedHandler=E,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=f.createAutoChecklist()}normalize(g){let m={},C=[g],k=()=>{for(;C.length!==0;){let w=C.shift(),S=this._applyNormalization(w,m);C.push(...S)}};k();for(let w of Object.keys(this._utils.schemas)){let S=this._utils.schemas[w];if(!(w in m)){let E=f.normalizeDefaultResult(S.default(this._utils));"value"in E&&C.push({[w]:E.value})}}k();for(let w of Object.keys(this._utils.schemas)){let S=this._utils.schemas[w];w in m&&(m[w]=S.postprocess(m[w],this._utils))}return m}_applyNormalization(g,m){let C=[],[k,w]=f.partition(Object.keys(g),S=>S in this._utils.schemas);for(let S of k){let E=this._utils.schemas[S],B=E.preprocess(g[S],this._utils),T=f.normalizeValidateResult(E.validate(B,this._utils),B);if(T!==!0){let{value:L}=T,z=this._invalidHandler(S,L,this._utils);throw typeof z=="string"?new Error(z):z}let A=({from:L,to:z})=>{C.push(typeof z=="string"?{[z]:L}:{[z.key]:z.value})},F=({value:L,redirectTo:z})=>{let V=f.normalizeDeprecatedResult(E.deprecated(L,this._utils),B,!0);if(V!==!1)if(V===!0)this._hasDeprecationWarned(S)||this._utils.logger.warn(this._deprecatedHandler(S,z,this._utils));else for(let{value:Y}of V){let Q={key:S,value:Y};if(!this._hasDeprecationWarned(Q)){let Z=typeof z=="string"?{key:z,value:Y}:z;this._utils.logger.warn(this._deprecatedHandler(Q,Z,this._utils))}}};f.normalizeForwardResult(E.forward(B,this._utils),B).forEach(A);let O=f.normalizeRedirectResult(E.redirect(B,this._utils),B);if(O.redirect.forEach(A),"remain"in O){let L=O.remain;m[S]=S in m?E.overlap(m[S],L,this._utils):L,F({value:L})}for(let{from:L,to:z}of O.redirect)F({value:L,redirectTo:z})}for(let S of w){let E=g[S],B=this._unknownHandler(S,E,this._utils);if(B)for(let T of Object.keys(B)){let A={[T]:B[T]};T in this._utils.schemas?C.push(A):Object.assign(m,A)}}return C}};u.Normalizer=p}),op=d(u=>{Object.defineProperty(u,"__esModule",{value:!0});var c=(Ft(),b(P));c.__exportStar(jh(),u),c.__exportStar(Gh(),u),c.__exportStar(rp(),u),c.__exportStar(sp(),u),c.__exportStar(Tt(),u)}),Pa={};h(Pa,{getChalk:()=>za,shouldHighlight:()=>Ra});var Ra,za,ap=l(()=>{qr(),Ra=()=>!1,za=()=>ms}),lp=d(u=>{Object.defineProperty(u,"__esModule",{value:!0}),u.codeFrameColumns=C,u.default=k;var c=(ap(),b(Pa)),f=!1;function p(w){return{gutter:w.grey,marker:w.red.bold,message:w.red.bold}}var g=/\r\n|[\n\r\u2028\u2029]/;function m(w,S,E){let B=Object.assign({column:0,line:-1},w.start),T=Object.assign({},B,w.end),{linesAbove:A=2,linesBelow:F=3}=E||{},O=B.line,L=B.column,z=T.line,V=T.column,Y=Math.max(O-(A+1),0),Q=Math.min(S.length,z+F);O===-1&&(Y=0),z===-1&&(Q=S.length);let Z=z-O,ne={};if(Z)for(let ie=0;ie<=Z;ie++){let le=ie+O;if(!L)ne[le]=!0;else if(ie===0){let St=S[le-1].length;ne[le]=[L,St-L+1]}else if(ie===Z)ne[le]=[0,V];else{let St=S[le-ie].length;ne[le]=[0,St]}}else L===V?L?ne[O]=[L,0]:ne[O]=!0:ne[O]=[L,V-L];return{start:Y,end:Q,markerLines:ne}}function C(w,S,E={}){let B=(E.highlightCode||E.forceColor)&&(0,c.shouldHighlight)(E),T=(0,c.getChalk)(E),A=p(T),F=(ne,ie)=>B?ne(ie):ie,O=w.split(g),{start:L,end:z,markerLines:V}=m(S,O,E),Y=S.start&&typeof S.start.column=="number",Q=String(z).length,Z=(B?(0,c.default)(w,E):w).split(g,z).slice(L,z).map((ne,ie)=>{let le=L+1+ie,St=` ${` ${le}`.slice(-Q)} |`,Xr=V[le],Bm=!V[le+1];if(Xr){let $s="";if(Array.isArray(Xr)){let Nm=ne.slice(0,Math.max(Xr[0]-1,0)).replace(/[^\t]/g," "),Om=Xr[1]||1;$s=[`
`,F(A.gutter,St.replace(/\d/g," "))," ",Nm,F(A.marker,"^").repeat(Om)].join(""),Bm&&E.message&&($s+=" "+F(A.message,E.message))}return[F(A.marker,">"),F(A.gutter,St),ne.length>0?` ${ne}`:"",$s].join("")}else return` ${F(A.gutter,St)}${ne.length>0?` ${ne}`:""}`}).join(`
`);return E.message&&!Y&&(Z=`${" ".repeat(Q+1)}${E.message}
${Z}`),B?T.reset(Z):Z}function k(w,S,E,B={}){if(!f){f=!0;let T="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";{let A=new Error(T);A.name="DeprecationWarning",console.warn(new Error(T))}}return E=Math.max(E,0),C(w,{start:{column:E,line:S}},B)}}),qa={};h(qa,{__debug:()=>_m,check:()=>Tm,doc:()=>_l,format:()=>Nl,formatWithCursor:()=>Bl,getSupportInfo:()=>Mm,util:()=>Ml,version:()=>Fm});var up=(u,c,f,p)=>{if(!(u&&c==null))return c.replaceAll?c.replaceAll(f,p):f.global?c.replace(f,p):c.split(f).join(p)},Hr=up,cp=y(_(),1),Zt="string",Mt="array",Qt="cursor",gt="indent",Dt="align",yt="trim",Te="group",ze="fill",Le="if-break",bt="indent-if-break",Ct="line-suffix",vt="line-suffix-boundary",De="line",ot="label",qe="break-parent",Ha=new Set([Qt,gt,Dt,yt,Te,ze,Le,bt,Ct,vt,De,ot,qe]);function dp(u){if(typeof u=="string")return Zt;if(Array.isArray(u))return Mt;if(!u)return;let{type:c}=u;if(Ha.has(c))return c}var en=dp,hp=u=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(u);function pp(u){let c=u===null?"null":typeof u;if(c!=="string"&&c!=="object")return`Unexpected doc '${c}',
Expected it to be 'string' or 'object'.`;if(en(u))throw new Error("doc is valid.");let f=Object.prototype.toString.call(u);if(f!=="[object Object]")return`Unexpected doc '${f}'.`;let p=hp([...Ha].map(g=>`'${g}'`));return`Unexpected doc.type '${u.type}'.
Expected it to be ${p}.`}var fp=class extends Error{name="InvalidDocError";constructor(u){super(pp(u)),this.doc=u}},An=fp,$a={};function mp(u,c,f,p){let g=[u];for(;g.length>0;){let m=g.pop();if(m===$a){f(g.pop());continue}f&&g.push(m,$a);let C=en(m);if(!C)throw new An(m);if(c?.(m)!==!1)switch(C){case Mt:case ze:{let k=C===Mt?m:m.parts;for(let w=k.length,S=w-1;S>=0;--S)g.push(k[S]);break}case Le:g.push(m.flatContents,m.breakContents);break;case Te:if(p&&m.expandedStates)for(let k=m.expandedStates.length,w=k-1;w>=0;--w)g.push(m.expandedStates[w]);else g.push(m.contents);break;case Dt:case gt:case bt:case ot:case Ct:g.push(m.contents);break;case Zt:case Qt:case yt:case vt:case De:case qe:break;default:throw new An(m)}}}var Ds=mp,gp=()=>{},Dp=gp;function $r(u){return{type:gt,contents:u}}function Fn(u,c){return{type:Dt,contents:c,n:u}}function Va(u,c={}){return Dp(c.expandedStates),{type:Te,id:c.id,contents:u,break:!!c.shouldBreak,expandedStates:c.expandedStates}}function yp(u){return Fn(Number.NEGATIVE_INFINITY,u)}function bp(u){return Fn({type:"root"},u)}function Cp(u){return Fn(-1,u)}function vp(u,c){return Va(u[0],{...c,expandedStates:u})}function ja(u){return{type:ze,parts:u}}function kp(u,c="",f={}){return{type:Le,breakContents:u,flatContents:c,groupId:f.groupId}}function Sp(u,c){return{type:bt,contents:u,groupId:c.groupId,negate:c.negate}}function ys(u){return{type:Ct,contents:u}}var wp={type:vt},Vr={type:qe},Ep={type:yt},bs={type:De,hard:!0},Wa={type:De,hard:!0,literal:!0},Ua={type:De},xp={type:De,soft:!0},tn=[bs,Vr],Ja=[Wa,Vr],Cs={type:Qt};function Ka(u,c){let f=[];for(let p=0;p<c.length;p++)p!==0&&f.push(u),f.push(c[p]);return f}function Ga(u,c,f){let p=u;if(c>0){for(let g=0;g<Math.floor(c/f);++g)p=$r(p);p=Fn(c%f,p),p=Fn(Number.NEGATIVE_INFINITY,p)}return p}function Ap(u,c){return u?{type:ot,label:u,contents:c}:c}var Fp=(u,c,f)=>{if(!(u&&c==null))return Array.isArray(c)||typeof c=="string"?c[f<0?c.length+f:f]:c.at(f)},he=Fp;function Tp(u){let c=u.indexOf("\r");return c>=0?u.charAt(c+1)===`
`?"crlf":"cr":"lf"}function vs(u){switch(u){case"cr":return"\r";case"crlf":return`\r
`;default:return`
`}}function Ya(u,c){let f;switch(c){case`
`:f=/\n/g;break;case"\r":f=/\r/g;break;case`\r
`:f=/\r\n/g;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(c)}.`)}let p=u.match(f);return p?p.length:0}function Mp(u){return Hr(!1,u,/\r\n?/g,`
`)}var _p=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,Bp={eastAsianWidth(u){var c=u.charCodeAt(0),f=u.length==2?u.charCodeAt(1):0,p=c;return 55296<=c&&c<=56319&&56320<=f&&f<=57343&&(c&=1023,f&=1023,p=c<<10|f,p+=65536),p==12288||65281<=p&&p<=65376||65504<=p&&p<=65510?"F":4352<=p&&p<=4447||4515<=p&&p<=4519||4602<=p&&p<=4607||9001<=p&&p<=9002||11904<=p&&p<=11929||11931<=p&&p<=12019||12032<=p&&p<=12245||12272<=p&&p<=12283||12289<=p&&p<=12350||12353<=p&&p<=12438||12441<=p&&p<=12543||12549<=p&&p<=12589||12593<=p&&p<=12686||12688<=p&&p<=12730||12736<=p&&p<=12771||12784<=p&&p<=12830||12832<=p&&p<=12871||12880<=p&&p<=13054||13056<=p&&p<=19903||19968<=p&&p<=42124||42128<=p&&p<=42182||43360<=p&&p<=43388||44032<=p&&p<=55203||55216<=p&&p<=55238||55243<=p&&p<=55291||63744<=p&&p<=64255||65040<=p&&p<=65049||65072<=p&&p<=65106||65108<=p&&p<=65126||65128<=p&&p<=65131||110592<=p&&p<=110593||127488<=p&&p<=127490||127504<=p&&p<=127546||127552<=p&&p<=127560||127568<=p&&p<=127569||131072<=p&&p<=194367||177984<=p&&p<=196605||196608<=p&&p<=262141?"W":"N"}},Np=/[^\x20-\x7F]/;function Op(u){if(!u)return 0;if(!Np.test(u))return u.length;u=u.replace(_p()," ");let c=0;for(let f of u){let p=f.codePointAt(0);if(p<=31||p>=127&&p<=159||p>=768&&p<=879)continue;let g=Bp.eastAsianWidth(f);c+=g==="F"||g==="W"?2:1}return c}var ks=Op,Ip=u=>{if(Array.isArray(u))return u;if(u.type!==ze)throw new Error(`Expect doc to be 'array' or '${ze}'.`);return u.parts};function jr(u,c){if(typeof u=="string")return c(u);let f=new Map;return p(u);function p(m){if(f.has(m))return f.get(m);let C=g(m);return f.set(m,C),C}function g(m){switch(en(m)){case Mt:return c(m.map(p));case ze:return c({...m,parts:m.parts.map(p)});case Le:return c({...m,breakContents:p(m.breakContents),flatContents:p(m.flatContents)});case Te:{let{expandedStates:C,contents:k}=m;return C?(C=C.map(p),k=C[0]):k=p(k),c({...m,contents:k,expandedStates:C})}case Dt:case gt:case bt:case ot:case Ct:return c({...m,contents:p(m.contents)});case Zt:case Qt:case yt:case vt:case De:case qe:return c(m);default:throw new An(m)}}}function Ss(u,c,f){let p=f,g=!1;function m(C){if(g)return!1;let k=c(C);k!==void 0&&(g=!0,p=k)}return Ds(u,m),p}function Lp(u){if(u.type===Te&&u.break||u.type===De&&u.hard||u.type===qe)return!0}function Pp(u){return Ss(u,Lp,!1)}function Xa(u){if(u.length>0){let c=he(!1,u,-1);!c.expandedStates&&!c.break&&(c.break="propagated")}return null}function Rp(u){let c=new Set,f=[];function p(m){if(m.type===qe&&Xa(f),m.type===Te){if(f.push(m),c.has(m))return!1;c.add(m)}}function g(m){m.type===Te&&f.pop().break&&Xa(f)}Ds(u,p,g,!0)}function zp(u){return u.type===De&&!u.hard?u.soft?"":" ":u.type===Le?u.flatContents:u}function qp(u){return jr(u,zp)}function Za(u){for(u=[...u];u.length>=2&&he(!1,u,-2).type===De&&he(!1,u,-1).type===qe;)u.length-=2;if(u.length>0){let c=er(he(!1,u,-1));u[u.length-1]=c}return u}function er(u){switch(en(u)){case Dt:case gt:case bt:case Te:case Ct:case ot:{let c=er(u.contents);return{...u,contents:c}}case Le:return{...u,breakContents:er(u.breakContents),flatContents:er(u.flatContents)};case ze:return{...u,parts:Za(u.parts)};case Mt:return Za(u);case Zt:return u.replace(/[\n\r]*$/,"");case Qt:case yt:case vt:case De:case qe:break;default:throw new An(u)}return u}function Qa(u){return er($p(u))}function Hp(u){switch(en(u)){case ze:if(u.parts.every(c=>c===""))return"";break;case Te:if(!u.contents&&!u.id&&!u.break&&!u.expandedStates)return"";if(u.contents.type===Te&&u.contents.id===u.id&&u.contents.break===u.break&&u.contents.expandedStates===u.expandedStates)return u.contents;break;case Dt:case gt:case bt:case Ct:if(!u.contents)return"";break;case Le:if(!u.flatContents&&!u.breakContents)return"";break;case Mt:{let c=[];for(let f of u){if(!f)continue;let[p,...g]=Array.isArray(f)?f:[f];typeof p=="string"&&typeof he(!1,c,-1)=="string"?c[c.length-1]+=p:c.push(p),c.push(...g)}return c.length===0?"":c.length===1?c[0]:c}case Zt:case Qt:case yt:case vt:case De:case ot:case qe:break;default:throw new An(u)}return u}function $p(u){return jr(u,c=>Hp(c))}function Vp(u,c=Ja){return jr(u,f=>typeof f=="string"?Ka(c,f.split(`
`)):f)}function jp(u){if(u.type===De)return!0}function Wp(u){return Ss(u,jp,!1)}function el(u,c){return u.type===ot?{...u,contents:c(u.contents)}:c(u)}var Me=Symbol("MODE_BREAK"),at=Symbol("MODE_FLAT"),tr=Symbol("cursor");function tl(){return{value:"",length:0,queue:[]}}function Up(u,c){return ws(u,{type:"indent"},c)}function Jp(u,c,f){return c===Number.NEGATIVE_INFINITY?u.root||tl():c<0?ws(u,{type:"dedent"},f):c?c.type==="root"?{...u,root:u}:ws(u,{type:typeof c=="string"?"stringAlign":"numberAlign",n:c},f):u}function ws(u,c,f){let p=c.type==="dedent"?u.queue.slice(0,-1):[...u.queue,c],g="",m=0,C=0,k=0;for(let F of p)switch(F.type){case"indent":E(),f.useTabs?w(1):S(f.tabWidth);break;case"stringAlign":E(),g+=F.n,m+=F.n.length;break;case"numberAlign":C+=1,k+=F.n;break;default:throw new Error(`Unexpected type '${F.type}'`)}return T(),{...u,value:g,length:m,queue:p};function w(F){g+=" ".repeat(F),m+=f.tabWidth*F}function S(F){g+=" ".repeat(F),m+=F}function E(){f.useTabs?B():T()}function B(){C>0&&w(C),A()}function T(){k>0&&S(k),A()}function A(){C=0,k=0}}function Es(u){let c=0,f=0,p=u.length;e:for(;p--;){let g=u[p];if(g===tr){f++;continue}for(let m=g.length-1;m>=0;m--){let C=g[m];if(C===" "||C===" ")c++;else{u[p]=g.slice(0,m+1);break e}}}if(c>0||f>0)for(u.length=p+1;f-- >0;)u.push(tr);return c}function Wr(u,c,f,p,g,m){if(f===Number.POSITIVE_INFINITY)return!0;let C=c.length,k=[u],w=[];for(;f>=0;){if(k.length===0){if(C===0)return!0;k.push(c[--C]);continue}let{mode:S,doc:E}=k.pop();switch(en(E)){case Zt:w.push(E),f-=ks(E);break;case Mt:case ze:{let B=Ip(E);for(let T=B.length-1;T>=0;T--)k.push({mode:S,doc:B[T]});break}case gt:case Dt:case bt:case ot:k.push({mode:S,doc:E.contents});break;case yt:f+=Es(w);break;case Te:{if(m&&E.break)return!1;let B=E.break?Me:S,T=E.expandedStates&&B===Me?he(!1,E.expandedStates,-1):E.contents;k.push({mode:B,doc:T});break}case Le:{let B=(E.groupId?g[E.groupId]||at:S)===Me?E.breakContents:E.flatContents;B&&k.push({mode:S,doc:B});break}case De:if(S===Me||E.hard)return!0;E.soft||(w.push(" "),f--);break;case Ct:p=!0;break;case vt:if(p)return!1;break}}return!1}function Ur(u,c){let f={},p=c.printWidth,g=vs(c.endOfLine),m=0,C=[{ind:tl(),mode:Me,doc:u}],k=[],w=!1,S=[],E=0;for(Rp(u);C.length>0;){let{ind:T,mode:A,doc:F}=C.pop();switch(en(F)){case Zt:{let O=g!==`
`?Hr(!1,F,`
`,g):F;k.push(O),C.length>0&&(m+=ks(O));break}case Mt:for(let O=F.length-1;O>=0;O--)C.push({ind:T,mode:A,doc:F[O]});break;case Qt:if(E>=2)throw new Error("There are too many 'cursor' in doc.");k.push(tr),E++;break;case gt:C.push({ind:Up(T,c),mode:A,doc:F.contents});break;case Dt:C.push({ind:Jp(T,F.n,c),mode:A,doc:F.contents});break;case yt:m-=Es(k);break;case Te:switch(A){case at:if(!w){C.push({ind:T,mode:F.break?Me:at,doc:F.contents});break}case Me:{w=!1;let O={ind:T,mode:at,doc:F.contents},L=p-m,z=S.length>0;if(!F.break&&Wr(O,C,L,z,f))C.push(O);else if(F.expandedStates){let V=he(!1,F.expandedStates,-1);if(F.break){C.push({ind:T,mode:Me,doc:V});break}else for(let Y=1;Y<F.expandedStates.length+1;Y++)if(Y>=F.expandedStates.length){C.push({ind:T,mode:Me,doc:V});break}else{let Q=F.expandedStates[Y],Z={ind:T,mode:at,doc:Q};if(Wr(Z,C,L,z,f)){C.push(Z);break}}}else C.push({ind:T,mode:Me,doc:F.contents});break}}F.id&&(f[F.id]=he(!1,C,-1).mode);break;case ze:{let O=p-m,{parts:L}=F;if(L.length===0)break;let[z,V]=L,Y={ind:T,mode:at,doc:z},Q={ind:T,mode:Me,doc:z},Z=Wr(Y,[],O,S.length>0,f,!0);if(L.length===1){Z?C.push(Y):C.push(Q);break}let ne={ind:T,mode:at,doc:V},ie={ind:T,mode:Me,doc:V};if(L.length===2){Z?C.push(ne,Y):C.push(ie,Q);break}L.splice(0,2);let le={ind:T,mode:A,doc:ja(L)},St=L[0];Wr({ind:T,mode:at,doc:[z,V,St]},[],O,S.length>0,f,!0)?C.push(le,ne,Y):Z?C.push(le,ie,Y):C.push(le,ie,Q);break}case Le:case bt:{let O=F.groupId?f[F.groupId]:A;if(O===Me){let L=F.type===Le?F.breakContents:F.negate?F.contents:$r(F.contents);L&&C.push({ind:T,mode:A,doc:L})}if(O===at){let L=F.type===Le?F.flatContents:F.negate?$r(F.contents):F.contents;L&&C.push({ind:T,mode:A,doc:L})}break}case Ct:S.push({ind:T,mode:A,doc:F.contents});break;case vt:S.length>0&&C.push({ind:T,mode:A,doc:bs});break;case De:switch(A){case at:if(F.hard)w=!0;else{F.soft||(k.push(" "),m+=1);break}case Me:if(S.length>0){C.push({ind:T,mode:A,doc:F},...S.reverse()),S.length=0;break}F.literal?T.root?(k.push(g,T.root.value),m=T.root.length):(k.push(g),m=0):(m-=Es(k),k.push(g+T.value),m=T.length);break}break;case ot:C.push({ind:T,mode:A,doc:F.contents});break;case qe:break;default:throw new An(F)}C.length===0&&S.length>0&&(C.push(...S.reverse()),S.length=0)}let B=k.indexOf(tr);if(B!==-1){let T=k.indexOf(tr,B+1),A=k.slice(0,B).join(""),F=k.slice(B+1,T).join(""),O=k.slice(T+1).join("");return{formatted:A+F+O,cursorNodeStart:A.length,cursorNodeText:F}}return{formatted:k.join("")}}function kt(u){var c;if(!u)return"";if(Array.isArray(u)){let f=[];for(let p of u)if(Array.isArray(p))f.push(...kt(p));else{let g=kt(p);g!==""&&f.push(g)}return f}return u.type===Le?{...u,breakContents:kt(u.breakContents),flatContents:kt(u.flatContents)}:u.type===Te?{...u,contents:kt(u.contents),expandedStates:(c=u.expandedStates)==null?void 0:c.map(kt)}:u.type===ze?{type:"fill",parts:u.parts.map(kt)}:u.contents?{...u,contents:kt(u.contents)}:u}function Kp(u){let c=Object.create(null),f=new Set;return p(kt(u));function p(m,C,k){var w,S;if(typeof m=="string")return JSON.stringify(m);if(Array.isArray(m)){let E=m.map(p).filter(Boolean);return E.length===1?E[0]:`[${E.join(", ")}]`}if(m.type===De){let E=((w=k?.[C+1])==null?void 0:w.type)===qe;return m.literal?E?"literalline":"literallineWithoutBreakParent":m.hard?E?"hardline":"hardlineWithoutBreakParent":m.soft?"softline":"line"}if(m.type===qe)return((S=k?.[C-1])==null?void 0:S.type)===De&&k[C-1].hard?void 0:"breakParent";if(m.type===yt)return"trim";if(m.type===gt)return"indent("+p(m.contents)+")";if(m.type===Dt)return m.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+p(m.contents)+")":m.n<0?"dedent("+p(m.contents)+")":m.n.type==="root"?"markAsRoot("+p(m.contents)+")":"align("+JSON.stringify(m.n)+", "+p(m.contents)+")";if(m.type===Le)return"ifBreak("+p(m.breakContents)+(m.flatContents?", "+p(m.flatContents):"")+(m.groupId?(m.flatContents?"":', ""')+`, { groupId: ${g(m.groupId)} }`:"")+")";if(m.type===bt){let E=[];m.negate&&E.push("negate: true"),m.groupId&&E.push(`groupId: ${g(m.groupId)}`);let B=E.length>0?`, { ${E.join(", ")} }`:"";return`indentIfBreak(${p(m.contents)}${B})`}if(m.type===Te){let E=[];m.break&&m.break!=="propagated"&&E.push("shouldBreak: true"),m.id&&E.push(`id: ${g(m.id)}`);let B=E.length>0?`, { ${E.join(", ")} }`:"";return m.expandedStates?`conditionalGroup([${m.expandedStates.map(T=>p(T)).join(",")}]${B})`:`group(${p(m.contents)}${B})`}if(m.type===ze)return`fill([${m.parts.map(E=>p(E)).join(", ")}])`;if(m.type===Ct)return"lineSuffix("+p(m.contents)+")";if(m.type===vt)return"lineSuffixBoundary";if(m.type===ot)return`label(${JSON.stringify(m.label)}, ${p(m.contents)})`;throw new Error("Unknown doc type "+m.type)}function g(m){if(typeof m!="symbol")return JSON.stringify(String(m));if(m in c)return c[m];let C=m.description||"symbol";for(let k=0;;k++){let w=C+(k>0?` #${k}`:"");if(!f.has(w))return f.add(w),c[m]=`Symbol.for(${JSON.stringify(w)})`}}}function Gp(u,c,f=0){let p=0;for(let g=f;g<u.length;++g)u[g]===" "?p=p+c-p%c:p++;return p}var xs=Gp,nl=class extends Error{name="ConfigError"},rl=class extends Error{name="UndefinedParserError"},Yp={cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:`Print (to stderr) where a cursor at the given position would move to after formatting.
This option cannot be used with --range-start and --range-end.`,cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:u=>typeof u=="string"||typeof u=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:u=>typeof u=="string"||typeof u=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement.
This option cannot be used with --cursor-offset.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
The range will extend backwards to the start of the first line containing the selected statement.
This option cannot be used with --cursor-offset.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment
in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function il({plugins:u=[],showDeprecated:c=!1}={}){let f=u.flatMap(g=>g.languages??[]),p=[];for(let g of Zp(Object.assign({},...u.map(({options:m})=>m),Yp)))!c&&g.deprecated||(Array.isArray(g.choices)&&(c||(g.choices=g.choices.filter(m=>!m.deprecated)),g.name==="parser"&&(g.choices=[...g.choices,...Xp(g.choices,f,u)])),g.pluginDefaults=Object.fromEntries(u.filter(m=>{var C;return((C=m.defaultOptions)==null?void 0:C[g.name])!==void 0}).map(m=>[m.name,m.defaultOptions[g.name]])),p.push(g));return{languages:f,options:p}}function*Xp(u,c,f){let p=new Set(u.map(g=>g.value));for(let g of c)if(g.parsers){for(let m of g.parsers)if(!p.has(m)){p.add(m);let C=f.find(w=>w.parsers&&Object.prototype.hasOwnProperty.call(w.parsers,m)),k=g.name;C!=null&&C.name&&(k+=` (plugin: ${C.name})`),yield{value:m,description:k}}}}function Zp(u){let c=[];for(let[f,p]of Object.entries(u)){let g={name:f,...p};Array.isArray(g.default)&&(g.default=he(!1,g.default,-1).value),c.push(g)}return c}var Qp=u=>u.split(/[/\\]/).pop();function sl(u,c){if(!c)return;let f=Qp(c).toLowerCase();return u.find(p=>{var g,m;return((g=p.extensions)==null?void 0:g.some(C=>f.endsWith(C)))||((m=p.filenames)==null?void 0:m.some(C=>C.toLowerCase()===f))})}function ef(u,c){if(c)return u.find(({name:f})=>f.toLowerCase()===c)??u.find(({aliases:f})=>f?.includes(c))??u.find(({extensions:f})=>f?.includes(`.${c}`))}function tf(u,c){let f=u.plugins.flatMap(g=>g.languages??[]),p=ef(f,c.language)??sl(f,c.physicalFile)??sl(f,c.file)??(c.physicalFile,void 0);return p?.parsers[0]}var nf=tf,Xe=y(op(),1),As;function rf(u,c,{logger:f=!1,isCLI:p=!1,passThrough:g=!1,FlagSchema:m,descriptor:C}={}){if(p){if(!m)throw new Error("'FlagSchema' option is required.");if(!C)throw new Error("'descriptor' option is required.")}else C=Xe.default.apiDescriptor;let k=g?Array.isArray(g)?(T,A)=>g.includes(T)?{[T]:A}:void 0:(T,A)=>({[T]:A}):(T,A,F)=>{let{_:O,...L}=F.schemas;return Xe.default.levenUnknownHandler(T,A,{...F,schemas:L})},w=sf(c,{isCLI:p,FlagSchema:m}),S=new Xe.default.Normalizer(w,{logger:f,unknown:k,descriptor:C}),E=f!==!1;E&&As&&(S._hasDeprecationWarned=As);let B=S.normalize(u);return E&&(As=S._hasDeprecationWarned),B}function sf(u,{isCLI:c,FlagSchema:f}){let p=[];c&&p.push(Xe.default.AnySchema.create({name:"_"}));for(let g of u)p.push(of(g,{isCLI:c,optionInfos:u,FlagSchema:f})),g.alias&&c&&p.push(Xe.default.AliasSchema.create({name:g.alias,sourceName:g.name}));return p}function of(u,{isCLI:c,optionInfos:f,FlagSchema:p}){let{name:g}=u,m={name:g},C,k={};switch(u.type){case"int":C=Xe.default.IntegerSchema,c&&(m.preprocess=Number);break;case"string":C=Xe.default.StringSchema;break;case"choice":C=Xe.default.ChoiceSchema,m.choices=u.choices.map(w=>w!=null&&w.redirect?{...w,redirect:{to:{key:u.name,value:w.redirect}}}:w);break;case"boolean":C=Xe.default.BooleanSchema;break;case"flag":C=p,m.flags=f.flatMap(w=>[w.alias,w.description&&w.name,w.oppositeDescription&&`no-${w.name}`].filter(Boolean));break;case"path":C=Xe.default.StringSchema;break;default:throw new Error(`Unexpected type ${u.type}`)}if(u.exception?m.validate=(w,S,E)=>u.exception(w)||S.validate(w,E):m.validate=(w,S,E)=>w===void 0||S.validate(w,E),u.redirect&&(k.redirect=w=>w?{to:{key:u.redirect.option,value:u.redirect.value}}:void 0),u.deprecated&&(k.deprecated=!0),c&&!u.array){let w=m.preprocess||(S=>S);m.preprocess=(S,E,B)=>E.preprocess(w(Array.isArray(S)?he(!1,S,-1):S),B)}return u.array?Xe.default.ArraySchema.create({...c?{preprocess:w=>Array.isArray(w)?w:[w]}:{},...k,valueSchema:C.create(m)}):C.create({...m,...k})}var af=rf;function ol(u,c){if(!c)throw new Error("parserName is required.");for(let p=u.length-1;p>=0;p--){let g=u[p];if(g.parsers&&Object.prototype.hasOwnProperty.call(g.parsers,c))return g}let f=`Couldn't resolve parser "${c}".`;throw f+=" Plugins must be explicitly added to the standalone bundle.",new nl(f)}function lf(u,c){if(!c)throw new Error("astFormat is required.");for(let p=u.length-1;p>=0;p--){let g=u[p];if(g.printers&&Object.prototype.hasOwnProperty.call(g.printers,c))return g}let f=`Couldn't find plugin for AST format "${c}".`;throw f+=" Plugins must be explicitly added to the standalone bundle.",new nl(f)}function al({plugins:u,parser:c}){let f=ol(u,c);return ll(f,c)}function ll(u,c){let f=u.parsers[c];return typeof f=="function"?f():f}function uf(u,c){let f=u.printers[c];return typeof f=="function"?f():f}var ul={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function cf(u,c={}){var f;let p={...u};if(!p.parser)if(p.filepath){if(p.parser=nf(p,{physicalFile:p.filepath}),!p.parser)throw new rl(`No parser could be inferred for file "${p.filepath}".`)}else throw new rl("No parser and no file path given, couldn't infer a parser.");let g=il({plugins:u.plugins,showDeprecated:!0}).options,m={...ul,...Object.fromEntries(g.filter(T=>T.default!==void 0).map(T=>[T.name,T.default]))},C=ol(p.plugins,p.parser),k=await ll(C,p.parser);p.astFormat=k.astFormat,p.locEnd=k.locEnd,p.locStart=k.locStart;let w=(f=C.printers)!=null&&f[k.astFormat]?C:lf(p.plugins,k.astFormat),S=await uf(w,k.astFormat);p.printer=S;let E=w.defaultOptions?Object.fromEntries(Object.entries(w.defaultOptions).filter(([,T])=>T!==void 0)):{},B={...m,...E};for(let[T,A]of Object.entries(B))(p[T]===null||p[T]===void 0)&&(p[T]=A);return p.parser==="json"&&(p.trailingComma="none"),af(p,g,{passThrough:Object.keys(ul),...c})}var Tn=cf,cl=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),df=u=>Object.keys(u).filter(c=>!cl.has(c));function hf(u){return u?c=>u(c,cl):df}var Jr=hf;function pf(u,c){let{printer:{massageAstNode:f,getVisitorKeys:p}}=c;if(!f)return u;let g=Jr(p),m=f.ignoredProperties??new Set;return C(u);function C(k,w){if(!(k!==null&&typeof k=="object"))return k;if(Array.isArray(k))return k.map(T=>C(T,w)).filter(Boolean);let S={},E=new Set(g(k));for(let T in k)!Object.prototype.hasOwnProperty.call(k,T)||m.has(T)||(E.has(T)?S[T]=C(k[T],k):S[T]=k[T]);let B=f(k,S,w);if(B!==null)return B??S}}var ff=pf,mf=y(lp(),1);async function gf(u,c){let f=await al(c),p=f.preprocess?f.preprocess(u,c):u;c.originalText=p;let g;try{g=await f.parse(p,c,c)}catch(m){Df(m,u)}return{text:p,ast:g}}function Df(u,c){let{loc:f}=u;if(f){let p=(0,mf.codeFrameColumns)(c,f,{highlightCode:!0});throw u.message+=`
`+p,u.codeFrame=p,u}throw u}var nr=gf,Kr,Fs,rr,Gr,yf=class{constructor(u){x(this,Kr),x(this,rr),this.stack=[u]}get key(){let{stack:u,siblings:c}=this;return he(!1,u,c===null?-2:-4)??null}get index(){return this.siblings===null?null:he(!1,this.stack,-2)}get node(){return he(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:u}=this,c=he(!1,u,-3);return Array.isArray(c)?c:null}get next(){let{siblings:u}=this;return u===null?null:u[this.index+1]}get previous(){let{siblings:u}=this;return u===null?null:u[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:u,index:c}=this;return u!==null&&c===u.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...M(this,rr,Gr).call(this)]}getName(){let{stack:u}=this,{length:c}=u;return c>1?he(!1,u,-2):null}getValue(){return he(!1,this.stack,-1)}getNode(u=0){let c=M(this,Kr,Fs).call(this,u);return c===-1?null:this.stack[c]}getParentNode(u=0){return this.getNode(u+1)}call(u,...c){let{stack:f}=this,{length:p}=f,g=he(!1,f,-1);for(let m of c)g=g[m],f.push(m,g);try{return u(this)}finally{f.length=p}}callParent(u,c=0){let f=M(this,Kr,Fs).call(this,c+1),p=this.stack.splice(f+1);try{return u(this)}finally{this.stack.push(...p)}}each(u,...c){let{stack:f}=this,{length:p}=f,g=he(!1,f,-1);for(let m of c)g=g[m],f.push(m,g);try{for(let m=0;m<g.length;++m)f.push(m,g[m]),u(this,m,g),f.length-=2}finally{f.length=p}}map(u,...c){let f=[];return this.each((p,g,m)=>{f[g]=u(p,g,m)},...c),f}match(...u){let c=this.stack.length-1,f=null,p=this.stack[c--];for(let g of u){if(p===void 0)return!1;let m=null;if(typeof f=="number"&&(m=f,f=this.stack[c--],p=this.stack[c--]),g&&!g(p,f,m))return!1;f=this.stack[c--],p=this.stack[c--]}return!0}findAncestor(u){for(let c of M(this,rr,Gr).call(this))if(u(c))return c}hasAncestor(u){for(let c of M(this,rr,Gr).call(this))if(u(c))return!0;return!1}};Kr=new WeakSet,Fs=function(u){let{stack:c}=this;for(let f=c.length-1;f>=0;f-=2)if(!Array.isArray(c[f])&&--u<0)return f;return-1},rr=new WeakSet,Gr=function*(){let{stack:u}=this;for(let c=u.length-3;c>=0;c-=2){let f=u[c];Array.isArray(f)||(yield f)}};var bf=yf,ir=()=>{};ir.ok=ir,ir.strictEqual=ir;var Ts=ir;function sr(u){return(c,f,p)=>{let g=!!(p!=null&&p.backwards);if(f===!1)return!1;let{length:m}=c,C=f;for(;C>=0&&C<m;){let k=c.charAt(C);if(u instanceof RegExp){if(!u.test(k))return C}else if(!u.includes(k))return C;g?C--:C++}return C===-1||C===m?C:!1}}var Cf=sr(/\s/),_t=sr(" "),dl=sr(",; "),hl=sr(/[^\n\r]/);function vf(u,c,f){let p=!!(f!=null&&f.backwards);if(c===!1)return!1;let g=u.charAt(c);if(p){if(u.charAt(c-1)==="\r"&&g===`
`)return c-2;if(g===`
`||g==="\r"||g==="\u2028"||g==="\u2029")return c-1}else{if(g==="\r"&&u.charAt(c+1)===`
`)return c+2;if(g===`
`||g==="\r"||g==="\u2028"||g==="\u2029")return c+1}return c}var nn=vf;function kf(u,c,f={}){let p=_t(u,f.backwards?c-1:c,f),g=nn(u,p,f);return p!==g}var Bt=kf;function Sf(u){return Array.isArray(u)&&u.length>0}var wf=Sf;function Ef(u){return u!==null&&typeof u=="object"}var xf=Ef;function*pl(u,c){let{getVisitorKeys:f,filter:p=()=>!0}=c,g=m=>xf(m)&&p(m);for(let m of f(u)){let C=u[m];if(Array.isArray(C))for(let k of C)g(k)&&(yield k);else g(C)&&(yield C)}}function*Af(u,c){let f=[u];for(let p=0;p<f.length;p++){let g=f[p];for(let m of pl(g,c))yield m,f.push(m)}}function Ff(u){let c=u.type||u.kind||"(unknown type)",f=String(u.name||u.id&&(typeof u.id=="object"?u.id.name:u.id)||u.key&&(typeof u.key=="object"?u.key.name:u.key)||u.value&&(typeof u.value=="object"?"":String(u.value))||u.operator||"");return f.length>20&&(f=f.slice(0,19)+"…"),c+(f?" "+f:"")}function Ms(u,c){(u.comments??(u.comments=[])).push(c),c.printed=!1,c.nodeDescription=Ff(u)}function Mn(u,c){c.leading=!0,c.trailing=!1,Ms(u,c)}function rn(u,c,f){c.leading=!1,c.trailing=!1,f&&(c.marker=f),Ms(u,c)}function _n(u,c){c.leading=!1,c.trailing=!0,Ms(u,c)}var _s=new WeakMap;function Bs(u,c){if(_s.has(u))return _s.get(u);let{printer:{getCommentChildNodes:f,canAttachComment:p,getVisitorKeys:g},locStart:m,locEnd:C}=c;if(!p)return[];let k=(f?.(u,c)??[...pl(u,{getVisitorKeys:Jr(g)})]).flatMap(w=>p(w)?[w]:Bs(w,c));return k.sort((w,S)=>m(w)-m(S)||C(w)-C(S)),_s.set(u,k),k}function fl(u,c,f,p){let{locStart:g,locEnd:m}=f,C=g(c),k=m(c),w=Bs(u,f),S,E,B=0,T=w.length;for(;B<T;){let A=B+T>>1,F=w[A],O=g(F),L=m(F);if(O<=C&&k<=L)return fl(F,c,f,F);if(L<=C){S=F,B=A+1;continue}if(k<=O){E=F,T=A;continue}throw new Error("Comment location overlaps with node location")}if(p?.type==="TemplateLiteral"){let{quasis:A}=p,F=Os(A,c,f);S&&Os(A,S,f)!==F&&(S=null),E&&Os(A,E,f)!==F&&(E=null)}return{enclosingNode:p,precedingNode:S,followingNode:E}}var Ns=()=>!1;function Tf(u,c){let{comments:f}=u;if(delete u.comments,!wf(f)||!c.printer.canAttachComment)return;let p=[],{locStart:g,locEnd:m,printer:{experimentalFeatures:{avoidAstMutation:C=!1}={},handleComments:k={}},originalText:w}=c,{ownLine:S=Ns,endOfLine:E=Ns,remaining:B=Ns}=k,T=f.map((A,F)=>({...fl(u,A,c),comment:A,text:w,options:c,ast:u,isLastComment:f.length-1===F}));for(let[A,F]of T.entries()){let{comment:O,precedingNode:L,enclosingNode:z,followingNode:V,text:Y,options:Q,ast:Z,isLastComment:ne}=F;if(Q.parser==="json"||Q.parser==="json5"||Q.parser==="__js_expression"||Q.parser==="__ts_expression"||Q.parser==="__vue_expression"||Q.parser==="__vue_ts_expression"){if(g(O)-g(Z)<=0){Mn(Z,O);continue}if(m(O)-m(Z)>=0){_n(Z,O);continue}}let ie;if(C?ie=[F]:(O.enclosingNode=z,O.precedingNode=L,O.followingNode=V,ie=[O,Y,Q,Z,ne]),Mf(Y,Q,T,A))O.placement="ownLine",S(...ie)||(V?Mn(V,O):L?_n(L,O):rn(z||Z,O));else if(_f(Y,Q,T,A))O.placement="endOfLine",E(...ie)||(L?_n(L,O):V?Mn(V,O):rn(z||Z,O));else if(O.placement="remaining",!B(...ie))if(L&&V){let le=p.length;le>0&&p[le-1].followingNode!==V&&gl(p,Q),p.push(F)}else L?_n(L,O):V?Mn(V,O):rn(z||Z,O)}if(gl(p,c),!C)for(let A of f)delete A.precedingNode,delete A.enclosingNode,delete A.followingNode}var ml=u=>!/[\S\n\u2028\u2029]/.test(u);function Mf(u,c,f,p){let{comment:g,precedingNode:m}=f[p],{locStart:C,locEnd:k}=c,w=C(g);if(m)for(let S=p-1;S>=0;S--){let{comment:E,precedingNode:B}=f[S];if(B!==m||!ml(u.slice(k(E),w)))break;w=C(E)}return Bt(u,w,{backwards:!0})}function _f(u,c,f,p){let{comment:g,followingNode:m}=f[p],{locStart:C,locEnd:k}=c,w=k(g);if(m)for(let S=p+1;S<f.length;S++){let{comment:E,followingNode:B}=f[S];if(B!==m||!ml(u.slice(w,C(E))))break;w=k(E)}return Bt(u,w)}function gl(u,c){var f,p;let g=u.length;if(g===0)return;let{precedingNode:m,followingNode:C}=u[0],k=c.locStart(C),w;for(w=g;w>0;--w){let{comment:S,precedingNode:E,followingNode:B}=u[w-1];Ts.strictEqual(E,m),Ts.strictEqual(B,C);let T=c.originalText.slice(c.locEnd(S),k);if(((p=(f=c.printer).isGap)==null?void 0:p.call(f,T,c))??/^[\s(]*$/.test(T))k=c.locStart(S);else break}for(let[S,{comment:E}]of u.entries())S<w?_n(m,E):Mn(C,E);for(let S of[m,C])S.comments&&S.comments.length>1&&S.comments.sort((E,B)=>c.locStart(E)-c.locStart(B));u.length=0}function Os(u,c,f){let p=f.locStart(c)-1;for(let g=1;g<u.length;++g)if(p<f.locStart(u[g]))return g-1;return 0}function Bf(u,c){let f=c-1;f=_t(u,f,{backwards:!0}),f=nn(u,f,{backwards:!0}),f=_t(u,f,{backwards:!0});let p=nn(u,f,{backwards:!0});return f!==p}var Is=Bf;function Dl(u,c){let f=u.node;return f.printed=!0,c.printer.printComment(u,c)}function Nf(u,c){var f;let p=u.node,g=[Dl(u,c)],{printer:m,originalText:C,locStart:k,locEnd:w}=c;if((f=m.isBlockComment)!=null&&f.call(m,p)){let E=Bt(C,w(p))?Bt(C,k(p),{backwards:!0})?tn:Ua:" ";g.push(E)}else g.push(tn);let S=nn(C,_t(C,w(p)));return S!==!1&&Bt(C,S)&&g.push(tn),g}function Of(u,c,f){var p;let g=u.node,m=Dl(u,c),{printer:C,originalText:k,locStart:w}=c,S=(p=C.isBlockComment)==null?void 0:p.call(C,g);if(f!=null&&f.hasLineSuffix&&!(f!=null&&f.isBlock)||Bt(k,w(g),{backwards:!0})){let E=Is(k,w(g));return{doc:ys([tn,E?tn:"",m]),isBlock:S,hasLineSuffix:!0}}return!S||f!=null&&f.hasLineSuffix?{doc:[ys([" ",m]),Vr],isBlock:S,hasLineSuffix:!0}:{doc:[" ",m],isBlock:S,hasLineSuffix:!1}}function If(u,c){let f=u.node;if(!f)return{};let p=c[Symbol.for("printedComments")];if((f.comments||[]).filter(k=>!p.has(k)).length===0)return{leading:"",trailing:""};let g=[],m=[],C;return u.each(()=>{let k=u.node;if(p!=null&&p.has(k))return;let{leading:w,trailing:S}=k;w?g.push(Nf(u,c)):S&&(C=Of(u,c,C),m.push(C.doc))},"comments"),{leading:g,trailing:m}}function Lf(u,c,f){let{leading:p,trailing:g}=If(u,f);return!p&&!g?c:el(c,m=>[p,m,g])}function Pf(u){let{[Symbol.for("comments")]:c,[Symbol.for("printedComments")]:f}=u;for(let p of c){if(!p.printed&&!f.has(p))throw new Error('Comment "'+p.value.trim()+'" was not printed. Please report this error!');delete p.printed}}async function Rf(u,c,f,p,g){let{embeddedLanguageFormatting:m,printer:{embed:C,hasPrettierIgnore:k=()=>!1,getVisitorKeys:w}}=f;if(!C||m!=="auto")return;if(C.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed");let S=Jr(C.getVisitorKeys??w),E=[];A();let B=u.stack;for(let{print:F,node:O,pathStack:L}of E)try{u.stack=L;let z=await F(T,c,u,f);z&&g.set(O,z)}catch(z){if(globalThis.PRETTIER_DEBUG)throw z}u.stack=B;function T(F,O){return zf(F,O,f,p)}function A(){let{node:F}=u;if(F===null||typeof F!="object"||k(u))return;for(let L of S(F))Array.isArray(F[L])?u.each(A,L):u.call(A,L);let O=C(u,f);if(O){if(typeof O=="function"){E.push({print:O,node:F,pathStack:[...u.stack]});return}g.set(F,O)}}}async function zf(u,c,f,p){let g=await Tn({...f,...c,parentParser:f.parser,originalText:u},{passThrough:!0}),{ast:m}=await nr(u,g),C=await p(m,g);return Qa(C)}function qf(u,c){let{originalText:f,[Symbol.for("comments")]:p,locStart:g,locEnd:m,[Symbol.for("printedComments")]:C}=c,{node:k}=u,w=g(k),S=m(k);for(let E of p)g(E)>=w&&m(E)<=S&&C.add(E);return f.slice(w,S)}var Hf=qf;async function Yr(u,c){({ast:u}=await bl(u,c));let f=new Map,p=new bf(u),g=new Map;await Rf(p,C,c,Yr,g);let m=await yl(p,c,C,void 0,g);return Pf(c),m;function C(w,S){return w===void 0||w===p?k(S):Array.isArray(w)?p.call(()=>k(S),...w):p.call(()=>k(S),w)}function k(w){let S=p.node;if(S==null)return"";let E=S&&typeof S=="object"&&w===void 0;if(E&&f.has(S))return f.get(S);let B=yl(p,c,C,w,g);return E&&f.set(S,B),B}}function yl(u,c,f,p,g){var m;let{node:C}=u,{printer:k}=c,w;return(m=k.hasPrettierIgnore)!=null&&m.call(k,u)?w=Hf(u,c):g.has(C)?w=g.get(C):w=k.print(u,c,f,p),k.printComment&&(!k.willPrintOwnComments||!k.willPrintOwnComments(u,c))&&(w=Lf(u,w,c)),C===c.cursorNode&&(w=el(w,S=>[Cs,S,Cs])),w}async function bl(u,c){let f=u.comments??[];c[Symbol.for("comments")]=f,c[Symbol.for("tokens")]=u.tokens??[],c[Symbol.for("printedComments")]=new Set,Tf(u,c);let{printer:{preprocess:p}}=c;return u=p?await p(u,c):u,{ast:u,comments:f}}var $f=({parser:u})=>u==="json"||u==="json5"||u==="json-stringify";function Vf(u,c){let f=[u.node,...u.parentNodes],p=new Set([c.node,...c.parentNodes]);return f.find(g=>vl.has(g.type)&&p.has(g))}function Cl(u){let c=u.length-1;for(;;){let f=u[c];if(f?.type==="Program"||f?.type==="File")c--;else break}return u.slice(0,c+1)}function jf(u,c,{locStart:f,locEnd:p}){let g=u.node,m=c.node;if(g===m)return{startNode:g,endNode:m};let C=f(u.node);for(let w of Cl(c.parentNodes))if(f(w)>=C)m=w;else break;let k=p(c.node);for(let w of Cl(u.parentNodes)){if(p(w)<=k)g=w;else break;if(g===m)break}return{startNode:g,endNode:m}}function Ls(u,c,f,p,g=[],m){let{locStart:C,locEnd:k}=f,w=C(u),S=k(u);if(!(c>S||c<w||m==="rangeEnd"&&c===w||m==="rangeStart"&&c===S)){for(let E of Bs(u,f)){let B=Ls(E,c,f,p,[u,...g],m);if(B)return B}if(!p||p(u,g[0]))return{node:u,parentNodes:g}}}function Wf(u,c){return c!=="DeclareExportDeclaration"&&u!=="TypeParameterDeclaration"&&(u==="Directive"||u==="TypeAlias"||u==="TSExportAssignment"||u.startsWith("Declare")||u.startsWith("TSDeclare")||u.endsWith("Statement")||u.endsWith("Declaration"))}var vl=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),Uf=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function kl(u,c,f){if(!c)return!1;switch(u.parser){case"flow":case"babel":case"babel-flow":case"babel-ts":case"typescript":case"acorn":case"espree":case"meriyah":case"__babel_estree":return Wf(c.type,f?.type);case"json":case"json5":case"json-stringify":return vl.has(c.type);case"graphql":return Uf.has(c.kind);case"vue":return c.tag!=="root"}return!1}function Jf(u,c,f){let{rangeStart:p,rangeEnd:g,locStart:m,locEnd:C}=c;Ts.ok(g>p);let k=u.slice(p,g).search(/\S/),w=k===-1;if(!w)for(p+=k;g>p&&!/\S/.test(u[g-1]);--g);let S=Ls(f,p,c,(A,F)=>kl(c,A,F),[],"rangeStart"),E=w?S:Ls(f,g,c,A=>kl(c,A),[],"rangeEnd");if(!S||!E)return{rangeStart:0,rangeEnd:0};let B,T;if($f(c)){let A=Vf(S,E);B=A,T=A}else({startNode:B,endNode:T}=jf(S,E,c));return{rangeStart:Math.min(m(B),m(T)),rangeEnd:Math.max(C(B),C(T))}}function Kf(u,c){let{cursorOffset:f,locStart:p,locEnd:g}=c,m=Jr(c.printer.getVisitorKeys),C=w=>p(w)<=f&&g(w)>=f,k=u;for(let w of Af(u,{getVisitorKeys:m,filter:C}))k=w;return k}var Gf=Kf,Sl="\uFEFF",wl=Symbol("cursor");async function El(u,c,f=0){if(!u||u.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:p,text:g}=await nr(u,c);c.cursorOffset>=0&&(c.cursorNode=Gf(p,c));let m=await Yr(p,c);f>0&&(m=Ga([tn,m],f,c.tabWidth));let C=Ur(m,c);if(f>0){let w=C.formatted.trim();C.cursorNodeStart!==void 0&&(C.cursorNodeStart-=C.formatted.indexOf(w)),C.formatted=w+vs(c.endOfLine)}let k=c[Symbol.for("comments")];if(c.cursorOffset>=0){let w,S,E,B,T;if(c.cursorNode&&C.cursorNodeText?(w=c.locStart(c.cursorNode),S=g.slice(w,c.locEnd(c.cursorNode)),E=c.cursorOffset-w,B=C.cursorNodeStart,T=C.cursorNodeText):(w=0,S=g,E=c.cursorOffset,B=0,T=C.formatted),S===T)return{formatted:C.formatted,cursorOffset:B+E,comments:k};let A=S.split("");A.splice(E,0,wl);let F=T.split(""),O=(0,cp.diffArrays)(A,F),L=B;for(let z of O)if(z.removed){if(z.value.includes(wl))break}else L+=z.count;return{formatted:C.formatted,cursorOffset:L,comments:k}}return{formatted:C.formatted,cursorOffset:-1,comments:k}}async function Yf(u,c){let{ast:f,text:p}=await nr(u,c),{rangeStart:g,rangeEnd:m}=Jf(p,c,f),C=p.slice(g,m),k=Math.min(g,p.lastIndexOf(`
`,g)+1),w=p.slice(k,g).match(/^\s*/)[0],S=xs(w,c.tabWidth),E=await El(C,{...c,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:c.cursorOffset>g&&c.cursorOffset<=m?c.cursorOffset-g:-1,endOfLine:"lf"},S),B=E.formatted.trimEnd(),{cursorOffset:T}=c;T>m?T+=B.length-C.length:E.cursorOffset>=0&&(T=E.cursorOffset+g);let A=p.slice(0,g)+B+p.slice(m);if(c.endOfLine!=="lf"){let F=vs(c.endOfLine);T>=0&&F===`\r
`&&(T+=Ya(A.slice(0,T),`
`)),A=Hr(!1,A,`
`,F)}return{formatted:A,cursorOffset:T,comments:E.comments}}function Ps(u,c,f){return typeof c!="number"||Number.isNaN(c)||c<0||c>u.length?f:c}function xl(u,c){let{cursorOffset:f,rangeStart:p,rangeEnd:g}=c;return f=Ps(u,f,-1),p=Ps(u,p,0),g=Ps(u,g,u.length),{...c,cursorOffset:f,rangeStart:p,rangeEnd:g}}function Al(u,c){let{cursorOffset:f,rangeStart:p,rangeEnd:g,endOfLine:m}=xl(u,c),C=u.charAt(0)===Sl;if(C&&(u=u.slice(1),f--,p--,g--),m==="auto"&&(m=Tp(u)),u.includes("\r")){let k=w=>Ya(u.slice(0,Math.max(w,0)),`\r
`);f-=k(f),p-=k(p),g-=k(g),u=Mp(u)}return{hasBOM:C,text:u,options:xl(u,{...c,cursorOffset:f,rangeStart:p,rangeEnd:g,endOfLine:m})}}async function Fl(u,c){let f=await al(c);return!f.hasPragma||f.hasPragma(u)}async function Tl(u,c){let{hasBOM:f,text:p,options:g}=Al(u,await Tn(c));if(g.rangeStart>=g.rangeEnd&&p!==""||g.requirePragma&&!await Fl(p,g))return{formatted:u,cursorOffset:c.cursorOffset,comments:[]};let m;return g.rangeStart>0||g.rangeEnd<p.length?m=await Yf(p,g):(!g.requirePragma&&g.insertPragma&&g.printer.insertPragma&&!await Fl(p,g)&&(p=g.printer.insertPragma(p)),m=await El(p,g)),f&&(m.formatted=Sl+m.formatted,m.cursorOffset>=0&&m.cursorOffset++),m}async function Xf(u,c,f){let{text:p,options:g}=Al(u,await Tn(c)),m=await nr(p,g);return f&&(f.preprocessForPrint&&(m.ast=await bl(m.ast,g)),f.massage&&(m.ast=ff(m.ast,g))),m}async function Zf(u,c){c=await Tn(c);let f=await Yr(u,c);return Ur(f,c)}async function Qf(u,c){let f=Kp(u),{formatted:p}=await Tl(f,{...c,parser:"__js_expression"});return p}async function em(u,c){c=await Tn(c);let{ast:f}=await nr(u,c);return Yr(f,c)}async function tm(u,c){return Ur(u,await Tn(c))}var Ml={};h(Ml,{addDanglingComment:()=>rn,addLeadingComment:()=>Mn,addTrailingComment:()=>_n,getAlignmentSize:()=>xs,getIndentSize:()=>cm,getMaxContinuousCount:()=>lm,getNextNonSpaceNonCommentCharacter:()=>gm,getNextNonSpaceNonCommentCharacterIndex:()=>Cm,getStringWidth:()=>ks,hasNewline:()=>Bt,hasNewlineInRange:()=>hm,hasSpaces:()=>fm,isNextLineEmpty:()=>wm,isNextLineEmptyAfterIndex:()=>Hs,isPreviousLineEmpty:()=>km,makeString:()=>ym,skip:()=>sr,skipEverythingButNewLine:()=>hl,skipInlineComment:()=>Rs,skipNewline:()=>nn,skipSpaces:()=>_t,skipToLineEnd:()=>dl,skipTrailingComment:()=>zs,skipWhitespace:()=>Cf});function nm(u,c){if(c===!1)return!1;if(u.charAt(c)==="/"&&u.charAt(c+1)==="*"){for(let f=c+2;f<u.length;++f)if(u.charAt(f)==="*"&&u.charAt(f+1)==="/")return f+2}return c}var Rs=nm;function rm(u,c){return c===!1?!1:u.charAt(c)==="/"&&u.charAt(c+1)==="/"?hl(u,c):c}var zs=rm;function im(u,c){let f=null,p=c;for(;p!==f;)f=p,p=_t(u,p),p=Rs(u,p),p=zs(u,p),p=nn(u,p);return p}var qs=im;function sm(u,c){let f=null,p=c;for(;p!==f;)f=p,p=dl(u,p),p=Rs(u,p),p=_t(u,p);return p=zs(u,p),p=nn(u,p),p!==!1&&Bt(u,p)}var Hs=sm;function om(u){if(typeof u!="string")throw new TypeError("Expected a string");return u.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function am(u,c){let f=u.match(new RegExp(`(${om(c)})+`,"g"));return f===null?0:f.reduce((p,g)=>Math.max(p,g.length/c.length),0)}var lm=am;function um(u,c){let f=u.lastIndexOf(`
`);return f===-1?0:xs(u.slice(f+1).match(/^[\t ]*/)[0],c)}var cm=um;function dm(u,c,f){for(let p=c;p<f;++p)if(u.charAt(p)===`
`)return!0;return!1}var hm=dm;function pm(u,c,f={}){return _t(u,f.backwards?c-1:c,f)!==c}var fm=pm;function mm(u,c){let f=qs(u,c);return f===!1?"":u.charAt(f)}var gm=mm;function Dm(u,c,f){let p=c==='"'?"'":'"',g=Hr(!1,u,/\\(.)|(["'])/gs,(m,C,k)=>C===p?C:k===c?"\\"+k:k||(f&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(C)?C:"\\"+C));return c+g+c}var ym=Dm;function bm(u,c,f){return qs(u,f(c))}function Cm(u,c){return arguments.length===2||typeof c=="number"?qs(u,c):bm(...arguments)}function vm(u,c,f){return Is(u,f(c))}function km(u,c){return arguments.length===2||typeof c=="number"?Is(u,c):vm(...arguments)}function Sm(u,c,f){return Hs(u,f(c))}function wm(u,c){return arguments.length===2||typeof c=="number"?Hs(u,c):Sm(...arguments)}var _l={};h(_l,{builders:()=>Em,printer:()=>xm,utils:()=>Am});var Em={join:Ka,line:Ua,softline:xp,hardline:tn,literalline:Ja,group:Va,conditionalGroup:vp,fill:ja,lineSuffix:ys,lineSuffixBoundary:wp,cursor:Cs,breakParent:Vr,ifBreak:kp,trim:Ep,indent:$r,indentIfBreak:Sp,align:Fn,addAlignmentToDoc:Ga,markAsRoot:bp,dedentToRoot:yp,dedent:Cp,hardlineWithoutBreakParent:bs,literallineWithoutBreakParent:Wa,label:Ap,concat:u=>u},xm={printDocToString:Ur},Am={willBreak:Pp,traverseDoc:Ds,findInDoc:Ss,mapDoc:jr,removeLines:qp,stripTrailingHardline:Qa,replaceEndOfLine:Vp,canBreak:Wp},Fm="3.0.0";function sn(u,c=1){return async(...f)=>{let p=f[c]??{},g=p.plugins??[];return f[c]={...p,plugins:Array.isArray(g)?g:Object.values(g)},u(...f)}}var Bl=sn(Tl);async function Nl(u,c){let{formatted:f}=await Bl(u,{...c,cursorOffset:-1});return f}async function Tm(u,c){return await Nl(u,c)===u}var Mm=sn(il,0),_m={parse:sn(Xf),formatAST:sn(Zf),formatDoc:sn(Qf),printToDoc:sn(em),printDocToString:sn(tm)};return b(qa)})})(Dc);var o2=Dc.exports,a2=Object.defineProperty,yc=(n,e)=>{for(var t in e)a2(n,t,{get:e[t],enumerable:!0})},bc=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Nt=(n,e,t)=>(bc(n,e,"read from private field"),t?t.call(n):e.get(n)),l2=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},u2=(n,e,t,r)=>(bc(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Cc={};yc(Cc,{languages:()=>Vy,options:()=>Wy,parsers:()=>Xc,printers:()=>Uy});var c2=(n,e,t,r)=>{if(!(n&&e==null))return e.replaceAll?e.replaceAll(t,r):t.global?e.replace(t,r):e.split(t).join(r)},Je=c2,Jo="string",Ko="array",Go="cursor",Oi="indent",Ii="align",Yo="trim",Cr="group",Li="fill",Pi="if-break",Ri="indent-if-break",Xo="line-suffix",Zo="line-suffix-boundary",En="line",Qo="label",zi="break-parent",vc=new Set([Go,Oi,Ii,Yo,Cr,Li,Pi,Ri,Xo,Zo,En,Qo,zi]);function d2(n){if(typeof n=="string")return Jo;if(Array.isArray(n))return Ko;if(!n)return;let{type:e}=n;if(vc.has(e))return e}var ea=d2,h2=n=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(n);function p2(n){let e=n===null?"null":typeof n;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;if(ea(n))throw new Error("doc is valid.");let t=Object.prototype.toString.call(n);if(t!=="[object Object]")return`Unexpected doc '${t}'.`;let r=h2([...vc].map(i=>`'${i}'`));return`Unexpected doc.type '${n.type}'.
Expected it to be ${r}.`}var f2=class extends Error{name="InvalidDocError";constructor(n){super(p2(n)),this.doc=n}},kc=f2,m2=()=>{},g2=m2;function Mr(n){return{type:Oi,contents:n}}function Sc(n,e){return{type:Ii,contents:e,n}}function Ke(n,e={}){return g2(e.expandedStates),{type:Cr,id:e.id,contents:n,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function D2(n){return Sc(Number.NEGATIVE_INFINITY,n)}function y2(n){return Sc({type:"root"},n)}function wc(n){return{type:Li,parts:n}}function mi(n,e="",t={}){return{type:Pi,breakContents:n,flatContents:e,groupId:t.groupId}}function b2(n,e){return{type:Ri,contents:n,groupId:e.groupId,negate:e.negate}}var _r={type:zi},C2={type:En,hard:!0},v2={type:En,hard:!0,literal:!0},Be={type:En},et={type:En,soft:!0},se=[C2,_r],k2=[v2,_r];function qi(n,e){let t=[];for(let r=0;r<e.length;r++)r!==0&&t.push(n),t.push(e[r]);return t}var S2=(n,e,t)=>{if(!(n&&e==null))return Array.isArray(e)||typeof e=="string"?e[t<0?e.length+t:t]:e.at(t)},ta=S2;function na(n,e){if(typeof n=="string")return e(n);let t=new Map;return r(n);function r(s){if(t.has(s))return t.get(s);let o=i(s);return t.set(s,o),o}function i(s){switch(ea(s)){case Ko:return e(s.map(r));case Li:return e({...s,parts:s.parts.map(r)});case Pi:return e({...s,breakContents:r(s.breakContents),flatContents:r(s.flatContents)});case Cr:{let{expandedStates:o,contents:a}=s;return o?(o=o.map(r),a=o[0]):a=r(a),e({...s,contents:a,expandedStates:o})}case Ii:case Oi:case Ri:case Qo:case Xo:return e({...s,contents:r(s.contents)});case Jo:case Go:case Yo:case Zo:case En:case zi:return e(s);default:throw new kc(s)}}}function w2(n){switch(ea(n)){case Li:if(n.parts.every(e=>e===""))return"";break;case Cr:if(!n.contents&&!n.id&&!n.break&&!n.expandedStates)return"";if(n.contents.type===Cr&&n.contents.id===n.id&&n.contents.break===n.break&&n.contents.expandedStates===n.expandedStates)return n.contents;break;case Ii:case Oi:case Ri:case Xo:if(!n.contents)return"";break;case Pi:if(!n.flatContents&&!n.breakContents)return"";break;case Ko:{let e=[];for(let t of n){if(!t)continue;let[r,...i]=Array.isArray(t)?t:[t];typeof r=="string"&&typeof ta(!1,e,-1)=="string"?e[e.length-1]+=r:e.push(r),e.push(...i)}return e.length===0?"":e.length===1?e[0]:e}case Jo:case Go:case Yo:case Zo:case En:case Qo:case zi:break;default:throw new kc(n)}return n}function E2(n){return na(n,e=>w2(e))}function rt(n,e=k2){return na(n,t=>typeof t=="string"?qi(e,t.split(`
`)):t)}var x2=class extends Error{name="UnexpectedNodeError";constructor(n,e,t="type"){super(`Unexpected ${e} node ${t}: ${JSON.stringify(n[t])}.`),this.node=n}},A2=x2,Zr="'",Ol='"';function F2(n,e){let t=e===!0||e===Zr?Zr:Ol,r=t===Zr?Ol:Zr,i=0,s=0;for(let o of n)o===t?i++:o===r&&s++;return i>s?r:t}var T2=F2;function M2(n){return n?.type==="front-matter"}var Hi=M2,_2=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens"]);function Ec(n,e){if(n.type==="text"||n.type==="comment"||Hi(n)||n.type==="yaml"||n.type==="toml")return null;n.type==="attribute"&&delete e.value,n.type==="docType"&&delete e.value}Ec.ignoredProperties=_2;var B2=Ec,N2=n=>n.split(/[/\\]/).pop();function Il(n,e){if(!e)return;let t=N2(e).toLowerCase();return n.find(r=>{var i,s;return((i=r.extensions)==null?void 0:i.some(o=>t.endsWith(o)))||((s=r.filenames)==null?void 0:s.some(o=>o.toLowerCase()===t))})}function O2(n,e){if(e)return n.find(({name:t})=>t.toLowerCase()===e)??n.find(({aliases:t})=>t?.includes(e))??n.find(({extensions:t})=>t?.includes(`.${e}`))}function I2(n,e){let t=n.plugins.flatMap(i=>i.languages??[]),r=O2(t,e.language)??Il(t,e.physicalFile)??Il(t,e.file)??(e.physicalFile,void 0);return r?.parsers[0]}var $i=I2,L2="inline",P2={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",source:"block",style:"none",template:"inline",track:"block",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",fieldset:"block",button:"inline-block",details:"block",summary:"block",dialog:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",select:"inline-block",option:"block",optgroup:"block",search:"block"},R2="normal",z2={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function q2(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Ze,H2=class{constructor(n){l2(this,Ze,void 0),u2(this,Ze,new Set(n))}getLeadingWhitespaceCount(n){let e=Nt(this,Ze),t=0;for(let r=0;r<n.length&&e.has(n.charAt(r));r++)t++;return t}getTrailingWhitespaceCount(n){let e=Nt(this,Ze),t=0;for(let r=n.length-1;r>=0&&e.has(n.charAt(r));r--)t++;return t}getLeadingWhitespace(n){let e=this.getLeadingWhitespaceCount(n);return n.slice(0,e)}getTrailingWhitespace(n){let e=this.getTrailingWhitespaceCount(n);return n.slice(n.length-e)}hasLeadingWhitespace(n){return Nt(this,Ze).has(n.charAt(0))}hasTrailingWhitespace(n){return Nt(this,Ze).has(ta(!1,n,-1))}trimStart(n){let e=this.getLeadingWhitespaceCount(n);return n.slice(e)}trimEnd(n){let e=this.getTrailingWhitespaceCount(n);return n.slice(0,n.length-e)}trim(n){return this.trimEnd(this.trimStart(n))}split(n,e=!1){let t=`[${q2([...Nt(this,Ze)].join(""))}]+`,r=new RegExp(e?`(${t})`:t);return n.split(r)}hasWhitespaceCharacter(n){let e=Nt(this,Ze);return Array.prototype.some.call(n,t=>e.has(t))}hasNonWhitespaceCharacter(n){let e=Nt(this,Ze);return Array.prototype.some.call(n,t=>!e.has(t))}isWhitespaceOnly(n){let e=Nt(this,Ze);return Array.prototype.every.call(n,t=>e.has(t))}};Ze=new WeakMap;var $2=H2,V2=[" ",`
`,"\f","\r"," "],j2=new $2(V2),yn=j2;function W2(n){return n.type==="element"&&!n.hasExplicitNamespace&&!["html","svg"].includes(n.namespace)}var vr=W2,U2=n=>Je(!1,n,/^[\t\f\r ]*\n/g,""),xc=n=>U2(yn.trimEnd(n)),J2=n=>{let e=n,t=yn.getLeadingWhitespace(e);t&&(e=e.slice(t.length));let r=yn.getTrailingWhitespace(e);return r&&(e=e.slice(0,-r.length)),{leadingWhitespace:t,trailingWhitespace:r,text:e}};function Ac(n,e){return!!(n.type==="ieConditionalComment"&&n.lastChild&&!n.lastChild.isSelfClosing&&!n.lastChild.endSourceSpan||n.type==="ieConditionalComment"&&!n.complete||$n(n)&&n.children.some(t=>t.type!=="text"&&t.type!=="interpolation")||sa(n,e)&&!At(n)&&n.type!=="interpolation")}function ra(n){return n.type==="attribute"||!n.parent||!n.prev?!1:K2(n.prev)}function K2(n){return n.type==="comment"&&n.value.trim()==="prettier-ignore"}function Ve(n){return n.type==="text"||n.type==="comment"}function At(n){return n.type==="element"&&(n.fullName==="script"||n.fullName==="style"||n.fullName==="svg:style"||n.fullName==="svg:script"||vr(n)&&(n.name==="script"||n.name==="style"))}function G2(n){return n.children&&!At(n)}function Y2(n){return At(n)||n.type==="interpolation"||Fc(n)}function Fc(n){return Ic(n).startsWith("pre")}function X2(n,e){var t,r;let i=s();if(i&&!n.prev&&(r=(t=n.parent)==null?void 0:t.tagDefinition)!=null&&r.ignoreFirstLf)return n.type==="interpolation";return i;function s(){return Hi(n)?!1:(n.type==="text"||n.type==="interpolation")&&n.prev&&(n.prev.type==="text"||n.prev.type==="interpolation")?!0:!n.parent||n.parent.cssDisplay==="none"?!1:$n(n.parent)?!0:!(!n.prev&&(n.parent.type==="root"||$n(n)&&n.parent||At(n.parent)||Vi(n.parent,e)||!o0(n.parent.cssDisplay))||n.prev&&!u0(n.prev.cssDisplay))}}function Z2(n,e){return Hi(n)?!1:(n.type==="text"||n.type==="interpolation")&&n.next&&(n.next.type==="text"||n.next.type==="interpolation")?!0:!n.parent||n.parent.cssDisplay==="none"?!1:$n(n.parent)?!0:!(!n.next&&(n.parent.type==="root"||$n(n)&&n.parent||At(n.parent)||Vi(n.parent,e)||!a0(n.parent.cssDisplay))||n.next&&!l0(n.next.cssDisplay))}function Q2(n){return c0(n.cssDisplay)&&!At(n)}function Qr(n){return Hi(n)||n.next&&n.sourceSpan.end&&n.sourceSpan.end.line+1<n.next.sourceSpan.start.line}function e0(n){return Tc(n)||n.type==="element"&&n.children.length>0&&(["body","script","style"].includes(n.name)||n.children.some(e=>n0(e)))||n.firstChild&&n.firstChild===n.lastChild&&n.firstChild.type!=="text"&&_c(n.firstChild)&&(!n.lastChild.isTrailingSpaceSensitive||Bc(n.lastChild))}function Tc(n){return n.type==="element"&&n.children.length>0&&(["html","head","ul","ol","select"].includes(n.name)||n.cssDisplay.startsWith("table")&&n.cssDisplay!=="table-cell")}function js(n){return Nc(n)||n.prev&&t0(n.prev)||Mc(n)}function t0(n){return Nc(n)||n.type==="element"&&n.fullName==="br"||Mc(n)}function Mc(n){return _c(n)&&Bc(n)}function _c(n){return n.hasLeadingSpaces&&(n.prev?n.prev.sourceSpan.end.line<n.sourceSpan.start.line:n.parent.type==="root"||n.parent.startSourceSpan.end.line<n.sourceSpan.start.line)}function Bc(n){return n.hasTrailingSpaces&&(n.next?n.next.sourceSpan.start.line>n.sourceSpan.end.line:n.parent.type==="root"||n.parent.endSourceSpan&&n.parent.endSourceSpan.start.line>n.sourceSpan.end.line)}function Nc(n){switch(n.type){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return["script","select"].includes(n.name)}return!1}function ia(n){return n.lastChild?ia(n.lastChild):n}function n0(n){var e;return(e=n.children)==null?void 0:e.some(t=>t.type!=="text")}function Oc(n){if(n)switch(n){case"module":case"text/javascript":case"text/babel":case"application/javascript":return"babel";case"application/x-typescript":return"typescript";case"text/markdown":return"markdown";case"text/html":return"html";case"text/x-handlebars-template":return"glimmer";default:if(n.endsWith("json")||n.endsWith("importmap")||n==="speculationrules")return"json"}}function r0(n,e){let{name:t,attrMap:r}=n;if(t!=="script"||Object.prototype.hasOwnProperty.call(r,"src"))return;let{type:i,lang:s}=n.attrMap;return!s&&!i?"babel":$i(e,{language:s})??Oc(i)}function i0(n,e){if(!sa(n,e))return;let{attrMap:t}=n;if(Object.prototype.hasOwnProperty.call(t,"src"))return;let{type:r,lang:i}=t;return $i(e,{language:i})??Oc(r)}function s0(n,e){if(n.name!=="style")return;let{lang:t}=n.attrMap;return t?$i(e,{language:t}):"css"}function Ll(n,e){return r0(n,e)??s0(n,e)??i0(n,e)}function Br(n){return n==="block"||n==="list-item"||n.startsWith("table")}function o0(n){return!Br(n)&&n!=="inline-block"}function a0(n){return!Br(n)&&n!=="inline-block"}function l0(n){return!Br(n)}function u0(n){return!Br(n)}function c0(n){return!Br(n)&&n!=="inline-block"}function $n(n){return Ic(n).startsWith("pre")}function d0(n,e){let t=n;for(;t;){if(e(t))return!0;t=t.parent}return!1}function h0(n,e){var t;if(Xn(n,e))return"block";if(((t=n.prev)==null?void 0:t.type)==="comment"){let i=n.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/);if(i)return i[1]}let r=!1;if(n.type==="element"&&n.namespace==="svg")if(d0(n,i=>i.fullName==="svg:foreignObject"))r=!0;else return n.name==="svg"?"inline-block":"block";switch(e.htmlWhitespaceSensitivity){case"strict":return"inline";case"ignore":return"block";default:return n.type==="element"&&(!n.namespace||r||vr(n))&&P2[n.name]||L2}}function Ic(n){return n.type==="element"&&(!n.namespace||vr(n))&&z2[n.name]||R2}function p0(n){let e=Number.POSITIVE_INFINITY;for(let t of n.split(`
`)){if(t.length===0)continue;let r=yn.getLeadingWhitespaceCount(t);if(r===0)return 0;t.length!==r&&r<e&&(e=r)}return e===Number.POSITIVE_INFINITY?0:e}function Lc(n,e=p0(n)){return e===0?n:n.split(`
`).map(t=>t.slice(e)).join(`
`)}function Pc(n){return Je(!1,Je(!1,n,"&apos;","'"),"&quot;",'"')}function xn(n){return Pc(n.value)}var f0=new Set(["template","style","script"]);function Vi(n,e){return Xn(n,e)&&!f0.has(n.fullName)}function Xn(n,e){return e.parser==="vue"&&n.type==="element"&&n.parent.type==="root"&&n.fullName.toLowerCase()!=="html"}function sa(n,e){return Xn(n,e)&&(Vi(n,e)||n.attrMap.lang&&n.attrMap.lang!=="html")}function m0(n){let e=n.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function g0(n,e){let t=n.parent;if(!Xn(t,e))return!1;let r=t.fullName,i=n.fullName;return r==="script"&&i==="setup"||r==="style"&&i==="vars"}function Rc(n,e=n.value){return n.parent.isWhitespaceSensitive?n.parent.isIndentationSensitive?rt(e):rt(Lc(xc(e)),se):qi(Be,yn.split(e))}function D0(n,e){return Xn(n,e)&&n.name==="script"}function zc(n){return n>=9&&n<=32||n==160}function y0(n){return 48<=n&&n<=57}function qc(n){return n>=97&&n<=122||n>=65&&n<=90}function b0(n){return n>=97&&n<=102||n>=65&&n<=70||y0(n)}function Hc(n){return n===10||n===13}function Pl(n){return 48<=n&&n<=55}function C0(n){return n===39||n===34||n===96}var v0=/-+([a-z0-9])/g;function k0(n){return n.replace(v0,(...e)=>e[1].toUpperCase())}var ko=class $c{constructor(e,t,r,i){this.file=e,this.offset=t,this.line=r,this.col=i}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let t=this.file.content,r=t.length,i=this.offset,s=this.line,o=this.col;for(;i>0&&e<0;)if(i--,e++,t.charCodeAt(i)==10){s--;let a=t.substring(0,i-1).lastIndexOf(String.fromCharCode(10));o=a>0?i-a:i}else o--;for(;i<r&&e>0;){let a=t.charCodeAt(i);i++,e--,a==10?(s++,o=0):o++}return new $c(this.file,i,s,o)}getContext(e,t){let r=this.file.content,i=this.offset;if(i!=null){i>r.length-1&&(i=r.length-1);let s=i,o=0,a=0;for(;o<e&&i>0&&(i--,o++,!(r[i]==`
`&&++a==t)););for(o=0,a=0;o<e&&s<r.length-1&&(s++,o++,!(r[s]==`
`&&++a==t)););return{before:r.substring(i,this.offset),after:r.substring(this.offset,s+1)}}return null}},Vc=class{constructor(n,e){this.content=n,this.url=e}},ee=class{constructor(n,e,t=n,r=null){this.start=n,this.end=e,this.fullStart=t,this.details=r}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},gi;(function(n){n[n.WARNING=0]="WARNING",n[n.ERROR=1]="ERROR"})(gi||(gi={}));var jc=class{constructor(n,e,t=gi.ERROR){this.span=n,this.msg=e,this.level=t}contextualMessage(){let n=this.span.start.getContext(100,3);return n?`${this.msg} ("${n.before}[${gi[this.level]} ->]${n.after}")`:this.msg}toString(){let n=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${n}`}},S0=[E0,x0,F0,M0,_0,O0,B0,N0,I0,T0];function w0(n,e){for(let t of S0)t(n,e);return n}function E0(n){n.walk(e=>{if(e.type==="element"&&e.tagDefinition.ignoreFirstLf&&e.children.length>0&&e.children[0].type==="text"&&e.children[0].value[0]===`
`){let t=e.children[0];t.value.length===1?e.removeChild(t):t.value=t.value.slice(1)}})}function x0(n){let e=t=>{var r,i;return t.type==="element"&&((r=t.prev)==null?void 0:r.type)==="ieConditionalStartComment"&&t.prev.sourceSpan.end.offset===t.startSourceSpan.start.offset&&((i=t.firstChild)==null?void 0:i.type)==="ieConditionalEndComment"&&t.firstChild.sourceSpan.start.offset===t.startSourceSpan.end.offset};n.walk(t=>{if(t.children)for(let r=0;r<t.children.length;r++){let i=t.children[r];if(!e(i))continue;let s=i.prev,o=i.firstChild;t.removeChild(s),r--;let a=new ee(s.sourceSpan.start,o.sourceSpan.end),l=new ee(a.start,i.sourceSpan.end);i.condition=s.condition,i.sourceSpan=l,i.startSourceSpan=a,i.removeChild(o)}})}function A0(n,e,t){n.walk(r=>{if(r.children)for(let i=0;i<r.children.length;i++){let s=r.children[i];if(s.type!=="text"&&!e(s))continue;s.type!=="text"&&(s.type="text",s.value=t(s));let o=s.prev;!o||o.type!=="text"||(o.value+=s.value,o.sourceSpan=new ee(o.sourceSpan.start,s.sourceSpan.end),r.removeChild(s),i--)}})}function F0(n){return A0(n,e=>e.type==="cdata",e=>`<![CDATA[${e.value}]]>`)}function T0(n){let e=t=>{var r,i;return t.type==="element"&&t.attrs.length===0&&t.children.length===1&&t.firstChild.type==="text"&&!yn.hasWhitespaceCharacter(t.children[0].value)&&!t.firstChild.hasLeadingSpaces&&!t.firstChild.hasTrailingSpaces&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces&&((r=t.prev)==null?void 0:r.type)==="text"&&((i=t.next)==null?void 0:i.type)==="text"};n.walk(t=>{if(t.children)for(let r=0;r<t.children.length;r++){let i=t.children[r];if(!e(i))continue;let s=i.prev,o=i.next;s.value+=`<${i.rawName}>`+i.firstChild.value+`</${i.rawName}>`+o.value,s.sourceSpan=new ee(s.sourceSpan.start,o.sourceSpan.end),s.isTrailingSpaceSensitive=o.isTrailingSpaceSensitive,s.hasTrailingSpaces=o.hasTrailingSpaces,t.removeChild(i),r--,t.removeChild(o)}})}function M0(n,e){if(e.parser==="html")return;let t=/{{(.+?)}}/s;n.walk(r=>{if(G2(r))for(let i of r.children){if(i.type!=="text")continue;let s=i.sourceSpan.start,o=null,a=i.value.split(t);for(let l=0;l<a.length;l++,s=o){let d=a[l];if(l%2===0){o=s.moveBy(d.length),d.length>0&&r.insertChildBefore(i,{type:"text",value:d,sourceSpan:new ee(s,o)});continue}o=s.moveBy(d.length+4),r.insertChildBefore(i,{type:"interpolation",sourceSpan:new ee(s,o),children:d.length===0?[]:[{type:"text",value:d,sourceSpan:new ee(s.moveBy(2),o.moveBy(-2))}]})}r.removeChild(i)}})}function _0(n){n.walk(e=>{if(!e.children)return;if(e.children.length===0||e.children.length===1&&e.children[0].type==="text"&&yn.trim(e.children[0].value).length===0){e.hasDanglingSpaces=e.children.length>0,e.children=[];return}let t=Y2(e),r=Fc(e);if(!t)for(let i=0;i<e.children.length;i++){let s=e.children[i];if(s.type!=="text")continue;let{leadingWhitespace:o,text:a,trailingWhitespace:l}=J2(s.value),d=s.prev,h=s.next;a?(s.value=a,s.sourceSpan=new ee(s.sourceSpan.start.moveBy(o.length),s.sourceSpan.end.moveBy(-l.length)),o&&(d&&(d.hasTrailingSpaces=!0),s.hasLeadingSpaces=!0),l&&(s.hasTrailingSpaces=!0,h&&(h.hasLeadingSpaces=!0))):(e.removeChild(s),i--,(o||l)&&(d&&(d.hasTrailingSpaces=!0),h&&(h.hasLeadingSpaces=!0)))}e.isWhitespaceSensitive=t,e.isIndentationSensitive=r})}function B0(n){n.walk(e=>{e.isSelfClosing=!e.children||e.type==="element"&&(e.tagDefinition.isVoid||e.endSourceSpan&&e.startSourceSpan.start===e.endSourceSpan.start&&e.startSourceSpan.end===e.endSourceSpan.end)})}function N0(n,e){n.walk(t=>{t.type==="element"&&(t.hasHtmComponentClosingTag=t.endSourceSpan&&/^<\s*\/\s*\/\s*>$/.test(e.originalText.slice(t.endSourceSpan.start.offset,t.endSourceSpan.end.offset)))})}function O0(n,e){n.walk(t=>{t.cssDisplay=h0(t,e)})}function I0(n,e){n.walk(t=>{let{children:r}=t;if(r){if(r.length===0){t.isDanglingSpaceSensitive=Q2(t);return}for(let i of r)i.isLeadingSpaceSensitive=X2(i,e),i.isTrailingSpaceSensitive=Z2(i,e);for(let i=0;i<r.length;i++){let s=r[i];s.isLeadingSpaceSensitive=(i===0||s.prev.isTrailingSpaceSensitive)&&s.isLeadingSpaceSensitive,s.isTrailingSpaceSensitive=(i===r.length-1||s.next.isLeadingSpaceSensitive)&&s.isTrailingSpaceSensitive}}})}var L0=w0;function P0(n){return/^\s*<!--\s*@(?:format|prettier)\s*-->/.test(n)}function R0(n){return`<!-- @format -->
`+n}function ji(n){return n.sourceSpan.start.offset}function Wi(n){return n.sourceSpan.end.offset}async function z0(n,e){if(n.lang==="yaml"){let t=n.value.trim(),r=t?await e(t,{parser:"yaml"}):"";return y2([n.startDelimiter,se,r,r?se:"",n.endDelimiter])}}var q0=z0,kr=()=>{};kr.ok=kr;kr.strictEqual=kr;var Wc=kr;function H0(n){return Array.isArray(n)&&n.length>0}var $0=H0;function So(n,e){return[n.isSelfClosing?"":V0(n,e),ai(n,e)]}function V0(n,e){return n.lastChild&&Sr(n.lastChild)?"":[j0(n,e),oa(n,e)]}function ai(n,e){return(n.next?Cn(n.next):Or(n.parent))?"":[Nr(n,e),bn(n,e)]}function j0(n,e){return Or(n)?Nr(n.lastChild,e):""}function bn(n,e){return Sr(n)?oa(n.parent,e):Ui(n)?aa(n.next):""}function oa(n,e){if(Wc(!n.isSelfClosing),Uc(n,e))return"";switch(n.type){case"ieConditionalComment":return"<!";case"element":if(n.hasHtmComponentClosingTag)return"<//";default:return`</${n.rawName}`}}function Nr(n,e){if(Uc(n,e))return"";switch(n.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"element":if(n.isSelfClosing)return"/>";default:return">"}}function Uc(n,e){return!n.isSelfClosing&&!n.endSourceSpan&&(ra(n)||Ac(n.parent,e))}function Cn(n){return n.prev&&n.prev.type!=="docType"&&!Ve(n.prev)&&n.isLeadingSpaceSensitive&&!n.hasLeadingSpaces}function Or(n){var e;return((e=n.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!n.lastChild.hasTrailingSpaces&&!Ve(ia(n.lastChild))&&!$n(n)}function Sr(n){return!n.next&&!n.hasTrailingSpaces&&n.isTrailingSpaceSensitive&&Ve(ia(n))}function Ui(n){return n.next&&!Ve(n.next)&&Ve(n)&&n.isTrailingSpaceSensitive&&!n.hasTrailingSpaces}function W0(n){let e=n.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/s);return e?e[1]?e[1].split(/\s+/):!0:!1}function Ji(n){return!n.prev&&n.isLeadingSpaceSensitive&&!n.hasLeadingSpaces}function U0(n,e,t){var r;let{node:i}=n;if(!$0(i.attrs))return i.isSelfClosing?" ":"";let s=((r=i.prev)==null?void 0:r.type)==="comment"&&W0(i.prev.value),o=typeof s=="boolean"?()=>s:Array.isArray(s)?D=>s.includes(D.rawName):()=>!1,a=n.map(({node:D})=>o(D)?rt(e.originalText.slice(ji(D),Wi(D))):t(),"attrs"),l=i.type==="element"&&i.fullName==="script"&&i.attrs.length===1&&i.attrs[0].fullName==="src"&&i.children.length===0,d=e.singleAttributePerLine&&i.attrs.length>1&&!Xn(i,e)?se:Be,h=[Mr([l?" ":Be,qi(d,a)])];return i.firstChild&&Ji(i.firstChild)||i.isSelfClosing&&Or(i.parent)||l?h.push(i.isSelfClosing?" ":""):h.push(e.bracketSameLine?i.isSelfClosing?" ":"":i.isSelfClosing?Be:et),h}function J0(n){return n.firstChild&&Ji(n.firstChild)?"":la(n)}function wo(n,e,t){let{node:r}=n;return[li(r,e),U0(n,e,t),r.isSelfClosing?"":J0(r)]}function li(n,e){return n.prev&&Ui(n.prev)?"":[vn(n,e),aa(n)]}function vn(n,e){return Ji(n)?la(n.parent):Cn(n)?Nr(n.prev,e):""}function aa(n){switch(n.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${n.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":return n.value==="html"?"<!doctype":"<!DOCTYPE";case"element":if(n.condition)return`<!--[if ${n.condition}]><!--><${n.rawName}`;default:return`<${n.rawName}`}}function la(n){switch(Wc(!n.isSelfClosing),n.type){case"ieConditionalComment":return"]>";case"element":if(n.condition)return"><!--<![endif]-->";default:return">"}}var Ws=new WeakMap;function K0(n,e){let{root:t}=n;return Ws.has(t)||Ws.set(t,t.children.some(r=>D0(r,e)&&["ts","typescript"].includes(r.attrMap.lang))),Ws.get(t)}var ua=K0;function G0(n,e){if(!n.endSourceSpan)return"";let t=n.startSourceSpan.end.offset;n.firstChild&&Ji(n.firstChild)&&(t-=la(n).length);let r=n.endSourceSpan.start.offset;return n.lastChild&&Sr(n.lastChild)?r+=oa(n,e).length:Or(n)&&(r-=Nr(n.lastChild,e).length),e.originalText.slice(t,r)}var Jc=G0;function Rl(n){return n===" "||n===`
`||n==="\f"||n==="\r"||n===" "}var Y0=/^[ \t\n\r\u000c]+/,X0=/^[, \t\n\r\u000c]+/,Z0=/^[^ \t\n\r\u000c]+/,Q0=/[,]+$/,zl=/^\d+$/,eD=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function tD(n){let e=n.length,t,r,i,s,o,a=0,l;function d(b){let v,x=b.exec(n.substring(a));if(x)return[v]=x,a+=v.length,v}let h=[];for(;;){if(d(X0),a>=e){if(h.length===0)throw new Error("Must contain one or more image candidate strings.");return h}l=a,t=d(Z0),r=[],t.slice(-1)===","?(t=t.replace(Q0,""),y()):D()}function D(){for(d(Y0),i="",s="in descriptor";;){if(o=n.charAt(a),s==="in descriptor")if(Rl(o))i&&(r.push(i),i="",s="after descriptor");else if(o===","){a+=1,i&&r.push(i),y();return}else if(o==="(")i+=o,s="in parens";else if(o===""){i&&r.push(i),y();return}else i+=o;else if(s==="in parens")if(o===")")i+=o,s="in descriptor";else if(o===""){r.push(i),y();return}else i+=o;else if(s==="after descriptor"&&!Rl(o))if(o===""){y();return}else s="in descriptor",a-=1;a+=1}}function y(){let b=!1,v,x,M,N,_={},P,W,H,X,re;for(N=0;N<r.length;N++)P=r[N],W=P[P.length-1],H=P.substring(0,P.length-1),X=parseInt(H,10),re=parseFloat(H),zl.test(H)&&W==="w"?((v||x)&&(b=!0),X===0?b=!0:v=X):eD.test(H)&&W==="x"?((v||x||M)&&(b=!0),re<0?b=!0:x=re):zl.test(H)&&W==="h"?((M||x)&&(b=!0),X===0?b=!0:M=X):b=!0;if(!b)_.source={value:t,startOffset:l},v&&(_.width={value:v}),x&&(_.density={value:x}),M&&(_.height={value:M}),h.push(_);else throw new Error(`Invalid srcset descriptor found in "${n}" at "${P}".`)}}var nD=tD;function Ki(n,e=!0){return[Mr([et,n]),e?et:""]}function Gi(n,e){let t=n.type==="NGRoot"?n.node.type==="NGMicrosyntax"&&n.node.body.length===1&&n.node.body[0].type==="NGMicrosyntaxExpression"?n.node.body[0].expression:n.node:n.type==="JsExpressionRoot"?n.node:n;return t&&(t.type==="ObjectExpression"||t.type==="ArrayExpression"||(e.parser==="__vue_expression"||e.parser==="__vue_ts_expression")&&(t.type==="TemplateLiteral"||t.type==="StringLiteral"))}async function Wt(n,e,t,r){t={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...t};let i=!0;r&&(t.__onHtmlBindingRoot=(o,a)=>{i=r(o,a)});let s=await e(n,t,e);return i?Ke(s):Ki(s)}function rD(n){if(n.node.fullName==="srcset"&&(n.parent.fullName==="img"||n.parent.fullName==="source"))return()=>iD(xn(n.node))}function iD(n){let e=nD(n),t=e.some(({width:y})=>y),r=e.some(({height:y})=>y),i=e.some(({density:y})=>y);if(t+r+i>1)throw new Error("Mixed descriptor in srcset is not supported");let s=t?"width":r?"height":"density",o=t?"w":r?"h":"x",a=e.map(y=>y.source.value),l=Math.max(...a.map(y=>y.length)),d=e.map(y=>y[s]?String(y[s].value):""),h=d.map(y=>{let b=y.indexOf(".");return b===-1?y.length:b}),D=Math.max(...h);return Ki(qi([",",Be],a.map((y,b)=>{let v=[y],x=d[b];if(x){let M=l-y.length+1,N=D-h[b],_=" ".repeat(M+N);v.push(mi(_," "),x+o)}return v})))}var sD=rD;function oD(n,e){let{node:t}=n,r=xn(t);if(t.fullName==="class"&&!e.parentParser&&!r.includes("{{"))return()=>r.trim().split(/\s+/).join(" ")}var aD=oD;function lD(n,e){let{node:t}=n,r=xn(n.node).trim();if(t.fullName==="style"&&!e.parentParser&&!r.includes("{{"))return async i=>Ki(await i(r,{parser:"css",__isHTMLStyleAttribute:!0}))}async function uD(n,e,t,r){let i=xn(t.node),{left:s,operator:o,right:a}=cD(i),l=ua(t,r);return[Ke(await Wt(`function _(${s}) {}`,n,{parser:l?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",o," ",await Wt(a,n,{parser:l?"__ts_expression":"__js_expression"})]}function cD(n){let e=/(.*?)\s+(in|of)\s+(.*)/s,t=/,([^,\]}]*)(?:,([^,\]}]*))?$/,r=/^\(|\)$/g,i=n.match(e);if(!i)return;let s={};if(s.for=i[3].trim(),!s.for)return;let o=Je(!1,i[1].trim(),r,""),a=o.match(t);a?(s.alias=o.replace(t,""),s.iterator1=a[1].trim(),a[2]&&(s.iterator2=a[2].trim())):s.alias=o;let l=[s.alias,s.iterator1,s.iterator2];if(!l.some((d,h)=>!d&&(h===0||l.slice(h+1).some(Boolean))))return{left:l.filter(Boolean).join(","),operator:i[2],right:s.for}}function dD(n,e,{parseWithTs:t}){return Wt(`function _(${n}) {}`,e,{parser:t?"babel-ts":"babel",__isVueBindings:!0})}function hD(n){let e=/^(?:[\w$]+|\([^)]*\))\s*=>|^function\s*\(/,t=/^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*']|\["[^"]*"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/,r=n.trim();return e.test(r)||t.test(r)}function pD(n,e){if(e.parser!=="vue")return;let{node:t}=n,r=t.fullName;if(r==="v-for")return uD;let i=xn(t),s=ua(n,e);if(m0(t)||g0(t,e))return o=>dD(i,o,{parseWithTs:s});if(r.startsWith("@")||r.startsWith("v-on:"))return o=>fD(i,o,{parseWithTs:s});if(r.startsWith(":")||r.startsWith("v-bind:"))return o=>mD(i,o,{parseWithTs:s});if(r.startsWith("v-"))return o=>Kc(i,o,{parseWithTs:s})}function fD(n,e,{parseWithTs:t}){return hD(n)?Kc(n,e,{parseWithTs:t}):Wt(n,e,{parser:t?"__vue_ts_event_binding":"__vue_event_binding"},Gi)}function mD(n,e,{parseWithTs:t}){return Wt(n,e,{parser:t?"__vue_ts_expression":"__vue_expression"},Gi)}function Kc(n,e,{parseWithTs:t}){return Wt(n,e,{parser:t?"__ts_expression":"__js_expression"},Gi)}var gD=pD,Gc=/{{(.+?)}}/s;async function DD(n,e){let t=[];for(let[r,i]of n.split(Gc).entries())if(r%2===0)t.push(rt(i));else try{t.push(Ke(["{{",Mr([Be,await Wt(i,e,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0,trailingComma:"none"})]),Be,"}}"]))}catch{t.push("{{",rt(i),"}}")}return t}function ca({parser:n}){return(e,t,r)=>Wt(xn(r.node),e,{parser:n,trailingComma:"none"},Gi)}var yD=ca({parser:"__ng_action"}),bD=ca({parser:"__ng_binding"}),CD=ca({parser:"__ng_directive"});function vD(n,e){if(e.parser!=="angular")return;let{node:t}=n,r=t.fullName;if(r.startsWith("(")&&r.endsWith(")")||r.startsWith("on-"))return yD;if(r.startsWith("[")&&r.endsWith("]")||/^bind(?:on)?-/.test(r)||/^ng-(?:if|show|hide|class|style)$/.test(r))return bD;if(r.startsWith("*"))return CD;let i=xn(t);if(/^i18n(?:-.+)?$/.test(r))return()=>Ki(wc(Rc(t,i.trim())),!i.includes("@@"));if(Gc.test(i))return s=>DD(i,s)}var kD=vD;function SD(n,e){let{node:t}=n;if(t.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/.test(e.originalText.slice(t.valueSpan.start.offset,t.valueSpan.end.offset))||e.parser==="lwc"&&t.value.startsWith("{")&&t.value.endsWith("}"))return[t.rawName,"=",t.value];for(let r of[sD,lD,aD,gD,kD]){let i=r(n,e);if(i)return wD(i)}}}function wD(n){return async(e,t,r,i)=>{let s=await n(e,t,r,i);if(s)return s=na(s,o=>typeof o=="string"?Je(!1,o,'"',"&quot;"):o),[r.node.rawName,'="',Ke(s),'"']}}var ED=SD;function xD(n,e){let{node:t}=n;switch(t.type){case"element":if(At(t)||t.type==="interpolation")return;if(!t.isSelfClosing&&sa(t,e)){let r=Ll(t,e);return r?async(i,s)=>{let o=Jc(t,e),a=/^\s*$/.test(o),l="";return a||(l=await i(xc(o),{parser:r,__embeddedInHtml:!0}),a=l===""),[vn(t,e),Ke(wo(n,e,s)),a?"":se,l,a?"":se,So(t,e),bn(t,e)]}:void 0}break;case"text":if(At(t.parent)){let r=Ll(t.parent,e);if(r)return async i=>{let s=r==="markdown"?Lc(t.value.replace(/^[^\S\n]*\n/,"")):t.value,o={parser:r,__embeddedInHtml:!0};if(e.parser==="html"&&r==="babel"){let a="script",{attrMap:l}=t.parent;l&&(l.type==="module"||l.type==="text/babel"&&l["data-type"]==="module")&&(a="module"),o.__babelSourceType=a}return[_r,vn(t,e),await i(s,o,{stripTrailingHardline:!0}),bn(t,e)]}}else if(t.parent.type==="interpolation")return async r=>{let i={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return e.parser==="angular"?(i.parser="__ng_interpolation",i.trailingComma="none"):e.parser==="vue"?i.parser=ua(n,e)?"__vue_ts_expression":"__vue_expression":i.parser="__js_expression",[Mr([Be,await r(t.value,i)]),t.parent.next&&Cn(t.parent.next)?" ":Be]};break;case"attribute":return ED(n,e);case"front-matter":return r=>q0(t,r)}}var AD=xD;function or(n,e,t){let r=n.node;return ra(r)?[vn(r,e),rt(e.originalText.slice(ji(r)+(r.prev&&Ui(r.prev)?aa(r).length:0),Wi(r)-(r.next&&Cn(r.next)?Nr(r,e).length:0))),bn(r,e)]:t()}function ei(n,e){return Ve(n)&&Ve(e)?n.isTrailingSpaceSensitive?n.hasTrailingSpaces?js(e)?se:Be:"":js(e)?se:et:Ui(n)&&(ra(e)||e.firstChild||e.isSelfClosing||e.type==="element"&&e.attrs.length>0)||n.type==="element"&&n.isSelfClosing&&Cn(e)?"":!e.isLeadingSpaceSensitive||js(e)||Cn(e)&&n.lastChild&&Sr(n.lastChild)&&n.lastChild.lastChild&&Sr(n.lastChild.lastChild)?se:e.hasLeadingSpaces?Be:et}function Yc(n,e,t){let{node:r}=n;if(Tc(r))return[_r,...n.map(s=>{let o=s.node,a=o.prev?ei(o.prev,o):"";return[a?[a,Qr(o.prev)?se:""]:"",or(s,e,t)]},"children")];let i=r.children.map(()=>Symbol(""));return n.map((s,o)=>{let a=s.node;if(Ve(a)){if(a.prev&&Ve(a.prev)){let v=ei(a.prev,a);if(v)return Qr(a.prev)?[se,se,or(s,e,t)]:[v,or(s,e,t)]}return or(s,e,t)}let l=[],d=[],h=[],D=[],y=a.prev?ei(a.prev,a):"",b=a.next?ei(a,a.next):"";return y&&(Qr(a.prev)?l.push(se,se):y===se?l.push(se):Ve(a.prev)?d.push(y):d.push(mi("",et,{groupId:i[o-1]}))),b&&(Qr(a)?Ve(a.next)&&D.push(se,se):b===se?Ve(a.next)&&D.push(se):h.push(b)),[...l,Ke([...d,Ke([or(s,e,t),...h],{id:i[o]})]),...D]},"children")}function FD(n,e,t){let{node:r}=n;if(Ac(r,e))return[vn(r,e),Ke(wo(n,e,t)),rt(Jc(r,e)),...So(r,e),bn(r,e)];let i=r.children.length===1&&r.firstChild.type==="interpolation"&&r.firstChild.isLeadingSpaceSensitive&&!r.firstChild.hasLeadingSpaces&&r.lastChild.isTrailingSpaceSensitive&&!r.lastChild.hasTrailingSpaces,s=Symbol("element-attr-group-id"),o=h=>Ke([Ke(wo(n,e,t),{id:s}),h,So(r,e)]),a=h=>i?b2(h,{groupId:s}):(At(r)||Vi(r,e))&&r.parent.type==="root"&&e.parser==="vue"&&!e.vueIndentScriptAndStyle?h:Mr(h),l=()=>i?mi(et,"",{groupId:s}):r.firstChild.hasLeadingSpaces&&r.firstChild.isLeadingSpaceSensitive?Be:r.firstChild.type==="text"&&r.isWhitespaceSensitive&&r.isIndentationSensitive?D2(et):et,d=()=>(r.next?Cn(r.next):Or(r.parent))?r.lastChild.hasTrailingSpaces&&r.lastChild.isTrailingSpaceSensitive?" ":"":i?mi(et,"",{groupId:s}):r.lastChild.hasTrailingSpaces&&r.lastChild.isTrailingSpaceSensitive?Be:(r.lastChild.type==="comment"||r.lastChild.type==="text"&&r.isWhitespaceSensitive&&r.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${e.tabWidth*(n.ancestors.length-1)}}$`).test(r.lastChild.value)?"":et;return r.children.length===0?o(r.hasDanglingSpaces&&r.isDanglingSpaceSensitive?Be:""):o([e0(r)?_r:"",a([l(),Yc(n,e,t)]),d()])}var ar=null;function mr(n){if(ar!==null&&typeof ar.property){let e=ar;return ar=mr.prototype=null,e}return ar=mr.prototype=n??Object.create(null),new mr}var TD=10;for(let n=0;n<=TD;n++)mr();function MD(n){return mr(n)}function _D(n,e="type"){MD(n);function t(r){let i=r[e],s=n[i];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:r});return s}return t}var BD=_D,ND={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[]},OD=ND,ID=BD(OD),LD=ID;function PD(n,e,t){let{node:r}=n;switch(r.type){case"front-matter":return rt(r.raw);case"root":return e.__onHtmlRoot&&e.__onHtmlRoot(r),[Ke(Yc(n,e,t)),se];case"element":case"ieConditionalComment":return FD(n,e,t);case"ieConditionalStartComment":case"ieConditionalEndComment":return[li(r),ai(r)];case"interpolation":return[li(r,e),...n.map(t,"children"),ai(r,e)];case"text":{if(r.parent.type==="interpolation"){let s=/\n[^\S\n]*$/,o=s.test(r.value),a=o?r.value.replace(s,""):r.value;return[rt(a),o?se:""]}let i=E2([vn(r,e),...Rc(r),bn(r,e)]);return Array.isArray(i)?wc(i):i}case"docType":return[Ke([li(r,e)," ",Je(!1,r.value.replace(/^html\b/i,"html"),/\s+/g," ")]),ai(r,e)];case"comment":return[vn(r,e),rt(e.originalText.slice(ji(r),Wi(r))),bn(r,e)];case"attribute":{if(r.value===null)return r.rawName;let i=Pc(r.value),s=T2(i,'"');return[r.rawName,"=",s,rt(s==='"'?Je(!1,i,'"',"&quot;"):Je(!1,i,"'","&apos;")),s]}case"cdata":default:throw new A2(r,"HTML")}}var RD={preprocess:L0,print:PD,insertPragma:R0,massageAstNode:B2,embed:AD,getVisitorKeys:LD},zD=RD,Xc={};yc(Xc,{angular:()=>qy,html:()=>zy,lwc:()=>$y,vue:()=>Hy});var ql;(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom"})(ql||(ql={}));var Hl;(function(n){n[n.OnPush=0]="OnPush",n[n.Default=1]="Default"})(Hl||(Hl={}));var $l={name:"custom-elements"},Vl={name:"no-errors-schema"},ln;(function(n){n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL"})(ln||(ln={}));var jl;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Ignore=2]="Ignore"})(jl||(jl={}));var tt;(function(n){n[n.RAW_TEXT=0]="RAW_TEXT",n[n.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",n[n.PARSABLE_DATA=2]="PARSABLE_DATA"})(tt||(tt={}));function Yi(n){if(n[0]!=":")return[null,n];let e=n.indexOf(":",1);if(e===-1)throw new Error(`Unsupported format "${n}" expecting ":namespace:name"`);return[n.slice(1,e),n.slice(e+1)]}function Wl(n){return Yi(n)[1]==="ng-container"}function Ul(n){return Yi(n)[1]==="ng-content"}function ui(n){return n===null?null:Yi(n)[0]}function Di(n,e){return n?`:${n}:${e}`:e}var ci;function Jl(){return ci||(ci={},ti(ln.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),ti(ln.STYLE,["*|style"]),ti(ln.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]),ti(ln.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])),ci}function ti(n,e){for(let t of e)ci[t.toLowerCase()]=n}var qD=class{},HD="boolean",$D="number",VD="string",jD="object",WD=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|"],Zc=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),UD=Array.from(Zc).reduce((n,[e,t])=>(n.set(e,t),n),new Map),JD=class extends qD{constructor(){super(),this._schema=new Map,this._eventSchema=new Map,WD.forEach(n=>{let e=new Map,t=new Set,[r,i]=n.split("|"),s=i.split(","),[o,a]=r.split("^");o.split(",").forEach(d=>{this._schema.set(d.toLowerCase(),e),this._eventSchema.set(d.toLowerCase(),t)});let l=a&&this._schema.get(a.toLowerCase());if(l){for(let[d,h]of l)e.set(d,h);for(let d of this._eventSchema.get(a.toLowerCase()))t.add(d)}s.forEach(d=>{if(d.length>0)switch(d[0]){case"*":t.add(d.substring(1));break;case"!":e.set(d.substring(1),HD);break;case"#":e.set(d.substring(1),$D);break;case"%":e.set(d.substring(1),jD);break;default:e.set(d,VD)}})})}hasProperty(n,e,t){if(t.some(r=>r.name===Vl.name))return!0;if(n.indexOf("-")>-1){if(Wl(n)||Ul(n))return!1;if(t.some(r=>r.name===$l.name))return!0}return(this._schema.get(n.toLowerCase())||this._schema.get("unknown")).has(e)}hasElement(n,e){return e.some(t=>t.name===Vl.name)||n.indexOf("-")>-1&&(Wl(n)||Ul(n)||e.some(t=>t.name===$l.name))?!0:this._schema.has(n.toLowerCase())}securityContext(n,e,t){t&&(e=this.getMappedPropName(e)),n=n.toLowerCase(),e=e.toLowerCase();let r=Jl()[n+"|"+e];return r||(r=Jl()["*|"+e],r||ln.NONE)}getMappedPropName(n){return Zc.get(n)??n}getDefaultComponentElementName(){return"ng-component"}validateProperty(n){return n.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${n}' is disallowed for security reasons, please use (${n.slice(2)})=...
If '${n}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(n){return n.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${n}' is disallowed for security reasons, please use (${n.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(n){let e=this._schema.get(n.toLowerCase())||this._schema.get("unknown");return Array.from(e.keys()).map(t=>UD.get(t)??t)}allKnownEventsOfElement(n){return Array.from(this._eventSchema.get(n.toLowerCase())??[])}normalizeAnimationStyleProperty(n){return k0(n)}normalizeAnimationStyleValue(n,e,t){let r="",i=t.toString().trim(),s=null;if(KD(n)&&t!==0&&t!=="0")if(typeof t=="number")r="px";else{let o=t.match(/^[+-]?[\d\.]+([a-z]*)$/);o&&o[1].length==0&&(s=`Please provide a CSS unit value for ${e}:${t}`)}return{error:s,value:i+r}}};function KD(n){switch(n){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var U=class{constructor({closedByChildren:n,implicitNamespacePrefix:e,contentType:t=tt.PARSABLE_DATA,closedByParent:r=!1,isVoid:i=!1,ignoreFirstLf:s=!1,preventNamespaceInheritance:o=!1,canSelfClose:a=!1}={}){this.closedByChildren={},this.closedByParent=!1,n&&n.length>0&&n.forEach(l=>this.closedByChildren[l]=!0),this.isVoid=i,this.closedByParent=r||i,this.implicitNamespacePrefix=e||null,this.contentType=t,this.ignoreFirstLf=s,this.preventNamespaceInheritance=o,this.canSelfClose=a??i}isClosedByChild(n){return this.isVoid||n.toLowerCase()in this.closedByChildren}getContentType(n){return typeof this.contentType=="object"?(n===void 0?void 0:this.contentType[n])??this.contentType.default:this.contentType}},Kl,lr;function Eo(n){return lr||(Kl=new U({canSelfClose:!0}),lr={base:new U({isVoid:!0}),meta:new U({isVoid:!0}),area:new U({isVoid:!0}),embed:new U({isVoid:!0}),link:new U({isVoid:!0}),img:new U({isVoid:!0}),input:new U({isVoid:!0}),param:new U({isVoid:!0}),hr:new U({isVoid:!0}),br:new U({isVoid:!0}),source:new U({isVoid:!0}),track:new U({isVoid:!0}),wbr:new U({isVoid:!0}),p:new U({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new U({closedByChildren:["tbody","tfoot"]}),tbody:new U({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new U({closedByChildren:["tbody"],closedByParent:!0}),tr:new U({closedByChildren:["tr"],closedByParent:!0}),td:new U({closedByChildren:["td","th"],closedByParent:!0}),th:new U({closedByChildren:["td","th"],closedByParent:!0}),col:new U({isVoid:!0}),svg:new U({implicitNamespacePrefix:"svg"}),foreignObject:new U({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new U({implicitNamespacePrefix:"math"}),li:new U({closedByChildren:["li"],closedByParent:!0}),dt:new U({closedByChildren:["dt","dd"]}),dd:new U({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new U({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new U({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new U({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new U({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new U({closedByChildren:["optgroup"],closedByParent:!0}),option:new U({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new U({ignoreFirstLf:!0}),listing:new U({ignoreFirstLf:!0}),style:new U({contentType:tt.RAW_TEXT}),script:new U({contentType:tt.RAW_TEXT}),title:new U({contentType:{default:tt.ESCAPABLE_RAW_TEXT,svg:tt.PARSABLE_DATA}}),textarea:new U({contentType:tt.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})},new JD().allKnownElementNames().forEach(e=>{!lr.hasOwnProperty(e)&&ui(e)===null&&(lr[e]=new U({canSelfClose:!1}))})),lr[n]??Kl}var Ir=class{constructor(n,e){this.sourceSpan=n,this.i18n=e}},GD=class extends Ir{constructor(n,e,t,r){super(e,r),this.value=n,this.tokens=t,this.type="text"}visit(n,e){return n.visitText(this,e)}},YD=class extends Ir{constructor(n,e,t,r){super(e,r),this.value=n,this.tokens=t,this.type="cdata"}visit(n,e){return n.visitCdata(this,e)}},XD=class extends Ir{constructor(n,e,t,r,i,s){super(r,s),this.switchValue=n,this.type=e,this.cases=t,this.switchValueSourceSpan=i}visit(n,e){return n.visitExpansion(this,e)}},ZD=class{constructor(n,e,t,r,i){this.value=n,this.expression=e,this.sourceSpan=t,this.valueSourceSpan=r,this.expSourceSpan=i}visit(n,e){return n.visitExpansionCase(this,e)}},QD=class extends Ir{constructor(n,e,t,r,i,s,o){super(t,o),this.name=n,this.value=e,this.keySpan=r,this.valueSpan=i,this.valueTokens=s,this.type="attribute"}visit(n,e){return n.visitAttribute(this,e)}get nameSpan(){return this.keySpan}},ey=class extends Ir{constructor(n,e,t,r,i,s=null,o=null,a){super(r,a),this.name=n,this.attrs=e,this.children=t,this.startSourceSpan=i,this.endSourceSpan=s,this.nameSpan=o,this.type="element"}visit(n,e){return n.visitElement(this,e)}},ty=class{constructor(n,e){this.value=n,this.sourceSpan=e,this.type="comment"}visit(n,e){return n.visitComment(this,e)}},ny=class{constructor(n,e){this.value=n,this.sourceSpan=e,this.type="docType"}visit(n,e){return n.visitDocType(this,e)}};function Qc(n,e,t=null){let r=[],i=n.visit?s=>n.visit(s,t)||s.visit(n,t):s=>s.visit(n,t);return e.forEach(s=>{let o=i(s);o&&r.push(o)}),r}var ry=class{constructor(){}visitElement(n,e){this.visitChildren(e,t=>{t(n.attrs),t(n.children)})}visitAttribute(n,e){}visitText(n,e){}visitCdata(n,e){}visitComment(n,e){}visitDocType(n,e){}visitExpansion(n,e){return this.visitChildren(e,t=>{t(n.cases)})}visitExpansionCase(n,e){}visitChildren(n,e){let t=[],r=this;function i(s){s&&t.push(Qc(r,s,n))}return e(i),Array.prototype.concat.apply([],t)}},yi={AElig:"Æ",AMP:"&",amp:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"",af:"",Aring:"Å",angst:"Å",Ascr:"𝒜",Assign:"≔",colone:"≔",coloneq:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"",setminus:"",setmn:"",smallsetminus:"",ssetmn:"",Barv:"⫧",Barwed:"⌆",doublebarwedge:"⌆",Bcy:"Б",Because:"∵",becaus:"∵",because:"∵",Bernoullis:"",Bscr:"",bernou:"",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",breve:"˘",Bumpeq:"≎",HumpDownHump:"≎",bump:"≎",CHcy:"Ч",COPY:"©",copy:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"",DD:"",Cayleys:"",Cfr:"",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",cedil:"¸",CenterDot:"·",centerdot:"·",middot:"·",Chi:"Χ",CircleDot:"⊙",odot:"⊙",CircleMinus:"⊖",ominus:"⊖",CirclePlus:"⊕",oplus:"⊕",CircleTimes:"⊗",otimes:"⊗",ClockwiseContourIntegral:"∲",cwconint:"∲",CloseCurlyDoubleQuote:"”",rdquo:"”",rdquor:"”",CloseCurlyQuote:"",rsquo:"",rsquor:"",Colon:"∷",Proportion:"∷",Colone:"⩴",Congruent:"≡",equiv:"≡",Conint:"∯",DoubleContourIntegral:"∯",ContourIntegral:"∮",conint:"∮",oint:"∮",Copf:"",complexes:"",Coproduct:"∐",coprod:"∐",CounterClockwiseContourIntegral:"∳",awconint:"∳",Cross:"",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",asympeq:"≍",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",ddagger:"‡",Darr:"↡",Dashv:"⫤",DoubleLeftTee:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",nabla:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",acute:"´",DiacriticalDot:"˙",dot:"˙",DiacriticalDoubleAcute:"˝",dblac:"˝",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"˜",tilde:"˜",Diamond:"⋄",diam:"⋄",diamond:"⋄",DifferentialD:"",dd:"",Dopf:"𝔻",Dot:"¨",DoubleDot:"¨",die:"¨",uml:"¨",DotDot:"⃜",DotEqual:"≐",doteq:"≐",esdot:"≐",DoubleDownArrow:"⇓",Downarrow:"⇓",dArr:"⇓",DoubleLeftArrow:"⇐",Leftarrow:"⇐",lArr:"⇐",DoubleLeftRightArrow:"⇔",Leftrightarrow:"⇔",hArr:"⇔",iff:"⇔",DoubleLongLeftArrow:"⟸",Longleftarrow:"⟸",xlArr:"⟸",DoubleLongLeftRightArrow:"⟺",Longleftrightarrow:"⟺",xhArr:"⟺",DoubleLongRightArrow:"⟹",Longrightarrow:"⟹",xrArr:"⟹",DoubleRightArrow:"⇒",Implies:"⇒",Rightarrow:"⇒",rArr:"⇒",DoubleRightTee:"⊨",vDash:"⊨",DoubleUpArrow:"⇑",Uparrow:"⇑",uArr:"⇑",DoubleUpDownArrow:"⇕",Updownarrow:"⇕",vArr:"⇕",DoubleVerticalBar:"∥",par:"∥",parallel:"∥",shortparallel:"∥",spar:"∥",DownArrow:"↓",ShortDownArrow:"↓",darr:"↓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",duarr:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",leftharpoondown:"↽",lhard:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",rhard:"⇁",rightharpoondown:"⇁",DownRightVectorBar:"⥗",DownTee:"",top:"",DownTeeArrow:"↧",mapstodown:"↧",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",in:"∈",isin:"∈",isinv:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",eqsim:"≂",esim:"≂",Equilibrium:"⇌",rightleftharpoons:"⇌",rlhar:"⇌",Escr:"",expectation:"",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",exist:"∃",ExponentialE:"",ee:"",exponentiale:"",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",blacksquare:"▪",squarf:"▪",squf:"▪",Fopf:"𝔽",ForAll:"∀",forall:"∀",Fouriertrf:"",Fscr:"",GJcy:"Ѓ",GT:">",gt:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",ggg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",ge:"≥",geq:"≥",GreaterEqualLess:"⋛",gel:"⋛",gtreqless:"⋛",GreaterFullEqual:"≧",gE:"≧",geqq:"≧",GreaterGreater:"⪢",GreaterLess:"≷",gl:"≷",gtrless:"≷",GreaterSlantEqual:"⩾",geqslant:"⩾",ges:"⩾",GreaterTilde:"≳",gsim:"≳",gtrsim:"≳",Gscr:"𝒢",Gt:"≫",NestedGreaterGreater:"≫",gg:"≫",HARDcy:"Ъ",Hacek:"ˇ",caron:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"",Poincareplane:"",HilbertSpace:"",Hscr:"",hamilt:"",Hopf:"",quaternions:"",HorizontalLine:"─",boxh:"─",Hstrok:"Ħ",HumpEqual:"≏",bumpe:"≏",bumpeq:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"",Im:"",image:"",imagpart:"",Igrave:"Ì",Imacr:"Ī",ImaginaryI:"",ii:"",Int:"∬",Integral:"∫",int:"∫",Intersection:"⋂",bigcap:"⋂",xcap:"⋂",InvisibleComma:"",ic:"",InvisibleTimes:"",it:"",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"",imagline:"",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",lt:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"",Lscr:"",lagran:"",Larr:"↞",twoheadleftarrow:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",lang:"⟨",langle:"⟨",LeftArrow:"←",ShortLeftArrow:"←",larr:"←",leftarrow:"←",slarr:"←",LeftArrowBar:"⇤",larrb:"⇤",LeftArrowRightArrow:"⇆",leftrightarrows:"⇆",lrarr:"⇆",LeftCeiling:"⌈",lceil:"⌈",LeftDoubleBracket:"⟦",lobrk:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",dharl:"⇃",downharpoonleft:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",lfloor:"⌊",LeftRightArrow:"↔",harr:"↔",leftrightarrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",dashv:"⊣",LeftTeeArrow:"↤",mapstoleft:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",vartriangleleft:"⊲",vltri:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",ltrie:"⊴",trianglelefteq:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",uharl:"↿",upharpoonleft:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",leftharpoonup:"↼",lharu:"↼",LeftVectorBar:"⥒",LessEqualGreater:"⋚",leg:"⋚",lesseqgtr:"⋚",LessFullEqual:"≦",lE:"≦",leqq:"≦",LessGreater:"≶",lessgtr:"≶",lg:"≶",LessLess:"⪡",LessSlantEqual:"⩽",leqslant:"⩽",les:"⩽",LessTilde:"≲",lesssim:"≲",lsim:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",lAarr:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",longleftarrow:"⟵",xlarr:"⟵",LongLeftRightArrow:"⟷",longleftrightarrow:"⟷",xharr:"⟷",LongRightArrow:"⟶",longrightarrow:"⟶",xrarr:"⟶",Lopf:"𝕃",LowerLeftArrow:"↙",swarr:"↙",swarrow:"↙",LowerRightArrow:"↘",searr:"↘",searrow:"↘",Lsh:"↰",lsh:"↰",Lstrok:"Ł",Lt:"≪",NestedLessLess:"≪",ll:"≪",Map:"⤅",Mcy:"М",MediumSpace:"",Mellintrf:"",Mscr:"",phmmat:"",Mfr:"𝔐",MinusPlus:"∓",mnplus:"∓",mp:"∓",Mopf:"𝕄",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",ZeroWidthSpace:"",NewLine:`
`,Nfr:"𝔑",NoBreak:"",NonBreakingSpace:" ",nbsp:" ",Nopf:"",naturals:"",Not:"⫬",NotCongruent:"≢",nequiv:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",npar:"∦",nparallel:"∦",nshortparallel:"∦",nspar:"∦",NotElement:"∉",notin:"∉",notinva:"∉",NotEqual:"≠",ne:"≠",NotEqualTilde:"≂̸",nesim:"≂̸",NotExists:"∄",nexist:"∄",nexists:"∄",NotGreater:"≯",ngt:"≯",ngtr:"≯",NotGreaterEqual:"≱",nge:"≱",ngeq:"≱",NotGreaterFullEqual:"≧̸",ngE:"≧̸",ngeqq:"≧̸",NotGreaterGreater:"≫̸",nGtv:"≫̸",NotGreaterLess:"≹",ntgl:"≹",NotGreaterSlantEqual:"⩾̸",ngeqslant:"⩾̸",nges:"⩾̸",NotGreaterTilde:"≵",ngsim:"≵",NotHumpDownHump:"≎̸",nbump:"≎̸",NotHumpEqual:"≏̸",nbumpe:"≏̸",NotLeftTriangle:"⋪",nltri:"⋪",ntriangleleft:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",nltrie:"⋬",ntrianglelefteq:"⋬",NotLess:"≮",nless:"≮",nlt:"≮",NotLessEqual:"≰",nle:"≰",nleq:"≰",NotLessGreater:"≸",ntlg:"≸",NotLessLess:"≪̸",nLtv:"≪̸",NotLessSlantEqual:"⩽̸",nleqslant:"⩽̸",nles:"⩽̸",NotLessTilde:"≴",nlsim:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",npr:"⊀",nprec:"⊀",NotPrecedesEqual:"⪯̸",npre:"⪯̸",npreceq:"⪯̸",NotPrecedesSlantEqual:"⋠",nprcue:"⋠",NotReverseElement:"∌",notni:"∌",notniva:"∌",NotRightTriangle:"⋫",nrtri:"⋫",ntriangleright:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",nrtrie:"⋭",ntrianglerighteq:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",nsqsube:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",nsqsupe:"⋣",NotSubset:"⊂⃒",nsubset:"⊂⃒",vnsub:"⊂⃒",NotSubsetEqual:"⊈",nsube:"⊈",nsubseteq:"⊈",NotSucceeds:"⊁",nsc:"⊁",nsucc:"⊁",NotSucceedsEqual:"⪰̸",nsce:"⪰̸",nsucceq:"⪰̸",NotSucceedsSlantEqual:"⋡",nsccue:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",nsupset:"⊃⃒",vnsup:"⊃⃒",NotSupersetEqual:"⊉",nsupe:"⊉",nsupseteq:"⊉",NotTilde:"≁",nsim:"≁",NotTildeEqual:"≄",nsime:"≄",nsimeq:"≄",NotTildeFullEqual:"≇",ncong:"≇",NotTildeTilde:"≉",nap:"≉",napprox:"≉",NotVerticalBar:"∤",nmid:"∤",nshortmid:"∤",nsmid:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",ohm:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",ldquo:"“",OpenCurlyQuote:"",lsquo:"",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",oline:"‾",OverBrace:"⏞",OverBracket:"⎴",tbrk:"⎴",OverParenthesis:"⏜",PartialD:"∂",part:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",plusmn:"±",pm:"±",Popf:"",primes:"",Pr:"⪻",Precedes:"≺",pr:"≺",prec:"≺",PrecedesEqual:"⪯",pre:"⪯",preceq:"⪯",PrecedesSlantEqual:"≼",prcue:"≼",preccurlyeq:"≼",PrecedesTilde:"≾",precsim:"≾",prsim:"≾",Prime:"″",Product:"∏",prod:"∏",Proportional:"∝",prop:"∝",propto:"∝",varpropto:"∝",vprop:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',quot:'"',Qfr:"𝔔",Qopf:"",rationals:"",Qscr:"𝒬",RBarr:"⤐",drbkarow:"⤐",REG:"®",circledR:"®",reg:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",twoheadrightarrow:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"",Rfr:"",real:"",realpart:"",ReverseElement:"∋",SuchThat:"∋",ni:"∋",niv:"∋",ReverseEquilibrium:"⇋",leftrightharpoons:"⇋",lrhar:"⇋",ReverseUpEquilibrium:"⥯",duhar:"⥯",Rho:"Ρ",RightAngleBracket:"⟩",rang:"⟩",rangle:"⟩",RightArrow:"→",ShortRightArrow:"→",rarr:"→",rightarrow:"→",srarr:"→",RightArrowBar:"⇥",rarrb:"⇥",RightArrowLeftArrow:"⇄",rightleftarrows:"⇄",rlarr:"⇄",RightCeiling:"⌉",rceil:"⌉",RightDoubleBracket:"⟧",robrk:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",dharr:"⇂",downharpoonright:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rfloor:"⌋",RightTee:"⊢",vdash:"⊢",RightTeeArrow:"↦",map:"↦",mapsto:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",vartriangleright:"⊳",vrtri:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",rtrie:"⊵",trianglerighteq:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",uharr:"↾",upharpoonright:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",rharu:"⇀",rightharpoonup:"⇀",RightVectorBar:"⥓",Ropf:"",reals:"",RoundImplies:"⥰",Rrightarrow:"⇛",rAarr:"⇛",Rscr:"",realine:"",Rsh:"↱",rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortUpArrow:"↑",UpArrow:"↑",uarr:"↑",uparrow:"↑",Sigma:"Σ",SmallCircle:"∘",compfn:"∘",Sopf:"𝕊",Sqrt:"√",radic:"√",Square:"□",squ:"□",square:"□",SquareIntersection:"⊓",sqcap:"⊓",SquareSubset:"⊏",sqsub:"⊏",sqsubset:"⊏",SquareSubsetEqual:"⊑",sqsube:"⊑",sqsubseteq:"⊑",SquareSuperset:"⊐",sqsup:"⊐",sqsupset:"⊐",SquareSupersetEqual:"⊒",sqsupe:"⊒",sqsupseteq:"⊒",SquareUnion:"⊔",sqcup:"⊔",Sscr:"𝒮",Star:"⋆",sstarf:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",sube:"⊆",subseteq:"⊆",Succeeds:"≻",sc:"≻",succ:"≻",SucceedsEqual:"⪰",sce:"⪰",succeq:"⪰",SucceedsSlantEqual:"≽",sccue:"≽",succcurlyeq:"≽",SucceedsTilde:"≿",scsim:"≿",succsim:"≿",Sum:"∑",sum:"∑",Sup:"⋑",Supset:"⋑",Superset:"⊃",sup:"⊃",supset:"⊃",SupersetEqual:"⊇",supe:"⊇",supseteq:"⊇",THORN:"Þ",TRADE:"™",trade:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",there4:"∴",therefore:"∴",Theta:"Θ",ThickSpace:"",ThinSpace:"",thinsp:"",Tilde:"",sim:"",thicksim:"",thksim:"",TildeEqual:"≃",sime:"≃",simeq:"≃",TildeFullEqual:"≅",cong:"≅",TildeTilde:"≈",ap:"≈",approx:"≈",asymp:"≈",thickapprox:"≈",thkap:"≈",Topf:"𝕋",TripleDot:"⃛",tdot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",lowbar:"_",UnderBrace:"⏟",UnderBracket:"⎵",bbrk:"⎵",UnderParenthesis:"⏝",Union:"",bigcup:"",xcup:"",UnionPlus:"⊎",uplus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",udarr:"⇅",UpDownArrow:"↕",updownarrow:"↕",varr:"↕",UpEquilibrium:"⥮",udhar:"⥮",UpTee:"⊥",bot:"⊥",bottom:"⊥",perp:"⊥",UpTeeArrow:"↥",mapstoup:"↥",UpperLeftArrow:"↖",nwarr:"↖",nwarrow:"↖",UpperRightArrow:"↗",nearr:"↗",nearrow:"↗",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"",bigvee:"",xvee:"",Verbar:"‖",Vert:"‖",VerticalBar:"",mid:"",shortmid:"",smid:"",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"❘",VerticalTilde:"≀",wr:"≀",wreath:"≀",VeryThinSpace:"",hairsp:"",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",bigwedge:"⋀",xwedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",Zeta:"Ζ",Zfr:"",zeetrf:"",Zopf:"",integers:"",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",mstpos:"∾",acE:"∾̳",acd:"∿",acirc:"â",acy:"а",aelig:"æ",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",and:"∧",wedge:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",angle:"∠",ange:"⦤",angmsd:"∡",measuredangle:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angzarr:"⍼",aogon:"ą",aopf:"𝕒",apE:"⩰",apacir:"⩯",ape:"≊",approxeq:"≊",apid:"≋",apos:"'",aring:"å",ascr:"𝒶",ast:"*",midast:"*",atilde:"ã",auml:"ä",awint:"⨑",bNot:"⫭",backcong:"≌",bcong:"≌",backepsilon:"϶",bepsi:"϶",backprime:"",bprime:"",backsim:"∽",bsim:"∽",backsimeq:"⋍",bsime:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrktbrk:"⎶",bcy:"б",bdquo:"„",ldquor:"„",bemptyv:"⦰",beta:"β",beth:"ℶ",between:"≬",twixt:"≬",bfr:"𝔟",bigcirc:"◯",xcirc:"◯",bigodot:"⨀",xodot:"⨀",bigoplus:"⨁",xoplus:"⨁",bigotimes:"⨂",xotime:"⨂",bigsqcup:"⨆",xsqcup:"⨆",bigstar:"★",starf:"★",bigtriangledown:"▽",xdtri:"▽",bigtriangleup:"△",xutri:"△",biguplus:"⨄",xuplus:"⨄",bkarow:"⤍",rbarr:"⤍",blacklozenge:"⧫",lozf:"⧫",blacktriangle:"▴",utrif:"▴",blacktriangledown:"▾",dtrif:"▾",blacktriangleleft:"◂",ltrif:"◂",blacktriangleright:"▸",rtrif:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",minusb:"⊟",boxplus:"⊞",plusb:"⊞",boxtimes:"⊠",timesb:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bumpE:"⪮",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cemptyv:"⦲",cent:"¢",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",cire:"≗",circlearrowleft:"↺",olarr:"↺",circlearrowright:"↻",orarr:"↻",circledS:"Ⓢ",oS:"Ⓢ",circledast:"⊛",oast:"⊛",circledcirc:"⊚",ocir:"⊚",circleddash:"⊝",odash:"⊝",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",comma:",",commat:"@",comp:"∁",complement:"∁",congdot:"⩭",copf:"𝕔",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",curlyeqprec:"⋞",cuesc:"⋟",curlyeqsucc:"⋟",cularr:"↶",curvearrowleft:"↶",cularrp:"⤽",cup:"",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"",curarr:"↷",curvearrowright:"↷",curarrm:"⤼",curlyvee:"⋎",cuvee:"⋎",curlywedge:"⋏",cuwed:"⋏",curren:"¤",cwint:"∱",cylcty:"⌭",dHar:"⥥",dagger:"†",daleth:"ℸ",dash:"",hyphen:"",dbkarow:"⤏",rBarr:"⤏",dcaron:"ď",dcy:"д",ddarr:"⇊",downdownarrows:"⇊",ddotseq:"⩷",eDDot:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",diamondsuit:"♦",diams:"♦",digamma:"ϝ",gammad:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",llcorner:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",doteqdot:"≑",eDot:"≑",dotminus:"∸",minusd:"∸",dotplus:"∔",plusdo:"∔",dotsquare:"⊡",sdotb:"⊡",drcorn:"⌟",lrcorner:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",triangledown:"▿",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",eqcirc:"≖",ecirc:"ê",ecolon:"≕",eqcolon:"≕",ecy:"э",edot:"ė",efDot:"≒",fallingdotseq:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",eqslantgtr:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"",els:"⪕",eqslantless:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",varnothing:"∅",emsp13:"",emsp14:"",emsp:"",eng:"ŋ",ensp:"",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",straightepsilon:"ϵ",varepsilon:"ϵ",equals:"=",equest:"≟",questeq:"≟",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",risingdotseq:"≓",erarr:"⥱",escr:"",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",fork:"⋔",pitchfork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",half:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"",frown:"⌢",sfrown:"⌢",fscr:"𝒻",gEl:"⪌",gtreqqless:"⪌",gacute:"ǵ",gamma:"γ",gap:"⪆",gtrapprox:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gimel:"ℷ",gjcy:"ѓ",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gneqq:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gnsim:"⋧",gopf:"𝕘",gscr:"",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtrdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrarr:"⥸",gvertneqq:"≩︀",gvnE:"≩︀",hardcy:"ъ",harrcir:"⥈",harrw:"↭",leftrightsquigarrow:"↭",hbar:"ℏ",hslash:"ℏ",planck:"ℏ",plankv:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",mldr:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",searhk:"⤥",hkswarow:"⤦",swarhk:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",larrhk:"↩",hookrightarrow:"↪",rarrhk:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hstrok:"ħ",hybull:"",iacute:"í",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",ifr:"𝔦",igrave:"ì",iiiint:"⨌",qint:"⨌",iiint:"∭",tint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",imath:"ı",inodot:"ı",imof:"⊷",imped:"Ƶ",incare:"℅",infin:"∞",infintie:"⧝",intcal:"⊺",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iquest:"¿",iscr:"𝒾",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",varkappa:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAtail:"⤛",lBarr:"⤎",lEg:"⪋",lesseqqgtr:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lambda:"λ",langd:"⦑",lap:"⪅",lessapprox:"⪅",laquo:"«",larrbfs:"⤟",larrfs:"⤝",larrlp:"↫",looparrowleft:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",leftarrowtail:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lcy:"л",ldca:"⤶",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leq:"≤",leftleftarrows:"⇇",llarr:"⇇",leftthreetimes:"⋋",lthree:"⋋",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessdot:"⋖",ltdot:"⋖",lfisht:"⥼",lfr:"𝔩",lgE:"⪑",lharul:"⥪",lhblk:"▄",ljcy:"љ",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lneqq:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lnsim:"⋦",loang:"⟬",loarr:"⇽",longmapsto:"⟼",xmap:"⟼",looparrowright:"↬",rarrlp:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"",loz:"◊",lozenge:"◊",lpar:"(",lparlt:"⦓",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"",lscr:"𝓁",lsime:"⪍",lsimg:"⪏",lsquor:"",sbquo:"",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",triangleleft:"◃",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",strns:"¯",male:"♂",malt:"✠",maltese:"✠",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",mfr:"𝔪",mho:"℧",micro:"µ",midcir:"⫰",minus:"",minusdu:"⨪",mlcp:"⫛",models:"⊧",mopf:"𝕞",mscr:"𝓂",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nLeftarrow:"⇍",nlArr:"⇍",nLeftrightarrow:"⇎",nhArr:"⇎",nLl:"⋘̸",nLt:"≪⃒",nRightarrow:"⇏",nrArr:"⇏",nVDash:"⊯",nVdash:"⊮",nacute:"ń",nang:"∠⃒",napE:"⩰̸",napid:"≋̸",napos:"ʼn",natur:"♮",natural:"♮",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"",neArr:"⇗",nearhk:"⤤",nedot:"≐̸",nesear:"⤨",toea:"⤨",nfr:"𝔫",nharr:"↮",nleftrightarrow:"↮",nhpar:"⫲",nis:"⋼",nisd:"⋺",njcy:"њ",nlE:"≦̸",nleqq:"≦̸",nlarr:"↚",nleftarrow:"↚",nldr:"‥",nopf:"𝕟",not:"¬",notinE:"⋹̸",notindot:"⋵̸",notinvb:"⋷",notinvc:"⋶",notnivb:"⋾",notnivc:"⋽",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",nrarr:"↛",nrightarrow:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nscr:"𝓃",nsub:"⊄",nsubE:"⫅̸",nsubseteqq:"⫅̸",nsup:"⊅",nsupE:"⫆̸",nsupseteqq:"⫆̸",ntilde:"ñ",nu:"ν",num:"#",numero:"№",numsp:"",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwnear:"⤧",oacute:"ó",ocirc:"ô",ocy:"о",odblac:"ő",odiv:"⨸",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",olcir:"⦾",olcross:"⦻",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",oopf:"𝕠",opar:"⦷",operp:"⦹",or:"",vee:"",ord:"⩝",order:"",orderof:"",oscr:"",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oslash:"ø",osol:"⊘",otilde:"õ",otimesas:"⨶",ouml:"ö",ovbar:"⌽",para:"¶",parsim:"⫳",parsl:"⫽",pcy:"п",percnt:"%",period:".",permil:"‰",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",straightphi:"ϕ",varphi:"ϕ",phone:"☎",pi:"π",piv:"ϖ",varpi:"ϖ",planckh:"",plus:"+",plusacir:"⨣",pluscir:"⨢",plusdu:"⨥",pluse:"⩲",plussim:"⨦",plustwo:"⨧",pointint:"⨕",popf:"𝕡",pound:"£",prE:"⪳",prap:"⪷",precapprox:"⪷",precnapprox:"⪹",prnap:"⪹",precneqq:"⪵",prnE:"⪵",precnsim:"⋨",prnsim:"⋨",prime:"",profalar:"⌮",profline:"⌒",profsurf:"⌓",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:"",qfr:"𝔮",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quatint:"⨖",quest:"?",rAtail:"⤜",rHar:"⥤",race:"∽̱",racute:"ŕ",raemptyv:"⦳",rangd:"⦒",range:"⦥",raquo:"»",rarrap:"⥵",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rightarrowtail:"↣",rarrw:"↝",rightsquigarrow:"↝",ratail:"⤚",ratio:"",rbbrk:"",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdsh:"↳",rect:"▭",rfisht:"⥽",rfr:"𝔯",rharul:"⥬",rho:"ρ",rhov:"ϱ",varrho:"ϱ",rightrightarrows:"⇉",rrarr:"⇉",rightthreetimes:"⋌",rthree:"⋌",ring:"˚",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rsaquo:"",rscr:"𝓇",rtimes:"⋊",rtri:"▹",triangleright:"▹",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",scE:"⪴",scap:"⪸",succapprox:"⪸",scaron:"š",scedil:"ş",scirc:"ŝ",scnE:"⪶",succneqq:"⪶",scnap:"⪺",succnapprox:"⪺",scnsim:"⋩",succnsim:"⋩",scpolint:"⨓",scy:"с",sdot:"⋅",sdote:"⩦",seArr:"⇘",sect:"§",semi:";",seswar:"⤩",tosa:"⤩",sext:"✶",sfr:"𝔰",sharp:"♯",shchcy:"щ",shcy:"ш",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",varsigma:"ς",simdot:"⩪",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",smashp:"⨳",smeparsl:"⧤",smile:"⌣",ssmile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",sqcaps:"⊓︀",sqcups:"⊔︀",sscr:"𝓈",star:"☆",sub:"⊂",subset:"⊂",subE:"⫅",subseteqq:"⫅",subdot:"⪽",subedot:"⫃",submult:"⫁",subnE:"⫋",subsetneqq:"⫋",subne:"⊊",subsetneq:"⊊",subplus:"⪿",subrarr:"⥹",subsim:"⫇",subsub:"⫕",subsup:"⫓",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",supE:"⫆",supseteqq:"⫆",supdot:"⪾",supdsub:"⫘",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supsetneqq:"⫌",supne:"⊋",supsetneq:"⊋",supplus:"⫀",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tcaron:"ť",tcedil:"ţ",tcy:"т",telrec:"⌕",tfr:"𝔱",theta:"θ",thetasym:"ϑ",thetav:"ϑ",vartheta:"ϑ",thorn:"þ",times:"×",timesbar:"⨱",timesd:"⨰",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tprime:"‴",triangle:"▵",utri:"▵",triangleq:"≜",trie:"≜",tridot:"◬",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",uHar:"⥣",uacute:"ú",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udblac:"ű",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uogon:"ų",uopf:"𝕦",upsi:"υ",upsilon:"υ",upuparrows:"⇈",uuarr:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",uuml:"ü",uwangle:"⦧",vBar:"⫨",vBarv:"⫩",vangrt:"⦜",varsubsetneq:"⊊︀",vsubne:"⊊︀",varsubsetneqq:"⫋︀",vsubnE:"⫋︀",varsupsetneq:"⊋︀",vsupne:"⊋︀",varsupsetneqq:"⫌︀",vsupnE:"⫌︀",vcy:"в",veebar:"⊻",veeeq:"≚",vellip:"⋮",vfr:"𝔳",vopf:"𝕧",vscr:"𝓋",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedgeq:"≙",weierp:"℘",wp:"℘",wfr:"𝔴",wopf:"𝕨",wscr:"𝓌",xfr:"𝔵",xi:"ξ",xnis:"⋻",xopf:"𝕩",xscr:"𝓍",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"",zwnj:""},iy="";yi.ngsp=iy;var sy=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function oy(n,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${n}' to be an array, [start, end].`);if(e!=null){let t=e[0],r=e[1];sy.forEach(i=>{if(i.test(t)||i.test(r))throw new Error(`['${t}', '${r}'] contains unusable interpolation symbol.`)})}}var ay=class ed{static fromArray(e){return e?(oy("interpolation",e),new ed(e[0],e[1])):td}constructor(e,t){this.start=e,this.end=t}},td=new ay("{{","}}"),Us=class extends jc{constructor(n,e,t){super(t,n),this.tokenType=e}},ly=class{constructor(n,e,t){this.tokens=n,this.errors=e,this.nonNormalizedIcuExpressions=t}};function uy(n,e,t,r={}){let i=new hy(new Vc(n,e),t,r);return i.tokenize(),new ly(yy(i.tokens),i.errors,i.nonNormalizedIcuExpressions)}var cy=/\r\n?/g;function Bn(n){return`Unexpected character "${n===0?"EOF":String.fromCharCode(n)}"`}function Gl(n){return`Unknown entity "${n}" - use the "&#<decimal>;" or "&#x<hex>;" syntax`}function dy(n,e){return`Unable to parse entity "${e}" - ${n} character reference entities must end with ";"`}var bi;(function(n){n.HEX="hexadecimal",n.DEC="decimal"})(bi||(bi={}));var Js=class{constructor(n){this.error=n}},hy=class{constructor(n,e,t){this._getTagContentType=e,this._currentTokenStart=null,this._currentTokenType=null,this._expansionCaseStack=[],this._inInterpolation=!1,this._fullNameStack=[],this.tokens=[],this.errors=[],this.nonNormalizedIcuExpressions=[],this._tokenizeIcu=t.tokenizeExpansionForms||!1,this._interpolationConfig=t.interpolationConfig||td,this._leadingTriviaCodePoints=t.leadingTriviaChars&&t.leadingTriviaChars.map(i=>i.codePointAt(0)||0),this._canSelfClose=t.canSelfClose||!1,this._allowHtmComponentClosingTags=t.allowHtmComponentClosingTags||!1;let r=t.range||{endPos:n.content.length,startPos:0,startLine:0,startCol:0};this._cursor=t.escapedString?new by(n,r):new nd(n,r),this._preserveLineEndings=t.preserveLineEndings||!1,this._escapedString=t.escapedString||!1,this._i18nNormalizeLineEndingsInICUs=t.i18nNormalizeLineEndingsInICUs||!1;try{this._cursor.init()}catch(i){this.handleError(i)}}_processCarriageReturns(n){return this._preserveLineEndings?n:n.replace(cy,`
`)}tokenize(){for(;this._cursor.peek()!==0;){let n=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(n):this._attemptStr("--")?this._consumeComment(n):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(n):this._consumeBogusComment(n);else if(this._attemptCharCode(47))this._consumeTagClose(n);else{let e=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=e,this._consumeBogusComment(n)):this._consumeTagOpen(n)}else this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(e){this.handleError(e)}}this._beginToken(25),this._endToken([])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(gy(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(n,e=this._cursor.clone()){this._currentTokenStart=e,this._currentTokenType=n}_endToken(n,e){if(this._currentTokenStart===null)throw new Us("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(e));if(this._currentTokenType===null)throw new Us("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let t={type:this._currentTokenType,parts:n,sourceSpan:(e??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(t),this._currentTokenStart=null,this._currentTokenType=null,t}_createError(n,e){this._isInExpansionForm()&&(n+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let t=new Us(n,this._currentTokenType,e);return this._currentTokenStart=null,this._currentTokenType=null,new Js(t)}handleError(n){if(n instanceof da&&(n=this._createError(n.msg,this._cursor.getSpan(n.cursor))),n instanceof Js)this.errors.push(n.error);else throw n}_attemptCharCode(n){return this._cursor.peek()===n?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(n){return Dy(this._cursor.peek(),n)?(this._cursor.advance(),!0):!1}_requireCharCode(n){let e=this._cursor.clone();if(!this._attemptCharCode(n))throw this._createError(Bn(this._cursor.peek()),this._cursor.getSpan(e))}_attemptStr(n){let e=n.length;if(this._cursor.charsLeft()<e)return!1;let t=this._cursor.clone();for(let r=0;r<e;r++)if(!this._attemptCharCode(n.charCodeAt(r)))return this._cursor=t,!1;return!0}_attemptStrCaseInsensitive(n){for(let e=0;e<n.length;e++)if(!this._attemptCharCodeCaseInsensitive(n.charCodeAt(e)))return!1;return!0}_requireStr(n){let e=this._cursor.clone();if(!this._attemptStr(n))throw this._createError(Bn(this._cursor.peek()),this._cursor.getSpan(e))}_requireStrCaseInsensitive(n){let e=this._cursor.clone();if(!this._attemptStrCaseInsensitive(n))throw this._createError(Bn(this._cursor.peek()),this._cursor.getSpan(e))}_attemptCharCodeUntilFn(n){for(;!n(this._cursor.peek());)this._cursor.advance()}_requireCharCodeUntilFn(n,e){let t=this._cursor.clone();if(this._attemptCharCodeUntilFn(n),this._cursor.diff(t)<e)throw this._createError(Bn(this._cursor.peek()),this._cursor.getSpan(t))}_attemptUntilChar(n){for(;this._cursor.peek()!==n;)this._cursor.advance()}_readChar(){let n=String.fromCodePoint(this._cursor.peek());return this._cursor.advance(),n}_consumeEntity(n){this._beginToken(9);let e=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(35)){let t=this._attemptCharCode(120)||this._attemptCharCode(88),r=this._cursor.clone();if(this._attemptCharCodeUntilFn(fy),this._cursor.peek()!=59){this._cursor.advance();let s=t?bi.HEX:bi.DEC;throw this._createError(dy(s,this._cursor.getChars(e)),this._cursor.getSpan())}let i=this._cursor.getChars(r);this._cursor.advance();try{let s=parseInt(i,t?16:10);this._endToken([String.fromCharCode(s),this._cursor.getChars(e)])}catch{throw this._createError(Gl(this._cursor.getChars(e)),this._cursor.getSpan())}}else{let t=this._cursor.clone();if(this._attemptCharCodeUntilFn(my),this._cursor.peek()!=59)this._beginToken(n,e),this._cursor=t,this._endToken(["&"]);else{let r=this._cursor.getChars(t);this._cursor.advance();let i=yi[r];if(!i)throw this._createError(Gl(r),this._cursor.getSpan(e));this._endToken([i,`&${r};`])}}}_consumeRawText(n,e){this._beginToken(n?6:7);let t=[];for(;;){let r=this._cursor.clone(),i=e();if(this._cursor=r,i)break;n&&this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(t.join(""))]),t.length=0,this._consumeEntity(6),this._beginToken(6)):t.push(this._readChar())}this._endToken([this._processCarriageReturns(t.join(""))])}_consumeComment(n){this._beginToken(10,n),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(n){this._beginToken(10,n),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(11),this._cursor.advance(),this._endToken([])}_consumeCdata(n){this._beginToken(12,n),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(n){this._beginToken(18,n),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(19),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(){let n=this._cursor.clone(),e="";for(;this._cursor.peek()!==58&&!py(this._cursor.peek());)this._cursor.advance();let t;this._cursor.peek()===58?(e=this._cursor.getChars(n),this._cursor.advance(),t=this._cursor.clone()):t=n,this._requireCharCodeUntilFn(Yl,e===""?0:1);let r=this._cursor.getChars(t);return[e,r]}_consumeTagOpen(n){let e,t,r,i=[];try{if(!qc(this._cursor.peek()))throw this._createError(Bn(this._cursor.peek()),this._cursor.getSpan(n));for(r=this._consumeTagOpenStart(n),t=r.parts[0],e=r.parts[1],this._attemptCharCodeUntilFn(_e);this._cursor.peek()!==47&&this._cursor.peek()!==62&&this._cursor.peek()!==60&&this._cursor.peek()!==0;){let[o,a]=this._consumeAttributeName();if(this._attemptCharCodeUntilFn(_e),this._attemptCharCode(61)){this._attemptCharCodeUntilFn(_e);let l=this._consumeAttributeValue();i.push({prefix:o,name:a,value:l})}else i.push({prefix:o,name:a});this._attemptCharCodeUntilFn(_e)}this._consumeTagOpenEnd()}catch(o){if(o instanceof Js){r?r.type=4:(this._beginToken(5,n),this._endToken(["<"]));return}throw o}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===2)return;let s=this._getTagContentType(e,t,this._fullNameStack.length>0,i);this._handleFullNameStackForTagOpen(t,e),s===tt.RAW_TEXT?this._consumeRawTextWithTagClose(t,e,!1):s===tt.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(t,e,!0)}_consumeRawTextWithTagClose(n,e,t){this._consumeRawText(t,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(_e),!this._attemptStrCaseInsensitive(n?`${n}:${e}`:e))?!1:(this._attemptCharCodeUntilFn(_e),this._attemptCharCode(62))),this._beginToken(3),this._requireCharCodeUntilFn(r=>r===62,3),this._cursor.advance(),this._endToken([n,e]),this._handleFullNameStackForTagClose(n,e)}_consumeTagOpenStart(n){this._beginToken(0,n);let e=this._consumePrefixAndName();return this._endToken(e)}_consumeAttributeName(){let n=this._cursor.peek();if(n===39||n===34)throw this._createError(Bn(n),this._cursor.getSpan());this._beginToken(14);let e=this._consumePrefixAndName();return this._endToken(e),e}_consumeAttributeValue(){let n;if(this._cursor.peek()===39||this._cursor.peek()===34){let e=this._cursor.peek();this._consumeQuote(e);let t=()=>this._cursor.peek()===e;n=this._consumeWithInterpolation(16,17,t,t),this._consumeQuote(e)}else{let e=()=>Yl(this._cursor.peek());n=this._consumeWithInterpolation(16,17,e,e)}return n}_consumeQuote(n){this._beginToken(15),this._requireCharCode(n),this._endToken([String.fromCodePoint(n)])}_consumeTagOpenEnd(){let n=this._attemptCharCode(47)?2:1;this._beginToken(n),this._requireCharCode(62),this._endToken([])}_consumeTagClose(n){if(this._beginToken(3,n),this._attemptCharCodeUntilFn(_e),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(_e),this._requireCharCode(62),this._endToken([]);else{let[e,t]=this._consumePrefixAndName();this._attemptCharCodeUntilFn(_e),this._requireCharCode(62),this._endToken([e,t]),this._handleFullNameStackForTagClose(e,t)}}_consumeExpansionFormStart(){this._beginToken(20),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(20),this._beginToken(7);let n=this._readUntil(44),e=this._processCarriageReturns(n);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([e]);else{let r=this._endToken([n]);e!==n&&this.nonNormalizedIcuExpressions.push(r)}this._requireCharCode(44),this._attemptCharCodeUntilFn(_e),this._beginToken(7);let t=this._readUntil(44);this._endToken([t]),this._requireCharCode(44),this._attemptCharCodeUntilFn(_e)}_consumeExpansionCaseStart(){this._beginToken(21);let n=this._readUntil(123).trim();this._endToken([n]),this._attemptCharCodeUntilFn(_e),this._beginToken(22),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(_e),this._expansionCaseStack.push(22)}_consumeExpansionCaseEnd(){this._beginToken(23),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(_e),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(24),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(n,e,t,r){this._beginToken(n);let i=[];for(;!t();){let o=this._cursor.clone();this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(this._endToken([this._processCarriageReturns(i.join(""))],o),i.length=0,this._consumeInterpolation(e,o,r),this._beginToken(n)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(i.join(""))]),i.length=0,this._consumeEntity(n),this._beginToken(n)):i.push(this._readChar())}this._inInterpolation=!1;let s=this._processCarriageReturns(i.join(""));return this._endToken([s]),s}_consumeInterpolation(n,e,t){let r=[];this._beginToken(n,e),r.push(this._interpolationConfig.start);let i=this._cursor.clone(),s=null,o=!1;for(;this._cursor.peek()!==0&&(t===null||!t());){let a=this._cursor.clone();if(this._isTagStart()){this._cursor=a,r.push(this._getProcessedChars(i,a)),this._endToken(r);return}if(s===null)if(this._attemptStr(this._interpolationConfig.end)){r.push(this._getProcessedChars(i,a)),r.push(this._interpolationConfig.end),this._endToken(r);return}else this._attemptStr("//")&&(o=!0);let l=this._cursor.peek();this._cursor.advance(),l===92?this._cursor.advance():l===s?s=null:!o&&s===null&&C0(l)&&(s=l)}r.push(this._getProcessedChars(i,this._cursor)),this._endToken(r)}_getProcessedChars(n,e){return this._processCarriageReturns(e.getChars(n))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase()))}_isTagStart(){if(this._cursor.peek()===60){let n=this._cursor.clone();n.advance();let e=n.peek();if(97<=e&&e<=122||65<=e&&e<=90||e===47||e===33)return!0}return!1}_readUntil(n){let e=this._cursor.clone();return this._attemptUntilChar(n),this._cursor.getChars(e)}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===22}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===20}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;if(this._interpolationConfig){let n=this._cursor.clone(),e=this._attemptStr(this._interpolationConfig.start);return this._cursor=n,!e}return!0}_handleFullNameStackForTagOpen(n,e){let t=Di(n,e);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===t)&&this._fullNameStack.push(t)}_handleFullNameStackForTagClose(n,e){let t=Di(n,e);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===t&&this._fullNameStack.pop()}};function _e(n){return!zc(n)||n===0}function Yl(n){return zc(n)||n===62||n===60||n===47||n===39||n===34||n===61||n===0}function py(n){return(n<97||122<n)&&(n<65||90<n)&&(n<48||n>57)}function fy(n){return n===59||n===0||!b0(n)}function my(n){return n===59||n===0||!qc(n)}function gy(n){return n!==125}function Dy(n,e){return Xl(n)===Xl(e)}function Xl(n){return n>=97&&n<=122?n-97+65:n}function yy(n){let e=[],t;for(let r=0;r<n.length;r++){let i=n[r];t&&t.type===5&&i.type===5||t&&t.type===16&&i.type===16?(t.parts[0]+=i.parts[0],t.sourceSpan.end=i.sourceSpan.end):(t=i,e.push(t))}return e}var nd=class xo{constructor(e,t){if(e instanceof xo){this.file=e.file,this.input=e.input,this.end=e.end;let r=e.state;this.state={peek:r.peek,offset:r.offset,line:r.line,column:r.column}}else{if(!t)throw new Error("Programming error: the range argument must be provided with a file argument.");this.file=e,this.input=e.content,this.end=t.endPos,this.state={peek:-1,offset:t.startPos,line:t.startLine,column:t.startCol}}}clone(){return new xo(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(e){return this.state.offset-e.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(e,t){e=e||this;let r=e;if(t)for(;this.diff(e)>0&&t.indexOf(e.peek())!==-1;)r===e&&(e=e.clone()),e.advance();let i=this.locationFromCursor(e),s=this.locationFromCursor(this),o=r!==e?this.locationFromCursor(r):i;return new ee(i,s,o)}getChars(e){return this.input.substring(e.state.offset,this.state.offset)}charAt(e){return this.input.charCodeAt(e)}advanceState(e){if(e.offset>=this.end)throw this.state=e,new da('Unexpected character "EOF"',this);let t=this.charAt(e.offset);t===10?(e.line++,e.column=0):Hc(t)||e.column++,e.offset++,this.updatePeek(e)}updatePeek(e){e.peek=e.offset>=this.end?0:this.charAt(e.offset)}locationFromCursor(e){return new ko(e.file,e.state.offset,e.state.line,e.state.column)}},by=class Ao extends nd{constructor(e,t){e instanceof Ao?(super(e),this.internalState={...e.internalState}):(super(e,t),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new Ao(this)}getChars(e){let t=e.clone(),r="";for(;t.internalState.offset<this.internalState.offset;)r+=String.fromCodePoint(t.peek()),t.advance();return r}processEscapeSequence(){let e=()=>this.internalState.peek;if(e()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),e()===110)this.state.peek=10;else if(e()===114)this.state.peek=13;else if(e()===118)this.state.peek=11;else if(e()===116)this.state.peek=9;else if(e()===98)this.state.peek=8;else if(e()===102)this.state.peek=12;else if(e()===117)if(this.advanceState(this.internalState),e()===123){this.advanceState(this.internalState);let t=this.clone(),r=0;for(;e()!==125;)this.advanceState(this.internalState),r++;this.state.peek=this.decodeHexDigits(t,r)}else{let t=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(t,4)}else if(e()===120){this.advanceState(this.internalState);let t=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(t,2)}else if(Pl(e())){let t="",r=0,i=this.clone();for(;Pl(e())&&r<3;)i=this.clone(),t+=String.fromCodePoint(e()),this.advanceState(this.internalState),r++;this.state.peek=parseInt(t,8),this.internalState=i.internalState}else Hc(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(e,t){let r=this.input.slice(e.internalState.offset,e.internalState.offset+t),i=parseInt(r,16);if(isNaN(i))throw e.state=e.internalState,new da("Invalid hexadecimal escape sequence",e);return i}},da=class{constructor(n,e){this.msg=n,this.cursor=e}},wt=class rd extends jc{static create(e,t,r){return new rd(e,t,r)}constructor(e,t,r){super(t,r),this.elementName=e}},Cy=class{constructor(n,e){this.rootNodes=n,this.errors=e}},vy=class{constructor(n){this.getTagDefinition=n}parse(n,e,t,r=!1,i){let s=b=>(v,...x)=>b(v.toLowerCase(),...x),o=r?this.getTagDefinition:s(this.getTagDefinition),a=b=>o(b).getContentType(),l=r?i:s(i),d=uy(n,e,i?(b,v,x,M)=>{let N=l(b,v,x,M);return N!==void 0?N:a(b)}:a,t),h=t&&t.canSelfClose||!1,D=t&&t.allowHtmComponentClosingTags||!1,y=new ky(d.tokens,o,h,D,r);return y.build(),new Cy(y.rootNodes,d.errors.concat(y.errors))}},ky=class id{constructor(e,t,r,i,s){this.tokens=e,this.getTagDefinition=t,this.canSelfClose=r,this.allowHtmComponentClosingTags=i,this.isTagNameCaseSensitive=s,this._index=-1,this._elementStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==25;)this._peek.type===0||this._peek.type===4?this._consumeStartTag(this._advance()):this._peek.type===3?(this._closeVoidElement(),this._consumeEndTag(this._advance())):this._peek.type===12?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===10?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===5||this._peek.type===7||this._peek.type===6?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===20?this._consumeExpansion(this._advance()):this._peek.type===18?this._consumeDocType(this._advance()):this._advance()}_advance(){let e=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],e}_advanceIf(e){return this._peek.type===e?this._advance():null}_consumeCdata(e){let t=this._advance(),r=this._getText(t),i=this._advanceIf(13);this._addToParent(new YD(r,new ee(e.sourceSpan.start,(i||t).sourceSpan.end),[t]))}_consumeComment(e){let t=this._advanceIf(7),r=this._advanceIf(11),i=t!=null?t.parts[0].trim():null,s=new ee(e.sourceSpan.start,(r||t||e).sourceSpan.end);this._addToParent(new ty(i,s))}_consumeDocType(e){let t=this._advanceIf(7),r=this._advanceIf(19),i=t!=null?t.parts[0].trim():null,s=new ee(e.sourceSpan.start,(r||t||e).sourceSpan.end);this._addToParent(new ny(i,s))}_consumeExpansion(e){let t=this._advance(),r=this._advance(),i=[];for(;this._peek.type===21;){let o=this._parseExpansionCase();if(!o)return;i.push(o)}if(this._peek.type!==24){this.errors.push(wt.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));return}let s=new ee(e.sourceSpan.start,this._peek.sourceSpan.end,e.sourceSpan.fullStart);this._addToParent(new XD(t.parts[0],r.parts[0],i,s,t.sourceSpan)),this._advance()}_parseExpansionCase(){let e=this._advance();if(this._peek.type!==22)return this.errors.push(wt.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;let t=this._advance(),r=this._collectExpansionExpTokens(t);if(!r)return null;let i=this._advance();r.push({type:25,parts:[],sourceSpan:i.sourceSpan});let s=new id(r,this.getTagDefinition,this.canSelfClose,this.allowHtmComponentClosingTags,this.isTagNameCaseSensitive);if(s.build(),s.errors.length>0)return this.errors=this.errors.concat(s.errors),null;let o=new ee(e.sourceSpan.start,i.sourceSpan.end,e.sourceSpan.fullStart),a=new ee(t.sourceSpan.start,i.sourceSpan.end,t.sourceSpan.fullStart);return new ZD(e.parts[0],s.rootNodes,o,e.sourceSpan,a)}_collectExpansionExpTokens(e){let t=[],r=[22];for(;;){if((this._peek.type===20||this._peek.type===22)&&r.push(this._peek.type),this._peek.type===23)if(Zl(r,22)){if(r.pop(),r.length===0)return t}else return this.errors.push(wt.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===24)if(Zl(r,20))r.pop();else return this.errors.push(wt.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===25)return this.errors.push(wt.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;t.push(this._advance())}}_getText(e){let t=e.parts[0];if(t.length>0&&t[0]==`
`){let r=this._getParentElement();r!=null&&r.children.length==0&&this.getTagDefinition(r.name).ignoreFirstLf&&(t=t.substring(1))}return t}_consumeText(e){let t=[e],r=e.sourceSpan,i=e.parts[0];if(i.length>0&&i[0]===`
`){let s=this._getParentElement();s!=null&&s.children.length===0&&this.getTagDefinition(s.name).ignoreFirstLf&&(i=i.substring(1),t[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[i]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)e=this._advance(),t.push(e),e.type===8?i+=e.parts.join("").replace(/&([^;]+);/g,Ql):e.type===9?i+=e.parts[0]:i+=e.parts.join("");if(i.length>0){let s=e.sourceSpan;this._addToParent(new GD(i,new ee(r.start,s.end,r.fullStart,r.details),t))}}_closeVoidElement(){let e=this._getParentElement();e&&this.getTagDefinition(e.name).isVoid&&this._elementStack.pop()}_consumeStartTag(e){let[t,r]=e.parts,i=[];for(;this._peek.type===14;)i.push(this._consumeAttr(this._advance()));let s=this._getElementFullName(t,r,this._getParentElement()),o=!1;if(this._peek.type===2){this._advance(),o=!0;let y=this.getTagDefinition(s);this.canSelfClose||y.canSelfClose||ui(s)!==null||y.isVoid||this.errors.push(wt.create(s,e.sourceSpan,`Only void, custom and foreign elements can be self closed "${e.parts[1]}"`))}else this._peek.type===1&&(this._advance(),o=!1);let a=this._peek.sourceSpan.fullStart,l=new ee(e.sourceSpan.start,a,e.sourceSpan.fullStart),d=new ee(e.sourceSpan.start,a,e.sourceSpan.fullStart),h=new ee(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),D=new ey(s,i,[],l,d,void 0,h);this._pushElement(D),o?this._popElement(s,l):e.type===4&&(this._popElement(s,null),this.errors.push(wt.create(s,l,`Opening tag "${s}" not terminated.`)))}_pushElement(e){let t=this._getParentElement();t&&this.getTagDefinition(t.name).isClosedByChild(e.name)&&this._elementStack.pop(),this._addToParent(e),this._elementStack.push(e)}_consumeEndTag(e){let t=this.allowHtmComponentClosingTags&&e.parts.length===0?null:this._getElementFullName(e.parts[0],e.parts[1],this._getParentElement());if(t&&this.getTagDefinition(t).isVoid)this.errors.push(wt.create(t,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popElement(t,e.sourceSpan)){let r=`Unexpected closing tag "${t}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(wt.create(t,e.sourceSpan,r))}}_popElement(e,t){let r=!1;for(let i=this._elementStack.length-1;i>=0;i--){let s=this._elementStack[i];if(!e||(ui(s.name)?s.name==e:s.name.toLowerCase()==e.toLowerCase()))return s.endSourceSpan=t,s.sourceSpan.end=t!==null?t.end:s.sourceSpan.end,this._elementStack.splice(i,this._elementStack.length-i),!r;this.getTagDefinition(s.name).closedByParent||(r=!0)}return!1}_consumeAttr(e){let t=Di(e.parts[0],e.parts[1]),r=e.sourceSpan.end,i;this._peek.type===15&&(i=this._advance());let s="",o=[],a,l;if(this._peek.type===16)for(a=this._peek.sourceSpan,l=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let h=this._advance();o.push(h),h.type===17?s+=h.parts.join("").replace(/&([^;]+);/g,Ql):h.type===9?s+=h.parts[0]:s+=h.parts.join(""),l=r=h.sourceSpan.end}this._peek.type===15&&(l=r=this._advance().sourceSpan.end);let d=a&&l&&new ee(i?.sourceSpan.start??a.start,l,i?.sourceSpan.fullStart??a.fullStart);return new QD(t,s,new ee(e.sourceSpan.start,r,e.sourceSpan.fullStart),e.sourceSpan,d,o.length>0?o:void 0,void 0)}_getParentElement(){return this._elementStack.length>0?this._elementStack[this._elementStack.length-1]:null}_addToParent(e){let t=this._getParentElement();t!=null?t.children.push(e):this.rootNodes.push(e)}_getElementFullName(e,t,r){if(e===""&&(e=this.getTagDefinition(t).implicitNamespacePrefix||"",e===""&&r!=null)){let i=Yi(r.name)[1];this.getTagDefinition(i).preventNamespaceInheritance||(e=ui(r.name))}return Di(e,t)}};function Zl(n,e){return n.length>0&&n[n.length-1]===e}function Ql(n,e){return yi[e]!==void 0?yi[e]||n:/^#x[a-f0-9]+$/i.test(e)?String.fromCodePoint(parseInt(e.slice(2),16)):/^#\d+$/.test(e)?String.fromCodePoint(parseInt(e.slice(1),10)):n}var Sy=class extends vy{constructor(){super(Eo)}parse(n,e,t,r=!1,i){return super.parse(n,e,t,r,i)}},Ks=null,wy=()=>(Ks||(Ks=new Sy),Ks);function eu(n,e={}){let{canSelfClose:t=!1,allowHtmComponentClosingTags:r=!1,isTagNameCaseSensitive:i=!1,getTagContentType:s}=e;return wy().parse(n,"angular-html-parser",{tokenizeExpansionForms:!1,interpolationConfig:void 0,canSelfClose:t,allowHtmComponentClosingTags:r},i,s)}var Ey=new RegExp("^(?<startDelimiter>-{3}|\\+{3})(?<language>[^\\n]*)\\n(?:|(?<value>.*?)\\n)(?<endDelimiter>\\k<startDelimiter>|\\.{3})[^\\S\\n]*(?:\\n|$)","s");function xy(n){let e=n.match(Ey);if(!e)return{content:n};let{startDelimiter:t,language:r,value:i="",endDelimiter:s}=e.groups,o=r.trim()||"yaml";if(t==="+++"&&(o="toml"),o!=="yaml"&&t!==s)return{content:n};let[a]=e;return{frontMatter:{type:"front-matter",lang:o,value:i,startDelimiter:t,endDelimiter:s,raw:a.replace(/\n$/,"")},content:Je(!1,a,/[^\n]/g," ")+n.slice(a.length)}}var Ay=xy;function Fy(n,e){let t=new SyntaxError(n+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(t,e)}var Ty=Fy,My=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]),Gs=new Map([["*",new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","popover","slot","spellcheck","style","tabindex","title","translate"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["open"])],["dialog",new Set(["open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alt","autocomplete","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]),ni={attrs:!0,children:!0},tu=new Set(["parent"]),_y=class dr{constructor(e={}){for(let t of new Set([...tu,...Object.keys(e)]))this.setProperty(t,e[t])}setProperty(e,t){if(this[e]!==t){if(e in ni&&(t=t.map(r=>this.createChild(r))),!tu.has(e)){this[e]=t;return}Object.defineProperty(this,e,{value:t,enumerable:!1,configurable:!0})}}map(e){let t;for(let r in ni){let i=this[r];if(i){let s=By(i,o=>o.map(e));t!==i&&(t||(t=new dr({parent:this.parent})),t.setProperty(r,s))}}if(t)for(let r in this)r in ni||(t[r]=this[r]);return e(t||this)}walk(e){for(let t in ni){let r=this[t];if(r)for(let i=0;i<r.length;i++)r[i].walk(e)}e(this)}createChild(e){let t=e instanceof dr?e.clone():new dr(e);return t.setProperty("parent",this),t}insertChildBefore(e,t){this.children.splice(this.children.indexOf(e),0,this.createChild(t))}removeChild(e){this.children.splice(this.children.indexOf(e),1)}replaceChild(e,t){this.children[this.children.indexOf(e)]=this.createChild(t)}clone(){return new dr(this)}get firstChild(){var e;return(e=this.children)==null?void 0:e[0]}get lastChild(){var e;return(e=this.children)==null?void 0:e[this.children.length-1]}get prev(){var e;return(e=this.parent)==null?void 0:e.children[this.parent.children.indexOf(this)-1]}get next(){var e;return(e=this.parent)==null?void 0:e.children[this.parent.children.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(e=>[e.fullName,e.value]))}};function By(n,e){let t=n.map(e);return t.some((r,i)=>r!==n[i])?t:n}var Ny=[{regex:/^(\[if([^\]]*)]>)(.*?)<!\s*\[endif]$/s,parse:Iy},{regex:/^\[if([^\]]*)]><!$/,parse:Ly},{regex:/^<!\s*\[endif]$/,parse:Py}];function Oy(n,e){if(n.value)for(let{regex:t,parse:r}of Ny){let i=n.value.match(t);if(i)return r(n,e,i)}return null}function Iy(n,e,t){let[,r,i,s]=t,o=4+r.length,a=n.sourceSpan.start.moveBy(o),l=a.moveBy(s.length),[d,h]=(()=>{try{return[!0,e(s,a).children]}catch{return[!1,[{type:"text",value:s,sourceSpan:new ee(a,l)}]]}})();return{type:"ieConditionalComment",complete:d,children:h,condition:Je(!1,i.trim(),/\s+/g," "),sourceSpan:n.sourceSpan,startSourceSpan:new ee(n.sourceSpan.start,a),endSourceSpan:new ee(l,n.sourceSpan.end)}}function Ly(n,e,t){let[,r]=t;return{type:"ieConditionalStartComment",condition:Je(!1,r.trim(),/\s+/g," "),sourceSpan:n.sourceSpan}}function Py(n){return{type:"ieConditionalEndComment",sourceSpan:n.sourceSpan}}function sd(n,e,t){let{name:r,canSelfClose:i=!0,normalizeTagName:s=!1,normalizeAttributeName:o=!1,allowHtmComponentClosingTags:a=!1,isTagNameCaseSensitive:l=!1,shouldParseAsRawText:d}=e,{rootNodes:h,errors:D}=eu(n,{canSelfClose:i,allowHtmComponentClosingTags:a,isTagNameCaseSensitive:l,getTagContentType:d?(..._)=>d(..._)?tt.RAW_TEXT:void 0:void 0});if(r==="vue"){if(h.some(H=>H.type==="docType"&&H.value==="html"||H.type==="element"&&H.name.toLowerCase()==="html"))return sd(n,ad,t);let _,P=()=>_??(_=eu(n,{canSelfClose:i,allowHtmComponentClosingTags:a,isTagNameCaseSensitive:l})),W=H=>P().rootNodes.find(({startSourceSpan:X})=>X&&X.start.offset===H.startSourceSpan.start.offset)??H;for(let[H,X]of h.entries()){let{endSourceSpan:re,startSourceSpan:j}=X;if(re===null)D=P().errors,h[H]=W(X);else if(Ry(X,t)){let Ie=P().errors.find(mt=>mt.span.start.offset>j.start.offset&&mt.span.start.offset<re.end.offset);Ie&&nu(Ie),h[H]=W(X)}}}D.length>0&&nu(D[0]);let y=_=>{let P=_.name.startsWith(":")?_.name.slice(1).split(":")[0]:null,W=_.nameSpan.toString(),H=P!==null&&W.startsWith(`${P}:`),X=H?W.slice(P.length+1):W;_.name=X,_.namespace=P,_.hasExplicitNamespace=H},b=_=>{switch(_.type){case"element":y(_);for(let P of _.attrs)y(P),P.valueSpan?(P.value=P.valueSpan.toString(),/["']/.test(P.value[0])&&(P.value=P.value.slice(1,-1))):P.value=null;break;case"comment":_.value=_.sourceSpan.toString().slice(4,-3);break;case"text":_.value=_.sourceSpan.toString();break}},v=(_,P)=>{let W=_.toLowerCase();return P(W)?W:_},x=_=>{if(_.type==="element"&&(s&&(!_.namespace||_.namespace===_.tagDefinition.implicitNamespacePrefix||vr(_))&&(_.name=v(_.name,P=>My.has(P))),o))for(let P of _.attrs)P.namespace||(P.name=v(P.name,W=>Gs.has(_.name)&&(Gs.get("*").has(W)||Gs.get(_.name).has(W))))},M=_=>{_.sourceSpan&&_.endSourceSpan&&(_.sourceSpan=new ee(_.sourceSpan.start,_.endSourceSpan.end))},N=_=>{if(_.type==="element"){let P=Eo(l?_.name:_.name.toLowerCase());!_.namespace||_.namespace===P.implicitNamespacePrefix||vr(_)?_.tagDefinition=P:_.tagDefinition=Eo("")}};return Qc(new class extends ry{visit(_){b(_),N(_),x(_),M(_)}},h),h}function Ry(n,e){var t;if(n.type!=="element"||n.name!=="template")return!1;let r=(t=n.attrs.find(i=>i.name==="lang"))==null?void 0:t.value;return!r||$i(e,{language:r})==="html"}function nu(n){let{msg:e,span:{start:t,end:r}}=n;throw Ty(e,{loc:{start:{line:t.line+1,column:t.col+1},end:{line:r.line+1,column:r.col+1}},cause:n})}function od(n,e,t={},r=!0){let{frontMatter:i,content:s}=r?Ay(n):{frontMatter:null,content:n},o=new Vc(n,t.filepath),a=new ko(o,0,0,0),l=a.moveBy(n.length),d={type:"root",sourceSpan:new ee(a,l),children:sd(s,e,t)};if(i){let y=new ko(o,0,0,0),b=y.moveBy(i.raw.length);i.sourceSpan=new ee(y,b),d.children.unshift(i)}let h=new _y(d),D=(y,b)=>{let{offset:v}=b,x=Je(!1,n.slice(0,v),/[^\n\r]/g," "),M=od(x+y,e,t,!1);M.sourceSpan=new ee(b,ta(!1,M.children,-1).sourceSpan.end);let N=M.children[0];return N.length===v?M.children.shift():(N.sourceSpan=new ee(N.sourceSpan.start.moveBy(v),N.sourceSpan.end),N.value=N.value.slice(v)),M};return h.walk(y=>{if(y.type==="comment"){let b=Oy(y,D);b&&y.parent.replaceChild(y,b)}}),h}function Xi(n){return{parse:(e,t)=>od(e,n,t),hasPragma:P0,astFormat:"html",locStart:ji,locEnd:Wi}}var ad={name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0},zy=Xi(ad),qy=Xi({name:"angular"}),Hy=Xi({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(n,e,t,r){return n.toLowerCase()!=="html"&&!t&&(n!=="template"||r.some(({name:i,value:s})=>i==="lang"&&s!=="html"&&s!==""&&s!==void 0))}}),$y=Xi({name:"lwc",canSelfClose:!1}),Vy=[{linguistLanguageId:146,name:"Angular",type:"markup",tmScope:"text.html.basic",aceMode:"html",codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",color:"#e34c26",aliases:["xhtml"],extensions:[".component.html"],parsers:["angular"],vscodeLanguageIds:["html"],filenames:[]},{linguistLanguageId:146,name:"HTML",type:"markup",tmScope:"text.html.basic",aceMode:"html",codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",color:"#e34c26",aliases:["xhtml"],extensions:[".html",".hta",".htm",".html.hl",".inc",".xht",".xhtml",".mjml"],parsers:["html"],vscodeLanguageIds:["html"]},{linguistLanguageId:146,name:"Lightning Web Components",type:"markup",tmScope:"text.html.basic",aceMode:"html",codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",color:"#e34c26",aliases:["xhtml"],extensions:[],parsers:["lwc"],vscodeLanguageIds:["html"],filenames:[]},{linguistLanguageId:391,name:"Vue",type:"markup",color:"#41b883",extensions:[".vue"],tmScope:"text.html.vue",aceMode:"html",parsers:["vue"],vscodeLanguageIds:["vue"]}],ru={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}},iu="HTML",jy={bracketSameLine:ru.bracketSameLine,htmlWhitespaceSensitivity:{category:iu,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:ru.singleAttributePerLine,vueIndentScriptAndStyle:{category:iu,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},Wy=jy,Uy={html:zD},Jy=Cc;function ye(n){this.content=n}ye.prototype={constructor:ye,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new ye(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ye(t)},addToStart:function(n,e){return new ye([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ye(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new ye(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ye.from(n),n.size?new ye(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ye.from(n),n.size?new ye(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ye.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ye.from=function(n){if(n instanceof ye)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ye(e)};function ld(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=ld(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function ud(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let o=n.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:t,b:r};if(o.isText&&o.text!=a.text){let d=0,h=Math.min(o.text.length,a.text.length);for(;d<h&&o.text[o.text.length-d-1]==a.text[a.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(o.content.size||a.content.size){let d=ud(o.content,a.content,t-1,r-1);if(d)return d}t-=l,r-=l}}class I{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],d=a+l.nodeSize;if(d>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let h=a+1;l.nodesBetween(Math.max(0,e-h),Math.min(l.content.size,t-h),r,i+h)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{a.isText?(s+=a.text.slice(Math.max(e,l)-l,t-l),o=!r):a.isLeaf?(i?s+=typeof i=="function"?i(a):i:a.type.spec.leafText&&(s+=a.type.spec.leafText(a)),o=!r):!o&&a.isBlock&&(s+=r,o=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new I(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),r.push(a),i+=a.nodeSize),o=l}return new I(r,i)}cutByIndex(e,t){return e==t?I.empty:e==0&&t==this.content.length?this:new I(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new I(i,s)}addToStart(e){return new I([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new I(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return ld(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return ud(this,e,t,r)}findIndex(e,t=-1){if(e==0)return ri(0,e);if(e==this.size)return ri(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),o=i+s.nodeSize;if(o>=e)return o==e||t>0?ri(r+1,o):ri(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return I.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new I(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return I.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new I(t||e,r)}static from(e){if(!e)return I.empty;if(e instanceof I)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new I([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}I.empty=new I([],0);const Ys={index:0,offset:0};function ri(n,e){return Ys.index=n,Ys.offset=e,Ys}function Ci(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Ci(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Ci(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let te=class Fo{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ci(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Fo.none;if(e instanceof Fo)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};te.none=[];class vi extends Error{}class R{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=dd(this.content,e+this.openStart,t);return r&&new R(r,this.openStart,this.openEnd)}removeBetween(e,t){return new R(cd(this.content,e+this.openStart,t+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,t){if(!t)return R.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new R(I.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new R(e,r,i)}}R.empty=new R(I.empty,0,0);function cd(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(t);if(i==e||s.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(cd(s.content,e-i-1,t-i-1)))}function dd(n,e,t,r){let{index:i,offset:s}=n.findIndex(e),o=n.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=dd(o.content,e-s-1,t);return a&&n.replaceChild(i,o.copy(a))}function Ky(n,e,t){if(t.openStart>n.depth)throw new vi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new vi("Inconsistent open depths");return hd(n,e,t,0)}function hd(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let o=hd(n,e,t,r+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,a=o.content;return fn(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Gy(t,n);return fn(s,fd(n,o,a,e,r))}else return fn(s,ki(n,e,r))}function pd(n,e){if(!e.type.compatibleContent(n.type))throw new vi("Cannot join "+e.type.name+" onto "+n.type.name)}function To(n,e,t){let r=n.node(t);return pd(r,e.node(t)),r}function pn(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function gr(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(pn(n.nodeAfter,r),s++));for(let a=s;a<o;a++)pn(i.child(a),r);e&&e.depth==t&&e.textOffset&&pn(e.nodeBefore,r)}function fn(n,e){return n.type.checkContent(e),n.copy(e)}function fd(n,e,t,r,i){let s=n.depth>i&&To(n,e,i+1),o=r.depth>i&&To(t,r,i+1),a=[];return gr(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(pd(s,o),pn(fn(s,fd(n,e,t,r,i+1)),a)):(s&&pn(fn(s,ki(n,e,i+1)),a),gr(e,t,i,a),o&&pn(fn(o,ki(t,r,i+1)),a)),gr(r,null,i,a),new I(a)}function ki(n,e,t){let r=[];if(gr(null,n,t,r),n.depth>t){let i=To(n,e,t+1);pn(fn(i,ki(n,e,t+1)),r)}return gr(e,null,t,r),new I(r)}function Gy(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(I.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class wr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return te.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Si(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),d=s-l;if(r.push(o,a,i+l),!d||(o=o.child(a),o.isText))break;s=d-1,i+=l+1}return new wr(t,r,s)}static resolveCached(e,t){for(let i=0;i<Xs.length;i++){let s=Xs[i];if(s.pos==t&&s.doc==e)return s}let r=Xs[Zs]=wr.resolve(e,t);return Zs=(Zs+1)%Yy,r}}let Xs=[],Zs=0,Yy=12;class Si{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Xy=Object.create(null);let mn=class Mo{constructor(e,t,r,i=te.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||I.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Ci(this.attrs,t||e.defaultAttrs||Xy)&&te.sameSet(this.marks,r||te.none)}copy(e=null){return e==this.content?this:new Mo(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Mo(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return R.empty;let i=this.resolve(e),s=this.resolve(t),o=r?0:i.sharedDepth(t),a=i.start(o),d=i.node(o).content.cut(i.pos-a,s.pos-a);return new R(d,i.depth-o,s.depth-o)}replace(e,t,r){return Ky(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return wr.resolveCached(this,e)}resolveNoCache(e){return wr.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.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()+")"),md(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=I.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=te.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!te.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t 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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=I.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};mn.prototype.text=void 0;class wi extends mn{constructor(e,t,r,i){if(super(e,t,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):md(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new wi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new wi(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function md(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class kn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Zy(e,t);if(r.next==null)return kn.empty;let i=gd(r);r.next&&r.err("Unexpected trailing text");let s=s1(i1(i));return o1(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let s=t;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!t||l.validEnd))return I.from(a.map(d=>d.createAndFill()));for(let d=0;d<o.next.length;d++){let{type:h,next:D}=o.next[d];if(!(h.isText||h.hasRequiredAttrs())&&i.indexOf(D)==-1){i.push(D);let y=s(D,a.concat(h));if(y)return y}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
`)}}kn.empty=new kn(!0);class Zy{constructor(e,t){this.string=e,this.nodeTypes=t,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 gd(n){let e=[];do e.push(Qy(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Qy(n){let e=[];do e.push(e1(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function e1(n){let e=r1(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=t1(n,e);else break;return e}function su(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function t1(n,e){let t=su(n),r=t;return n.eat(",")&&(n.next!="}"?r=su(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function n1(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let o=t[s];o.groups.indexOf(e)>-1&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function r1(n){if(n.eat("(")){let e=gd(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=n1(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function i1(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(o,a,l){let d={term:l,to:a};return e[o].push(d),d}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,d)=>l.concat(s(d,a)),[]);if(o.type=="seq")for(let l=0;;l++){let d=s(o.exprs[l],a);if(l==o.exprs.length-1)return d;i(d,a=t())}else if(o.type=="star"){let l=t();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let d=0;d<o.min;d++){let h=t();i(s(o.expr,l),h),l=h}if(o.max==-1)i(s(o.expr,l),l);else for(let d=o.min;d<o.max;d++){let h=t();r(l,h),i(s(o.expr,l),h),l=h}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Dd(n,e){return e-n}function ou(n,e){let t=[];return r(e),t.sort(Dd);function r(i){let s=n[i];if(s.length==1&&!s[0].term)return r(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&t.indexOf(l)==-1&&r(l)}}}function s1(n){let e=Object.create(null);return t(ou(n,0));function t(r){let i=[];r.forEach(o=>{n[o].forEach(({term:a,to:l})=>{if(!a)return;let d;for(let h=0;h<i.length;h++)i[h][0]==a&&(d=i[h][1]);ou(n,l).forEach(h=>{d||i.push([a,d=[]]),d.indexOf(h)==-1&&d.push(h)})})});let s=e[r.join(",")]=new kn(r.indexOf(n.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(Dd);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function o1(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:d}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(d)==-1&&r.push(d)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function yd(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function bd(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let s=n[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Cd(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new a1(n[t]);return e}let au=class vd{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Cd(r.attrs),this.defaultAttrs=yd(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==kn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:bd(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new mn(this,this.computeAttrs(e),I.from(t),te.setFrom(r))}createChecked(e=null,t,r){return t=I.from(t),this.checkContent(t),new mn(this,this.computeAttrs(e),t,te.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=I.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(I.empty,!0);return s?new mn(this,e,t.append(s),te.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:te.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,o)=>r[s]=new vd(s,t,o));let i=t.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 s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class a1{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Zi{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Cd(i.attrs),this.excluded=null;let s=yd(this.attrs);this.instance=s?new te(this,s):null}create(e=null){return!e&&this.instance?this.instance:new te(this,bd(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Zi(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class l1{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=ye.from(e.nodes),t.marks=ye.from(e.marks||{}),this.nodes=au.compile(this.spec.nodes,this),this.marks=Zi.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 s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;s.contentMatch=r[o]||(r[o]=kn.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.markSet=a=="_"?null:a?lu(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:lu(this,o.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,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof au){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(t,r,i)}text(e,t){let r=this.nodes.text;return new wi(r,r.defaultAttrs,e,te.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return mn.fromJSON(this,e)}markFromJSON(e){return te.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function lu(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],s=n.marks[i],o=s;if(s)t.push(s);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class Vn{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.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,t={}){let r=new cu(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new cu(this,t,!0);return r.addAll(e,t.from,t.to),R.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(d1(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=du(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=du(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Vn(e,Vn.schemaRules(e)))}}const kd={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},u1={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Sd={ol:!0,ul:!0},Ei=1,xi=2,Dr=4;function uu(n,e,t){return e!=null?(e?Ei:0)|(e==="full"?xi:0):n&&n.whitespace=="pre"?Ei|xi:t&~Dr}class ii{constructor(e,t,r,i,s,o,a){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=s,this.options=a,this.content=[],this.activeMarks=te.none,this.stashMarks=[],this.match=o||(a&Dr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(I.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);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&Ei)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=I.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(I.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):p1(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!kd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class cu{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,s,o=uu(null,t.preserveWhitespace,0)|(r?Dr:0);i?s=new ii(i.type,i.attrs,te.none,te.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new ii(null,null,te.none,te.none,!0,null,o):s=new ii(e.schema.topNodeType,null,te.none,te.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let t=e.getAttribute("style");if(!t)this.addElement(e);else{let r=this.readStyles(h1(t));if(!r)return;let[i,s]=r,o=this.top;for(let a=0;a<s.length;a++)this.removePendingMark(s[a],o);for(let a=0;a<i.length;a++)this.addPendingMark(i[a]);this.addElement(e);for(let a=0;a<i.length;a++)this.removePendingMark(i[a],o);for(let a=0;a<s.length;a++)this.addPendingMark(s[a])}}}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&xi||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Ei)r.options&xi?t=t.replace(/\r\n?/g,`
`):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],s=e.previousSibling;(!i||s&&s.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;Sd.hasOwnProperty(r)&&this.parser.normalizeLists&&c1(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(s?s.ignore:u1.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let o,a=this.top,l=this.needsBlock;if(kd.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),o=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),o&&this.sync(a),this.needsBlock=l}else this.addElementByRule(e,s,s.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 t=te.none,r=te.none;for(let i=0;i<e.length;i+=2)for(let s=void 0;;){let o=this.parser.matchStyle(e[i],e[i+1],this,s);if(!o)break;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{o.clearMark(a)&&(r=a.addToSet(r))}):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),o.consuming===!1)s=o;else break}return[t,r]}addElementByRule(e,t,r){let i,s,o;t.node?(s=this.parser.schema.nodes[t.node],s.isLeaf?this.insertNode(s.create(t.attrs))||this.leafFallback(e):i=this.enter(s,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,o&&this.removePendingMark(o,a)}addAll(e,t,r){let i=t||0;for(let s=t?e.childNodes[t]:e.firstChild,o=r==null?null:e.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,r=s,!o.length)||s.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let s=this.top;s.applyPending(e),s.match=s.match&&s.match.matchType(e);let o=uu(e,i,s.options);s.options&Dr&&s.content.length==0&&(o|=Dr),this.nodes.push(new ii(e,t,s.activeMarks,s.pendingMarks,r,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let d=t[a];if(d==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let h=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!h||h.name!=d&&h.groups.indexOf(d)==-1)return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=f1(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){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 o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function c1(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Sd.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function d1(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function h1(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function du(n){let e={};for(let t in n)e[t]=n[t];return e}function p1(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:d,next:h}=a.edge(l);if(d==e||s.indexOf(h)<0&&o(h))return!0}};if(o(i.contentMatch))return!0}}function f1(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class ct{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Qs(t).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let d=o.marks[l];if(!this.marks[d.type.name]){l++;continue}if(!d.eq(s[a][0])||d.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let d=o.marks[l++],h=this.serializeMark(d,o.isInline,t);h&&(s.push([d,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=ct.renderSpec(Qs(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&ct.renderSpec(Qs(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let o,a=r?e.createElementNS(r,i):e.createElement(i),l=t[1],d=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){d=2;for(let h in l)if(l[h]!=null){let D=h.indexOf(" ");D>0?a.setAttributeNS(h.slice(0,D),h.slice(D+1),l[h]):a.setAttribute(h,l[h])}}for(let h=d;h<t.length;h++){let D=t[h];if(D===0){if(h<t.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:y,contentDOM:b}=ct.renderSpec(e,D,r);if(a.appendChild(y),b){if(o)throw new RangeError("Multiple content holes");o=b}}}return{dom:a,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ct(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=hu(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return hu(e.marks)}}function hu(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Qs(n){return n.document||window.document}const wd=65535,Ed=Math.pow(2,16);function m1(n,e){return n+e*Ed}function pu(n){return n&wd}function g1(n){return(n-(n&wd))/Ed}const xd=1,Ad=2,di=4,Fd=8;class _o{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Fd)>0}get deletedBefore(){return(this.delInfo&(xd|di))>0}get deletedAfter(){return(this.delInfo&(Ad|di))>0}get deletedAcross(){return(this.delInfo&di)>0}}class je{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&je.empty)return je.empty}recover(e){let t=0,r=pu(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+g1(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let d=this.ranges[a+s],h=this.ranges[a+o],D=l+d;if(e<=D){let y=d?e==l?-1:e==D?1:t:t,b=l+i+(y<0?0:h);if(r)return b;let v=e==(t<0?l:D)?null:m1(a/3,e-l),x=e==l?Ad:e==D?xd:di;return(t<0?e!=l:e!=D)&&(x|=Fd),new _o(b,x,v)}i+=h-d}return r?e+i:new _o(e+i,0,null)}touches(e,t){let r=0,i=pu(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let d=this.ranges[a+s],h=l+d;if(e<=h&&a==i*3)return!0;r+=this.ranges[a+o]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),d=this.ranges[i+t],h=this.ranges[i+r];e(a,a+d,l,l+h),s+=h-d}}invert(){return new je(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?je.empty:new je(e<0?[0,-e,0]:[0,0,e])}}je.empty=new je([]);class Rn{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Rn(this.maps,this.mirror,e,t)}copy(){return new Rn(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Rn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this.maps[s],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new _o(e,i,null)}}const eo=Object.create(null);class Oe{getMap(){return je.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=eo[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in eo)throw new RangeError("Duplicate use of step JSON ID "+e);return eo[e]=t,t.prototype.jsonID=e,t}}class ce{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ce(e,null)}static fail(e){return new ce(null,e)}static fromReplace(e,t,r,i){try{return ce.ok(e.replace(t,r,i))}catch(s){if(s instanceof vi)return ce.fail(s.message);throw s}}}function ha(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(ha(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return I.fromArray(r)}class Rt extends Oe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new R(ha(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return ce.fromReplace(e,this.from,this.to,s)}invert(){return new dt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Rt(t.pos,r.pos,this.mark)}merge(e){return e instanceof Rt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Rt(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Rt(t.from,t.to,e.markFromJSON(t.mark))}}Oe.jsonID("addMark",Rt);class dt extends Oe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new R(ha(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return ce.fromReplace(e,this.from,this.to,r)}invert(){return new Rt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new dt(t.pos,r.pos,this.mark)}merge(e){return e instanceof dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dt(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new dt(t.from,t.to,e.markFromJSON(t.mark))}}Oe.jsonID("removeMark",dt);class zt extends Oe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ce.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ce.fromReplace(e,this.pos,this.pos+1,new R(I.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new zt(this.pos,t.marks[i]);return new zt(this.pos,this.mark)}}return new jn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new zt(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new zt(t.pos,e.markFromJSON(t.mark))}}Oe.jsonID("addNodeMark",zt);class jn extends Oe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ce.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ce.fromReplace(e,this.pos,this.pos+1,new R(I.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new zt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new jn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new jn(t.pos,e.markFromJSON(t.mark))}}Oe.jsonID("removeNodeMark",jn);class ke extends Oe{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Bo(e,this.from,this.to)?ce.fail("Structure replace would overwrite content"):ce.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new je([this.from,this.to-this.from,this.slice.size])}invert(e){return new ke(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new ke(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ke)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?R.empty:new R(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ke(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?R.empty:new R(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ke(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ke(t.from,t.to,R.fromJSON(e,t.slice),!!t.structure)}}Oe.jsonID("replace",ke);class pe extends Oe{constructor(e,t,r,i,s,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Bo(e,this.from,this.gapFrom)||Bo(e,this.gapTo,this.to)))return ce.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ce.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?ce.fromReplace(e,this.from,this.to,r):ce.fail("Content does not fit in gap")}getMap(){return new je([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new pe(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),s=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new pe(t.pos,r.pos,i,s,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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new pe(t.from,t.to,t.gapFrom,t.gapTo,R.fromJSON(e,t.slice),t.insert,!!t.structure)}}Oe.jsonID("replaceAround",pe);function Bo(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function D1(n,e,t,r){let i=[],s=[],o,a;n.doc.nodesBetween(e,t,(l,d,h)=>{if(!l.isInline)return;let D=l.marks;if(!r.isInSet(D)&&h.type.allowsMarkType(r.type)){let y=Math.max(d,e),b=Math.min(d+l.nodeSize,t),v=r.addToSet(D);for(let x=0;x<D.length;x++)D[x].isInSet(v)||(o&&o.to==y&&o.mark.eq(D[x])?o.to=b:i.push(o=new dt(y,b,D[x])));a&&a.to==y?a.to=b:s.push(a=new Rt(y,b,r))}}),i.forEach(l=>n.step(l)),s.forEach(l=>n.step(l))}function y1(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof Zi){let d=o.marks,h;for(;h=r.isInSet(d);)(l||(l=[])).push(h),d=h.removeFromSet(d)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let d=Math.min(a+o.nodeSize,t);for(let h=0;h<l.length;h++){let D=l[h],y;for(let b=0;b<i.length;b++){let v=i[b];v.step==s-1&&D.eq(i[b].style)&&(y=v)}y?(y.to=d,y.step=s):i.push({style:D,from:Math.max(a,e),to:d,step:s})}}}),i.forEach(o=>n.step(new dt(o.from,o.to,o.style)))}function b1(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),s=[],o=e+1;for(let a=0;a<i.childCount;a++){let l=i.child(a),d=o+l.nodeSize,h=r.matchType(l.type);if(!h)s.push(new ke(o,d,R.empty));else{r=h;for(let D=0;D<l.marks.length;D++)t.allowsMarkType(l.marks[D].type)||n.step(new dt(o,d,l.marks[D]))}o=d}if(!r.validEnd){let a=r.fillBefore(I.empty,!0);n.replace(o,o,new R(a,0,0))}for(let a=s.length-1;a>=0;a--)n.step(s[a])}function C1(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Zn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),s=n.$from.index(r),o=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(s,o,t))return r;if(r==0||i.type.spec.isolating||!C1(i,s,o))break}return null}function v1(n,e,t){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,d=a,h=I.empty,D=0;for(let v=s,x=!1;v>t;v--)x||r.index(v)>0?(x=!0,h=I.from(r.node(v).copy(h)),D++):l--;let y=I.empty,b=0;for(let v=s,x=!1;v>t;v--)x||i.after(v+1)<i.end(v)?(x=!0,y=I.from(i.node(v).copy(y)),b++):d++;n.step(new pe(l,d,o,a,new R(h.append(y),D,b),h.size-D,!0))}function pa(n,e,t=null,r=n){let i=k1(n,e),s=i&&S1(r,e);return s?i.map(fu).concat({type:e,attrs:t}).concat(s.map(fu)):null}function fu(n){return{type:n,attrs:null}}function k1(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(r,i,o)?s:null}function S1(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let d=r;l&&d<i;d++)l=l.matchType(t.child(d).type);return!l||!l.validEnd?null:o}function w1(n,e,t){let r=I.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let a=t[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=I.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new pe(i,s,i,s,new R(r,0,0),t.length,!0))}function E1(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(o,a)=>{if(o.isTextblock&&!o.hasMarkup(r,i)&&x1(n.doc,n.mapping.slice(s).map(a),r)){n.clearIncompatible(n.mapping.slice(s).map(a,1),r);let l=n.mapping.slice(s),d=l.map(a,1),h=l.map(a+o.nodeSize,1);return n.step(new pe(d,h,d+1,h-1,new R(I.from(r.create(i,null,o.marks)),0,0),1,!0)),!1}})}function x1(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function A1(n,e,t,r,i){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(r,null,i||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new pe(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new R(I.from(o),0,0),1,!0))}function zn(n,e,t=1,r){let i=n.resolve(e),s=i.depth-t,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,h=t-2;d>s;d--,h--){let D=i.node(d),y=i.index(d);if(D.type.spec.isolating)return!1;let b=D.content.cutByIndex(y,D.childCount),v=r&&r[h+1];v&&(b=b.replaceChild(0,v.type.create(v.attrs)));let x=r&&r[h]||D;if(!D.canReplace(y+1,D.childCount)||!x.type.validContent(b))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function F1(n,e,t=1,r){let i=n.doc.resolve(e),s=I.empty,o=I.empty;for(let a=i.depth,l=i.depth-t,d=t-1;a>l;a--,d--){s=I.from(i.node(a).copy(s));let h=r&&r[d];o=I.from(h?h.type.create(h.attrs,o):i.node(a).copy(o))}n.step(new ke(e,e,new R(s.append(o),t,t),!0))}function Kt(n,e){let t=n.resolve(e),r=t.index();return Td(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Td(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Qi(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):t>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&Td(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function T1(n,e,t){let r=new ke(e-t,e+t,R.empty,!0);n.step(r)}function M1(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,t))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,t))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function Md(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),d=r.node(o),h=!1;if(s==1)h=d.canReplace(l,l,i);else{let D=d.contentMatchAt(l).findWrapping(i.firstChild.type);h=D&&d.canReplaceWith(l,l,D[0])}if(h)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function fa(n,e,t=e,r=R.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return _d(i,s,r)?new ke(e,t,r):new _1(i,s,r).fit()}function _d(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class _1{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=I.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=I.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(),t=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 s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new R(s,o,a);return e>-1?new pe(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new ke(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}t=s.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=to(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:d}=this.frontier[a],h,D=null;if(t==1&&(o?d.matchType(o.type)||(D=d.fillBefore(I.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:D};if(t==2&&o&&(h=d.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:h};if(s&&d.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=to(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new R(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=to(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new R(hr(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new R(hr(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let x=0;x<s.length;x++)this.openFrontierNode(s[x]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,d=0,h=[],{match:D,type:y}=this.frontier[t];if(i){for(let x=0;x<i.childCount;x++)h.push(i.child(x));D=D.matchFragment(i)}let b=a.size+e-(o.content.size-o.openEnd);for(;d<a.childCount;){let x=a.child(d),M=D.matchType(x.type);if(!M)break;d++,(d>1||l==0||x.content.size)&&(D=M,h.push(Bd(x.mark(y.allowedMarks(x.marks)),d==1?l:0,d==a.childCount?b:-1)))}let v=d==a.childCount;v||(b=-1),this.placed=pr(this.placed,t,I.from(h)),this.frontier[t].match=D,v&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let x=0,M=a;x<b;x++){let N=M.lastChild;this.frontier.push({type:N.type,match:N.contentMatchAt(N.childCount)}),M=N.content}this.unplaced=v?e==0?R.empty:new R(hr(o.content,e-1,1),e-1,b<0?o.openEnd:e-1):new R(hr(o.content,e,d),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!no(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=no(e,t,i,r,s);if(o){for(let a=t-1;a>=0;a--){let{match:l,type:d}=this.frontier[a],h=no(e,a,d,l,!0);if(!h||h.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=pr(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=pr(this.placed,this.depth,I.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(I.empty,!0);t.childCount&&(this.placed=pr(this.placed,this.frontier.length,t))}}function hr(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(hr(n.firstChild.content,e-1,t)))}function pr(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(pr(n.lastChild.content,e-1,t)))}function to(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Bd(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Bd(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(I.empty,!0)))),n.copy(r)}function no(n,e,t,r,i){let s=n.node(e),o=i?n.indexAfter(e):n.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!B1(t,s.content,o)?a:null}function B1(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function N1(n){return n.spec.defining||n.spec.definingForContent}function O1(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),s=n.doc.resolve(t);if(_d(i,s,r))return n.step(new ke(e,t,r));let o=Od(i,n.doc.resolve(t));o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let y=i.depth,b=i.pos-1;y>0;y--,b--){let v=i.node(y).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;o.indexOf(y)>-1?a=y:i.before(y)==b&&o.splice(1,0,-y)}let l=o.indexOf(a),d=[],h=r.openStart;for(let y=r.content,b=0;;b++){let v=y.firstChild;if(d.push(v),b==r.openStart)break;y=v.content}for(let y=h-1;y>=0;y--){let b=d[y].type,v=N1(b);if(v&&i.node(l).type!=b)h=y;else if(v||!b.isTextblock)break}for(let y=r.openStart;y>=0;y--){let b=(y+h+1)%(r.openStart+1),v=d[b];if(v)for(let x=0;x<o.length;x++){let M=o[(x+l)%o.length],N=!0;M<0&&(N=!1,M=-M);let _=i.node(M-1),P=i.index(M-1);if(_.canReplaceWith(P,P,v.type,v.marks))return n.replace(i.before(M),N?s.after(M):t,new R(Nd(r.content,0,r.openStart,b),b,r.openEnd))}}let D=n.steps.length;for(let y=o.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>D));y--){let b=o[y];b<0||(e=i.before(b),t=s.after(b))}}function Nd(n,e,t,r,i){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(Nd(s.content,e+1,t,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(n).append(n);n=o.append(s.matchFragment(o).fillBefore(I.empty,!0))}return n}function I1(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=M1(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new R(I.from(r),0,0))}function L1(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),s=Od(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return n.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return n.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&t>r.end(o)&&i.end(o)-t!=i.depth-o)return n.delete(r.before(o),t);n.delete(e,t)}function Od(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(s<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class qn extends Oe{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return ce.fail("No node at attribute step's position");let r=Object.create(null);for(let s in t.attrs)r[s]=t.attrs[s];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return ce.fromReplace(e,this.pos,this.pos+1,new R(I.from(i),0,t.isLeaf?0:1))}getMap(){return je.empty}invert(e){return new qn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new qn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new qn(t.pos,t.attr,t.value)}}Oe.jsonID("attr",qn);let Wn=class extends Error{};Wn=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};Wn.prototype=Object.create(Error.prototype);Wn.prototype.constructor=Wn;Wn.prototype.name="TransformError";class P1{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Rn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Wn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=R.empty){let i=fa(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new R(I.from(r),0,0))}delete(e,t){return this.replace(e,t,R.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return O1(this,e,t,r),this}replaceRangeWith(e,t,r){return I1(this,e,t,r),this}deleteRange(e,t){return L1(this,e,t),this}lift(e,t){return v1(this,e,t),this}join(e,t=1){return T1(this,e,t),this}wrap(e,t){return w1(this,e,t),this}setBlockType(e,t=e,r,i=null){return E1(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return A1(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new qn(e,t,r)),this}addNodeMark(e,t){return this.step(new zt(e,t)),this}removeNodeMark(e,t){if(!(t instanceof te)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new jn(e,t)),this}split(e,t=1,r){return F1(this,e,t,r),this}addMark(e,t,r){return D1(this,e,t,r),this}removeMark(e,t,r){return y1(this,e,t,r),this}clearIncompatible(e,t,r){return b1(this,e,t,r),this}}const ro=Object.create(null);class G{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new R1(e.min(t),e.max(t))]}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 t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=R.empty){let r=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:d}=o[a],h=e.mapping.slice(s);e.replaceRange(h.map(l.pos),h.map(d.pos),a?R.empty:t),a==0&&Du(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),d=l.map(o.pos),h=l.map(a.pos);s?e.deleteRange(d,h):(e.replaceRangeWith(d,h,t),Du(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new J(e):On(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?On(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):On(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new it(e.node(0))}static atStart(e){return On(e,e,0,0,1)||new it(e)}static atEnd(e){return On(e,e,e.content.size,e.childCount,-1)||new it(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ro[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ro)throw new RangeError("Duplicate use of selection JSON ID "+e);return ro[e]=t,t.prototype.jsonID=e,t}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}}G.prototype.visible=!0;class R1{constructor(e,t){this.$from=e,this.$to=t}}let mu=!1;function gu(n){!mu&&!n.parent.inlineContent&&(mu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class J extends G{constructor(e,t=e){gu(e),gu(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return G.near(r);let i=e.resolve(t.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(e,t=R.empty){if(super.replace(e,t),t==R.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof J&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new es(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new J(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let s=G.findFrom(t,r,!0)||G.findFrom(t,-r,!0);if(s)t=s.$head;else return G.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(G.findFrom(e,-r,!0)||G.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new J(e,t)}}G.jsonID("text",J);class es{constructor(e,t){this.anchor=e,this.head=t}map(e){return new es(e.map(this.anchor),e.map(this.head))}resolve(e){return J.between(e.resolve(this.anchor),e.resolve(this.head))}}class $ extends G{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return r?G.near(s):new $(s)}content(){return new R(I.from(this.node),0,0)}eq(e){return e instanceof $&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ma(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new $(e.resolve(t.anchor))}static create(e,t){return new $(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}$.prototype.visible=!1;G.jsonID("node",$);class ma{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new es(r,r):new ma(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&$.isSelectable(r)?new $(t):G.near(t)}}class it extends G{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=R.empty){if(t==R.empty){e.delete(0,e.doc.content.size);let r=G.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new it(e)}map(e){return new it(e)}eq(e){return e instanceof it}getBookmark(){return z1}}G.jsonID("all",it);const z1={map(){return this},resolve(n){return new it(n)}};function On(n,e,t,r,i,s=!1){if(e.inlineContent)return J.create(n,t);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&$.isSelectable(a))return $.create(n,t-(i<0?a.nodeSize:0))}else{let l=On(n,a,t+i,i<0?a.childCount:0,i,s);if(l)return l}t+=a.nodeSize*i}return null}function Du(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof ke||i instanceof pe))return;let s=n.mapping.maps[r],o;s.forEach((a,l,d,h)=>{o==null&&(o=h)}),n.setSelection(G.near(n.doc.resolve(o),t))}const yu=1,si=2,bu=4;class q1 extends P1{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|yu)&~si,this.storedMarks=null,this}get selectionSet(){return(this.updated&yu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=si,this}ensureMarks(e){return te.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&si)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~si,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||te.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=r==t?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,s)),this.selection.empty||this.setSelection(G.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,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|=bu,this}get scrolledIntoView(){return(this.updated&bu)>0}}function Cu(n,e){return!e||!n?n:n.bind(e)}class fr{constructor(e,t,r){this.name=e,this.init=Cu(t.init,r),this.apply=Cu(t.apply,r)}}const H1=[new fr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new fr("selection",{init(n,e){return n.selection||G.atStart(e.doc)},apply(n){return n.selection}}),new fr("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new fr("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class io{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=H1.slice(),t&&t.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 fr(r.key,r.spec.state,r))})}}class Ln{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,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,d=i?i[o].state:this,h=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,d,r);if(h&&r.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",e),!i){i=[];for(let D=0;D<this.config.plugins.length;D++)i.push(D<o?{state:r,n:t.length}:{state:this,n:0})}t.push(h),r=r.applyInner(h),s=!0}i&&(i[o]={state:r,n:t.length})}}if(!s)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Ln(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new q1(this)}static create(e){let t=new io(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ln(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new io(this.schema,e.plugins),r=t.fields,i=new Ln(t);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(t[r]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new io(e.schema,e.plugins),s=new Ln(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=mn.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=G.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],d=l.spec.state;if(l.key==o.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=d.fromJSON.call(l,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function Id(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Id(i,e,{})),t[r]=i}return t}class Ye{constructor(e){this.spec=e,this.props={},e.props&&Id(e.props,this,this.props),this.key=e.key?e.key.key:Ld("plugin")}getState(e){return e[this.key]}}const so=Object.create(null);function Ld(n){return n in so?n+"$"+ ++so[n]:(so[n]=0,n+"$")}class Gt{constructor(e="key"){this.key=Ld(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const We=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Er=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let vu=null;const Et=function(n,e,t){let r=vu||(vu=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Sn=function(n,e,t,r){return t&&(ku(n,e,t,r,-1)||ku(n,e,t,r,1))},$1=/^(img|br|input|textarea|hr)$/i;function ku(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ut(n))){let s=n.parentNode;if(!s||s.nodeType!=1||j1(n)||$1.test(n.nodeName)||n.contentEditable=="false")return!1;e=We(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?ut(n):0}else return!1}}function ut(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function V1(n,e,t){for(let r=e==0,i=e==ut(n);r||i;){if(n==t)return!0;let s=We(n);if(n=n.parentNode,!n)return!1;r=r&&s==0,i=i&&s==ut(n)}}function j1(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ts=function(n){return n.focusNode&&Sn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function on(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function W1(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function U1(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const ht=typeof navigator<"u"?navigator:null,Su=typeof document<"u"?document:null,Yt=ht&&ht.userAgent||"",No=/Edge\/(\d+)/.exec(Yt),Pd=/MSIE \d/.exec(Yt),Oo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yt),Ne=!!(Pd||Oo||No),Ht=Pd?document.documentMode:Oo?+Oo[1]:No?+No[1]:0,st=!Ne&&/gecko\/(\d+)/i.test(Yt);st&&+(/Firefox\/(\d+)/.exec(Yt)||[0,0])[1];const Io=!Ne&&/Chrome\/(\d+)/.exec(Yt),Se=!!Io,J1=Io?+Io[1]:0,Ee=!Ne&&!!ht&&/Apple Computer/.test(ht.vendor),Un=Ee&&(/Mobile\/\w+/.test(Yt)||!!ht&&ht.maxTouchPoints>2),He=Un||(ht?/Mac/.test(ht.platform):!1),K1=ht?/Win/.test(ht.platform):!1,Qe=/Android \d/.test(Yt),ns=!!Su&&"webkitFontSmoothing"in Su.documentElement.style,G1=ns?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Y1(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Ot(n,e){return typeof n=="number"?n:n[e]}function X1(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function wu(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,s=n.dom.ownerDocument;for(let o=t||n.dom;o;o=Er(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,d=l?Y1(s):X1(a),h=0,D=0;if(e.top<d.top+Ot(r,"top")?D=-(d.top-e.top+Ot(i,"top")):e.bottom>d.bottom-Ot(r,"bottom")&&(D=e.bottom-d.bottom+Ot(i,"bottom")),e.left<d.left+Ot(r,"left")?h=-(d.left-e.left+Ot(i,"left")):e.right>d.right-Ot(r,"right")&&(h=e.right-d.right+Ot(i,"right")),h||D)if(l)s.defaultView.scrollBy(h,D);else{let y=a.scrollLeft,b=a.scrollTop;D&&(a.scrollTop+=D),h&&(a.scrollLeft+=h);let v=a.scrollLeft-y,x=a.scrollTop-b;e={left:e.left-v,top:e.top-x,right:e.right-v,bottom:e.bottom-x}}if(l)break}}function Z1(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=n.root.elementFromPoint(s,o);if(!a||a==n.dom||!n.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=t-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:Rd(n.dom)}}function Rd(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Er(r));return e}function Q1({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;zd(t,r==0?0:r-e)}function zd(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:s}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Nn=null;function eb(n){if(n.setActive)return n.setActive();if(Nn)return n.focus(Nn);let e=Rd(n);n.focus(Nn==null?{get preventScroll(){return Nn={preventScroll:!0},!0}}:void 0),Nn||(Nn=!1,zd(e,0))}function qd(n,e){let t,r=2e8,i,s=0,o=e.top,a=e.top,l,d;for(let h=n.firstChild,D=0;h;h=h.nextSibling,D++){let y;if(h.nodeType==1)y=h.getClientRects();else if(h.nodeType==3)y=Et(h).getClientRects();else continue;for(let b=0;b<y.length;b++){let v=y[b];if(v.top<=o&&v.bottom>=a){o=Math.max(v.bottom,o),a=Math.min(v.top,a);let x=v.left>e.left?v.left-e.left:v.right<e.left?e.left-v.right:0;if(x<r){t=h,r=x,i=x&&t.nodeType==3?{left:v.right<e.left?v.right:v.left,top:e.top}:e,h.nodeType==1&&x&&(s=D+(e.left>=(v.left+v.right)/2?1:0));continue}}else v.top>e.top&&!l&&v.left<=e.left&&v.right>=e.left&&(l=h,d={left:Math.max(v.left,Math.min(v.right,e.left)),top:v.top});!t&&(e.left>=v.right&&e.top>=v.top||e.left>=v.left&&e.top>=v.bottom)&&(s=D+1)}}return!t&&l&&(t=l,i=d,r=0),t&&t.nodeType==3?tb(t,i):!t||r&&t.nodeType==1?{node:n,offset:s}:qd(t,i)}function tb(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i<t;i++){r.setEnd(n,i+1),r.setStart(n,i);let s=It(r,1);if(s.top!=s.bottom&&ga(e,s))return{node:n,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:n,offset:0}}function ga(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function nb(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function rb(n,e,t){let{node:r,offset:i}=qd(e,t),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(r,i,s)}function ib(n,e,t,r){let i=-1;for(let s=e,o=!1;s!=n.dom;){let a=n.docView.nearestDesc(s,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!o||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!o&&(o=!0,l.left>r.left||l.top>r.top?i=a.posBefore:(l.right<r.left||l.bottom<r.top)&&(i=a.posAfter)),!a.contentDOM&&i<0)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}s=a.dom.parentNode}return i>-1?i:n.docView.posFromDOM(e,t,-1)}function Hd(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),s=i;;){let o=n.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let d=a[l];if(ga(e,d))return Hd(o,e,d)}}if((s=(s+1)%r)==i)break}return n}function sb(n,e){let t=n.dom.ownerDocument,r,i=0,s=U1(t,e.left,e.top);s&&({node:r,offset:i}=s);let o=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),a;if(!o||!n.dom.contains(o.nodeType!=1?o.parentNode:o)){let d=n.dom.getBoundingClientRect();if(!ga(e,d)||(o=Hd(n.dom,e,d),!o))return null}if(Ee)for(let d=o;r&&d;d=Er(d))d.draggable&&(r=void 0);if(o=nb(o,e),r){if(st&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&i++}r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=ib(n,r,i,e))}a==null&&(a=rb(n,o,e));let l=n.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Eu(n){return n.top<n.bottom||n.left<n.right}function It(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Eu(r))return r}return Array.prototype.find.call(t,Eu)||n.getBoundingClientRect()}const ob=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function $d(n,e,t){let{node:r,offset:i,atom:s}=n.docView.domFromPos(e,t<0?-1:1),o=ns||st;if(r.nodeType==3)if(o&&(ob.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let l=It(Et(r,i,i),t);if(st&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=It(Et(r,i-1,i-1),-1);if(d.top==l.top){let h=It(Et(r,i,i+1),-1);if(h.top!=l.top)return ur(h,h.left<d.left)}}return l}else{let l=i,d=i,h=t<0?1:-1;return t<0&&!i?(d++,h=-1):t>=0&&i==r.nodeValue.length?(l--,h=1):t<0?l--:d++,ur(It(Et(r,l,d),h),h<0)}if(!n.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==ut(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return oo(l.getBoundingClientRect(),!1)}if(s==null&&i<ut(r)){let l=r.childNodes[i];if(l.nodeType==1)return oo(l.getBoundingClientRect(),!0)}return oo(r.getBoundingClientRect(),t>=0)}if(s==null&&i&&(t<0||i==ut(r))){let l=r.childNodes[i-1],d=l.nodeType==3?Et(l,ut(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(d)return ur(It(d,1),!1)}if(s==null&&i<ut(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let d=l?l.nodeType==3?Et(l,0,o?0:1):l.nodeType==1?l:null:null;if(d)return ur(It(d,-1),!0)}return ur(It(r.nodeType==3?Et(r):r,-t),t>=0)}function ur(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function oo(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Vd(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function ab(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Vd(n,e,()=>{let{node:s}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=$d(n,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Et(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<l.length;d++){let h=l[d];if(h.bottom>h.top+1&&(t=="up"?o.top-h.top>(h.bottom-o.top)*2:h.bottom-o.bottom>(o.bottom-h.top)*2))return!1}}return!0})}const lb=/[\u0590-\u08ac]/;function ub(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=n.domSelection();return!lb.test(r.parent.textContent)||!a.modify?t=="left"||t=="backward"?s:o:Vd(n,e,()=>{let{focusNode:l,focusOffset:d,anchorNode:h,anchorOffset:D}=n.domSelectionRange(),y=a.caretBidiLevel;a.modify("move",t,"character");let b=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:v,focusOffset:x}=n.domSelectionRange(),M=v&&!b.contains(v.nodeType==1?v:v.parentNode)||l==v&&d==x;try{a.collapse(h,D),l&&(l!=h||d!=D)&&a.extend&&a.extend(l,d)}catch{}return y!=null&&(a.caretBidiLevel=y),M})}let xu=null,Au=null,Fu=!1;function cb(n,e,t){return xu==e&&Au==t?Fu:(xu=e,Au=t,Fu=t=="up"||t=="down"?ab(n,e,t):ub(n,e,t))}const Ge=0,Tu=1,un=2,pt=3;class Lr{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=Ge,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>We(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(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof Wd){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof jd&&s.side>=0;r--);if(t<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?We(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?We(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],d=o+l.size;if(i==-1&&e<=d){let h=o+l.border;if(e>=h&&t<=d-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,h);e=o;for(let D=a;D>0;D--){let y=this.children[D-1];if(y.size&&y.dom.parentNode==this.contentDOM&&!y.emptyChildAt(1)){i=We(y.dom)+1;break}e-=y.size}i==-1&&(i=0)}if(i>-1&&(d>t||a==this.children.length-1)){t=d;for(let h=a+1;h<this.children.length;h++){let D=this.children[h];if(D.size&&D.dom.parentNode==this.contentDOM&&!D.emptyChildAt(-1)){s=We(D.dom);break}t+=D.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=d}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let s=Math.min(e,t),o=Math.max(e,t);for(let y=0,b=0;y<this.children.length;y++){let v=this.children[y],x=b+v.size;if(s>b&&o<x)return v.setSelection(e-b-v.border,t-b-v.border,r,i);b=x}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),d=r.getSelection(),h=!1;if((st||Ee)&&e==t){let{node:y,offset:b}=a;if(y.nodeType==3)h=!!(b&&y.nodeValue[b-1]==`
`);else{let v=y.childNodes[b-1];h=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(st&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let y=d.focusNode.childNodes[d.focusOffset];y&&y.contentEditable=="false"&&(i=!0)}if(!(i||h&&Ee)&&Sn(a.node,a.offset,d.anchorNode,d.anchorOffset)&&Sn(l.node,l.offset,d.focusNode,d.focusOffset))return;let D=!1;if((d.extend||e==t)&&!h){d.collapse(a.node,a.offset);try{e!=t&&d.extend(l.node,l.offset),D=!0}catch{}}if(!D){if(e>t){let b=a;a=l,l=b}let y=document.createRange();y.setEnd(l.node,l.offset),y.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(y)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&t>=r:e<o&&t>r){let a=r+s.border,l=o-s.border;if(e>=a&&t<=l){this.dirty=e==r||t==o?un:Tu,e==a&&t==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=pt:s.markDirty(e-a,t-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?un:pt}r=o}this.dirty=un}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?un:Tu;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class jd extends Lr{constructor(e,t,r,i){let s,o=t.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==Ge&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(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}}class db extends Lr{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class wn extends Lr{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,r);return(!o||!o.dom)&&(o=ct.renderSpec(document,t.type.spec.toDOM(t,r))),new wn(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&pt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=pt&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ge){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ge}}slice(e,t,r){let i=wn.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;t<o&&(s=Ro(s,t,o,r)),e>0&&(s=Ro(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}}class $t extends Lr{constructor(e,t,r,i,s,o,a,l,d){super(e,[],s,o),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,t,r,i,s,o){let a=s.nodeViews[t.type.name],l,d=a&&a(t,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),h=d&&d.dom,D=d&&d.contentDOM;if(t.isText){if(!h)h=document.createTextNode(t.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:D}=ct.renderSpec(document,t.type.spec.toDOM(t)));!D&&!t.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),t.type.spec.draggable&&(h.draggable=!0));let y=h;return h=Kd(h,r,t),d?l=new hb(e,t,r,i,h,D||null,y,d,s,o+1):t.isText?new rs(e,t,r,i,h,y,s):new $t(e,t,r,i,h,D||null,y,s,o+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 t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>I.empty)}return e}matchesNode(e,t,r){return this.dirty==Ge&&e.eq(this.node)&&Po(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new fb(this,o&&o.node,e);Db(this.node,this.innerDeco,(d,h,D)=>{d.spec.marks?l.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!D&&l.syncToMarks(h==this.node.childCount?te.none:this.node.child(h).marks,r,e),l.placeWidget(d,e,i)},(d,h,D,y)=>{l.syncToMarks(d.marks,r,e);let b;l.findNodeMatch(d,h,D,y)||a&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(b=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(d,h,D,b,e)||l.updateNextNode(d,h,D,e,y,i)||l.addNode(d,h,D,e,i),i+=d.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==un)&&(o&&this.protectLocalComposition(e,o),Ud(this.contentDOM,this.children,e),Un&&yb(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof J)||r<t||i>t+this.node.content.size)return null;let s=e.domSelectionRange(),o=bb(s.focusNode,s.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let a=o.nodeValue,l=Cb(this.node.content,a,r-t,i-t);return l<0?null:{node:o,pos:l,text:a}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new db(this,s,t,i);e.input.compositionNodes.push(o),this.children=Ro(this.children,r,r+i.length,e,o)}update(e,t,r,i){return this.dirty==pt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ge}updateOuterDeco(e){if(Po(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Jd(this.dom,this.nodeDOM,Lo(this.outerDeco,this.node,t),Lo(e,this.node,t)),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 Mu(n,e,t,r,i){Kd(r,e,n);let s=new $t(void 0,n,e,t,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class rs extends $t{constructor(e,t,r,i,s,o,a){super(e,t,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==pt||this.dirty!=Ge&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ge||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=Ge,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new rs(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=pt)}get domAtom(){return!1}}class Wd extends Lr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ge&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class hb extends $t{constructor(e,t,r,i,s,o,a,l,d,h){super(e,t,r,i,s,o,a,d,h),this.spec=l}update(e,t,r,i){if(this.dirty==pt)return!1;if(this.spec.update){let s=this.spec.update(e,t,r);return s&&this.updateInner(e,t,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,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 Ud(n,e,t){let r=n.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==n){for(;a!=r;)r=_u(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(a,r);if(o instanceof wn){let l=r?r.previousSibling:n.lastChild;Ud(o.contentDOM,o.children,t),r=l?l.nextSibling:n.firstChild}}for(;r;)r=_u(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const yr=function(n){n&&(this.nodeName=n)};yr.prototype=Object.create(null);const cn=[new yr];function Lo(n,e,t){if(n.length==0)return cn;let r=t?cn[0]:new yr,i=[r];for(let s=0;s<n.length;s++){let o=n[s].type.attrs;if(o){o.nodeName&&i.push(r=new yr(o.nodeName));for(let a in o){let l=o[a];l!=null&&(t&&i.length==1&&i.push(r=new yr(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function Jd(n,e,t,r){if(t==cn&&r==cn)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=t[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=n&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=cn[0]),i=l}pb(i,a||cn[0],o)}return i}function pb(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&n.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&n.classList.add(i[s]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)n.style.removeProperty(i[1])}t.style&&(n.style.cssText+=t.style)}}function Kd(n,e,t){return Jd(n,n,cn,Lo(e,t,n.nodeType!=1))}function Po(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function _u(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class fb{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=mb(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=Ge,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let d=this.top.children[l];if(d.matchesMark(e[s])&&!this.isLocked(d.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=wn.create(this.top,e[s],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let d=this.top.children[a];if(d.matchesNode(e,t,r)&&!this.preMatch.matched.has(d)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,r,i,s){let o=this.top.children[i];return o.dirty==pt&&o.dom==o.contentDOM&&(o.dirty=un),o.update(e,t,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof $t){let d=this.preMatch.matched.get(l);if(d!=null&&d!=s)return!1;let h=l.dom,D,y=this.isLocked(h)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=pt&&Po(t,l.outerDeco));if(!y&&l.update(e,t,r,i))return this.destroyBetween(this.index,a),l.dom!=h&&(this.changed=!0),this.index++,!0;if(!y&&(D=this.recreateWrapper(l,e,t,r,i,o)))return this.top.children[this.index]=D,D.dirty=un,D.updateChildren(i,o+1),D.dirty=Ge,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,s,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let a=$t.create(this.top,t,r,i,s,o);if(!a.contentDOM)return null;a.children=e.children,e.children=[],e.destroy();for(let l of a.children)l.parent=a;return a}addNode(e,t,r,i,s){let o=$t.create(this.top,e,t,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new jd(this.top,e,t,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof wn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof rs)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ee||Se)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Wd(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function mb(n,e){let t=e,r=t.children.length,i=n.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let d=t.children[r-1];if(d instanceof wn)t=d,r=d.children.length;else{a=d,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=n.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function gb(n,e){return n.type.side-e.type.side}function Db(n,e,t,r){let i=e.locals(n),s=0;if(i.length==0){for(let d=0;d<n.childCount;d++){let h=n.child(d);r(h,i,e.forChild(s,h),d),s+=h.nodeSize}return}let o=0,a=[],l=null;for(let d=0;;){if(o<i.length&&i[o].to==s){let v=i[o++],x;for(;o<i.length&&i[o].to==s;)(x||(x=[v])).push(i[o++]);if(x){x.sort(gb);for(let M=0;M<x.length;M++)t(x[M],d,!!l)}else t(v,d,!!l)}let h,D;if(l)D=-1,h=l,l=null;else if(d<n.childCount)D=d,h=n.child(d++);else break;for(let v=0;v<a.length;v++)a[v].to<=s&&a.splice(v--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let y=s+h.nodeSize;if(h.isText){let v=y;o<i.length&&i[o].from<v&&(v=i[o].from);for(let x=0;x<a.length;x++)a[x].to<v&&(v=a[x].to);v<y&&(l=h.cut(v-s),h=h.cut(0,v-s),y=v,D=-1)}let b=h.isInline&&!h.isLeaf?a.filter(v=>!v.inline):a.slice();r(h,b,e.forChild(s,h),D),s=y}}function yb(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function bb(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=ut(n)}else if(n.nodeType==1&&e<n.childNodes.length)n=n.childNodes[e],e=0;else return null}}function Cb(n,e,t,r){for(let i=0,s=0;i<n.childCount&&s<=r;){let o=n.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<n.childCount;){let d=n.child(i++);if(s+=d.nodeSize,!d.isText)break;l+=d.text}if(s>=t){let d=a<r?l.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=t)return a+d;if(t==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Ro(n,e,t,r,i){let s=[];for(let o=0,a=0;o<n.length;o++){let l=n[o],d=a,h=a+=l.size;d>=t||h<=e?s.push(l):(d<e&&s.push(l.slice(0,e-d,r)),i&&(s.push(i),i=void 0),h>t&&s.push(l.slice(t-d,l.size,r)))}return s}function Da(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,d;if(ts(t)){for(l=a;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&$.isSelectable(h)&&i.parent&&!(h.isInline&&V1(t.focusNode,t.focusOffset,i.dom))){let D=i.posBefore;d=new $(o==D?a:r.resolve(D))}}else{let h=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(h<0)return null;l=r.resolve(h)}if(!d){let h=e=="pointer"||n.state.selection.head<a.pos&&!s?1:-1;d=ya(n,l,a,h)}return d}function Gd(n){return n.editable?n.hasFocus():Xd(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function xt(n,e=!1){let t=n.state.selection;if(Yd(n,t),!!Gd(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Se){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Sn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)kb(n);else{let{anchor:r,head:i}=t,s,o;Bu&&!(t instanceof J)&&(t.$from.parent.inlineContent||(s=Nu(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(o=Nu(n,t.to))),n.docView.setSelection(r,i,n.root,e),Bu&&(s&&Ou(s),o&&Ou(o)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vb(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Bu=Ee||Se&&J1<63;function Nu(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,s=r?t.childNodes[r-1]:null;if(Ee&&i&&i.contentEditable=="false")return ao(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return ao(i);if(s)return ao(s)}}function ao(n){return n.contentEditable="true",Ee&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Ou(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function vb(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Gd(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function kb(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,We(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ne&&Ht<=11&&(r.disabled=!0,r.disabled=!1)}function Yd(n,e){if(e instanceof $){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Iu(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Iu(n)}function Iu(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function ya(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||J.between(e,t,r)}function Lu(n){return n.editable&&!n.hasFocus()?!1:Xd(n)}function Xd(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Sb(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Sn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function zo(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),s=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return s&&G.findFrom(s,e)}function an(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Pu(n,e,t){let r=n.state.selection;if(r instanceof J){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=zo(n.state,e);return i&&i instanceof $?an(n,i):!1}else if(!(He&&t.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=n.docView.descAt(a))&&!o.contentDOM?$.isSelectable(s)?an(n,new $(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):ns?an(n,new J(n.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else{if(r instanceof $&&r.node.isInline)return an(n,new J(e>0?r.$to:r.$from));{let i=zo(n.state,e);return i?an(n,i):!1}}}function Ai(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function br(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function cr(n,e){return e<0?wb(n):Zd(n)}function wb(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,o=!1;for(st&&t.nodeType==1&&r<Ai(t)&&br(t.childNodes[r])&&(o=!0);;)if(r>0){if(t.nodeType!=1)break;{let a=t.childNodes[r-1];if(br(a))i=t,s=--r;else if(a.nodeType==3)t=a,r=t.nodeValue.length;else break}}else{if(Qd(t))break;{let a=t.previousSibling;for(;a&&br(a);)i=t.parentNode,s=We(a),a=a.previousSibling;if(a)t=a,r=Ai(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?qo(n,t,r):i&&qo(n,i,s)}function Zd(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Ai(t),s,o;for(;;)if(r<i){if(t.nodeType!=1)break;let a=t.childNodes[r];if(br(a))s=t,o=++r;else break}else{if(Qd(t))break;{let a=t.nextSibling;for(;a&&br(a);)s=a.parentNode,o=We(a)+1,a=a.nextSibling;if(a)t=a,r=0,i=Ai(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}s&&qo(n,s,o)}function Qd(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function qo(n,e,t){let r=n.domSelection();if(ts(r)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&xt(n)},50)}function Ru(n,e){let t=n.state.doc.resolve(e);if(!(Se||K1)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function zu(n,e,t){let r=n.state.selection;if(r instanceof J&&!r.empty||t.indexOf("s")>-1||He&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=zo(n.state,e);if(o&&o instanceof $)return an(n,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof it?G.near(o,e):G.findFrom(o,e);return a?an(n,a):!1}return!1}function qu(n,e){if(!(n.state.selection instanceof J))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=n.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),n.dispatch(o),!0}return!1}function Hu(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Eb(n){if(!Ee||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Hu(n,r,"true"),setTimeout(()=>Hu(n,r,"false"),20)}return!1}function xb(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Ab(n,e){let t=e.keyCode,r=xb(e);if(t==8||He&&t==72&&r=="c")return qu(n,-1)||cr(n,-1);if(t==46||He&&t==68&&r=="c")return qu(n,1)||cr(n,1);if(t==13||t==27)return!0;if(t==37||He&&t==66&&r=="c"){let i=t==37?Ru(n,n.state.selection.from)=="ltr"?-1:1:-1;return Pu(n,i,r)||cr(n,i)}else if(t==39||He&&t==70&&r=="c"){let i=t==39?Ru(n,n.state.selection.from)=="ltr"?1:-1:1;return Pu(n,i,r)||cr(n,i)}else{if(t==38||He&&t==80&&r=="c")return zu(n,-1,r)||cr(n,-1);if(t==40||He&&t==78&&r=="c")return Eb(n)||zu(n,1,r)||Zd(n);if(r==(He?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function eh(n,e){n.someProp("transformCopied",b=>{e=b(e,n)});let t=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let b=r.firstChild;t.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let o=n.someProp("clipboardSerializer")||ct.fromSchema(n.state.schema),a=oh(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let d=l.firstChild,h,D=0;for(;d&&d.nodeType==1&&(h=sh[d.nodeName.toLowerCase()]);){for(let b=h.length-1;b>=0;b--){let v=a.createElement(h[b]);for(;l.firstChild;)v.appendChild(l.firstChild);l.appendChild(v),D++}d=l.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${s}${D?` -${D}`:""} ${JSON.stringify(t)}`);let y=n.someProp("clipboardTextSerializer",b=>b(e,n))||e.content.textBetween(0,e.content.size,`
`);return{dom:l,text:y}}function th(n,e,t,r,i){let s=i.parent.type.spec.code,o,a;if(!t&&!e)return null;let l=e&&(r||s||!t);if(l){if(n.someProp("transformPastedText",y=>{e=y(e,s||r,n)}),s)return e?new R(I.from(n.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0):R.empty;let D=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(D)a=D;else{let y=i.marks(),{schema:b}=n.state,v=ct.fromSchema(b);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(x=>{let M=o.appendChild(document.createElement("p"));x&&M.appendChild(v.serializeNode(b.text(x,y)))})}}else n.someProp("transformPastedHTML",D=>{t=D(t,n)}),o=Mb(t),ns&&_b(o);let d=o&&o.querySelector("[data-pm-slice]"),h=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let D=+h[3];D>0;D--){let y=o.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;o=y}if(a||(a=(n.someProp("clipboardParser")||n.someProp("domParser")||Vn.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||h),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!Fb.test(y.parentNode.nodeName)?{ignore:!0}:null}})),h)a=Bb($u(a,+h[1],+h[2]),h[4]);else if(a=R.maxOpen(Tb(a.content,i),!0),a.openStart||a.openEnd){let D=0,y=0;for(let b=a.content.firstChild;D<a.openStart&&!b.type.spec.isolating;D++,b=b.firstChild);for(let b=a.content.lastChild;y<a.openEnd&&!b.type.spec.isolating;y++,b=b.lastChild);a=$u(a,D,y)}return n.someProp("transformPasted",D=>{a=D(a,n)}),a}const Fb=/^(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 Tb(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(n.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),d;if(!l)return o=null;if(d=o.length&&s.length&&rh(l,s,a,o[o.length-1],0))o[o.length-1]=d;else{o.length&&(o[o.length-1]=ih(o[o.length-1],s.length));let h=nh(a,l);o.push(h),i=i.matchType(h.type),s=l}}),o)return I.from(o)}return n}function nh(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,I.from(n));return n}function rh(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let s=rh(n,e,t,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(I.from(nh(t,n,i+1))))}}function ih(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,ih(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(I.empty,!0);return n.copy(t.append(r))}function Ho(n,e,t,r,i,s){let o=e<0?n.firstChild:n.lastChild,a=o.content;return n.childCount>1&&(s=0),i<r-1&&(a=Ho(a,e,t,r,i+1,s)),i>=t&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(I.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(a))}function $u(n,e,t){return e<n.openStart&&(n=new R(Ho(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new R(Ho(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const sh={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Vu=null;function oh(){return Vu||(Vu=document.implementation.createHTMLDocument("title"))}function Mb(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=oh().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&sh[r[1].toLowerCase()])&&(n=i.map(s=>"<"+s+">").join("")+n+i.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=n,i)for(let s=0;s<i.length;s++)t=t.querySelector(i[s])||t;return t}function _b(n){let e=n.querySelectorAll(Se?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function Bb(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:s,openEnd:o}=n;for(let a=r.length-2;a>=0;a-=2){let l=t.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=I.from(l.create(r[a+1],i)),s++,o++}return new R(i,s,o)}const xe={},Ae={},Nb={touchstart:!0,touchmove:!0};class Ob{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.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Ib(n){for(let e in xe){let t=xe[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Pb(n,r)&&!ba(n,r)&&(n.editable||!(r.type in Ae))&&t(n,r)},Nb[e]?{passive:!0}:void 0)}Ee&&n.dom.addEventListener("input",()=>null),$o(n)}function qt(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Lb(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function $o(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>ba(n,r))})}function ba(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Pb(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Rb(n,e){!ba(n,e)&&xe[e.type]&&(n.editable||!(e.type in Ae))&&xe[e.type](n,e)}Ae.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!lh(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Qe&&Se&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Un&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,on(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Ab(n,t)?t.preventDefault():qt(n,"key")};Ae.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ae.keypress=(n,e)=>{let t=e;if(lh(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||He&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof J)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function is(n){return{left:n.clientX,top:n.clientY}}function zb(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Ca(n,e,t,r,i){if(r==-1)return!1;let s=n.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(n.someProp(e,a=>o>s.depth?a(n,t,s.nodeAfter,s.before(o),i,!0):a(n,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function Hn(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function qb(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&$.isSelectable(r)?(Hn(n,new $(t),"pointer"),!0):!1}function Hb(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof $&&(r=t.node);let s=n.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if($.isSelectable(a)){r&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(Hn(n,$.create(n.state.doc,i),"pointer"),!0):!1}function $b(n,e,t,r,i){return Ca(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?Hb(n,t):qb(n,t))}function Vb(n,e,t,r){return Ca(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function jb(n,e,t,r){return Ca(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Wb(n,t,r)}function Wb(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Hn(n,J.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)Hn(n,J.create(r,a+1,a+1+o.content.size),"pointer");else if($.isSelectable(o))Hn(n,$.create(r,a),"pointer");else continue;return!0}}function va(n){return Fi(n)}const ah=He?"metaKey":"ctrlKey";xe.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=va(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&zb(t,n.input.lastClick)&&!t[ah]&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let o=n.posAtCoords(is(t));o&&(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Ub(n,o,t,!!r)):(s=="doubleClick"?Vb:jb)(n,o.pos,o.inside,t)?t.preventDefault():qt(n,"pointer"))};class Ub{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[ah],this.allowDefault=r.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let h=e.state.doc.resolve(t.pos);s=h.parent,o=h.depth?h.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:d}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof $&&d.from<=o&&d.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&st&&!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)),qt(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(()=>xt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(is(e))),this.updateAllowDefault(e),this.allowDefault||!t?qt(this.view,"pointer"):$b(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ee&&this.mightDrag&&!this.mightDrag.node.isAtom||Se&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Hn(this.view,G.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):qt(this.view,"pointer")}move(e){this.updateAllowDefault(e),qt(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)}}xe.touchstart=n=>{n.input.lastTouch=Date.now(),va(n),qt(n,"pointer")};xe.touchmove=n=>{n.input.lastTouch=Date.now(),qt(n,"pointer")};xe.contextmenu=n=>va(n);function lh(n,e){return n.composing?!0:Ee&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Jb=Qe?5e3:-1;Ae.compositionstart=Ae.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Fi(n,!0),n.markCursor=null;else if(Fi(n),st&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){n.domSelection().collapse(o,o.nodeValue.length);break}else i=o,s=-1}}n.input.composing=!0}uh(n,Jb)};Ae.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionID++,uh(n,20))};function uh(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Fi(n),e))}function ch(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Kb());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Kb(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Fi(n,e=!1){if(!(Qe&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),ch(n),e||n.docView&&n.docView.dirty){let t=Da(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function Gb(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Jn=Ne&&Ht<15||Un&&G1<604;xe.copy=Ae.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=Jn?null:t.clipboardData,o=r.content(),{dom:a,text:l}=eh(n,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):Gb(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Yb(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Xb(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?xr(n,r.value,null,n.input.shiftKey,e):xr(n,r.textContent,r.innerHTML,n.input.shiftKey,e)},50)}function xr(n,e,t,r,i){let s=th(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,s||R.empty)))return!0;if(!s)return!1;let o=Yb(s),a=o?n.state.tr.replaceSelectionWith(o,n.input.shiftKey):n.state.tr.replaceSelection(s);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ae.paste=(n,e)=>{let t=e;if(n.composing&&!Qe)return;let r=Jn?null:t.clipboardData;r&&xr(n,r.getData("text/plain"),r.getData("text/html"),n.input.shiftKey,t)?t.preventDefault():Xb(n,t)};class Zb{constructor(e,t){this.slice=e,this.move=t}}const dh=He?"altKey":"ctrlKey";xe.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,s=i.empty?null:n.posAtCoords(is(t));if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof $?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection($.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&n.dispatch(n.state.tr.setSelection($.create(n.state.doc,d.posBefore)))}}let o=n.state.selection.content(),{dom:a,text:l}=eh(n,o);t.dataTransfer.clearData(),t.dataTransfer.setData(Jn?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",Jn||t.dataTransfer.setData("text/plain",l),n.dragging=new Zb(o,!t[dh])};xe.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ae.dragover=Ae.dragenter=(n,e)=>e.preventDefault();Ae.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(is(t));if(!i)return;let s=n.state.doc.resolve(i.pos),o=r&&r.slice;o?n.someProp("transformPasted",v=>{o=v(o,n)}):o=th(n,t.dataTransfer.getData(Jn?"Text":"text/plain"),Jn?null:t.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!t[dh]);if(n.someProp("handleDrop",v=>v(n,t,o||R.empty,a))){t.preventDefault();return}if(!o)return;t.preventDefault();let l=o?Md(n.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let d=n.state.tr;a&&d.deleteSelection();let h=d.mapping.map(l),D=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,y=d.doc;if(D?d.replaceRangeWith(h,h,o.content.firstChild):d.replaceRange(h,h,o),d.doc.eq(y))return;let b=d.doc.resolve(h);if(D&&$.isSelectable(o.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(o.content.firstChild))d.setSelection(new $(b));else{let v=d.mapping.map(l);d.mapping.maps[d.mapping.maps.length-1].forEach((x,M,N,_)=>v=_),d.setSelection(ya(n,b,d.doc.resolve(v)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))};xe.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&xt(n)},20))};xe.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};xe.beforeinput=(n,e)=>{if(Se&&Qe&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",s=>s(n,on(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Ae)xe[n]=Ae[n];function Ar(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class ka{constructor(e,t){this.toDOM=e,this.spec=t||gn,this.side=this.spec.side||0}map(e,t,r,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new Ue(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ka&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ar(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Vt{constructor(e,t){this.attrs=e,this.spec=t||gn}map(e,t,r,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new Ue(s,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Vt&&Ar(this.attrs,e.attrs)&&Ar(this.spec,e.spec)}static is(e){return e.type instanceof Vt}destroy(){}}class Sa{constructor(e,t){this.attrs=e,this.spec=t||gn}map(e,t,r,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Ue(s.pos-r,o.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(r)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Sa&&Ar(this.attrs,e.attrs)&&Ar(this.spec,e.spec)}destroy(){}}class Ue{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Ue(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Ue(e,e,new ka(t,r))}static inline(e,t,r,i){return new Ue(e,t,new Vt(r,i))}static node(e,t,r,i){return new Ue(e,t,new Sa(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Vt}}const In=[],gn={};class ue{constructor(e,t){this.local=e.length?e:In,this.children=t.length?t:In}static create(e,t){return t.length?Ti(t,e,0,gn):ve}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=t&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,t-a,r,i+a,s)}}map(e,t,r){return this==ve||e.maps.length==0?this:this.mapInner(e,t,0,0,r||gn)}mapInner(e,t,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(t,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?Qb(this.children,o||[],e,t,r,i,s):o?new ue(o.sort(Dn),In):ve}add(e,t){return t.length?this==ve?ue.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,s=0;e.forEach((a,l)=>{let d=l+r,h;if(h=ph(t,a,d)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,h,d+1):i.splice(s,0,l,l+a.nodeSize,Ti(h,a,d+1,gn)),s+=3}});let o=hh(s?fh(t):t,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new ue(o.length?this.local.concat(o).sort(Dn):this.local,i||this.children)}remove(e){return e.length==0||this==ve?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+t,l=r[s+1]+t;for(let h=0,D;h<e.length;h++)(D=e[h])&&D.from>a&&D.to<l&&(e[h]=null,(o||(o=[])).push(D));if(!o)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(o,a+1);d!=ve?r[s+2]=d:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ue(i,r):ve}forChild(e,t){if(this==ve)return this;if(t.isLeaf)return ue.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof Vt){let d=Math.max(s,l.from)-s,h=Math.min(o,l.to)-s;d<h&&(i||(i=[])).push(l.copy(d,h))}}if(i){let a=new ue(i.sort(Dn),In);return r?new Pt([a,r]):a}return r||ve}eq(e){if(this==e)return!0;if(!(e instanceof ue)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return wa(this.localsInner(e))}localsInner(e){if(this==ve)return In;if(e.inlineContent||!this.local.some(Vt.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Vt||t.push(this.local[r]);return t}}ue.empty=new ue([],[]);ue.removeOverlap=wa;const ve=ue.empty;class Pt{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,gn));return Pt.from(r)}forChild(e,t){if(t.isLeaf)return ue.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=ve&&(s instanceof Pt?r=r.concat(s.members):r.push(s))}return Pt.from(r)}eq(e){if(!(e instanceof Pt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{r&&(t=t.slice(),r=!1);for(let o=0;o<s.length;o++)t.push(s[o])}}return t?wa(r?t:t.sort(Dn)):In}static from(e){switch(e.length){case 0:return ve;case 1:return e[0];default:return new Pt(e.every(t=>t instanceof ue)?e:e.reduce((t,r)=>t.concat(r instanceof ue?r:r.members),[]))}}}function Qb(n,e,t,r,i,s,o){let a=n.slice();for(let d=0,h=s;d<t.maps.length;d++){let D=0;t.maps[d].forEach((y,b,v,x)=>{let M=x-v-(b-y);for(let N=0;N<a.length;N+=3){let _=a[N+1];if(_<0||y>_+h-D)continue;let P=a[N]+h-D;b>=P?a[N+1]=y<=P?-2:-1:v>=i&&M&&(a[N]+=M,a[N+1]+=M)}D+=M}),h=t.maps[d].map(h,-1)}let l=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){l=!0,a[d+1]=-1;continue}let h=t.map(n[d]+s),D=h-i;if(D<0||D>=r.content.size){l=!0;continue}let y=t.map(n[d+1]+s,-1),b=y-i,{index:v,offset:x}=r.content.findIndex(D),M=r.maybeChild(v);if(M&&x==D&&x+M.nodeSize==b){let N=a[d+2].mapInner(t,M,h+1,n[d]+s+1,o);N!=ve?(a[d]=D,a[d+1]=b,a[d+2]=N):(a[d+1]=-2,l=!0)}else l=!0}if(l){let d=eC(a,n,e,t,i,s,o),h=Ti(d,r,0,o);e=h.local;for(let D=0;D<a.length;D+=3)a[D+1]<0&&(a.splice(D,3),D-=3);for(let D=0,y=0;D<h.children.length;D+=3){let b=h.children[D];for(;y<a.length&&a[y]<b;)y+=3;a.splice(y,0,h.children[D],h.children[D+1],h.children[D+2])}}return new ue(e.sort(Dn),a)}function hh(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new Ue(i.from+e,i.to+e,i.type))}return t}function eC(n,e,t,r,i,s,o){function a(l,d){for(let h=0;h<l.local.length;h++){let D=l.local[h].map(r,i,d);D?t.push(D):o.onRemove&&o.onRemove(l.local[h].spec)}for(let h=0;h<l.children.length;h+=3)a(l.children[h+2],l.children[h]+d+1)}for(let l=0;l<n.length;l+=3)n[l+1]==-1&&a(n[l+2],e[l]+s+1);return t}function ph(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let s=0,o;s<n.length;s++)(o=n[s])&&o.from>t&&o.to<r&&((i||(i=[])).push(o),n[s]=null);return i}function fh(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Ti(n,e,t,r){let i=[],s=!1;e.forEach((a,l)=>{let d=ph(n,a,l+t);if(d){s=!0;let h=Ti(d,a,t+l+1,r);h!=ve&&i.push(l,l+a.nodeSize,h)}});let o=hh(s?fh(n):n,-t).sort(Dn);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new ue(o,i):ve}function Dn(n,e){return n.from-e.from||n.to-e.to}function wa(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==n&&(e=n.slice()),e[i]=s.copy(s.from,r.to),ju(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,s.from),ju(e,i,r.copy(s.from,r.to)));break}}}return e}function ju(n,e,t){for(;e<n.length&&Dn(t,n[e])>0;)e++;n.splice(e,0,t)}function lo(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ve&&e.push(r)}),n.cursorWrapper&&e.push(ue.create(n.state.doc,[n.cursorWrapper.deco])),Pt.from(e)}const tC={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},nC=Ne&&Ht<=11;class rC{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}}class iC{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rC,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Ne&&Ht<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),nC&&(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,tC)),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 t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Lu(this.view)){if(this.suppressingSelectionUpdates)return xt(this.view);if(Ne&&Ht<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Sn(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 t=new Set,r;for(let s=e.focusNode;s;s=Er(s))t.add(s);for(let s=e.anchorNode;s;s=Er(s))if(t.has(s)){r=s;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}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Lu(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let h=0;h<t.length;h++){let D=this.registerMutation(t[h],l);D&&(s=s<0?D.from:Math.min(D.from,s),o=o<0?D.to:Math.max(D.to,o),D.typeOver&&(a=!0))}if(st&&l.length>1){let h=l.filter(D=>D.nodeName=="BR");if(h.length==2){let D=h[0],y=h[1];D.parentNode&&D.parentNode.parentNode==y.parentNode?y.remove():D.remove()}}let d=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ts(r)&&(d=Da(e))&&d.eq(G.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,xt(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),sC(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||xt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.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 h=0;h<e.addedNodes.length;h++)t.push(e.addedNodes[h]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Ne&&Ht<=11&&e.addedNodes.length)for(let h=0;h<e.addedNodes.length;h++){let{previousSibling:D,nextSibling:y}=e.addedNodes[h];(!D||Array.prototype.indexOf.call(e.addedNodes,D)<0)&&(i=D),(!y||Array.prototype.indexOf.call(e.addedNodes,y)<0)&&(s=y)}let o=i&&i.parentNode==e.target?We(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?We(s):e.target.childNodes.length,d=r.localPosFromDOM(e.target,l,1);return{from:a,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let Wu=new WeakMap,Uu=!1;function sC(n){if(!Wu.has(n)&&(Wu.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=st,Uu)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Uu=!0}}function oC(n){let e;function t(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}n.dom.addEventListener("beforeinput",t,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",t,!0);let r=e.startContainer,i=e.startOffset,s=e.endContainer,o=e.endOffset,a=n.domAtPos(n.state.selection.anchor);return Sn(a.node,a.offset,s,o)&&([r,i,s,o]=[s,o,r,i]),{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}}function aC(n,e,t){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=n.docView.parseRange(e,t),l=n.domSelectionRange(),d,h=l.anchorNode;if(h&&n.dom.contains(h.nodeType==1?h:h.parentNode)&&(d=[{node:h,offset:l.anchorOffset}],ts(l)||d.push({node:l.focusNode,offset:l.focusOffset})),Se&&n.input.lastKeyCode===8)for(let M=s;M>i;M--){let N=r.childNodes[M-1],_=N.pmViewDesc;if(N.nodeName=="BR"&&!_){s=M;break}if(!_||_.size)break}let D=n.state.doc,y=n.someProp("domParser")||Vn.fromSchema(n.state.schema),b=D.resolve(o),v=null,x=y.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:i,to:s,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:lC,context:b});if(d&&d[0].pos!=null){let M=d[0].pos,N=d[1]&&d[1].pos;N==null&&(N=M),v={anchor:M+o,head:N+o}}return{doc:x,sel:v,from:o,to:a}}function lC(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Ee&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Ee&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const uC=/^(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 cC(n,e,t,r,i){if(e<0){let j=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,Ie=Da(n,j);if(Ie&&!n.state.selection.eq(Ie)){if(Se&&Qe&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",ps=>ps(n,on(13,"Enter"))))return;let mt=n.state.tr.setSelection(Ie);j=="pointer"?mt.setMeta("pointer",!0):j=="key"&&mt.scrollIntoView(),n.composing&&mt.setMeta("composition",n.input.compositionID),n.dispatch(mt)}return}let s=n.state.doc.resolve(e),o=s.sharedDepth(t);e=s.before(o+1),t=n.state.doc.resolve(t).after(o+1);let a=n.state.selection,l=aC(n,e,t),d=n.state.doc,h=d.slice(l.from,l.to),D,y;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(D=n.state.selection.to,y="end"):(D=n.state.selection.from,y="start"),n.input.lastKeyCode=null;let b=pC(h.content,l.doc.content,l.from,D,y);if((Un&&n.input.lastIOSEnter>Date.now()-225||Qe)&&i.some(j=>j.nodeType==1&&!uC.test(j.nodeName))&&(!b||b.endA>=b.endB)&&n.someProp("handleKeyDown",j=>j(n,on(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!b)if(r&&a instanceof J&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))b={start:a.from,endA:a.to,endB:a.to};else{if(l.sel){let j=Ju(n,n.state.doc,l.sel);if(j&&!j.eq(n.state.selection)){let Ie=n.state.tr.setSelection(j);n.composing&&Ie.setMeta("composition",n.input.compositionID),n.dispatch(Ie)}}return}if(Se&&n.cursorWrapper&&l.sel&&l.sel.anchor==n.cursorWrapper.deco.from&&l.sel.head==l.sel.anchor){let j=b.endB-b.start;l.sel={anchor:l.sel.anchor+j,head:l.sel.anchor+j}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&b.start==b.endB&&n.state.selection instanceof J&&(b.start>n.state.selection.from&&b.start<=n.state.selection.from+2&&n.state.selection.from>=l.from?b.start=n.state.selection.from:b.endA<n.state.selection.to&&b.endA>=n.state.selection.to-2&&n.state.selection.to<=l.to&&(b.endB+=n.state.selection.to-b.endA,b.endA=n.state.selection.to)),Ne&&Ht<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>l.from&&l.doc.textBetween(b.start-l.from-1,b.start-l.from+1)=="  "&&(b.start--,b.endA--,b.endB--);let v=l.doc.resolveNoCache(b.start-l.from),x=l.doc.resolveNoCache(b.endB-l.from),M=d.resolve(b.start),N=v.sameParent(x)&&v.parent.inlineContent&&M.end()>=b.endA,_;if((Un&&n.input.lastIOSEnter>Date.now()-225&&(!N||i.some(j=>j.nodeName=="DIV"||j.nodeName=="P"))||!N&&v.pos<l.doc.content.size&&(_=G.findFrom(l.doc.resolve(v.pos+1),1,!0))&&_.head==x.pos)&&n.someProp("handleKeyDown",j=>j(n,on(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>b.start&&hC(d,b.start,b.endA,v,x)&&n.someProp("handleKeyDown",j=>j(n,on(8,"Backspace")))){Qe&&Se&&n.domObserver.suppressSelectionUpdates();return}Se&&Qe&&b.endB==b.start&&(n.input.lastAndroidDelete=Date.now()),Qe&&!N&&v.start()!=x.start()&&x.parentOffset==0&&v.depth==x.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==b.endA&&(b.endB-=2,x=l.doc.resolveNoCache(b.endB-l.from),setTimeout(()=>{n.someProp("handleKeyDown",function(j){return j(n,on(13,"Enter"))})},20));let P=b.start,W=b.endA,H,X,re;if(N){if(v.pos==x.pos)Ne&&Ht<=11&&v.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>xt(n),20)),H=n.state.tr.delete(P,W),X=d.resolve(b.start).marksAcross(d.resolve(b.endA));else if(b.endA==b.endB&&(re=dC(v.parent.content.cut(v.parentOffset,x.parentOffset),M.parent.content.cut(M.parentOffset,b.endA-M.start()))))H=n.state.tr,re.type=="add"?H.addMark(P,W,re.mark):H.removeMark(P,W,re.mark);else if(v.parent.child(v.index()).isText&&v.index()==x.index()-(x.textOffset?0:1)){let j=v.parent.textBetween(v.parentOffset,x.parentOffset);if(n.someProp("handleTextInput",Ie=>Ie(n,P,W,j)))return;H=n.state.tr.insertText(j,P,W)}}if(H||(H=n.state.tr.replace(P,W,l.doc.slice(b.start-l.from,b.endB-l.from))),l.sel){let j=Ju(n,H.doc,l.sel);j&&!(Se&&Qe&&n.composing&&j.empty&&(b.start!=b.endB||n.input.lastAndroidDelete<Date.now()-100)&&(j.head==P||j.head==H.mapping.map(W)-1)||Ne&&j.empty&&j.head==P)&&H.setSelection(j)}X&&H.ensureMarks(X),n.composing&&H.setMeta("composition",n.input.compositionID),n.dispatch(H.scrollIntoView())}function Ju(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:ya(n,e.resolve(t.anchor),e.resolve(t.head))}function dC(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,s=r,o,a,l;for(let h=0;h<r.length;h++)i=r[h].removeFromSet(i);for(let h=0;h<t.length;h++)s=t[h].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=h=>h.mark(a.addToSet(h.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=h=>h.mark(a.removeFromSet(h.marks));else return null;let d=[];for(let h=0;h<e.childCount;h++)d.push(l(e.child(h)));if(I.from(d).eq(n))return{mark:a,type:o}}function hC(n,e,t,r,i){if(!r.parent.isTextblock||t-e<=i.pos-r.pos||uo(r,!0,!1)<i.pos)return!1;let s=n.resolve(e);if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=n.resolve(uo(s,!0,!0));return!o.parent.isTextblock||o.pos>t||uo(o,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function uo(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let s=n.node(r).maybeChild(n.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function pC(n,e,t,r,i){let s=n.findDiffStart(e,t);if(s==null)return null;let{a:o,b:a}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&n.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}class fC{constructor(e,t){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 Ob,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Zu),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=Yu(this),Gu(this),this.nodeViews=Xu(this),this.docView=Mu(this.state.doc,Ku(this),lo(this),this.dom,this),this.domObserver=new iC(this,(r,i,s,o)=>cC(this,r,i,s,o)),this.domObserver.start(),Ib(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 t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$o(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Zu),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let r=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(ch(this),s=!0),this.state=e;let o=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let y=Xu(this);gC(y,this.nodeViews)&&(this.nodeViews=y,i=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&$o(this),this.editable=Yu(this),Gu(this);let a=lo(this),l=Ku(this),d=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,l,a);(h||!e.selection.eq(r.selection))&&(s=!0);let D=d=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Z1(this);if(s){this.domObserver.stop();let y=h&&(Ne||Se)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&mC(r.selection,e.selection);if(h){let b=Se?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Mu(e.doc,l,a,this.dom,this)),b&&!this.trackWrites&&(y=!0)}y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Sb(this))?xt(this,y):(Yd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():D&&Q1(D)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof $){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&wu(this,t.getBoundingClientRect(),e)}else wu(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 t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=t?t(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=t?t(a):a))return i}}hasFocus(){if(Ne){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&eb(this.dom),xt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}posAtCoords(e){return sb(this,e)}coordsAtPos(e,t=1){return $d(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return cb(this,t||this.state,e)}pasteHTML(e,t){return xr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return xr(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(Lb(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],lo(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 Rb(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Ee&&this.root.nodeType===11&&W1(this.dom.ownerDocument)==this.dom?oC(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Ku(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Ue.node(0,n.state.doc.content.size,e)]}function Gu(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Ue.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Yu(n){return!n.someProp("editable",e=>e(n.state)===!1)}function mC(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Xu(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function gC(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function Zu(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Ut={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:"'"},Mi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},DC=typeof navigator<"u"&&/Mac/.test(navigator.platform),yC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var be=0;be<10;be++)Ut[48+be]=Ut[96+be]=String(be);for(var be=1;be<=24;be++)Ut[be+111]="F"+be;for(var be=65;be<=90;be++)Ut[be]=String.fromCharCode(be+32),Mi[be]=String.fromCharCode(be);for(var co in Ut)Mi.hasOwnProperty(co)||(Mi[co]=Ut[co]);function bC(n){var e=DC&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||yC&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Mi:Ut)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const CC=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function vC(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))CC?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function kC(n){let e=Object.create(null);for(let t in n)e[vC(t)]=n[t];return e}function ho(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function SC(n){return new Ye({props:{handleKeyDown:mh(n)}})}function mh(n){let e=kC(n);return function(t,r){let i=bC(r),s,o=e[ho(i,r)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[ho(i,r,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=Ut[r.keyCode])&&s!=i){let a=e[ho(s,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}const wC=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function EC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const xC=(n,e,t)=>{let r=EC(n,t);if(!r)return!1;let i=gh(r);if(!i){let o=r.blockRange(),a=o&&Zn(o);return a==null?!1:(e&&e(n.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&bh(n,i,e))return!0;if(r.parent.content.size==0&&(Kn(s,"end")||$.isSelectable(s))){let o=fa(n.doc,r.before(),r.after(),R.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=n.tr.step(o);a.setSelection(Kn(s,"end")?G.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):$.create(a.doc,i.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1};function Kn(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const AC=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;s=gh(r)}let o=s&&s.nodeBefore;return!o||!$.isSelectable(o)?!1:(e&&e(n.tr.setSelection($.create(n.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function gh(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function FC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const TC=(n,e,t)=>{let r=FC(n,t);if(!r)return!1;let i=Dh(r);if(!i)return!1;let s=i.nodeAfter;if(bh(n,i,e))return!0;if(r.parent.content.size==0&&(Kn(s,"start")||$.isSelectable(s))){let o=fa(n.doc,r.before(),r.after(),R.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=n.tr.step(o);a.setSelection(Kn(s,"start")?G.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):$.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},MC=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;s=Dh(r)}let o=s&&s.nodeAfter;return!o||!$.isSelectable(o)?!1:(e&&e(n.tr.setSelection($.create(n.doc,s.pos)).scrollIntoView()),!0)};function Dh(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const _C=(n,e)=>{let t=n.selection,r=t instanceof $,i;if(r){if(t.node.isTextblock||!Kt(n.doc,t.from))return!1;i=t.from}else if(i=Qi(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection($.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},BC=(n,e)=>{let t=n.selection,r;if(t instanceof $){if(t.node.isTextblock||!Kt(n.doc,t.to))return!1;r=t.to}else if(r=Qi(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},NC=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&Zn(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},OC=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
`).scrollIntoView()),!0)};function yh(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const IC=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=yh(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,o.createAndFill());l.setSelection(G.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},LC=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof it||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=yh(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=n.tr.insert(o,s.createAndFill());a.setSelection(J.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},PC=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(zn(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Zn(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},RC=(n,e)=>{let{$from:t,to:r}=n.selection,i,s=t.sharedDepth(r);return s==0?!1:(i=t.before(s),e&&e(n.tr.setSelection($.create(n.doc,i))),!0)};function zC(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Kt(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function bh(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s,o;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(zC(n,e,t))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(s=(o=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(t){let D=e.pos+i.nodeSize,y=I.empty;for(let x=s.length-1;x>=0;x--)y=I.from(s[x].create(null,y));y=I.from(r.copy(y));let b=n.tr.step(new pe(e.pos-1,D,e.pos,D,new R(y,1,0),s.length,!0)),v=D+2*s.length;Kt(b.doc,v)&&b.join(v),t(b.scrollIntoView())}return!0}let l=G.findFrom(e,1),d=l&&l.$from.blockRange(l.$to),h=d&&Zn(d);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(d,h).scrollIntoView()),!0;if(a&&Kn(i,"start",!0)&&Kn(r,"end")){let D=r,y=[];for(;y.push(D),!D.isTextblock;)D=D.lastChild;let b=i,v=1;for(;!b.isTextblock;b=b.firstChild)v++;if(D.canReplace(D.childCount,D.childCount,b.content)){if(t){let x=I.empty;for(let N=y.length-1;N>=0;N--)x=I.from(y[N].copy(x));let M=n.tr.step(new pe(e.pos-y.length,e.pos+i.nodeSize,e.pos+v,e.pos+i.nodeSize-v,new R(x,y.length,0),0,!0));t(M.scrollIntoView())}return!0}}return!1}function Ch(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(J.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const qC=Ch(-1),HC=Ch(1);function $C(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),a=o&&pa(o,n,e);return a?(r&&r(t.tr.wrap(o,a).scrollIntoView()),!0):!1}}function Qu(n,e=null){return function(t,r){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=t.selection.ranges[s];t.doc.nodesBetween(o,a,(l,d)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(n,e)))if(l.type==n)i=!0;else{let h=t.doc.resolve(d),D=h.index();i=h.parent.canReplaceWith(D,D+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=t.selection.ranges[o];s.setBlockType(a,l,n,e)}r(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function VC(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),a=!1,l=o;if(!o)return!1;if(o.depth>=2&&i.node(o.depth-1).type.compatibleContent(n)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let h=t.doc.resolve(o.start-2);l=new Si(h,h,o.depth),o.endIndex<o.parent.childCount&&(o=new Si(i,t.doc.resolve(s.end(o.depth)),o.depth)),a=!0}let d=pa(l,n,e,o);return d?(r&&r(jC(t.tr,o,d,a,n).scrollIntoView()),!0):!1}}function jC(n,e,t,r,i){let s=I.empty;for(let h=t.length-1;h>=0;h--)s=I.from(t[h].type.create(t[h].attrs,s));n.step(new pe(e.start-(r?2:0),e.end,e.start,e.end,new R(s,0,0),t.length,!0));let o=0;for(let h=0;h<t.length;h++)t[h].type==i&&(o=h+1);let a=t.length-o,l=e.start+t.length-(r?2:0),d=e.parent;for(let h=e.startIndex,D=e.endIndex,y=!0;h<D;h++,y=!1)!y&&zn(n.doc,l,a)&&(n.split(l,a),l+=2*a),l+=d.child(h).nodeSize;return n}function WC(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?UC(e,t,n,s):JC(e,t,s):!0:!1}}function UC(n,e,t,r){let i=n.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new pe(s-1,o,s,o,new R(I.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new Si(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=Zn(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(s,-1)-1;return Kt(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function JC(n,e,t){let r=n.tr,i=t.parent;for(let b=t.end,v=t.endIndex-1,x=t.startIndex;v>x;v--)b-=i.child(v).nodeSize,r.delete(b-1,b+1);let s=r.doc.resolve(t.start),o=s.nodeAfter;if(r.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==i.childCount,d=s.node(-1),h=s.index(-1);if(!d.canReplace(h+(a?0:1),h+1,o.content.append(l?I.empty:I.from(i))))return!1;let D=s.pos,y=D+o.nodeSize;return r.step(new pe(D-(a?1:0),y+(l?1:0),D+1,y-1,new R((a?I.empty:I.from(i.copy(I.empty))).append(l?I.empty:I.from(i.copy(I.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function KC(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=n)return!1;if(t){let d=l.lastChild&&l.lastChild.type==a.type,h=I.from(d?n.create():null),D=new R(I.from(n.create(null,I.from(a.type.create(null,h)))),d?3:1,0),y=s.start,b=s.end;t(e.tr.step(new pe(y-(d?3:1),b,y,b,D,1,!0)).scrollIntoView())}return!0}}function ss(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:s}=t;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 s},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,s=t.storedMarks,t}}}class as{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(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...h)=>{const D=l(...h)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),D}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,d=e||s.tr,h=()=>(!l&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(d),a.every(y=>y===!0)),D={...Object.fromEntries(Object.entries(r).map(([y,b])=>[y,(...x)=>{const M=this.buildProps(d,t),N=b(...x)(M);return a.push(N),D}])),run:h};return D}createCan(e){const{rawCommands:t,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([l,d])=>[l,(...h)=>d(...h)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:e,editor:i,view:o,state:ss({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,d])=>[l,(...h)=>d(...h)(a)]))}};return a}}class GC{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function q(n,e,t){return n.config[e]===void 0&&n.parent?q(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?q(n.parent,e,t):null}):n.config[e]}function ls(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function vh(n){const e=[],{nodeExtensions:t,markExtensions:r}=ls(n),i=[...t,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=q(o,"addGlobalAttributes",a);if(!l)return;l().forEach(h=>{h.types.forEach(D=>{Object.entries(h.attributes).forEach(([y,b])=>{e.push({type:D,name:y,attribute:{...s,...b}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=q(o,"addAttributes",a);if(!l)return;const d=l();Object.entries(d).forEach(([h,D])=>{const y={...s,...D};typeof y?.default=="function"&&(y.default=y.default()),y?.isRequired&&y?.default===void 0&&delete y.default,e.push({type:o.name,name:h,attribute:y})})}),e}function me(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function de(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?s.split(" "):[],l=r[i]?r[i].split(" "):[],d=a.filter(h=>!l.includes(h));r[i]=[...l,...d].join(" ")}else i==="style"?r[i]=[r[i],s].join("; "):r[i]=s}),r},{})}function Vo(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>de(t,r),{})}function kh(n){return typeof n=="function"}function K(n,e=void 0,...t){return kh(n)?e?n.bind(e)(...t):n(...t):n}function YC(n={}){return Object.keys(n).length===0&&n.constructor===Object}function XC(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function ec(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(t):XC(t.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function tc(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&YC(t)?!1:t!=null))}function ZC(n,e){var t;const r=vh(n),{nodeExtensions:i,markExtensions:s}=ls(n),o=(t=i.find(d=>q(d,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(i.map(d=>{const h=r.filter(N=>N.type===d.name),D={name:d.name,options:d.options,storage:d.storage,editor:e},y=n.reduce((N,_)=>{const P=q(_,"extendNodeSchema",D);return{...N,...P?P(d):{}}},{}),b=tc({...y,content:K(q(d,"content",D)),marks:K(q(d,"marks",D)),group:K(q(d,"group",D)),inline:K(q(d,"inline",D)),atom:K(q(d,"atom",D)),selectable:K(q(d,"selectable",D)),draggable:K(q(d,"draggable",D)),code:K(q(d,"code",D)),defining:K(q(d,"defining",D)),isolating:K(q(d,"isolating",D)),attrs:Object.fromEntries(h.map(N=>{var _;return[N.name,{default:(_=N?.attribute)===null||_===void 0?void 0:_.default}]}))}),v=K(q(d,"parseHTML",D));v&&(b.parseDOM=v.map(N=>ec(N,h)));const x=q(d,"renderHTML",D);x&&(b.toDOM=N=>x({node:N,HTMLAttributes:Vo(N,h)}));const M=q(d,"renderText",D);return M&&(b.toText=M),[d.name,b]})),l=Object.fromEntries(s.map(d=>{const h=r.filter(M=>M.type===d.name),D={name:d.name,options:d.options,storage:d.storage,editor:e},y=n.reduce((M,N)=>{const _=q(N,"extendMarkSchema",D);return{...M,..._?_(d):{}}},{}),b=tc({...y,inclusive:K(q(d,"inclusive",D)),excludes:K(q(d,"excludes",D)),group:K(q(d,"group",D)),spanning:K(q(d,"spanning",D)),code:K(q(d,"code",D)),attrs:Object.fromEntries(h.map(M=>{var N;return[M.name,{default:(N=M?.attribute)===null||N===void 0?void 0:N.default}]}))}),v=K(q(d,"parseHTML",D));v&&(b.parseDOM=v.map(M=>ec(M,h)));const x=q(d,"renderHTML",D);return x&&(b.toDOM=M=>x({mark:M,HTMLAttributes:Vo(M,h)})),[d.name,b]}));return new l1({topNode:o,nodes:a,marks:l})}function po(n,e){return e.nodes[n]||e.marks[n]||null}function nc(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const QC=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,d;const h=((d=(l=i.type.spec).toText)===null||d===void 0?void 0:d.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";t+=h.slice(0,Math.max(0,r-s))}),t};function Ea(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class us{constructor(e){this.find=e.find,this.handler=e.handler}}const ev=(n,e)=>{if(Ea(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function fo(n){var e;const{editor:t,from:r,to:i,text:s,rules:o,plugin:a}=n,{view:l}=t;if(l.composing)return!1;const d=l.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let h=!1;const D=QC(d)+s;return o.forEach(y=>{if(h)return;const b=ev(D,y.find);if(!b)return;const v=l.state.tr,x=ss({state:l.state,transaction:v}),M={from:r-(b[0].length-s.length),to:i},{commands:N,chain:_,can:P}=new as({editor:t,state:x});y.handler({state:x,range:M,match:b,commands:N,chain:_,can:P})===null||!v.steps.length||(v.setMeta(a,{transform:v,from:r,to:i,text:s}),l.dispatch(v),h=!0)}),h}function tv(n){const{editor:e,rules:t}=n,r=new Ye({state:{init(){return null},apply(i,s){const o=i.getMeta(r);return o||(i.selectionSet||i.docChanged?null:s)}},props:{handleTextInput(i,s,o,a){return fo({editor:e,from:s,to:o,text:a,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&fo({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?fo({editor:e,from:o.pos,to:o.pos,text:`
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function nv(n){return typeof n=="number"}class rv{constructor(e){this.find=e.find,this.handler=e.handler}}const iv=(n,e)=>{if(Ea(e))return[...n.matchAll(e)];const t=e(n);return t?t.map(r=>{const i=[r.text];return i.index=r.index,i.input=n,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 sv(n){const{editor:e,state:t,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=n,{commands:l,chain:d,can:h}=new as({editor:e,state:t}),D=[];return t.doc.nodesBetween(r,i,(b,v)=>{if(!b.isTextblock||b.type.spec.code)return;const x=Math.max(r,v),M=Math.min(i,v+b.content.size),N=b.textBetween(x-v,M-v,void 0,"");iv(N,s.find).forEach(P=>{if(P.index===void 0)return;const W=x+P.index+1,H=W+P[0].length,X={from:t.tr.mapping.map(W),to:t.tr.mapping.map(H)},re=s.handler({state:t,range:X,match:P,commands:l,chain:d,can:h,pasteEvent:o,dropEvent:a});D.push(re)})}),D.every(b=>b!==null)}function ov(n){const{editor:e,rules:t}=n;let r=null,i=!1,s=!1,o=new ClipboardEvent("paste"),a=new DragEvent("drop");return t.map(d=>new Ye({view(h){const D=y=>{var b;r=!((b=h.dom.parentElement)===null||b===void 0)&&b.contains(y.target)?h.dom.parentElement:null};return window.addEventListener("dragstart",D),{destroy(){window.removeEventListener("dragstart",D)}}},props:{handleDOMEvents:{drop:(h,D)=>(s=r===h.dom.parentElement,a=D,!1),paste:(h,D)=>{var y;const b=(y=D.clipboardData)===null||y===void 0?void 0:y.getData("text/html");return o=D,i=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(h,D,y)=>{const b=h[0],v=b.getMeta("uiEvent")==="paste"&&!i,x=b.getMeta("uiEvent")==="drop"&&!s;if(!v&&!x)return;const M=D.doc.content.findDiffStart(y.doc.content),N=D.doc.content.findDiffEnd(y.doc.content);if(!nv(M)||!N||M===N.b)return;const _=y.tr,P=ss({state:y,transaction:_});if(!(!sv({editor:e,state:P,from:Math.max(M-1,0),to:N.b-1,rule:d,pasteEvent:o,dropEvent:a})||!_.steps.length))return a=new DragEvent("drop"),o=new ClipboardEvent("paste"),_}}))}function av(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Pn{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Pn.resolve(e),this.schema=ZC(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const s={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:po(r.name,this.schema)};r.type==="mark"&&(!((i=K(q(r,"keepOnSplit",s)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const o=q(r,"onBeforeCreate",s);o&&this.editor.on("beforeCreate",o);const a=q(r,"onCreate",s);a&&this.editor.on("create",a);const l=q(r,"onUpdate",s);l&&this.editor.on("update",l);const d=q(r,"onSelectionUpdate",s);d&&this.editor.on("selectionUpdate",d);const h=q(r,"onTransaction",s);h&&this.editor.on("transaction",h);const D=q(r,"onFocus",s);D&&this.editor.on("focus",D);const y=q(r,"onBlur",s);y&&this.editor.on("blur",y);const b=q(r,"onDestroy",s);b&&this.editor.on("destroy",b)})}static resolve(e){const t=Pn.sort(Pn.flatten(e)),r=av(t.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.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=q(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=q(r,"priority")||100,o=q(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:po(t.name,this.schema)},i=q(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Pn.sort([...this.extensions].reverse()),r=[],i=[],s=t.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:po(o.name,this.schema)},l=[],d=q(o,"addKeyboardShortcuts",a);let h={};if(o.type==="mark"&&o.config.exitable&&(h.ArrowRight=()=>ft.handleExit({editor:e,mark:o})),d){const x=Object.fromEntries(Object.entries(d()).map(([M,N])=>[M,()=>N({editor:e})]));h={...h,...x}}const D=SC(h);l.push(D);const y=q(o,"addInputRules",a);nc(o,e.options.enableInputRules)&&y&&r.push(...y());const b=q(o,"addPasteRules",a);nc(o,e.options.enablePasteRules)&&b&&i.push(...b());const v=q(o,"addProseMirrorPlugins",a);if(v){const x=v();l.push(...x)}return l}).flat();return[tv({editor:e,rules:r}),...ov({editor:e,rules:i}),...s]}get attributes(){return vh(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ls(this.extensions);return Object.fromEntries(t.filter(r=>!!q(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:me(r.name,this.schema)},o=q(r,"addNodeView",s);if(!o)return[];const a=(l,d,h,D)=>{const y=Vo(l,i);return o()({editor:e,node:l,getPos:h,decorations:D,HTMLAttributes:y,extension:r})};return[r.name,a]}))}}function lv(n){return Object.prototype.toString.call(n).slice(8,-1)}function mo(n){return lv(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function cs(n,e){const t={...n};return mo(n)&&mo(e)&&Object.keys(e).forEach(r=>{mo(e[r])?r in n?t[r]=cs(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class Re{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=K(q(this,"addOptions",{name:this.name}))),this.storage=K(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Re(e)}configure(e={}){const t=this.extend();return t.options=cs(this.options,e),t.storage=K(q(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Re(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=K(q(t,"addOptions",{name:t.name})),t.storage=K(q(t,"addStorage",{name:t.name,options:t.options})),t}}function Sh(n,e,t){const{from:r,to:i}=e,{blockSeparator:s=`
`,textSerializers:o={}}=t||{};let a="",l=!0;return n.nodesBetween(r,i,(d,h,D,y)=>{var b;const v=o?.[d.type.name];v?(d.isBlock&&!l&&(a+=s,l=!0),D&&(a+=v({node:d,pos:h,parent:D,index:y,range:e}))):d.isText?(a+=(b=d?.text)===null||b===void 0?void 0:b.slice(Math.max(r,h)-h,i-h),l=!1):d.isBlock&&!l&&(a+=s,l=!0)}),a}function wh(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const uv=Re.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ye({key:new Gt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(h=>h.$from.pos)),a=Math.max(...s.map(h=>h.$to.pos)),l=wh(t);return Sh(r,{from:o,to:a},{textSerializers:l})}}})]}}),cv=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),dv=(n=!1)=>({commands:e})=>e.setContent("",n),hv=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:s,$to:o})=>{n.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:d,mapping:h}=e,D=d.resolve(h.map(l)),y=d.resolve(h.map(l+a.nodeSize)),b=D.blockRange(y);if(!b)return;const v=Zn(b);if(a.type.isTextblock){const{defaultType:x}=D.parent.contentMatchAt(D.index());e.setNodeMarkup(b.start,x)}(v||v===0)&&e.lift(b,v)})}),!0},pv=n=>e=>n(e),fv=()=>({state:n,dispatch:e})=>LC(n,e),mv=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,s=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new J(r.doc.resolve(o-1))),!0},gv=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);n.delete(a,l).scrollIntoView()}return!0}return!1},Dv=n=>({tr:e,state:t,dispatch:r})=>{const i=me(n,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),d=s.after(o);e.delete(l,d).scrollIntoView()}return!0}return!1},yv=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},bv=()=>({state:n,dispatch:e})=>wC(n,e),Cv=()=>({commands:n})=>n.keyboardShortcut("Enter"),vv=()=>({state:n,dispatch:e})=>IC(n,e);function _i(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Ea(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function jo(n,e,t={}){return n.find(r=>r.type===e&&_i(r.attrs,t))}function kv(n,e,t={}){return!!jo(n,e,t)}function xa(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=jo([...r.node.marks],e,t);if(!i)return;let s=r.index,o=n.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(jo([...r.node.marks],e,t);s>0&&i.isInSet(n.parent.child(s-1).marks);)s-=1,o-=n.parent.child(s).nodeSize;for(;a<n.parent.childCount&&kv([...n.parent.child(a).marks],e,t);)l+=n.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Xt(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const Sv=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const s=Xt(n,r.schema),{doc:o,selection:a}=t,{$from:l,from:d,to:h}=a;if(i){const D=xa(l,s,e);if(D&&D.from<=d&&D.to>=h){const y=J.create(o,D.from,D.to);t.setSelection(y)}}return!0},wv=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Eh(n){return n instanceof J}function dn(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function xh(n,e=null){if(!e)return null;const t=G.atStart(n),r=G.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,s=r.to;return e==="all"?J.create(n,dn(0,i,s),dn(n.content.size,i,s)):J.create(n,dn(e,i,s),dn(e,i,s))}function Aa(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const Ev=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Aa()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(s&&n===null&&!Eh(t.state.selection))return o(),!0;const a=xh(i.doc,n)||t.state.selection,l=t.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},xv=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),Av=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function rc(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Bi(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?I.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Bi("",e,t)}if(typeof n=="string"){const r=Vn.fromSchema(e);return t.slice?r.parseSlice(rc(n),t.parseOptions).content:r.parse(rc(n),t.parseOptions)}return Bi("",e,t)}function Fv(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof ke||i instanceof pe))return;const s=n.mapping.maps[r];let o=0;s.forEach((a,l,d,h)=>{o===0&&(o=h)}),n.setSelection(G.near(n.doc.resolve(o),t))}const Tv=n=>n.toString().startsWith("<"),Mv=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const o=Bi(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(o.toString()==="<>")return!0;let{from:a,to:l}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,h=!0;if((Tv(o)?o:[o]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),a===l&&h){const{parent:y}=r.doc.resolve(a);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(a-=1,l+=1)}d?Array.isArray(e)?r.insertText(e.map(y=>y.text||"").join(""),a,l):typeof e=="object"&&e&&e.text?r.insertText(e.text,a,l):r.insertText(e,a,l):r.replaceWith(a,l,o),t.updateSelection&&Fv(r,r.steps.length-1,-1)}return!0},_v=()=>({state:n,dispatch:e})=>_C(n,e),Bv=()=>({state:n,dispatch:e})=>BC(n,e),Nv=()=>({state:n,dispatch:e})=>xC(n,e),Ov=()=>({state:n,dispatch:e})=>TC(n,e),Iv=()=>({tr:n,state:e,dispatch:t})=>{try{const r=Qi(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Lv=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Qi(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Fa(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Pv(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Aa()||Fa()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const Rv=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const s=Pv(n).split(/-(?!$)/),o=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,a))});return l?.steps.forEach(d=>{const h=d.map(r.mapping);h&&i&&r.maybeStep(h)}),!0};function Fr(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,o=e?me(e,n.schema):null,a=[];n.doc.nodesBetween(r,i,(D,y)=>{if(D.isText)return;const b=Math.max(r,y),v=Math.min(i,y+D.nodeSize);a.push({node:D,from:b,to:v})});const l=i-r,d=a.filter(D=>o?o.name===D.node.type.name:!0).filter(D=>_i(D.node.attrs,t,{strict:!1}));return s?!!d.length:d.reduce((D,y)=>D+y.to-y.from,0)>=l}const zv=(n,e={})=>({state:t,dispatch:r})=>{const i=me(n,t.schema);return Fr(t,i,e)?NC(t,r):!1},qv=()=>({state:n,dispatch:e})=>PC(n,e),Hv=n=>({state:e,dispatch:t})=>{const r=me(n,e.schema);return WC(r)(e,t)},$v=()=>({state:n,dispatch:e})=>OC(n,e);function ds(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function ic(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const Vv=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const a=ds(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(s=me(n,r.schema)),a==="mark"&&(o=Xt(n,r.schema)),i&&t.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(d,h)=>{s&&s===d.type&&t.setNodeMarkup(h,void 0,ic(d.attrs,e)),o&&d.marks.length&&d.marks.forEach(D=>{o===D.type&&t.addMark(h,h+d.nodeSize,o.create(ic(D.attrs,e)))})})}),!0):!1},jv=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Wv=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),Uv=()=>({state:n,dispatch:e})=>AC(n,e),Jv=()=>({state:n,dispatch:e})=>MC(n,e),Kv=()=>({state:n,dispatch:e})=>RC(n,e),Gv=()=>({state:n,dispatch:e})=>HC(n,e),Yv=()=>({state:n,dispatch:e})=>qC(n,e);function Ah(n,e,t={}){return Bi(n,e,{slice:!1,parseOptions:t})}const Xv=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:s})=>{const{doc:o}=r,a=Ah(n,i.schema,t);return s&&r.replaceWith(0,o.content.size,a).setMeta("preventUpdate",!e),!0};function hs(n,e){const t=Xt(e,n.schema),{from:r,to:i,empty:s}=n.selection,o=[];s?(n.storedMarks&&o.push(...n.storedMarks),o.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===t.name);return a?{...a.attrs}:{}}function Zv(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function Qv(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Ta(n){return e=>Qv(e.$from,n)}function ek(n,e){const t=ct.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function tk(n,e){const t={from:0,to:n.content.size};return Sh(n,t,e)}function nk(n,e){const t=me(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===t.name);return o?{...o.attrs}:{}}function rk(n,e){const t=ds(typeof e=="string"?e:e.name,n.schema);return t==="node"?nk(n,e):t==="mark"?hs(n,e):{}}function Fh(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=t.resolve(n-1),o=xa(s,i.type);o&&r.push({mark:i,...o})}):t.nodesBetween(n,e,(i,s)=>{r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function hi(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function Wo(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?Xt(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(D=>s?s.name===D.type.name:!0).find(D=>_i(D.attrs,t,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:D,$to:y})=>{const b=D.pos,v=y.pos;n.doc.nodesBetween(b,v,(x,M)=>{if(!x.isText&&!x.marks.length)return;const N=Math.max(b,M),_=Math.min(v,M+x.nodeSize),P=_-N;o+=P,a.push(...x.marks.map(W=>({mark:W,from:N,to:_})))})}),o===0)return!1;const l=a.filter(D=>s?s.name===D.mark.type.name:!0).filter(D=>_i(D.mark.attrs,t,{strict:!1})).reduce((D,y)=>D+y.to-y.from,0),d=a.filter(D=>s?D.mark.type!==s&&D.mark.type.excludes(s):!0).reduce((D,y)=>D+y.to-y.from,0);return(l>0?l+d:l)>=o}function ik(n,e,t={}){if(!e)return Fr(n,null,t)||Wo(n,null,t);const r=ds(e,n.schema);return r==="node"?Fr(n,e,t):r==="mark"?Wo(n,e,t):!1}function sc(n,e){const{nodeExtensions:t}=ls(e),r=t.find(o=>o.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=K(q(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function sk(n){var e;const t=(e=n.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=n.toJSON();return JSON.stringify(t)===JSON.stringify(r)}function ok(n,e,t){var r;const{selection:i}=e;let s=null;if(Eh(i)&&(s=i.$cursor),s){const a=(r=n.storedMarks)!==null&&r!==void 0?r:s.marks();return!!t.isInSet(a)||!a.some(l=>l.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let d=a.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(a.pos,l.pos,(h,D,y)=>{if(d)return!1;if(h.isInline){const b=!y||y.type.allowsMarkType(t),v=!!t.isInSet(h.marks)||!h.marks.some(x=>x.type.excludes(t));d=b&&v}return!d}),d})}const ak=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:a}=s,l=Xt(n,r.schema);if(i)if(o){const d=hs(r,l);t.addStoredMark(l.create({...d,...e}))}else a.forEach(d=>{const h=d.$from.pos,D=d.$to.pos;r.doc.nodesBetween(h,D,(y,b)=>{const v=Math.max(b,h),x=Math.min(b+y.nodeSize,D);y.marks.find(N=>N.type===l)?y.marks.forEach(N=>{l===N.type&&t.addMark(v,x,l.create({...N.attrs,...e}))}):t.addMark(v,x,l.create(e))})});return ok(r,t,l)},lk=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),uk=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=me(n,t.schema);return s.isTextblock?i().command(({commands:o})=>Qu(s,e)(t)?!0:o.clearNodes()).command(({state:o})=>Qu(s,e)(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ck=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=dn(n,0,r.content.size),s=$.create(r,i);e.setSelection(s)}return!0},dk=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,o=J.atStart(r).from,a=J.atEnd(r).to,l=dn(i,o,a),d=dn(s,o,a),h=J.create(r,l,d);e.setSelection(h)}return!0},hk=n=>({state:e,dispatch:t})=>{const r=me(n,e.schema);return KC(r)(e,t)};function oc(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const pk=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,d=i.extensionManager.attributes,h=hi(d,a.node().type.name,a.node().attrs);if(s instanceof $&&s.node.isBlock)return!a.parentOffset||!zn(o,a.pos)?!1:(r&&(n&&oc(t,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const D=l.parentOffset===l.parent.content.size;s instanceof J&&e.deleteSelection();const y=a.depth===0?void 0:Zv(a.node(-1).contentMatchAt(a.indexAfter(-1)));let b=D&&y?[{type:y,attrs:h}]:void 0,v=zn(e.doc,e.mapping.map(a.pos),1,b);if(!b&&!v&&zn(e.doc,e.mapping.map(a.pos),1,y?[{type:y}]:void 0)&&(v=!0,b=y?[{type:y,attrs:h}]:void 0),v&&(e.split(e.mapping.map(a.pos),1,b),y&&!D&&!a.parentOffset&&a.parent.type!==y)){const x=e.mapping.map(a.before()),M=e.doc.resolve(x);a.node(-1).canReplaceWith(M.index(),M.index()+1,y)&&e.setNodeMarkup(e.mapping.map(a.before()),y)}n&&oc(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},fk=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var s;const o=me(n,t.schema),{$from:a,$to:l}=t.selection,d=t.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(l))return!1;const h=a.node(-1);if(h.type!==o)return!1;const D=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==o||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let M=I.empty;const N=a.index(-1)?1:a.index(-2)?2:3;for(let re=a.depth-N;re>=a.depth-3;re-=1)M=I.from(a.node(re).copy(M));const _=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,P=hi(D,a.node().type.name,a.node().attrs),W=((s=o.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(P))||void 0;M=M.append(I.from(o.createAndFill(null,W)||void 0));const H=a.before(a.depth-(N-1));e.replace(H,a.after(-_),new R(M,4-N,0));let X=-1;e.doc.nodesBetween(H,e.doc.content.size,(re,j)=>{if(X>-1)return!1;re.isTextblock&&re.content.size===0&&(X=j+1)}),X>-1&&e.setSelection(J.near(e.doc.resolve(X))),e.scrollIntoView()}return!0}const y=l.pos===a.end()?h.contentMatchAt(0).defaultType:null,b=hi(D,h.type.name,h.attrs),v=hi(D,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const x=y?[{type:o,attrs:b},{type:y,attrs:v}]:[{type:o,attrs:b}];if(!zn(e.doc,a.pos,2))return!1;if(r){const{selection:M,storedMarks:N}=t,{splittableMarks:_}=i.extensionManager,P=N||M.$to.parentOffset&&M.$from.marks();if(e.split(a.pos,2,x).scrollIntoView(),!P||!r)return!0;const W=P.filter(H=>_.includes(H.type.name));e.ensureMarks(W)}return!0},go=(n,e)=>{const t=Ta(o=>o.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Kt(n.doc,t.pos)&&n.join(t.pos),!0},Do=(n,e)=>{const t=Ta(o=>o.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&Kt(n.doc,r)&&n.join(r),!0},mk=(n,e,t,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:d,can:h})=>{const{extensions:D,splittableMarks:y}=i.extensionManager,b=me(n,o.schema),v=me(e,o.schema),{selection:x,storedMarks:M}=o,{$from:N,$to:_}=x,P=N.blockRange(_),W=M||x.$to.parentOffset&&x.$from.marks();if(!P)return!1;const H=Ta(X=>sc(X.type.name,D))(x);if(P.depth>=1&&H&&P.depth-H.depth<=1){if(H.node.type===b)return d.liftListItem(v);if(sc(H.node.type.name,D)&&b.validContent(H.node.content)&&a)return l().command(()=>(s.setNodeMarkup(H.pos,b),!0)).command(()=>go(s,b)).command(()=>Do(s,b)).run()}return!t||!W||!a?l().command(()=>h().wrapInList(b,r)?!0:d.clearNodes()).wrapInList(b,r).command(()=>go(s,b)).command(()=>Do(s,b)).run():l().command(()=>{const X=h().wrapInList(b,r),re=W.filter(j=>y.includes(j.type.name));return s.ensureMarks(re),X?!0:d.clearNodes()}).wrapInList(b,r).command(()=>go(s,b)).command(()=>Do(s,b)).run()},gk=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=Xt(n,r.schema);return Wo(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},Dk=(n,e,t={})=>({state:r,commands:i})=>{const s=me(n,r.schema),o=me(e,r.schema);return Fr(r,s,t)?i.setNode(o):i.setNode(s,t)},yk=(n,e={})=>({state:t,commands:r})=>{const i=me(n,t.schema);return Fr(t,i,e)?r.lift(i):r.wrapIn(i,e)},bk=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let s;if(i.spec.isInputRules&&(s=i.getState(n))){if(e){const o=n.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,n.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},Ck=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},vk=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=t,l=Xt(n,r.schema),{$from:d,empty:h,ranges:D}=a;if(!i)return!0;if(h&&o){let{from:y,to:b}=a;const v=(s=d.marks().find(M=>M.type===l))===null||s===void 0?void 0:s.attrs,x=xa(d,l,v);x&&(y=x.from,b=x.to),t.removeMark(y,b,l)}else D.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,l)});return t.removeStoredMark(l),!0},kk=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const a=ds(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(s=me(n,r.schema)),a==="mark"&&(o=Xt(n,r.schema)),i&&t.selection.ranges.forEach(l=>{const d=l.$from.pos,h=l.$to.pos;r.doc.nodesBetween(d,h,(D,y)=>{s&&s===D.type&&t.setNodeMarkup(y,void 0,{...D.attrs,...e}),o&&D.marks.length&&D.marks.forEach(b=>{if(o===b.type){const v=Math.max(y,d),x=Math.min(y+D.nodeSize,h);t.addMark(v,x,o.create({...b.attrs,...e}))}})})}),!0):!1},Sk=(n,e={})=>({state:t,dispatch:r})=>{const i=me(n,t.schema);return $C(i,e)(t,r)},wk=(n,e={})=>({state:t,dispatch:r})=>{const i=me(n,t.schema);return VC(i,e)(t,r)};var Ek=Object.freeze({__proto__:null,blur:cv,clearContent:dv,clearNodes:hv,command:pv,createParagraphNear:fv,cut:mv,deleteCurrentNode:gv,deleteNode:Dv,deleteRange:yv,deleteSelection:bv,enter:Cv,exitCode:vv,extendMarkRange:Sv,first:wv,focus:Ev,forEach:xv,insertContent:Av,insertContentAt:Mv,joinUp:_v,joinDown:Bv,joinBackward:Nv,joinForward:Ov,joinItemBackward:Iv,joinItemForward:Lv,keyboardShortcut:Rv,lift:zv,liftEmptyBlock:qv,liftListItem:Hv,newlineInCode:$v,resetAttributes:Vv,scrollIntoView:jv,selectAll:Wv,selectNodeBackward:Uv,selectNodeForward:Jv,selectParentNode:Kv,selectTextblockEnd:Gv,selectTextblockStart:Yv,setContent:Xv,setMark:ak,setMeta:lk,setNode:uk,setNodeSelection:ck,setTextSelection:dk,sinkListItem:hk,splitBlock:pk,splitListItem:fk,toggleList:mk,toggleMark:gk,toggleNode:Dk,toggleWrap:yk,undoInputRule:bk,unsetAllMarks:Ck,unsetMark:vk,updateAttributes:kk,wrapIn:Sk,wrapInList:wk});const xk=Re.create({name:"commands",addCommands(){return{...Ek}}}),Ak=Re.create({name:"editable",addProseMirrorPlugins(){return[new Ye({key:new Gt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Fk=Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ye({key:new Gt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Tk=Re.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:d}=a,{empty:h,$anchor:D}=l,{pos:y,parent:b}=D,v=D.parent.isTextblock?a.doc.resolve(y-1):D,x=v.parent.type.spec.isolating,M=D.pos-D.parentOffset,N=x&&v.parent.childCount===1?M===D.pos:G.atStart(d).from===y;return!h||!N||!b.type.isTextblock||b.textContent.length?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":n,"Alt-Backspace":n,"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 Aa()||Fa()?s:i},addProseMirrorPlugins(){return[new Ye({key:new Gt("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(v=>v.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:s,to:o}=e.selection,a=G.atStart(e.doc).from,l=G.atEnd(e.doc).to;if(i||!(s===a&&o===l)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const D=t.tr,y=ss({state:t,transaction:D}),{commands:b}=new as({editor:this.editor,state:y});if(b.clearNodes(),!!D.steps.length)return D}})]}}),Mk=Re.create({name:"tabindex",addProseMirrorPlugins(){return[new Ye({key:new Gt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var _k=Object.freeze({__proto__:null,ClipboardTextSerializer:uv,Commands:xk,Editable:Ak,FocusEvents:Fk,Keymap:Tk,Tabindex:Mk});const Bk=`.ProseMirror {
position: relative;
}
.ProseMirror {
word-wrap: break-word;
white-space: pre-wrap;
white-space: break-spaces;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}
.ProseMirror [contenteditable="false"] {
white-space: normal;
}
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
white-space: pre-wrap;
}
.ProseMirror pre {
white-space: pre-wrap;
}
img.ProseMirror-separator {
display: inline !important;
border: none !important;
margin: 0 !important;
width: 1px !important;
height: 1px !important;
}
.ProseMirror-gapcursor {
display: none;
pointer-events: none;
position: absolute;
margin: 0;
}
.ProseMirror-gapcursor:after {
content: "";
display: block;
position: absolute;
top: -2px;
width: 20px;
border-top: 1px solid black;
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}
@keyframes ProseMirror-cursor-blink {
to {
visibility: hidden;
}
}
.ProseMirror-hideselection *::selection {
background: transparent;
}
.ProseMirror-hideselection *::-moz-selection {
background: transparent;
}
.ProseMirror-hideselection * {
caret-color: transparent;
}
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
}
.tippy-box[data-animation=fade][data-state=hidden] {
opacity: 0
}`;function Nk(n,e,t){const r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}let Ok=class extends GC{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=Nk(Bk,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,t=!0){this.setOptions({editable:e}),t&&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,t){const r=kh(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(t))});this.view.updateState(r)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(_k):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new Pn(t,this)}createCommandManager(){this.commandManager=new as({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Ah(this.options.content,this.schema,this.options.parseOptions),t=xh(e,this.options.autofocus);this.view=new fC(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Ln.create({doc:e,selection:t||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const 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;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(o)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return rk(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return ik(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ek(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
`,textSerializers:r={}}=e||{};return tk(this.state.doc,{blockSeparator:t,textSerializers:{...wh(this.schema),...r}})}get isEmpty(){return sk(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 Gn(n){return new us({find:n.find,handler:({state:e,range:t,match:r})=>{const i=K(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),d=t.from+a.indexOf(o),h=d+o.length;if(Fh(t.from,t.to,e.doc).filter(b=>b.mark.type.excluded.find(x=>x===n.type&&x!==b.mark.type)).filter(b=>b.to>d).length)return null;h<t.to&&s.delete(h,t.to),d>t.from&&s.delete(t.from+l,d);const y=t.from+l+o.length;s.addMark(t.from+l,y,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}function Ik(n){return new us({find:n.find,handler:({state:e,range:t,match:r})=>{const i=K(n.getAttributes,void 0,r)||{},{tr:s}=e,o=t.from;let a=t.to;const l=n.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let h=o+d;h>a?h=a:a=h+r[1].length;const D=r[0][r[0].length-1];s.insertText(D,o+r[0].length-1),s.replaceWith(h,a,l)}else r[0]&&s.insert(o-1,n.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a));s.scrollIntoView()}})}function Uo(n){return new us({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=K(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,s)}})}function Tr(n){return new us({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=K(n.getAttributes,void 0,r)||{},o=e.tr.delete(t.from,t.to),l=o.doc.resolve(t.from).blockRange(),d=l&&pa(l,n.type,s);if(!d)return null;if(o.wrap(l,d),n.keepMarks&&n.editor){const{selection:D,storedMarks:y}=e,{splittableMarks:b}=n.editor.extensionManager,v=y||D.$to.parentOffset&&D.$from.marks();if(v){const x=v.filter(M=>b.includes(M.type.name));o.ensureMarks(x)}}if(n.keepAttributes){const D=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(D,s).run()}const h=o.doc.resolve(t.from-1).nodeBefore;h&&h.type===n.type&&Kt(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,h))&&o.join(t.from-1)}})}class ft{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=K(q(this,"addOptions",{name:this.name}))),this.storage=K(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ft(e)}configure(e={}){const t=this.extend();return t.options=cs(this.options,e),t.storage=K(q(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ft(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=K(q(t,"addOptions",{name:t.name})),t.storage=K(q(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(d=>d?.type.name===t.name))return!1;const l=o.find(d=>d?.type.name===t.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class we{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=K(q(this,"addOptions",{name:this.name}))),this.storage=K(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new we(e)}configure(e={}){const t=this.extend();return t.options=cs(this.options,e),t.storage=K(q(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new we(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=K(q(t,"addOptions",{name:t.name})),t.storage=K(q(t,"addStorage",{name:t.name,options:t.options})),t}}function Yn(n){return new rv({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=K(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let d=t.to;if(a){const h=l.search(/\S/),D=t.from+l.indexOf(a),y=D+a.length;if(Fh(t.from,t.to,e.doc).filter(v=>v.mark.type.excluded.find(M=>M===n.type&&M!==v.mark.type)).filter(v=>v.to>D).length)return null;y<t.to&&o.delete(y,t.to),D>t.from&&o.delete(t.from+h,D),d=t.from+h+a.length,o.addMark(t.from+h,d,n.type.create(s||{})),o.removeStoredMark(n.type)}}})}function ac(n){return Hm((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}let Lk=class extends Ok{constructor(e={}){return super(e),this.vueRenderers=Im(new Map),this.contentComponent=null,this.reactiveState=ac(this.view.state),this.reactiveExtensionStorage=ac(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),Lm(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}};const Pk=ge({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=Pm(),t=Vm();return Rm(()=>{const r=n.editor;r&&r.options.element&&e.value&&$m(()=>{if(!e.value||!r.options.element.firstChild)return;const i=$e(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=t.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),zm(()=>{const r=n.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const n=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const t=Vs(qm,{to:e.teleportElement,key:e.id},Vs(e.component,{ref:e.id,...e.props}));n.push(t)}),Vs("div",{ref:e=>{this.rootEl=e}},...n)}}),Rk=/^\s*>\s$/,zk=we.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",de(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Tr({find:Rk,type:this.type})]}}),qk=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Hk=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,$k=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Vk=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,jk=ft.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",de(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Gn({find:qk,type:this.type}),Gn({find:$k,type:this.type})]},addPasteRules(){return[Yn({find:Hk,type:this.type}),Yn({find:Vk,type:this.type})]}}),Wk=we.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",de(this.options.HTMLAttributes,n),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)}}}),lc=ft.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",de(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=hs(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),uc=/^\s*([-+*])\s$/,Uk=we.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:n}){return["ul",de(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Wk.name,this.editor.getAttributes(lc.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=Tr({find:uc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Tr({find:uc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(lc.name),editor:this.editor})),[n]}}),Jk=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Kk=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Gk=ft.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",de(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Gn({find:Jk,type:this.type})]},addPasteRules(){return[Yn({find:Kk,type:this.type})]}}),Yk=/^```([a-z]+)?[\s\n]$/,Xk=/^~~~([a-z]+)?[\s\n]$/,Zk=we.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:n=>{var e;const{languageClassPrefix:t}=this.options,s=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",de(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
`);return!s||!o?!1:n.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:n.commands.exitCode()}}},addInputRules(){return[Uo({find:Yk,type:this.type,getAttributes:n=>({language:n[1]})}),Uo({find:Xk,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Ye({key:new Gt("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i?.mode;if(!t||!s)return!1;const{tr:o}=n.state;return o.replaceSelectionWith(this.type.create({language:s})),o.setSelection(J.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(t.replace(/\r\n?/g,`
`)),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),Qk=we.create({name:"doc",topNode:!0,content:"block+"});function eS(n={}){return new Ye({view(e){return new tS(e,n)}})}class tS{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.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),t=!e.parent.inlineContent,r;if(t){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let d=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(d){let h=d.getBoundingClientRect(),D=a?h.bottom:h.top;a&&l&&(D=(D+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:h.left,right:h.right,top:D-this.width/2,bottom:D+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.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",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let s,o;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,o=-pageYOffset;else{let a=i.getBoundingClientRect();s=a.left-i.scrollLeft,o=a.top-i.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-o+"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 t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Md(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),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)}}const nS=Re.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[eS(this.options)]}});class oe extends G{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return oe.valid(r)?new oe(r):G.near(r)}content(){return R.empty}eq(e){return e instanceof oe&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new oe(e.resolve(t.pos))}getBookmark(){return new Ma(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!rS(e)||!iS(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&oe.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(oe.valid(l))return l}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!$.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),r=!1;continue e}break}s=o,i+=t;let a=e.doc.resolve(i);if(oe.valid(a))return a}return null}}}oe.prototype.visible=!1;oe.findFrom=oe.findGapCursorFrom;G.jsonID("gapcursor",oe);class Ma{constructor(e){this.pos=e}map(e){return new Ma(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return oe.valid(t)?new oe(t):G.near(t)}}function rS(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-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 iS(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;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 sS(){return new Ye({props:{decorations:uS,createSelectionBetween(n,e,t){return e.pos==t.pos&&oe.valid(t)?new oe(t):null},handleClick:aS,handleKeyDown:oS,handleDOMEvents:{beforeinput:lS}}})}const oS=mh({ArrowLeft:oi("horiz",-1),ArrowRight:oi("horiz",1),ArrowUp:oi("vert",-1),ArrowDown:oi("vert",1)});function oi(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof J){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let d=oe.findGapCursorFrom(a,e,l);return d?(i&&i(r.tr.setSelection(new oe(d))),!0):!1}}function aS(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!oe.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&$.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new oe(r))),!0)}function lS(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof oe))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=I.empty;for(let o=r.length-1;o>=0;o--)i=I.from(r[o].createAndFill(null,i));let s=n.state.tr.replace(t.pos,t.pos,new R(i,0,0));return s.setSelection(J.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function uS(n){if(!(n.selection instanceof oe))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ue.create(n.doc,[Ue.widget(n.selection.head,e,{key:"gapcursor"})])}const cS=Re.create({name:"gapCursor",addProseMirrorPlugins(){return[sS()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=K(q(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),dS=we.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",de(this.options.HTMLAttributes,n)]},renderText(){return`
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:h})=>{if(h&&l&&o){const D=l.filter(y=>a.includes(y.type.name));d.ensureMarks(D)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),hS=we.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(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,de(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Uo({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Ni=200,fe=function(){};fe.prototype.append=function(e){return e.length?(e=fe.from(e),!this.length&&e||e.length<Ni&&this.leafAppend(e)||this.length<Ni&&e.leafPrepend(this)||this.appendInner(e)):this};fe.prototype.prepend=function(e){return e.length?fe.from(e).append(this):this};fe.prototype.appendInner=function(e){return new pS(this,e)};fe.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?fe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};fe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};fe.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};fe.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,r),i};fe.from=function(e){return e instanceof fe?e:e&&e.length?new Th(e):fe.empty};var Th=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ni)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ni)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(fe);fe.empty=new Th([]);var pS=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},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}(fe);const fS=500;class nt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;t&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,d=[],h=[];return this.items.forEach((D,y)=>{if(!D.step){i||(i=this.remapping(r,y+1),s=i.maps.length),s--,h.push(D);return}if(i){h.push(new lt(D.map));let b=D.step.map(i.slice(s)),v;b&&o.maybeStep(b).doc&&(v=o.mapping.maps[o.mapping.maps.length-1],d.push(new lt(v,void 0,void 0,d.length+h.length))),s--,v&&i.appendMap(v,s)}else o.maybeStep(D.step);if(D.selection)return a=i?D.selection.map(i.slice(s)):D.selection,l=new nt(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let h=0;h<e.steps.length;h++){let D=e.steps[h].invert(e.docs[h]),y=new lt(e.mapping.maps[h],D,t),b;(b=l&&l.merge(y))&&(y=b,h?s.pop():a=a.slice(0,a.length-1)),s.push(y),t&&(o++,t=void 0),i||(l=y)}let d=o-r.depth;return d>gS&&(a=mS(a,d),o-=d),new nt(a.append(s),o)}remapping(e,t){let r=new Rn;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,t),r}addMaps(e){return this.eventCount==0?this:new nt(this.items.append(e.map(t=>new lt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(y=>{y.selection&&a--},i);let l=t;this.items.forEach(y=>{let b=s.getMirror(--l);if(b==null)return;o=Math.min(o,b);let v=s.maps[b];if(y.step){let x=e.steps[b].invert(e.docs[b]),M=y.selection&&y.selection.map(s.slice(l+1,b));M&&a++,r.push(new lt(v,x,M))}else r.push(new lt(v))},i);let d=[];for(let y=t;y<o;y++)d.push(new lt(s.maps[y]));let h=this.items.slice(0,i).append(d).append(r),D=new nt(h,a);return D.emptyItemCount()>fS&&(D=D.compress(this.items.length-r.length)),D}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(t.slice(r)),d=l&&l.getMap();if(r--,d&&t.appendMap(d,r),l){let h=o.selection&&o.selection.map(t.slice(r));h&&s++;let D=new lt(d.invert(),l,h),y,b=i.length-1;(y=i.length&&i[b].merge(D))?i[b]=y:i.push(D)}}else o.map&&r--},this.items.length,0),new nt(fe.from(i.reverse()),s)}}nt.empty=new nt(fe.empty,0);function mS(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class lt{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new lt(t.getMap().invert(),t,this.selection)}}}class Lt{constructor(e,t,r,i,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const gS=20;function DS(n,e,t,r){let i=t.getMeta(jt),s;if(i)return i.historyState;t.getMeta(bS)&&(n=new Lt(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(jt))return o.getMeta(jt).redo?new Lt(n.done.addTransform(t,void 0,r,pi(e)),n.undone,cc(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new Lt(n.done,n.undone.addTransform(t,void 0,r,pi(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=n.prevTime==0||!o&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!yS(t,n.prevRanges)),d=o?yo(n.prevRanges,t.mapping):cc(t.mapping.maps[t.steps.length-1]);return new Lt(n.done.addTransform(t,l?e.selection.getBookmark():void 0,r,pi(e)),nt.empty,d,t.time,a??n.prevComposition)}else return(s=t.getMeta("rebased"))?new Lt(n.done.rebased(t,s),n.undone.rebased(t,s),yo(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Lt(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),yo(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function yS(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function cc(n){let e=[];return n.forEach((t,r,i,s)=>e.push(i,s)),e}function yo(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),s=e.map(n[r+1],-1);i<=s&&t.push(i,s)}return t}function Mh(n,e,t,r){let i=pi(e),s=jt.get(e).spec.config,o=(r?n.undone:n.done).popEvent(e,i);if(!o)return;let a=o.selection.resolve(o.transform.doc),l=(r?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),s,i),d=new Lt(r?l:o.remaining,r?o.remaining:l,null,0,-1);t(o.transform.setSelection(a).setMeta(jt,{redo:r,historyState:d}).scrollIntoView())}let bo=!1,dc=null;function pi(n){let e=n.plugins;if(dc!=e){bo=!1,dc=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){bo=!0;break}}return bo}const jt=new Gt("history"),bS=new Gt("closeHistory");function CS(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Ye({key:jt,state:{init(){return new Lt(nt.empty,nt.empty,null,0,-1)},apply(e,t,r){return DS(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?_h:r=="historyRedo"?Bh:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const _h=(n,e)=>{let t=jt.getState(n);return!t||t.done.eventCount==0?!1:(e&&Mh(t,n,e,!1),!0)},Bh=(n,e)=>{let t=jt.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Mh(t,n,e,!0),!0)},vS=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>_h(n,e),redo:()=>({state:n,dispatch:e})=>Bh(n,e)}},addProseMirrorPlugins(){return[CS(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-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),kS=we.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",de(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(t.pos-2,{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:s})=>{var o;if(s){const{$to:a}=i.selection,l=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(J.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection($.create(i.doc,a.pos)):i.setSelection(J.create(i.doc,a.pos));else{const d=(o=a.parent.type.contentMatch.defaultType)===null||o===void 0?void 0:o.create();d&&(i.insert(l,d),i.setSelection(J.create(i.doc,l+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Ik({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),SS=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,wS=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,ES=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,xS=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,AS=ft.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",de(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Gn({find:SS,type:this.type}),Gn({find:ES,type:this.type})]},addPasteRules(){return[Yn({find:wS,type:this.type}),Yn({find:xS,type:this.type})]}}),FS=we.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",de(this.options.HTMLAttributes,n),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)}}}),TS=we.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",de(this.options.HTMLAttributes,n),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)}}}),hc=ft.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",de(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=hs(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),pc=/^(\d+)\.\s$/,MS=we.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:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",de(this.options.HTMLAttributes,t),0]:["ol",de(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(TS.name,this.editor.getAttributes(hc.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Tr({find:pc,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Tr({find:pc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(hc.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),_S=we.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",de(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),BS=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,NS=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,OS=ft.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",de(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return Fa()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[Gn({find:BS,type:this.type})]},addPasteRules(){return[Yn({find:NS,type:this.type})]}}),IS=we.create({name:"text",group:"inline"}),LS=Re.create({name:"starterKit",addExtensions(){var n,e,t,r,i,s,o,a,l,d,h,D,y,b,v,x,M,N;const _=[];return this.options.blockquote!==!1&&_.push(zk.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&_.push(jk.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&_.push(Uk.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&_.push(Gk.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&_.push(Zk.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&_.push(Qk.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&_.push(nS.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&_.push(cS.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&_.push(dS.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&_.push(hS.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&_.push(vS.configure((h=this.options)===null||h===void 0?void 0:h.history)),this.options.horizontalRule!==!1&&_.push(kS.configure((D=this.options)===null||D===void 0?void 0:D.horizontalRule)),this.options.italic!==!1&&_.push(AS.configure((y=this.options)===null||y===void 0?void 0:y.italic)),this.options.listItem!==!1&&_.push(FS.configure((b=this.options)===null||b===void 0?void 0:b.listItem)),this.options.orderedList!==!1&&_.push(MS.configure((v=this.options)===null||v===void 0?void 0:v.orderedList)),this.options.paragraph!==!1&&_.push(_S.configure((x=this.options)===null||x===void 0?void 0:x.paragraph)),this.options.strike!==!1&&_.push(OS.configure((M=this.options)===null||M===void 0?void 0:M.strike)),this.options.text!==!1&&_.push(IS.configure((N=this.options)===null||N===void 0?void 0:N.text)),_}}),PS=ge({__name:"menu-bar-item",props:{icon:{},title:{},action:{type:Function},isActive:{type:Function}},setup(n){const e=n,{icon:t,title:r,action:i,isActive:s}=fc(e);return(o,a)=>{const l=ng,d=jm,h=eg;return ae(),fi(h,{tooltip:$e(r)},{default:Co(()=>[hn(d,{circle:"",variant:"text",type:$e(s)?.()?"primary":"default",onClick:$e(i)},{default:Co(()=>[hn(l,{component:$e(t)},null,8,["component"])]),_:1},8,["type","onClick"])]),_:1},8,["tooltip"])}}}),RS={flex:"","items-center":""},zS=ge({__name:"menu-bar",props:{editor:{}},setup(n){const e=n,{editor:t}=fc(e),r=[{type:"button",icon:Sg,title:"Bold",action:()=>t.value.chain().focus().toggleBold().run(),isActive:()=>t.value.isActive("bold")},{type:"button",icon:Xg,title:"Italic",action:()=>t.value.chain().focus().toggleItalic().run(),isActive:()=>t.value.isActive("italic")},{type:"button",icon:s2,title:"Strike",action:()=>t.value.chain().focus().toggleStrike().run(),isActive:()=>t.value.isActive("strike")},{type:"button",icon:rg,title:"Inline code",action:()=>t.value.chain().focus().toggleCode().run(),isActive:()=>t.value.isActive("code")},{type:"divider"},{type:"button",icon:Ig,title:"Heading 1",action:()=>t.value.chain().focus().toggleHeading({level:1}).run(),isActive:()=>t.value.isActive("heading",{level:1})},{type:"button",icon:zg,title:"Heading 2",action:()=>t.value.chain().focus().toggleHeading({level:2}).run(),isActive:()=>t.value.isActive("heading",{level:2})},{type:"button",icon:Vg,title:"Heading 3",action:()=>t.value.chain().focus().toggleHeading({level:4}).run(),isActive:()=>t.value.isActive("heading",{level:4})},{type:"button",icon:Jg,title:"Heading 4",action:()=>t.value.chain().focus().toggleHeading({level:4}).run(),isActive:()=>t.value.isActive("heading",{level:4})},{type:"divider"},{type:"button",icon:ig,title:"Bullet list",action:()=>t.value.chain().focus().toggleBulletList().run(),isActive:()=>t.value.isActive("bulletList")},{type:"button",icon:t2,title:"Ordered list",action:()=>t.value.chain().focus().toggleOrderedList().run(),isActive:()=>t.value.isActive("orderedList")},{type:"button",icon:_g,title:"Code block",action:()=>t.value.chain().focus().toggleCodeBlock().run(),isActive:()=>t.value.isActive("codeBlock")},{type:"button",icon:bg,title:"Blockquote",action:()=>t.value.chain().focus().toggleBlockquote().run(),isActive:()=>t.value.isActive("blockquote")},{type:"divider"},{type:"button",icon:sg,title:"Hard break",action:()=>t.value.chain().focus().setHardBreak().run()},{type:"button",icon:Ag,title:"Clear format",action:()=>t.value.chain().focus().clearNodes().unsetAllMarks().run()},{type:"button",icon:dg,title:"Undo",action:()=>t.value.chain().focus().undo().run()},{type:"button",icon:mg,title:"Redo",action:()=>t.value.chain().focus().redo().run()}];return(i,s)=>{const o=gc;return ae(),Ce("div",RS,[(ae(),Ce(vo,null,Wm(r,(a,l)=>(ae(),Ce(vo,null,[a.type==="divider"?(ae(),fi(o,{key:`divider${l}`,vertical:""})):a.type==="button"?(ae(),fi(PS,Um({key:l},a),null,16)):mc("",!0)],64))),64))])}}}),qS={px8:"",pb6:""},HS=ge({__name:"editor",props:{html:{}},emits:["update:html"],setup(n,{emit:e}){const t=n;Jm(o=>({"99251dac":$e(r).codeColor}));const r=og(),i=Km(t,"html",e),s=new Lk({content:i.value,extensions:[LS]});return s.on("update",({editor:o})=>e("update:html",o.getHTML())),Gm(()=>{s.destroy()}),(o,a)=>{const l=gc,d=tg;return $e(s)?(ae(),fi(d,{key:0,"important:p0":""},{default:Co(()=>[hn(zS,{class:"editor-header",editor:$e(s)},null,8,["editor"]),hn(l,{style:{"margin-top":"0"}}),Pe("div",qS,[hn($e(Pk),{class:"editor-content",editor:$e(s)},null,8,["editor"])])]),_:1})):mc("",!0)}}});const $S=Ym(HS,[["__scopeId","data-v-3bc77d7d"]]),rw=ge({__name:"html-wysiwyg-editor",setup(n){const e=Xm("html-wysiwyg-editor--html","<h1>Hey!</h1><p>Welcome to this html wysiwyg editor</p>"),t=Zm(()=>o2.format(e.value,{parser:"html",plugins:[Jy]}),"");return(r,i)=>(ae(),Ce(vo,null,[hn($S,{html:$e(e),"onUpdate:html":i[0]||(i[0]=s=>Qm(e)?e.value=s:null)},null,8,["html"]),hn(ag,{value:$e(t),language:"html"},null,8,["value"])],64))}});export{rw as default};