diff --git a/modules/boardwalk/dist/assets/editor-DOwNKalZ.js b/modules/boardwalk/dist/assets/editor-DjIW-4Gn.js similarity index 54% rename from modules/boardwalk/dist/assets/editor-DOwNKalZ.js rename to modules/boardwalk/dist/assets/editor-DjIW-4Gn.js index 426643c8..1edaa960 100644 --- a/modules/boardwalk/dist/assets/editor-DOwNKalZ.js +++ b/modules/boardwalk/dist/assets/editor-DjIW-4Gn.js @@ -1,29 +1,29 @@ -import{L as mu,i as gu}from"./index-CGlcvAra.js";var Vs=Object.defineProperty,yu=(n,e)=>{let t={};for(var r in n)Vs(t,r,{get:n[r],enumerable:!0});return Vs(t,Symbol.toStringTag,{value:"Module"}),t};function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Cl(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){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d=56320&&n<57344}function El(n){return n>=55296&&n<56320}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;re&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},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);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(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 k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Rn(t+1,s):Rn(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let i=0;ithis.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;tr.type.rank-i.type.rank),t}};B.none=[];class gn extends Error{}class w{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=Al(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(e,t){return new w(vl(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 w.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 w(k.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 w(e,r,i)}}w.empty=new w(k.empty,0,0);function vl(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(i==e||s.isText){if(l!=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(vl(s.content,e-i-1,t-i-1)))}function Al(n,e,t,r,i,s){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=Al(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function ku(n,e,t){if(t.openStart>n.depth)throw new gn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new gn("Inconsistent open depths");return Ol(n,e,t,0)}function Ol(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function nn(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&&(mt(n.nodeAfter,r),s++));for(let l=s;li&&Ai(n,e,i+1),o=r.depth>i&&Ai(t,r,i+1),l=[];return nn(null,n,i,l),s&&o&&e.index(i)==t.index(i)?(Nl(s,o),mt(gt(s,Dl(n,e,t,r,i+1)),l)):(s&&mt(gt(s,Qn(n,e,i+1)),l),nn(e,t,i,l),o&&mt(gt(o,Qn(t,r,i+1)),l)),nn(r,null,i,l),new k(l)}function Qn(n,e,t){let r=[];if(nn(null,n,t,r),n.depth>t){let i=Ai(n,e,t+1);mt(gt(i,Qn(n,e,t+1)),r)}return nn(e,null,t,r),new k(r)}function bu(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(k.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class yn{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;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Zn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new yn(t,r,s)}static resolveCached(e,t){let r=Hs.get(e);if(r)for(let s=0;se&&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()+")"),Il(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=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.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;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=k.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};yt.prototype.text=void 0;class er extends yt{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):Il(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 er(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new er(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 Il(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function js(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class xt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Cu(e,t);if(r.next==null)return xt.empty;let i=Rl(r);r.next&&r.err("Unexpected trailing text");let s=Nu(Ou(i));return Du(s,r),s}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=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{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return s}).join(` -`)}}xt.empty=new xt(!0);class Cu{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 Rl(n){let e=[];do e.push(Mu(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Mu(n){let e=[];do e.push(Tu(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Tu(n){let e=Au(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=Eu(n,e);else break;return e}function Ws(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Eu(n,e){let t=Ws(n),r=t;return n.eat(",")&&(n.next!="}"?r=Ws(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function vu(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.isInGroup(e)&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Au(n){if(n.eat("(")){let e=Rl(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=vu(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 Ou(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),i(s(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new xt(r.indexOf(n.length-1)>-1);for(let o=0;o-1}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:Bl(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new yt(this,this.computeAttrs(e),k.from(t),B.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new yt(this,this.computeAttrs(e),t,B.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.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(k.empty,!0);return s?new yt(this,e,t.append(s),B.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[s]=new $l(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}};function Iu(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class Ru{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Iu(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Fr{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=zl(e,i.attrs),this.excluded=null;let s=Pl(this.attrs);this.instance=s?new B(this,s):null}create(e=null){return!e&&this.instance?this.instance:new B(this,Bl(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Fr(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t-1}}class Fl{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Q.from(e.nodes),t.marks=Q.from(e.marks||{}),this.nodes=Us.compile(this.spec.nodes,this),this.marks=Fr.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||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=xt.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?_s(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:_s(this,o.split(" "))}this.nodeFromJSON=i=>yt.fromJSON(this,i),this.markFromJSON=i=>B.fromJSON(this,i),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 Us){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 er(r,r.defaultAttrs,e,B.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function _s(n,e){let t=[];for(let r=0;r-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Lu(n){return n.tag!=null}function Pu(n){return n.style!=null}class Xe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(Lu(i))this.tags.push(i);else if(Pu(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new Js(this,t,!1);return r.addAll(e,B.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Js(this,t,!0);return r.addAll(e,B.none,t.from,t.to),w.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o{r(o=Gs(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=Gs(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xe(e,Xe.schemaRules(e)))}}const Vl={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Bu={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Hl={ol:!0,ul:!0},kn=1,Ni=2,rn=4;function qs(n,e,t){return e!=null?(e?kn:0)|(e==="full"?Ni:0):n&&n.whitespace=="pre"?kn|Ni:t&~rn}class Ln{constructor(e,t,r,i,s,o){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=B.none,this.match=s||(o&rn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.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&kn)){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=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Vl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Js{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=qs(null,t.preserveWhitespace,0)|(r?rn:0);i?s=new Ln(i.type,i.attrs,B.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new Ln(null,null,B.none,!0,null,o):s=new Ln(e.schema.topNodeType,null,B.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&Ni?"full":this.localPreserveWS||(i.options&kn)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,` -`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o(o.type?o.type.allowsMarkType(c.type):Ys(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Ln(e,t,a,i,null,l)),this.open++,r}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;this.localPreserveWS&&(this.nodes[t].options|=kn)}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-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=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}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}}}function zu(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Hl.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function $u(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Gs(n){let e={};for(let t in n)e[t]=n[t];return e}function Ys(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=l=>{s.push(l);for(let a=0;a{if(s.length||o.marks.length){let l=0,a=0;for(;l=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&&_n(Pn(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:_n(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Tt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Xs(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Xs(e.marks)}}function Xs(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Pn(n){return n.document||window.document}const Qs=new WeakMap;function Fu(n){let e=Qs.get(n);return e===void 0&&Qs.set(n,e=Vu(n)),e}function Vu(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let l,a=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:p}=_n(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const jl=65535,Wl=Math.pow(2,16);function Hu(n,e){return n+e*Wl}function Zs(n){return n&jl}function ju(n){return(n-(n&jl))/Wl}const Kl=1,Ul=2,qn=4,_l=8;class Di{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&_l)>0}get deletedBefore(){return(this.delInfo&(Kl|qn))>0}get deletedAfter(){return(this.delInfo&(Ul|qn))>0}get deletedAcross(){return(this.delInfo&qn)>0}}class de{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&de.empty)return de.empty}recover(e){let t=0,r=Zs(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+s],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+i+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:Hu(l/3,e-a),m=0;return c&&(m|=e==a?Ul:e==d?Kl:qn,(t<0?e!=a:e!=d)&&(m|=_l)),new Di(h,m,p)}i+=u-c}return r?e+i:new Di(e+i,0,null)}touches(e,t){let r=0,i=Zs(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i=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 bn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;rs&&a!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return K.fromReplace(e,this.from,this.to,s)}invert(){return new Ce(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 Ge(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ge(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 Ge(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("addMark",Ge);class Ce extends se{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 w(ss(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return K.fromReplace(e,this.from,this.to,r)}invert(){return new Ge(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 Ce(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ce&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ce(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 Ce(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("removeMark",Ce);class Ye extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return K.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return K.fromReplace(e,this.pos,this.pos+1,new w(k.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;ir.pos?null:new G(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 G(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}}se.jsonID("replaceAround",G);function Ii(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 Wu(n,e,t,r){let i=[],s=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;mn.step(a)),s.forEach(a=>n.step(a))}function Ku(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof Fr){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;un.step(new Ce(o.from,o.to,o.style)))}function ls(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a=0;a--)n.step(o[a])}function Uu(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function _t(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,s=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+i,a=n.$to.indexAfter(r)-s;if(rt;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=s,m=!1;p>t;p--)m||i.after(p+1)=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new G(i,s,i,s,new w(r,0,0),t.length,!0))}function Yu(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,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,a)&&Xu(n.doc,n.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Jl(n,o,l,s),ls(n,n.mapping.slice(s).map(l,1),r,void 0,c===null);let u=n.mapping.slice(s),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new G(d,f,d+1,f-1,new w(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&ql(n,o,l,s),!1}})}function ql(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=n.mapping.slice(r).map(t+1+s+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Jl(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+s);n.replaceWith(o,o+1,e.type.schema.text(` -`))}})}function Xu(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function Qu(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 G(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new w(k.from(o),0,0),1,!0))}function Fe(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 c=i.depth-1,u=t-2;c>s;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(h))return!1}let l=i.indexAfter(s),a=r&&r[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function Zu(n,e,t=1,r){let i=n.doc.resolve(e),s=k.empty,o=k.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){s=k.from(i.node(l).copy(s));let u=r&&r[c];o=k.from(u?u.type.create(u.attrs,o):i.node(l).copy(o))}n.step(new H(e,e,new w(s.append(o),t,t),!0))}function st(n,e){let t=n.resolve(e),r=t.index();return Gl(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function ed(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i0?(s=r.node(i+1),l++,o=r.node(i).maybeChild(l)):(s=r.node(i).maybeChild(l-1),o=r.node(i+1)),s&&!s.isTextblock&&Gl(s,o)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function td(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,s=n.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);u&&!d?r=!1:!u&&d&&(r=!0)}let l=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);Jl(n,u.node(),u.before(),l)}o.inlineContent&&ls(n,e+t-1,o,s.node().contentMatchAt(s.index()),r==null);let a=n.mapping.slice(l),c=a.map(e-t);if(n.step(new H(c,a.map(e+t,-1),w.empty,!0)),r===!0){let u=n.doc.resolve(c);ql(n,u.node(),u.before(),n.steps.length)}return n}function nd(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=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(s==1)u=c.canReplace(a,a,i);else{let d=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function Hr(n,e,t=e,r=w.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return Xl(i,s,r)?new H(e,t,r):new rd(i,s,r).fit()}function Xl(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class rd{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=k.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=k.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):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,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new w(s,o,l);return e>-1?new G(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new H(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(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 l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(o?c.matchType(o.type)||(d=c.fillBefore(k.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:d};if(t==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced;return no(e,-1)<=t?!1:(this.unplaced.size>1&&no(e,1)>r&&r++,this.unplaced=new w(e,t+1,r),!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 w(Xt(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new w(Xt(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 m=0;m1||a==0||m.content.size)&&(d=g,u.push(Ql(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=Qt(this.placed,t,k.from(u)),this.frontier[t].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&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=0;l--){let{match:a,type:c}=this.frontier[l],u=ii(e,l,c,a,!0);if(!u||u.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=Qt(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=Qt(this.placed,this.depth,k.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(k.empty,!0);t.childCount&&(this.placed=Qt(this.placed,this.frontier.length,t))}}function Xt(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Xt(n.firstChild.content,e-1,t)))}function Qt(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Qt(n.lastChild.content,e-1,t)))}function to(n,e){for(let t=0;t1&&(r=r.replaceChild(0,Ql(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(k.empty,!0)))),n.copy(r)}function ii(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 l=r.fillBefore(s.content,!0,o);return l&&!id(t,s.content,o)?l:null}function id(n,e,t){for(let r=t;r0;f--,h--){let p=i.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==h&&o.splice(1,0,-f)}let a=o.indexOf(l),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f],p=sd(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let h=o[f];h<0||(e=i.before(h),t=s.after(h))}}function Zl(n,e,t,r,i){if(er){let s=i.contentMatchAt(0),o=s.fillBefore(n).append(n);n=o.append(s.matchFragment(o).fillBefore(k.empty,!0))}return n}function ld(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=nd(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new w(k.from(r),0,0))}function ad(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(t),l=!1;for(let a=r.depth;a>o;a--)r.node(a).type.spec.isolating&&(l=!0);for(let a=i.depth;a>o;a--)i.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=r.depth;a>0&&e==r.start(a);a--)e=r.before(a);for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);r=n.doc.resolve(e),i=n.doc.resolve(t)}}let s=ea(r,i);for(let o=0;o0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}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&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return n.delete(r.before(o),t);n.delete(e,t)}function ea(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(se.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 zt extends se{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 K.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 K.fromReplace(e,this.pos,this.pos+1,new w(k.from(i),0,t.isLeaf?0:1))}getMap(){return de.empty}invert(e){return new zt(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 zt(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 zt(t.pos,t.attr,t.value)}}se.jsonID("attr",zt);class xn extends se{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return K.ok(r)}getMap(){return de.empty}invert(e){return new xn(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new xn(t.attr,t.value)}}se.jsonID("docAttr",xn);let Ft=class extends Error{};Ft=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};Ft.prototype=Object.create(Error.prototype);Ft.prototype.constructor=Ft;Ft.prototype.name="TransformError";class ta{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new bn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ft(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}changedRange(){let e=1e9,t=-1e9;for(let r=0;r{e=Math.min(e,l),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}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=w.empty){let i=Hr(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new w(k.from(r),0,0))}delete(e,t){return this.replace(e,t,w.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return od(this,e,t,r),this}replaceRangeWith(e,t,r){return ld(this,e,t,r),this}deleteRange(e,t){return ad(this,e,t),this}lift(e,t){return _u(this,e,t),this}join(e,t=1){return td(this,e,t),this}wrap(e,t){return Gu(this,e,t),this}setBlockType(e,t=e,r,i=null){return Yu(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return Qu(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new zt(e,t,r)),this}setDocAttribute(e,t){return this.step(new xn(e,t)),this}addNodeMark(e,t){return this.step(new Ye(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof B)t.isInSet(r.marks)&&this.step(new St(e,t));else{let i=r.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new St(e,s)),i=s.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,r){return Zu(this,e,t,r),this}addMark(e,t,r){return Wu(this,e,t,r),this}removeMark(e,t,r){return Ku(this,e,t,r),this}clearIncompatible(e,t,r){return ls(this,e,t,r),this}}const si=Object.create(null);class O{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new cd(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=0;s--){let o=t<0?It(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):It(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 fe(e.node(0))}static atStart(e){return It(e,e,0,0,1)||new fe(e)}static atEnd(e){return It(e,e,e.content.size,e.childCount,-1)||new fe(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=si[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 si)throw new RangeError("Duplicate use of selection JSON ID "+e);return si[e]=t,t.prototype.jsonID=e,t}getBookmark(){return v.between(this.$anchor,this.$head).getBookmark()}}O.prototype.visible=!0;class cd{constructor(e,t){this.$from=e,this.$to=t}}let ro=!1;function io(n){!ro&&!n.parent.inlineContent&&(ro=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class v extends O{constructor(e,t=e){io(e),io(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 O.near(r);let i=e.resolve(t.map(this.anchor));return new v(i.parent.inlineContent?i:r,r)}replace(e,t=w.empty){if(super.replace(e,t),t==w.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof v&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new jr(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 v(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=O.findFrom(t,r,!0)||O.findFrom(t,-r,!0);if(s)t=s.$head;else return O.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(O.findFrom(e,-r,!0)||O.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&E.isSelectable(l))return E.create(n,t-(i<0?l.nodeSize:0))}else{let a=It(n,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function so(n,e,t){let r=n.steps.length-1;if(r{o==null&&(o=u)}),n.setSelection(O.near(n.doc.resolve(o),t))}const oo=1,Bn=2,lo=4;class dd extends ta{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Bn,this}ensureMarks(e){return B.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&Bn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Bn,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)||B.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),!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.selection.to==t+e.length&&this.setSelection(O.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|=lo,this}get scrolledIntoView(){return(this.updated&lo)>0}}function ao(n,e){return!e||!n?n:n.bind(e)}class Zt{constructor(e,t,r){this.name=e,this.init=ao(t.init,r),this.apply=ao(t.apply,r)}}const fd=[new Zt("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Zt("selection",{init(n,e){return n.selection||O.atStart(e.doc)},apply(n){return n.selection}}),new Zt("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Zt("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class oi{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=fd.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 Zt(r.key,r.spec.state,r))})}}class Be{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;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],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 oi(e.schema,e.plugins),s=new Be(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=yt.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=O.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 l in r){let a=r[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){s[o.name]=c.fromJSON.call(a,e,t[l],s);return}}s[o.name]=o.init(e,s)}}),s}}function na(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=na(i,e,{})),t[r]=i}return t}class ${constructor(e){this.spec=e,this.props={},e.props&&na(e.props,this,this.props),this.key=e.key?e.key.key:ra("plugin")}getState(e){return e[this.key]}}const li=Object.create(null);function ra(n){return n in li?n+"$"+ ++li[n]:(li[n]=0,n+"$")}class U{constructor(e="key"){this.key=ra(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ia=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function sa(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const oa=(n,e,t)=>{let r=sa(n,t);if(!r)return!1;let i=us(r);if(!i){let o=r.blockRange(),l=o&&_t(o);return l==null?!1:(e&&e(n.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(ma(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Vt(s,"end")||E.isSelectable(s)))for(let o=r.depth;;o--){let l=Hr(n.doc,r.before(o),r.after(o),w.empty);if(l&&l.slice.size1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},hd=(n,e,t)=>{let r=sa(n,t);if(!r)return!1;let i=us(r);return i?la(n,i,e):!1},pd=(n,e,t)=>{let r=ca(n,t);if(!r)return!1;let i=ds(r);return i?la(n,i,e):!1};function la(n,e,t){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Hr(n.doc,s,a,w.empty);if(!c||c.from!=s||c instanceof H&&c.slice.size>=a-s)return!1;if(t){let u=n.tr.step(c);u.setSelection(v.create(u.doc,s)),t(u.scrollIntoView())}return!0}function Vt(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 aa=(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=us(r)}let o=s&&s.nodeBefore;return!o||!E.isSelectable(o)?!1:(e&&e(n.tr.setSelection(E.create(n.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function us(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 ca(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=ca(n,t);if(!r)return!1;let i=ds(r);if(!i)return!1;let s=i.nodeAfter;if(ma(n,i,e,1))return!0;if(r.parent.content.size==0&&(Vt(s,"start")||E.isSelectable(s))){let o=Hr(n.doc,r.before(),r.after(),w.empty);if(o&&o.slice.size{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=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof E,i;if(r){if(t.node.isTextblock||!st(n.doc,t.from))return!1;i=t.from}else if(i=Vr(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection(E.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},gd=(n,e)=>{let t=n.selection,r;if(t instanceof E){if(t.node.isTextblock||!st(n.doc,t.to))return!1;r=t.to}else if(r=Vr(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},yd=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&_t(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},fa=(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 fs(n){for(let e=0;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=fs(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,o.createAndFill());a.setSelection(O.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},ha=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof fe||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=fs(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index(){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(Fe(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&_t(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function bd(n){return(e,t)=>{if(e.selection instanceof E&&e.selection.node.isBlock){let{$from:h}=e.selection;return!h.parentOffset||!Fe(e.doc,h.pos)?!1:(t&&t(e.tr.split(h.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let r=e.tr;!e.selection.empty&&(e.selection instanceof v||e.selection instanceof fe)&&r.deleteSelection();let{$from:i}=r.selection,s=r.steps.length,o=[],l,a,c=!1,u=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){c=i.end(h)==i.pos+(i.depth-h),u=i.start(h)==i.pos-(i.depth-h),a=fs(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),o.unshift(c&&a?{type:a}:null),l=h;break}else{if(h==1)return!1;o.unshift(null)}let d=i.pos,f=Fe(r.doc,d,o.length,o);if(f||(o[0]=a?{type:a}:null,f=Fe(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!c&&u&&i.node(l).type!=a){let h=r.mapping.slice(s),p=h.map(i.before(l)),m=r.doc.resolve(p);a&&i.node(l-1).canReplaceWith(m.index(),m.index()+1,a)&&r.setNodeMarkup(h.map(i.before(l)),a)}return t&&t(r.scrollIntoView()),!0}}const xd=bd(),Sd=(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(E.create(n.doc,i))),!0)};function wd(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||st(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function ma(n,e,t,r){let i=e.nodeBefore,s=e.nodeAfter,o,l,a=i.type.spec.isolating||s.type.spec.isolating;if(!a&&wd(n,e,t))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(o[0]||s.type).validEnd){if(t){let h=e.pos+s.nodeSize,p=k.empty;for(let y=o.length-1;y>=0;y--)p=k.from(o[y].create(null,p));p=k.from(i.copy(p));let m=n.tr.step(new G(e.pos-1,h,e.pos,h,new w(p,1,0),o.length,!0)),g=m.doc.resolve(h+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&st(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let u=s.type.spec.isolating||r>0&&a?null:O.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&_t(d);if(f!=null&&f>=e.depth)return t&&t(n.tr.lift(d,f).scrollIntoView()),!0;if(c&&Vt(s,"start",!0)&&Vt(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(t){let y=k.empty;for(let S=p.length-1;S>=0;S--)y=k.from(p[S].copy(y));let x=n.tr.step(new G(e.pos-p.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new w(y,p.length,0),0,!0));t(x.scrollIntoView())}return!0}}return!1}function ga(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(v.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const Cd=ga(-1),Md=ga(1);function Td(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&as(o,n,e);return l?(r&&r(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function co(n,e=null){return function(t,r){let i=!1;for(let s=0;s{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);s=new Zn(a,a,e.depth),e.endIndex=0;u--)s=k.from(t[u].type.create(t[u].attrs,s));n.step(new G(e.start-(r?2:0),e.end,e.start,e.end,new w(s,0,0),t.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?Nd(e,t,n,s):Dd(e,t,s):!0:!1}}function Nd(n,e,t,r){let i=n.tr,s=r.end,o=r.$to.end(r.depth);sm;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+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 l=t.startIndex==0,a=t.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?k.empty:k.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return r.step(new G(d-(l?1:0),f+(a?1:0),d+1,f-1,new w((l?k.empty:k.from(i.copy(k.empty))).append(a?k.empty:k.from(i.copy(k.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Id(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=k.from(c?n.create():null),d=new w(k.from(n.create(null,k.from(l.type.create(null,u)))),c?3:1,0),f=s.start,h=s.end;t(e.tr.step(new G(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}const Z=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Ht=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Ri=null;const Pe=function(n,e,t){let r=Ri||(Ri=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Rd=function(){Ri=null},wt=function(n,e,t,r){return t&&(uo(n,e,t,r,-1)||uo(n,e,t,r,1))},Ld=/^(img|br|input|textarea|hr)$/i;function uo(n,e,t,r,i){for(var s;;){if(n==t&&e==r)return!0;if(e==(i<0?0:re(n))){let o=n.parentNode;if(!o||!T(o)||vn(n)||Ld.test(n.nodeName)||n.contentEditable=="false")return!1;e=Z(n)+(i<0?0:1),n=o}else if(T(n)){let o=n.childNodes[e+(i<0?-1:0)];if(T(o)&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else n=o,e=i<0?re(n):0}else return!1}}function re(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function T(n){return n.nodeType==1}function _(n){return n.nodeType==3}function Ct(n,e){return e?n.contains(T(e)?e:e.parentNode):!1}function Pd(n,e){for(;;){if(_(n)&&e)return n;if(T(n)&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=re(n)}else if(n.parentNode&&!vn(n))e=Z(n),n=n.parentNode;else return null}}function Bd(n,e){for(;;){if(_(n)&&e2),ke=jt||(Ae?/Mac/.test(Ae.platform):!1),ba=Ae?/Win/.test(Ae.platform):!1,ze=/Android \d/.test(ot),Kr=!!fo&&"webkitFontSmoothing"in fo.documentElement.style,Vd=Kr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Hd(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Ne(n,e){return typeof n=="number"?n:n[e]}function jd(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 ho(n,e,t){if(!zi(e)&&e.left==0)return;let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,s=n.dom.ownerDocument;for(let o=t||n.dom;o;){if(!T(o)){o=Ht(o);continue}let l=o==s.body,a=l?Hd(s):jd(o),c=0,u=0;if(e.topa.bottom-Ne(r,"bottom")&&(u=e.bottom-e.top>a.bottom-a.top?e.top+Ne(i,"top")-a.top:e.bottom-a.bottom+Ne(i,"bottom")),e.lefta.right-Ne(r,"right")&&(c=e.right-a.right+Ne(i,"right")),c||u)if(l)s.defaultView.scrollBy(c,u);else{let f=o.scrollLeft,h=o.scrollTop;u&&(o.scrollTop+=u),c&&(o.scrollLeft+=c);let p=o.scrollLeft-f,m=o.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}let d=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(d))break;o=d=="absolute"?o.offsetParent:Ht(o)}}function Wd(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=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:xa(n.dom)}}function xa(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Ht(r));return e}function Kd({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Sa(t,r==0?0:r-e)}function Sa(n,e){for(let t=0;t=l){o=Math.max(p.bottom,o),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=d+1)}}return!t&&a&&(t=a,i=c,r=0),t&&_(t)?_d(t,i):!t||r?{node:n,offset:s}:wa(t,i)}function _d(n,e){let t=n.nodeValue.length,r=document.createRange(),i;for(let s=0;s=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:n,offset:0}}function ps(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function qd(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(r,i,s)}function Gd(n,e,t,r){let i=-1;for(let s=e,o=!1;s!=n.dom;){let l=n.docView.nearestDesc(s,!0),a;if(!l)return null;if(T(l.dom)&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>r.left||a.top>r.top?i=l.posBefore:(!o&&a.right-1?i:n.docView.posFromDOM(e,t,-1)}function Ca(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;Kr&&i&&T(r)&&T(c=r.childNodes[i-1])&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&T(r.lastChild)&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||!T(r)||r.childNodes[i-1].nodeName!="BR")&&(l=Gd(n,r,i,e))}l==null&&(l=Jd(n,o,e));let a=n.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function zi(n){return n.top=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:c++,qt(Ke(Pe(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==re(r))){let a=r.childNodes[i-1];if(T(a))return ai(a.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(t<0||i==re(r))){let a=r.childNodes[i-1],c=_(a)?Pe(a,re(a)-(o?0:1)):T(a)&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return qt(Ke(c,1),!1)}if(s==null&&i=0)}function qt(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 ai(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 Ta(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 Qd(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Ta(n,e,()=>{let{node:s}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=Ma(n,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(T(l))a=l.getClientRects();else if(_(l))a=Pe(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Zd=/[\u0590-\u08ac]/;function ef(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,l=n.domSelection();return l?!Zd.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?s:o:Ta(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:p,focusOffset:m}=n.domSelectionRange(),g=p&&!Ct(h,p)||a==p&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g}):r.pos==r.start()||r.pos==r.end()}let po=null,mo=null,go=!1;function tf(n,e,t){return po==e&&mo==t?go:(po=e,mo=t,go=t=="up"||t=="down"?Qd(n,e,t):ef(n,e,t))}const be=0,yo=1,ut=2,Me=3;class An{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=be,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tZ(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(e.compareDocumentPosition(this.contentDOM)&4);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)&&!(T(o)?Ct(o,e):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;te){i=e-s;break}s=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r>0;r--){let s=this.children[r-1];if(s.size||!(s instanceof va||s instanceof Ea&&s.side>=0))break}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?Z(s.dom)+1:0}}else{let s,o=!0;for(;s=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=o;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Z(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&ot){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}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=r:er){let l=r+s.border,a=o-s.border;if(e>=l&&t<=a){this.dirty=e==r||t==o?ut:yo,e==l&&t==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Me:s.markDirty(e-l,t-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?ut:Me}r=o}this.dirty=ut}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?ut:yo;t.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){let l=T(o)?o:document.createElement("span");l!=o&&l.appendChild(o),l.hasAttribute("contenteditable")||(l.contentEditable="false"),l.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==be&&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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class nf extends An{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 Ze extends An{constructor(e,t,r,i,s){super(e,[],r,i),this.mark=t,this.spec=s}static create(e,t,r,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,r);return(!o||!o.dom)&&(o=Tt.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new Ze(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Me||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Me&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=be){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(s=Fi(s,0,e,r));for(let l=0;l{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(!_(u))throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Tt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Na(u,r,t),c?a=new rf(e,t,r,i,u,d||null,f,c):t.isText?new Ur(e,t,r,i,u,f):new et(e,t,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let i=this.children[r];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}if(!t.contentElement){let r=e&&e.find(i=>T(i)&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));r?t.contentElement=r:t.getContent=()=>k.empty}}return t}matchesNode(e,t,r){return this.dirty==be&&e.eq(this.node)&&tr(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,l=s&&s.pos<0,a=new of(this,o&&o.node,e),c=this.node.inlineContent,u=c&&this.node.isBlock;cf(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?a.syncToMarks(d.spec.marks,r,e,f):d.type.side>=0&&!h&&a.syncToMarks(f==this.node.childCount?B.none:this.node.child(f).marks,r,e,f),a.placeWidget(d,e,i)},(d,f,h,p)=>{a.syncToMarks(d.marks,r,e,p),u&&d.isAtom&&!d.isText&&a.addHackNode("IMG",a.top);let m;a.findNodeMatch(d,f,h,p)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(d,f,h,m,e)||a.updateNextNode(d,f,h,e,p,i)||a.addNode(d,f,h,e,i),i+=d.nodeSize,c&&(u=d.isAtom&&!d.isText)}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==ut)&&(o&&this.protectLocalComposition(e,o),Aa(this.contentDOM,this.children,e),jt&&uf(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof v)||rt+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,l=df(this.node.content,o,r-t,i-t);return l<0?null:{node:s,pos:l,text:o}}else return{node:s,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 nf(this,s,t,i);e.input.compositionNodes.push(o),this.children=Fi(this.children,r,r+i.length,e,o)}update(e,t,r,i){return this.dirty==Me||!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=be}updateOuterDeco(e){if(tr(e,this.outerDeco))return;let t=!T(this.nodeDOM),r=this.dom;this.dom=Oa(this.dom,this.nodeDOM,$i(this.outerDeco,this.node,t),$i(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){T(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){T(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ko(n,e,t,r,i){Na(r,e,n);let s=new et(void 0,n,e,t,r,r,r);return s.contentDOM&&s.updateChildren(i,0),s}class Ur extends et{constructor(e,t,r,i,s,o){super(e,t,r,i,s,null,o)}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==Me||this.dirty!=be&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=be||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=be,!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 Ur(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Me)}get domAtom(){return!1}isText(e){return this.node.text==e}}class va extends An{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==be&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class rf extends et{constructor(e,t,r,i,s,o,l,a){super(e,t,r,i,s,o,l),this.spec=a}update(e,t,r,i){if(this.dirty==Me)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){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.root):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 Aa(n,e,t){let r=n.firstChild,i=!1;for(let s=0;s>1,l=Math.min(o,e.length);for(;s-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let u=Ze.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}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 l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof Ze)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function af(n,e){return n.type.side-e.type.side}function cf(n,e,t,r){let i=e.locals(n),s=0;if(i.length==0){for(let c=0;cs;)l.push(i[o++]);let p=s+f.nodeSize;if(f.isText){let g=p;o!g.inline):l.slice();r(f,m,e.forChild(s,f),h),s=p}}function uf(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 df(n,e,t,r){for(let i=0,s=0;i=t){if(s>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Fi(n,e,t,r,i){let s=[];for(let o=0,l=0;o=t||u<=e?s.push(a):(ct&&s.push(a.slice(t-c,a.size,r)))}return s}function ms(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 l=r.resolve(o),a,c;if(Wr(t)){for(a=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&E.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&zd(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new E(o==d?l:r.resolve(d))}else if(he&&e=="key"&&o>n.state.selection.to&&T(t.focusNode)&&t.focusOffset==t.focusNode.childNodes.length&&i&&i.posAtStart>n.state.selection.to)for(let d=t.focusNode;;d=d.parentNode){if(getComputedStyle(d).overflow!="visible"){c=O.findFrom(r.resolve(i.posAtStart),1);break}if(d==i.dom||d.nextSibling||!d.parentNode||!T(d.parentNode))break}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,f=o;for(let h=0;h{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Da(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function hf(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,r=t.nodeName=="IMG";r?e.collapse(t.parentNode,Z(t)+1):e.collapse(t,0),!r&&!n.state.selection.visible&&ue&&Qe<=11&&(t.disabled=!0,t.disabled=!1)}function Ia(n,e){if(e instanceof E){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Co(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Co(n)}function Co(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function gs(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||v.between(e,t,r)}function Mo(n){return n.editable&&!n.hasFocus()?!1:Ra(n)}function Ra(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return Ct(n.dom,e.anchorNode)&&(n.editable||Ct(n.dom,e.focusNode))}catch{return!1}}function pf(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return wt(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Vi(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&&O.findFrom(s,e)}function Ue(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function To(n,e,t){let r=n.state.selection;if(r instanceof v)if(t.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=n.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Ue(n,new v(r.$anchor,o))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Vi(n.state,e);return i&&i instanceof E?Ue(n,i):!1}else if(!(ke&&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 l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=n.docView.descAt(l))&&!o.contentDOM?E.isSelectable(s)?Ue(n,new E(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):Ue(n,new v(n.state.doc.resolve(e<0?l:l+s.nodeSize))):!1}}else return!1;else{if(r instanceof E&&r.node.isInline)return Ue(n,new v(e>0?r.$to:r.$from));{let i=Vi(n.state,e);return i?Ue(n,i):!1}}}function on(n,e){let t=n.pmViewDesc;return t?t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR"):T(n)&&n.contentEditable=="false"}function Ot(n,e){return e<0?mf(n):gf(n)}function mf(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,o=!1;for(he&&T(t)&&r0){if(!T(t))break;let l=t.childNodes[r-1];if(on(l,-1))i=t,s=--r;else if(_(l))t=l,r=t.nodeValue.length;else break}else{if(La(t))break;{let l=t.previousSibling;for(;l&&on(l,-1);)i=t.parentNode,s=Z(l),l=l.previousSibling;if(l)t=l,r=re(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?Hi(n,t,r):i&&Hi(n,i,s)}function gf(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=re(t),s,o;for(;;)if(r{n.state==i&&Ve(n)},50)}function Eo(n,e){let t=n.state.doc.resolve(e);if(!(te||ba)&&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&&o1)return s.lefti.top&&o1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function vo(n,e,t){let r=n.state.selection;if(r instanceof v&&!r.empty||t.indexOf("s")>-1||ke&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=Vi(n.state,e);if(o&&o instanceof E)return Ue(n,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=r instanceof fe?O.near(o,e):O.findFrom(o,e);return l?Ue(n,l):!1}return!1}function Ao(n,e){if(!(n.state.selection instanceof v))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 Oo(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function bf(n){if(!ie||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&T(e)&&t==0&&e.firstChild&&T(e.firstChild)&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Oo(n,r,"true"),setTimeout(()=>Oo(n,r,"false"),20)}return!1}function xf(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Sf(n,e){let t=e.keyCode,r=xf(e);if(t==8||ke&&t==72&&r=="c")return Ao(n,-1)||Ot(n,-1);if(t==46&&!e.shiftKey||ke&&t==68&&r=="c")return Ao(n,1)||Ot(n,1);if(t==13||t==27)return!0;if(t==37||ke&&t==66&&r=="c"){let i=t==37?Eo(n,n.state.selection.from)=="ltr"?-1:1:-1;return To(n,i,r)||Ot(n,i)}else if(t==39||ke&&t==70&&r=="c"){let i=t==39?Eo(n,n.state.selection.from)=="ltr"?1:-1:1;return To(n,i,r)||Ot(n,i)}else{if(t==38||ke&&t==80&&r=="c")return vo(n,-1,r)||Ot(n,-1);if(t==40||ke&&t==78&&r=="c")return bf(n)||vo(n,1,r)||Ot(n,1);if(r==(ke?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function ys(n,e){n.someProp("transformCopied",h=>{e=h(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 h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=n.someProp("clipboardSerializer")||Tt.fromSchema(n.state.schema),l=Va(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&T(c)&&(u=Fa[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=l.createElement(u[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),d++}c=a.firstChild}c&&T(c)&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,` +import{k as du,b as fu}from"./index-Vcq4gwWv.js";import{L as hu,i as pu}from"./index-DDDXRADK.js";var Bs=Object.defineProperty,mu=(n,e)=>{let t={};for(var r in n)Bs(t,r,{get:n[r],enumerable:!0});return Bs(t,Symbol.toStringTag,{value:"Module"}),t};function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function bl(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){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d=56320&&n<57344}function wl(n){return n>=55296&&n<56320}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;re&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},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);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(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 k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Dn(t+1,s):Dn(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let i=0;ithis.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;tr.type.rank-i.type.rank),t}};B.none=[];class pn extends Error{}class w{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=Ml(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(e,t){return new w(Cl(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 w.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 w(k.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 w(e,r,i)}}w.empty=new w(k.empty,0,0);function Cl(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(i==e||s.isText){if(l!=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(Cl(s.content,e-i-1,t-i-1)))}function Ml(n,e,t,r,i,s){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=Ml(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function gu(n,e,t){if(t.openStart>n.depth)throw new pn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new pn("Inconsistent open depths");return Tl(n,e,t,0)}function Tl(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function en(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&&(ht(n.nodeAfter,r),s++));for(let l=s;li&&Mi(n,e,i+1),o=r.depth>i&&Mi(t,r,i+1),l=[];return en(null,n,i,l),s&&o&&e.index(i)==t.index(i)?(El(s,o),ht(pt(s,vl(n,e,t,r,i+1)),l)):(s&&ht(pt(s,Yn(n,e,i+1)),l),en(e,t,i,l),o&&ht(pt(o,Yn(t,r,i+1)),l)),en(r,null,i,l),new k(l)}function Yn(n,e,t){let r=[];if(en(null,n,t,r),n.depth>t){let i=Mi(n,e,t+1);ht(pt(i,Yn(n,e,t+1)),r)}return en(e,null,t,r),new k(r)}function yu(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(k.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class mn{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;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Xn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new mn(t,r,s)}static resolveCached(e,t){let r=zs.get(e);if(r)for(let s=0;se&&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()+")"),Al(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=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.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;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=k.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};mt.prototype.text=void 0;class Qn extends mt{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):Al(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 Qn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Qn(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 Al(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function $s(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class kt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Su(e,t);if(r.next==null)return kt.empty;let i=Ol(r);r.next&&r.err("Unexpected trailing text");let s=Au(vu(i));return Ou(s,r),s}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=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{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return s}).join(` +`)}}kt.empty=new kt(!0);class Su{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 Ol(n){let e=[];do e.push(wu(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function wu(n){let e=[];do e.push(Cu(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Cu(n){let e=Eu(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=Mu(n,e);else break;return e}function Fs(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Mu(n,e){let t=Fs(n),r=t;return n.eat(",")&&(n.next!="}"?r=Fs(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Tu(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.isInGroup(e)&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Eu(n){if(n.eat("(")){let e=Ol(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=Tu(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 vu(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),i(s(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new kt(r.indexOf(n.length-1)>-1);for(let o=0;o-1}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:Il(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new mt(this,this.computeAttrs(e),k.from(t),B.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new mt(this,this.computeAttrs(e),t,B.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.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(k.empty,!0);return s?new mt(this,e,t.append(s),B.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[s]=new Ll(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}};function Nu(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class Du{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Nu(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Br{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Rl(e,i.attrs),this.excluded=null;let s=Dl(this.attrs);this.instance=s?new B(this,s):null}create(e=null){return!e&&this.instance?this.instance:new B(this,Il(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Br(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t-1}}class Pl{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Q.from(e.nodes),t.marks=Q.from(e.marks||{}),this.nodes=Hs.compile(this.spec.nodes,this),this.marks=Br.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||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=kt.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?js(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:js(this,o.split(" "))}this.nodeFromJSON=i=>mt.fromJSON(this,i),this.markFromJSON=i=>B.fromJSON(this,i),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 Hs){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 Qn(r,r.defaultAttrs,e,B.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function js(n,e){let t=[];for(let r=0;r-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Iu(n){return n.tag!=null}function Ru(n){return n.style!=null}class Ye{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(Iu(i))this.tags.push(i);else if(Ru(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new Ks(this,t,!1);return r.addAll(e,B.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Ks(this,t,!0);return r.addAll(e,B.none,t.from,t.to),w.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o{r(o=_s(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=_s(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ye(e,Ye.schemaRules(e)))}}const Bl={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Lu={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zl={ol:!0,ul:!0},gn=1,Ei=2,tn=4;function Ws(n,e,t){return e!=null?(e?gn:0)|(e==="full"?Ei:0):n&&n.whitespace=="pre"?gn|Ei:t&~tn}class In{constructor(e,t,r,i,s,o){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=B.none,this.match=s||(o&tn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.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&gn)){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=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Bl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ks{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=Ws(null,t.preserveWhitespace,0)|(r?tn:0);i?s=new In(i.type,i.attrs,B.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new In(null,null,B.none,!0,null,o):s=new In(e.schema.topNodeType,null,B.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&Ei?"full":this.localPreserveWS||(i.options&gn)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,` +`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o(o.type?o.type.allowsMarkType(c.type):Us(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new In(e,t,a,i,null,l)),this.open++,r}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;this.localPreserveWS&&(this.nodes[t].options|=gn)}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-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=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}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}}}function Pu(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&zl.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Bu(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function _s(n){let e={};for(let t in n)e[t]=n[t];return e}function Us(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=l=>{s.push(l);for(let a=0;a{if(s.length||o.marks.length){let l=0,a=0;for(;l=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&&Kn(Rn(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:Kn(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ct(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=qs(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return qs(e.marks)}}function qs(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Rn(n){return n.document||window.document}const Js=new WeakMap;function zu(n){let e=Js.get(n);return e===void 0&&Js.set(n,e=$u(n)),e}function $u(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let l,a=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:p}=Kn(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const $l=65535,Fl=Math.pow(2,16);function Fu(n,e){return n+e*Fl}function Gs(n){return n&$l}function Vu(n){return(n-(n&$l))/Fl}const Vl=1,Hl=2,_n=4,jl=8;class vi{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&jl)>0}get deletedBefore(){return(this.delInfo&(Vl|_n))>0}get deletedAfter(){return(this.delInfo&(Hl|_n))>0}get deletedAcross(){return(this.delInfo&_n)>0}}class ue{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ue.empty)return ue.empty}recover(e){let t=0,r=Gs(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+s],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+i+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:Fu(l/3,e-a),m=0;return c&&(m|=e==a?Hl:e==d?Vl:_n,(t<0?e!=a:e!=d)&&(m|=jl)),new vi(h,m,p)}i+=u-c}return r?e+i:new vi(e+i,0,null)}touches(e,t){let r=0,i=Gs(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i=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 yn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;rs&&a!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return K.fromReplace(e,this.from,this.to,s)}invert(){return new we(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 Je(t.pos,r.pos,this.mark)}merge(e){return e instanceof Je&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Je(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 Je(t.from,t.to,e.markFromJSON(t.mark))}}ie.jsonID("addMark",Je);class we extends ie{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 w(ts(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return K.fromReplace(e,this.from,this.to,r)}invert(){return new Je(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 we(t.pos,r.pos,this.mark)}merge(e){return e instanceof we&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new we(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 we(t.from,t.to,e.markFromJSON(t.mark))}}ie.jsonID("removeMark",we);class Ge extends ie{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return K.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return K.fromReplace(e,this.pos,this.pos+1,new w(k.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;ir.pos?null:new G(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 G(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}}ie.jsonID("replaceAround",G);function Ai(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 Hu(n,e,t,r){let i=[],s=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;mn.step(a)),s.forEach(a=>n.step(a))}function ju(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof Br){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;un.step(new we(o.from,o.to,o.style)))}function ns(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a=0;a--)n.step(o[a])}function Wu(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Kt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,s=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+i,a=n.$to.indexAfter(r)-s;if(rt;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=s,m=!1;p>t;p--)m||i.after(p+1)=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new G(i,s,i,s,new w(r,0,0),t.length,!0))}function Ju(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,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,a)&&Gu(n.doc,n.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Kl(n,o,l,s),ns(n,n.mapping.slice(s).map(l,1),r,void 0,c===null);let u=n.mapping.slice(s),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new G(d,f,d+1,f-1,new w(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Wl(n,o,l,s),!1}})}function Wl(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=n.mapping.slice(r).map(t+1+s+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Kl(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+s);n.replaceWith(o,o+1,e.type.schema.text(` +`))}})}function Gu(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function Yu(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 G(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new w(k.from(o),0,0),1,!0))}function $e(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 c=i.depth-1,u=t-2;c>s;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(h))return!1}let l=i.indexAfter(s),a=r&&r[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function Xu(n,e,t=1,r){let i=n.doc.resolve(e),s=k.empty,o=k.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){s=k.from(i.node(l).copy(s));let u=r&&r[c];o=k.from(u?u.type.create(u.attrs,o):i.node(l).copy(o))}n.step(new H(e,e,new w(s.append(o),t,t),!0))}function rt(n,e){let t=n.resolve(e),r=t.index();return _l(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Qu(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i0?(s=r.node(i+1),l++,o=r.node(i).maybeChild(l)):(s=r.node(i).maybeChild(l-1),o=r.node(i+1)),s&&!s.isTextblock&&_l(s,o)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function Zu(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,s=n.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);u&&!d?r=!1:!u&&d&&(r=!0)}let l=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);Kl(n,u.node(),u.before(),l)}o.inlineContent&&ns(n,e+t-1,o,s.node().contentMatchAt(s.index()),r==null);let a=n.mapping.slice(l),c=a.map(e-t);if(n.step(new H(c,a.map(e+t,-1),w.empty,!0)),r===!0){let u=n.doc.resolve(c);Wl(n,u.node(),u.before(),n.steps.length)}return n}function ed(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=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(s==1)u=c.canReplace(a,a,i);else{let d=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function $r(n,e,t=e,r=w.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return ql(i,s,r)?new H(e,t,r):new td(i,s,r).fit()}function ql(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class td{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=k.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=k.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):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,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new w(s,o,l);return e>-1?new G(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new H(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(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=Xs(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(o?c.matchType(o.type)||(d=c.fillBefore(k.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:d};if(t==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced;return Qs(e,-1)<=t?!1:(this.unplaced.size>1&&Qs(e,1)>r&&r++,this.unplaced=new w(e,t+1,r),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Xs(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new w(Gt(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new w(Gt(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 m=0;m1||a==0||m.content.size)&&(d=g,u.push(Jl(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=Yt(this.placed,t,k.from(u)),this.frontier[t].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&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=0;l--){let{match:a,type:c}=this.frontier[l],u=ti(e,l,c,a,!0);if(!u||u.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=Yt(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=Yt(this.placed,this.depth,k.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(k.empty,!0);t.childCount&&(this.placed=Yt(this.placed,this.frontier.length,t))}}function Gt(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Gt(n.firstChild.content,e-1,t)))}function Yt(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Yt(n.lastChild.content,e-1,t)))}function Xs(n,e){for(let t=0;t1&&(r=r.replaceChild(0,Jl(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(k.empty,!0)))),n.copy(r)}function ti(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 l=r.fillBefore(s.content,!0,o);return l&&!nd(t,s.content,o)?l:null}function nd(n,e,t){for(let r=t;r0;f--,h--){let p=i.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==h&&o.splice(1,0,-f)}let a=o.indexOf(l),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f],p=rd(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let h=o[f];h<0||(e=i.before(h),t=s.after(h))}}function Gl(n,e,t,r,i){if(er){let s=i.contentMatchAt(0),o=s.fillBefore(n).append(n);n=o.append(s.matchFragment(o).fillBefore(k.empty,!0))}return n}function sd(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=ed(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new w(k.from(r),0,0))}function od(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(t),l=!1;for(let a=r.depth;a>o;a--)r.node(a).type.spec.isolating&&(l=!0);for(let a=i.depth;a>o;a--)i.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=r.depth;a>0&&e==r.start(a);a--)e=r.before(a);for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);r=n.doc.resolve(e),i=n.doc.resolve(t)}}let s=Yl(r,i);for(let o=0;o0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}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&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return n.delete(r.before(o),t);n.delete(e,t)}function Yl(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(se.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 Pt extends ie{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 K.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 K.fromReplace(e,this.pos,this.pos+1,new w(k.from(i),0,t.isLeaf?0:1))}getMap(){return ue.empty}invert(e){return new Pt(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 Pt(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 Pt(t.pos,t.attr,t.value)}}ie.jsonID("attr",Pt);class kn extends ie{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return K.ok(r)}getMap(){return ue.empty}invert(e){return new kn(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new kn(t.attr,t.value)}}ie.jsonID("docAttr",kn);let zt=class extends Error{};zt=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};zt.prototype=Object.create(Error.prototype);zt.prototype.constructor=zt;zt.prototype.name="TransformError";class Xl{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new yn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new zt(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}changedRange(){let e=1e9,t=-1e9;for(let r=0;r{e=Math.min(e,l),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}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=w.empty){let i=$r(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new w(k.from(r),0,0))}delete(e,t){return this.replace(e,t,w.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return id(this,e,t,r),this}replaceRangeWith(e,t,r){return sd(this,e,t,r),this}deleteRange(e,t){return od(this,e,t),this}lift(e,t){return Ku(this,e,t),this}join(e,t=1){return Zu(this,e,t),this}wrap(e,t){return qu(this,e,t),this}setBlockType(e,t=e,r,i=null){return Ju(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return Yu(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Pt(e,t,r)),this}setDocAttribute(e,t){return this.step(new kn(e,t)),this}addNodeMark(e,t){return this.step(new Ge(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof B)t.isInSet(r.marks)&&this.step(new bt(e,t));else{let i=r.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new bt(e,s)),i=s.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,r){return Xu(this,e,t,r),this}addMark(e,t,r){return Hu(this,e,t,r),this}removeMark(e,t,r){return ju(this,e,t,r),this}clearIncompatible(e,t,r){return ns(this,e,t,r),this}}const ni=Object.create(null);class O{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new ld(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=0;s--){let o=t<0?Nt(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):Nt(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 de(e.node(0))}static atStart(e){return Nt(e,e,0,0,1)||new de(e)}static atEnd(e){return Nt(e,e,e.content.size,e.childCount,-1)||new de(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ni[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 ni)throw new RangeError("Duplicate use of selection JSON ID "+e);return ni[e]=t,t.prototype.jsonID=e,t}getBookmark(){return v.between(this.$anchor,this.$head).getBookmark()}}O.prototype.visible=!0;class ld{constructor(e,t){this.$from=e,this.$to=t}}let Zs=!1;function eo(n){!Zs&&!n.parent.inlineContent&&(Zs=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class v extends O{constructor(e,t=e){eo(e),eo(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 O.near(r);let i=e.resolve(t.map(this.anchor));return new v(i.parent.inlineContent?i:r,r)}replace(e,t=w.empty){if(super.replace(e,t),t==w.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof v&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Fr(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 v(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=O.findFrom(t,r,!0)||O.findFrom(t,-r,!0);if(s)t=s.$head;else return O.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(O.findFrom(e,-r,!0)||O.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&E.isSelectable(l))return E.create(n,t-(i<0?l.nodeSize:0))}else{let a=Nt(n,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function to(n,e,t){let r=n.steps.length-1;if(r{o==null&&(o=u)}),n.setSelection(O.near(n.doc.resolve(o),t))}const no=1,Ln=2,ro=4;class cd extends Xl{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ln,this}ensureMarks(e){return B.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&Ln)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Ln,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)||B.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),!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.selection.to==t+e.length&&this.setSelection(O.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|=ro,this}get scrolledIntoView(){return(this.updated&ro)>0}}function io(n,e){return!e||!n?n:n.bind(e)}class Xt{constructor(e,t,r){this.name=e,this.init=io(t.init,r),this.apply=io(t.apply,r)}}const ud=[new Xt("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Xt("selection",{init(n,e){return n.selection||O.atStart(e.doc)},apply(n){return n.selection}}),new Xt("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Xt("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class ri{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ud.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 Xt(r.key,r.spec.state,r))})}}class Pe{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;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],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 ri(e.schema,e.plugins),s=new Pe(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=mt.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=O.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 l in r){let a=r[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){s[o.name]=c.fromJSON.call(a,e,t[l],s);return}}s[o.name]=o.init(e,s)}}),s}}function Ql(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Ql(i,e,{})),t[r]=i}return t}class ${constructor(e){this.spec=e,this.props={},e.props&&Ql(e.props,this,this.props),this.key=e.key?e.key.key:Zl("plugin")}getState(e){return e[this.key]}}const ii=Object.create(null);function Zl(n){return n in ii?n+"$"+ ++ii[n]:(ii[n]=0,n+"$")}class _{constructor(e="key"){this.key=Zl(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ea=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function ta(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const na=(n,e,t)=>{let r=ta(n,t);if(!r)return!1;let i=ss(r);if(!i){let o=r.blockRange(),l=o&&Kt(o);return l==null?!1:(e&&e(n.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(da(n,i,e,-1))return!0;if(r.parent.content.size==0&&($t(s,"end")||E.isSelectable(s)))for(let o=r.depth;;o--){let l=$r(n.doc,r.before(o),r.after(o),w.empty);if(l&&l.slice.size1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},dd=(n,e,t)=>{let r=ta(n,t);if(!r)return!1;let i=ss(r);return i?ra(n,i,e):!1},fd=(n,e,t)=>{let r=sa(n,t);if(!r)return!1;let i=ls(r);return i?ra(n,i,e):!1};function ra(n,e,t){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=$r(n.doc,s,a,w.empty);if(!c||c.from!=s||c instanceof H&&c.slice.size>=a-s)return!1;if(t){let u=n.tr.step(c);u.setSelection(v.create(u.doc,s)),t(u.scrollIntoView())}return!0}function $t(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 ia=(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=ss(r)}let o=s&&s.nodeBefore;return!o||!E.isSelectable(o)?!1:(e&&e(n.tr.setSelection(E.create(n.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function ss(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 sa(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=sa(n,t);if(!r)return!1;let i=ls(r);if(!i)return!1;let s=i.nodeAfter;if(da(n,i,e,1))return!0;if(r.parent.content.size==0&&($t(s,"start")||E.isSelectable(s))){let o=$r(n.doc,r.before(),r.after(),w.empty);if(o&&o.slice.size{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=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof E,i;if(r){if(t.node.isTextblock||!rt(n.doc,t.from))return!1;i=t.from}else if(i=zr(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection(E.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},pd=(n,e)=>{let t=n.selection,r;if(t instanceof E){if(t.node.isTextblock||!rt(n.doc,t.to))return!1;r=t.to}else if(r=zr(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},md=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&Kt(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},aa=(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 as(n){for(let e=0;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=as(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,o.createAndFill());a.setSelection(O.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},ca=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof de||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=as(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index(){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($e(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Kt(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function yd(n){return(e,t)=>{if(e.selection instanceof E&&e.selection.node.isBlock){let{$from:h}=e.selection;return!h.parentOffset||!$e(e.doc,h.pos)?!1:(t&&t(e.tr.split(h.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let r=e.tr;!e.selection.empty&&(e.selection instanceof v||e.selection instanceof de)&&r.deleteSelection();let{$from:i}=r.selection,s=r.steps.length,o=[],l,a,c=!1,u=!1;for(let h=i.depth;;h--)if(i.node(h).isBlock){c=i.end(h)==i.pos+(i.depth-h),u=i.start(h)==i.pos-(i.depth-h),a=as(i.node(h-1).contentMatchAt(i.indexAfter(h-1))),o.unshift(c&&a?{type:a}:null),l=h;break}else{if(h==1)return!1;o.unshift(null)}let d=i.pos,f=$e(r.doc,d,o.length,o);if(f||(o[0]=a?{type:a}:null,f=$e(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!c&&u&&i.node(l).type!=a){let h=r.mapping.slice(s),p=h.map(i.before(l)),m=r.doc.resolve(p);a&&i.node(l-1).canReplaceWith(m.index(),m.index()+1,a)&&r.setNodeMarkup(h.map(i.before(l)),a)}return t&&t(r.scrollIntoView()),!0}}const kd=yd(),bd=(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(E.create(n.doc,i))),!0)};function xd(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||rt(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function da(n,e,t,r){let i=e.nodeBefore,s=e.nodeAfter,o,l,a=i.type.spec.isolating||s.type.spec.isolating;if(!a&&xd(n,e,t))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(o[0]||s.type).validEnd){if(t){let h=e.pos+s.nodeSize,p=k.empty;for(let y=o.length-1;y>=0;y--)p=k.from(o[y].create(null,p));p=k.from(i.copy(p));let m=n.tr.step(new G(e.pos-1,h,e.pos,h,new w(p,1,0),o.length,!0)),g=m.doc.resolve(h+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&rt(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let u=s.type.spec.isolating||r>0&&a?null:O.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Kt(d);if(f!=null&&f>=e.depth)return t&&t(n.tr.lift(d,f).scrollIntoView()),!0;if(c&&$t(s,"start",!0)&&$t(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(t){let y=k.empty;for(let S=p.length-1;S>=0;S--)y=k.from(p[S].copy(y));let x=n.tr.step(new G(e.pos-p.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new w(y,p.length,0),0,!0));t(x.scrollIntoView())}return!0}}return!1}function fa(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(v.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const Sd=fa(-1),wd=fa(1);function Cd(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&rs(o,n,e);return l?(r&&r(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function so(n,e=null){return function(t,r){let i=!1;for(let s=0;s{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);s=new Xn(a,a,e.depth),e.endIndex=0;u--)s=k.from(t[u].type.create(t[u].attrs,s));n.step(new G(e.start-(r?2:0),e.end,e.start,e.end,new w(s,0,0),t.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?Ad(e,t,n,s):Od(e,t,s):!0:!1}}function Ad(n,e,t,r){let i=n.tr,s=r.end,o=r.$to.end(r.depth);sm;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+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 l=t.startIndex==0,a=t.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?k.empty:k.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return r.step(new G(d-(l?1:0),f+(a?1:0),d+1,f-1,new w((l?k.empty:k.from(i.copy(k.empty))).append(a?k.empty:k.from(i.copy(k.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Nd(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=k.from(c?n.create():null),d=new w(k.from(n.create(null,k.from(l.type.create(null,u)))),c?3:1,0),f=s.start,h=s.end;t(e.tr.step(new G(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}const Z=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Ft=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Oi=null;const Le=function(n,e,t){let r=Oi||(Oi=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Dd=function(){Oi=null},xt=function(n,e,t,r){return t&&(oo(n,e,t,r,-1)||oo(n,e,t,r,1))},Id=/^(img|br|input|textarea|hr)$/i;function oo(n,e,t,r,i){for(var s;;){if(n==t&&e==r)return!0;if(e==(i<0?0:ne(n))){let o=n.parentNode;if(!o||!T(o)||Tn(n)||Id.test(n.nodeName)||n.contentEditable=="false")return!1;e=Z(n)+(i<0?0:1),n=o}else if(T(n)){let o=n.childNodes[e+(i<0?-1:0)];if(T(o)&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else n=o,e=i<0?ne(n):0}else return!1}}function ne(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function T(n){return n.nodeType==1}function U(n){return n.nodeType==3}function St(n,e){return e?n.contains(T(e)?e:e.parentNode):!1}function Rd(n,e){for(;;){if(U(n)&&e)return n;if(T(n)&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=ne(n)}else if(n.parentNode&&!Tn(n))e=Z(n),n=n.parentNode;else return null}}function Ld(n,e){for(;;){if(U(n)&&e2),ye=Vt||(ve?/Mac/.test(ve.platform):!1),ma=ve?/Win/.test(ve.platform):!1,Be=/Android \d/.test(it),Hr=!!lo&&"webkitFontSmoothing"in lo.documentElement.style,$d=Hr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Fd(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Oe(n,e){return typeof n=="number"?n:n[e]}function Vd(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 ao(n,e,t){if(!Ri(e)&&e.left==0)return;let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,s=n.dom.ownerDocument;for(let o=t||n.dom;o;){if(!T(o)){o=Ft(o);continue}let l=o==s.body,a=l?Fd(s):Vd(o),c=0,u=0;if(e.topa.bottom-Oe(r,"bottom")&&(u=e.bottom-e.top>a.bottom-a.top?e.top+Oe(i,"top")-a.top:e.bottom-a.bottom+Oe(i,"bottom")),e.lefta.right-Oe(r,"right")&&(c=e.right-a.right+Oe(i,"right")),c||u)if(l)s.defaultView.scrollBy(c,u);else{let f=o.scrollLeft,h=o.scrollTop;u&&(o.scrollTop+=u),c&&(o.scrollLeft+=c);let p=o.scrollLeft-f,m=o.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}let d=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(d))break;o=d=="absolute"?o.offsetParent:Ft(o)}}function Hd(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=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:ga(n.dom)}}function ga(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Ft(r));return e}function jd({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;ya(t,r==0?0:r-e)}function ya(n,e){for(let t=0;t=l){o=Math.max(p.bottom,o),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=d+1)}}return!t&&a&&(t=a,i=c,r=0),t&&U(t)?Kd(t,i):!t||r?{node:n,offset:s}:ka(t,i)}function Kd(n,e){let t=n.nodeValue.length,r=document.createRange(),i;for(let s=0;s=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:n,offset:0}}function us(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function _d(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(r,i,s)}function qd(n,e,t,r){let i=-1;for(let s=e,o=!1;s!=n.dom;){let l=n.docView.nearestDesc(s,!0),a;if(!l)return null;if(T(l.dom)&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>r.left||a.top>r.top?i=l.posBefore:(!o&&a.right-1?i:n.docView.posFromDOM(e,t,-1)}function ba(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;Hr&&i&&T(r)&&T(c=r.childNodes[i-1])&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&T(r.lastChild)&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||!T(r)||r.childNodes[i-1].nodeName!="BR")&&(l=qd(n,r,i,e))}l==null&&(l=Ud(n,o,e));let a=n.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Ri(n){return n.top=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:c++,_t(We(Le(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==ne(r))){let a=r.childNodes[i-1];if(T(a))return si(a.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(t<0||i==ne(r))){let a=r.childNodes[i-1],c=U(a)?Le(a,ne(a)-(o?0:1)):T(a)&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return _t(We(c,1),!1)}if(s==null&&i=0)}function _t(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 si(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 Sa(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 Yd(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Sa(n,e,()=>{let{node:s}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=xa(n,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(T(l))a=l.getClientRects();else if(U(l))a=Le(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Xd=/[\u0590-\u08ac]/;function Qd(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,l=n.domSelection();return l?!Xd.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?s:o:Sa(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:p,focusOffset:m}=n.domSelectionRange(),g=p&&!St(h,p)||a==p&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g}):r.pos==r.start()||r.pos==r.end()}let co=null,uo=null,fo=!1;function Zd(n,e,t){return co==e&&uo==t?fo:(co=e,uo=t,fo=t=="up"||t=="down"?Yd(n,e,t):Qd(n,e,t))}const ke=0,ho=1,at=2,Ce=3;class En{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=ke,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tZ(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(e.compareDocumentPosition(this.contentDOM)&4);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)&&!(T(o)?St(o,e):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;te){i=e-s;break}s=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r>0;r--){let s=this.children[r-1];if(s.size||!(s instanceof Ca||s instanceof wa&&s.side>=0))break}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?Z(s.dom)+1:0}}else{let s,o=!0;for(;s=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=o;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Z(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&ot){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}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=r:er){let l=r+s.border,a=o-s.border;if(e>=l&&t<=a){this.dirty=e==r||t==o?at:ho,e==l&&t==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Ce:s.markDirty(e-l,t-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?at:Ce}r=o}this.dirty=at}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?at:ho;t.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){let l=T(o)?o:document.createElement("span");l!=o&&l.appendChild(o),l.hasAttribute("contenteditable")||(l.contentEditable="false"),l.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==ke&&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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ef extends En{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 Qe extends En{constructor(e,t,r,i,s){super(e,[],r,i),this.mark=t,this.spec=s}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),null,t.attrs)),new Qe(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ce||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ce&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ke){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(s=Pi(s,0,e,r));for(let l=0;l{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(!U(u))throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Ct.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Ea(u,r,t),c?a=new tf(e,t,r,i,u,d||null,f,c):t.isText?new jr(e,t,r,i,u,f):new Ze(e,t,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let i=this.children[r];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}if(!t.contentElement){let r=e&&e.find(i=>T(i)&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));r?t.contentElement=r:t.getContent=()=>k.empty}}return t}matchesNode(e,t,r){return this.dirty==ke&&e.eq(this.node)&&Zn(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,l=s&&s.pos<0,a=new rf(this,o&&o.node,e),c=this.node.inlineContent,u=c&&this.node.isBlock;lf(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?a.syncToMarks(d.spec.marks,r,e,f):d.type.side>=0&&!h&&a.syncToMarks(f==this.node.childCount?B.none:this.node.child(f).marks,r,e,f),a.placeWidget(d,e,i)},(d,f,h,p)=>{a.syncToMarks(d.marks,r,e,p),u&&d.isAtom&&!d.isText&&a.addHackNode("IMG",a.top);let m;a.findNodeMatch(d,f,h,p)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(d,f,h,m,e)||a.updateNextNode(d,f,h,e,p,i)||a.addNode(d,f,h,e,i),i+=d.nodeSize,c&&(u=d.isAtom&&!d.isText)}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==at)&&(o&&this.protectLocalComposition(e,o),Ma(this.contentDOM,this.children,e),Vt&&af(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof v)||rt+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,l=cf(this.node.content,o,r-t,i-t);return l<0?null:{node:s,pos:l,text:o}}else return{node:s,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 ef(this,s,t,i);e.input.compositionNodes.push(o),this.children=Pi(this.children,r,r+i.length,e,o)}update(e,t,r,i){return this.dirty==Ce||!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=ke}updateOuterDeco(e){if(Zn(e,this.outerDeco))return;let t=!T(this.nodeDOM),r=this.dom;this.dom=Ta(this.dom,this.nodeDOM,Li(this.outerDeco,this.node,t),Li(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){T(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){T(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function po(n,e,t,r,i){Ea(r,e,n);let s=new Ze(void 0,n,e,t,r,r,r);return s.contentDOM&&s.updateChildren(i,0),s}class jr extends Ze{constructor(e,t,r,i,s,o){super(e,t,r,i,s,null,o)}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==Ce||this.dirty!=ke&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=ke||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=ke,!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 jr(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ce)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Ca extends En{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ke&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class tf extends Ze{constructor(e,t,r,i,s,o,l,a){super(e,t,r,i,s,o,l),this.spec=a}update(e,t,r,i){if(this.dirty==Ce)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){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.root):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 Ma(n,e,t){let r=n.firstChild,i=!1;for(let s=0;s>1,l=Math.min(o,e.length);for(;s-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let u=Qe.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}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 l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof Qe)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function of(n,e){return n.type.side-e.type.side}function lf(n,e,t,r){let i=e.locals(n),s=0;if(i.length==0){for(let c=0;cs;)l.push(i[o++]);let p=s+f.nodeSize;if(f.isText){let g=p;o!g.inline):l.slice();r(f,m,e.forChild(s,f),h),s=p}}function af(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 cf(n,e,t,r){for(let i=0,s=0;i=t){if(s>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Pi(n,e,t,r,i){let s=[];for(let o=0,l=0;o=t||u<=e?s.push(a):(ct&&s.push(a.slice(t-c,a.size,r)))}return s}function ds(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 l=r.resolve(o),a,c;if(Vr(t)){for(a=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&E.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&Pd(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new E(o==d?l:r.resolve(d))}else if(fe&&e=="key"&&o>n.state.selection.to&&T(t.focusNode)&&t.focusOffset==t.focusNode.childNodes.length&&i&&i.posAtStart>n.state.selection.to)for(let d=t.focusNode;;d=d.parentNode){if(getComputedStyle(d).overflow!="visible"){c=O.findFrom(r.resolve(i.posAtStart),1);break}if(d==i.dom||d.nextSibling||!d.parentNode||!T(d.parentNode))break}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,f=o;for(let h=0;h{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!va(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function df(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,r=t.nodeName=="IMG";r?e.collapse(t.parentNode,Z(t)+1):e.collapse(t,0),!r&&!n.state.selection.visible&&ce&&Xe<=11&&(t.disabled=!0,t.disabled=!1)}function Aa(n,e){if(e instanceof E){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(bo(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else bo(n)}function bo(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function fs(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||v.between(e,t,r)}function xo(n){return n.editable&&!n.hasFocus()?!1:Oa(n)}function Oa(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return St(n.dom,e.anchorNode)&&(n.editable||St(n.dom,e.focusNode))}catch{return!1}}function ff(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return xt(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Bi(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&&O.findFrom(s,e)}function Ke(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function So(n,e,t){let r=n.state.selection;if(r instanceof v)if(t.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=n.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Ke(n,new v(r.$anchor,o))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Bi(n.state,e);return i&&i instanceof E?Ke(n,i):!1}else if(!(ye&&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 l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=n.docView.descAt(l))&&!o.contentDOM?E.isSelectable(s)?Ke(n,new E(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):Ke(n,new v(n.state.doc.resolve(e<0?l:l+s.nodeSize))):!1}}else return!1;else{if(r instanceof E&&r.node.isInline)return Ke(n,new v(e>0?r.$to:r.$from));{let i=Bi(n.state,e);return i?Ke(n,i):!1}}}function rn(n,e){let t=n.pmViewDesc;return t?t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR"):T(n)&&n.contentEditable=="false"}function vt(n,e){return e<0?hf(n):pf(n)}function hf(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,o=!1;for(fe&&T(t)&&r0){if(!T(t))break;let l=t.childNodes[r-1];if(rn(l,-1))i=t,s=--r;else if(U(l))t=l,r=t.nodeValue.length;else break}else{if(Na(t))break;{let l=t.previousSibling;for(;l&&rn(l,-1);)i=t.parentNode,s=Z(l),l=l.previousSibling;if(l)t=l,r=ne(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?zi(n,t,r):i&&zi(n,i,s)}function pf(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=ne(t),s,o;for(;;)if(r{n.state==i&&Fe(n)},50)}function wo(n,e){let t=n.state.doc.resolve(e);if(!(ee||ma)&&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&&o1)return s.lefti.top&&o1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Co(n,e,t){let r=n.state.selection;if(r instanceof v&&!r.empty||t.indexOf("s")>-1||ye&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=Bi(n.state,e);if(o&&o instanceof E)return Ke(n,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=r instanceof de?O.near(o,e):O.findFrom(o,e);return l?Ke(n,l):!1}return!1}function Mo(n,e){if(!(n.state.selection instanceof v))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 To(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function yf(n){if(!re||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&T(e)&&t==0&&e.firstChild&&T(e.firstChild)&&e.firstChild.contentEditable=="false"){let r=e.firstChild;To(n,r,"true"),setTimeout(()=>To(n,r,"false"),20)}return!1}function kf(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function bf(n,e){let t=e.keyCode,r=kf(e);if(t==8||ye&&t==72&&r=="c")return Mo(n,-1)||vt(n,-1);if(t==46&&!e.shiftKey||ye&&t==68&&r=="c")return Mo(n,1)||vt(n,1);if(t==13||t==27)return!0;if(t==37||ye&&t==66&&r=="c"){let i=t==37?wo(n,n.state.selection.from)=="ltr"?-1:1:-1;return So(n,i,r)||vt(n,i)}else if(t==39||ye&&t==70&&r=="c"){let i=t==39?wo(n,n.state.selection.from)=="ltr"?1:-1:1;return So(n,i,r)||vt(n,i)}else{if(t==38||ye&&t==80&&r=="c")return Co(n,-1,r)||vt(n,-1);if(t==40||ye&&t==78&&r=="c")return yf(n)||Co(n,1,r)||vt(n,1);if(r==(ye?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function hs(n,e){n.someProp("transformCopied",h=>{e=h(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 h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=n.someProp("clipboardSerializer")||Ct.fromSchema(n.state.schema),l=Ba(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&T(c)&&(u=Pa[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=l.createElement(u[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),d++}c=a.firstChild}c&&T(c)&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,` -`);return{dom:a,text:f,slice:e}}function Pa(n,e,t,r,i){let s=i.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=!!e&&(r||s||!t);if(a){if(n.someProp("transformPastedText",f=>{e=f(e,s||r,n)}),s)return l=new w(k.from(n.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0),n.someProp("transformPasted",f=>{l=f(l,n,!0)}),l;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)l=d;else{let f=i.marks(),{schema:h}=n.state,p=Tt.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=Tf(t),Kr&&Ef(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=o.firstChild;for(;f&&!T(f);)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Xe.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!wf.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=vf(No(l,+u[1],+u[2]),u[4]);else if(l=w.maxOpen(Cf(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d{l=d(l,n,a)}),l}const wf=/^(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 Cf(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(l=>{if(!o)return;let a=i.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&s.length&&za(a,s,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=$a(o[o.length-1],s.length));let u=Ba(l,a);o.push(u),i=i.matchType(u.type),s=a}}),o)return k.from(o)}return n}function Ba(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,k.from(n));return n}function za(n,e,t,r,i){if(i1&&(s=0),i=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(k.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function No(n,e,t){return et})}return Jt.createHTML(n)}function Tf(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Va(),r=t.body,i=/<([a-z][^>\s]+)/i.exec(n),s;if((s=i&&Fa[i[1].toLowerCase()])&&(n=s.map(o=>"<"+o+">").join("")+n+s.map(o=>"").reverse().join("")),r.innerHTML=Mf(n),s)for(let o=0;o=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;try{i=k.from(a.create(r[l+1],i))}catch{break}s++,o++}return new w(i,s,o)}const le={},ae={},Af={touchstart:!0,touchmove:!0};class Of{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Nf(n){for(let e in le){let t=le[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{If(n,r)&&!ks(n,r)&&(n.editable||!(r.type in ae))&&t(n,r)},Af[e]?{passive:!0}:void 0)}ie&&n.dom.addEventListener("input",()=>null),Wi(n)}function $e(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Df(n){n.input.mouseDown&&n.input.mouseDown.done(),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 Wi(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>ks(n,r))})}function ks(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function If(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 Rf(n,e){!ks(n,e)&&le[e.type]&&(n.editable||!(e.type in ae))&&le[e.type](n,e)}ae.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Ka(n)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ze&&te&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),jt&&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,ct(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Sf(n,t)?t.preventDefault():$e(n,"key")};ae.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};ae.keypress=(n,e)=>{let t=e;if(Ka(n)||!t.charCode||t.ctrlKey&&!t.altKey||ke&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof v)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode),s=()=>n.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i,s))&&n.dispatch(s()),t.preventDefault()}};function On(n){return{left:n.clientX,top:n.clientY}}function Lf(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function bs(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,l=>o>s.depth?l(n,t,s.nodeAfter,s.before(o),i,!0):l(n,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function Nn(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function Pf(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&E.isSelectable(r)?(Nn(n,new E(t)),!0):!1}function Bf(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof E&&(r=t.node);let s=n.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(E.isSelectable(l)){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?(Nn(n,E.create(n.state.doc,i)),!0):!1}function zf(n,e,t,r,i){return bs(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?Bf(n,t):Pf(n,t))}function $f(n,e,t,r){return bs(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Ff(n,e,t,r){return bs(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Vf(n,t,r)}function Vf(n,e,t){if(t.button!=0)return!1;let r=Ha(n,e,!0),i=n.state.doc;return r?(Nn(n,r),r instanceof v&&i.eq(n.state.doc)&&(n.input.mouseDown=new jf(n,r)),!0):!1}function Ha(n,e,t){let r=n.state.doc;if(e==-1)return r.inlineContent?v.create(r,0,r.content.size):null;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)return v.create(r,l+1,l+1+o.content.size);if(t&&E.isSelectable(o))return E.create(r,l)}return null}function xs(n){return nr(n)}const ja=ke?"metaKey":"ctrlKey";le.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=xs(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&Lf(t,n.input.lastClick)&&!t[ja]&&n.input.lastClick.button==t.button&&(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,button:t.button},n.input.mouseDown&&n.input.mouseDown.done();let o=n.posAtCoords(On(t));o&&(s=="singleClick"?n.input.mouseDown=new Hf(n,o,t,!!r):(s=="doubleClick"?$f:Ff)(n,o.pos,o.inside,t)?t.preventDefault():$e(n,"pointer"))};class Wa{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class Hf extends Wa{constructor(e,t,r,i){super(e),this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[ja],this.allowDefault=r.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);s=u.parent,o=u.depth?u.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&T(a.nodeDOM)?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof E&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&he&&!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(e,"pointer")}done(){super.done(),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(()=>{this.view.isDestroyed||Ve(this.view)})}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(On(e))),this.updateAllowDefault(e),this.allowDefault||!t?$e(this.view,"pointer"):zf(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ie&&this.mightDrag&&!this.mightDrag.node.isAtom||te&&!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)?(Nn(this.view,O.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):$e(this.view,"pointer")}move(e){this.updateAllowDefault(e),$e(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class jf extends Wa{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),$e(this.view,"pointer");let t=this.view.posAtCoords(On(e)),r=t&&Ha(this.view,t.inside,!1);if(!r)return;let{doc:i}=this.view.state,s=this.startSelection,[o,l]=r.from{n.input.lastTouch=Date.now(),xs(n),$e(n,"pointer")};le.touchmove=n=>{n.input.lastTouch=Date.now(),$e(n,"pointer")};le.contextmenu=n=>xs(n);function Ka(n,e){return n.composing?!0:ie&&Math.abs(Date.now()-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Wf=ze?5e3:-1;ae.compositionstart=ae.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof v&&e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||te&&ba&&Kf(n)))n.markCursor=n.state.storedMarks||t.marks(),nr(n,!0),n.markCursor=null;else if(nr(n,!e.selection.empty),he&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&T(i)&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(_(o)){let l=n.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}n.input.composing=!0}Ua(n,Wf)};function Kf(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||!T(e)||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return T(r)&&r.contentEditable=="false"}ae.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now(),n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Ua(n,20))};function Ua(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>nr(n),e))}function _a(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Uf(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=Pd(e.focusNode,e.focusOffset),r=Bd(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let i=r.pmViewDesc,s=n.domObserver.lastChangedTextNode;if(t==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return r}}return t||r}function nr(n,e=!1){if(!(ze&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),_a(n),e||n.docView&&n.docView.dirty){let t=ms(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function _f(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 Sn=ue&&Qe<15||jt&&Vd<604;le.copy=ae.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=Sn?null:t.clipboardData,o=r.content(),{dom:l,text:a}=ys(n,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):_f(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function qf(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Jf(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();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?wn(n,r.value,null,i,e):wn(n,r.textContent,r.innerHTML,i,e)},50)}function wn(n,e,t,r,i){let s=Pa(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,s||w.empty)))return!0;if(!s)return!1;let o=qf(s),l=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(s);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function qa(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}ae.paste=(n,e)=>{let t=e;if(n.composing&&!ze)return;let r=Sn?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&wn(n,qa(r),r.getData("text/html"),i,t)?t.preventDefault():Jf(n,t)};class Ja{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Gf=ke?"altKey":"ctrlKey";function Ga(n,e){let t;return n.someProp("dragCopies",r=>{t=t||r(e)}),t!=null?!t:!e[Gf]}le.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(On(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof E?i.to-1:i.to))){if(r&&r.mightDrag)o=E.create(n.state.doc,r.mightDrag.pos);else if(t.target&&T(t.target)){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(o=E.create(n.state.doc,d.posBefore))}}let l=(o||n.state.selection).content(),{dom:a,text:c,slice:u}=ys(n,l);(!t.dataTransfer.files.length||!te||ka>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Sn?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",Sn||t.dataTransfer.setData("text/plain",c),n.dragging=new Ja(u,Ga(n,t),o)};le.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)=>{try{Yf(n,e,n.dragging)}finally{n.dragging=null}};function Yf(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(On(e));if(!r)return;let i=n.state.doc.resolve(r.pos),s=t&&t.slice;s?n.someProp("transformPasted",h=>{s=h(s,n,!1)}):s=Pa(n,qa(e.dataTransfer),Sn?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&Ga(n,e));if(n.someProp("handleDrop",h=>h(n,e,s||w.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?Yl(n.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let a=n.state.tr;if(o){let{node:h}=t;h?h.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=a.doc;if(u?a.replaceRangeWith(c,c,s.content.firstChild):a.replaceRange(c,c,s),a.doc.eq(d))return;let f=a.doc.resolve(c);if(u&&E.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new E(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((p,m,g,y)=>h=y),a.setSelection(gs(n,f,a.doc.resolve(h)))}n.focus(),n.dispatch(a.setMeta("uiEvent","drop"))}le.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())&&Ve(n)},20))};le.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)};le.beforeinput=(n,e)=>{if(ze&&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,ct(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)le[n]=ae[n];function Cn(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 rr{constructor(e,t){this.toDOM=e,this.spec=t||kt,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 oe(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof rr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Cn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tt{constructor(e,t){this.attrs=e,this.spec=t||kt}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 oe(s,o,this)}valid(e,t){return t.from=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,r,i+l,s)}}map(e,t,r){return this==ne||e.maps.length==0?this:this.mapInner(e,t,0,0,r||kt)}mapInner(e,t,r,i,s){let o;for(let l=0;l{let c=a+r,u;if(u=Xa(t,l,c)){for(i||(i=this.children.slice());sl&&d.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,o=s+t.content.size;for(let l=0;ls&&a.type instanceof tt){let c=Math.max(s,a.from)-s,u=Math.min(o,a.to)-s;ci.map(e,t,kt));return Je.from(r)}forChild(e,t){if(t.isLeaf)return D.empty;let r=[];for(let i=0;it instanceof D)?e:e.reduce((t,r)=>t.concat(r instanceof D?r:r.members),[]))}}forEachSet(e){for(let t=0;t{let g=m-p-(h-f);for(let y=0;yx+u-d)continue;let S=l[y]+u-d;h>=S?l[y+1]=f<=S?-2:-1:f>=u&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let f=t.map(n[c+1]+s,-1),h=f-i,{index:p,offset:m}=r.content.findIndex(d),g=r.maybeChild(p);if(g&&m==d&&m+g.nodeSize==h){let y=l[c+2].mapInner(t,g,u+1,n[c]+s+1,o);y!=ne?(l[c]=d,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Qf(l,n,e,t,i,s,o),u=ir(c,r,0,o);e=u.local;for(let d=0;dt&&o.to{let c=Xa(n,l,a+t);if(c){s=!0;let u=ir(c,l,t+a+1,r);u!=ne&&i.push(a,a+l.nodeSize,u)}});let o=Ya(s?Qa(n):n,-t).sort(bt);for(let l=0;l0;)e++;n.splice(e,0,t)}function ui(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ne&&e.push(r)}),n.cursorWrapper&&e.push(D.create(n.state.doc,[n.cursorWrapper.deco])),Je.from(e)}const Zf={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},eh=ue&&Qe<=11;class th{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 nh{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new th,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():ie&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),eh&&(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,Zf)),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;tthis.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(Mo(this.view)){if(this.suppressingSelectionUpdates)return Ve(this.view);if(ue&&Qe<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&wt(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=Ht(s))t.add(s);for(let s=e.anchorNode;s;s=Ht(s))if(t.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:_(r)?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Mo(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,l=!1,a=[];if(e.editable)for(let u=0;uu.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||te&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of a)if(u.nodeName=="BR"&&u.parentNode){let d=u.nextSibling;for(;d&&T(d);){if(d.contentEditable=="false"){u.parentNode.removeChild(u);break}d=d.firstChild}}}else if(he&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||sh(e,d)!=h)&&f.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(s>-1&&(e.docView.markDirty(s,o),rh(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,oh(e,a)),this.handleDOMChange(s,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ve(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 u=0;us;y--){let x=i.childNodes[y-1],S=x.pmViewDesc;if(x.nodeName=="BR"&&!S){o=y;break}if(!S||S.size)break}let f=n.state.doc,h=n.someProp("domParser")||Xe.fromSchema(n.state.schema),p=f.resolve(l),m=null,g=h.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:ah(r),context:p});if(u&&u[0].pos!=null){let y=u[0].pos,x=u[1]&&u[1].pos;x==null&&(x=y),m={anchor:y+l,head:x+l}}return{doc:g,sel:m,from:l,to:a}}const ah=n=>e=>{let t=e.pmViewDesc;if(t)return t.parseRule(n);if(e.nodeName=="BR"&&e.parentNode){if(ie&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||ie&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},ch=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function uh(n,e,t,r,i){let s=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let A=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,R=ms(n,A);if(R&&!n.state.selection.eq(R)){if(te&&ze&&n.input.lastKeyCode===13&&Date.now()-100X(n,ct(13,"Enter"))))return;let P=n.state.tr.setSelection(R);A=="pointer"?P.setMeta("pointer",!0):A=="key"&&P.scrollIntoView(),s&&P.setMeta("composition",s),n.dispatch(P)}return}let o=n.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=lh(n,e,t,i),u=n.state.doc,d=u.slice(c.from,c.to),f,h;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||ze)&&i.some(A=>T(A)&&!ch.test(A.nodeName))&&(!p||p.endA>=p.endB)&&n.someProp("handleKeyDown",A=>A(n,ct(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof v&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let A=Po(n,n.state.doc,c.sel);if(A&&!A.eq(n.state.selection)){let R=n.state.tr.setSelection(A);s&&R.setMeta("composition",s),n.dispatch(R)}}return}n.state.selection.fromn.state.selection.from&&p.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?p.start=n.state.selection.from:p.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(p.endB+=n.state.selection.to-p.endA,p.endA=n.state.selection.to)),ue&&Qe<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA;if((jt&&n.input.lastIOSEnter>Date.now()-225&&(!x||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!x&&hh(c.doc,m.pos,g.pos))&&n.someProp("handleKeyDown",A=>A(n,ct(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>p.start&&fh(u,p.start,p.endA,m,g)&&n.someProp("handleKeyDown",A=>A(n,ct(8,"Backspace")))){ze&&te&&n.domObserver.suppressSelectionUpdates();return}te&&p.endB==p.start&&(n.input.lastChromeDelete=Date.now()),ze&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(A){return A(n,ct(13,"Enter"))})},20));let S=p.start,C=p.endA,I=A=>{let R=A||n.state.tr.replace(S,C,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let P=Po(n,R.doc,c.sel);P&&!(te&&n.composing&&P.empty&&(p.start!=p.endB||n.input.lastChromeDeleteVe(n),20));let A=I(n.state.tr.delete(S,C)),R=u.resolve(p.start).marksAcross(u.resolve(p.endA));R&&A.ensureMarks(R),n.dispatch(A)}else if(p.endA==p.endB&&(F=dh(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let A=I(n.state.tr);F.type=="add"?A.addMark(S,C,F.mark):A.removeMark(S,C,F.mark),n.dispatch(A)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let A=m.parent.textBetween(m.parentOffset,g.parentOffset),R=()=>I(n.state.tr.insertText(A,S,C));n.someProp("handleTextInput",P=>P(n,S,C,A,R))||n.dispatch(R())}else n.dispatch(I());else n.dispatch(I())}function Po(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:gs(n,e.resolve(t.anchor),e.resolve(t.head))}function dh(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,s=r,o,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||di(o,!0,!1){s.isTextblock&&o>=e&&o0&&(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 ph(n,e,t,r,i){let s=n.findDiffStart(e,t),o=t+n.size,l=t+e.size;if(s==null)return null;let{a,b:c}=n.findDiffEnd(e,o,l);if(i=="end"){let u=Math.max(0,s-Math.min(a,c));r-=a+u-s}if(a=a?s-r:0;s-=u,c=s+(c-a),a=s}else if(c=c?s-r:0;s-=u,a=s+(a-c),c=s}return{start:s,endA:a,endB:c}}class Za{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 Of,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Vo),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=$o(this),zo(this),this.nodeViews=Fo(this),this.docView=ko(this.state.doc,Bo(this),ui(this),this.dom,this),this.domObserver=new nh(this,(r,i,s,o)=>uh(this,r,i,s,o)),this.domObserver.start(),Nf(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&&Wi(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Vo),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){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(_a(this),o=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Fo(this);gh(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Wi(this),this.editable=$o(this),zo(this);let a=ui(this),c=Bo(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(i.selection))&&(o=!0);let f=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Wd(this);if(o){this.domObserver.stop();let h=d&&(ue||te)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&mh(i.selection,e.selection);if(d){let m=te?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Uf(this)),(s||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=ko(e.doc,c,a,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let p=this.input.mouseDown;h||!(p&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&pf(this)&&p.delaySelUpdate())?Ve(this,h):(Ia(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Kd(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!Ct(this.dom,e))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof E){let t=this.docView.domAfterPos(this.state.selection.from);T(t)&&ho(this,t.getBoundingClientRect(),e)}else ho(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;t0&&st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Yd(this,e)}coordsAtPos(e,t=1){return Ma(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 tf(this,t||this.state,e)}pasteHTML(e,t){return wn(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return wn(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return ys(this,e)}destroy(){this.docView&&(Df(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ui(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Rd())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Rf(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?ie&&this.root.nodeType===11&&$d(this.dom.ownerDocument)==this.dom&&ih(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Za.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function Bo(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"),[oe.node(0,n.state.doc.content.size,e)]}function zo(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:oe.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function $o(n){return!n.someProp("editable",e=>e(n.state)===!1)}function mh(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 Fo(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 gh(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 Vo(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 rt={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:"'"},sr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yh=typeof navigator<"u"&&/Mac/.test(navigator.platform),kh=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ee=0;ee<10;ee++)rt[48+ee]=rt[96+ee]=String(ee);for(var ee=1;ee<=24;ee++)rt[ee+111]="F"+ee;for(var ee=65;ee<=90;ee++)rt[ee]=String.fromCharCode(ee+32),sr[ee]=String.fromCharCode(ee);for(var fi in rt)sr.hasOwnProperty(fi)||(sr[fi]=rt[fi]);function bh(n){var e=yh&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||kh&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?sr:rt)[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 xh=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Sh=typeof navigator<"u"&&/Win/.test(navigator.platform);function wh(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,o;for(let l=0;l=t?Y.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};Y.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Y.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)};Y.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};Y.from=function(e){return e instanceof Y?e:e&&e.length?new tc(e):Y.empty};var tc=(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,l){for(var a=s;a=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=or)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=or)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})(Y);Y.empty=new tc([]);var Th=(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 rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(s,l)-l,o+l)===!1||s=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})(Y);const Eh=500;class we{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,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,u.push(d);return}if(i){u.push(new Te(d.map));let h=d.step.map(i.slice(s)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new Te(p,void 0,void 0,c.length+u.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(s)):d.selection,a=new we(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,r,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;uAh&&(l=vh(l,c),o-=c),new we(l.append(s),o)}remapping(e,t){let r=new bn;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 we(this.items.append(e.map(t=>new Te(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;t=Math.min(this.items.length,t);let r=[],i=this.items.length-t,s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;o=Math.min(o,h);let p=s.maps[h];if(f.step){let m=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(s.slice(a+1,h));g&&l++,r.push(new Te(p,m,g))}else r.push(new Te(p))},i);let c=[];for(let f=t;fEh&&(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,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=o.selection&&o.selection.map(t.slice(r));u&&s++;let d=new Te(c.invert(),a,u),f,h=i.length-1;(f=i.length&&i[h].merge(d))?i[h]=f:i.push(d)}}else o.map&&r--},this.items.length,0),new we(Y.from(i.reverse()),s)}}we.empty=new we(Y.empty,0);function vh(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Te{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 Te(t.getMap().invert(),t,this.selection)}}}class _e{constructor(e,t,r,i,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const Ah=20;function Oh(n,e,t,r){let i=t.getMeta(nt),s;if(i)return i.historyState;t.getMeta(nc)&&(n=new _e(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(nt))return o.getMeta(nt).redo?new _e(n.done.addTransform(t,void 0,r,Jn(e)),n.undone,Ho(t.mapping.maps),n.prevTime,n.prevComposition):new _e(n.done,n.undone.addTransform(t,void 0,r,Jn(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!Nh(t,n.prevRanges)),c=o?pi(n.prevRanges,t.mapping):Ho(t.mapping.maps);return new _e(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Jn(e)),we.empty,c,t.time,l??n.prevComposition)}else return(s=t.getMeta("rebased"))?new _e(n.done.rebased(t,s),n.undone.rebased(t,s),pi(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new _e(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),pi(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function Nh(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[s]&&(t=!0)}),t}function Ho(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,s,o)=>e.push(s,o));return e}function pi(n,e){if(!n)return null;let t=[];for(let r=0;r{let i=nt.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let s=Dh(i,t,n);s&&r(e?s.scrollIntoView():s)}return!0}}const ic=rc(!1,!0),sc=rc(!0,!0);function Lh(n){return n.getMeta(nt)!=null}function _r(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),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}}}var $t=class oc{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(([l,a])=>[l,(...u)=>{const d=a(...u)(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,l=[],a=!!e,c=e||s.tr,u=()=>(!a&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...m)=>{const g=this.buildProps(c,t),y=h(...m)(g);return l.push(y),d}])),run:u};return d}static createFakeChain(){const e=new Proxy({},{get:(t,r)=>{if(r!=="then")return r==="run"?()=>!1:()=>e}});return e}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,a])=>[l,(...c)=>a(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}static createFallbackCan(){const e=oc.createFakeChain();return new Proxy({chain:()=>e},{get:(t,r)=>{if(r!=="then")return r==="chain"?t.chain:()=>!1}})}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:_r({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(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}};const Ph=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{if(!n.isDestroyed){var t;e.dom.blur(),(t=window)===null||t===void 0||(t=t.getSelection())===null||t===void 0||t.removeAllRanges()}}),!0),Bh=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),zh=()=>({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,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),h=d.blockRange(f);if(!h)return;const p=_t(h);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},$h=n=>e=>n(e),Fh=()=>({state:n,dispatch:e})=>ha(n,e),Vh=(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 v(r.doc.resolve(Math.max(o-1,0)))),!0},Hh=()=>({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 o=i.before(s),l=i.after(s);n.delete(o,l).scrollIntoView()}return!0}return!1};function q(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}const jh=n=>({tr:e,state:t,dispatch:r})=>{const i=q(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),a=s.after(o);e.delete(l,a).scrollIntoView()}return!0}return!1},Wh=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},Kh=n=>n.content?/^text(\*|\+)/.test(n.content):!1,Wo=(n,e,t)=>{if(!n.parent.isInline||t==="left"&&n.pos>n.start()||t==="right"&&n.pos({from:Wo(n,t,"left"),to:Wo(e,t,"right")}),_h=()=>({state:n,dispatch:e})=>{if(n.selection.empty)return!1;if(e){const t=n.tr,{ranges:r}=n.selection,i=t.steps.length;r.forEach(s=>{const o=t.mapping.slice(i),l=t.doc.resolve(o.map(s.$from.pos)),a=t.doc.resolve(o.map(s.$to.pos)),{from:c,to:u}=Uh(l,a,n.schema);t.deleteRange(c,u)}),t.selection.empty||t.setSelection(v.near(t.doc.resolve(t.selection.from))),t.scrollIntoView(),e(t)}return!0},qh=()=>({commands:n})=>n.keyboardShortcut("Enter"),Jh=()=>({state:n,dispatch:e})=>kd(n,e);function Cs(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function lr(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Cs(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function lc(n,e,t={}){return n.find(r=>r.type===e&&lr(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function Ko(n,e,t={}){return!!lc(n,e,t)}function Ms(n,e,t){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if((!r.node||!r.node.marks.some(a=>a.type===e))&&(r=n.parent.childBefore(n.parentOffset)),!r.node||!r.node.marks.some(a=>a.type===e))return;if(!t){const a=r.node.marks.find(c=>c.type===e);a&&(t=a.attrs)}if(!lc([...r.node.marks],e,t))return;let i=r.index,s=n.start()+r.offset,o=i+1,l=s+r.node.nodeSize;for(;i>0&&Ko([...n.parent.child(i-1).marks],e,t);)i-=1,s-=n.parent.child(i).nodeSize;for(;o({tr:t,state:r,dispatch:i})=>{const s=je(n,r.schema),{doc:o,selection:l}=t,{$from:a,from:c,to:u}=l;if(i){const d=Ms(a,s,e);if(d&&d.from<=c&&d.to>=u){const f=v.create(o,d.from,d.to);t.setSelection(f)}}return!0},Yh=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(ar()||Uo())&&r.dom.focus(),Xh()&&!ar()&&!Uo()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};try{if(r.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(s&&n===null&&!ac(t.state.selection))return o(),!0;const l=Ki(i.doc,n)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Zh=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),ep=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),cc=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&cc(r)}return n};function zn(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return cc(t)}function uc(n){return typeof n?.nodesBetween=="function"}function Wt(n,e,t){if(uc(n))return n;const r=typeof n=="object"&&n!==null;t={slice:!0,parseOptions:{},...t};const i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return k.fromArray(n.map(o=>e.nodeFromJSON(o)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),Wt("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,l="";const a=new Fl({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?Xe.fromSchema(a).parseSlice(zn(n),t.parseOptions):Xe.fromSchema(a).parse(zn(n),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Xe.fromSchema(e);return t.slice?s.parseSlice(zn(n),t.parseOptions).content:s.parse(zn(n),t.parseOptions)}return Wt("",e,t)}function dc(n){return!("type"in n)}function fc(n,e,t){const r=n.steps.length-1;if(r{o===0&&(o=u)}),n.setSelection(O.near(n.doc.resolve(o),t))}const tp=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const a=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Wt(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(g){a(g)}try{var o;l=Wt(e,s.schema,{parseOptions:c,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(g){return a(g),!1}let{from:u,to:d}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,h=!0;const p=dc(l)?l.content:[l];if(p.forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),u===d&&h){const{parent:g}=r.doc.resolve(u);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(u-=1,d+=1)}let m;if(f)Array.isArray(e)?m=e.map(g=>g.text||"").join(""):uc(e)?m=p.map(g=>{var y;return(y=g.text)!==null&&y!==void 0?y:""}).join(""):typeof e=="object"&&e&&e.text?m=e.text:m=e,r.insertText(m,u,d);else{m=k.from(p);const g=r.doc.resolve(u),y=g.node(),x=g.parentOffset===0,S=y.isText||y.isTextblock,C=y.content.size>0;x&&S&&C&&h&&(u=Math.max(0,u-1)),r.replaceWith(u,d,p)}t.updateSelection&&fc(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:m}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:m})}return!0};function hc(n){for(let e=0;e({tr:e,dispatch:t,editor:r})=>{const{pos:i,attrs:s,content:o,updateSelection:l=!0}=n;let a;typeof i=="number"?a=e.doc.resolve(i):i?a=i:a=e.selection.$from;const c=hc(a.parent.contentMatchAt(a.index()));if(!c)return!1;const u=Object.keys(c.spec.attrs||{}),d=s?Object.fromEntries(Object.entries(s).filter(([h])=>u.includes(h))):{};let f;if(o){const h=Wt(o,r.schema);f=c.createAndFill(d,h)}else f=c.createAndFill(d);return f?(t&&(e.insert(a.pos,f),l&&fc(e,e.steps.length-1,-1)),!0):!1},rp=()=>({state:n,dispatch:e})=>md(n,e),ip=()=>({state:n,dispatch:e})=>gd(n,e),sp=()=>({state:n,dispatch:e})=>oa(n,e),op=()=>({state:n,dispatch:e})=>ua(n,e),pc=(n,e)=>{const t=n.resolve(e),r=t.nodeBefore,i=t.nodeAfter;return!r||!i?!1:!r.type.spec.isolating&&!i.type.spec.isolating},lp=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Vr(n.doc,n.selection.$from.pos,-1);return r==null||!pc(n.doc,r)?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},ap=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Vr(n.doc,n.selection.$from.pos,1);return r==null||!pc(n.doc,r)?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},cp=()=>({state:n,dispatch:e})=>hd(n,e),up=()=>({state:n,dispatch:e})=>pd(n,e);function mc(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function dp(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,o;for(let l=0;l({editor:e,view:t,tr:r,dispatch:i})=>{const s=dp(n).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=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}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a?.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function He(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,o=e?q(e,n.schema):null,l=[];n.doc.nodesBetween(r,i,(u,d)=>{if(u.isText)return;const f=Math.max(r,d),h=Math.min(i,d+u.nodeSize);l.push({node:u,from:f,to:h})});const a=i-r,c=l.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>lr(u.node.attrs,t,{strict:!1}));return s?!!c.length:c.reduce((u,d)=>u+d.to-d.from,0)>=a}const hp=(n,e={})=>({state:t,dispatch:r})=>He(t,q(n,t.schema),e)?yd(t,r):!1,pp=()=>({state:n,dispatch:e})=>pa(n,e),mp=n=>({state:e,dispatch:t})=>{const r=q(n,e.schema);return Od(r)(e,t)},gp=()=>({state:n,dispatch:e})=>fa(n,e);function qr(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function _o(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 yp=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const l=qr(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(s=q(n,r.schema)),l==="mark"&&(o=je(n,r.schema));let a=!1;return t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{s&&s===u.type&&(a=!0,i&&t.setNodeMarkup(d,void 0,_o(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&(a=!0,i&&t.addMark(d,d+u.nodeSize,o.create(_o(f.attrs,e))))})})}),a},kp=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),bp=()=>({tr:n,dispatch:e})=>{if(e){const t=new fe(n.doc);n.setSelection(t)}return!0},xp=()=>({state:n,dispatch:e})=>aa(n,e),Sp=()=>({state:n,dispatch:e})=>da(n,e),wp=()=>({state:n,dispatch:e})=>Sd(n,e),Cp=()=>({state:n,dispatch:e})=>Md(n,e),Mp=()=>({state:n,dispatch:e})=>Cd(n,e);function Ui(n,e,t={},r={}){return Wt(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const Tp=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:l})=>{const{doc:a}=s;if(r.preserveWhitespace!=="full"){const c=Ui(n,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});if(o){const u=dc(c)?c.content:[c];s.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t)}return!0}return o&&s.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:a.content.size},n,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function gc(n,e){const t=je(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,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function yc(n,e){const t=new ta(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function Ep(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function vp(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 Jr(n){return e=>vp(e.$from,n)}function M(n,e,t){return n.config[e]===void 0&&n.parent?M(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?M(n.parent,e,t):null}):n.config[e]}function Ts(n){return n.map(e=>{const t=M(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...Ts(t())]:e}).flat(10)}function Es(n,e){const t=Tt.fromSchema(e).serializeFragment(n),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(t),r.innerHTML}function _i(n){return typeof n=="function"}function L(n,e=void 0,...t){return _i(n)?e?n.bind(e)(...t):n(...t):n}function Ap(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Kt(n){return{baseExtensions:n.filter(e=>e.type==="extension"),nodeExtensions:n.filter(e=>e.type==="node"),markExtensions:n.filter(e=>e.type==="mark")}}function kc(n){const e=[],{nodeExtensions:t,markExtensions:r}=Kt(n),i=[...t,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=t.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...o,...l];return n.forEach(c=>{const u=M(c,"addGlobalAttributes",{name:c.name,options:c.options,storage:c.storage,extensions:i});u&&u().forEach(d=>{let f;Array.isArray(d.types)?f=d.types:d.types==="*"?f=a:d.types==="nodes"?f=o:d.types==="marks"?f=l:f=[],f.forEach(h=>{Object.entries(d.attributes).forEach(([p,m])=>{e.push({type:h,name:p,attribute:{...s,...m}})})})})}),i.forEach(c=>{const u=M(c,"addAttributes",{name:c.name,options:c.options,storage:c.storage});if(!u)return;const d=u();Object.entries(d).forEach(([f,h])=>{const p={...s,...h};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,e.push({type:c.name,name:f,attribute:p})})}),e}function Op(n){const e=[];let t="",r=!1,i=!1,s=0;const o=n.length;for(let l=0;l0){s-=1,t+=a;continue}if(a===";"&&s===0){e.push(t),t="";continue}}t+=a}return t&&e.push(t),e}function qo(n){const e=[],t=Op(n||""),r=t.length;for(let i=0;i!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(i==="__proto__"){Object.defineProperty(r,i,{configurable:!0,enumerable:!0,value:s,writable:!0});return}if(!r[i]){r[i]=s;return}if(i==="class"){const o=s?String(s).split(" "):[],l=r[i]?r[i].split(" "):[],a=o.filter(c=>!l.includes(c));r[i]=[...l,...a].join(" ")}else if(i==="style"){const o=new Map([...qo(r[i]),...qo(s)]);r[i]=Array.from(o.entries()).map(([l,a])=>`${l}: ${a}`).join("; ")}else r[i]=s}),r},{})}function Mn(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>J(t,r),{})}function Np(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Jo(n,e){return"style"in n?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 l=o.attribute.parseHTML?o.attribute.parseHTML(t):Np(t.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...r,...i}}}}function Go(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Ap(t)?!1:t!=null))}function Yo(n){var e,t;const r={};return!(!(n==null||(e=n.attribute)===null||e===void 0)&&e.isRequired)&&"default"in(n?.attribute||{})&&(r.default=n.attribute.default),(n==null||(t=n.attribute)===null||t===void 0?void 0:t.validate)!==void 0&&(r.validate=n.attribute.validate),[n.name,r]}function Dp(n,e){var t;const r=kc(n),{nodeExtensions:i,markExtensions:s}=Kt(n),o=(t=i.find(c=>M(c,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=Go({...n.reduce((g,y)=>{const x=M(y,"extendNodeSchema",d);return{...g,...x?x(c):{}}},{}),content:L(M(c,"content",d)),marks:L(M(c,"marks",d)),group:L(M(c,"group",d)),inline:L(M(c,"inline",d)),atom:L(M(c,"atom",d)),selectable:L(M(c,"selectable",d)),draggable:L(M(c,"draggable",d)),code:L(M(c,"code",d)),whitespace:L(M(c,"whitespace",d)),linebreakReplacement:L(M(c,"linebreakReplacement",d)),defining:L(M(c,"defining",d)),isolating:L(M(c,"isolating",d)),attrs:Object.fromEntries(u.map(Yo))}),h=L(M(c,"parseHTML",d));h&&(f.parseDOM=h.map(g=>Jo(g,u)));const p=M(c,"renderHTML",d);p&&(f.toDOM=g=>p({node:g,HTMLAttributes:Mn(g,u)}));const m=M(c,"renderText",d);return m&&(f.toText=m),[c.name,f]})),a=Object.fromEntries(s.map(c=>{const u=r.filter(m=>m.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=Go({...n.reduce((m,g)=>{const y=M(g,"extendMarkSchema",d);return{...m,...y?y(c):{}}},{}),inclusive:L(M(c,"inclusive",d)),excludes:L(M(c,"excludes",d)),group:L(M(c,"group",d)),spanning:L(M(c,"spanning",d)),code:L(M(c,"code",d)),attrs:Object.fromEntries(u.map(Yo))}),h=L(M(c,"parseHTML",d));h&&(f.parseDOM=h.map(m=>Jo(m,u)));const p=M(c,"renderHTML",d);return p&&(f.toDOM=m=>p({mark:m,HTMLAttributes:Mn(m,u)})),[c.name,f]}));return new Fl({topNode:o,nodes:l,marks:a})}function Ip(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function ln(n){return n.sort((t,r)=>{const i=M(t,"priority")||100,s=M(r,"priority")||100;return i>s?-1:ir.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function xc(n,e,t){const{from:r,to:i}=e,{blockSeparator:s=` +`);return{dom:a,text:f,slice:e}}function Da(n,e,t,r,i){let s=i.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=!!e&&(r||s||!t);if(a){if(n.someProp("transformPastedText",f=>{e=f(e,s||r,n)}),s)return l=new w(k.from(n.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0),n.someProp("transformPasted",f=>{l=f(l,n,!0)}),l;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)l=d;else{let f=i.marks(),{schema:h}=n.state,p=Ct.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=Cf(t),Hr&&Mf(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=o.firstChild;for(;f&&!T(f);)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Ye.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!xf.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=Tf(Eo(l,+u[1],+u[2]),u[4]);else if(l=w.maxOpen(Sf(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d{l=d(l,n,a)}),l}const xf=/^(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 Sf(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(l=>{if(!o)return;let a=i.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&s.length&&Ra(a,s,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=La(o[o.length-1],s.length));let u=Ia(l,a);o.push(u),i=i.matchType(u.type),s=a}}),o)return k.from(o)}return n}function Ia(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,k.from(n));return n}function Ra(n,e,t,r,i){if(i1&&(s=0),i=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(k.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function Eo(n,e,t){return et})}return Ut.createHTML(n)}function Cf(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Ba(),r=t.body,i=/<([a-z][^>\s]+)/i.exec(n),s;if((s=i&&Pa[i[1].toLowerCase()])&&(n=s.map(o=>"<"+o+">").join("")+n+s.map(o=>"").reverse().join("")),r.innerHTML=wf(n),s)for(let o=0;o=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;try{i=k.from(a.create(r[l+1],i))}catch{break}s++,o++}return new w(i,s,o)}const oe={},le={},Ef={touchstart:!0,touchmove:!0};class vf{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Af(n){for(let e in oe){let t=oe[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Nf(n,r)&&!ps(n,r)&&(n.editable||!(r.type in le))&&t(n,r)},Ef[e]?{passive:!0}:void 0)}re&&n.dom.addEventListener("input",()=>null),Fi(n)}function ze(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Of(n){n.input.mouseDown&&n.input.mouseDown.done(),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 Fi(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>ps(n,r))})}function ps(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Nf(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 Df(n,e){!ps(n,e)&&oe[e.type]&&(n.editable||!(e.type in le))&&oe[e.type](n,e)}le.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Va(n)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Be&&ee&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Vt&&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,lt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||bf(n,t)?t.preventDefault():ze(n,"key")};le.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};le.keypress=(n,e)=>{let t=e;if(Va(n)||!t.charCode||t.ctrlKey&&!t.altKey||ye&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof v)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode),s=()=>n.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i,s))&&n.dispatch(s()),t.preventDefault()}};function vn(n){return{left:n.clientX,top:n.clientY}}function If(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function ms(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,l=>o>s.depth?l(n,t,s.nodeAfter,s.before(o),i,!0):l(n,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function An(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function Rf(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&E.isSelectable(r)?(An(n,new E(t)),!0):!1}function Lf(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof E&&(r=t.node);let s=n.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(E.isSelectable(l)){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?(An(n,E.create(n.state.doc,i)),!0):!1}function Pf(n,e,t,r,i){return ms(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?Lf(n,t):Rf(n,t))}function Bf(n,e,t,r){return ms(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function zf(n,e,t,r){return ms(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||$f(n,t,r)}function $f(n,e,t){if(t.button!=0)return!1;let r=za(n,e,!0),i=n.state.doc;return r?(An(n,r),r instanceof v&&i.eq(n.state.doc)&&(n.input.mouseDown=new Vf(n,r)),!0):!1}function za(n,e,t){let r=n.state.doc;if(e==-1)return r.inlineContent?v.create(r,0,r.content.size):null;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)return v.create(r,l+1,l+1+o.content.size);if(t&&E.isSelectable(o))return E.create(r,l)}return null}function gs(n){return er(n)}const $a=ye?"metaKey":"ctrlKey";oe.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=gs(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&If(t,n.input.lastClick)&&!t[$a]&&n.input.lastClick.button==t.button&&(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,button:t.button},n.input.mouseDown&&n.input.mouseDown.done();let o=n.posAtCoords(vn(t));o&&(s=="singleClick"?n.input.mouseDown=new Ff(n,o,t,!!r):(s=="doubleClick"?Bf:zf)(n,o.pos,o.inside,t)?t.preventDefault():ze(n,"pointer"))};class Fa{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class Ff extends Fa{constructor(e,t,r,i){super(e),this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[$a],this.allowDefault=r.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);s=u.parent,o=u.depth?u.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&T(a.nodeDOM)?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof E&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&fe&&!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()),ze(e,"pointer")}done(){super.done(),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(()=>{this.view.isDestroyed||Fe(this.view)})}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(vn(e))),this.updateAllowDefault(e),this.allowDefault||!t?ze(this.view,"pointer"):Pf(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||re&&this.mightDrag&&!this.mightDrag.node.isAtom||ee&&!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)?(An(this.view,O.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ze(this.view,"pointer")}move(e){this.updateAllowDefault(e),ze(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class Vf extends Fa{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),ze(this.view,"pointer");let t=this.view.posAtCoords(vn(e)),r=t&&za(this.view,t.inside,!1);if(!r)return;let{doc:i}=this.view.state,s=this.startSelection,[o,l]=r.from{n.input.lastTouch=Date.now(),gs(n),ze(n,"pointer")};oe.touchmove=n=>{n.input.lastTouch=Date.now(),ze(n,"pointer")};oe.contextmenu=n=>gs(n);function Va(n,e){return n.composing?!0:re&&Math.abs(Date.now()-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Hf=Be?5e3:-1;le.compositionstart=le.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof v&&e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||ee&&ma&&jf(n)))n.markCursor=n.state.storedMarks||t.marks(),er(n,!0),n.markCursor=null;else if(er(n,!e.selection.empty),fe&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&T(i)&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(U(o)){let l=n.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}n.input.composing=!0}Ha(n,Hf)};function jf(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||!T(e)||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return T(r)&&r.contentEditable=="false"}le.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now(),n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Ha(n,20))};function Ha(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>er(n),e))}function ja(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Wf(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=Rd(e.focusNode,e.focusOffset),r=Ld(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let i=r.pmViewDesc,s=n.domObserver.lastChangedTextNode;if(t==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return r}}return t||r}function er(n,e=!1){if(!(Be&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),ja(n),e||n.docView&&n.docView.dirty){let t=ds(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function Kf(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 bn=ce&&Xe<15||Vt&&$d<604;oe.copy=le.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=bn?null:t.clipboardData,o=r.content(),{dom:l,text:a}=hs(n,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):Kf(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function _f(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Uf(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();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?xn(n,r.value,null,i,e):xn(n,r.textContent,r.innerHTML,i,e)},50)}function xn(n,e,t,r,i){let s=Da(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,s||w.empty)))return!0;if(!s)return!1;let o=_f(s),l=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(s);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Wa(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}le.paste=(n,e)=>{let t=e;if(n.composing&&!Be)return;let r=bn?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&xn(n,Wa(r),r.getData("text/html"),i,t)?t.preventDefault():Uf(n,t)};class Ka{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const qf=ye?"altKey":"ctrlKey";function _a(n,e){let t;return n.someProp("dragCopies",r=>{t=t||r(e)}),t!=null?!t:!e[qf]}oe.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(vn(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof E?i.to-1:i.to))){if(r&&r.mightDrag)o=E.create(n.state.doc,r.mightDrag.pos);else if(t.target&&T(t.target)){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(o=E.create(n.state.doc,d.posBefore))}}let l=(o||n.state.selection).content(),{dom:a,text:c,slice:u}=hs(n,l);(!t.dataTransfer.files.length||!ee||pa>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(bn?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",bn||t.dataTransfer.setData("text/plain",c),n.dragging=new Ka(u,_a(n,t),o)};oe.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};le.dragover=le.dragenter=(n,e)=>e.preventDefault();le.drop=(n,e)=>{try{Jf(n,e,n.dragging)}finally{n.dragging=null}};function Jf(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(vn(e));if(!r)return;let i=n.state.doc.resolve(r.pos),s=t&&t.slice;s?n.someProp("transformPasted",h=>{s=h(s,n,!1)}):s=Da(n,Wa(e.dataTransfer),bn?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&_a(n,e));if(n.someProp("handleDrop",h=>h(n,e,s||w.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?Ul(n.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let a=n.state.tr;if(o){let{node:h}=t;h?h.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=a.doc;if(u?a.replaceRangeWith(c,c,s.content.firstChild):a.replaceRange(c,c,s),a.doc.eq(d))return;let f=a.doc.resolve(c);if(u&&E.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new E(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((p,m,g,y)=>h=y),a.setSelection(fs(n,f,a.doc.resolve(h)))}n.focus(),n.dispatch(a.setMeta("uiEvent","drop"))}oe.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())&&Fe(n)},20))};oe.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)};oe.beforeinput=(n,e)=>{if(Be&&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,lt(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 le)oe[n]=le[n];function Sn(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 tr{constructor(e,t){this.toDOM=e,this.spec=t||gt,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 se(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof tr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Sn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class et{constructor(e,t){this.attrs=e,this.spec=t||gt}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 se(s,o,this)}valid(e,t){return t.from=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,r,i+l,s)}}map(e,t,r){return this==te||e.maps.length==0?this:this.mapInner(e,t,0,0,r||gt)}mapInner(e,t,r,i,s){let o;for(let l=0;l{let c=a+r,u;if(u=qa(t,l,c)){for(i||(i=this.children.slice());sl&&d.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,o=s+t.content.size;for(let l=0;ls&&a.type instanceof et){let c=Math.max(s,a.from)-s,u=Math.min(o,a.to)-s;ci.map(e,t,gt));return qe.from(r)}forChild(e,t){if(t.isLeaf)return D.empty;let r=[];for(let i=0;it instanceof D)?e:e.reduce((t,r)=>t.concat(r instanceof D?r:r.members),[]))}}forEachSet(e){for(let t=0;t{let g=m-p-(h-f);for(let y=0;yx+u-d)continue;let S=l[y]+u-d;h>=S?l[y+1]=f<=S?-2:-1:f>=u&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let f=t.map(n[c+1]+s,-1),h=f-i,{index:p,offset:m}=r.content.findIndex(d),g=r.maybeChild(p);if(g&&m==d&&m+g.nodeSize==h){let y=l[c+2].mapInner(t,g,u+1,n[c]+s+1,o);y!=te?(l[c]=d,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Yf(l,n,e,t,i,s,o),u=nr(c,r,0,o);e=u.local;for(let d=0;dt&&o.to{let c=qa(n,l,a+t);if(c){s=!0;let u=nr(c,l,t+a+1,r);u!=te&&i.push(a,a+l.nodeSize,u)}});let o=Ua(s?Ja(n):n,-t).sort(yt);for(let l=0;l0;)e++;n.splice(e,0,t)}function li(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=te&&e.push(r)}),n.cursorWrapper&&e.push(D.create(n.state.doc,[n.cursorWrapper.deco])),qe.from(e)}const Xf={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Qf=ce&&Xe<=11;class Zf{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 eh{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Zf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():re&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Qf&&(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,Xf)),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;tthis.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(xo(this.view)){if(this.suppressingSelectionUpdates)return Fe(this.view);if(ce&&Xe<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xt(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=Ft(s))t.add(s);for(let s=e.anchorNode;s;s=Ft(s))if(t.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:U(r)?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&xo(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,l=!1,a=[];if(e.editable)for(let u=0;uu.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||ee&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of a)if(u.nodeName=="BR"&&u.parentNode){let d=u.nextSibling;for(;d&&T(d);){if(d.contentEditable=="false"){u.parentNode.removeChild(u);break}d=d.firstChild}}}else if(fe&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||rh(e,d)!=h)&&f.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(s>-1&&(e.docView.markDirty(s,o),th(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,ih(e,a)),this.handleDOMChange(s,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Fe(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 u=0;us;y--){let x=i.childNodes[y-1],S=x.pmViewDesc;if(x.nodeName=="BR"&&!S){o=y;break}if(!S||S.size)break}let f=n.state.doc,h=n.someProp("domParser")||Ye.fromSchema(n.state.schema),p=f.resolve(l),m=null,g=h.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:oh(r),context:p});if(u&&u[0].pos!=null){let y=u[0].pos,x=u[1]&&u[1].pos;x==null&&(x=y),m={anchor:y+l,head:x+l}}return{doc:g,sel:m,from:l,to:a}}const oh=n=>e=>{let t=e.pmViewDesc;if(t)return t.parseRule(n);if(e.nodeName=="BR"&&e.parentNode){if(re&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||re&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},lh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ah(n,e,t,r,i){let s=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let A=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,R=ds(n,A);if(R&&!n.state.selection.eq(R)){if(ee&&Be&&n.input.lastKeyCode===13&&Date.now()-100X(n,lt(13,"Enter"))))return;let P=n.state.tr.setSelection(R);A=="pointer"?P.setMeta("pointer",!0):A=="key"&&P.scrollIntoView(),s&&P.setMeta("composition",s),n.dispatch(P)}return}let o=n.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=sh(n,e,t,i),u=n.state.doc,d=u.slice(c.from,c.to),f,h;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Be)&&i.some(A=>T(A)&&!lh.test(A.nodeName))&&(!p||p.endA>=p.endB)&&n.someProp("handleKeyDown",A=>A(n,lt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof v&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let A=Do(n,n.state.doc,c.sel);if(A&&!A.eq(n.state.selection)){let R=n.state.tr.setSelection(A);s&&R.setMeta("composition",s),n.dispatch(R)}}return}n.state.selection.fromn.state.selection.from&&p.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?p.start=n.state.selection.from:p.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(p.endB+=n.state.selection.to-p.endA,p.endA=n.state.selection.to)),ce&&Xe<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA;if((Vt&&n.input.lastIOSEnter>Date.now()-225&&(!x||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!x&&dh(c.doc,m.pos,g.pos))&&n.someProp("handleKeyDown",A=>A(n,lt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>p.start&&uh(u,p.start,p.endA,m,g)&&n.someProp("handleKeyDown",A=>A(n,lt(8,"Backspace")))){Be&&ee&&n.domObserver.suppressSelectionUpdates();return}ee&&p.endB==p.start&&(n.input.lastChromeDelete=Date.now()),Be&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(A){return A(n,lt(13,"Enter"))})},20));let S=p.start,C=p.endA,I=A=>{let R=A||n.state.tr.replace(S,C,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let P=Do(n,R.doc,c.sel);P&&!(ee&&n.composing&&P.empty&&(p.start!=p.endB||n.input.lastChromeDeleteFe(n),20));let A=I(n.state.tr.delete(S,C)),R=u.resolve(p.start).marksAcross(u.resolve(p.endA));R&&A.ensureMarks(R),n.dispatch(A)}else if(p.endA==p.endB&&(F=ch(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let A=I(n.state.tr);F.type=="add"?A.addMark(S,C,F.mark):A.removeMark(S,C,F.mark),n.dispatch(A)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let A=m.parent.textBetween(m.parentOffset,g.parentOffset),R=()=>I(n.state.tr.insertText(A,S,C));n.someProp("handleTextInput",P=>P(n,S,C,A,R))||n.dispatch(R())}else n.dispatch(I());else n.dispatch(I())}function Do(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:fs(n,e.resolve(t.anchor),e.resolve(t.head))}function ch(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,s=r,o,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||ai(o,!0,!1){s.isTextblock&&o>=e&&o0&&(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 fh(n,e,t,r,i){let s=n.findDiffStart(e,t),o=t+n.size,l=t+e.size;if(s==null)return null;let{a,b:c}=n.findDiffEnd(e,o,l);if(i=="end"){let u=Math.max(0,s-Math.min(a,c));r-=a+u-s}if(a=a?s-r:0;s-=u,c=s+(c-a),a=s}else if(c=c?s-r:0;s-=u,a=s+(a-c),c=s}return{start:s,endA:a,endB:c}}class Ga{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 vf,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Bo),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=Lo(this),Ro(this),this.nodeViews=Po(this),this.docView=po(this.state.doc,Io(this),li(this),this.dom,this),this.domObserver=new eh(this,(r,i,s,o)=>ah(this,r,i,s,o)),this.domObserver.start(),Af(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&&Fi(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Bo),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){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(ja(this),o=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Po(this);ph(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Fi(this),this.editable=Lo(this),Ro(this);let a=li(this),c=Io(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(i.selection))&&(o=!0);let f=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Hd(this);if(o){this.domObserver.stop();let h=d&&(ce||ee)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&hh(i.selection,e.selection);if(d){let m=ee?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Wf(this)),(s||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=po(e.doc,c,a,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let p=this.input.mouseDown;h||!(p&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ff(this)&&p.delaySelUpdate())?Fe(this,h):(Aa(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&jd(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!St(this.dom,e))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof E){let t=this.docView.domAfterPos(this.state.selection.from);T(t)&&ao(this,t.getBoundingClientRect(),e)}else ao(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;t0&&st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Jd(this,e)}coordsAtPos(e,t=1){return xa(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 Zd(this,t||this.state,e)}pasteHTML(e,t){return xn(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return xn(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return hs(this,e)}destroy(){this.docView&&(Of(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],li(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Dd())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Df(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?re&&this.root.nodeType===11&&Bd(this.dom.ownerDocument)==this.dom&&nh(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Ga.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function Io(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"),[se.node(0,n.state.doc.content.size,e)]}function Ro(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:se.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Lo(n){return!n.someProp("editable",e=>e(n.state)===!1)}function hh(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 Po(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 ph(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 Bo(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")}const mh=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),gh=typeof navigator<"u"&&/Win/.test(navigator.platform);function yh(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,o;for(let l=0;l=t?Y.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};Y.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Y.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)};Y.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};Y.from=function(e){return e instanceof Y?e:e&&e.length?new Xa(e):Y.empty};var Xa=(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,l){for(var a=s;a=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=rr)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=rr)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})(Y);Y.empty=new Xa([]);var xh=(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 rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(s,l)-l,o+l)===!1||s=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})(Y);const Sh=500;class Se{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,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,u.push(d);return}if(i){u.push(new Me(d.map));let h=d.step.map(i.slice(s)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new Me(p,void 0,void 0,c.length+u.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(s)):d.selection,a=new Se(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,r,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;uCh&&(l=wh(l,c),o-=c),new Se(l.append(s),o)}remapping(e,t){let r=new yn;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 Se(this.items.append(e.map(t=>new Me(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;t=Math.min(this.items.length,t);let r=[],i=this.items.length-t,s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;o=Math.min(o,h);let p=s.maps[h];if(f.step){let m=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(s.slice(a+1,h));g&&l++,r.push(new Me(p,m,g))}else r.push(new Me(p))},i);let c=[];for(let f=t;fSh&&(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,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=o.selection&&o.selection.map(t.slice(r));u&&s++;let d=new Me(c.invert(),a,u),f,h=i.length-1;(f=i.length&&i[h].merge(d))?i[h]=f:i.push(d)}}else o.map&&r--},this.items.length,0),new Se(Y.from(i.reverse()),s)}}Se.empty=new Se(Y.empty,0);function wh(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Me{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 Me(t.getMap().invert(),t,this.selection)}}}class _e{constructor(e,t,r,i,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const Ch=20;function Mh(n,e,t,r){let i=t.getMeta(tt),s;if(i)return i.historyState;t.getMeta(Qa)&&(n=new _e(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(tt))return o.getMeta(tt).redo?new _e(n.done.addTransform(t,void 0,r,Un(e)),n.undone,zo(t.mapping.maps),n.prevTime,n.prevComposition):new _e(n.done,n.undone.addTransform(t,void 0,r,Un(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!Th(t,n.prevRanges)),c=o?ui(n.prevRanges,t.mapping):zo(t.mapping.maps);return new _e(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Un(e)),Se.empty,c,t.time,l??n.prevComposition)}else return(s=t.getMeta("rebased"))?new _e(n.done.rebased(t,s),n.undone.rebased(t,s),ui(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new _e(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),ui(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function Th(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[s]&&(t=!0)}),t}function zo(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,s,o)=>e.push(s,o));return e}function ui(n,e){if(!n)return null;let t=[];for(let r=0;r{let i=tt.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let s=Eh(i,t,n);s&&r(e?s.scrollIntoView():s)}return!0}}const ec=Za(!1,!0),tc=Za(!0,!0);function Oh(n){return n.getMeta(tt)!=null}function Wr(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),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}}}var Bt=class nc{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(([l,a])=>[l,(...u)=>{const d=a(...u)(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,l=[],a=!!e,c=e||s.tr,u=()=>(!a&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...m)=>{const g=this.buildProps(c,t),y=h(...m)(g);return l.push(y),d}])),run:u};return d}static createFakeChain(){const e=new Proxy({},{get:(t,r)=>{if(r!=="then")return r==="run"?()=>!1:()=>e}});return e}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,a])=>[l,(...c)=>a(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}static createFallbackCan(){const e=nc.createFakeChain();return new Proxy({chain:()=>e},{get:(t,r)=>{if(r!=="then")return r==="chain"?t.chain:()=>!1}})}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:Wr({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(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}};const Nh=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{if(!n.isDestroyed){var t;e.dom.blur(),(t=window)===null||t===void 0||(t=t.getSelection())===null||t===void 0||t.removeAllRanges()}}),!0),Dh=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),Ih=()=>({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,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),h=d.blockRange(f);if(!h)return;const p=Kt(h);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},Rh=n=>e=>n(e),Lh=()=>({state:n,dispatch:e})=>ca(n,e),Ph=(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 v(r.doc.resolve(Math.max(o-1,0)))),!0},Bh=()=>({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 o=i.before(s),l=i.after(s);n.delete(o,l).scrollIntoView()}return!0}return!1};function q(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}const zh=n=>({tr:e,state:t,dispatch:r})=>{const i=q(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),a=s.after(o);e.delete(l,a).scrollIntoView()}return!0}return!1},$h=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},Fh=n=>n.content?/^text(\*|\+)/.test(n.content):!1,Fo=(n,e,t)=>{if(!n.parent.isInline||t==="left"&&n.pos>n.start()||t==="right"&&n.pos({from:Fo(n,t,"left"),to:Fo(e,t,"right")}),Hh=()=>({state:n,dispatch:e})=>{if(n.selection.empty)return!1;if(e){const t=n.tr,{ranges:r}=n.selection,i=t.steps.length;r.forEach(s=>{const o=t.mapping.slice(i),l=t.doc.resolve(o.map(s.$from.pos)),a=t.doc.resolve(o.map(s.$to.pos)),{from:c,to:u}=Vh(l,a,n.schema);t.deleteRange(c,u)}),t.selection.empty||t.setSelection(v.near(t.doc.resolve(t.selection.from))),t.scrollIntoView(),e(t)}return!0},jh=()=>({commands:n})=>n.keyboardShortcut("Enter"),Wh=()=>({state:n,dispatch:e})=>gd(n,e);function bs(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function ir(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:bs(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function rc(n,e,t={}){return n.find(r=>r.type===e&&ir(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function Vo(n,e,t={}){return!!rc(n,e,t)}function xs(n,e,t){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if((!r.node||!r.node.marks.some(a=>a.type===e))&&(r=n.parent.childBefore(n.parentOffset)),!r.node||!r.node.marks.some(a=>a.type===e))return;if(!t){const a=r.node.marks.find(c=>c.type===e);a&&(t=a.attrs)}if(!rc([...r.node.marks],e,t))return;let i=r.index,s=n.start()+r.offset,o=i+1,l=s+r.node.nodeSize;for(;i>0&&Vo([...n.parent.child(i-1).marks],e,t);)i-=1,s-=n.parent.child(i).nodeSize;for(;o({tr:t,state:r,dispatch:i})=>{const s=He(n,r.schema),{doc:o,selection:l}=t,{$from:a,from:c,to:u}=l;if(i){const d=xs(a,s,e);if(d&&d.from<=c&&d.to>=u){const f=v.create(o,d.from,d.to);t.setSelection(f)}}return!0},_h=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(sr()||Ho())&&r.dom.focus(),Uh()&&!sr()&&!Ho()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};try{if(r.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(s&&n===null&&!ic(t.state.selection))return o(),!0;const l=Vi(i.doc,n)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Jh=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),Gh=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),sc=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&sc(r)}return n};function Pn(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return sc(t)}function oc(n){return typeof n?.nodesBetween=="function"}function Ht(n,e,t){if(oc(n))return n;const r=typeof n=="object"&&n!==null;t={slice:!0,parseOptions:{},...t};const i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return k.fromArray(n.map(o=>e.nodeFromJSON(o)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),Ht("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,l="";const a=new Pl({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?Ye.fromSchema(a).parseSlice(Pn(n),t.parseOptions):Ye.fromSchema(a).parse(Pn(n),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Ye.fromSchema(e);return t.slice?s.parseSlice(Pn(n),t.parseOptions).content:s.parse(Pn(n),t.parseOptions)}return Ht("",e,t)}function lc(n){return!("type"in n)}function ac(n,e,t){const r=n.steps.length-1;if(r{o===0&&(o=u)}),n.setSelection(O.near(n.doc.resolve(o),t))}const Yh=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const a=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Ht(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(g){a(g)}try{var o;l=Ht(e,s.schema,{parseOptions:c,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(g){return a(g),!1}let{from:u,to:d}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,h=!0;const p=lc(l)?l.content:[l];if(p.forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),u===d&&h){const{parent:g}=r.doc.resolve(u);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(u-=1,d+=1)}let m;if(f)Array.isArray(e)?m=e.map(g=>g.text||"").join(""):oc(e)?m=p.map(g=>{var y;return(y=g.text)!==null&&y!==void 0?y:""}).join(""):typeof e=="object"&&e&&e.text?m=e.text:m=e,r.insertText(m,u,d);else{m=k.from(p);const g=r.doc.resolve(u),y=g.node(),x=g.parentOffset===0,S=y.isText||y.isTextblock,C=y.content.size>0;x&&S&&C&&h&&(u=Math.max(0,u-1)),r.replaceWith(u,d,p)}t.updateSelection&&ac(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:m}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:m})}return!0};function cc(n){for(let e=0;e({tr:e,dispatch:t,editor:r})=>{const{pos:i,attrs:s,content:o,updateSelection:l=!0}=n;let a;typeof i=="number"?a=e.doc.resolve(i):i?a=i:a=e.selection.$from;const c=cc(a.parent.contentMatchAt(a.index()));if(!c)return!1;const u=Object.keys(c.spec.attrs||{}),d=s?Object.fromEntries(Object.entries(s).filter(([h])=>u.includes(h))):{};let f;if(o){const h=Ht(o,r.schema);f=c.createAndFill(d,h)}else f=c.createAndFill(d);return f?(t&&(e.insert(a.pos,f),l&&ac(e,e.steps.length-1,-1)),!0):!1},Qh=()=>({state:n,dispatch:e})=>hd(n,e),Zh=()=>({state:n,dispatch:e})=>pd(n,e),ep=()=>({state:n,dispatch:e})=>na(n,e),tp=()=>({state:n,dispatch:e})=>oa(n,e),uc=(n,e)=>{const t=n.resolve(e),r=t.nodeBefore,i=t.nodeAfter;return!r||!i?!1:!r.type.spec.isolating&&!i.type.spec.isolating},np=()=>({state:n,dispatch:e,tr:t})=>{try{const r=zr(n.doc,n.selection.$from.pos,-1);return r==null||!uc(n.doc,r)?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},rp=()=>({state:n,dispatch:e,tr:t})=>{try{const r=zr(n.doc,n.selection.$from.pos,1);return r==null||!uc(n.doc,r)?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},ip=()=>({state:n,dispatch:e})=>dd(n,e),sp=()=>({state:n,dispatch:e})=>fd(n,e);function dc(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function op(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,o;for(let l=0;l({editor:e,view:t,tr:r,dispatch:i})=>{const s=op(n).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=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}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a?.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function Ve(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,o=e?q(e,n.schema):null,l=[];n.doc.nodesBetween(r,i,(u,d)=>{if(u.isText)return;const f=Math.max(r,d),h=Math.min(i,d+u.nodeSize);l.push({node:u,from:f,to:h})});const a=i-r,c=l.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>ir(u.node.attrs,t,{strict:!1}));return s?!!c.length:c.reduce((u,d)=>u+d.to-d.from,0)>=a}const ap=(n,e={})=>({state:t,dispatch:r})=>Ve(t,q(n,t.schema),e)?md(t,r):!1,cp=()=>({state:n,dispatch:e})=>ua(n,e),up=n=>({state:e,dispatch:t})=>{const r=q(n,e.schema);return vd(r)(e,t)},dp=()=>({state:n,dispatch:e})=>aa(n,e);function Kr(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function jo(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 fp=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const l=Kr(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(s=q(n,r.schema)),l==="mark"&&(o=He(n,r.schema));let a=!1;return t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{s&&s===u.type&&(a=!0,i&&t.setNodeMarkup(d,void 0,jo(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&(a=!0,i&&t.addMark(d,d+u.nodeSize,o.create(jo(f.attrs,e))))})})}),a},hp=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),pp=()=>({tr:n,dispatch:e})=>{if(e){const t=new de(n.doc);n.setSelection(t)}return!0},mp=()=>({state:n,dispatch:e})=>ia(n,e),gp=()=>({state:n,dispatch:e})=>la(n,e),yp=()=>({state:n,dispatch:e})=>bd(n,e),kp=()=>({state:n,dispatch:e})=>wd(n,e),bp=()=>({state:n,dispatch:e})=>Sd(n,e);function Hi(n,e,t={},r={}){return Ht(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const xp=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:l})=>{const{doc:a}=s;if(r.preserveWhitespace!=="full"){const c=Hi(n,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});if(o){const u=lc(c)?c.content:[c];s.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t)}return!0}return o&&s.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:a.content.size},n,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function fc(n,e){const t=He(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,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function hc(n,e){const t=new Xl(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function Sp(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function wp(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 _r(n){return e=>wp(e.$from,n)}function M(n,e,t){return n.config[e]===void 0&&n.parent?M(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?M(n.parent,e,t):null}):n.config[e]}function Ss(n){return n.map(e=>{const t=M(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...Ss(t())]:e}).flat(10)}function ws(n,e){const t=Ct.fromSchema(e).serializeFragment(n),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(t),r.innerHTML}function ji(n){return typeof n=="function"}function L(n,e=void 0,...t){return ji(n)?e?n.bind(e)(...t):n(...t):n}function Cp(n={}){return Object.keys(n).length===0&&n.constructor===Object}function jt(n){return{baseExtensions:n.filter(e=>e.type==="extension"),nodeExtensions:n.filter(e=>e.type==="node"),markExtensions:n.filter(e=>e.type==="mark")}}function pc(n){const e=[],{nodeExtensions:t,markExtensions:r}=jt(n),i=[...t,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=t.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...o,...l];return n.forEach(c=>{const u=M(c,"addGlobalAttributes",{name:c.name,options:c.options,storage:c.storage,extensions:i});u&&u().forEach(d=>{let f;Array.isArray(d.types)?f=d.types:d.types==="*"?f=a:d.types==="nodes"?f=o:d.types==="marks"?f=l:f=[],f.forEach(h=>{Object.entries(d.attributes).forEach(([p,m])=>{e.push({type:h,name:p,attribute:{...s,...m}})})})})}),i.forEach(c=>{const u=M(c,"addAttributes",{name:c.name,options:c.options,storage:c.storage});if(!u)return;const d=u();Object.entries(d).forEach(([f,h])=>{const p={...s,...h};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,e.push({type:c.name,name:f,attribute:p})})}),e}function Mp(n){const e=[];let t="",r=!1,i=!1,s=0;const o=n.length;for(let l=0;l0){s-=1,t+=a;continue}if(a===";"&&s===0){e.push(t),t="";continue}}t+=a}return t&&e.push(t),e}function Wo(n){const e=[],t=Mp(n||""),r=t.length;for(let i=0;i!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(i==="__proto__"){Object.defineProperty(r,i,{configurable:!0,enumerable:!0,value:s,writable:!0});return}if(!r[i]){r[i]=s;return}if(i==="class"){const o=s?String(s).split(" "):[],l=r[i]?r[i].split(" "):[],a=o.filter(c=>!l.includes(c));r[i]=[...l,...a].join(" ")}else if(i==="style"){const o=new Map([...Wo(r[i]),...Wo(s)]);r[i]=Array.from(o.entries()).map(([l,a])=>`${l}: ${a}`).join("; ")}else r[i]=s}),r},{})}function wn(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>J(t,r),{})}function Tp(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Ko(n,e){return"style"in n?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 l=o.attribute.parseHTML?o.attribute.parseHTML(t):Tp(t.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...r,...i}}}}function _o(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Cp(t)?!1:t!=null))}function Uo(n){var e,t;const r={};return!(!(n==null||(e=n.attribute)===null||e===void 0)&&e.isRequired)&&"default"in(n?.attribute||{})&&(r.default=n.attribute.default),(n==null||(t=n.attribute)===null||t===void 0?void 0:t.validate)!==void 0&&(r.validate=n.attribute.validate),[n.name,r]}function Ep(n,e){var t;const r=pc(n),{nodeExtensions:i,markExtensions:s}=jt(n),o=(t=i.find(c=>M(c,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=_o({...n.reduce((g,y)=>{const x=M(y,"extendNodeSchema",d);return{...g,...x?x(c):{}}},{}),content:L(M(c,"content",d)),marks:L(M(c,"marks",d)),group:L(M(c,"group",d)),inline:L(M(c,"inline",d)),atom:L(M(c,"atom",d)),selectable:L(M(c,"selectable",d)),draggable:L(M(c,"draggable",d)),code:L(M(c,"code",d)),whitespace:L(M(c,"whitespace",d)),linebreakReplacement:L(M(c,"linebreakReplacement",d)),defining:L(M(c,"defining",d)),isolating:L(M(c,"isolating",d)),attrs:Object.fromEntries(u.map(Uo))}),h=L(M(c,"parseHTML",d));h&&(f.parseDOM=h.map(g=>Ko(g,u)));const p=M(c,"renderHTML",d);p&&(f.toDOM=g=>p({node:g,HTMLAttributes:wn(g,u)}));const m=M(c,"renderText",d);return m&&(f.toText=m),[c.name,f]})),a=Object.fromEntries(s.map(c=>{const u=r.filter(m=>m.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=_o({...n.reduce((m,g)=>{const y=M(g,"extendMarkSchema",d);return{...m,...y?y(c):{}}},{}),inclusive:L(M(c,"inclusive",d)),excludes:L(M(c,"excludes",d)),group:L(M(c,"group",d)),spanning:L(M(c,"spanning",d)),code:L(M(c,"code",d)),attrs:Object.fromEntries(u.map(Uo))}),h=L(M(c,"parseHTML",d));h&&(f.parseDOM=h.map(m=>Ko(m,u)));const p=M(c,"renderHTML",d);return p&&(f.toDOM=m=>p({mark:m,HTMLAttributes:wn(m,u)})),[c.name,f]}));return new Pl({topNode:o,nodes:l,marks:a})}function vp(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function sn(n){return n.sort((t,r)=>{const i=M(t,"priority")||100,s=M(r,"priority")||100;return i>s?-1:ir.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function gc(n,e,t){const{from:r,to:i}=e,{blockSeparator:s=` -`,textSerializers:o={}}=t||{};let l="";return n.nodesBetween(r,i,(a,c,u,d)=>{a.isBlock&&c>r&&(l+=s);const f=o?.[a.type.name];if(f)return u&&(l+=f({node:a,pos:c,parent:u,index:d,range:e})),!1;if(a.isText){var h;l+=a==null||(h=a.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,i-c)}}),l}function Rp(n,e){return xc(n,{from:0,to:n.content.size},e)}function Sc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Lp(n,e){const t=q(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function wc(n,e){const t=qr(typeof e=="string"?e:e.name,n.schema);return t==="node"?Lp(n,e):t==="mark"?gc(n,e):{}}function Pp(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function Bp(n){const e=Pp(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,s)=>s!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function Gr(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=t[s];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(s).map(l,-1),u=e.slice(s).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),Bp(r)}function Yr(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=Ms(t.resolve(n),i.type);s&&r.push({mark:i,...s})}):t.nodesBetween(n,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}const zp=(n,e,t,r=20)=>{const i=n.doc.resolve(t);let s=r,o=null;for(;s>0&&o===null;){const l=i.node(s);l?.type.name===e?o=l:s-=1}return[o,s]},$p=n=>{const e=n.depth-1;if(e<0)return null;const t=n.index(e);return t===0?null:n.node(e).child(t-1)};function Nt(n,e){return e.nodes[n]||e.marks[n]||null}function Gn(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}))}const Fp=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,l)=>{var a,c;const u=((a=(c=i.type.spec).toText)===null||a===void 0?void 0:a.call(c,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-s))}),t};function qi(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?je(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>lr(u.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:u,$to:d})=>{const f=u.pos,h=d.pos;n.doc.nodesBetween(f,h,(p,m)=>{if(s&&p.inlineContent&&!p.type.allowsMarkType(s))return!1;if(!p.isText&&!p.marks.length)return;const g=Math.max(f,m),y=Math.min(h,m+p.nodeSize),x=y-g;o+=x,l.push(...p.marks.map(S=>({mark:S,from:g,to:y})))})}),o===0)return!1;const a=l.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>lr(u.mark.attrs,t,{strict:!1})).reduce((u,d)=>u+d.to-d.from,0),c=l.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,d)=>u+d.to-d.from,0);return(a>0?a+c:a)>=o}function Vp(n,e,t={}){if(!e)return He(n,null,t)||qi(n,null,t);const r=qr(e,n.schema);return r==="node"?He(n,e,t):r==="mark"?qi(n,e,t):!1}const Hp=(n,e)=>{const{$from:t,$to:r,$anchor:i}=n.selection;if(e){const s=Jr(l=>l.type.name===e)(n.selection);if(!s)return!1;const o=n.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Xo(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function gi(n,e){const{nodeExtensions:t}=Kt(e),r=t.find(s=>s.name===n);if(!r)return!1;const i=L(M(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function Dn(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){if(t){if(n.type.name==="hardBreak")return!0;if(n.isText){var r;return!/\S/.test((r=n.text)!==null&&r!==void 0?r:"")}}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(s=>{i!==!1&&(Dn(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function Cc(n){return n instanceof E}var Mc=class Tc{constructor(e){this.position=e}static fromJSON(e){return new Tc(e.position)}toJSON(){return{position:this.position}}};function Wp(n,e){const t=e.mapping.mapResult(n.position);return{position:new Mc(t.pos),mapResult:t}}function Kp(n){return new Mc(n)}function Up(n,e,t){const{selection:r}=e;let i=null;if(ac(r)&&(i=r.$cursor),i){var s;const l=(s=n.storedMarks)!==null&&s!==void 0?s:i.marks();return i.parent.type.allowsMarkType(t)&&(!!t.isInSet(l)||!l.some(a=>a.type.excludes(t)))}const{ranges:o}=r;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),p=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=h&&p}return!c}),c})}const _p=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=je(n,r.schema);if(i)if(o){const c=gc(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),m=Math.min(h+f.nodeSize,d);f.marks.find(g=>g.type===a)?f.marks.forEach(g=>{a===g.type&&t.addMark(p,m,a.create({...g.attrs,...e}))}):t.addMark(p,m,a.create(e))})});return Up(r,t,a)},qp=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Jp=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=q(n,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>co(s,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>co(s,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Gp=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=ft(n,0,r.content.size),s=E.create(r,i);e.setSelection(s)}return!0},Yp=(n,e)=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=r;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=s.from,l=s.to),i&&t.doc.nodesBetween(o,l,(a,c)=>{a.isText||t.setNodeMarkup(c,void 0,{...a.attrs,dir:n})}),!0},Xp=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,o=v.atStart(r).from,l=v.atEnd(r).to,a=ft(i,o,l),c=ft(s,o,l),u=v.create(r,a,c);e.setSelection(u)}return!0},Qp=n=>({state:e,dispatch:t})=>{const r=q(n,e.schema);return Id(r)(e,t)};function Qo(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 Zp=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,c=i.extensionManager.attributes,u=Gn(c,l.node().type.name,l.node().attrs);if(s instanceof E&&s.node.isBlock)return!l.parentOffset||!Fe(o,l.pos)?!1:(r&&(n&&Qo(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:hc(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0;const p=s instanceof v&&!s.empty?Be.create({doc:e.doc,selection:s}).tr.deleteSelection():null,m=p?p.doc:e.doc,g=p?p.mapping.map(l.pos):l.pos;let y=Fe(m,g,1,h);if(!h&&!y&&Fe(m,g,1,f?[{type:f}]:void 0)&&(y=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(y){const x=e.steps.length;if(s instanceof v&&e.deleteSelection(),e.split(e.mapping.slice(x).map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f){const S=e.mapping.slice(x).map(l.before()),C=e.doc.resolve(S);l.node(-1).canReplaceWith(C.index(),C.index()+1,f)&&e.setNodeMarkup(e.mapping.slice(x).map(l.before()),f)}}n&&Qo(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},em=(n,e={})=>({tr:t,state:r,dispatch:i,editor:s})=>{const o=q(n,r.schema),{$from:l,$to:a}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(a))return!1;const u=l.node(-1);if(u.type!==o)return!1;const d=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){var f;let C=k.empty;const I=l.index(-1)?1:l.index(-2)?2:3;for(let me=l.depth-I;me>=l.depth-3;me-=1)C=k.from(l.node(me).copy(C));const F=l.indexAfter(-1){if(X>-1)return!1;me.isTextblock&&me.content.size===0&&(X=lt+1)}),X>-1&&t.setSelection(v.near(t.doc.resolve(X))),t.scrollIntoView()}return!0}const h=a.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...Gn(d,u.type.name,u.attrs),...e},m={...Gn(d,l.node().type.name,l.node().attrs),...e},g=l.parentOffset===0&&l.index(-1)===0,y=l.before(-1);t.delete(l.pos,a.pos);const x=g?u.attrs:p,S=h?[{type:o,attrs:x},{type:h,attrs:m}]:[{type:o,attrs:x}];if(!Fe(t.doc,l.pos,2))return!1;if(i){const{selection:C,storedMarks:I}=r,{splittableMarks:F}=s.extensionManager,A=I||C.$to.parentOffset&&C.$from.marks();if(t.split(l.pos,2,S).scrollIntoView(),g&&t.setNodeMarkup(y,void 0,p),!A||!i)return!0;const R=A.filter(P=>F.includes(P.type.name));t.ensureMarks(R)}return!0};function Zo(n){return!n||n==="1"?null:n}function Ec(n,e){return Zo(n)===Zo(e)}const yi=(n,e)=>{const t=Jr(s=>s.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&&st(n.doc,t.pos))||!Ec(t.node.attrs.type,i?.attrs.type)||n.join(t.pos),!0},ki=(n,e)=>{const t=Jr(s=>s.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&&st(n.doc,r))||!Ec(t.node.attrs.type,i?.attrs.type)||n.join(r),!0};function tm(n){const e=n.doc,t=e.firstChild;if(!t)return null;const r=e.resolve(1),i=e.resolve(t.nodeSize-1);return v.between(r,i)}const nm=(n,e,t,r={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,h=q(n,o.schema),p=q(e,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:x}=m,S=y.blockRange(x),C=g||m.$to.parentOffset&&m.$from.marks();if(!S)return!1;const I=Jr(xe=>gi(xe.type.name,d))(m),F=m.from===0&&m.to===o.doc.content.size,A=o.doc.content.content,R=A.length===1?A[0]:null,P=F&&R&&gi(R.type.name,d)?{node:R,pos:0}:null,X=I??P,me=!!I&&S.depth>=1&&S.depth-I.depth<=1,lt=!!P;if((me||lt)&&X){if(X.node.type===h)return F&<?a().command(({tr:xe,dispatch:Oe})=>{const Se=tm(xe);return Se?(xe.setSelection(Se),Oe&&Oe(xe),!0):!1}).liftListItem(p).run():c.liftListItem(p);if(gi(X.node.type.name,d)&&h.validContent(X.node.content))return a().command(()=>(s.setNodeMarkup(X.pos,h),!0)).command(()=>yi(s,h)).command(()=>ki(s,h)).run()}return!t||!C||!l?a().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>yi(s,h)).command(()=>ki(s,h)).run():a().command(()=>{const xe=u().wrapInList(h,r),Oe=C.filter(Se=>f.includes(Se.type.name));return s.ensureMarks(Oe),xe?!0:c.clearNodes()}).wrapInList(h,r).command(()=>yi(s,h)).command(()=>ki(s,h)).run()},rm=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=je(n,r.schema);return qi(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},im=(n,e,t={})=>({state:r,commands:i})=>{const s=q(n,r.schema),o=q(e,r.schema),l=He(r,s,t);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?i.setNode(o,a):i.setNode(s,{...a,...t})},sm=(n,e={})=>({state:t,commands:r})=>{const i=q(n,t.schema);return He(t,i,e)?r.lift(i):r.wrapIn(i,e)},om=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,n.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},lm=(n={})=>({tr:e,dispatch:t,editor:r})=>{const{ignoreClearable:i=!1}=n,{selection:s}=e,{empty:o,ranges:l}=s;if(o)return!0;const{nonClearableMarks:a}=r.extensionManager;if(t){const c=Object.values(r.schema.marks).filter(u=>i||!a.includes(u.name));l.forEach(u=>{for(const d of c)e.removeMark(u.$from.pos,u.$to.pos,d)})}return!0},am=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{extendEmptyMarkRange:s=!1}=e,{selection:o}=t,l=je(n,r.schema),{$from:a,empty:c,ranges:u}=o;if(!i)return!0;if(c&&s){var d;let{from:f,to:h}=o;const p=Ms(a,l,(d=a.marks().find(m=>m.type===l))===null||d===void 0?void 0:d.attrs);p&&(f=p.from,h=p.to),t.removeMark(f,h,l)}else u.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,l)});return t.removeStoredMark(l),!0},cm=n=>({tr:e,state:t,dispatch:r})=>{const{selection:i}=t;let s,o;return typeof n=="number"?(s=n,o=n):n&&"from"in n&&"to"in n?(s=n.from,o=n.to):(s=i.from,o=i.to),r&&e.doc.nodesBetween(s,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},um=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const l=qr(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(s=q(n,r.schema)),l==="mark"&&(o=je(n,r.schema));let a=!1;return t.selection.ranges.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;let f,h,p,m;t.selection.empty?r.doc.nodesBetween(u,d,(g,y)=>{s&&s===g.type&&(a=!0,p=Math.max(y,u),m=Math.min(y+g.nodeSize,d),f=y,h=g)}):r.doc.nodesBetween(u,d,(g,y)=>{y=u&&y<=d&&(s&&s===g.type&&(a=!0,i&&t.setNodeMarkup(y,void 0,{...g.attrs,...e})),o&&g.marks.length&&g.marks.forEach(x=>{if(o===x.type&&(a=!0,i)){const S=Math.max(y,u),C=Math.min(y+g.nodeSize,d);t.addMark(S,C,o.create({...x.attrs,...e}))}}))}),h&&(f!==void 0&&i&&t.setNodeMarkup(f,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(g=>{o===g.type&&i&&t.addMark(p,m,o.create({...g.attrs,...e}))}))}),a},Lt=new U("__tiptap_decorations__"),dm=n=>({tr:e,dispatch:t})=>(t&&e.setMeta(Lt,{type:"force",name:n}),!0),fm=(n,e={})=>({state:t,dispatch:r})=>{const i=q(n,t.schema);return Td(i,e)(t,r)},hm=(n,e={})=>({state:t,dispatch:r})=>{const i=q(n,t.schema);return Ed(i,e)(t,r)};var pm=yu({blur:()=>Ph,clearContent:()=>Bh,clearNodes:()=>zh,command:()=>$h,createParagraphNear:()=>Fh,cut:()=>Vh,deleteCurrentNode:()=>Hh,deleteNode:()=>jh,deleteRange:()=>Wh,deleteSelection:()=>_h,enter:()=>qh,exitCode:()=>Jh,extendMarkRange:()=>Gh,first:()=>Yh,focus:()=>Qh,forEach:()=>Zh,insertContent:()=>ep,insertContentAt:()=>tp,insertDefaultBlock:()=>np,joinBackward:()=>sp,joinDown:()=>ip,joinForward:()=>op,joinItemBackward:()=>lp,joinItemForward:()=>ap,joinTextblockBackward:()=>cp,joinTextblockForward:()=>up,joinUp:()=>rp,keyboardShortcut:()=>fp,lift:()=>hp,liftEmptyBlock:()=>pp,liftListItem:()=>mp,newlineInCode:()=>gp,resetAttributes:()=>yp,scrollIntoView:()=>kp,selectAll:()=>bp,selectNodeBackward:()=>xp,selectNodeForward:()=>Sp,selectParentNode:()=>wp,selectTextblockEnd:()=>Cp,selectTextblockStart:()=>Mp,setContent:()=>Tp,setMark:()=>_p,setMeta:()=>qp,setNode:()=>Jp,setNodeSelection:()=>Gp,setTextDirection:()=>Yp,setTextSelection:()=>Xp,sinkListItem:()=>Qp,splitBlock:()=>Zp,splitListItem:()=>em,toggleList:()=>nm,toggleMark:()=>rm,toggleNode:()=>im,toggleWrap:()=>sm,undoInputRule:()=>om,unsetAllMarks:()=>lm,unsetMark:()=>am,unsetTextDirection:()=>cm,updateAttributes:()=>um,updateDecorations:()=>dm,wrapIn:()=>fm,wrapInList:()=>hm});const Gt=new WeakMap;function mm(n,e){var t;Gt.set(n,((t=Gt.get(n))!==null&&t!==void 0?t:0)+1);try{return e()}finally{var r;const i=((r=Gt.get(n))!==null&&r!==void 0?r:1)-1;i>0?Gt.set(n,i):Gt.delete(n)}}var gm=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){const t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}};function ym(n){return n.kind==="widget"}function vc(n,e){const t=[],r=new Set;for(const i of n)i.kind==="widget"&&ym(i)&&r.add(i.key),t.push(i.toPMDecoration(e));return{decorations:t,widgetKeys:r}}function km(n,e,t){const{decorations:r,widgetKeys:i}=vc(e,t);return{set:D.create(n,r),widgetKeys:i}}function Ac({position:n,from:e,to:t,docSize:r}){return nAc({position:o.anchor,from:e,to:t,docSize:r})?!0:(o.anchor===t||s.has(i)||(s.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${e}, ${t}). It was ignored.`)),!1))}function xm(n){var e;const t=(e=n.spec)===null||e===void 0?void 0:e.key;return typeof t=="string"?t:void 0}function Oc(n){return n.jsonID==="attr"}function Sm(n){let e=!1;if(n.getMap().forEach(()=>{e=!0}),e||Oc(n))return!0;const t=n;return typeof t.from=="number"&&typeof t.to=="number"}function wm(n,e){let t=null,r=0,i=0;for(let s=0;se.to);s+=1){const o=i+n.child(s).nodeSize;o>=e.from&&(t===null&&(t=i),r=o),i=o}return t===null?null:{from:t,to:r}}function Cm(n,e){if(n.steps.some(s=>!Sm(s)))return{type:"full"};const t=Gr(n).map(({newRange:s})=>s);n.steps.forEach((s,o)=>{if(!Oc(s))return;const l=n.mapping.slice(o);t.push({from:l.map(s.pos,-1),to:l.map(s.pos+1)})});const r=[];for(const s of t){const o=wm(e,s);o&&r.push(o)}r.sort((s,o)=>s.from-o.from);const i=[];for(const s of r){const o=i[i.length-1];o&&s.from<=o.to?o.to=Math.max(o.to,s.to):i.push({...s})}return{type:"ranges",ranges:i}}function Nc(n,e,t,r){return n.map(e,t,{onRemove:i=>{const s=i?.key;typeof s=="string"&&r.delete(s)}})}function Mm(n,e,t){var r,i;const s=(r=e.decorationSetsByExtension[n])!==null&&r!==void 0?r:D.empty,o=new Set((i=e.widgetKeysByExtension[n])!==null&&i!==void 0?i:[]);return{set:Nc(s,t.mapping,t.doc,o),widgetKeys:o}}function el(n,e){const t=Object.values(e).flatMap(r=>r.find());return D.create(n,t)}function tl(n){const e=new Set;for(const t of Object.values(n))for(const r of t)e.add(r);return e}function Tm(n,e){var t;switch((t=e.update)!==null&&t!==void 0?t:"document"){case"document":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension "${n}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${n}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function Em(n,e,t){return t?!0:n.update==="manual"?!1:n.shouldUpdate?n.shouldUpdate(e):e.tr.docChanged}const vm=new Set;var Am=class{constructor(n){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{const t=Lt.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=n.editor,this.entries=this.resolveEntries(n.entries),this.entries.forEach(({name:e,spec:t})=>Tm(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var n,e;return(n=(e=Lt.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&n!==void 0?n:vm}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(n){const e=[];for(const{name:t,addDecorations:r}of n){const i=r();i&&e.push({name:t,spec:i})}return e}createPlugin(){const{editor:n,entries:e}=this;return new $({key:Lt,state:{init:(t,r)=>{const i={},s={};for(const{name:l,spec:a}of e){const{set:c,widgetKeys:u}=this.buildFullSet(l,a,r);i[l]=c,s[l]=u}const o={decorationSetsByExtension:i,widgetKeysByExtension:s,mergedDecorationSet:this.buildMergedSet(r.doc,i),widgetKeys:tl(s)};return this.warnDuplicateWidgetKeys(o),o},apply:(t,r,i,s)=>{const o=t.getMeta(Lt),l=o?.type==="force"&&!o.name,a=o?.type==="force"?o.name:void 0,c={},u={},d=new Set;return mm(n,()=>{for(const{name:f,spec:h}of e){const p=l||a===f;if(Em(h,{editor:n,tr:t,oldState:i,newState:s},p))if(h.update==="changedRanges"&&t.docChanged&&!p){const m=this.applyChangedRangesRecompute(f,h,r,t,s);c[f]=m.set,u[f]=m.widgetKeys,d.add(f)}else{const{set:m,widgetKeys:g}=this.buildFullSet(f,h,s);c[f]=m,u[f]=g,d.add(f)}else{const m=Mm(f,r,t);c[f]=m.set,u[f]=m.widgetKeys}}}),d.size===0&&!t.docChanged?r:{decorationSetsByExtension:c,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:r,tr:t,decorationSetsByExtension:c,recomputedNames:d}),widgetKeys:tl(u)}}},props:{decorations(t){var r,i;return(r=(i=Lt.getState(t))===null||i===void 0?void 0:i.mergedDecorationSet)!==null&&r!==void 0?r:D.empty}}})}applyChangedRangesRecompute(n,e,t,r,i){const s=Cm(r,i.doc);return s.type==="full"?this.buildFullSet(n,e,i):this.rebuildRanges(n,e,t,r,i,s.ranges)}rebuildRanges(n,e,t,r,i,s){var o,l;const a=(o=t.decorationSetsByExtension[n])!==null&&o!==void 0?o:D.empty,c=new Set((l=t.widgetKeysByExtension[n])!==null&&l!==void 0?l:[]);let u=Nc(a,r.mapping,r.doc,c);const d=i.doc.content.size;for(const{from:f,to:h}of s){const p=u.find(f,h).filter(y=>Ac({position:y.from,from:f,to:h,docSize:d}));for(const y of p){const x=xm(y);x&&c.delete(x)}u=u.remove(p);const{decorations:m,widgetKeys:g}=vc(bm({decorations:this.runCreate(n,"createInRange",()=>e.createInRange({editor:this.editor,state:i,view:this.mountedView,from:f,to:h})),from:f,to:h,docSize:d,extensionName:n,warnedExtensions:this.warnedOutOfRangeExtensions}),n);u=u.add(i.doc,m);for(const y of g)c.add(y)}return{set:u,widgetKeys:c}}buildFullSet(n,e,t){const r=this.runCreate(n,"create",()=>e.create({editor:this.editor,state:t,view:this.mountedView}));return km(t.doc,r,n)}runCreate(n,e,t){try{return t()}catch(r){return console.error(`[tiptap error]: Extension "${n}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(n){}buildMergedSet(n,e){const t=Object.keys(e);return t.length===1?e[t[0]]:el(n,e)}mergeAfterApply({entries:n,previous:e,tr:t,decorationSetsByExtension:r,recomputedNames:i}){return n.length===1?r[n[0].name]:i.size===0?e.mergedDecorationSet.map(t.mapping,t.doc):el(t.doc,r)}};function Om(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof E){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function Nm(n,e,t){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}function Dm(n){return typeof n=="number"}function Im(n){return Object.prototype.toString.call(n).slice(8,-1)}function $n(n){return Im(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function nl(n,e,t){const r=n.split(` +`,textSerializers:o={}}=t||{};let l="";return n.nodesBetween(r,i,(a,c,u,d)=>{a.isBlock&&c>r&&(l+=s);const f=o?.[a.type.name];if(f)return u&&(l+=f({node:a,pos:c,parent:u,index:d,range:e})),!1;if(a.isText){var h;l+=a==null||(h=a.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,i-c)}}),l}function Ap(n,e){return gc(n,{from:0,to:n.content.size},e)}function yc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Op(n,e){const t=q(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function kc(n,e){const t=Kr(typeof e=="string"?e:e.name,n.schema);return t==="node"?Op(n,e):t==="mark"?fc(n,e):{}}function Np(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function Dp(n){const e=Np(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,s)=>s!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function Ur(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=t[s];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(s).map(l,-1),u=e.slice(s).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),Dp(r)}function qr(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=xs(t.resolve(n),i.type);s&&r.push({mark:i,...s})}):t.nodesBetween(n,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}const Ip=(n,e,t,r=20)=>{const i=n.doc.resolve(t);let s=r,o=null;for(;s>0&&o===null;){const l=i.node(s);l?.type.name===e?o=l:s-=1}return[o,s]},Rp=n=>{const e=n.depth-1;if(e<0)return null;const t=n.index(e);return t===0?null:n.node(e).child(t-1)};function At(n,e){return e.nodes[n]||e.marks[n]||null}function qn(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}))}const Lp=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,l)=>{var a,c;const u=((a=(c=i.type.spec).toText)===null||a===void 0?void 0:a.call(c,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-s))}),t};function Wi(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?He(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>ir(u.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:u,$to:d})=>{const f=u.pos,h=d.pos;n.doc.nodesBetween(f,h,(p,m)=>{if(s&&p.inlineContent&&!p.type.allowsMarkType(s))return!1;if(!p.isText&&!p.marks.length)return;const g=Math.max(f,m),y=Math.min(h,m+p.nodeSize),x=y-g;o+=x,l.push(...p.marks.map(S=>({mark:S,from:g,to:y})))})}),o===0)return!1;const a=l.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>ir(u.mark.attrs,t,{strict:!1})).reduce((u,d)=>u+d.to-d.from,0),c=l.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,d)=>u+d.to-d.from,0);return(a>0?a+c:a)>=o}function Pp(n,e,t={}){if(!e)return Ve(n,null,t)||Wi(n,null,t);const r=Kr(e,n.schema);return r==="node"?Ve(n,e,t):r==="mark"?Wi(n,e,t):!1}const Bp=(n,e)=>{const{$from:t,$to:r,$anchor:i}=n.selection;if(e){const s=_r(l=>l.type.name===e)(n.selection);if(!s)return!1;const o=n.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function qo(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function fi(n,e){const{nodeExtensions:t}=jt(e),r=t.find(s=>s.name===n);if(!r)return!1;const i=L(M(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function On(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){if(t){if(n.type.name==="hardBreak")return!0;if(n.isText){var r;return!/\S/.test((r=n.text)!==null&&r!==void 0?r:"")}}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(s=>{i!==!1&&(On(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function bc(n){return n instanceof E}var xc=class Sc{constructor(e){this.position=e}static fromJSON(e){return new Sc(e.position)}toJSON(){return{position:this.position}}};function $p(n,e){const t=e.mapping.mapResult(n.position);return{position:new xc(t.pos),mapResult:t}}function Fp(n){return new xc(n)}function Vp(n,e,t){const{selection:r}=e;let i=null;if(ic(r)&&(i=r.$cursor),i){var s;const l=(s=n.storedMarks)!==null&&s!==void 0?s:i.marks();return i.parent.type.allowsMarkType(t)&&(!!t.isInSet(l)||!l.some(a=>a.type.excludes(t)))}const{ranges:o}=r;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),p=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=h&&p}return!c}),c})}const Hp=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=He(n,r.schema);if(i)if(o){const c=fc(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),m=Math.min(h+f.nodeSize,d);f.marks.find(g=>g.type===a)?f.marks.forEach(g=>{a===g.type&&t.addMark(p,m,a.create({...g.attrs,...e}))}):t.addMark(p,m,a.create(e))})});return Vp(r,t,a)},jp=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Wp=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=q(n,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>so(s,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>so(s,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Kp=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=ut(n,0,r.content.size),s=E.create(r,i);e.setSelection(s)}return!0},_p=(n,e)=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=r;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=s.from,l=s.to),i&&t.doc.nodesBetween(o,l,(a,c)=>{a.isText||t.setNodeMarkup(c,void 0,{...a.attrs,dir:n})}),!0},Up=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,o=v.atStart(r).from,l=v.atEnd(r).to,a=ut(i,o,l),c=ut(s,o,l),u=v.create(r,a,c);e.setSelection(u)}return!0},qp=n=>({state:e,dispatch:t})=>{const r=q(n,e.schema);return Nd(r)(e,t)};function Jo(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 Jp=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,c=i.extensionManager.attributes,u=qn(c,l.node().type.name,l.node().attrs);if(s instanceof E&&s.node.isBlock)return!l.parentOffset||!$e(o,l.pos)?!1:(r&&(n&&Jo(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:cc(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0;const p=s instanceof v&&!s.empty?Pe.create({doc:e.doc,selection:s}).tr.deleteSelection():null,m=p?p.doc:e.doc,g=p?p.mapping.map(l.pos):l.pos;let y=$e(m,g,1,h);if(!h&&!y&&$e(m,g,1,f?[{type:f}]:void 0)&&(y=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(y){const x=e.steps.length;if(s instanceof v&&e.deleteSelection(),e.split(e.mapping.slice(x).map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f){const S=e.mapping.slice(x).map(l.before()),C=e.doc.resolve(S);l.node(-1).canReplaceWith(C.index(),C.index()+1,f)&&e.setNodeMarkup(e.mapping.slice(x).map(l.before()),f)}}n&&Jo(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},Gp=(n,e={})=>({tr:t,state:r,dispatch:i,editor:s})=>{const o=q(n,r.schema),{$from:l,$to:a}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(a))return!1;const u=l.node(-1);if(u.type!==o)return!1;const d=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){var f;let C=k.empty;const I=l.index(-1)?1:l.index(-2)?2:3;for(let pe=l.depth-I;pe>=l.depth-3;pe-=1)C=k.from(l.node(pe).copy(C));const F=l.indexAfter(-1){if(X>-1)return!1;pe.isTextblock&&pe.content.size===0&&(X=st+1)}),X>-1&&t.setSelection(v.near(t.doc.resolve(X))),t.scrollIntoView()}return!0}const h=a.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...qn(d,u.type.name,u.attrs),...e},m={...qn(d,l.node().type.name,l.node().attrs),...e},g=l.parentOffset===0&&l.index(-1)===0,y=l.before(-1);t.delete(l.pos,a.pos);const x=g?u.attrs:p,S=h?[{type:o,attrs:x},{type:h,attrs:m}]:[{type:o,attrs:x}];if(!$e(t.doc,l.pos,2))return!1;if(i){const{selection:C,storedMarks:I}=r,{splittableMarks:F}=s.extensionManager,A=I||C.$to.parentOffset&&C.$from.marks();if(t.split(l.pos,2,S).scrollIntoView(),g&&t.setNodeMarkup(y,void 0,p),!A||!i)return!0;const R=A.filter(P=>F.includes(P.type.name));t.ensureMarks(R)}return!0};function Go(n){return!n||n==="1"?null:n}function wc(n,e){return Go(n)===Go(e)}const hi=(n,e)=>{const t=_r(s=>s.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&&rt(n.doc,t.pos))||!wc(t.node.attrs.type,i?.attrs.type)||n.join(t.pos),!0},pi=(n,e)=>{const t=_r(s=>s.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&&rt(n.doc,r))||!wc(t.node.attrs.type,i?.attrs.type)||n.join(r),!0};function Yp(n){const e=n.doc,t=e.firstChild;if(!t)return null;const r=e.resolve(1),i=e.resolve(t.nodeSize-1);return v.between(r,i)}const Xp=(n,e,t,r={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,h=q(n,o.schema),p=q(e,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:x}=m,S=y.blockRange(x),C=g||m.$to.parentOffset&&m.$from.marks();if(!S)return!1;const I=_r(be=>fi(be.type.name,d))(m),F=m.from===0&&m.to===o.doc.content.size,A=o.doc.content.content,R=A.length===1?A[0]:null,P=F&&R&&fi(R.type.name,d)?{node:R,pos:0}:null,X=I??P,pe=!!I&&S.depth>=1&&S.depth-I.depth<=1,st=!!P;if((pe||st)&&X){if(X.node.type===h)return F&&st?a().command(({tr:be,dispatch:Ae})=>{const xe=Yp(be);return xe?(be.setSelection(xe),Ae&&Ae(be),!0):!1}).liftListItem(p).run():c.liftListItem(p);if(fi(X.node.type.name,d)&&h.validContent(X.node.content))return a().command(()=>(s.setNodeMarkup(X.pos,h),!0)).command(()=>hi(s,h)).command(()=>pi(s,h)).run()}return!t||!C||!l?a().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>hi(s,h)).command(()=>pi(s,h)).run():a().command(()=>{const be=u().wrapInList(h,r),Ae=C.filter(xe=>f.includes(xe.type.name));return s.ensureMarks(Ae),be?!0:c.clearNodes()}).wrapInList(h,r).command(()=>hi(s,h)).command(()=>pi(s,h)).run()},Qp=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=He(n,r.schema);return Wi(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},Zp=(n,e,t={})=>({state:r,commands:i})=>{const s=q(n,r.schema),o=q(e,r.schema),l=Ve(r,s,t);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?i.setNode(o,a):i.setNode(s,{...a,...t})},em=(n,e={})=>({state:t,commands:r})=>{const i=q(n,t.schema);return Ve(t,i,e)?r.lift(i):r.wrapIn(i,e)},tm=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,n.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},nm=(n={})=>({tr:e,dispatch:t,editor:r})=>{const{ignoreClearable:i=!1}=n,{selection:s}=e,{empty:o,ranges:l}=s;if(o)return!0;const{nonClearableMarks:a}=r.extensionManager;if(t){const c=Object.values(r.schema.marks).filter(u=>i||!a.includes(u.name));l.forEach(u=>{for(const d of c)e.removeMark(u.$from.pos,u.$to.pos,d)})}return!0},rm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{extendEmptyMarkRange:s=!1}=e,{selection:o}=t,l=He(n,r.schema),{$from:a,empty:c,ranges:u}=o;if(!i)return!0;if(c&&s){var d;let{from:f,to:h}=o;const p=xs(a,l,(d=a.marks().find(m=>m.type===l))===null||d===void 0?void 0:d.attrs);p&&(f=p.from,h=p.to),t.removeMark(f,h,l)}else u.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,l)});return t.removeStoredMark(l),!0},im=n=>({tr:e,state:t,dispatch:r})=>{const{selection:i}=t;let s,o;return typeof n=="number"?(s=n,o=n):n&&"from"in n&&"to"in n?(s=n.from,o=n.to):(s=i.from,o=i.to),r&&e.doc.nodesBetween(s,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},sm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const l=Kr(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(s=q(n,r.schema)),l==="mark"&&(o=He(n,r.schema));let a=!1;return t.selection.ranges.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;let f,h,p,m;t.selection.empty?r.doc.nodesBetween(u,d,(g,y)=>{s&&s===g.type&&(a=!0,p=Math.max(y,u),m=Math.min(y+g.nodeSize,d),f=y,h=g)}):r.doc.nodesBetween(u,d,(g,y)=>{y=u&&y<=d&&(s&&s===g.type&&(a=!0,i&&t.setNodeMarkup(y,void 0,{...g.attrs,...e})),o&&g.marks.length&&g.marks.forEach(x=>{if(o===x.type&&(a=!0,i)){const S=Math.max(y,u),C=Math.min(y+g.nodeSize,d);t.addMark(S,C,o.create({...x.attrs,...e}))}}))}),h&&(f!==void 0&&i&&t.setNodeMarkup(f,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(g=>{o===g.type&&i&&t.addMark(p,m,o.create({...g.attrs,...e}))}))}),a},It=new _("__tiptap_decorations__"),om=n=>({tr:e,dispatch:t})=>(t&&e.setMeta(It,{type:"force",name:n}),!0),lm=(n,e={})=>({state:t,dispatch:r})=>{const i=q(n,t.schema);return Cd(i,e)(t,r)},am=(n,e={})=>({state:t,dispatch:r})=>{const i=q(n,t.schema);return Md(i,e)(t,r)};var cm=mu({blur:()=>Nh,clearContent:()=>Dh,clearNodes:()=>Ih,command:()=>Rh,createParagraphNear:()=>Lh,cut:()=>Ph,deleteCurrentNode:()=>Bh,deleteNode:()=>zh,deleteRange:()=>$h,deleteSelection:()=>Hh,enter:()=>jh,exitCode:()=>Wh,extendMarkRange:()=>Kh,first:()=>_h,focus:()=>qh,forEach:()=>Jh,insertContent:()=>Gh,insertContentAt:()=>Yh,insertDefaultBlock:()=>Xh,joinBackward:()=>ep,joinDown:()=>Zh,joinForward:()=>tp,joinItemBackward:()=>np,joinItemForward:()=>rp,joinTextblockBackward:()=>ip,joinTextblockForward:()=>sp,joinUp:()=>Qh,keyboardShortcut:()=>lp,lift:()=>ap,liftEmptyBlock:()=>cp,liftListItem:()=>up,newlineInCode:()=>dp,resetAttributes:()=>fp,scrollIntoView:()=>hp,selectAll:()=>pp,selectNodeBackward:()=>mp,selectNodeForward:()=>gp,selectParentNode:()=>yp,selectTextblockEnd:()=>kp,selectTextblockStart:()=>bp,setContent:()=>xp,setMark:()=>Hp,setMeta:()=>jp,setNode:()=>Wp,setNodeSelection:()=>Kp,setTextDirection:()=>_p,setTextSelection:()=>Up,sinkListItem:()=>qp,splitBlock:()=>Jp,splitListItem:()=>Gp,toggleList:()=>Xp,toggleMark:()=>Qp,toggleNode:()=>Zp,toggleWrap:()=>em,undoInputRule:()=>tm,unsetAllMarks:()=>nm,unsetMark:()=>rm,unsetTextDirection:()=>im,updateAttributes:()=>sm,updateDecorations:()=>om,wrapIn:()=>lm,wrapInList:()=>am});const qt=new WeakMap;function um(n,e){var t;qt.set(n,((t=qt.get(n))!==null&&t!==void 0?t:0)+1);try{return e()}finally{var r;const i=((r=qt.get(n))!==null&&r!==void 0?r:1)-1;i>0?qt.set(n,i):qt.delete(n)}}var dm=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){const t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}};function fm(n){return n.kind==="widget"}function Cc(n,e){const t=[],r=new Set;for(const i of n)i.kind==="widget"&&fm(i)&&r.add(i.key),t.push(i.toPMDecoration(e));return{decorations:t,widgetKeys:r}}function hm(n,e,t){const{decorations:r,widgetKeys:i}=Cc(e,t);return{set:D.create(n,r),widgetKeys:i}}function Mc({position:n,from:e,to:t,docSize:r}){return nMc({position:o.anchor,from:e,to:t,docSize:r})?!0:(o.anchor===t||s.has(i)||(s.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${e}, ${t}). It was ignored.`)),!1))}function mm(n){var e;const t=(e=n.spec)===null||e===void 0?void 0:e.key;return typeof t=="string"?t:void 0}function Tc(n){return n.jsonID==="attr"}function gm(n){let e=!1;if(n.getMap().forEach(()=>{e=!0}),e||Tc(n))return!0;const t=n;return typeof t.from=="number"&&typeof t.to=="number"}function ym(n,e){let t=null,r=0,i=0;for(let s=0;se.to);s+=1){const o=i+n.child(s).nodeSize;o>=e.from&&(t===null&&(t=i),r=o),i=o}return t===null?null:{from:t,to:r}}function km(n,e){if(n.steps.some(s=>!gm(s)))return{type:"full"};const t=Ur(n).map(({newRange:s})=>s);n.steps.forEach((s,o)=>{if(!Tc(s))return;const l=n.mapping.slice(o);t.push({from:l.map(s.pos,-1),to:l.map(s.pos+1)})});const r=[];for(const s of t){const o=ym(e,s);o&&r.push(o)}r.sort((s,o)=>s.from-o.from);const i=[];for(const s of r){const o=i[i.length-1];o&&s.from<=o.to?o.to=Math.max(o.to,s.to):i.push({...s})}return{type:"ranges",ranges:i}}function Ec(n,e,t,r){return n.map(e,t,{onRemove:i=>{const s=i?.key;typeof s=="string"&&r.delete(s)}})}function bm(n,e,t){var r,i;const s=(r=e.decorationSetsByExtension[n])!==null&&r!==void 0?r:D.empty,o=new Set((i=e.widgetKeysByExtension[n])!==null&&i!==void 0?i:[]);return{set:Ec(s,t.mapping,t.doc,o),widgetKeys:o}}function Yo(n,e){const t=Object.values(e).flatMap(r=>r.find());return D.create(n,t)}function Xo(n){const e=new Set;for(const t of Object.values(n))for(const r of t)e.add(r);return e}function xm(n,e){var t;switch((t=e.update)!==null&&t!==void 0?t:"document"){case"document":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension "${n}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${n}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function Sm(n,e,t){return t?!0:n.update==="manual"?!1:n.shouldUpdate?n.shouldUpdate(e):e.tr.docChanged}const wm=new Set;var Cm=class{constructor(n){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{const t=It.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=n.editor,this.entries=this.resolveEntries(n.entries),this.entries.forEach(({name:e,spec:t})=>xm(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var n,e;return(n=(e=It.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&n!==void 0?n:wm}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(n){const e=[];for(const{name:t,addDecorations:r}of n){const i=r();i&&e.push({name:t,spec:i})}return e}createPlugin(){const{editor:n,entries:e}=this;return new $({key:It,state:{init:(t,r)=>{const i={},s={};for(const{name:l,spec:a}of e){const{set:c,widgetKeys:u}=this.buildFullSet(l,a,r);i[l]=c,s[l]=u}const o={decorationSetsByExtension:i,widgetKeysByExtension:s,mergedDecorationSet:this.buildMergedSet(r.doc,i),widgetKeys:Xo(s)};return this.warnDuplicateWidgetKeys(o),o},apply:(t,r,i,s)=>{const o=t.getMeta(It),l=o?.type==="force"&&!o.name,a=o?.type==="force"?o.name:void 0,c={},u={},d=new Set;return um(n,()=>{for(const{name:f,spec:h}of e){const p=l||a===f;if(Sm(h,{editor:n,tr:t,oldState:i,newState:s},p))if(h.update==="changedRanges"&&t.docChanged&&!p){const m=this.applyChangedRangesRecompute(f,h,r,t,s);c[f]=m.set,u[f]=m.widgetKeys,d.add(f)}else{const{set:m,widgetKeys:g}=this.buildFullSet(f,h,s);c[f]=m,u[f]=g,d.add(f)}else{const m=bm(f,r,t);c[f]=m.set,u[f]=m.widgetKeys}}}),d.size===0&&!t.docChanged?r:{decorationSetsByExtension:c,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:r,tr:t,decorationSetsByExtension:c,recomputedNames:d}),widgetKeys:Xo(u)}}},props:{decorations(t){var r,i;return(r=(i=It.getState(t))===null||i===void 0?void 0:i.mergedDecorationSet)!==null&&r!==void 0?r:D.empty}}})}applyChangedRangesRecompute(n,e,t,r,i){const s=km(r,i.doc);return s.type==="full"?this.buildFullSet(n,e,i):this.rebuildRanges(n,e,t,r,i,s.ranges)}rebuildRanges(n,e,t,r,i,s){var o,l;const a=(o=t.decorationSetsByExtension[n])!==null&&o!==void 0?o:D.empty,c=new Set((l=t.widgetKeysByExtension[n])!==null&&l!==void 0?l:[]);let u=Ec(a,r.mapping,r.doc,c);const d=i.doc.content.size;for(const{from:f,to:h}of s){const p=u.find(f,h).filter(y=>Mc({position:y.from,from:f,to:h,docSize:d}));for(const y of p){const x=mm(y);x&&c.delete(x)}u=u.remove(p);const{decorations:m,widgetKeys:g}=Cc(pm({decorations:this.runCreate(n,"createInRange",()=>e.createInRange({editor:this.editor,state:i,view:this.mountedView,from:f,to:h})),from:f,to:h,docSize:d,extensionName:n,warnedExtensions:this.warnedOutOfRangeExtensions}),n);u=u.add(i.doc,m);for(const y of g)c.add(y)}return{set:u,widgetKeys:c}}buildFullSet(n,e,t){const r=this.runCreate(n,"create",()=>e.create({editor:this.editor,state:t,view:this.mountedView}));return hm(t.doc,r,n)}runCreate(n,e,t){try{return t()}catch(r){return console.error(`[tiptap error]: Extension "${n}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(n){}buildMergedSet(n,e){const t=Object.keys(e);return t.length===1?e[t[0]]:Yo(n,e)}mergeAfterApply({entries:n,previous:e,tr:t,decorationSetsByExtension:r,recomputedNames:i}){return n.length===1?r[n[0].name]:i.size===0?e.mergedDecorationSet.map(t.mapping,t.doc):Yo(t.doc,r)}};function Mm(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof E){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function Tm(n,e,t){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}function Em(n){return typeof n=="number"}function vm(n){return Object.prototype.toString.call(n).slice(8,-1)}function Bn(n){return vm(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Qo(n,e,t){const r=n.split(` `),i=[];let s="",o=0;const l=e.baseIndentSize||2;for(;o0)break;if(u.trim()===""){o+=1,s=`${s}${u} `;continue}else return}const f=e.extractItemData(d),{indentLevel:h,mainContent:p}=f;s=`${s}${u} `;const m=[p];for(o+=1;oI.trim()!=="");if(C===-1)break;if((((c=r[o+1+C].match(/^(\s*)/))===null||c===void 0||(c=c[1])===null||c===void 0?void 0:c.length)||0)>h){m.push(S),s=`${s}${S} `,o+=1;continue}else break}if((((a=S.match(/^(\s*)/))===null||a===void 0||(a=a[1])===null||a===void 0?void 0:a.length)||0)>h)m.push(S),s=`${s}${S} `,o+=1;else break}let g;const y=m.slice(1);if(y.length>0){const S=y.map(C=>C.slice(h+l)).join(` -`);S.trim()&&(e.customNestedParser?g=e.customNestedParser(S):g=t.blockTokens(S))}const x=e.createToken(f,g);i.push(x)}if(i.length!==0)return{items:i,raw:s}}const rl=4;function il(n){let e=0;for(const t of n)e=t===" "?e+rl-e%rl:e+1;return e}function Dc(n,e,t,r,i){if(!n||!Array.isArray(n.content))return"";const s=typeof t=="function"?t(r):t,[o,...l]=n.content;let a=`${s}${e.renderChildren([o])}`;return l&&l.length>0&&l.forEach((c,u)=>{var d,f;const h=(d=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,c,u+1))!==null&&d!==void 0?d:e.renderChildren([c]);if(h!=null){const p=g=>{if(!i?.alignNestedToPrefix)return e.indent(g);const y=e.indent(""),x=il(s);return(il(y)>=x?y:" ".repeat(x))+g},m=h.split(` +`);S.trim()&&(e.customNestedParser?g=e.customNestedParser(S):g=t.blockTokens(S))}const x=e.createToken(f,g);i.push(x)}if(i.length!==0)return{items:i,raw:s}}const Zo=4;function el(n){let e=0;for(const t of n)e=t===" "?e+Zo-e%Zo:e+1;return e}function vc(n,e,t,r,i){if(!n||!Array.isArray(n.content))return"";const s=typeof t=="function"?t(r):t,[o,...l]=n.content;let a=`${s}${e.renderChildren([o])}`;return l&&l.length>0&&l.forEach((c,u)=>{var d,f;const h=(d=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,c,u+1))!==null&&d!==void 0?d:e.renderChildren([c]);if(h!=null){const p=g=>{if(!i?.alignNestedToPrefix)return e.indent(g);const y=e.indent(""),x=el(s);return(el(y)>=x?y:" ".repeat(x))+g},m=h.split(` `).map(g=>p(g||"")).join(` `);a+=c.type==="paragraph"?` ${m}`:` -${m}`}}),a}function Ic(n,e){const t={...n};return $n(n)&&$n(e)&&Object.keys(e).forEach(r=>{$n(e[r])&&$n(n[r])?t[r]=Ic(n[r],e[r]):t[r]=e[r]}),t}function Rm(n,e,t={}){const{state:r}=e,{doc:i,tr:s}=r,o=n;i.descendants((l,a)=>{const c=s.mapping.map(a),u=s.mapping.map(a)+l.nodeSize;let d=null;if(l.marks.forEach(h=>{if(h!==o)return!1;d=h}),!d)return;let f=!1;if(Object.keys(t).forEach(h=>{t[h]!==d.attrs[h]&&(f=!0)}),f){const h=n.type.create({...n.attrs,...t});s.removeMark(c,u,n.type),s.addMark(c,u,h)}}),s.docChanged&&e.view.dispatch(s)}var In=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!==null&&e!==void 0?e:!0}};const Lm=(n,e)=>{if(Cs(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 Pm(n){const{editor:e,from:t,to:r,text:i,insertText:s}=n;if(!s)return{inputTransaction:null,tr:e.view.state.tr};const o=e.view.state.tr.insertText(i,t,r);return{inputTransaction:o,tr:Be.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function Bm(n){const{editor:e,from:t,to:r,text:i,rule:s,match:o,plugin:l,insertText:a}=n,{view:c}=e,{inputTransaction:u,tr:d}=Pm({editor:e,from:t,to:r,text:i,insertText:a}),f=u?t+i.length:r,h=_r({state:c.state,transaction:d}),p={from:t-(o[0].length-i.length),to:f},{commands:m,chain:g,can:y}=new $t({editor:e,state:h});return s.handler({state:h,range:p,match:o,commands:m,chain:g,can:y})===null||!d.steps.length?!1:(u&&(c.dispatch(u),!c.state.doc.eq(u.doc))||(Ih(d),d.setMeta("inputRule",!0),s.undoable&&d.setMeta(l,{transform:d,from:t,to:f,text:i}),c.dispatch(d)),!0)}function zm(n,e,t){const r=e[0].length-t.length;if(r<=0)return!0;const i=n.parentOffset-r;return i>=0&&n.parent.textBetween(i,n.parentOffset)===e[0].slice(0,r)}function Fn(n){var e;const{editor:t,from:r,to:i,text:s,rules:o,plugin:l,insertText:a}=n,{view:c}=t;if(c.composing)return!1;const u=c.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;const d=Fp(u)+s;for(const f of o){const h=Lm(d,f.find);if(!(!h||!zm(u,h,s))&&Bm({editor:t,from:r,to:i,text:s,rule:f,match:h,plugin:l,insertText:a}))return!0}return!1}function $m(n){const{editor:e,rules:t}=n,r=new $({state:{init(){return null},apply(i,s,o){const l=i.getMeta(r);if(l)return l;const a=i.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=Es(k.from(c),o.schema);const{from:u}=a,d=u+c.length;Fn({editor:e,from:u,to:d,text:c,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,l){return Fn({editor:e,from:s,to:o,text:l,rules:t,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Fn({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?Fn({editor:e,from:o.pos,to:o.pos,text:` -`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}var vs=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...L(M(this,"addOptions",{name:this.name}))}}get storage(){return{...L(M(this,"addStorage",{name:this.name,options:this.options}))}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>Ic(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},Et=class Rc extends vs{constructor(...e){super(...e),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new Rc(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!s.find(l=>l?.type.name===t.name))return!1;const o=s.find(l=>l?.type.name===t.name);return o&&r.removeStoredMark(o),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},Lc=class{constructor(n){this.find=n.find,this.handler=n.handler}};const Fm=(n,e,t)=>{if(Cs(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=n,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function Vm(n){const{editor:e,state:t,from:r,to:i,rule:s,pasteEvent:o,dropEvent:l}=n,{commands:a,chain:c,can:u}=new $t({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,i,(f,h)=>{var p,m,g,y;if(!((p=f.type)===null||p===void 0||(p=p.spec)===null||p===void 0)&&p.code||!(f.isText||f.isTextblock||f.isInline))return;const x=(m=(g=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&g!==void 0?g:f.nodeSize)!==null&&m!==void 0?m:0,S=Math.max(r,h),C=Math.min(i,h+x);if(S>=C)return;const I=f.isText?f.text||"":f.textBetween(S-h,C-h,void 0,"");Fm(I,s.find,o).forEach(F=>{if(F.index===void 0)return;const A=S+F.index+1,R=A+F[0].length,P={from:t.tr.mapping.map(A),to:t.tr.mapping.map(R)},X=s.handler({state:t,range:P,match:F,commands:a,chain:c,can:u,pasteEvent:o,dropEvent:l});d.push(X)})}),d.every(f=>f!==null)}let Dt=null;const Hm=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function jm(n){const{editor:e,rules:t}=n;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:c,from:u,to:d,rule:f,pasteEvt:h})=>{const p=c.tr,m=_r({state:c,transaction:p});if(!(!Vm({editor:e,state:m,from:Math.max(u-1,0),to:d.b-1,rule:f,pasteEvent:h,dropEvent:l})||!p.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return e.on("destroy",()=>{Dt===e&&(Dt=null)}),t.map(c=>new $({view(u){const d=h=>{var p;r=!((p=u.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?u.dom.parentElement:null,r&&(Dt=e)},f=()=>{Dt&&(Dt=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(u,d)=>{if(s=r===u.dom.parentElement,l=d,!s){const f=Dt;f?.isEditable&&setTimeout(()=>{if(f.isDestroyed)return;const h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(u,d)=>{var f;const h=(f=d.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=d,i=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(u,d,f)=>{const h=u[0],p=h.getMeta("uiEvent")==="paste"&&!i,m=h.getMeta("uiEvent")==="drop"&&!s,g=h.getMeta("applyPasteRules"),y=!!g;if(!p&&!m&&!y)return;if(y){let{text:C}=g;typeof C=="string"?C=C:C=Es(k.from(C),f.schema);const{from:I}=g,F=I+C.length,A=Hm(C);return a({rule:c,state:f,from:I,to:{b:F},pasteEvt:A})}const x=d.doc.content.findDiffStart(f.doc.content),S=d.doc.content.findDiffEnd(f.doc.content);if(!(!Dm(x)||!S||x===S.b))return a({rule:c,state:f,from:x,to:S,pasteEvt:o})}}))}var Xr=class{constructor(n,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=n,this.extensions=bc(n),this.schema=Dp(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t=M(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Nt(e.name,this.schema)});return t?{...n,...t()}:n},{})}get plugins(){const{editor:n}=this,e=ln([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:Nt(r.name,this.schema)},s=[],o=M(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&M(r,"exitable",i)&&(l.ArrowRight=()=>Et.handleExit({editor:n,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([h,p])=>[h,()=>p({editor:n})]));l={...l,...f}}const a=Mh(l);s.push(a);const c=M(r,"addInputRules",i);if(Xo(r,n.options.enableInputRules)&&c){const f=c();if(f&&f.length){const h=$m({editor:n,rules:f}),p=Array.isArray(h)?h:[h];s.push(...p)}}const u=M(r,"addPasteRules",i);if(Xo(r,n.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const h=jm({editor:n,rules:f});s.push(...h)}}const d=M(r,"addProseMirrorPlugins",i);if(d){const f=d();s.push(...f)}return s}),t=this.createDecorationPlugin();return t&&e.push(t),e}createDecorationPlugin(){var n;const{editor:e}=this;(n=this.decorationManager)===null||n===void 0||n.destroy();const t=[];return this.extensions.forEach(r=>{const i=M(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Nt(r.name,this.schema)});i&&t.push({name:r.name,addDecorations:i})}),this.decorationManager=new Am({editor:e,entries:t}),this.decorationManager.plugin}get attributes(){return kc(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=Kt(this.extensions);return Object.fromEntries(e.filter(t=>!!M(t,"addNodeView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),i=M(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:q(t.name,this.schema)});if(!i)return[];const s=i();if(!s)return[];const o=(l,a,c,u,d)=>{const f=Mn(l,r);return s({node:l,view:a,getPos:c,decorations:u,innerDecorations:d,editor:n,extension:t,HTMLAttributes:f})};return[t.name,o]}))}dispatchTransaction(n){const{editor:e}=this;return ln([...this.extensions].reverse()).reduceRight((t,r)=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Nt(r.name,this.schema)},s=M(r,"dispatchTransaction",i);return s?o=>{s.call(i,{transaction:o,next:t})}:t},n)}transformPastedHTML(n){const{editor:e}=this;return ln([...this.extensions]).reduce((t,r)=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Nt(r.name,this.schema)},s=M(r,"transformPastedHTML",i);return s?(o,l)=>{const a=t(o,l);return s.call(i,a)}:t},n||(t=>t))}get markViews(){const{editor:n}=this,{markExtensions:e}=Kt(this.extensions);return Object.fromEntries(e.filter(t=>!!M(t,"addMarkView")).map(t=>{const r=this.attributes.filter(o=>o.type===t.name),i=M(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:je(t.name,this.schema)});if(!i)return[];const s=(o,l,a)=>{const c=Mn(o,r);return i()({mark:o,view:l,inline:a,editor:n,extension:t,HTMLAttributes:c,updateAttributes:u=>{Rm(o,n,u)}})};return[t.name,s]}))}destroy(){var n;(n=this.decorationManager)===null||n===void 0||n.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){const r=t.parent;r.child===t&&(r.child=null),t=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Nt(e.name,this.schema)};if(e.type==="mark"){var r,i;(!((r=L(M(e,"keepOnSplit",t)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name),!((i=L(M(e,"clearable",t)))!==null&&i!==void 0)||i||this.nonClearableMarks.push(e.name)}const s=M(e,"onBeforeCreate",t),o=M(e,"onCreate",t),l=M(e,"onUpdate",t),a=M(e,"onSelectionUpdate",t),c=M(e,"onTransaction",t),u=M(e,"onFocus",t),d=M(e,"onBlur",t),f=M(e,"onDestroy",t);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),l&&this.editor.on("update",l),a&&this.editor.on("selectionUpdate",a),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}};Xr.resolve=bc;Xr.sort=ln;Xr.flatten=Ts;var W=class Pc extends vs{constructor(...e){super(...e),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new Pc(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};const Wm=W.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new $({key:new U("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,s=Sc(t),{blockSeparator:o}=this.options,l={...o!==void 0?{blockSeparator:o}:{},textSerializers:s};return[...i.ranges].sort((a,c)=>a.$from.pos-c.$from.pos).map(({$from:a,$to:c})=>xc(r,{from:a.pos,to:c.pos},l)).join(o??` +${m}`}}),a}function Ac(n,e){const t={...n};return Bn(n)&&Bn(e)&&Object.keys(e).forEach(r=>{Bn(e[r])&&Bn(n[r])?t[r]=Ac(n[r],e[r]):t[r]=e[r]}),t}function Am(n,e,t={}){const{state:r}=e,{doc:i,tr:s}=r,o=n;i.descendants((l,a)=>{const c=s.mapping.map(a),u=s.mapping.map(a)+l.nodeSize;let d=null;if(l.marks.forEach(h=>{if(h!==o)return!1;d=h}),!d)return;let f=!1;if(Object.keys(t).forEach(h=>{t[h]!==d.attrs[h]&&(f=!0)}),f){const h=n.type.create({...n.attrs,...t});s.removeMark(c,u,n.type),s.addMark(c,u,h)}}),s.docChanged&&e.view.dispatch(s)}var Nn=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!==null&&e!==void 0?e:!0}};const Om=(n,e)=>{if(bs(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 Nm(n){const{editor:e,from:t,to:r,text:i,insertText:s}=n;if(!s)return{inputTransaction:null,tr:e.view.state.tr};const o=e.view.state.tr.insertText(i,t,r);return{inputTransaction:o,tr:Pe.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function Dm(n){const{editor:e,from:t,to:r,text:i,rule:s,match:o,plugin:l,insertText:a}=n,{view:c}=e,{inputTransaction:u,tr:d}=Nm({editor:e,from:t,to:r,text:i,insertText:a}),f=u?t+i.length:r,h=Wr({state:c.state,transaction:d}),p={from:t-(o[0].length-i.length),to:f},{commands:m,chain:g,can:y}=new Bt({editor:e,state:h});return s.handler({state:h,range:p,match:o,commands:m,chain:g,can:y})===null||!d.steps.length?!1:(u&&(c.dispatch(u),!c.state.doc.eq(u.doc))||(vh(d),d.setMeta("inputRule",!0),s.undoable&&d.setMeta(l,{transform:d,from:t,to:f,text:i}),c.dispatch(d)),!0)}function Im(n,e,t){const r=e[0].length-t.length;if(r<=0)return!0;const i=n.parentOffset-r;return i>=0&&n.parent.textBetween(i,n.parentOffset)===e[0].slice(0,r)}function zn(n){var e;const{editor:t,from:r,to:i,text:s,rules:o,plugin:l,insertText:a}=n,{view:c}=t;if(c.composing)return!1;const u=c.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;const d=Lp(u)+s;for(const f of o){const h=Om(d,f.find);if(!(!h||!Im(u,h,s))&&Dm({editor:t,from:r,to:i,text:s,rule:f,match:h,plugin:l,insertText:a}))return!0}return!1}function Rm(n){const{editor:e,rules:t}=n,r=new $({state:{init(){return null},apply(i,s,o){const l=i.getMeta(r);if(l)return l;const a=i.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=ws(k.from(c),o.schema);const{from:u}=a,d=u+c.length;zn({editor:e,from:u,to:d,text:c,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,l){return zn({editor:e,from:s,to:o,text:l,rules:t,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&zn({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?zn({editor:e,from:o.pos,to:o.pos,text:` +`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}var Cs=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...L(M(this,"addOptions",{name:this.name}))}}get storage(){return{...L(M(this,"addStorage",{name:this.name,options:this.options}))}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>Ac(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},Mt=class Oc extends Cs{constructor(...e){super(...e),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new Oc(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!s.find(l=>l?.type.name===t.name))return!1;const o=s.find(l=>l?.type.name===t.name);return o&&r.removeStoredMark(o),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},Nc=class{constructor(n){this.find=n.find,this.handler=n.handler}};const Lm=(n,e,t)=>{if(bs(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=n,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function Pm(n){const{editor:e,state:t,from:r,to:i,rule:s,pasteEvent:o,dropEvent:l}=n,{commands:a,chain:c,can:u}=new Bt({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,i,(f,h)=>{var p,m,g,y;if(!((p=f.type)===null||p===void 0||(p=p.spec)===null||p===void 0)&&p.code||!(f.isText||f.isTextblock||f.isInline))return;const x=(m=(g=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&g!==void 0?g:f.nodeSize)!==null&&m!==void 0?m:0,S=Math.max(r,h),C=Math.min(i,h+x);if(S>=C)return;const I=f.isText?f.text||"":f.textBetween(S-h,C-h,void 0,"");Lm(I,s.find,o).forEach(F=>{if(F.index===void 0)return;const A=S+F.index+1,R=A+F[0].length,P={from:t.tr.mapping.map(A),to:t.tr.mapping.map(R)},X=s.handler({state:t,range:P,match:F,commands:a,chain:c,can:u,pasteEvent:o,dropEvent:l});d.push(X)})}),d.every(f=>f!==null)}let Ot=null;const Bm=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function zm(n){const{editor:e,rules:t}=n;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:c,from:u,to:d,rule:f,pasteEvt:h})=>{const p=c.tr,m=Wr({state:c,transaction:p});if(!(!Pm({editor:e,state:m,from:Math.max(u-1,0),to:d.b-1,rule:f,pasteEvent:h,dropEvent:l})||!p.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return e.on("destroy",()=>{Ot===e&&(Ot=null)}),t.map(c=>new $({view(u){const d=h=>{var p;r=!((p=u.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?u.dom.parentElement:null,r&&(Ot=e)},f=()=>{Ot&&(Ot=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(u,d)=>{if(s=r===u.dom.parentElement,l=d,!s){const f=Ot;f?.isEditable&&setTimeout(()=>{if(f.isDestroyed)return;const h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(u,d)=>{var f;const h=(f=d.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=d,i=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(u,d,f)=>{const h=u[0],p=h.getMeta("uiEvent")==="paste"&&!i,m=h.getMeta("uiEvent")==="drop"&&!s,g=h.getMeta("applyPasteRules"),y=!!g;if(!p&&!m&&!y)return;if(y){let{text:C}=g;typeof C=="string"?C=C:C=ws(k.from(C),f.schema);const{from:I}=g,F=I+C.length,A=Bm(C);return a({rule:c,state:f,from:I,to:{b:F},pasteEvt:A})}const x=d.doc.content.findDiffStart(f.doc.content),S=d.doc.content.findDiffEnd(f.doc.content);if(!(!Em(x)||!S||x===S.b))return a({rule:c,state:f,from:x,to:S,pasteEvt:o})}}))}var Jr=class{constructor(n,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=n,this.extensions=mc(n),this.schema=Ep(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t=M(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:At(e.name,this.schema)});return t?{...n,...t()}:n},{})}get plugins(){const{editor:n}=this,e=sn([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:At(r.name,this.schema)},s=[],o=M(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&M(r,"exitable",i)&&(l.ArrowRight=()=>Mt.handleExit({editor:n,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([h,p])=>[h,()=>p({editor:n})]));l={...l,...f}}const a=bh(l);s.push(a);const c=M(r,"addInputRules",i);if(qo(r,n.options.enableInputRules)&&c){const f=c();if(f&&f.length){const h=Rm({editor:n,rules:f}),p=Array.isArray(h)?h:[h];s.push(...p)}}const u=M(r,"addPasteRules",i);if(qo(r,n.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const h=zm({editor:n,rules:f});s.push(...h)}}const d=M(r,"addProseMirrorPlugins",i);if(d){const f=d();s.push(...f)}return s}),t=this.createDecorationPlugin();return t&&e.push(t),e}createDecorationPlugin(){var n;const{editor:e}=this;(n=this.decorationManager)===null||n===void 0||n.destroy();const t=[];return this.extensions.forEach(r=>{const i=M(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:At(r.name,this.schema)});i&&t.push({name:r.name,addDecorations:i})}),this.decorationManager=new Cm({editor:e,entries:t}),this.decorationManager.plugin}get attributes(){return pc(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=jt(this.extensions);return Object.fromEntries(e.filter(t=>!!M(t,"addNodeView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),i=M(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:q(t.name,this.schema)});if(!i)return[];const s=i();if(!s)return[];const o=(l,a,c,u,d)=>{const f=wn(l,r);return s({node:l,view:a,getPos:c,decorations:u,innerDecorations:d,editor:n,extension:t,HTMLAttributes:f})};return[t.name,o]}))}dispatchTransaction(n){const{editor:e}=this;return sn([...this.extensions].reverse()).reduceRight((t,r)=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:At(r.name,this.schema)},s=M(r,"dispatchTransaction",i);return s?o=>{s.call(i,{transaction:o,next:t})}:t},n)}transformPastedHTML(n){const{editor:e}=this;return sn([...this.extensions]).reduce((t,r)=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:At(r.name,this.schema)},s=M(r,"transformPastedHTML",i);return s?(o,l)=>{const a=t(o,l);return s.call(i,a)}:t},n||(t=>t))}get markViews(){const{editor:n}=this,{markExtensions:e}=jt(this.extensions);return Object.fromEntries(e.filter(t=>!!M(t,"addMarkView")).map(t=>{const r=this.attributes.filter(o=>o.type===t.name),i=M(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:He(t.name,this.schema)});if(!i)return[];const s=(o,l,a)=>{const c=wn(o,r);return i()({mark:o,view:l,inline:a,editor:n,extension:t,HTMLAttributes:c,updateAttributes:u=>{Am(o,n,u)}})};return[t.name,s]}))}destroy(){var n;(n=this.decorationManager)===null||n===void 0||n.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){const r=t.parent;r.child===t&&(r.child=null),t=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:At(e.name,this.schema)};if(e.type==="mark"){var r,i;(!((r=L(M(e,"keepOnSplit",t)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name),!((i=L(M(e,"clearable",t)))!==null&&i!==void 0)||i||this.nonClearableMarks.push(e.name)}const s=M(e,"onBeforeCreate",t),o=M(e,"onCreate",t),l=M(e,"onUpdate",t),a=M(e,"onSelectionUpdate",t),c=M(e,"onTransaction",t),u=M(e,"onFocus",t),d=M(e,"onBlur",t),f=M(e,"onDestroy",t);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),l&&this.editor.on("update",l),a&&this.editor.on("selectionUpdate",a),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}};Jr.resolve=mc;Jr.sort=sn;Jr.flatten=Ss;var W=class Dc extends Cs{constructor(...e){super(...e),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new Dc(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};const $m=W.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new $({key:new _("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,s=yc(t),{blockSeparator:o}=this.options,l={...o!==void 0?{blockSeparator:o}:{},textSerializers:s};return[...i.ranges].sort((a,c)=>a.$from.pos-c.$from.pos).map(({$from:a,$to:c})=>gc(r,{from:a.pos,to:c.pos},l)).join(o??` -`)}}})]}}),Km=W.create({name:"commands",addCommands(){return{...pm}}}),Um=W.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r;const i=()=>{var s,o,l;if((s=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0||(l=o.filterTransaction)===null||l===void 0?void 0:l.call(o,n))!==null&&s!==void 0?s:n.getMeta("y-sync$"))return;const a=yc(n.before,[n,...e]);Gr(a).forEach(u=>{a.mapping.mapResult(u.oldRange.from).deletedAfter&&a.mapping.mapResult(u.oldRange.to).deletedBefore&&a.before.nodesBetween(u.oldRange.from,u.oldRange.to,(d,f)=>{const h=f+d.nodeSize-2,p=u.oldRange.from<=f&&h<=u.oldRange.to;this.editor.emit("delete",{type:"node",node:d,from:f,to:h,newFrom:a.mapping.map(f),newTo:a.mapping.map(h),deletedRange:u.oldRange,newRange:u.newRange,partial:!p,editor:this.editor,transaction:n,combinedTransform:a})})});const c=a.mapping;a.steps.forEach((u,d)=>{if(u instanceof Ce){var f,h;const p=c.slice(d).map(u.from,-1),m=c.slice(d).map(u.to),g=c.invert().map(p,-1),y=c.invert().map(m),x=p>0?(f=a.doc.nodeAt(p-1))===null||f===void 0?void 0:f.marks.some(C=>C.eq(u.mark)):!1,S=(h=a.doc.nodeAt(m))===null||h===void 0?void 0:h.marks.some(C=>C.eq(u.mark));this.editor.emit("delete",{type:"mark",mark:u.mark,from:u.from,to:u.to,deletedRange:{from:g,to:y},newRange:{from:p,to:m},partial:!!(S||x),editor:this.editor,transaction:n,combinedTransform:a})}})};!((t=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&t!==void 0)||t?setTimeout(i,0):i()}}),_m=W.create({name:"drop",addProseMirrorPlugins(){return[new $({key:new U("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),qm=W.create({name:"editable",addProseMirrorPlugins(){return[new $({key:new U("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Jm=new U("focusEvents"),Gm=W.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new $({key:Jm,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}}}})]}}),Ym=W.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:h}=d,p=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,m=p.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&p.parent.childCount===1?g===d.pos:O.atStart(c).from===f;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!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 ar()||mc()?s:i},addProseMirrorPlugins(){return[new $({key:new U("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(h=>h.getMeta("composition")))return;const r=n.some(h=>h.docChanged)&&!e.doc.eq(t.doc),i=n.some(h=>h.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:l}=e.selection,a=O.atStart(e.doc).from,c=O.atEnd(e.doc).to;if(s||!(o===a&&l===c)||!Dn(t.doc))return;const u=t.tr,d=_r({state:t,transaction:u}),{commands:f}=new $t({editor:this.editor,state:d});if(f.clearNodes(),!!u.steps.length)return u}})]}}),Xm=W.create({name:"paste",addProseMirrorPlugins(){return[new $({key:new U("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Qm=W.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new $({key:new U("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!==null&&n!==void 0?n:"0"}}}})]}}),Zm=W.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=Kt(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new $({key:new U("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}});let sl=!1;function eg(n){if(sl)return;sl=!0;let e;try{e=H.fromJSON(n,{from:0,to:0}).slice.content}catch{return}e instanceof k||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var tg=class en{get name(){return this.node.type.name}constructor(e,t,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new en(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new en(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new en(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const i=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,o=t.isInline,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!i&&!o&&a.depth<=this.depth)return;const c=new en(a,this.editor,i,i||o?t:null);i&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(t).length>0){const s=i.node.attrs,o=Object.keys(t);for(let l=0;l{r&&i.length>0||(o.node.type.name===e&&s.every(l=>t[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,r))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};const ng=`.ProseMirror { +`)}}})]}}),Fm=W.create({name:"commands",addCommands(){return{...cm}}}),Vm=W.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r;const i=()=>{var s,o,l;if((s=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0||(l=o.filterTransaction)===null||l===void 0?void 0:l.call(o,n))!==null&&s!==void 0?s:n.getMeta("y-sync$"))return;const a=hc(n.before,[n,...e]);Ur(a).forEach(u=>{a.mapping.mapResult(u.oldRange.from).deletedAfter&&a.mapping.mapResult(u.oldRange.to).deletedBefore&&a.before.nodesBetween(u.oldRange.from,u.oldRange.to,(d,f)=>{const h=f+d.nodeSize-2,p=u.oldRange.from<=f&&h<=u.oldRange.to;this.editor.emit("delete",{type:"node",node:d,from:f,to:h,newFrom:a.mapping.map(f),newTo:a.mapping.map(h),deletedRange:u.oldRange,newRange:u.newRange,partial:!p,editor:this.editor,transaction:n,combinedTransform:a})})});const c=a.mapping;a.steps.forEach((u,d)=>{if(u instanceof we){var f,h;const p=c.slice(d).map(u.from,-1),m=c.slice(d).map(u.to),g=c.invert().map(p,-1),y=c.invert().map(m),x=p>0?(f=a.doc.nodeAt(p-1))===null||f===void 0?void 0:f.marks.some(C=>C.eq(u.mark)):!1,S=(h=a.doc.nodeAt(m))===null||h===void 0?void 0:h.marks.some(C=>C.eq(u.mark));this.editor.emit("delete",{type:"mark",mark:u.mark,from:u.from,to:u.to,deletedRange:{from:g,to:y},newRange:{from:p,to:m},partial:!!(S||x),editor:this.editor,transaction:n,combinedTransform:a})}})};!((t=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&t!==void 0)||t?setTimeout(i,0):i()}}),Hm=W.create({name:"drop",addProseMirrorPlugins(){return[new $({key:new _("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),jm=W.create({name:"editable",addProseMirrorPlugins(){return[new $({key:new _("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Wm=new _("focusEvents"),Km=W.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new $({key:Wm,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}}}})]}}),_m=W.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:h}=d,p=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,m=p.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&p.parent.childCount===1?g===d.pos:O.atStart(c).from===f;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!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 sr()||dc()?s:i},addProseMirrorPlugins(){return[new $({key:new _("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(h=>h.getMeta("composition")))return;const r=n.some(h=>h.docChanged)&&!e.doc.eq(t.doc),i=n.some(h=>h.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:l}=e.selection,a=O.atStart(e.doc).from,c=O.atEnd(e.doc).to;if(s||!(o===a&&l===c)||!On(t.doc))return;const u=t.tr,d=Wr({state:t,transaction:u}),{commands:f}=new Bt({editor:this.editor,state:d});if(f.clearNodes(),!!u.steps.length)return u}})]}}),Um=W.create({name:"paste",addProseMirrorPlugins(){return[new $({key:new _("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),qm=W.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new $({key:new _("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!==null&&n!==void 0?n:"0"}}}})]}}),Jm=W.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=jt(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new $({key:new _("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}});let tl=!1;function Gm(n){if(tl)return;tl=!0;let e;try{e=H.fromJSON(n,{from:0,to:0}).slice.content}catch{return}e instanceof k||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var Ym=class Qt{get name(){return this.node.type.name}constructor(e,t,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Qt(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Qt(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Qt(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const i=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,o=t.isInline,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!i&&!o&&a.depth<=this.depth)return;const c=new Qt(a,this.editor,i,i||o?t:null);i&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(t).length>0){const s=i.node.attrs,o=Object.keys(t);for(let l=0;l{r&&i.length>0||(o.node.type.name===e&&s.every(l=>t[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,r))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};const Xm=`.ProseMirror { position: relative; } @@ -93,20 +93,20 @@ img.ProseMirror-separator { .ProseMirror-focused .ProseMirror-gapcursor { display: block; -}`;var rg=class extends gm{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Wp,createMappablePosition:Kp},this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:t,slice:r,moved:i})=>this.options.onDrop(t,r,i)),this.on("paste",({event:t,slice:r})=>this.options.onPaste(t,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const t=Ki(e,this.options.autofocus);this.editorState=Be.create({doc:e,schema:this.schema,selection:t||void 0})}eg(this.schema),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const n=this.editorView.dom;n?.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():$t.createFakeChain()}can(){return this.commandManager?this.commandManager.can():$t.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Nm(ng,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=_i(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;t=t.filter(o=>!o.key.startsWith(s))}),e.length===t.length)return;const r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e;const t=[...this.options.enableCoreExtensions?[qm,Wm.configure({blockSeparator:(n=this.options.coreExtensionOptions)===null||n===void 0||(n=n.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),Km,Gm,Ym,Qm.configure({value:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.tabindex)===null||e===void 0?void 0:e.value}),_m,Xm,Um,Zm.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new Xr(t,this)}createCommandManager(){this.commandManager=new $t({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=Ui(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const t=Ui(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Be.create({doc:t,schema:this.schema,selection:Ki(t,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return n}getEditorViewAttributes(){var n;const e=(n=this.options.editorProps)===null||n===void 0?void 0:n.attributes;return _i(e)?t=>({role:"textbox",...e(t)}):{role:"textbox",...e}}createView(n){const{editorProps:e,enableExtensionDispatchTransaction:t}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=t?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new Za(n,{...e,attributes:this.getEditorViewAttributes(),dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(c)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),i=t.includes(n),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const o=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=o?.getMeta("focus"),a=o?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),a&&this.emit("blur",{editor:this,event:a.event,transaction:o}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return wc(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return Vp(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Es(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=` +}`;var Qm=class extends dm{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:$p,createMappablePosition:Fp},this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:t,slice:r,moved:i})=>this.options.onDrop(t,r,i)),this.on("paste",({event:t,slice:r})=>this.options.onPaste(t,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const t=Vi(e,this.options.autofocus);this.editorState=Pe.create({doc:e,schema:this.schema,selection:t||void 0})}Gm(this.schema),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const n=this.editorView.dom;n?.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Bt.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Bt.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Tm(Xm,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=ji(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;t=t.filter(o=>!o.key.startsWith(s))}),e.length===t.length)return;const r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e;const t=[...this.options.enableCoreExtensions?[jm,$m.configure({blockSeparator:(n=this.options.coreExtensionOptions)===null||n===void 0||(n=n.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),Fm,Km,_m,qm.configure({value:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.tabindex)===null||e===void 0?void 0:e.value}),Hm,Um,Vm,Jm.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new Jr(t,this)}createCommandManager(){this.commandManager=new Bt({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=Hi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const t=Hi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Pe.create({doc:t,schema:this.schema,selection:Vi(t,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return n}getEditorViewAttributes(){var n;const e=(n=this.options.editorProps)===null||n===void 0?void 0:n.attributes;return ji(e)?t=>({role:"textbox",...e(t)}):{role:"textbox",...e}}createView(n){const{editorProps:e,enableExtensionDispatchTransaction:t}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=t?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new Ga(n,{...e,attributes:this.getEditorViewAttributes(),dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(c)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),i=t.includes(n),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const o=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=o?.getMeta("focus"),a=o?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),a&&this.emit("blur",{editor:this,event:a.event,transaction:o}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return kc(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return Pp(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ws(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=` -`,textSerializers:t={}}=n||{};return Rp(this.state.doc,{blockSeparator:e,textSerializers:{...Sc(this.schema),...t}})}get isEmpty(){return Dn(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var n,e;return(n=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&n!==void 0?n:!0}$node(n,e){var t;return((t=this.$doc)===null||t===void 0?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)===null||t===void 0?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n),t=n>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new tg(e,this,!1,t)}get $doc(){return this.$pos(0)}};function Mt(n){return new In({find:n.find,handler:({state:e,range:t,match:r})=>{const i=L(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=t.from+l.indexOf(o),u=c+o.length;if(Yr(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===n.type&&h!==f.mark.type)).filter(f=>f.to>c).length)return null;ut.from&&s.delete(t.from+a,c);const d=t.from+a+o.length;s.addMark(t.from+a,d,n.type.create(i||{})),s.removeStoredMark(n.type)}},undoable:n.undoable})}function ig(n){return new In({find:n.find,handler:({state:e,range:t,match:r})=>{const i=L(n.getAttributes,void 0,r)||{},{tr:s}=e,o=t.from;let l=t.to;const a=n.type.create(i);if(r[1]){let c=o+r[0].lastIndexOf(r[1]);c>l?c=l:l=c+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,o+r[0].length-1),s.replaceWith(c,l,a)}else if(r[0]){const c=n.type.isInline?o:o-1;s.insert(c,n.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l))}s.scrollIntoView()},undoable:n.undoable})}function Ji(n){return new In({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=L(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)},undoable:n.undoable})}function Ut(n){return new In({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=L(n.getAttributes,void 0,r)||{},o=e.tr.delete(t.from,t.to),l=o.doc.resolve(t.from).blockRange(),a=l&&as(l,n.type,s);if(!a)return null;if(o.wrap(l,a),n.keepMarks&&n.editor){const{selection:u,storedMarks:d}=e,{splittableMarks:f}=n.editor.extensionManager,h=d||u.$to.parentOffset&&u.$from.marks();if(h){const p=h.filter(m=>f.includes(m.type.name));o.ensureMarks(p)}}if(n.keepAttributes){const u=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===n.type&&st(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,c))&&o.join(t.from-1)},undoable:n.undoable})}var pe=class Bc extends vs{constructor(...e){super(...e),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new Bc(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function it(n){return new Lc({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=L(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let c=t.to;if(l){const u=a.search(/\S/),d=t.from+a.indexOf(l),f=d+l.length;if(Yr(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(p=>p===n.type&&p!==h.mark.type)).filter(h=>h.to>d).length)return null;ft.from&&o.delete(t.from+u,d),c=t.from+u+l.length,o.addMark(t.from+u,c,n.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(n.type)}}})}const zc=new WeakSet,$c=new WeakSet;function at(n){const e=n;return zc.add(e),e}function Gi(n){return Array.isArray(n)&&zc.has(n)}function Fc(n){return n.flatMap(e=>e==null?[]:Array.isArray(e)&&$c.has(e)&&!Gi(e)?Fc(e):[e])}function sg(n,e){if(n==="slot")return 0;if(n instanceof Function){const i=n(e);return Array.isArray(i)&&!Gi(i)&&!$c.has(i)?at(i):i}const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(t)){if(Gi(t))return at([n,r,t]);if(t.length===0)return at([n,r]);const i=Fc(t);return i.length===0?at([n,r]):at([n,r,...i])}return t!=null?at([n,r,t]):at([n,r])}const cr=(n,e)=>sg(n,e),og=(n,e)=>{var t;const{state:r}=n,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0)return!1;const o=s.depth-1;if(o<0)return!1;const l=s.node(o),a=s.index(o);if(a===0)return!1;if(l.type===e)return n.commands.lift(e.name);const c=l.child(a-1);if(c.type!==e||!(!((t=c.lastChild)===null||t===void 0)&&t.isTextblock))return!1;const u=s.before()-1-1;return n.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;const h=s.parent.content,p=new w(h,0,0);return d.replace(u,s.after(),p),d.setSelection(v.create(d.doc,u+h.size)),d.scrollIntoView(),f(d),!0})},lg=/^\s*>\s$/,ag=pe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return cr("blockquote",{...J(this.options.HTMLAttributes,n),children:cr("slot",{})})},parseMarkdown:(n,e)=>{var t;const r=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;return e.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",r=[];return n.content.forEach((i,s)=>{var o,l;const a=((o=(l=e.renderChild)===null||l===void 0?void 0:l.call(e,i,s))!==null&&o!==void 0?o:e.renderChildren([i])).split(` +`,textSerializers:t={}}=n||{};return Ap(this.state.doc,{blockSeparator:e,textSerializers:{...yc(this.schema),...t}})}get isEmpty(){return On(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var n,e;return(n=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&n!==void 0?n:!0}$node(n,e){var t;return((t=this.$doc)===null||t===void 0?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)===null||t===void 0?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n),t=n>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new Ym(e,this,!1,t)}get $doc(){return this.$pos(0)}};function wt(n){return new Nn({find:n.find,handler:({state:e,range:t,match:r})=>{const i=L(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=t.from+l.indexOf(o),u=c+o.length;if(qr(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===n.type&&h!==f.mark.type)).filter(f=>f.to>c).length)return null;ut.from&&s.delete(t.from+a,c);const d=t.from+a+o.length;s.addMark(t.from+a,d,n.type.create(i||{})),s.removeStoredMark(n.type)}},undoable:n.undoable})}function Zm(n){return new Nn({find:n.find,handler:({state:e,range:t,match:r})=>{const i=L(n.getAttributes,void 0,r)||{},{tr:s}=e,o=t.from;let l=t.to;const a=n.type.create(i);if(r[1]){let c=o+r[0].lastIndexOf(r[1]);c>l?c=l:l=c+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,o+r[0].length-1),s.replaceWith(c,l,a)}else if(r[0]){const c=n.type.isInline?o:o-1;s.insert(c,n.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l))}s.scrollIntoView()},undoable:n.undoable})}function Ki(n){return new Nn({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=L(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)},undoable:n.undoable})}function Wt(n){return new Nn({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=L(n.getAttributes,void 0,r)||{},o=e.tr.delete(t.from,t.to),l=o.doc.resolve(t.from).blockRange(),a=l&&rs(l,n.type,s);if(!a)return null;if(o.wrap(l,a),n.keepMarks&&n.editor){const{selection:u,storedMarks:d}=e,{splittableMarks:f}=n.editor.extensionManager,h=d||u.$to.parentOffset&&u.$from.marks();if(h){const p=h.filter(m=>f.includes(m.type.name));o.ensureMarks(p)}}if(n.keepAttributes){const u=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===n.type&&rt(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,c))&&o.join(t.from-1)},undoable:n.undoable})}var he=class Ic extends Cs{constructor(...e){super(...e),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new Ic(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function nt(n){return new Nc({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=L(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let c=t.to;if(l){const u=a.search(/\S/),d=t.from+a.indexOf(l),f=d+l.length;if(qr(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(p=>p===n.type&&p!==h.mark.type)).filter(h=>h.to>d).length)return null;ft.from&&o.delete(t.from+u,d),c=t.from+u+l.length,o.addMark(t.from+u,c,n.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(n.type)}}})}const Rc=new WeakSet,Lc=new WeakSet;function ot(n){const e=n;return Rc.add(e),e}function _i(n){return Array.isArray(n)&&Rc.has(n)}function Pc(n){return n.flatMap(e=>e==null?[]:Array.isArray(e)&&Lc.has(e)&&!_i(e)?Pc(e):[e])}function eg(n,e){if(n==="slot")return 0;if(n instanceof Function){const i=n(e);return Array.isArray(i)&&!_i(i)&&!Lc.has(i)?ot(i):i}const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(t)){if(_i(t))return ot([n,r,t]);if(t.length===0)return ot([n,r]);const i=Pc(t);return i.length===0?ot([n,r]):ot([n,r,...i])}return t!=null?ot([n,r,t]):ot([n,r])}const or=(n,e)=>eg(n,e),tg=(n,e)=>{var t;const{state:r}=n,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0)return!1;const o=s.depth-1;if(o<0)return!1;const l=s.node(o),a=s.index(o);if(a===0)return!1;if(l.type===e)return n.commands.lift(e.name);const c=l.child(a-1);if(c.type!==e||!(!((t=c.lastChild)===null||t===void 0)&&t.isTextblock))return!1;const u=s.before()-1-1;return n.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;const h=s.parent.content,p=new w(h,0,0);return d.replace(u,s.after(),p),d.setSelection(v.create(d.doc,u+h.size)),d.scrollIntoView(),f(d),!0})},ng=/^\s*>\s$/,rg=he.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return or("blockquote",{...J(this.options.HTMLAttributes,n),children:or("slot",{})})},parseMarkdown:(n,e)=>{var t;const r=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;return e.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",r=[];return n.content.forEach((i,s)=>{var o,l;const a=((o=(l=e.renderChild)===null||l===void 0?void 0:l.call(e,i,s))!==null&&o!==void 0?o:e.renderChildren([i])).split(` `).map(c=>c.trim()===""?t:`${t} ${c}`);r.push(a.join(` `))}),r.join(` ${t} -`)},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(),Backspace:()=>og(this.editor,this.type)}},addInputRules(){return[Ut({find:lg,type:this.type})]}}),cg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ug=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,dg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,fg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,hg=Et.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return cr("strong",{...J(this.options.HTMLAttributes,n),children:cr("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,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[Mt({find:cg,type:this.type}),Mt({find:dg,type:this.type})]},addPasteRules(){return[it({find:ug,type:this.type}),it({find:fg,type:this.type})]}}),pg=n=>{const e=/`([^`]+)`(?!`)$/.exec(n);return!e||e.index>0&&n[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},mg=n=>{const e=/`([^`]+)`(?!`)/g,t=[];let r;for(;(r=e.exec(n))!==null;)r.index>0&&n[r.index-1]==="`"||t.push({index:r.index,text:r[0],replaceWith:r[1]});return t};function gg(n){const e=new Set((n.match(/`+/g)||[]).map(r=>r.length));let t=1;for(;e.has(t);)t+=1;return t}const yg=Et.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e,t)=>{var r;if(!n.content)return"";const i=typeof(t==null||(r=t.meta)===null||r===void 0?void 0:r.markText)=="string"?t.meta.markText:"",s="`".repeat(gg(i)),o=i.startsWith("`")||i.endsWith("`")?" ":"";return`${s}${o}${e.renderChildren(n.content)}${o}${s}`},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[Mt({find:pg,type:this.type})]},addPasteRules(){return[it({find:mg,type:this.type})]}}),bi=4,kg=/^```([a-z]+)?[\s\n]$/,bg=/^~~~([a-z]+)?[\s\n]$/,xg=pe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:bi,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const r=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(t)).map(i=>i.replace(t,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",J(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,r;return((t=n.raw)===null||t===void 0?void 0:t.startsWith("```"))===!1&&((r=n.raw)===null||r===void 0?void 0:r.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let r="";const i=((t=n.attrs)===null||t===void 0?void 0:t.language)||"";return n.content?r=[`\`\`\`${i}`,e.renderChildren(n.content),"```"].join(` +`)},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(),Backspace:()=>tg(this.editor,this.type)}},addInputRules(){return[Wt({find:ng,type:this.type})]}}),ig=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,sg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,og=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,lg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ag=Mt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return or("strong",{...J(this.options.HTMLAttributes,n),children:or("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,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[wt({find:ig,type:this.type}),wt({find:og,type:this.type})]},addPasteRules(){return[nt({find:sg,type:this.type}),nt({find:lg,type:this.type})]}}),cg=n=>{const e=/`([^`]+)`(?!`)$/.exec(n);return!e||e.index>0&&n[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},ug=n=>{const e=/`([^`]+)`(?!`)/g,t=[];let r;for(;(r=e.exec(n))!==null;)r.index>0&&n[r.index-1]==="`"||t.push({index:r.index,text:r[0],replaceWith:r[1]});return t};function dg(n){const e=new Set((n.match(/`+/g)||[]).map(r=>r.length));let t=1;for(;e.has(t);)t+=1;return t}const fg=Mt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e,t)=>{var r;if(!n.content)return"";const i=typeof(t==null||(r=t.meta)===null||r===void 0?void 0:r.markText)=="string"?t.meta.markText:"",s="`".repeat(dg(i)),o=i.startsWith("`")||i.endsWith("`")?" ":"";return`${s}${o}${e.renderChildren(n.content)}${o}${s}`},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[wt({find:cg,type:this.type})]},addPasteRules(){return[nt({find:ug,type:this.type})]}}),mi=4,hg=/^```([a-z]+)?[\s\n]$/,pg=/^~~~([a-z]+)?[\s\n]$/,mg=he.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:mi,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const r=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(t)).map(i=>i.replace(t,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",J(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,r;return((t=n.raw)===null||t===void 0?void 0:t.startsWith("```"))===!1&&((r=n.raw)===null||r===void 0?void 0:r.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let r="";const i=((t=n.attrs)===null||t===void 0?void 0:t.language)||"";return n.content?r=[`\`\`\`${i}`,e.renderChildren(n.content),"```"].join(` `):r=`\`\`\`${i} -\`\`\``,r},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},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!==null&&e!==void 0?e:bi,{state:r}=n,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(t);return o?n.commands.insertContent(l):n.commands.command(({tr:a})=>{const{from:c,to:u}=i,d=r.doc.textBetween(c,u,` +\`\`\``,r},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},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!==null&&e!==void 0?e:mi,{state:r}=n,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(t);return o?n.commands.insertContent(l):n.commands.command(({tr:a})=>{const{from:c,to:u}=i,d=r.doc.textBetween(c,u,` `,` `).split(` `).map(f=>l+f).join(` -`);return a.replaceWith(c,u,r.schema.text(d)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!==null&&e!==void 0?e:bi,{state:r}=n,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?n.commands.command(({tr:l})=>{var a;const{pos:c}=s,u=s.start(),d=s.end(),f=r.doc.textBetween(u,d,` +`);return a.replaceWith(c,u,r.schema.text(d)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!==null&&e!==void 0?e:mi,{state:r}=n,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?n.commands.command(({tr:l})=>{var a;const{pos:c}=s,u=s.start(),d=s.end(),f=r.doc.textBetween(u,d,` `,` `).split(` `);let h=0,p=0;const m=c-u;for(let S=0;S=m){h=S;break}p+=f[S].length+1}const g=((a=f[h].match(/^ */))===null||a===void 0?void 0:a[0])||"",y=Math.min(g.length,t);if(y===0)return!0;let x=u;for(let S=0;S{const{from:a,to:c}=i,u=r.doc.textBetween(a,c,` @@ -115,25 +115,25 @@ ${t} `).map(d=>{var f;const h=((f=d.match(/^ */))===null||f===void 0?void 0:f[0])||"",p=Math.min(h.length,t);return d.slice(p)}).join(` `);return l.replaceWith(a,c,r.schema.text(u)),!0})},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:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:n})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;const s=r.before();return s>0?!1:n.commands.insertDefaultBlock({pos:s})},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 o=i.after();return o===void 0?!1:r.nodeAt(o)?n.commands.command(({tr:l})=>(l.setSelection(O.near(r.resolve(o))),!0)):n.commands.exitCode()}}},addInputRules(){return[Ji({find:kg,type:this.type,getAttributes:n=>({language:n[1]})}),Ji({find:bg,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new $({key:new U("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,schema:l}=n.state,a=l.text(t.replace(/\r\n?/g,` -`));return o.replaceSelectionWith(this.type.create({language:s},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(v.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),Sg=pe.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`);return!s||!o?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:n})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;const s=r.before();return s>0?!1:n.commands.insertDefaultBlock({pos:s})},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 o=i.after();return o===void 0?!1:r.nodeAt(o)?n.commands.command(({tr:l})=>(l.setSelection(O.near(r.resolve(o))),!0)):n.commands.exitCode()}}},addInputRules(){return[Ki({find:hg,type:this.type,getAttributes:n=>({language:n[1]})}),Ki({find:pg,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new $({key:new _("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,schema:l}=n.state,a=l.text(t.replace(/\r\n?/g,` +`));return o.replaceSelectionWith(this.type.create({language:s},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(v.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),gg=he.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):""}),wg=pe.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",J(this.options.HTMLAttributes,n)]},renderText(){return` +`):""}),yg=he.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",J(this.options.HTMLAttributes,n)]},renderText(){return` `},renderMarkdown:()=>` -`,parseMarkdown:()=>({type:"hardBreak"}),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:l}=r.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Cg=pe.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]}`,J(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const r=!((t=n.attrs)===null||t===void 0)&&t.level?parseInt(n.attrs.level,10):1,i="#".repeat(r);return n.content?`${i} ${e.renderChildren(n.content)}`:""},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=>Ji({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),Mg=pe.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",J(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!Om(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,i=n();return Cc(t)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:l})=>{if(l){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(v.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(E.create(o.doc,a.pos)):o.setSelection(v.create(o.doc,a.pos));else{const u=s.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,d=u?.create();d&&(o.insert(c,d),o.setSelection(v.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ig({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Tg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Eg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,vg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Ag=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Og=Et.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",J(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)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Mt({find:Tg,type:this.type}),Mt({find:vg,type:this.type})]},addPasteRules(){return[it({find:Eg,type:this.type}),it({find:Ag,type:this.type})]}}),Ng="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Dg="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Yi="numeric",Xi="ascii",Qi="alpha",an="asciinumeric",tn="alphanumeric",Zi="domain",Vc="emoji",Ig="scheme",Rg="slashscheme",xi="whitespace";function Lg(n,e){return n in e||(e[n]=[]),e[n]}function ht(n,e,t){e[Yi]&&(e[an]=!0,e[tn]=!0),e[Xi]&&(e[an]=!0,e[Qi]=!0),e[an]&&(e[tn]=!0),e[Qi]&&(e[tn]=!0),e[tn]&&(e[Zi]=!0),e[Vc]&&(e[Zi]=!0);for(const r in e){const i=Lg(r,t);i.indexOf(n)<0&&i.push(n)}}function Pg(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function ce(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}ce.groups={};ce.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,i),V=(n,e,t,r,i)=>n.tr(e,t,r,i),ol=(n,e,t,r,i)=>n.ts(e,t,r,i),b=(n,e,t,r,i)=>n.tt(e,t,r,i),Le="WORD",es="UWORD",Hc="ASCIINUMERICAL",jc="ALPHANUMERICAL",Tn="LOCALHOST",ts="TLD",ns="UTLD",Yn="SCHEME",Pt="SLASH_SCHEME",As="NUM",rs="WS",Os="NL",cn="OPENBRACE",un="CLOSEBRACE",ur="OPENBRACKET",dr="CLOSEBRACKET",fr="OPENPAREN",hr="CLOSEPAREN",pr="OPENANGLEBRACKET",mr="CLOSEANGLEBRACKET",gr="FULLWIDTHLEFTPAREN",yr="FULLWIDTHRIGHTPAREN",kr="LEFTCORNERBRACKET",br="RIGHTCORNERBRACKET",xr="LEFTWHITECORNERBRACKET",Sr="RIGHTWHITECORNERBRACKET",wr="FULLWIDTHLESSTHAN",Cr="FULLWIDTHGREATERTHAN",Mr="AMPERSAND",Tr="APOSTROPHE",Er="ASTERISK",qe="AT",vr="BACKSLASH",Ar="BACKTICK",Or="CARET",pt="COLON",Ns="COMMA",Nr="DOLLAR",Ee="DOT",Dr="EQUALS",Ds="EXCLAMATION",ye="HYPHEN",dn="PERCENT",Ir="PIPE",Rr="PLUS",Lr="POUND",fn="QUERY",Is="QUOTE",Wc="FULLWIDTHMIDDLEDOT",Rs="SEMI",ve="SLASH",hn="TILDE",Pr="UNDERSCORE",Kc="EMOJI",Br="SYM";var Uc=Object.freeze({__proto__:null,ALPHANUMERICAL:jc,AMPERSAND:Mr,APOSTROPHE:Tr,ASCIINUMERICAL:Hc,ASTERISK:Er,AT:qe,BACKSLASH:vr,BACKTICK:Ar,CARET:Or,CLOSEANGLEBRACKET:mr,CLOSEBRACE:un,CLOSEBRACKET:dr,CLOSEPAREN:hr,COLON:pt,COMMA:Ns,DOLLAR:Nr,DOT:Ee,EMOJI:Kc,EQUALS:Dr,EXCLAMATION:Ds,FULLWIDTHGREATERTHAN:Cr,FULLWIDTHLEFTPAREN:gr,FULLWIDTHLESSTHAN:wr,FULLWIDTHMIDDLEDOT:Wc,FULLWIDTHRIGHTPAREN:yr,HYPHEN:ye,LEFTCORNERBRACKET:kr,LEFTWHITECORNERBRACKET:xr,LOCALHOST:Tn,NL:Os,NUM:As,OPENANGLEBRACKET:pr,OPENBRACE:cn,OPENBRACKET:ur,OPENPAREN:fr,PERCENT:dn,PIPE:Ir,PLUS:Rr,POUND:Lr,QUERY:fn,QUOTE:Is,RIGHTCORNERBRACKET:br,RIGHTWHITECORNERBRACKET:Sr,SCHEME:Yn,SEMI:Rs,SLASH:ve,SLASH_SCHEME:Pt,SYM:Br,TILDE:hn,TLD:ts,UNDERSCORE:Pr,UTLD:ns,UWORD:es,WORD:Le,WS:rs});const De=/[a-z]/,Yt=new RegExp("\\p{L}","u"),Si=new RegExp("\\p{Emoji}","u"),Ie=/\d/,wi=/\s/,ll="\r",Ci=` -`,Bg="️",zg="‍",Mi="";let Vn=null,Hn=null;function $g(n=[]){const e={};ce.groups=e;const t=new ce;Vn==null&&(Vn=al(Ng)),Hn==null&&(Hn=al(Dg)),b(t,"'",Tr),b(t,"{",cn),b(t,"}",un),b(t,"[",ur),b(t,"]",dr),b(t,"(",fr),b(t,")",hr),b(t,"<",pr),b(t,">",mr),b(t,"(",gr),b(t,")",yr),b(t,"「",kr),b(t,"」",br),b(t,"『",xr),b(t,"』",Sr),b(t,"<",wr),b(t,">",Cr),b(t,"&",Mr),b(t,"*",Er),b(t,"@",qe),b(t,"`",Ar),b(t,"^",Or),b(t,":",pt),b(t,",",Ns),b(t,"$",Nr),b(t,".",Ee),b(t,"=",Dr),b(t,"!",Ds),b(t,"-",ye),b(t,"%",dn),b(t,"|",Ir),b(t,"+",Rr),b(t,"#",Lr),b(t,"?",fn),b(t,'"',Is),b(t,"/",ve),b(t,";",Rs),b(t,"~",hn),b(t,"_",Pr),b(t,"\\",vr),b(t,"・",Wc);const r=V(t,Ie,As,{[Yi]:!0});V(r,Ie,r);const i=V(r,De,Hc,{[an]:!0}),s=V(r,Yt,jc,{[tn]:!0}),o=V(t,De,Le,{[Xi]:!0});V(o,Ie,i),V(o,De,o),V(i,Ie,i),V(i,De,i);const l=V(t,Yt,es,{[Qi]:!0});V(l,De),V(l,Ie,s),V(l,Yt,l),V(s,Ie,s),V(s,De),V(s,Yt,s);const a=b(t,Ci,Os,{[xi]:!0}),c=b(t,ll,rs,{[xi]:!0}),u=V(t,wi,rs,{[xi]:!0});b(t,Mi,u),b(c,Ci,a),b(c,Mi,u),V(c,wi,u),b(u,ll),b(u,Ci),V(u,wi,u),b(u,Mi,u);const d=V(t,Si,Kc,{[Vc]:!0});b(d,"#"),V(d,Si,d),b(d,Bg,d);const f=b(d,zg);b(f,"#"),V(f,Si,d);const h=[[De,o],[Ie,i]],p=[[De,null],[Yt,l],[Ie,s]];for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?x[Zi]=!0:De.test(g)?Ie.test(g)?x[an]=!0:x[Xi]=!0:x[Yi]=!0,ol(t,g,g,x)}return ol(t,"localhost",Tn,{ascii:!0}),t.jd=new ce(Br),{start:t,tokens:Object.assign({groups:e},Uc)}}function _c(n,e){const t=Fg(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let s=0,o=0;for(;o=0&&(d+=t[o].length,f++),c+=t[o].length,s+=t[o].length,o++;s-=d,o-=f,c-=d,i.push({t:u.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function Fg(n){const e=[],t=n.length;let r=0;for(;r56319||r+1===t||(s=n.charCodeAt(r+1))<56320||s>57343?n[r]:n.slice(r,r+2);e.push(o),r+=o.length}return e}function We(n,e,t,r,i){let s;const o=e.length;for(let l=0;l=0;)s++;if(s>0){e.push(t.join(""));for(let o=parseInt(n.substring(r,r+s),10);o>0;o--)t.pop();r+=s}else t.push(n[r]),r++}return e}const En={defaultProtocol:"http",events:null,format:cl,formatHref:cl,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ls(n,e=null){let t=Object.assign({},En);n&&(t=Object.assign(t,n instanceof Ls?n.o:n));const r=t.ignoreTags,i=[];for(let s=0;st?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=En.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),s=this.toFormattedString(n),o={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:i,attributes:o,content:s,eventListeners:d}}};function Qr(n,e){class t extends qc{constructor(i,s){super(i,s),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Vg=Qr("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ul=Qr("text"),Hg=Qr("nl"),jn=Qr("url",{isLink:!0,toHref(n=En.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Tn&&n[1].t===pt}}),ge=n=>new ce(n);function jg({groups:n}){const e=n.domain.concat([Mr,Er,qe,vr,Ar,Or,Nr,Dr,ye,As,dn,Ir,Rr,Lr,ve,Br,hn,Pr]),t=[Tr,pt,Ns,Ee,Ds,dn,fn,Is,Rs,pr,mr,cn,un,dr,ur,fr,hr,gr,yr,kr,br,xr,Sr,wr,Cr],r=[Mr,Tr,Er,vr,Ar,Or,Nr,Dr,ye,cn,un,dn,Ir,Rr,Lr,fn,ve,Br,hn,Pr],i=ge(),s=b(i,hn);N(s,r,s),N(s,n.domain,s);const o=ge(),l=ge(),a=ge();N(i,n.domain,o),N(i,n.scheme,l),N(i,n.slashscheme,a),N(o,r,s),N(o,n.domain,o);const c=b(o,qe);b(s,qe,c),b(l,qe,c),b(a,qe,c);const u=b(s,Ee);N(u,r,s),N(u,n.domain,s);const d=ge();N(c,n.domain,d),N(d,n.domain,d);const f=b(d,Ee);N(f,n.domain,d);const h=ge(Vg);N(f,n.tld,h),N(f,n.utld,h),b(c,Tn,h);const p=b(d,ye);b(p,ye,p),N(p,n.domain,d),N(h,n.domain,d),b(h,Ee,f),b(h,ye,p);const m=b(o,ye),g=b(o,Ee);b(m,ye,m),N(m,n.domain,o),N(g,r,s),N(g,n.domain,o);const y=ge(jn);N(g,n.tld,y),N(g,n.utld,y),N(y,n.domain,o),N(y,r,s),b(y,Ee,g),b(y,ye,m),b(y,qe,c);const x=b(y,pt),S=ge(jn);N(x,n.numeric,S);const C=ge(jn),I=ge();N(C,e,C),N(C,t,I),N(I,e,C),N(I,t,I),b(y,ve,C),b(S,ve,C);const F=b(l,pt),A=b(a,pt),R=b(A,ve),P=b(R,ve);N(l,n.domain,o),b(l,Ee,g),b(l,ye,m),N(a,n.domain,o),b(a,Ee,g),b(a,ye,m),N(F,n.domain,C),b(F,ve,C),b(F,fn,C),N(P,n.domain,C),N(P,e,C),b(P,ve,C);const X=[[cn,un],[ur,dr],[fr,hr],[pr,mr],[gr,yr],[kr,br],[xr,Sr],[wr,Cr]];for(let me=0;me=0&&f++,i++,u++;if(f<0)i-=u,i0&&(s.push(Ti(ul,e,o)),o=[]),i-=f,u-=f;const h=d.t,p=t.slice(i-u,i);s.push(Ti(h,e,p))}}return o.length>0&&s.push(Ti(ul,e,o)),s}function Ti(n,e,t){const r=t[0].s,i=t[t.length-1].e,s=e.slice(r,i);return new n(s,t)}const Kg=typeof console<"u"&&console&&console.warn||(()=>{}),Ug="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",z={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function _g(){return ce.groups={},z.scanner=null,z.parser=null,z.tokenQueue=[],z.pluginQueue=[],z.customSchemes=[],z.initialized=!1,z}function dl(n,e=!1){if(z.initialized&&Kg(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Ug}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. +`,parseMarkdown:()=>({type:"hardBreak"}),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:l}=r.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),kg=he.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]}`,J(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const r=!((t=n.attrs)===null||t===void 0)&&t.level?parseInt(n.attrs.level,10):1,i="#".repeat(r);return n.content?`${i} ${e.renderChildren(n.content)}`:""},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=>Ki({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),bg=he.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",J(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!Mm(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,i=n();return bc(t)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:l})=>{if(l){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(v.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(E.create(o.doc,a.pos)):o.setSelection(v.create(o.doc,a.pos));else{const u=s.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,d=u?.create();d&&(o.insert(c,d),o.setSelection(v.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Zm({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),xg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Sg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,wg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Cg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Mg=Mt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",J(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)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[wt({find:xg,type:this.type}),wt({find:wg,type:this.type})]},addPasteRules(){return[nt({find:Sg,type:this.type}),nt({find:Cg,type:this.type})]}}),Tg="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Eg="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ui="numeric",qi="ascii",Ji="alpha",on="asciinumeric",Zt="alphanumeric",Gi="domain",Bc="emoji",vg="scheme",Ag="slashscheme",gi="whitespace";function Og(n,e){return n in e||(e[n]=[]),e[n]}function dt(n,e,t){e[Ui]&&(e[on]=!0,e[Zt]=!0),e[qi]&&(e[on]=!0,e[Ji]=!0),e[on]&&(e[Zt]=!0),e[Ji]&&(e[Zt]=!0),e[Zt]&&(e[Gi]=!0),e[Bc]&&(e[Gi]=!0);for(const r in e){const i=Og(r,t);i.indexOf(n)<0&&i.push(n)}}function Ng(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function ae(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}ae.groups={};ae.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,i),V=(n,e,t,r,i)=>n.tr(e,t,r,i),nl=(n,e,t,r,i)=>n.ts(e,t,r,i),b=(n,e,t,r,i)=>n.tt(e,t,r,i),Re="WORD",Yi="UWORD",zc="ASCIINUMERICAL",$c="ALPHANUMERICAL",Cn="LOCALHOST",Xi="TLD",Qi="UTLD",Jn="SCHEME",Rt="SLASH_SCHEME",Ms="NUM",Zi="WS",Ts="NL",ln="OPENBRACE",an="CLOSEBRACE",lr="OPENBRACKET",ar="CLOSEBRACKET",cr="OPENPAREN",ur="CLOSEPAREN",dr="OPENANGLEBRACKET",fr="CLOSEANGLEBRACKET",hr="FULLWIDTHLEFTPAREN",pr="FULLWIDTHRIGHTPAREN",mr="LEFTCORNERBRACKET",gr="RIGHTCORNERBRACKET",yr="LEFTWHITECORNERBRACKET",kr="RIGHTWHITECORNERBRACKET",br="FULLWIDTHLESSTHAN",xr="FULLWIDTHGREATERTHAN",Sr="AMPERSAND",wr="APOSTROPHE",Cr="ASTERISK",Ue="AT",Mr="BACKSLASH",Tr="BACKTICK",Er="CARET",ft="COLON",Es="COMMA",vr="DOLLAR",Te="DOT",Ar="EQUALS",vs="EXCLAMATION",ge="HYPHEN",cn="PERCENT",Or="PIPE",Nr="PLUS",Dr="POUND",un="QUERY",As="QUOTE",Fc="FULLWIDTHMIDDLEDOT",Os="SEMI",Ee="SLASH",dn="TILDE",Ir="UNDERSCORE",Vc="EMOJI",Rr="SYM";var Hc=Object.freeze({__proto__:null,ALPHANUMERICAL:$c,AMPERSAND:Sr,APOSTROPHE:wr,ASCIINUMERICAL:zc,ASTERISK:Cr,AT:Ue,BACKSLASH:Mr,BACKTICK:Tr,CARET:Er,CLOSEANGLEBRACKET:fr,CLOSEBRACE:an,CLOSEBRACKET:ar,CLOSEPAREN:ur,COLON:ft,COMMA:Es,DOLLAR:vr,DOT:Te,EMOJI:Vc,EQUALS:Ar,EXCLAMATION:vs,FULLWIDTHGREATERTHAN:xr,FULLWIDTHLEFTPAREN:hr,FULLWIDTHLESSTHAN:br,FULLWIDTHMIDDLEDOT:Fc,FULLWIDTHRIGHTPAREN:pr,HYPHEN:ge,LEFTCORNERBRACKET:mr,LEFTWHITECORNERBRACKET:yr,LOCALHOST:Cn,NL:Ts,NUM:Ms,OPENANGLEBRACKET:dr,OPENBRACE:ln,OPENBRACKET:lr,OPENPAREN:cr,PERCENT:cn,PIPE:Or,PLUS:Nr,POUND:Dr,QUERY:un,QUOTE:As,RIGHTCORNERBRACKET:gr,RIGHTWHITECORNERBRACKET:kr,SCHEME:Jn,SEMI:Os,SLASH:Ee,SLASH_SCHEME:Rt,SYM:Rr,TILDE:dn,TLD:Xi,UNDERSCORE:Ir,UTLD:Qi,UWORD:Yi,WORD:Re,WS:Zi});const Ne=/[a-z]/,Jt=new RegExp("\\p{L}","u"),yi=new RegExp("\\p{Emoji}","u"),De=/\d/,ki=/\s/,rl="\r",bi=` +`,Dg="️",Ig="‍",xi="";let $n=null,Fn=null;function Rg(n=[]){const e={};ae.groups=e;const t=new ae;$n==null&&($n=il(Tg)),Fn==null&&(Fn=il(Eg)),b(t,"'",wr),b(t,"{",ln),b(t,"}",an),b(t,"[",lr),b(t,"]",ar),b(t,"(",cr),b(t,")",ur),b(t,"<",dr),b(t,">",fr),b(t,"(",hr),b(t,")",pr),b(t,"「",mr),b(t,"」",gr),b(t,"『",yr),b(t,"』",kr),b(t,"<",br),b(t,">",xr),b(t,"&",Sr),b(t,"*",Cr),b(t,"@",Ue),b(t,"`",Tr),b(t,"^",Er),b(t,":",ft),b(t,",",Es),b(t,"$",vr),b(t,".",Te),b(t,"=",Ar),b(t,"!",vs),b(t,"-",ge),b(t,"%",cn),b(t,"|",Or),b(t,"+",Nr),b(t,"#",Dr),b(t,"?",un),b(t,'"',As),b(t,"/",Ee),b(t,";",Os),b(t,"~",dn),b(t,"_",Ir),b(t,"\\",Mr),b(t,"・",Fc);const r=V(t,De,Ms,{[Ui]:!0});V(r,De,r);const i=V(r,Ne,zc,{[on]:!0}),s=V(r,Jt,$c,{[Zt]:!0}),o=V(t,Ne,Re,{[qi]:!0});V(o,De,i),V(o,Ne,o),V(i,De,i),V(i,Ne,i);const l=V(t,Jt,Yi,{[Ji]:!0});V(l,Ne),V(l,De,s),V(l,Jt,l),V(s,De,s),V(s,Ne),V(s,Jt,s);const a=b(t,bi,Ts,{[gi]:!0}),c=b(t,rl,Zi,{[gi]:!0}),u=V(t,ki,Zi,{[gi]:!0});b(t,xi,u),b(c,bi,a),b(c,xi,u),V(c,ki,u),b(u,rl),b(u,bi),V(u,ki,u),b(u,xi,u);const d=V(t,yi,Vc,{[Bc]:!0});b(d,"#"),V(d,yi,d),b(d,Dg,d);const f=b(d,Ig);b(f,"#"),V(f,yi,d);const h=[[Ne,o],[De,i]],p=[[Ne,null],[Jt,l],[De,s]];for(let m=0;m<$n.length;m++)je(t,$n[m],Xi,Re,h);for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?x[Gi]=!0:Ne.test(g)?De.test(g)?x[on]=!0:x[qi]=!0:x[Ui]=!0,nl(t,g,g,x)}return nl(t,"localhost",Cn,{ascii:!0}),t.jd=new ae(Rr),{start:t,tokens:Object.assign({groups:e},Hc)}}function jc(n,e){const t=Lg(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let s=0,o=0;for(;o=0&&(d+=t[o].length,f++),c+=t[o].length,s+=t[o].length,o++;s-=d,o-=f,c-=d,i.push({t:u.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function Lg(n){const e=[],t=n.length;let r=0;for(;r56319||r+1===t||(s=n.charCodeAt(r+1))<56320||s>57343?n[r]:n.slice(r,r+2);e.push(o),r+=o.length}return e}function je(n,e,t,r,i){let s;const o=e.length;for(let l=0;l=0;)s++;if(s>0){e.push(t.join(""));for(let o=parseInt(n.substring(r,r+s),10);o>0;o--)t.pop();r+=s}else t.push(n[r]),r++}return e}const Mn={defaultProtocol:"http",events:null,format:sl,formatHref:sl,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ns(n,e=null){let t=Object.assign({},Mn);n&&(t=Object.assign(t,n instanceof Ns?n.o:n));const r=t.ignoreTags,i=[];for(let s=0;st?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Mn.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),s=this.toFormattedString(n),o={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:i,attributes:o,content:s,eventListeners:d}}};function Gr(n,e){class t extends Wc{constructor(i,s){super(i,s),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Pg=Gr("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ol=Gr("text"),Bg=Gr("nl"),Vn=Gr("url",{isLink:!0,toHref(n=Mn.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Cn&&n[1].t===ft}}),me=n=>new ae(n);function zg({groups:n}){const e=n.domain.concat([Sr,Cr,Ue,Mr,Tr,Er,vr,Ar,ge,Ms,cn,Or,Nr,Dr,Ee,Rr,dn,Ir]),t=[wr,ft,Es,Te,vs,cn,un,As,Os,dr,fr,ln,an,ar,lr,cr,ur,hr,pr,mr,gr,yr,kr,br,xr],r=[Sr,wr,Cr,Mr,Tr,Er,vr,Ar,ge,ln,an,cn,Or,Nr,Dr,un,Ee,Rr,dn,Ir],i=me(),s=b(i,dn);N(s,r,s),N(s,n.domain,s);const o=me(),l=me(),a=me();N(i,n.domain,o),N(i,n.scheme,l),N(i,n.slashscheme,a),N(o,r,s),N(o,n.domain,o);const c=b(o,Ue);b(s,Ue,c),b(l,Ue,c),b(a,Ue,c);const u=b(s,Te);N(u,r,s),N(u,n.domain,s);const d=me();N(c,n.domain,d),N(d,n.domain,d);const f=b(d,Te);N(f,n.domain,d);const h=me(Pg);N(f,n.tld,h),N(f,n.utld,h),b(c,Cn,h);const p=b(d,ge);b(p,ge,p),N(p,n.domain,d),N(h,n.domain,d),b(h,Te,f),b(h,ge,p);const m=b(o,ge),g=b(o,Te);b(m,ge,m),N(m,n.domain,o),N(g,r,s),N(g,n.domain,o);const y=me(Vn);N(g,n.tld,y),N(g,n.utld,y),N(y,n.domain,o),N(y,r,s),b(y,Te,g),b(y,ge,m),b(y,Ue,c);const x=b(y,ft),S=me(Vn);N(x,n.numeric,S);const C=me(Vn),I=me();N(C,e,C),N(C,t,I),N(I,e,C),N(I,t,I),b(y,Ee,C),b(S,Ee,C);const F=b(l,ft),A=b(a,ft),R=b(A,Ee),P=b(R,Ee);N(l,n.domain,o),b(l,Te,g),b(l,ge,m),N(a,n.domain,o),b(a,Te,g),b(a,ge,m),N(F,n.domain,C),b(F,Ee,C),b(F,un,C),N(P,n.domain,C),N(P,e,C),b(P,Ee,C);const X=[[ln,an],[lr,ar],[cr,ur],[dr,fr],[hr,pr],[mr,gr],[yr,kr],[br,xr]];for(let pe=0;pe=0&&f++,i++,u++;if(f<0)i-=u,i0&&(s.push(Si(ol,e,o)),o=[]),i-=f,u-=f;const h=d.t,p=t.slice(i-u,i);s.push(Si(h,e,p))}}return o.length>0&&s.push(Si(ol,e,o)),s}function Si(n,e,t){const r=t[0].s,i=t[t.length-1].e,s=e.slice(r,i);return new n(s,t)}const Fg=typeof console<"u"&&console&&console.warn||(()=>{}),Vg="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",z={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Hg(){return ae.groups={},z.scanner=null,z.parser=null,z.tokenQueue=[],z.pluginQueue=[],z.customSchemes=[],z.initialized=!1,z}function ll(n,e=!1){if(z.initialized&&Fg(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Vg}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);z.customSchemes.push([n,e])}function qg(){z.scanner=$g(z.customSchemes);for(let n=0;nd.mark.type===t);if(!a.length)return;const{nodeAfter:c}=s;if(c&&a.some(d=>d.mark.isInSet(c.marks)))return;const u=n.storedMarks;n.removeMark(l,e.to,t),n.setStoredMarks(u),n.selection.empty&&n.selection.from===e.to&&n.removeStoredMark(t)}function Zg(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function ey(n){return new $({key:new U("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(a=>a.docChanged)&&!t.doc.eq(r.doc),s=e.some(a=>a.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,l=yc(t.doc,[...e]);if(!e.some(Lh)){const a=[];l.steps.forEach((c,u)=>{if(!(c instanceof H)||!c.slice.size)return;const d=l.mapping.slice(u+1),f=d.map(c.from,1),h=d.map(c.from+c.slice.size,-1);fu.to-c.to),a.forEach(c=>Qg(o,c,n.type))}if(Gr(l).forEach(({newRange:a})=>{const c=Ep(r.doc,a,f=>f.isTextblock);let u,d;if(c.length>1)u=c[0],d=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(c.length){const f=r.doc.textBetween(a.from,a.to," "," ");if(!Gg.test(f))return;u=c[0],d=r.doc.textBetween(u.pos,a.to,void 0," ")}if(u&&d){const f=d.split(Jg).filter(Boolean);if(f.length<=0)return!1;const h=f[f.length-1],p=u.pos+d.lastIndexOf(h);if(!h)return!1;const m=Ps(h).map(g=>g.toObject(n.defaultProtocol));if(!Zg(m))return!1;m.filter(g=>g.isLink).map(g=>({...g,from:p+g.start+1,to:p+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate(g.value)).filter(g=>n.shouldAutoLink(g.value)).forEach(g=>{Yr(g.from,g.to,r.doc).some(y=>y.mark.type===n.type)||o.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!o.steps.length)return o}})}function ty(n){return new $({key:new U("handleClickLink"),props:{handleClick:(e,t,r)=>{if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{const a=r.target;if(!a)return!1;const c=n.editor.view.dom;i=a.closest("a"),i&&!c.contains(i)&&(i=null)}if(!i)return!1;let s=!1;if(n.enableClickSelection&&(s=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){var o,l;const a=wc(e.state,n.type.name),c=(o=i.href)!==null&&o!==void 0?o:a.href,u=(l=i.target)!==null&&l!==void 0?l:a.target;c&&(window.open(c,u),s=!0)}return s}}})}const ny=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,ry=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Gc(n,e){let t=0;for(let r=e-1;r>=0&&n[r]==="\\";r-=1)t+=1;return t%2===1}function iy(n,e){let t=0,r=0;for(;r0}function Yc(n,e,t){var r,i;const[,s,o]=e;return(e.index?n[e.index-1]:void 0)==="!"||Gc(n,(r=e.index)!==null&&r!==void 0?r:0)||iy(n,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&t(o)}function Xc(n){var e,t;const[r,i,s,,o,l,a]=n,c=(e=o??l)!==null&&e!==void 0?e:a;return{index:(t=n.index)!==null&&t!==void 0?t:0,text:r,replaceWith:i,data:{href:s,title:c||null,markdown:!0}}}function sy(n,e){return n.index{const r=ny.exec(t);return!r||!Yc(t,r,n.isAllowedHref)?null:Xc(r)},type:n.type,getAttributes:Qc});return new In({find:e.find,handler:t=>{const r=e.handler(t);return r!==null&&t.state.tr.steps.length&&t.state.tr.setMeta("preventAutolink",!0),r}})}function ly(n){const e=it({find:t=>{var r,i;const s=[];for(const l of t.matchAll(ry))Yc(t,l,n.isAllowedHref)&&s.push(Xc(l));const o=((r=(i=n.findPlainUrls)===null||i===void 0?void 0:i.call(n,t))!==null&&r!==void 0?r:[]).filter(l=>!s.some(a=>sy(a,l)));return[...s,...o]},type:n.type,getAttributes:Qc});return new Lc({find:e.find,handler:t=>{var r;const i=e.handler(t);return i!==null&&t.state.tr.steps.length&&(!((r=t.match.data)===null||r===void 0)&&r.markdown)&&t.state.tr.setMeta("preventAutolink",!0),i}})}function ay(n){return new $({key:new U("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{shouldAutoLink:i}=n,{state:s}=e,{selection:o}=s,{empty:l}=o;if(l)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const c=Jc(a,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!c||i!==void 0&&!i(c.value)?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}function Re(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(Xg,"").match(new RegExp(`^(?:(?:${t.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const cy=Et.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){dl(n);return}dl(n.scheme,n.optionalSlashes)})},onDestroy(){_g()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Re(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const r=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){var n,e,t;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(n=this.options.HTMLAttributes.target)!==null&&n!==void 0?n:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(t=this.options.HTMLAttributes.class)!==null&&t!==void 0?t:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Re(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Re(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",J(this.options.HTMLAttributes,n),0]:["a",J(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,r,i,s;const o=(t=(r=n.attrs)===null||r===void 0?void 0:r.href)!==null&&t!==void 0?t:"",l=(i=(s=n.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"",a=e.renderChildren(n);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Re(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!Re(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[oy({type:this.type,isAllowedHref:n=>this.options.isAllowedUri(n,{defaultValidate:e=>!!Re(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const n=e=>{const t=[];if(e){const{protocols:r,defaultProtocol:i}=this.options;Jc(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Re(o,r),protocols:r,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&t.push({text:s.value,data:{href:s.href},index:s.start})})}return t};return this.options.markdownLinks?[ly({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!Re(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:n})]:[it({find:n,type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(ey({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Re(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(ty({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(ay({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),uy="listItem",fl="textStyle",hl=/^\s*([-+*])\s$/,Zc=pe.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",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(uy,this.editor.getAttributes(fl)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=Ut({find:hl,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Ut({find:hl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fl),editor:this.editor})),[n]}}),dy=(n,e,t)=>{const{selection:r}=n;if(!r.empty)return null;const{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let s=-1;for(let h=i.depth;h>0;h-=1)if(i.node(h).type.name===e){s=h;break}if(s<0)return null;const o=i.node(s),l=i.index(s);if(l+1>=o.childCount)return null;const a=o.child(l+1);if(!t.includes(a.type.name))return null;const c=n.schema.nodes[e];let u=!1;if(a.forEach(h=>{h.type===c&&h.childCount>1&&(u=!0)}),!u)return null;const d=n.doc.resolve(i.after()).nodeAfter;if(!d||!t.includes(d.type.name))return null;const f=[];return d.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:s,nestedList:d,nestedListPos:i.after(),insertPos:i.after(s),items:f}},fy=(n,e,t,r)=>{const i=dy(n,t,r);if(!i)return!1;const{selection:s}=n,{nestedList:o,nestedListPos:l,insertPos:a,items:c}=i,u=n.tr;u.delete(l,l+o.nodeSize);const d=u.mapping.map(a);return u.insert(d,k.from(c)),u.setSelection(s.map(u.doc,u.mapping)),e&&e(u),!0},hy=(n,e,t)=>fy(n.state,n.view.dispatch,e,t),eu=(n,e)=>W.create({name:`${n}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const t=()=>hy(this.editor,n,e);return{Delete:t,"Mod-Delete":t}}}),tu=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Wn="abcdefghijklmnopqrstuvwxyz",nu=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function ei(n){let e=n,t="";for(const[r,i]of tu)for(;e>=r;)t+=i,e-=r;return t}function Bs(n){return ei(n).toUpperCase()}function ru(n){const e=n.toLowerCase();let t=0,r=0;for(;t0?r:1}const t=parseInt(n,10);return Number.isNaN(t)?1:t}function gy(n,e){if(n==="numeric")return String(e);switch(n){case"a":return zr(e);case"A":return zr(e).toUpperCase();case"i":return ei(e);case"I":return Bs(e);default:return String(e)}}function yy(n){var e;if(n.length===0)return!1;const t=(e=ti(n[0]))!==null&&e!==void 0?e:"numeric",r=zs(n[0]);if(r<1)return!1;for(let i=0;i{var t;if(n.type!=="list_item")return[];const r=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;let i=[];if(n.tokens&&n.tokens.length>0){if(Sy(n))return{type:"listItem",content:[{type:"paragraph",content:wy(n.text||"",e)}]};if(n.tokens.some(s=>s.type==="paragraph"))i=r(n.tokens);else{const s=n.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(s.tokens)}],n.tokens.length>1){const o=r(n.tokens.slice(1));i.push(...o)}}else i=r(n.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(n,e,t)=>Dc(n,e,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){var i,s;const o=((i=r.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return xy((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,o-1+(r.index||0),". ")}return"- "},t,{alignNestedToPrefix:t?.parentType==="orderedList"}),addExtensions(){return[eu(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),$s=(n,e)=>{const{$from:t}=e.selection,r=q(n,e.schema);let i=null,s=t.depth,o=t.pos,l=null;for(;s>0&&l===null;)i=t.node(s),i.type===r?l=s:(s-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},su=(n,e)=>{const t=$s(n,e);if(!t)return!1;const[,r]=zp(e,n,t.$pos.pos+4);return r},Cy=(n,e,t)=>{const{$anchor:r}=n.selection,i=Math.max(0,r.pos-2),s=n.doc.resolve(i).node();return!(!s||!t.includes(s.type.name))},pl=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!He(n.state,e)&&Cy(n.state,e,t)){const{$anchor:s}=n.state.selection,o=n.state.doc.resolve(s.before()-1),l=[];o.node().descendants((u,d)=>{u.type.name===e&&l.push({node:u,pos:d})});const a=l.at(-1);if(!a)return!1;const c=n.state.doc.resolve(o.start()+a.pos+1);return n.chain().cut({from:s.start()-1,to:s.end()+1},c.end()).joinForward().run()}if(!He(n.state,e)||!jp(n.state))return!1;const{$from:r}=n.state.selection,i=r.depth-1;return r.node(i).type!==n.schema.nodes[e]||r.index(i)!==0?!1:n.chain().liftListItem(e).run()},My=(n,e)=>{const t=su(n,e),r=$s(n,e);return!r||!t?!1:t>r.depth},Ty=(n,e)=>{const t=su(n,e),r=$s(n,e);return!r||!t?!1:t{if(!He(n.state,e)||!Hp(n.state,e))return!1;const{selection:t}=n.state,{$from:r,$to:i}=t;return!t.empty&&r.sameParent(i)?!1:My(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():Ty(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},Ey=(n,e,t)=>{const{state:r}=n,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0||!s.parent.isTextblock||He(r,e))return!1;const o=$p(s);if(!o||!t.includes(o.type.name))return!1;const l=o.lastChild;if(!l||l.type.name!==e)return!1;const a=s.parent;if(!l.canReplace(l.childCount,l.childCount,k.from(a)))return!1;const c=s.before(),u=s.after(),d=c-2;return n.commands.command(({tr:f,dispatch:h})=>(h&&(f.delete(c,u).insert(d,k.from(a)),f.setSelection(v.create(f.doc,d+1)),f.scrollIntoView()),!0))},ou=W.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ml(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ml(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&pl(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&pl(n,t,r)&&(e=!0)}),e},Tab:({editor:n})=>{for(const{itemName:e,wrapperNames:t}of this.options.listTypes)if(n.state.schema.nodes[e]!==void 0&&Ey(n,e,t))return!0;return!1}}}}),$r=new RegExp(`^(\\s*)(${nu})([.)])\\s+(.*)$`),vy=/^\s/,Bt={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function Ay(n){return $r.test(n.trimStart())}function Oy(n){const e=n.trimStart();return Bt.bulletItem.test(e)||Ay(e)||Bt.heading.test(e)||Bt.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||Bt.codeFence.test(e)||Bt.blockMath.test(e)}function Ny(n){return Object.values(Bt).some(e=>e.test(n))}function Dy(n){const e=[],t=[];let r=!1;return n.forEach(i=>{if(r){t.push(i);return}if(i.trim()===""){r=!0,t.push(i);return}if(e.length>0&&Oy(i)){r=!0,t.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:t}}function gl(n){const e=[];let t=0,r=0;for(;td.mark.type===t);if(!a.length)return;const{nodeAfter:c}=s;if(c&&a.some(d=>d.mark.isInSet(c.marks)))return;const u=n.storedMarks;n.removeMark(l,e.to,t),n.setStoredMarks(u),n.selection.empty&&n.selection.from===e.to&&n.removeStoredMark(t)}function Jg(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function Gg(n){return new $({key:new _("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(a=>a.docChanged)&&!t.doc.eq(r.doc),s=e.some(a=>a.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,l=hc(t.doc,[...e]);if(!e.some(Oh)){const a=[];l.steps.forEach((c,u)=>{if(!(c instanceof H)||!c.slice.size)return;const d=l.mapping.slice(u+1),f=d.map(c.from,1),h=d.map(c.from+c.slice.size,-1);fu.to-c.to),a.forEach(c=>qg(o,c,n.type))}if(Ur(l).forEach(({newRange:a})=>{const c=Sp(r.doc,a,f=>f.isTextblock);let u,d;if(c.length>1)u=c[0],d=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(c.length){const f=r.doc.textBetween(a.from,a.to," "," ");if(!Kg.test(f))return;u=c[0],d=r.doc.textBetween(u.pos,a.to,void 0," ")}if(u&&d){const f=d.split(Wg).filter(Boolean);if(f.length<=0)return!1;const h=f[f.length-1],p=u.pos+d.lastIndexOf(h);if(!h)return!1;const m=Ds(h).map(g=>g.toObject(n.defaultProtocol));if(!Jg(m))return!1;m.filter(g=>g.isLink).map(g=>({...g,from:p+g.start+1,to:p+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate(g.value)).filter(g=>n.shouldAutoLink(g.value)).forEach(g=>{qr(g.from,g.to,r.doc).some(y=>y.mark.type===n.type)||o.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!o.steps.length)return o}})}function Yg(n){return new $({key:new _("handleClickLink"),props:{handleClick:(e,t,r)=>{if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{const a=r.target;if(!a)return!1;const c=n.editor.view.dom;i=a.closest("a"),i&&!c.contains(i)&&(i=null)}if(!i)return!1;let s=!1;if(n.enableClickSelection&&(s=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){var o,l;const a=kc(e.state,n.type.name),c=(o=i.href)!==null&&o!==void 0?o:a.href,u=(l=i.target)!==null&&l!==void 0?l:a.target;c&&(window.open(c,u),s=!0)}return s}}})}const Xg=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Qg=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function _c(n,e){let t=0;for(let r=e-1;r>=0&&n[r]==="\\";r-=1)t+=1;return t%2===1}function Zg(n,e){let t=0,r=0;for(;r0}function Uc(n,e,t){var r,i;const[,s,o]=e;return(e.index?n[e.index-1]:void 0)==="!"||_c(n,(r=e.index)!==null&&r!==void 0?r:0)||Zg(n,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&t(o)}function qc(n){var e,t;const[r,i,s,,o,l,a]=n,c=(e=o??l)!==null&&e!==void 0?e:a;return{index:(t=n.index)!==null&&t!==void 0?t:0,text:r,replaceWith:i,data:{href:s,title:c||null,markdown:!0}}}function ey(n,e){return n.index{const r=Xg.exec(t);return!r||!Uc(t,r,n.isAllowedHref)?null:qc(r)},type:n.type,getAttributes:Jc});return new Nn({find:e.find,handler:t=>{const r=e.handler(t);return r!==null&&t.state.tr.steps.length&&t.state.tr.setMeta("preventAutolink",!0),r}})}function ny(n){const e=nt({find:t=>{var r,i;const s=[];for(const l of t.matchAll(Qg))Uc(t,l,n.isAllowedHref)&&s.push(qc(l));const o=((r=(i=n.findPlainUrls)===null||i===void 0?void 0:i.call(n,t))!==null&&r!==void 0?r:[]).filter(l=>!s.some(a=>ey(a,l)));return[...s,...o]},type:n.type,getAttributes:Jc});return new Nc({find:e.find,handler:t=>{var r;const i=e.handler(t);return i!==null&&t.state.tr.steps.length&&(!((r=t.match.data)===null||r===void 0)&&r.markdown)&&t.state.tr.setMeta("preventAutolink",!0),i}})}function ry(n){return new $({key:new _("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{shouldAutoLink:i}=n,{state:s}=e,{selection:o}=s,{empty:l}=o;if(l)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const c=Kc(a,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!c||i!==void 0&&!i(c.value)?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}function Ie(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(Ug,"").match(new RegExp(`^(?:(?:${t.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const iy=Mt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){ll(n);return}ll(n.scheme,n.optionalSlashes)})},onDestroy(){Hg()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Ie(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const r=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){var n,e,t;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(n=this.options.HTMLAttributes.target)!==null&&n!==void 0?n:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(t=this.options.HTMLAttributes.class)!==null&&t!==void 0?t:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Ie(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Ie(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",J(this.options.HTMLAttributes,n),0]:["a",J(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,r,i,s;const o=(t=(r=n.attrs)===null||r===void 0?void 0:r.href)!==null&&t!==void 0?t:"",l=(i=(s=n.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"",a=e.renderChildren(n);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Ie(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!Ie(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[ty({type:this.type,isAllowedHref:n=>this.options.isAllowedUri(n,{defaultValidate:e=>!!Ie(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const n=e=>{const t=[];if(e){const{protocols:r,defaultProtocol:i}=this.options;Kc(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Ie(o,r),protocols:r,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&t.push({text:s.value,data:{href:s.href},index:s.start})})}return t};return this.options.markdownLinks?[ny({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!Ie(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:n})]:[nt({find:n,type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(Gg({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Ie(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(Yg({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(ry({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),sy="listItem",al="textStyle",cl=/^\s*([-+*])\s$/,Gc=he.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",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(sy,this.editor.getAttributes(al)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=Wt({find:cl,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Wt({find:cl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(al),editor:this.editor})),[n]}}),oy=(n,e,t)=>{const{selection:r}=n;if(!r.empty)return null;const{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let s=-1;for(let h=i.depth;h>0;h-=1)if(i.node(h).type.name===e){s=h;break}if(s<0)return null;const o=i.node(s),l=i.index(s);if(l+1>=o.childCount)return null;const a=o.child(l+1);if(!t.includes(a.type.name))return null;const c=n.schema.nodes[e];let u=!1;if(a.forEach(h=>{h.type===c&&h.childCount>1&&(u=!0)}),!u)return null;const d=n.doc.resolve(i.after()).nodeAfter;if(!d||!t.includes(d.type.name))return null;const f=[];return d.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:s,nestedList:d,nestedListPos:i.after(),insertPos:i.after(s),items:f}},ly=(n,e,t,r)=>{const i=oy(n,t,r);if(!i)return!1;const{selection:s}=n,{nestedList:o,nestedListPos:l,insertPos:a,items:c}=i,u=n.tr;u.delete(l,l+o.nodeSize);const d=u.mapping.map(a);return u.insert(d,k.from(c)),u.setSelection(s.map(u.doc,u.mapping)),e&&e(u),!0},ay=(n,e,t)=>ly(n.state,n.view.dispatch,e,t),Yc=(n,e)=>W.create({name:`${n}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const t=()=>ay(this.editor,n,e);return{Delete:t,"Mod-Delete":t}}}),Xc=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Hn="abcdefghijklmnopqrstuvwxyz",Qc=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function Xr(n){let e=n,t="";for(const[r,i]of Xc)for(;e>=r;)t+=i,e-=r;return t}function Is(n){return Xr(n).toUpperCase()}function Zc(n){const e=n.toLowerCase();let t=0,r=0;for(;t0?r:1}const t=parseInt(n,10);return Number.isNaN(t)?1:t}function dy(n,e){if(n==="numeric")return String(e);switch(n){case"a":return Lr(e);case"A":return Lr(e).toUpperCase();case"i":return Xr(e);case"I":return Is(e);default:return String(e)}}function fy(n){var e;if(n.length===0)return!1;const t=(e=Qr(n[0]))!==null&&e!==void 0?e:"numeric",r=Rs(n[0]);if(r<1)return!1;for(let i=0;i{var t;if(n.type!=="list_item")return[];const r=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;let i=[];if(n.tokens&&n.tokens.length>0){if(gy(n))return{type:"listItem",content:[{type:"paragraph",content:yy(n.text||"",e)}]};if(n.tokens.some(s=>s.type==="paragraph"))i=r(n.tokens);else{const s=n.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(s.tokens)}],n.tokens.length>1){const o=r(n.tokens.slice(1));i.push(...o)}}else i=r(n.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(n,e,t)=>vc(n,e,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){var i,s;const o=((i=r.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return my((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,o-1+(r.index||0),". ")}return"- "},t,{alignNestedToPrefix:t?.parentType==="orderedList"}),addExtensions(){return[Yc(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ls=(n,e)=>{const{$from:t}=e.selection,r=q(n,e.schema);let i=null,s=t.depth,o=t.pos,l=null;for(;s>0&&l===null;)i=t.node(s),i.type===r?l=s:(s-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},tu=(n,e)=>{const t=Ls(n,e);if(!t)return!1;const[,r]=Ip(e,n,t.$pos.pos+4);return r},ky=(n,e,t)=>{const{$anchor:r}=n.selection,i=Math.max(0,r.pos-2),s=n.doc.resolve(i).node();return!(!s||!t.includes(s.type.name))},ul=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!Ve(n.state,e)&&ky(n.state,e,t)){const{$anchor:s}=n.state.selection,o=n.state.doc.resolve(s.before()-1),l=[];o.node().descendants((u,d)=>{u.type.name===e&&l.push({node:u,pos:d})});const a=l.at(-1);if(!a)return!1;const c=n.state.doc.resolve(o.start()+a.pos+1);return n.chain().cut({from:s.start()-1,to:s.end()+1},c.end()).joinForward().run()}if(!Ve(n.state,e)||!zp(n.state))return!1;const{$from:r}=n.state.selection,i=r.depth-1;return r.node(i).type!==n.schema.nodes[e]||r.index(i)!==0?!1:n.chain().liftListItem(e).run()},by=(n,e)=>{const t=tu(n,e),r=Ls(n,e);return!r||!t?!1:t>r.depth},xy=(n,e)=>{const t=tu(n,e),r=Ls(n,e);return!r||!t?!1:t{if(!Ve(n.state,e)||!Bp(n.state,e))return!1;const{selection:t}=n.state,{$from:r,$to:i}=t;return!t.empty&&r.sameParent(i)?!1:by(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():xy(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},Sy=(n,e,t)=>{const{state:r}=n,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0||!s.parent.isTextblock||Ve(r,e))return!1;const o=Rp(s);if(!o||!t.includes(o.type.name))return!1;const l=o.lastChild;if(!l||l.type.name!==e)return!1;const a=s.parent;if(!l.canReplace(l.childCount,l.childCount,k.from(a)))return!1;const c=s.before(),u=s.after(),d=c-2;return n.commands.command(({tr:f,dispatch:h})=>(h&&(f.delete(c,u).insert(d,k.from(a)),f.setSelection(v.create(f.doc,d+1)),f.scrollIntoView()),!0))},nu=W.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&dl(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&dl(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&ul(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&ul(n,t,r)&&(e=!0)}),e},Tab:({editor:n})=>{for(const{itemName:e,wrapperNames:t}of this.options.listTypes)if(n.state.schema.nodes[e]!==void 0&&Sy(n,e,t))return!0;return!1}}}}),Pr=new RegExp(`^(\\s*)(${Qc})([.)])\\s+(.*)$`),wy=/^\s/,Lt={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function Cy(n){return Pr.test(n.trimStart())}function My(n){const e=n.trimStart();return Lt.bulletItem.test(e)||Cy(e)||Lt.heading.test(e)||Lt.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||Lt.codeFence.test(e)||Lt.blockMath.test(e)}function Ty(n){return Object.values(Lt).some(e=>e.test(n))}function Ey(n){const e=[],t=[];let r=!1;return n.forEach(i=>{if(r){t.push(i);return}if(i.trim()===""){r=!0,t.push(i);return}if(e.length>0&&My(i)){r=!0,t.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:t}}function fl(n){const e=[];let t=0,r=0;for(;tr.trim().length>0);if(e.length===0)return null;const t=[];for(const r of e){const i=r.trim().match(Iy);if(!i)return null;t.push({marker:i[1],content:i[3]})}return yy(t.map(r=>r.marker))?{type:"orderedList",attrs:by(t[0].marker),content:t.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function lu(n,e,t){const r=[];let i=0;for(;ir.trim().length>0);if(e.length===0)return null;const t=[];for(const r of e){const i=r.trim().match(vy);if(!i)return null;t.push({marker:i[1],content:i[3]})}return fy(t.map(r=>r.marker))?{type:"orderedList",attrs:py(t[0].marker),content:t.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function ru(n,e,t){const r=[];let i=0;for(;ie;)f.push(n[d]),d+=1;if(f.length>0){const h=lu(f,Math.min(...f.map(p=>p.indent)),t);c.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:h,raw:f.map(p=>p.raw).join(` -`)})}r.push({type:"list_item",raw:s.raw,tokens:c}),i=d}else i+=1}return r}function Ly(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const r=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}const Py=64;function yl(n,e){const t=[];let r=0;for(;t.lengthn.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>{const e=n.getAttribute("type");if(e)return e;const t=n.getAttribute("style");if(t){const i=xl(t);if(i)return i}const r=n.querySelector("li");if(r){const i=r.getAttribute("style");if(i){const s=xl(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,type:t,...r}=n,i=J(this.options.HTMLAttributes,r);return e!==1&&(i.start=e),t&&t!=="1"&&(i.type=t),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,r=n.typeMarker,i=n.items?Ly(n.items,e):[],s={};return t!==1&&(s.start=t),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:i}:{type:"orderedList",content:i}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(n,e,t)=>{var r,i;const[s,o,l]=By(n);if(s.length===0)return;const a=lu(s,s[0].indent,t);if(a.length!==0)return{type:"list",ordered:!0,start:((r=s[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(i=s[0])===null||i===void 0?void 0:i.type,items:a,raw:l.slice(0,o).join(` -`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zy,this.editor.getAttributes(kl)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new $({props:{handlePaste:(n,e)=>{var t,r;const i=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/html");if(i?.trim())return!1;const s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s)return!1;const o=Ry(s);if(!o)return!1;try{const l=n.state.schema.nodeFromJSON(o),a=n.state.tr.replaceSelectionWith(l);return n.dispatch(a),!0}catch{return!1}}}})]},addInputRules(){const n=(t,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+t[1];let e=Ut({find:bl,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:n});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ut({find:bl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(kl)}),joinPredicate:n,editor:this.editor})),[e]}}),$y=/^\s*(\[([( |x])?\])\s$/,Fy="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",Vy=(n,e,t)=>{var r;return(t==null||(r=t.checkboxLabel)===null||r===void 0?void 0:r.call(t,n,e))||`Task item checkbox for ${n.textContent||"empty task item"}`},Hy=pe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:n=>{var e;return(e=n.querySelector("div"))!==null&&e!==void 0?e:n}}]},renderHTML({node:n,HTMLAttributes:e}){return["li",J(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const r=`- [${!((t=n.attrs)===null||t===void 0)&&t.checked?"x":" "}] `;return Dc(n,e,r)},addExtensions(){return this.options.nested?[eu(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");o.style.cssText=Fy;const c=d=>{const f=Vy(d,d.attrs.checked,this.options.a11y);l.setAttribute("aria-label",f),o.textContent=f};c(n),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",d=>d.preventDefault()),l.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=t();if(typeof p!="number")return!1;const m=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...m?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,s.append(l,o),i.append(s,a),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)});let u=new Set(Object.keys(e));return{dom:i,contentDOM:a,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,l.checked=d.attrs.checked,c(d);const f=r.extensionManager.attributes,h=Mn(d,f),p=new Set(Object.keys(h)),m=this.options.HTMLAttributes;return u.forEach(g=>{p.has(g)||(g in m?i.setAttribute(g,m[g]):i.removeAttribute(g))}),Object.entries(h).forEach(([g,y])=>{y==null?g in m?i.setAttribute(g,m[g]):i.removeAttribute(g):i.setAttribute(g,y)}),u=p,!0}}}},addInputRules(){return[Ut({find:$y,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),jy=pe.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",J(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=s=>{const o=nl(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},t);if(o){const l={type:"taskList",raw:o.raw,items:o.items},a=s.slice(o.raw.length);return a.trim()?[l,...t.blockTokens(a)]:[l]}return t.blockTokens(s)},i=nl(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:t.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});W.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(Zc.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(iu.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(ou.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(au.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(Hy.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(jy.configure(this.options.taskList)),n}});const Kn=" ",Ei=" ",Wy=pe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",J(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const r=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Kn||t[0].text===Kn||t[0].raw===Ei||t[0].text===Ei)&&r.length===1&&r[0].type==="text"&&(r[0].text===Kn||r[0].text===Ei)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(n,e,t)=>{if(!n)return"";const r=Array.isArray(n.content)?n.content:[];if(r.length===0){var i,s;const o=Array.isArray(t==null||(i=t.previousNode)===null||i===void 0?void 0:i.content)?t.previousNode.content:[];return(t==null||(s=t.previousNode)===null||s===void 0?void 0:s.type)==="paragraph"&&o.length===0?Kn:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ky=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Uy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_y=Et.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",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Mt({find:Ky,type:this.type})]},addPasteRules(){return[it({find:Uy,type:this.type})]}}),qy=pe.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),Jy=Et.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",J(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Gy(n={}){return new $({view(e){return new Yy(e,n)}})}class Yy{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,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.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else 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,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(t){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),m=d?p.bottom:p.top;d&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.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 c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,h=d.height/a.offsetHeight;c=d.left-a.scrollLeft*f,u=d.top-a.scrollTop*h}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){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)return null;let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Yl(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class j extends O{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return j.valid(r)?new j(r):O.near(r)}content(){return w.empty}eq(e){return e instanceof j&&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 j(e.resolve(t.pos))}getBookmark(){return new Fs(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Xy(e)||!Qy(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&&j.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){s=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let a=e.doc.resolve(i);if(j.valid(a))return a}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!E.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),r=!1;continue e}break}s=o,i+=t;let l=e.doc.resolve(i);if(j.valid(l))return l}return null}}}j.prototype.visible=!1;j.findFrom=j.findGapCursorFrom;O.jsonID("gapcursor",j);class Fs{constructor(e){this.pos=e}map(e){return new Fs(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return j.valid(t)?new j(t):O.near(t)}}function cu(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function Xy(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||cu(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Qy(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||cu(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Zy(){return new $({props:{decorations:r0,createSelectionBetween(n,e,t){return e.pos==t.pos&&j.valid(t)?new j(t):null},handleClick:t0,handleKeyDown:e0,handleDOMEvents:{beforeinput:n0}}})}const e0=ec({ArrowLeft:Un("horiz",-1),ArrowRight:Un("horiz",1),ArrowUp:Un("vert",-1),ArrowDown:Un("vert",1)});function Un(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof v){if(!s.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=j.findGapCursorFrom(l,e,a);return c?(i&&i(r.tr.setSelection(new j(c))),!0):!1}}function t0(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!j.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&E.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new j(r))),!0)}function n0(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof j))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=k.empty;for(let o=r.length-1;o>=0;o--)i=k.from(r[o].createAndFill(null,i));let s=n.state.tr.replace(t.pos,t.pos,new w(i,0,0));return s.setSelection(v.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function r0(n){if(!(n.selection instanceof j))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",D.create(n.doc,[oe.widget(n.selection.head,e,{key:"gapcursor"})])}W.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new $({key:new U("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const i=this.options.limit,s=this.options.autoTrim;if(i==null||i===0||s===!1){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const l=o-i,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,l=o-(s-r),a=o;return e.deleteRange(l,a),!(this.storage.characters({node:e.doc})>r)}})]}});const i0=W.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Gy(this.options)]}});W.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new $({key:new U("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!t||!r)return D.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(!a.isText){if(!(i>=c&&i<=c+a.nodeSize-1))return!1;o+=1}});let l=0;return n.descendants((a,c)=>{if(a.isText||!(i>=c&&i<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(oe.node(c,c+a.nodeSize,{class:this.options.className}))}),D.create(n,s)}}})]}});const s0=W.create({name:"gapCursor",addProseMirrorPlugins(){return[Zy()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=L(M(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),uu="placeholder",Sl=new U("tiptap__placeholder");function du(n){const{editor:e,placeholder:t,dataAttribute:r,pos:i,node:s,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=n,u=[a];return o&&u.push(c),oe.node(i,i+s.nodeSize,{class:u.join(" "),[r]:typeof t=="function"?t({editor:e,node:s,pos:i,hasAnchor:l}):t})}function fu(n,e){return typeof n=="function"?n(e):n}function hu({editor:n,options:e,dataAttribute:t,doc:r,selection:i,from:s,to:o}){const{anchor:l}=i,a=[],c=n.isEmpty;return r.nodesBetween(s,o,(u,d)=>{const f=l>=d&&l<=d+u.nodeSize,h=!u.isLeaf&&Dn(u);return u.type.isTextblock&&(f||!e.showOnlyCurrent)&&h&&a.push(du({editor:n,isEmptyDoc:c,dataAttribute:t,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:fu(e.emptyNodeClass,{editor:n,node:u,pos:d,hasAnchor:f})},node:u,pos:d})),e.includeChildren}),a}function pu({editor:n,options:e,dataAttribute:t,doc:r,selection:i}){if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:s}=i,o=[],l=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const a=r.resolve(s),c=a.depth>0?a.node(1):a.nodeAfter,u=a.depth>0?a.before(1):s;if(c&&c.type.isTextblock&&Dn(c)){const d=s>=u&&s<=u+c.nodeSize;o.push(du({editor:n,isEmptyDoc:l,dataAttribute:t,hasAnchor:d,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:fu(e.emptyNodeClass,{editor:n,node:c,pos:u,hasAnchor:d})},node:c,pos:u}))}}else o.push(...hu({editor:n,options:e,dataAttribute:t,doc:r,selection:i,from:0,to:r.content.size}));return D.create(r,o)}function pn(n,e){const t=n.resolve(e);if(t.depth===0){var r;const s=(r=t.nodeAfter)!==null&&r!==void 0?r:t.nodeBefore;if(!s)return{from:e,to:e};const o=t.nodeAfter?e:e-s.nodeSize;return{from:o,to:o+s.nodeSize}}const i=t.before(1);return{from:i,to:i+t.node(1).nodeSize}}function mn(n,e){return{from:Math.max(0,e.from-1),to:Math.min(n.content.size,e.to-1)}}function o0(n,e,t){const r=[];return n.forEach((i,s)=>{const o=s,l=o+i.nodeSize,a=o+1,c=l+1;ae&&r.push({from:o,to:l})}),r}function l0(n){if(n.length===0)return[];const e=[...n].sort((r,i)=>r.from-i.from),t=[{...e[0]}];for(let r=1;re.from?t.push(mn(n,pn(n,Math.min(e.to,n.content.size+1)-1))):e.fromh.from>=c&&h.to<=u);d.length&&(l=l.remove(d));const f=hu({editor:t,options:r,dataAttribute:i,doc:s,selection:o,from:c,to:u});f.length&&(l=l.add(s,f))}return l}function f0({editor:n,options:e,dataAttribute:t}){return{init(r,i){const s=pu({editor:n,options:e,dataAttribute:t,doc:i.doc,selection:i.selection});return s??D.empty},apply(r,i,s,o){return!r.docChanged&&!r.selectionSet?i:d0({decorations:i.map(r.mapping,r.doc),ranges:c0(r,s,o),editor:n,options:e,dataAttribute:t,doc:o.doc,selection:o.selection})}}}function h0(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function p0({editor:n,options:e}){const t=e.dataAttribute?`data-${h0(e.dataAttribute)}`:`data-${uu}`,r=e.showOnlyCurrent&&!e.includeChildren;return new $({key:Sl,...r?{}:{state:f0({editor:n,options:e,dataAttribute:t})},props:{decorations:r?({doc:i,selection:s})=>pu({editor:n,options:e,dataAttribute:t,doc:i,selection:s}):i=>{var s;return e.showOnlyWhenEditable&&!n.isEditable?D.empty:(s=Sl.getState(i))!==null&&s!==void 0?s:D.empty}}})}W.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:uu,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[p0({editor:this.editor,options:this.options})]}});function is(n,e){return!n.selection.empty&&!Cc(n.selection)&&e.isEditable}function m0(n,e){return is(n,e)&&!e.isFocused&&!e.view.dragging}function g0(){var n;(n=window.getSelection())===null||n===void 0||n.removeAllRanges()}function y0(n){n.focus()}W.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new $({key:new U("selection"),props:{decorations(t){return m0(t,n)?D.create(t.doc,[oe.inline(t.selection.from,t.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(t){return is(t.state,n)&&g0(),!1},focus(t){return is(t.state,n)&&requestAnimationFrame(()=>{!n.isDestroyed&&t.hasFocus()&&y0(t)}),!1}}}})]}});function wl({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}const k0=W.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new U(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)===null||n===void 0?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new $({key:e,appendTransaction:(i,s,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),d=l.content.size,f=c.nodes[t];if(!i.some(h=>h.getMeta("skipTrailingNode"))&&u)return a.insert(d,f.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!wl({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!wl({node:o,types:r})}}})]}}),b0=W.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>ic(n,e),redo:()=>({state:n,dispatch:e})=>sc(n,e)}},addProseMirrorPlugins(){return[Rh(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),x0=W.create({name:"starterKit",addExtensions(){const n=[];if(this.options.bold!==!1&&n.push(hg.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(ag.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(Zc.configure(this.options.bulletList)),this.options.code!==!1&&n.push(yg.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(xg.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(Sg.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(i0.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(s0.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(wg.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(Cg.configure(this.options.heading)),this.options.undoRedo!==!1&&n.push(b0.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&n.push(Mg.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(Og.configure(this.options.italic)),this.options.listItem!==!1&&n.push(iu.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;n.push(ou.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var t;n.push(cy.configure((t=this.options)===null||t===void 0?void 0:t.link))}if(this.options.orderedList!==!1&&n.push(au.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push(Wy.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(_y.configure(this.options.strike)),this.options.text!==!1&&n.push(qy.configure(this.options.text)),this.options.underline!==!1){var r;n.push(Jy.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var i;n.push(k0.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return n}});var S0=x0;function C0(n){return new rg({element:n.element,injectCSS:!1,content:n.content,extensions:[S0.configure({heading:{levels:[3]},code:!1,codeBlock:!1,horizontalRule:!1,trailingNode:!1,link:{openOnClick:!1,autolink:!1,protocols:[...mu],HTMLAttributes:{target:null,rel:null,class:null},isAllowedUri:e=>gu(e)}})],editorProps:{attributes:n.attributes},onUpdate:({transaction:e,appendedTransactions:t})=>{(e.docChanged||t.some(r=>r.docChanged))&&n.onChange()},onTransaction:()=>n.onTransaction()})}function M0(n,e){n.chain().setMeta("addToHistory",!1).setContent(e,{emitUpdate:!1}).run()}function T0(n){return n.isEmpty?"":n.getHTML()}export{C0 as createRichEditor,T0 as editorValue,M0 as loadContent}; +`).trim();if(u){const h=t.blockTokens(u);c.push(...h)}let d=i+1;const f=[];for(;de;)f.push(n[d]),d+=1;if(f.length>0){const h=ru(f,Math.min(...f.map(p=>p.indent)),t);c.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:h,raw:f.map(p=>p.raw).join(` +`)})}r.push({type:"list_item",raw:s.raw,tokens:c}),i=d}else i+=1}return r}function Oy(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const r=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}const Ny=64;function hl(n,e){const t=[];let r=0;for(;t.lengthn.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>{const e=n.getAttribute("type");if(e)return e;const t=n.getAttribute("style");if(t){const i=gl(t);if(i)return i}const r=n.querySelector("li");if(r){const i=r.getAttribute("style");if(i){const s=gl(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,type:t,...r}=n,i=J(this.options.HTMLAttributes,r);return e!==1&&(i.start=e),t&&t!=="1"&&(i.type=t),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,r=n.typeMarker,i=n.items?Oy(n.items,e):[],s={};return t!==1&&(s.start=t),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:i}:{type:"orderedList",content:i}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(n,e,t)=>{var r,i;const[s,o,l]=Dy(n);if(s.length===0)return;const a=ru(s,s[0].indent,t);if(a.length!==0)return{type:"list",ordered:!0,start:((r=s[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(i=s[0])===null||i===void 0?void 0:i.type,items:a,raw:l.slice(0,o).join(` +`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Iy,this.editor.getAttributes(pl)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new $({props:{handlePaste:(n,e)=>{var t,r;const i=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/html");if(i?.trim())return!1;const s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s)return!1;const o=Ay(s);if(!o)return!1;try{const l=n.state.schema.nodeFromJSON(o),a=n.state.tr.replaceSelectionWith(l);return n.dispatch(a),!0}catch{return!1}}}})]},addInputRules(){const n=(t,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+t[1];let e=Wt({find:ml,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:n});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Wt({find:ml,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(pl)}),joinPredicate:n,editor:this.editor})),[e]}}),Ry=/^\s*(\[([( |x])?\])\s$/,Ly="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",Py=(n,e,t)=>{var r;return(t==null||(r=t.checkboxLabel)===null||r===void 0?void 0:r.call(t,n,e))||`Task item checkbox for ${n.textContent||"empty task item"}`},By=he.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:n=>{var e;return(e=n.querySelector("div"))!==null&&e!==void 0?e:n}}]},renderHTML({node:n,HTMLAttributes:e}){return["li",J(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const r=`- [${!((t=n.attrs)===null||t===void 0)&&t.checked?"x":" "}] `;return vc(n,e,r)},addExtensions(){return this.options.nested?[Yc(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");o.style.cssText=Ly;const c=d=>{const f=Py(d,d.attrs.checked,this.options.a11y);l.setAttribute("aria-label",f),o.textContent=f};c(n),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",d=>d.preventDefault()),l.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=t();if(typeof p!="number")return!1;const m=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...m?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,s.append(l,o),i.append(s,a),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)});let u=new Set(Object.keys(e));return{dom:i,contentDOM:a,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,l.checked=d.attrs.checked,c(d);const f=r.extensionManager.attributes,h=wn(d,f),p=new Set(Object.keys(h)),m=this.options.HTMLAttributes;return u.forEach(g=>{p.has(g)||(g in m?i.setAttribute(g,m[g]):i.removeAttribute(g))}),Object.entries(h).forEach(([g,y])=>{y==null?g in m?i.setAttribute(g,m[g]):i.removeAttribute(g):i.setAttribute(g,y)}),u=p,!0}}}},addInputRules(){return[Wt({find:Ry,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),zy=he.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",J(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=s=>{const o=Qo(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},t);if(o){const l={type:"taskList",raw:o.raw,items:o.items},a=s.slice(o.raw.length);return a.trim()?[l,...t.blockTokens(a)]:[l]}return t.blockTokens(s)},i=Qo(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:t.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});W.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(Gc.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(eu.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(nu.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(iu.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(By.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(zy.configure(this.options.taskList)),n}});const jn=" ",wi=" ",$y=he.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",J(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const r=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===jn||t[0].text===jn||t[0].raw===wi||t[0].text===wi)&&r.length===1&&r[0].type==="text"&&(r[0].text===jn||r[0].text===wi)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(n,e,t)=>{if(!n)return"";const r=Array.isArray(n.content)?n.content:[];if(r.length===0){var i,s;const o=Array.isArray(t==null||(i=t.previousNode)===null||i===void 0?void 0:i.content)?t.previousNode.content:[];return(t==null||(s=t.previousNode)===null||s===void 0?void 0:s.type)==="paragraph"&&o.length===0?jn:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Fy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Vy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Hy=Mt.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",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[wt({find:Fy,type:this.type})]},addPasteRules(){return[nt({find:Vy,type:this.type})]}}),jy=he.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),Wy=Mt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",J(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Ky(n={}){return new $({view(e){return new _y(e,n)}})}class _y{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,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.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else 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,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(t){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),m=d?p.bottom:p.top;d&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.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 c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,h=d.height/a.offsetHeight;c=d.left-a.scrollLeft*f,u=d.top-a.scrollTop*h}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){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)return null;let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Ul(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class j extends O{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return j.valid(r)?new j(r):O.near(r)}content(){return w.empty}eq(e){return e instanceof j&&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 j(e.resolve(t.pos))}getBookmark(){return new Ps(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Uy(e)||!qy(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&&j.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){s=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let a=e.doc.resolve(i);if(j.valid(a))return a}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!E.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),r=!1;continue e}break}s=o,i+=t;let l=e.doc.resolve(i);if(j.valid(l))return l}return null}}}j.prototype.visible=!1;j.findFrom=j.findGapCursorFrom;O.jsonID("gapcursor",j);class Ps{constructor(e){this.pos=e}map(e){return new Ps(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return j.valid(t)?new j(t):O.near(t)}}function su(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function Uy(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||su(i.type))return!0;if(i.inlineContent)return!1}}return!0}function qy(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||su(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Jy(){return new $({props:{decorations:Qy,createSelectionBetween(n,e,t){return e.pos==t.pos&&j.valid(t)?new j(t):null},handleClick:Yy,handleKeyDown:Gy,handleDOMEvents:{beforeinput:Xy}}})}const Gy=Ya({ArrowLeft:Wn("horiz",-1),ArrowRight:Wn("horiz",1),ArrowUp:Wn("vert",-1),ArrowDown:Wn("vert",1)});function Wn(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof v){if(!s.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=j.findGapCursorFrom(l,e,a);return c?(i&&i(r.tr.setSelection(new j(c))),!0):!1}}function Yy(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!j.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&E.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new j(r))),!0)}function Xy(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof j))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=k.empty;for(let o=r.length-1;o>=0;o--)i=k.from(r[o].createAndFill(null,i));let s=n.state.tr.replace(t.pos,t.pos,new w(i,0,0));return s.setSelection(v.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function Qy(n){if(!(n.selection instanceof j))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",D.create(n.doc,[se.widget(n.selection.head,e,{key:"gapcursor"})])}W.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new $({key:new _("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const i=this.options.limit,s=this.options.autoTrim;if(i==null||i===0||s===!1){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const l=o-i,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,l=o-(s-r),a=o;return e.deleteRange(l,a),!(this.storage.characters({node:e.doc})>r)}})]}});const Zy=W.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Ky(this.options)]}});W.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new $({key:new _("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!t||!r)return D.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(!a.isText){if(!(i>=c&&i<=c+a.nodeSize-1))return!1;o+=1}});let l=0;return n.descendants((a,c)=>{if(a.isText||!(i>=c&&i<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(se.node(c,c+a.nodeSize,{class:this.options.className}))}),D.create(n,s)}}})]}});const e0=W.create({name:"gapCursor",addProseMirrorPlugins(){return[Jy()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=L(M(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),ou="placeholder",yl=new _("tiptap__placeholder");function lu(n){const{editor:e,placeholder:t,dataAttribute:r,pos:i,node:s,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=n,u=[a];return o&&u.push(c),se.node(i,i+s.nodeSize,{class:u.join(" "),[r]:typeof t=="function"?t({editor:e,node:s,pos:i,hasAnchor:l}):t})}function au(n,e){return typeof n=="function"?n(e):n}function cu({editor:n,options:e,dataAttribute:t,doc:r,selection:i,from:s,to:o}){const{anchor:l}=i,a=[],c=n.isEmpty;return r.nodesBetween(s,o,(u,d)=>{const f=l>=d&&l<=d+u.nodeSize,h=!u.isLeaf&&On(u);return u.type.isTextblock&&(f||!e.showOnlyCurrent)&&h&&a.push(lu({editor:n,isEmptyDoc:c,dataAttribute:t,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:au(e.emptyNodeClass,{editor:n,node:u,pos:d,hasAnchor:f})},node:u,pos:d})),e.includeChildren}),a}function uu({editor:n,options:e,dataAttribute:t,doc:r,selection:i}){if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:s}=i,o=[],l=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const a=r.resolve(s),c=a.depth>0?a.node(1):a.nodeAfter,u=a.depth>0?a.before(1):s;if(c&&c.type.isTextblock&&On(c)){const d=s>=u&&s<=u+c.nodeSize;o.push(lu({editor:n,isEmptyDoc:l,dataAttribute:t,hasAnchor:d,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:au(e.emptyNodeClass,{editor:n,node:c,pos:u,hasAnchor:d})},node:c,pos:u}))}}else o.push(...cu({editor:n,options:e,dataAttribute:t,doc:r,selection:i,from:0,to:r.content.size}));return D.create(r,o)}function fn(n,e){const t=n.resolve(e);if(t.depth===0){var r;const s=(r=t.nodeAfter)!==null&&r!==void 0?r:t.nodeBefore;if(!s)return{from:e,to:e};const o=t.nodeAfter?e:e-s.nodeSize;return{from:o,to:o+s.nodeSize}}const i=t.before(1);return{from:i,to:i+t.node(1).nodeSize}}function hn(n,e){return{from:Math.max(0,e.from-1),to:Math.min(n.content.size,e.to-1)}}function t0(n,e,t){const r=[];return n.forEach((i,s)=>{const o=s,l=o+i.nodeSize,a=o+1,c=l+1;ae&&r.push({from:o,to:l})}),r}function n0(n){if(n.length===0)return[];const e=[...n].sort((r,i)=>r.from-i.from),t=[{...e[0]}];for(let r=1;re.from?t.push(hn(n,fn(n,Math.min(e.to,n.content.size+1)-1))):e.fromh.from>=c&&h.to<=u);d.length&&(l=l.remove(d));const f=cu({editor:t,options:r,dataAttribute:i,doc:s,selection:o,from:c,to:u});f.length&&(l=l.add(s,f))}return l}function l0({editor:n,options:e,dataAttribute:t}){return{init(r,i){const s=uu({editor:n,options:e,dataAttribute:t,doc:i.doc,selection:i.selection});return s??D.empty},apply(r,i,s,o){return!r.docChanged&&!r.selectionSet?i:o0({decorations:i.map(r.mapping,r.doc),ranges:i0(r,s,o),editor:n,options:e,dataAttribute:t,doc:o.doc,selection:o.selection})}}}function a0(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function c0({editor:n,options:e}){const t=e.dataAttribute?`data-${a0(e.dataAttribute)}`:`data-${ou}`,r=e.showOnlyCurrent&&!e.includeChildren;return new $({key:yl,...r?{}:{state:l0({editor:n,options:e,dataAttribute:t})},props:{decorations:r?({doc:i,selection:s})=>uu({editor:n,options:e,dataAttribute:t,doc:i,selection:s}):i=>{var s;return e.showOnlyWhenEditable&&!n.isEditable?D.empty:(s=yl.getState(i))!==null&&s!==void 0?s:D.empty}}})}W.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:ou,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[c0({editor:this.editor,options:this.options})]}});function es(n,e){return!n.selection.empty&&!bc(n.selection)&&e.isEditable}function u0(n,e){return es(n,e)&&!e.isFocused&&!e.view.dragging}function d0(){var n;(n=window.getSelection())===null||n===void 0||n.removeAllRanges()}function f0(n){n.focus()}W.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new $({key:new _("selection"),props:{decorations(t){return u0(t,n)?D.create(t.doc,[se.inline(t.selection.from,t.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(t){return es(t.state,n)&&d0(),!1},focus(t){return es(t.state,n)&&requestAnimationFrame(()=>{!n.isDestroyed&&t.hasFocus()&&f0(t)}),!1}}}})]}});function kl({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}const h0=W.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new _(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)===null||n===void 0?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new $({key:e,appendTransaction:(i,s,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),d=l.content.size,f=c.nodes[t];if(!i.some(h=>h.getMeta("skipTrailingNode"))&&u)return a.insert(d,f.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!kl({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!kl({node:o,types:r})}}})]}}),p0=W.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>ec(n,e),redo:()=>({state:n,dispatch:e})=>tc(n,e)}},addProseMirrorPlugins(){return[Ah(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),m0=W.create({name:"starterKit",addExtensions(){const n=[];if(this.options.bold!==!1&&n.push(ag.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(rg.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(Gc.configure(this.options.bulletList)),this.options.code!==!1&&n.push(fg.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(mg.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(gg.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(Zy.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(e0.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(yg.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(kg.configure(this.options.heading)),this.options.undoRedo!==!1&&n.push(p0.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&n.push(bg.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(Mg.configure(this.options.italic)),this.options.listItem!==!1&&n.push(eu.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;n.push(nu.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var t;n.push(iy.configure((t=this.options)===null||t===void 0?void 0:t.link))}if(this.options.orderedList!==!1&&n.push(iu.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push($y.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(Hy.configure(this.options.strike)),this.options.text!==!1&&n.push(jy.configure(this.options.text)),this.options.underline!==!1){var r;n.push(Wy.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var i;n.push(h0.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return n}});var g0=m0;function b0(n){return new Qm({element:n.element,injectCSS:!1,content:n.content,extensions:[g0.configure({heading:{levels:[3]},code:!1,codeBlock:!1,horizontalRule:!1,trailingNode:!1,link:{openOnClick:!1,autolink:!1,protocols:[...hu],HTMLAttributes:{target:null,rel:null,class:null},isAllowedUri:e=>pu(e)}})],editorProps:{attributes:n.attributes},onUpdate:({transaction:e,appendedTransactions:t})=>{(e.docChanged||t.some(r=>r.docChanged))&&n.onChange()},onTransaction:()=>n.onTransaction()})}function x0(n,e){n.chain().setMeta("addToHistory",!1).setContent(e,{emitUpdate:!1}).run()}function S0(n){return n.isEmpty?"":n.getHTML()}export{b0 as createRichEditor,S0 as editorValue,x0 as loadContent}; diff --git a/modules/boardwalk/dist/assets/editor-uDgt9VKj.js b/modules/boardwalk/dist/assets/editor-uDgt9VKj.js new file mode 100644 index 00000000..02e5f8a7 --- /dev/null +++ b/modules/boardwalk/dist/assets/editor-uDgt9VKj.js @@ -0,0 +1,22 @@ +import{k as MO,b as YO,s as _O}from"./index-Vcq4gwWv.js";let Qr=[],Eo=[];(()=>{let r="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(r=Eo[i])e=i+1;else return!0;if(e==t)return!1}}function Us(r){return r>=127462&&r<=127487}const Gs=8205;function qO(r,e,t=!0,i=!0){return(t?Vo:zO)(r,e,i)}function Vo(r,e,t){if(e==r.length)return e;e&&Do(r.charCodeAt(e))&&Lo(r.charCodeAt(e-1))&&e--;let i=Dn(r,e);for(e+=Is(i);e=0&&Us(Dn(r,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function zO(r,e,t){for(;e>1;){let i=Vo(r,e-2,t);if(i=56320&&r<57344}function Lo(r){return r>=55296&&r<56320}function Is(r){return r<65536?1:2}class j{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Wt(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),We.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Wt(this,e,t);let i=[];return this.decompose(e,t,i,0),We.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new hi(this),s=new hi(e);for(let l=t,o=t;;){if(n.next(l),s.next(l),l=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(o+=n.value.length,n.done||o>=i)return!0}}iter(e=1){return new hi(this,e)}iterRange(e,t=this.length){return new Bo(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Uo(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?j.empty:e.length<=32?new F(e):We.from(F.split(e,[]))}}class F extends j{constructor(e,t=EO(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.text[s],o=n+l.length;if((t?i:o)>=e)return new VO(n,o,i,l);n=o+1,i++}}decompose(e,t,i,n){let s=e<=0&&t>=this.length?this:new F(Ns(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let l=i.pop(),o=Ui(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new F(o,l.length+s.length));else{let a=o.length>>1;i.push(new F(o.slice(0,a)),new F(o.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof F))return super.replace(e,t,i);[e,t]=Wt(this,e,t);let n=Ui(this.text,Ui(i.text,Ns(this.text,0,e)),t),s=this.length+i.length-(t-e);return n.length<=32?new F(n,s):We.from(F.split(n,[]),s)}sliceString(e,t=this.length,i=` +`){[e,t]=Wt(this,e,t);let n="";for(let s=0,l=0;s<=t&&le&&l&&(n+=i),es&&(n+=o.slice(Math.max(0,e-s),t-s)),s=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let s of e)i.push(s),n+=s.length+1,i.length==32&&(t.push(new F(i,n)),i=[],n=-1);return n>-1&&t.push(new F(i,n)),t}}class We extends j{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.children[s],o=n+l.length,a=i+l.lines-1;if((t?a:o)>=e)return l.lineInner(e,t,i,n);n=o+1,i=a+1}}decompose(e,t,i,n){for(let s=0,l=0;l<=t&&s=l){let h=n&((l<=e?1:0)|(a>=t?2:0));l>=e&&a<=t&&!h?i.push(o):o.decompose(e-l,t-l,i,h)}l=a+1}}replace(e,t,i){if([e,t]=Wt(this,e,t),i.lines=s&&t<=o){let a=l.replace(e-s,t-s,i),h=this.lines-l.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let O=this.children.slice();return O[n]=a,new We(O,this.length-(t-e)+i.length)}return super.replace(s,o,a)}s=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` +`){[e,t]=Wt(this,e,t);let n="";for(let s=0,l=0;se&&s&&(n+=i),el&&(n+=o.sliceString(e-l,t-l,i)),l=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof We))return 0;let i=0,[n,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==l||s==o)return i;let a=this.children[n],h=e.children[s];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let u of e)i+=u.lines;if(i<32){let u=[];for(let d of e)d.flatten(u);return new F(u,t)}let n=Math.max(32,i>>5),s=n<<1,l=n>>1,o=[],a=0,h=-1,O=[];function c(u){let d;if(u.lines>s&&u instanceof We)for(let p of u.children)c(p);else u.lines>l&&(a>l||!a)?(f(),o.push(u)):u instanceof F&&a&&(d=O[O.length-1])instanceof F&&u.lines+d.lines<=32?(a+=u.lines,h+=u.length+1,O[O.length-1]=new F(d.text.concat(u.text),d.length+1+u.length)):(a+u.lines>n&&f(),a+=u.lines,h+=u.length+1,O.push(u))}function f(){a!=0&&(o.push(O.length==1?O[0]:We.from(O,h)),h=-1,a=O.length=0)}for(let u of e)c(u);return f(),o.length==1?o[0]:new We(o,t)}}j.empty=new F([""],0);function EO(r){let e=-1;for(let t of r)e+=t.length+1;return e}function Ui(r,e,t=0,i=1e9){for(let n=0,s=0,l=!0;s=t&&(a>i&&(o=o.slice(0,i-n)),n0?1:(e instanceof F?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],l=s>>1,o=n instanceof F?n.text.length:n.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(n instanceof F){let a=n.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=n.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof F?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Bo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new hi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Uo{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(j.prototype[Symbol.iterator]=function(){return this.iter()},hi.prototype[Symbol.iterator]=Bo.prototype[Symbol.iterator]=Uo.prototype[Symbol.iterator]=function(){return this});class VO{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}function Wt(r,e,t){return e=Math.max(0,Math.min(r.length,e)),[e,Math.max(e,Math.min(r.length,t))]}function ne(r,e,t=!0,i=!0){return qO(r,e,t,i)}function DO(r){return r>=56320&&r<57344}function LO(r){return r>=55296&&r<56320}function BO(r,e){let t=r.charCodeAt(e);if(!LO(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return DO(i)?(t-55296<<10)+(i-56320)+65536:t}function UO(r){return r<65536?1:2}const Sr=/\r\n?|\n/;var he=(function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r})(he||(he={}));class Be{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-n);s+=o}else{if(i!=he.Simple&&h>=e&&(i==he.TrackDel&&ne||i==he.TrackBefore&&ne))return null;if(h>e||h==e&&t<0&&!o)return e==n||t<0?s:s+a;s+=a}n=h}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let i=0,n=0;i=0&&n<=t&&o>=e)return nt?"cover":!0;n=o}return!1}toString(){let e="";for(let t=0;t=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Be(e)}static create(e){return new Be(e)}}class K extends Be{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return br(this,(t,i,n,s,l)=>e=e.replace(n,n+(i-t),l),!1),e}mapDesc(e,t=!1){return $r(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,s=0;n=0){t[n]=o,t[n+1]=l;let a=n>>1;for(;i.length0&&Ot(i,t,s.text),s.forward(O),o+=O}let h=e[l++];for(;o>1].toJSON()))}return e}static of(e,t,i){let n=[],s=[],l=0,o=null;function a(O=!1){if(!O&&!n.length)return;lf||c<0||f>t)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${t})`);let d=u?typeof u=="string"?j.of(u.split(i||Sr)):u:j.empty,p=d.length;if(c==f&&p==0)return;cl&&ie(n,c-l,-1),ie(n,f-c,p),Ot(s,n,d),l=f}}return h(e),a(!o),o}static empty(e){return new K(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;no&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length=0&&t<=0&&t==r[n+1]?r[n]+=e:n>=0&&e==0&&r[n]==0?r[n+1]+=t:i?(r[n]+=e,r[n+1]+=t):r.push(e,t)}function Ot(r,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||l==r.sections.length||r.sections[l+1]<0);)o=r.sections[l++],a=r.sections[l++];e(n,h,s,O,c),n=h,s=O}}}function $r(r,e,t,i=!1){let n=[],s=i?[]:null,l=new di(r),o=new di(e);for(let a=-1;;){if(l.done&&o.len||o.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&o.ins==-1){let h=Math.min(l.len,o.len);ie(n,h,-1),l.forward(h),o.forward(h)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len=0&&a=0){let h=0,O=l.len;for(;O;)if(o.ins==-1){let c=Math.min(O,o.len);h+=c,O-=c,o.forward(c)}else if(o.ins==0&&o.lena||l.ins>=0&&l.len>a)&&(o||i.length>h),s.forward2(a),l.forward(a)}}}}class di{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?j.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?j.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class at{constructor(e,t,i,n){this.from=e,this.to=t,this.flags=i,this.goalColumn=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new at(i,n,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t,void 0,void 0,i);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,n,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return S.range(e.anchor,e.head)}static create(e,t,i,n){return new at(e,t,i,n)}}class S{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:S.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new S(e.ranges.map(t=>at.fromJSON(t)),e.main)}static single(e,t=e){return new S([S.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;nn.from-s.from),t=e.indexOf(i);for(let n=1;ns.head?S.range(a,o):S.range(o,a))}}return new S(e,t)}}function Io(r,e){for(let t of r.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Os=0;class w{constructor(e,t,i,n,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=Os++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new w(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:cs),!!e.static,e.enables)}of(e){return new Gi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function cs(r,e){return r==e||r.length==e.length&&r.every((t,i)=>t===e[i])}class Gi{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=Os++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,a=!1,h=!1,O=[];for(let c of this.dependencies)c=="doc"?a=!0:c=="selection"?h=!0:(((t=e[c.id])!==null&&t!==void 0?t:1)&1)==0&&O.push(e[c.id]);return{create(c){return c.values[l]=i(c),1},update(c,f){if(a&&f.docChanged||h&&(f.docChanged||f.selection)||yr(c,O)){let u=i(c);if(o?!Fs(u,c.values[l],n):!n(u,c.values[l]))return c.values[l]=u,1}return 0},reconfigure:(c,f)=>{let u,d=f.config.address[s];if(d!=null){let p=rn(f,d);if(this.dependencies.every(m=>m instanceof w?f.facet(m)===c.facet(m):m instanceof rt?f.field(m,!1)==c.field(m,!1):!0)||(o?Fs(u=i(c),p,n):n(u=i(c),p)))return c.values[l]=p,0}else u=i(c);return c.values[l]=u,1}}}get extension(){return this}}function Fs(r,e,t){if(r.length!=e.length)return!1;for(let i=0;ir[a.id]),n=t.map(a=>a.type),s=i.filter(a=>!(a&1)),l=r[e.id]>>1;function o(a){let h=[];for(let O=0;Oi===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Ti).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,n)=>{let s=i.values[t],l=this.updateF(s,n);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,n)=>{let s=i.facet(Ti),l=n.facet(Ti),o;return(o=s.find(a=>a.field==this))&&o!=l.find(a=>a.field==this)?(i.values[t]=o.create(i),1):n.config.address[this.id]!=null?(i.values[t]=n.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Ti.of({field:this,create:e})]}get extension(){return this}}const St={lowest:4,low:3,default:2,high:1,highest:0};function Jt(r){return e=>new No(e,r)}const wn={highest:Jt(St.highest),high:Jt(St.high),default:Jt(St.default),low:Jt(St.low),lowest:Jt(St.lowest)};class No{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class vn{of(e){return new xr(this,e)}reconfigure(e){return vn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class xr{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class nn{constructor(e,t,i,n,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let n=[],s=Object.create(null),l=new Map;for(let f of IO(e,t,l))f instanceof rt?n.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let o=Object.create(null),a=[],h=[];for(let f of n)o[f.id]=h.length<<1,h.push(u=>f.slot(u));let O=i?.config.facets;for(let f in s){let u=s[f],d=u[0].facet,p=O&&O[f]||[];if(u.every(m=>m.type==0))if(o[d.id]=a.length<<1|1,cs(p,u))a.push(i.facet(d));else{let m=d.combine(u.map(Q=>Q.value));a.push(i&&d.compare(m,i.facet(d))?i.facet(d):m)}else{for(let m of u)m.type==0?(o[m.id]=a.length<<1|1,a.push(m.value)):(o[m.id]=h.length<<1,h.push(Q=>m.dynamicSlot(Q)));o[d.id]=h.length<<1,h.push(m=>GO(m,d,u))}}let c=h.map(f=>f(o));return new nn(e,l,c,o,a,s)}}function IO(r,e,t){let i=[[],[],[],[],[]],n=new Map;function s(l,o){let a=n.get(l);if(a!=null){if(a<=o)return;let h=i[a].indexOf(l);h>-1&&i[a].splice(h,1),l instanceof xr&&t.delete(l.compartment)}if(n.set(l,o),Array.isArray(l))for(let h of l)s(h,o);else if(l instanceof xr){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),s(h,o)}else if(l instanceof No)s(l.inner,l.prec);else if(l instanceof rt)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof Gi)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,St.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}).`);if(h==l)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,o)}}return s(r,St.default),i.reduce((l,o)=>l.concat(o))}function Oi(r,e){if(e&1)return 2;let t=e>>1,i=r.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;r.status[t]=4;let n=r.computeSlot(r,r.config.dynamicSlots[t]);return r.status[t]=2|n}function rn(r,e){return e&1?r.config.staticValues[e>>1]:r.values[e>>1]}const Fo=w.define(),Pr=w.define({combine:r=>r.some(e=>e),static:!0}),Ho=w.define({combine:r=>r.length?r[0]:void 0,static:!0}),Ko=w.define(),Jo=w.define(),ea=w.define(),ta=w.define({combine:r=>r.length?r[0]:!1});class st{constructor(e,t){this.type=e,this.value=t}static define(){return new NO}}class NO{of(e){return new st(this,e)}}class FO{constructor(e){this.map=e}of(e){return new L(this,e)}}class L{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new L(this.type,t)}is(e){return this.type==e}static define(e={}){return new FO(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let s=n.map(t);s&&i.push(s)}return i}}L.reconfigure=L.define();L.appendConfig=L.define();class H{constructor(e,t,i,n,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&Io(i,t.newLength),s.some(o=>o.type==H.time)||(this.annotations=s.concat(H.time.of(Date.now())))}static create(e,t,i,n,s,l){return new H(e,t,i,n,s,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(H.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}H.time=st.define();H.userEvent=st.define();H.addToHistory=st.define();H.remote=st.define();function HO(r,e){let t=[];for(let i=0,n=0;;){let s,l;if(i=r[i]))s=r[i++],l=r[i++];else if(n=0;n--){let s=i[n](r);s instanceof H?r=s:Array.isArray(s)&&s.length==1&&s[0]instanceof H?r=s[0]:r=na(e,Ct(s),!1)}return r}function JO(r){let e=r.startState,t=e.facet(ea),i=r;for(let n=t.length-1;n>=0;n--){let s=t[n](r);s&&Object.keys(s).length&&(i=ia(i,kr(e,s,r.changes.newLength),!0))}return i==r?r:H.create(e,r.changes,r.selection,i.effects,i.annotations,i.scrollIntoView)}const ec=[];function Ct(r){return r==null?ec:Array.isArray(r)?r:[r]}var et=(function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r})(et||(et={}));const tc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wr;try{wr=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ic(r){if(wr)return wr.test(r);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||tc.test(t)))return!0}return!1}function nc(r){return e=>{if(!/\S/.test(e))return et.Space;if(ic(e))return et.Word;for(let t=0;t-1)return et.Word;return et.Other}}class _{constructor(e,t,i,n,s,l){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;on.set(h,a)),t=null),n.set(o.value.compartment,o.value.extension)):o.is(L.reconfigure)?(t=null,i=o.value):o.is(L.appendConfig)&&(t=null,i=Ct(i).concat(o.value));let s;t?s=e.startState.values.slice():(t=nn.resolve(i,n,this),s=new _(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let l=e.startState.facet(Pr)?e.newSelection:e.newSelection.asSingle();new _(t,e.newDoc,l,s,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:S.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),s=[i.range],l=Ct(i.effects);for(let o=1;ol.spec.fromJSON(o,a)))}}return _.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=nn.resolve(e.extensions||[],new Map),i=e.doc instanceof j?e.doc:j.of((e.doc||"").split(t.staticFacet(_.lineSeparator)||Sr)),n=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return Io(n,i.length),t.staticFacet(Pr)||(n=n.asSingle()),new _(t,i,n,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(_.tabSize)}get lineBreak(){return this.facet(_.lineSeparator)||` +`}get readOnly(){return this.facet(ta)}phrase(e,...t){for(let i of this.facet(_.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let n=[];for(let s of this.facet(Fo))for(let l of s(this,t,i))Object.prototype.hasOwnProperty.call(l,e)&&n.push(l[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return nc(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-i,o=e-i;for(;l>0;){let a=ne(t,l,!1);if(s(t.slice(a,l))!=et.Word)break;l=a}for(;or.length?r[0]:4});_.lineSeparator=Ho;_.readOnly=ta;_.phrases=w.define({compare(r,e){let t=Object.keys(r),i=Object.keys(e);return t.length==i.length&&t.every(n=>r[n]==e[n])}});_.languageData=Fo;_.changeFilter=Ko;_.transactionFilter=Jo;_.transactionExtender=ea;vn.reconfigure=L.define();function fs(r,e,t={}){let i={};for(let n of r)for(let s of Object.keys(n)){let l=n[s],o=i[s];if(o===void 0)i[s]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](o,l);else throw new Error("Config merge conflict for field "+s)}for(let n in e)i[n]===void 0&&(i[n]=e[n]);return i}class ct{eq(e){return this==e}range(e,t=e){return vr.create(e,t,this)}}ct.prototype.startSide=ct.prototype.endSide=0;ct.prototype.point=!1;ct.prototype.mapMode=he.TrackDel;function us(r,e){return r==e||r.constructor==e.constructor&&r.eq(e)}let vr=class ra{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ra(e,t,i)}};function Xr(r,e){return r.from-e.from||r.value.startSide-e.value.startSide}class ds{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return vt(this.to)}findIndex(e,t,i,n=0){let s=i?this.to:this.from;for(let l=n,o=s.length;;){if(l==o)return l;let a=l+o>>1,h=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==l)return h>=0?l:o;h>=0?o=a:l=a+1}}between(e,t,i,n){for(let s=this.findIndex(t,-1e9,!0),l=this.findIndex(i,1e9,!1,s);sm||p==m&&f.startSide>0&&f.endSide<=0)continue;if(!((m-p||f.endSide-f.startSide)<0))if(h<0&&(h=p),f.point&&(O=Math.max(O,m-p)),(p-i||f.startSide-n)>=0)l.push(f),o.push(p-h),a.push(m-h),i=m,n=f.endSide;else{if(p==m)for(let Q=l.length;Q>0;Q--){if((p-(a[Q-1]+h)||f.startSide-l[Q-1].endSide)>=0){l.splice(Q,0,f),o.splice(Q,0,p-h),a.splice(Q,0,m-h);continue e}if((p-(o[Q-1]+h)||f.endSide-l[Q-1].startSide)>0)break}s(p,m,f)}}return{mapped:l.length?new ds(o,a,l,O):null,pos:h}}}class M{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new M(e,t,i,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:n=0,filterTo:s=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(i&&(t=t.slice().sort(Xr)),this.isEmpty)return t.length?M.of(t):this;let o=new sa(this,null,-1).goto(0),a=0,h=[],O=new $t;for(;o.value||a=0){let c=t[a++];O.addInner(c.from,c.to,c.value,!1)||h.push(c)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||so.to||s{s||(s=new $t),s.addRange(a,h,O,!1)};for(let a=0;a=s&&e<=s+l.length&&l.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return pi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return pi.from(e).goto(t)}static compare(e,t,i,n,s=-1){let l=e.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),o=t.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),a=Hs(l,o,i),h=new ei(l,a,s),O=new ei(o,a,s);i.iterGaps((c,f,u)=>Ks(h,c,O,f,u,n)),i.empty&&i.length==0&&Ks(h,0,O,0,0,n)}static eq(e,t,i=0,n){n==null&&(n=999999999);let s=e.filter(O=>!O.isEmpty&&t.indexOf(O)<0),l=t.filter(O=>!O.isEmpty&&e.indexOf(O)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let o=Hs(s,l),a=new ei(s,o,0).goto(i),h=new ei(l,o,0).goto(i);for(;;){if(a.to!=h.to||!Zr(a.active,h.active)||a.point&&(!h.point||!us(a.point,h.point)))return!1;if(a.to>n)return!0;a.next(),h.next()}}static spans(e,t,i,n,s=-1){let l=new ei(e,null,s).goto(t),o=t,a=l.openStart;for(;;){let h=Math.min(l.to,i);if(l.point){let O=l.activeForPoint(l.to),c=l.pointFromo&&(n.span(o,h,l.active,a),a=l.openEnd(h));if(l.to>i)return a+(l.point&&l.to>i?1:0);o=l.to,l.next()}}static of(e,t=!1){let i=new $t;for(let n of e instanceof vr?[e]:t?rc(e):e)i.add(n.from,n.to,n.value);return i.finish()}static join(e){if(!e.length)return M.empty;let t=vt(e);for(let i=e.length-2;i>=0;i--)for(let n=e[i];n!=M.empty;n=n.nextLayer)t=new M(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}}M.empty=new M([],[],null,-1);function vt(r){return r[r.length-1]}function rc(r){if(r.length>1)for(let e=r[0],t=1;t0)return r.slice().sort(Xr);e=i}return r}M.empty.nextLayer=M.empty;class $t{finishChunk(e){this.chunks.push(new ds(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addRange(e,t,i,!0)}addRange(e,t,i,n){this.addInner(e,t,i,n)||(this.nextLayer||(this.nextLayer=new $t)).addRange(e,t,i,n)}addInner(e,t,i,n){let s=e-this.lastTo||i.startSide-this.last.endSide;if(n&&s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(M.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=M.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Hs(r,e,t){let i=new Map;for(let s of r)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new sa(l,t,i,s));return n.length==1?n[0]:new pi(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Ln(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Ln(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Ln(this.heap,0)}}}function Ln(r,e){for(let t=r[e];;){let i=(e<<1)+1;if(i>=r.length)break;let n=r[i];if(i+1=0&&(n=r[i+1],i++),t.compare(n)<0)break;r[i]=t,r[e]=n,e=i}}class ei{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ai(this.active,e),Ai(this.activeTo,e),Ai(this.activeRank,e),this.minActive=Js(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:s}=this.cursor;for(;t0;)t++;Ci(this.active,t,i),Ci(this.activeTo,t,n),Ci(this.activeRank,t,s),e&&Ci(e,t,this.cursor.from),this.minActive=Js(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Ai(i,n)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[n]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Ks(r,e,t,i,n,s){r.goto(e),t.goto(i);let l=i+n,o=i,a=i-e,h=!!s.boundChange;for(let O=!1;;){let c=r.to+a-t.to,f=c||r.endSide-t.endSide,u=f<0?r.to+a:t.to,d=Math.min(u,l);if(r.point||t.point?(r.point&&t.point&&us(r.point,t.point)&&Zr(r.activeForPoint(r.to),t.activeForPoint(t.to))||s.comparePoint(o,d,r.point,t.point),O=!1):(O&&(s.boundChange(o),O=!1),d>o&&!Zr(r.active,t.active)&&s.compareRange(o,d,r.active,t.active),h&&dl)break;o=u,f<=0&&r.next(),f>=0&&t.next()}}function Zr(r,e){if(r.length!=e.length)return!1;for(let t=0;t=e;i--)r[i+1]=r[i];r[e]=t}function Js(r,e){let t=-1,i=1e9;for(let n=0;n=e)return n;if(n==r.length)break;s+=r.charCodeAt(n)==9?t-s%t:1,n=ne(r,n)}return r.length}const Tr="ͼ",el=typeof Symbol>"u"?"__"+Tr:Symbol.for(Tr),Ar=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),tl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ft{constructor(e,t){this.rules=[];let{finish:i}=t||{};function n(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,o,a,h){let O=[],c=/^@(\w+)\b/.exec(l[0]),f=c&&c[1]=="keyframes";if(c&&o==null)return a.push(l[0]+";");for(let u in o){let d=o[u];if(/&/.test(u))s(u.split(/,\s*/).map(p=>l.map(m=>p.replace(/&/,m))).reduce((p,m)=>p.concat(m)),d,a);else if(d&&typeof d=="object"){if(!c)throw new RangeError("The value of a property ("+u+") should be a primitive value.");s(n(u),d,O,f)}else d!=null&&O.push(u.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+d+";")}(O.length||f)&&a.push((i&&!c&&!h?l.map(i):l).join(", ")+" {"+O.join(" ")+"}")}for(let l in e)s(n(l),e[l],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=tl[el]||1;return tl[el]=e+1,Tr+e.toString(36)}static mount(e,t,i){let n=e[Ar],s=i&&i.nonce;n?s&&n.setNonce(s):n=new lc(e,s),n.mount(Array.isArray(t)?t:[t],e)}}let il=new Map;class lc{constructor(e,t){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=il.get(i);if(s)return e[Ar]=s;this.sheet=new n.CSSStyleSheet,il.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Ar]=this}mount(e,t){let i=this.sheet,n=0,s=0,l=!1;for(let o=0;o-1&&(this.modules.splice(h,1),l=!0,s--,h=-1),h==-1){if(this.modules.splice(s++,0,a),l=!0,i)for(let O=0;O2);var y={mac:sl||/Mac/.test(ae.platform),windows:/Win/.test(ae.platform),linux:/Linux|X11/.test(ae.platform),ie:Zn,ie_version:la?Cr.documentMode||6:jr?+jr[1]:Rr?+Rr[1]:0,gecko:nl,gecko_version:nl?+(/Firefox\/(\d+)/.exec(ae.userAgent)||[0,0])[1]:0,chrome:!!Bn,chrome_version:Bn?+Bn[1]:0,ios:sl,android:/Android\b/.test(ae.userAgent),webkit:rl,webkit_version:rl?+(/\bAppleWebKit\/(\d+)/.exec(ae.userAgent)||[0,0])[1]:0,safari:Mr,safari_version:Mr?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ae.userAgent)||[0,0])[1]:0,tabSize:Cr.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function ps(r,e){for(let t in r)t=="class"&&e.class?e.class+=" "+r.class:t=="style"&&e.style?e.style+=";"+r.style:e[t]=r[t];return e}const sn=Object.create(null);function gs(r,e,t){if(r==e)return!0;r||(r=sn),e||(e=sn);let i=Object.keys(r),n=Object.keys(e);if(i.length-0!=n.length-0)return!1;for(let s of i)if(s!=t&&(n.indexOf(s)==-1||r[s]!==e[s]))return!1;return!0}function oc(r,e){for(let t=r.attributes.length-1;t>=0;t--){let i=r.attributes[t].name;e[i]==null&&r.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?r.style.cssText=i:r.getAttribute(t)!=i&&r.setAttribute(t,i)}}function ll(r,e,t){let i=!1;if(e)for(let n in e)t&&n in t||(i=!0,n=="style"?r.style.cssText="":r.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(i=!0,n=="style"?r.style.cssText=t[n]:r.setAttribute(n,t[n]));return i}function ac(r){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new yt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,n;if(e.isBlockGap)i=-5e8,n=4e8;else{let{start:s,end:l}=oa(e,t);i=(s?t?-3e8:-1:5e8)-1,n=(l?t?2e8:1:-6e8)+1}return new yt(e,i,n,t,e.widget||null,!0)}static line(e){return new ki(e)}static set(e,t=!1){return M.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}E.none=M.empty;class Pi extends E{constructor(e){let{start:t,end:i}=oa(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?ps(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||sn}eq(e){return this==e||e instanceof Pi&&this.tagName==e.tagName&&gs(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Pi.prototype.point=!1;class ki extends E{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ki&&this.spec.class==e.spec.class&&gs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ki.prototype.mapMode=he.TrackBefore;ki.prototype.point=!0;class yt extends E{constructor(e,t,i,n,s,l){super(t,i,s,e),this.block=n,this.isReplace=l,this.mapMode=n?t<=0?he.TrackBefore:he.TrackAfter:he.TrackDel}get type(){return this.startSide!=this.endSide?ge.WidgetRange:this.startSide<=0?ge.WidgetBefore:ge.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof yt&&hc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}yt.prototype.point=!0;function oa(r,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=r;return t==null&&(t=r.inclusive),i==null&&(i=r.inclusive),{start:t??e,end:i??e}}function hc(r,e){return r==e||!!(r&&e&&r.compare(e))}function Rt(r,e,t,i=0){let n=t.length-1;n>=0&&t[n]+i>=r?t[n]=Math.max(t[n],e):t.push(r,e)}class gi extends ct{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof gi&&this.tagName==e.tagName&&gs(this.attributes,e.attributes)}static create(e){return new gi(e.tagName,e.attributes||sn,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return M.of(e,t)}}gi.prototype.startSide=gi.prototype.endSide=-1;const J=r=>r.nodeType==1,qt=r=>r.nodeType==3;function mi(r){let e;return r.nodeType==11?e=r.getSelection?r:r.ownerDocument:e=r,e.getSelection()}function Yr(r,e){return e?r==e||r.contains(e.nodeType!=1?e.parentNode:e):!1}function ci(r,e){if(!e.anchorNode)return!1;try{return Yr(r,e.anchorNode)}catch{return!1}}function Ii(r){return qt(r)?Qi(r,0,r.nodeValue.length).getClientRects():J(r)?r.getClientRects():[]}function fi(r,e,t,i){return t?ol(r,e,t,i,-1)||ol(r,e,t,i,1):!1}function ut(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e}function ln(r){return J(r)&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(r.nodeName)}function ol(r,e,t,i,n){for(;;){if(r==t&&e==i)return!0;if(e==(n<0?0:nt(r))){if(r.nodeName=="DIV")return!1;let s=r.parentNode;if(!s||!J(s))return!1;e=ut(r)+(n<0?0:1),r=s}else if(J(r)){if(r=r.childNodes[e+(n<0?-1:0)],J(r)&&(r.nodeName=="IMG"||r.nodeName=="BR"||r.contentEditable=="false"))return!1;e=n<0?nt(r):0}else return!1}}function nt(r){return qt(r)?r.nodeValue.length:r.childNodes.length}function on(r,e){let{left:t,right:i}=r;if(t==i)return r;let n=e?t:i;return{left:n,right:n,top:r.top,bottom:r.bottom}}function Oc(r){let e=r.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.innerWidth,top:0,bottom:r.innerHeight}}function aa(r,e){let t=e.width/r.offsetWidth,i=e.height/r.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-r.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-r.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function cc(r,e,t,i,n,s,l,o){let a=r.ownerDocument,h=a.defaultView||window;for(let O=r,c=!1;O&&!c;)if(J(O)){let f,u=O==a.body,d=1,p=1,m=!0,Q=!0;if(u)f=Oc(h);else{let A=getComputedStyle(O);if(/^(fixed|sticky)$/.test(A.position)&&(c=!0),(O.scrollHeight<=O.clientHeight||!/auto|scroll/.test(A.overflowY))&&(Q=!1),(O.scrollWidth<=O.clientWidth||!/auto|scroll/.test(A.overflowX))&&(m=!1),!m&&!Q){O=O.assignedSlot||O.parentNode;continue}let P=O.getBoundingClientRect();({scaleX:d,scaleY:p}=aa(O,P)),f={left:P.left,right:P.left+O.clientWidth*d,top:P.top,bottom:P.top+O.clientHeight*p}}let x=0,$=0;if(Q)if(n=="nearest")e.top0&&e.bottom>f.bottom+$&&($=e.bottom-f.bottom+l)):e.bottom>f.bottom-l&&($=e.bottom-f.bottom+l,t<0&&e.top-$0&&e.right>f.right+x&&(x=e.right-f.right+s)):e.right>f.right-s&&(x=e.right-f.right+s,t<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),O=O.assignedSlot||O.parentNode}else if(O.nodeType==11)O=O.host;else break}function ha(r,e=!0){let t=r.ownerDocument,i=null,n=null;for(let s=r.parentNode;s&&!(s==t.body||(!e||i)&&n);)if(J(s))!n&&s.scrollHeight>s.clientHeight&&/scroll|auto/.test(getComputedStyle(s).overflowY)&&(n=s),e&&!i&&s.scrollWidth>s.clientWidth&&/scroll|auto/.test(getComputedStyle(s).overflowX)&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:n}}class fc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?nt(t):0),i,Math.min(e.focusOffset,i?nt(i):0))}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}function Oa(r){let e=[];for(let t=r;t;t=t.nodeType==11?t.host:t.parentNode)J(t)&&e.push({node:t,left:t.scrollLeft,top:t.scrollTop});return e}function ca(r,e=!0){for(let{node:t,left:i,top:n}of r)e&&t.scrollTop!=n&&(t.scrollTop=n),t.scrollLeft!=i&&(t.scrollLeft=i)}let Qt=null;y.safari&&y.safari_version>=26&&(Qt=!1);function fa(r){if(r.setActive)return r.setActive();if(Qt)return r.focus(Qt);let e=Oa(r);r.focus(Qt==null?{get preventScroll(){return Qt={preventScroll:!0},!0}}:void 0),Qt||(Qt=!1,ca(e))}let al;function Qi(r,e,t=e){let i=al||(al=document.createRange());return i.setEnd(r,t),i.setStart(r,e),i}function jt(r,e,t,i){let n={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:n.altKey,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,metaKey:n.metaKey}=i);let s=new KeyboardEvent("keydown",n);s.synthetic=!0,r.dispatchEvent(s);let l=new KeyboardEvent("keyup",n);return l.synthetic=!0,r.dispatchEvent(l),s.defaultPrevented||l.defaultPrevented}function uc(r){for(;r;){if(r&&(r.nodeType==9||r.nodeType==11&&r.host))return r;r=r.assignedSlot||r.parentNode}return null}function dc(r,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,nt(t));;)if(i){if(!J(t))return!1;let n=t.childNodes[i-1];n.contentEditable=="false"?i--:(t=n,i=nt(t))}else{if(t==r)return!0;i=ut(t),t=t.parentNode}}function ua(r){return r instanceof Window?r.pageYOffset>Math.max(0,r.document.documentElement.scrollHeight-r.innerHeight-4):r.scrollTop>Math.max(1,r.scrollHeight-r.clientHeight-4)}function da(r,e){for(let t=r,i=e;;){if(qt(t)&&i>0)return{node:t,offset:i};if(J(t)&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=nt(t)}else if(t.parentNode&&!ln(t))i=ut(t),t=t.parentNode;else return null}}function pa(r,e){for(let t=r,i=e;;){if(qt(t)&&i=t){if(o.level==i)return l;(s<0||(n!=0?n<0?o.fromt:e[s].level>o.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function Qa(r,e){if(r.length!=e.length)return!1;for(let t=0;t=0;p-=3)if(je[p+1]==-u){let m=je[p+2],Q=m&2?n:m&4?m&1?s:n:0;Q&&(q[c]=q[je[p]]=Q),o=p;break}}else{if(je.length==189)break;je[o++]=c,je[o++]=f,je[o++]=a}else if((d=q[c])==2||d==1){let p=d==n;a=p?0:1;for(let m=o-3;m>=0;m-=3){let Q=je[m+2];if(Q&2)break;if(p)je[m+2]|=2;else{if(Q&4)break;je[m+2]|=4}}}}}function bc(r,e,t,i){for(let n=0,s=i;n<=t.length;n++){let l=n?t[n-1].to:r,o=na;)d==m&&(d=t[--p].from,m=p?t[p-1].to:r),q[--d]=u;a=O}else s=h,a++}}}function Wr(r,e,t,i,n,s,l){let o=i%2?2:1;if(i%2==n%2)for(let a=e,h=0;aa&&l.push(new ze(a,p.from,u));let m=p.direction==zt!=!(u%2);qr(r,m?i+1:i,n,p.inner,p.from,p.to,l),a=p.to}d=p.to}else{if(d==t||(O?q[d]!=o:q[d]==o))break;d++}f?Wr(r,a,d,i+1,n,f,l):ae;){let O=!0,c=!1;if(!h||a>s[h-1].to){let p=q[a-1];p!=o&&(O=!1,c=p==16)}let f=!O&&o==1?[]:null,u=O?i:i+1,d=a;e:for(;;)if(h&&d==s[h-1].to){if(c)break e;let p=s[--h];if(!O)for(let m=p.from,Q=h;;){if(m==e)break e;if(Q&&s[Q-1].to==m)m=s[--Q].from;else{if(q[m-1]==o)break e;break}}if(f)f.push(p);else{p.toq.length;)q[q.length]=256;let i=[],n=e==zt?0:1;return qr(r,n,n,t,0,r.length,i),i}function Sa(r){return[new ze(0,r,0)]}let ba="";function yc(r,e,t,i,n){var s;if(!r.length)return null;let l=i.head-r.from,o;if(i.head==r.from&&i.assoc<0){if(!n)return null;l=e[o=0].side(!1,t)}else if(i.head==r.to&&i.assoc>0){if(n)return null;l=e[o=e.length-1].side(!0,t)}else o=ze.find(e,l,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc);let a=e[o],h=a.side(n,t);if(l==h){let f=o+=n?1:-1;if(f<0||f>=e.length)return null;a=e[o=f],l=a.side(!n,t),h=a.side(n,t)}let O=ne(r.text,l,a.forward(n,t));(Oa.to)&&(O=h),ba=r.text.slice(Math.min(l,O),Math.max(l,O));let c=o==(n?e.length-1:0)?null:e[o+(n?1:-1)];if(O==h){if(!c)return n?S.cursor(r.to,1):S.cursor(r.from,-1);if(c.level+(n?0:1)r.some(e=>e)}),Pc=w.define({combine:r=>r.some(e=>e)}),Xa=w.define();class Mt{constructor(e,t,i,n,s,l=!1){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new Mt(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Mt(S.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Ri=L.define({map:(r,e)=>r.map(e)}),Za=L.define();function Ee(r,e,t){let i=r.facet(Pa);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Je=w.define({combine:r=>r.length?r[0]:!0});let kc=0;const Zt=w.define({combine(r){return r.filter((e,t)=>{for(let i=0;i{let a=[];return l&&a.push(Tn.of(h=>{let O=h.plugin(o);return O?l(O):E.none})),s&&a.push(s(o)),a})}static fromClass(e,t){return Ge.define((i,n)=>new e(i,n),t)}}class Un{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ee(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Ee(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ee(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ta=w.define(),bs=w.define(),Tn=w.define(),Aa=w.define(),$s=w.define(),wi=w.define(),Ca=w.define();function hl(r,e){let t=r.state.facet(Ca);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(r):s),n=[];return M.spans(i,e.from,e.to,{point(){},span(s,l,o,a){let h=s-e.from,O=l-e.from,c=n;for(let f=o.length-1;f>=0;f--,a--){let u=o[f].spec.bidiIsolate,d;if(a>0&&c.length&&(d=c[c.length-1]).to==h&&d.direction==u)d.to=O,c=d.inner;else{let p={from:h,to:O,direction:u,inner:[]};c.push(p),c=p.inner}}}}),Ra(e.text,n)}function Ra(r,e){for(let t of e){if(t.direction==null){for(let i=t.from,n=0;i0;t--){let n=e[t-1];if(!(n.fromA>i.toA)){if(n.toAn.push(new ye(s,l,o,a))),this.changedRanges=n}static create(e,t,i){return new an(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const wc=[];class N{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return wc}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&oc(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let n of this.children){if(n==e)return i;i+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,i){return null}domPosFor(e,t){let i=ut(this.dom),n=this.length?e>0:t>0;return new Xe(this.parent.dom,i+(n?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Cn)return e;return null}static get(e){return e.cmTile}}class An extends N{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,n,s=e?.node==t?e:null,l=0;for(let o of this.children){if(o.sync(e),l+=o.length+o.breakAfter,n=i?i.nextSibling:t.firstChild,s&&n!=o.dom&&(s.written=!0),o.dom.parentNode==t)for(;n&&n!=o.dom;)n=Ol(n);else t.insertBefore(o.dom,n);i=o.dom}for(n=i?i.nextSibling:t.firstChild,s&&n&&(s.written=!0);n;)n=Ol(n);this.length=l}}function Ol(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class Cn extends An{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=N.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,n=0,s=0;;)if(n==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&s++,n=t.pop()}else{let l=i.children[n++];if(l instanceof tt)t.push(n),i=l,n=0;else{let o=s+l.length,a=e(l,s);if(a!==void 0)return a;s=o+l.breakAfter}}}resolveBlock(e,t){let i,n=-1,s,l=-1;if(this.blockTiles((o,a)=>{let h=a+o.length;if(e>=a&&e<=h){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(i=void 0)}(ae||e==a&&(t>1?o.length:o.covers(-1)))&&(!s||!o.isWidget()&&s.isWidget())&&(s=o,l=e-a)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&t<0||!s?{tile:i,offset:n}:{tile:s,offset:l}}}class tt extends An{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new tt(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class Et extends An{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let n=new Et(t||document.createElement("div"),e);return(!t||!i)&&(n.flags|=4),n}get domAttrs(){return this.attrs}resolveInline(e,t,i=!1){let n=null,s=-1,l=null,o=-1;function a(O,c){for(let f=0,u=0;f=c&&(d.isComposite()?a(d,c-u):(!l||i&&l.isHidden&&(t>0&&!(l.flags&32)||i&&Xc(l,d)))&&(p>c||d.flags&32&&t<=1)?(l=d,o=c-u):(u=-1)&&(n=d,s=c-u)),u=p}}a(this,e);let h=(t<0?n:l)||n||l;return h?{tile:h,offset:h==n?s:o}:null}coordsIn(e,t,i){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t,i):vc(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:n,offset:s}=i;if(this.dom.contains(n.dom))return n.isText()?new Xe(n.dom,Math.min(n.dom.nodeValue.length,s)):n.domPosFor(s,n.flags&16?1:n.flags&32?-1:t);let l=i.tile.parent,o=!1;for(let a of l.children){if(o)return new Xe(a.dom,0);a==i.tile&&(o=!0)}}return new Xe(this.dom,0)}}function vc(r){let e=r.dom.lastChild;if(!e)return r.dom.getBoundingClientRect();let t=Ii(e);return t[t.length-1]||null}function Xc(r,e){let t=r.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.topn&&(e=n);let s=e,l=e,o=0;e==0&&t<0||e==n&&t>=0?y.chrome||y.gecko||(e?(s--,o=1):l=0)?0:a.length-1];return y.safari&&!o&&h.width==0&&(h=Array.prototype.find.call(a,O=>O.width)||h),i==null?h:on(h,(o?o>0:t<0)==i)}static of(e,t){let i=new bt(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class xt extends N{constructor(e,t,i,n){super(e,t,n),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;if(i)return on(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),l=null;if(!s.length)return null;let o=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=o?s.length-1:0;l=s[a],!(e>0?a==0:a==s.length-1||l.top0==i)}}class Zc{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:n,index:s,beforeBreak:l,parents:o}=this;for(;e||t>0;)if(n.isComposite())if(l){if(!e)break;i&&i.break(),e--,l=!1}else if(s==n.children.length){if(!e&&!o.length)break;i&&i.leave(n),l=!!n.breakAfter,{tile:n,index:s}=o.pop(),s++}else{let a=n.children[s],h=a.breakAfter;(t>0?a.length<=e:a.length=0;o--){let a=t.marks[o],h=n.lastChild;if(h instanceof de&&h.mark.eq(a.mark))h.dom!=a.dom&&h.setDOM(Gn(a.dom)),n=h;else{let{dom:O}=a;this.cache.reused.get(a)&&N.get(a.dom)&&(O=Gn(a.dom));let c=de.of(a.mark,O);n.append(c),n=c}this.cache.reused.set(a,2)}let s=N.get(e.text);s&&this.cache.reused.set(s,2);let l=new bt(e.text,e.text.nodeValue);l.flags|=8,this.pos=e.range.toB,n.append(l)}addInlineWidget(e,t,i){let n=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);n||this.flushBuffer();let s=this.ensureMarks(t,i);!n&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=Ya);let n=Et.start(e,t||((i=this.cache.find(Et))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let n=this.curLine;for(let s=e.length-1;s>=0;s--){let l=e[s],o;if(t>0&&(o=n.lastChild)&&o instanceof de&&o.mark.eq(l))n=o,t--;else{let a=de.of(l,(i=this.cache.find(de,h=>h.mark.eq(l)))===null||i===void 0?void 0:i.dom);n.append(a),n=a,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!cl(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(y.ios&&cl(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(In,0,32)||new xt(In.toDOM(),0,In,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let t=e.rank*102+e.value.rank,i=new Tc(e.from,e.to,e.value,t),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-i.rank||this.wrappers[n-1].to-i.to)<0;)n--;this.wrappers.splice(n,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let n=t.lastChild;if(i.froml.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(hn,void 0,1);return i&&(i.flags=t),i||new hn(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Cc{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:n,lineBreak:s,done:l}=this.cursor.next(this.skipCount);if(this.skipCount=0,l)throw new Error("Ran out of text content when drawing inline views");this.text=n;let o=this.textOff=Math.min(e,n.length);return s?null:n.slice(0,o)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const On=[xt,Et,bt,de,hn,tt,Cn];for(let r=0;r[]),this.index=On.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let n=e.bucket,s=this.buckets[n],l=this.index[n];for(let o=0;o{if(this.cache.add(l),l.isComposite())return!1},enter:l=>this.cache.add(l),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let n=0,s=0,l=0;;){let o=ln){let h=a-n;this.preserve(h,!l,!o),n=a,s+=h}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA{if(l.isWidget())if(this.openWidget)this.builder.continueWidget(a-o);else{let h=a>0||o{l.isLine()?this.builder.addLineStart(l.attrs,this.cache.maybeReuse(l)):(this.cache.add(l),l instanceof de&&n.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?n.length&&(n.length=s=0):l instanceof de&&(n.shift(),s=Math.min(s,n.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,n=this.builder,s=-1,l=M.spans(this.decorations,e,t,{point:(o,a,h,O,c,f)=>{if(h instanceof yt){if(this.disallowBlockEffectsFor[f]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=O.length,c>O.length)n.continueWidget(a-o);else{let u=h.widget||(h.block?Vt.block:Vt.inline),d=Mc(h),p=this.cache.findWidget(u,a-o,d)||xt.of(u,this.view,a-o,d);h.block?(h.startSide>0&&n.addLineStartIfNotCovered(i),n.addBlockWidget(p)):(n.ensureLine(i),n.addInlineWidget(p,O,c))}i=null}else i=Yc(i,h);a>o&&this.text.skip(a-o)},span:(o,a,h,O)=>{for(let c=o;c-1&&(this.openWidget=l>s),this.openWidget||n.addLineStartIfNotCovered(i),this.openMarks=l}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let n=e.parentNode;;n=n.parentNode){let s=N.get(n);if(n==this.view.contentDOM)break;s instanceof de?t.push(s):s?.isLine()?i=s:s instanceof tt||(n.nodeName=="DIV"&&!i?i=new Et(n,Ya):i||t.push(de.of(new Pi({tagName:n.nodeName.toLowerCase(),attributes:ac(n)}),n)))}return i?{line:i,marks:t}:null}}function cl(r,e){let t=i=>{for(let n of i.children)if((e?n.isText():n.length)||t(n))return!0;return!1};return t(r)}function Mc(r){let e=r.isReplace?(r.startSide<0?64:0)|(r.endSide>0?128:0):r.startSide>0?32:16;return r.block&&(e|=256),e}const Ya={class:"cm-line"};function Yc(r,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(r||(r={class:"cm-line"}),t&&ps(t,r),i&&(r.class+=" "+i)),r}function _c(r){let e=[];for(let t=r.parents.length;t>1;t--){let i=t==r.parents.length?r.tile:r.parents[t].tile;i instanceof de&&e.push(i.mark)}return e}function Gn(r){let e=N.get(r);return e&&e.setDOM(r.cloneNode()),r}class Vt extends xi{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Vt.inline=new Vt("span");Vt.block=new Vt("div");const In=new class extends xi{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class fl{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=E.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Cn(e,e.contentDOM),this.updateInner([new ye(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:O,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?n=this.domChanged.newSel.head:!Uc(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let s=n>-1?qc(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:O,to:c}=this.hasComposition;i=new ye(O,c,e.changes.mapPos(O,-1),e.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(y.ie||y.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.blockWrappers;this.updateDeco();let a=Vc(l,this.decorations,e.changes);a.length&&(i=ye.extendWithRanges(i,a));let h=Lc(o,this.blockWrappers,e.changes);return h.length&&(i=ye.extendWithRanges(i,h)),s&&!i.some(O=>O.fromA<=s.range.fromA&&O.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let l=this.tile,o=new jc(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&N.get(t.text)&&o.cache.reused.set(N.get(t.text),2),this.tile=o.run(e,t),Er(l,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=y.chrome||y.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let n=[];if(this.view.viewport.from||this.view.viewport.to-1)&&ci(i,this.view.observer.selectionRange)&&!(n&&i.contains(n));if(!(s||t||l))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,h,O;if(a.empty?O=h=this.inlineDOMNearPos(a.anchor,a.assoc||1):(O=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),h=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),y.gecko&&a.empty&&!this.hasComposition&&Wc(h)){let f=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(f,h.node.childNodes[h.offset]||null)),h=O=new Xe(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!fi(h.node,h.offset,c.anchorNode,c.anchorOffset)||!fi(O.node,O.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,a))&&(this.view.observer.ignore(()=>{y.android&&y.chrome&&i.contains(c.focusNode)&&Bc(c.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let f=mi(this.view.root);if(f)if(a.empty){if(y.gecko){let u=zc(h.node,h.offset);if(u&&u!=3){let d=(u==1?da:pa)(h.node,h.offset);d&&(h=new Xe(d.node,d.offset))}}f.collapse(h.node,h.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(h.node,h.offset);try{f.extend(O.node,O.offset)}catch{}}else{let u=document.createRange();a.anchor>a.head&&([h,O]=[O,h]),u.setEnd(O.node,O.offset),u.setStart(h.node,h.offset),f.removeAllRanges(),f.addRange(u)}l&&this.view.root.activeElement==i&&(i.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(h,O)),this.impreciseAnchor=h.precise?null:new Xe(c.anchorNode,c.anchorOffset),this.impreciseHead=O.precise?null:new Xe(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&fi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=mi(e.root),{anchorNode:n,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let l=this.lineAt(t.head,t.assoc);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let O=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(O.node,O.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&i.collapse(n,s)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let n=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[t];else{let l=nt(e)==0?0:t==0?-1:1;for(;;){let o=e.parentNode;if(o==i.dom)break;l==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?l=-1:l=1),e=o}l<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return n;for(;s&&!N.get(s);)s=s.nextSibling;if(!s)return n+i.length;for(let l=0,o=n;;l++){let a=i.children[l];if(a.dom==s)return o;o+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?n+t:n+(t?i.length:0):n}domAtPos(e,t){let{tile:i,offset:n}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(n,t):i.domIn(n,t)}inlineDOMNearPos(e,t){let i,n=-1,s=!1,l,o=-1,a=!1;return this.tile.blockTiles((h,O)=>{if(h.isWidget()){if(h.flags&32&&O>=e)return!0;h.flags&16&&(s=!0)}else{let c=O+h.length;if(O<=e&&(i=h,n=e-O,s=c=e&&!l&&(l=h,o=e-O,a=O>e),O>e&&l)return!0}}),!i&&!l?this.domAtPos(e,t):(s&&l?i=null:a&&i&&(l=null),i&&t<0||!l?i.domIn(n,t):l.domIn(o,t))}coordsAt(e,t,i){let{tile:n,offset:s}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof Nn?null:n.coordsInWidget(s,t,!0):n.coordsIn(s,t,i)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function n(s,l){if(s.isComposite())for(let o of s.children){if(o.length>=l){let a=n(o,l);if(a)return a}if(l-=o.length,l<0)break}else if(s.isText()&&lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==I.LTR,h=0,O=(c,f,u)=>{for(let d=0;dn);d++){let p=c.children[d],m=f+p.length,Q=p.dom.getBoundingClientRect(),{height:x}=Q;if(u&&!d&&(h+=Q.top-u.top),p instanceof tt)m>i&&O(p,f,Q);else if(f>=i&&(h>0&&t.push(-h),t.push(x+h),h=0,l)){let $=p.dom.lastChild,A=$?Ii($):[];if(A.length){let P=A[A.length-1],Z=a?P.right-Q.left:Q.right-P.left;Z>o&&(o=Z,this.minWidth=s,this.minWidthFrom=f,this.minWidthTo=m)}}u&&d==c.children.length-1&&(h+=u.bottom-Q.bottom),f=m+p.breakAfter}};return O(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?I.RTL:I.LTR}measureTextSize(){let e=this.tile.blockTiles(l=>{if(l.isLine()&&l.children.length&&l.length<=20){let o=0,a;for(let h of l.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let O=Ii(h.dom);if(O.length!=1)return;o+=O[0].width,a=O[0].height}if(o)return{lineHeight:l.dom.getBoundingClientRect().height,charWidth:o/l.length,textHeight:a}}});if(e)return e;let t=document.createElement("div"),i,n,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let l=Ii(t.firstChild)[0];i=t.getBoundingClientRect().height,n=l&&l.width?l.width/27:7,s=l&&l.height?l.height:i,t.remove()}),{lineHeight:i,charWidth:n,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let s=n==t.viewports.length?null:t.viewports[n],l=s?s.from-1:this.view.state.doc.length;if(l>i){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(E.replace({widget:new Nn(o),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!s)break;i=s.to+1}return E.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Tn).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,n=this.view.state.facet($s).map((s,l)=>{let o=typeof s=="function";return o&&(i=!0),o?s(this.view):s});for(n.length&&(this.dynamicDecorationMap[e++]=i,t.push(M.join(n))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(Xa))try{if(h(this.view,e.range,e))return!0}catch(O){Ee(this.view.state,O,"scroll handler")}let{range:t}=e,i=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),n;if(!i)return;!t.empty&&(n=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let s=Ma(this.view),l={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;if(cc(this.view.scrollDOM,l,t.head1&&(i.top>window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Er(this.tile)}}function Er(r,e){let t=e?.get(r);if(t!=1){t==null&&r.destroy();for(let i of r.children)Er(i,e)}}function Wc(r){return J(r.node)&&r.node.firstChild&&(r.offset==0||r.node.childNodes[r.offset-1].contentEditable=="false")&&(r.offset==r.node.childNodes.length||r.node.childNodes[r.offset].contentEditable=="false")}function _a(r,e){let t=r.observer.selectionRange;if(!t.focusNode)return null;let i=da(t.focusNode,t.focusOffset),n=pa(t.focusNode,t.focusOffset),s=i||n;if(n&&i&&n.node!=i.node){let o=N.get(n.node);if(!o||o.isText()&&o.text!=n.node.nodeValue)s=n;else if(r.docView.lastCompositionAfterCursor){let a=N.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=n)}}if(r.docView.lastCompositionAfterCursor=s!=i,!s)return null;let l=e-s.offset;return{from:l,to:l+s.node.nodeValue.length,node:s.node}}function qc(r,e,t){let i=_a(r,t);if(!i)return null;let{node:n,from:s,to:l}=i,o=n.nodeValue;if(/[\n\r]/.test(o)||r.state.doc.sliceString(i.from,i.to)!=o)return null;let a=e.invertedDesc;return{range:new ye(a.mapPos(s),a.mapPos(l),s,l),text:n}}function zc(r,e){return J(r)?(e&&r.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}class Nn extends xi{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Gc(r,e,t=1){let i=r.charCategorizer(e),n=r.doc.lineAt(e),s=e-n.from;if(n.length==0)return S.cursor(e);s==0?t=1:s==n.length&&(t=-1);let l=s,o=s;t<0?l=ne(n.text,s,!1):o=ne(n.text,s);let a=i(n.text.slice(l,o));for(;l>0;){let h=ne(n.text,l,!1);if(i(n.text.slice(h,l))!=a)break;l=h}for(;or.defaultLineHeight*1.5){let o=r.viewState.heightOracle.textHeight,a=Math.floor((n-t.top-(r.defaultLineHeight-o)*.5)/o);s+=a*r.viewState.heightOracle.lineLength}let l=r.state.sliceDoc(t.from,t.to);return t.from+sc(l,s,r.state.tabSize)}function Nc(r,e,t){let i=r.lineBlockAt(e);if(Array.isArray(i.type)){let n;for(let s of i.type){if(s.from>e)break;if(!(s.toe)return s;(!n||s.type==ge.Text&&(n.type!=s.type||(t<0?s.frome)))&&(n=s)}}return n||i}return i}function Fc(r,e,t,i){let n=Nc(r,e.head,e.assoc||-1),s=!i||n.type!=ge.Text||!(r.lineWrapping||n.widgetLineBreaks)?null:r.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head);if(s){let l=r.dom.getBoundingClientRect(),o=r.textDirectionAt(n.from),a=r.posAndSideAtCoords({x:t==(o==I.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(a)return S.cursor(a.pos,a.assoc)}return S.cursor(t?n.to:n.from,t?1:-1)}function ul(r,e,t,i){let n=r.state.doc.lineAt(e.head),s=r.bidiSpans(n),l=r.textDirectionAt(n.from);for(let o=e,a=null;;){let h=yc(n,s,l,o,t),O=ba;if(!h){if(n.number==(t?r.state.doc.lines:1))return o;O=` +`,n=r.state.doc.line(n.number+(t?1:-1)),s=r.bidiSpans(n),h=t?S.cursor(n.from,-1):S.cursor(n.to,1)}if(a){if(!a(O))return o}else{if(!i)return h;a=i(O)}o=h}}function Hc(r,e,t){let i=r.state.charCategorizer(e),n=i(t);return s=>{let l=i(s);return n==et.Space&&(n=l),n==l}}function Kc(r,e,t,i){let n=e.head,s=t?1:-1;if(n==(t?r.state.doc.length:0))return S.cursor(n,e.assoc);let l=e.goalColumn,o,a=r.contentDOM.getBoundingClientRect(),h=r.coordsAtPos(n,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),O=r.documentTop;if(h)l==null&&(l=h.left-a.left),o=s<0?h.top:h.bottom;else{let d=r.viewState.lineBlockAt(n);l==null&&(l=Math.min(a.right-a.left,r.defaultCharacterWidth*(n-d.from))),o=(s<0?d.top:d.bottom)+O}let c=a.left+l,f=r.viewState.heightOracle.textHeight>>1,u=i??f;for(let d=0;;d+=f){let p=o+(u+d)*s,m=Vr(r,{x:c,y:p},!1,s);if(t?p>a.bottom:po:x{if(e>s&&en(r)),t.from,e.head>t.from?-1:1);return i==t.from?t:S.cursor(i,ir.viewState.docHeight)return new qe(r.state.doc.length,-1);if(h=r.elementAtHeight(a),i==null)break;if(h.type==ge.Text){if(i<0?h.tor.viewport.to)break;let f=r.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(f&&(i<0?f.top<=a+s:f.bottom>=a+s))break}let c=r.viewState.heightOracle.textHeight/2;a=i>0?h.bottom+c:h.top-c}if(r.viewport.from>=h.to||r.viewport.to<=h.from){if(t)return null;if(h.type==ge.Text){let c=Ic(r,n,h,l,o);return new qe(c,c==h.from?1:-1)}}if(h.type!=ge.Text)return a<(h.top+h.bottom)/2?new qe(h.from,1):new qe(h.to,-1);let O=r.docView.lineAt(h.from,2);return(!O||O.length!=h.length)&&(O=r.docView.lineAt(h.from,-2)),new Jc(r,l,o,r.textDirectionAt(h.from)).scanTile(O,h.from)}class Jc{constructor(e,t,i,n){this.view=e,this.x=t,this.y=i,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+n.from>1;t:if(l.has(p)){for(let x=1;x=s&&($-=d),!l.has($)){p=$;break t}}break e}l.add(p);let m=t(p),Q=0;if(m)for(let x=0;x1))if($.bottomthis.y)(!h||h.top>$.top)&&(h=$),Q=-1;else{let A=$.left>this.x?this.x-$.left:$.right(d+d+p)/3)return this.y=a.bottom-1,this.scan(e,t,!0);if(h&&h.top<(d+p+p)/3)return this.y=h.top+1,this.scan(e,t,!0)}let u=(o?this.dirAt(e[O],1):this.baseDir)==I.LTR;return{i:O,after:this.x>(f.left+f.right)/2==u}}scanText(e,t){let i=[];for(let s=0;s{let l=i[s]-t,o=i[s+1]-t;return Qi(e.dom,l,o).getClientRects()});return n.after?new qe(i[n.i+1],-1):new qe(i[n.i],1)}scanTile(e,t){if(!e.length)return new qe(t,1);if(e.children.length==1){let o=e.children[0];if(o.isText())return this.scanText(o,t);if(o.isComposite())return this.scanTile(o,t)}let i=[t];for(let o=0,a=t;o{let a=e.children[o];return a.flags&48?null:(J(a.dom)?a.dom:Qi(a.dom,0,a.length)).getClientRects()}),s=e.children[n.i],l=i[n.i];return s.isText()?this.scanText(s,l):s.isComposite()?this.scanTile(s,l):n.after?new qe(i[n.i+1],-1):new qe(l,1)}}const Xt="￿";class ef{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(_.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Xt}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let n=e;;){this.findPointBefore(i,n);let s=this.text.length;this.readNode(n);let l=N.get(n),o=n.nextSibling;if(o==t){l?.breakAfter&&!o&&i!=this.view.contentDOM&&this.lineBreak();break}let a=N.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:ln(n))||ln(o)&&(n.nodeName!="BR"||l?.isWidget())&&this.text.length>s)&&!nf(o,t)&&this.lineBreak(),n=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,o;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(o=n.exec(t))&&(s=o.index,l=o[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=l-1);i=s+l}}readNode(e){let t=N.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else qt(e)?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():J(e)&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(qt(e)?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(tf(e,i.node,i.offset)?t:0))}}function tf(r,e,t){for(;;){if(!e||t-1;let{impreciseHead:s,impreciseAnchor:l}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=qa(e.docView.tile,t,i,0))){let a=s||l?[]:lf(e),h=new ef(a,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=of(a,this.bounds.from)}else{let a=e.observer.selectionRange,h=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Yr(e.contentDOM,a.focusNode)?o.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),O=l&&l.node==a.anchorNode&&l.offset==a.anchorOffset||!Yr(e.contentDOM,a.anchorNode)?o.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((y.ios||y.chrome)&&h!=O&&Math.min(h,O)<=o.main.from&&Math.max(h,O)>=o.main.to&&(c.from>0||c.to-1&&o.ranges.length>1)this.newSel=o.replaceRange(S.range(O,h));else if(e.lineWrapping&&O==h&&!(o.main.empty&&o.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let f=e.coordsAtPos(h,-1),u=0;f&&(u=e.inputState.lastTouchY<=f.bottom?-1:1),this.newSel=S.create([S.cursor(h,u)])}else this.newSel=S.single(O,h)}}}function qa(r,e,t,i){if(r.isComposite()){let n=-1,s=-1,l=-1,o=-1;for(let a=0,h=i,O=i;at)return qa(c,e,t,h);if(f>=e&&n==-1&&(n=a,s=h),h>t&&c.dom.parentNode==r.dom){l=a,o=O;break}O=f,h=f+c.breakAfter}return{from:s,to:o<0?i+r.length:o,startDOM:(n?r.children[n-1].dom.nextSibling:null)||r.dom.firstChild,endDOM:l=0?r.children[l].dom:null}}else return r.isText()?{from:i,to:i+r.length,startDOM:r.dom,endDOM:r.dom.nextSibling}:null}function za(r,e){let t,{newSel:i}=e,{state:n}=r,s=n.selection.main,l=r.inputState.lastKeyTime>Date.now()-100?r.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,h=s.from,O=null;(l===8||y.android&&e.text.length=o&&s.to<=a&&(e.typeOver||c!=e.text)&&c.slice(0,s.from-o)==e.text.slice(0,s.from-o)&&c.slice(s.to-o)==e.text.slice(f=e.text.length-(c.length-(s.to-o)))?t={from:s.from,to:s.to,insert:j.of(e.text.slice(s.from-o,f).split(Xt))}:(u=Ea(c,e.text,h-o,O))&&(y.chrome&&l==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==Xt+Xt&&u.toB--,t={from:o+u.from,to:o+u.toA,insert:j.of(e.text.slice(u.from,u.toB).split(Xt))})}else i&&(!r.hasFocus&&n.facet(Je)||Dr(i,s))&&(i=null);if(!t&&!i)return!1;if((y.mac||y.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&r.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:j.of([t.insert.toString().replace("."," ")])}):n.doc.lineAt(s.from).toDate.now()-50?t={from:s.from,to:s.to,insert:n.toText(r.inputState.insertingText)}:y.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&r.lineWrapping&&(i&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:j.of([" "])}),t)return ys(r,t,i,l);if(i&&!Dr(i,s)){let o=!1,a="select";return r.inputState.lastSelectionTime>Date.now()-50&&(r.inputState.lastSelectionOrigin=="select"&&(o=!0),a=r.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=Wa(n.facet(wi).map(h=>h(r)),i))),r.dispatch({selection:i,scrollIntoView:o,userEvent:a}),!0}else return!1}function ys(r,e,t,i=-1){if(y.ios&&r.inputState.flushIOSKey(e))return!0;let n=r.state.selection.main;if(y.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&r.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&jt(r.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||i==8&&e.insert.lengthn.head)&&jt(r.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&jt(r.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();r.inputState.composing>=0&&r.inputState.composing++;let l,o=()=>l||(l=sf(r,e,t));return r.state.facet(ka).some(a=>a(r,e.from,e.to,s,o))||r.dispatch(o()),!0}function sf(r,e,t){let i,n=r.state,s=n.selection.main,l=-1;if(e.from==e.to&&e.froms.to){let a=e.fromc(r)),h,a);e.from==O&&(l=O)}if(l>-1)i={changes:e,selection:S.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&r.inputState.composing<0){let a=s.frome.to?n.sliceDoc(e.to,s.to):"";i=n.replaceSelection(r.state.toText(a+e.insert.sliceString(0,void 0,r.state.lineBreak)+h))}else{let a=n.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(r.inputState.composing>=0||r.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let O=r.state.sliceDoc(e.from,e.to),c,f=t&&_a(r,t.main.head);if(f){let d=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-d}}else c=r.state.doc.lineAt(s.head);let u=s.to-e.to;i=n.changeByRange(d=>{if(d.from==s.from&&d.to==s.to)return{changes:a,range:h||d.map(a)};let p=d.to-u,m=p-O.length;if(r.state.sliceDoc(m,p)!=O||p>=c.from&&m<=c.to)return{range:d};let Q=n.changes({from:m,to:p,insert:e.insert}),x=d.to-s.to;return{changes:Q,range:h?S.range(Math.max(0,h.anchor+x),Math.max(0,h.head+x)):d.map(Q)}})}else i={changes:a,selection:h&&n.selection.replaceRange(h)}}let o="input.type";return(r.composing||r.inputState.compositionPendingChange&&r.inputState.compositionEndedAt>Date.now()-50)&&(r.inputState.compositionPendingChange=!1,o+=".compose",r.inputState.compositionFirstChange&&(o+=".start",r.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:o,scrollIntoView:!0})}function Ea(r,e,t,i){let n=Math.min(r.length,e.length),s=0;for(;s0&&o>0&&r.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(i=="end"){let a=Math.max(0,s-Math.min(l,o));t-=l+a-s}if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}else if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}return{from:s,toA:l,toB:o}}function lf(r){let e=[];if(r.root.activeElement!=r.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:s}=r.observer.selectionRange;return t&&(e.push(new dl(t,i)),(n!=t||s!=i)&&e.push(new dl(n,s))),e}function of(r,e){if(r.length==0)return null;let t=r[0].pos,i=r.length==2?r[1].pos:t;return t<0||i<0?null:t==i?S.create([S.cursor(i+e,-1)]):S.single(t+e,i+e)}function Dr(r,e){return e.head==r.main.head&&e.anchor==r.main.anchor}class af{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,y.safari&&e.contentDOM.addEventListener("input",()=>null),y.gecko&&Pf(e.contentDOM.ownerDocument)}handleEvent(e){!mf(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let n of i.observers)n(this.view,t);for(let n of i.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Of(e),i=this.handlers,n=this.view.contentDOM;for(let s in t)if(s!="scroll"){let l=!t[s].handlers.length,o=i[s];o&&l!=!o.handlers.length&&(n.removeEventListener(s,this.handleEvent),o=null),o||n.addEventListener(s,this.handleEvent,{passive:l})}for(let s in i)s!="scroll"&&!t[s]&&n.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Da.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),y.android&&y.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(y.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(Va.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||cf.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};t.shiftKey&&y.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&hf(this.view.win)&&(t.shiftKey=!1);let i=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t};return setTimeout(()=>{this.pendingIOSKey==i&&this.flushIOSKey()},50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||this.view.observer.pendingRecords().length||t.key=="Enter"&&e&&e.from0?!0:y.safari&&!y.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function hf(r){return r.visualViewport?r.visualViewport.height*r.visualViewport.scale/r.document.documentElement.clientHeight<.85:!1}function pl(r,e){return(t,i)=>{try{return e.call(r,i,t)}catch(n){Ee(t.state,n)}}}function Of(r){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of r){let n=i.spec,s=n&&n.plugin.domEventHandlers,l=n&&n.plugin.domEventObservers;if(s)for(let o in s){let a=s[o];a&&t(o).handlers.push(pl(i.value,a))}if(l)for(let o in l){let a=l[o];a&&t(o).observers.push(pl(i.value,a))}}for(let i in Te)t(i).handlers.push(Te[i]);for(let i in ce)t(i).observers.push(ce[i]);return e}const Va=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],cf="dthko",Da=[16,17,18,20,91,92,224,225],ji=6;function Mi(r){return Math.max(0,r)*.7+8}function ff(r,e){return Math.max(Math.abs(r.clientX-e.clientX),Math.abs(r.clientY-e.clientY))}class uf{constructor(e,t,i,n){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=ha(e.contentDOM),this.atoms=e.state.facet(wi).map(l=>l(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(_.allowMultipleSelections)&&df(e,t),this.dragging=gf(e,t)&&Ua(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&ff(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,n=0,s=0,l=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:o}=this.scrollParents.y.getBoundingClientRect());let a=Ma(this.view);e.clientX-a.left<=n+ji?t=-Mi(n-e.clientX):e.clientX+a.right>=l-ji&&(t=Mi(e.clientX-l)),e.clientY-a.top<=s+ji?i=-Mi(s-e.clientY):e.clientY+a.bottom>=o-ji&&(i=Mi(e.clientY-o)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=Wa(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function df(r,e){let t=r.state.facet($a);return t.length?t[0](e):y.mac?e.metaKey:e.ctrlKey}function pf(r,e){let t=r.state.facet(ya);return t.length?t[0](e):y.mac?!e.altKey:!e.ctrlKey}function gf(r,e){let{main:t}=r.state.selection;if(t.empty)return!1;let i=mi(r.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function mf(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=r.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=N.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const Te=Object.create(null),ce=Object.create(null),La=y.ie&&y.ie_version<15||y.ios&&y.webkit_version<604;function Qf(r){let e=r.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{r.focus(),t.remove(),Ba(r,t.value)},50)}function Rn(r,e,t){for(let i of r.facet(e))t=i(t,r);return t}function Ba(r,e){e=Rn(r.state,Qs,e);let{state:t}=r,i,n=1,s=t.toText(e),l=s.lines==t.selection.ranges.length;if(Lr!=null&&t.selection.ranges.every(a=>a.empty)&&Lr==s.toString()){let a=-1;i=t.changeByRange(h=>{let O=t.doc.lineAt(h.from);if(O.from==a)return{range:h};a=O.from;let c=t.toText((l?s.line(n++).text:e)+t.lineBreak);return{changes:{from:O.from,insert:c},range:S.cursor(h.from+c.length,-1)}})}else l?i=t.changeByRange(a=>{let h=s.line(n++);return{changes:{from:a.from,to:a.to,insert:h.text},range:S.cursor(a.from+h.length,-1)}}):i=t.replaceSelection(s);r.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ce.scroll=r=>{let e=r.inputState;e.lastScrollTop=r.scrollDOM.scrollTop,e.lastScrollLeft=r.scrollDOM.scrollLeft,y.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};ce.wheel=ce.mousewheel=r=>{r.inputState.lastWheelEvent=Date.now()};Te.keydown=(r,e)=>(r.inputState.setSelectionOrigin("select"),e.keyCode==27&&r.inputState.tabFocusMode!=0&&(r.inputState.tabFocusMode=Date.now()+2e3),!1);ce.touchstart=(r,e)=>{let t=r.inputState,i=e.targetTouches[0];t.touchActive=!0,t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};ce.touchmove=r=>{r.inputState.setSelectionOrigin("select.pointer")};ce.touchend=(r,e)=>{r.inputState.touchActive=!1};Te.mousedown=(r,e)=>{if(r.observer.flush(),r.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of r.state.facet(xa))if(t=i(r,e),t)break;if(!t&&e.button==0&&(t=bf(r,e)),t){let i=!r.hasFocus;r.inputState.startMouseSelection(new uf(r,e,t,i)),i&&r.observer.ignore(()=>{fa(r.contentDOM);let s=r.root.activeElement;s&&!s.contains(r.contentDOM)&&s.blur()});let n=r.inputState.mouseSelection;if(n)return n.start(e),n.dragging===!1}else r.inputState.setSelectionOrigin("select.pointer");return!1};function gl(r,e,t,i){if(i==1)return S.cursor(e,t);if(i==2)return Gc(r.state,e,t);{let n=r.docView.lineAt(e,t),s=r.state.doc.lineAt(n?n.posAtEnd:e),l=n?n.posAtStart:s.from,o=n?n.posAtEnd:s.to;return oDate.now()-400&&Math.abs(e.clientX-r.clientX)<2&&Math.abs(e.clientY-r.clientY)<2?(Ql+1)%3:1}function bf(r,e){let t=r.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=Ua(e),n=r.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),n=n.map(s.changes))},get(s,l,o){let a=r.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,O=gl(r,a.pos,a.assoc,i);if(t.pos!=a.pos&&!l){let c=gl(r,t.pos,t.assoc,i),f=Math.min(c.from,O.from),u=Math.max(c.to,O.to);O=f1&&(h=$f(n,a.pos))?h:o?n.addRange(O):S.create([O])}}}function $f(r,e){for(let t=0;t=e)return S.create(r.ranges.slice(0,t).concat(r.ranges.slice(t+1)),r.mainIndex==t?0:r.mainIndex-(r.mainIndex>t?1:0))}return null}Te.dragstart=(r,e)=>{let{selection:{main:t}}=r.state;if(e.target.draggable){let n=r.docView.tile.nearest(e.target);if(n&&n.isWidget()){let s=n.posAtStart,l=s+n.length;(s>=t.to||l<=t.from)&&(t=S.undirectionalRange(s,l))}}let{inputState:i}=r;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Rn(r.state,Ss,r.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Te.dragend=r=>(r.inputState.draggedContent=null,!1);function bl(r,e,t,i){if(t=Rn(r.state,Qs,t),!t)return;let n=r.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=r.inputState,l=i&&s&&pf(r,e)?{from:s.from,to:s.to}:null,o={from:n,insert:t},a=r.state.changes(l?[l,o]:o);r.focus(),r.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:l?"move.drop":"input.drop"}),r.inputState.draggedContent=null}Te.drop=(r,e)=>{if(!e.dataTransfer)return!1;if(r.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),n=0,s=()=>{++n==t.length&&bl(r,e,i.filter(l=>l!=null).join(r.state.lineBreak),!1)};for(let l=0;l{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(i[l]=o.result),s()},o.readAsText(t[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return bl(r,e,i,!0),!0}return!1};Te.paste=(r,e)=>{if(r.state.readOnly)return!0;r.observer.flush();let t=La?null:e.clipboardData;return t?(Ba(r,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Qf(r),!1)};function yf(r,e){let t=r.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),r.focus()},50)}function xf(r){let e=[],t=[],i=!1;for(let n of r.selection.ranges)n.empty||(e.push(r.sliceDoc(n.from,n.to)),t.push(n));if(!e.length){let n=-1;for(let{from:s}of r.selection.ranges){let l=r.doc.lineAt(s);l.number>n&&(e.push(l.text),t.push({from:l.from,to:Math.min(r.doc.length,l.to+1)})),n=l.number}i=!0}return{text:Rn(r,Ss,e.join(r.lineBreak)),ranges:t,linewise:i}}let Lr=null;Te.copy=Te.cut=(r,e)=>{if(!ci(r.contentDOM,r.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:n}=xf(r.state);if(!t&&!n)return!1;Lr=n?t:null,e.type=="cut"&&!r.state.readOnly&&r.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=La?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(yf(r,t),!1)};const Ga=st.define();function Ia(r,e){let t=[];for(let i of r.facet(wa)){let n=i(r,e);n&&t.push(n)}return t.length?r.update({effects:t,annotations:Ga.of(!0)}):null}function Na(r){setTimeout(()=>{let e=r.hasFocus;if(e!=r.inputState.notifiedFocused){let t=Ia(r.state,e);t?r.dispatch(t):r.update([])}},10)}ce.focus=r=>{r.inputState.lastFocusTime=Date.now(),!r.scrollDOM.scrollTop&&(r.inputState.lastScrollTop||r.inputState.lastScrollLeft)&&(r.scrollDOM.scrollTop=r.inputState.lastScrollTop,r.scrollDOM.scrollLeft=r.inputState.lastScrollLeft),Na(r)};ce.blur=r=>{r.observer.clearSelectionRange(),Na(r)};ce.compositionstart=ce.compositionupdate=(r,e)=>{if(!r.observer.editContext&&(r.inputState.compositionFirstChange==null&&(r.inputState.compositionFirstChange=!0),r.inputState.composing<0)){let{main:t}=r.state.selection;!t.empty&&r.lineBlockAt(t.from).from!=r.lineBlockAt(t.to).from&&!r.state.readOnly&&r.dispatch({changes:r.state.selection.ranges.filter(i=>!i.empty).map(i=>({from:i.from,to:i.to})),userEvent:"input"}),r.inputState.composing=0}};ce.compositionend=r=>{r.observer.editContext||(r.inputState.composing=-1,r.inputState.compositionEndedAt=Date.now(),r.inputState.compositionPendingKey=!0,r.inputState.compositionPendingChange=r.observer.pendingRecords().length>0,r.inputState.compositionFirstChange=null,y.chrome&&y.android?r.observer.flushSoon():r.inputState.compositionPendingChange?Promise.resolve().then(()=>r.observer.flush()):setTimeout(()=>{r.inputState.composing<0&&r.docView.hasComposition&&r.update([])},50))};ce.contextmenu=r=>{r.inputState.lastContextMenu=Date.now()};Te.beforeinput=(r,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(r.inputState.insertingText=e.data,r.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&r.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),l=e.getTargetRanges();if(s&&l.length){let o=l[0],a=r.posAtDOM(o.startContainer,o.startOffset),h=r.posAtDOM(o.endContainer,o.endOffset);return ys(r,{from:a,to:h,insert:r.state.toText(s)},null),!0}}let n;if(y.chrome&&y.android&&(n=Va.find(s=>s.inputType==e.inputType))&&(r.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>s+10&&r.hasFocus&&(r.contentDOM.blur(),r.focus())},100)}return y.ios&&e.inputType=="deleteContentForward"&&r.observer.flushSoon(),y.safari&&e.inputType=="insertText"&&r.inputState.composing>=0&&setTimeout(()=>ce.compositionend(r,e),20),!1};const $l=new Set;function Pf(r){$l.has(r)||($l.add(r),r.addEventListener("copy",()=>{}),r.addEventListener("cut",()=>{}))}const yl=["pre-wrap","normal","pre-line","break-spaces"];let Dt=!1;function xl(){Dt=!1}class kf{constructor(e){this.lineWrapping=e,this.doc=j.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return yl.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=n,this.lineLength=s,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Ni&&(Dt=!0),this.height=e)}replace(e,t,i){return Oe.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let s=this,l=i.doc;for(let o=n.length-1;o>=0;o--){let{fromA:a,toA:h,fromB:O,toB:c}=n[o],f=s.lineAt(a,z.ByPosNoHeight,i.setDoc(t),0,0),u=f.to>=h?f:s.lineAt(h,z.ByPosNoHeight,i,0,0);for(c+=u.to-h,h=u.to;o>0&&f.from<=n[o-1].toA;)a=n[o-1].fromA,O=n[o-1].fromB,o--,as*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),i+=1+o.break,n-=o.size}else if(s>n*2){let o=e[i];o.break?e.splice(i,1,o.left,null,o.right):e.splice(i,1,o.left,o.right),i+=2+o.break,s-=o.size}else break;else if(n=s&&l(this.lineAt(0,z.ByPos,i,n,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more&&this.setMeasuredHeight(n),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Se extends Fa{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new ve(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let n=i[0];return i.length==1&&(n instanceof Se||n instanceof ee&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof ee?n=new Se(n.length,this.height,this.spaceAbove):n.height=this.height,this.outdated||(n.outdated=!1),n):Oe.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setMeasuredHeight(n):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ee extends Oe{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,n=e.doc.lineAt(t+this.length).number,s=n-i+1,l,o=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);l=a/s,this.length>s+1&&(o=(this.height-a)/(this.length-s-1))}else l=this.height/s;return{firstLine:i,lastLine:n,perLine:l,perChar:o}}blockAt(e,t,i,n){let{firstLine:s,lastLine:l,perLine:o,perChar:a}=this.heightMetrics(t,n);if(t.lineWrapping){let h=n+(e0){let s=i[i.length-1];s instanceof ee?i[i.length-1]=new ee(s.length+n):i.push(null,new ee(n-1))}if(e>0){let s=i[0];s instanceof ee?i[0]=new ee(e+s.length):i.unshift(new ee(e-1),null)}return Oe.of(i)}decomposeLeft(e,t){t.push(new ee(e-1),null)}decomposeRight(e,t){t.push(null,new ee(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let s=t+this.length;if(n&&n.from<=t+this.length&&n.more){let l=[],o=Math.max(t,n.from),a=-1;for(n.from>t&&l.push(new ee(n.from-t-1).updateHeight(e,t));o<=s&&n.more;){let O=e.doc.lineAt(o).length;l.length&&l.push(null);let c=n.heights[n.index++],f=0;c<0&&(f=-c,c=n.heights[n.index++]),a==-1?a=c:Math.abs(c-a)>=Ni&&(a=-2);let u=new Se(O,c,f);u.outdated=!1,l.push(u),o+=O+1}o<=s&&l.push(null,new ee(s-o).updateHeight(e,o));let h=Oe.of(l);return(a<0||Math.abs(h.height-this.height)>=Ni||Math.abs(a-this.heightMetrics(e,t).perLine)>=Ni)&&(Dt=!0),cn(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Xf extends Oe{constructor(e,t,i){super(e.length+(t?1:0)+i.length,e.height+i.height,(t?1:0)|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,n){let s=i+this.left.height;return eo))return h;let O=t==z.ByPosNoHeight?z.ByPosNoHeight:z.ByPos;return a?h.join(this.right.lineAt(o,O,i,l,o)):this.left.lineAt(o,O,i,n,s).join(h)}forEachLine(e,t,i,n,s,l){let o=n+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,o,a,l);else{let h=this.lineAt(a,z.ByPos,i,n,s);e=e&&h.from<=t&&l(h),t>h.to&&this.right.forEachLine(Math.max(e,h.to+1),t,i,o,a,l)}}replace(e,t,i){let n=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let o of i)s.push(o);if(e>0&&Pl(s,l-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e2*t.size||t.size>2*e.size?Oe.of(this.break?[e,null,t]:[e,t]):(this.left=cn(this.left,e),this.right=cn(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,n){let{left:s,right:l}=this,o=t+s.length+this.break,a=null;return n&&n.from<=t+s.length&&n.more?a=s=s.updateHeight(e,t,i,n):s.updateHeight(e,t,i),n&&n.from<=o+l.length&&n.more?a=l=l.updateHeight(e,o,i,n):l.updateHeight(e,o,i),a?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Pl(r,e){let t,i;r[e]==null&&(t=r[e-1])instanceof ee&&(i=r[e+1])instanceof ee&&r.splice(e-1,3,new ee(t.length+1+i.length))}const Zf=5;class xs{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Se?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Se(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Zf)&&this.addLineDeco(n,s,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Se(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new ee(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Se)return e;let t=new Se(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Se)&&!this.isCovered?this.nodes.push(new Se(0,-1,0)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&O.overflow!="visible"){let c=h.getBoundingClientRect();s=Math.max(s,c.left),l=Math.min(l,c.right),o=Math.max(o,c.top),a=Math.min(h==r.parentNode?n.innerHeight:a,c.bottom)}h=O.position=="absolute"||O.position=="fixed"?h.offsetParent:h.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,a)-(t.top+e)}}function Rf(r){let e=r.getBoundingClientRect(),t=r.ownerDocument.defaultView||window;return e.left0&&e.top0}function jf(r,e){let t=r.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Hn{constructor(e,t,i,n){this.from=e,this.to=t,this.size=i,this.displaySize=n}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new kf(i),this.stateDeco=wl(t),this.heightMap=Oe.empty().applyChanges(this.stateDeco,j.empty,this.heightOracle.setDoc(t.doc),[new ye(0,0,0,t.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=E.set(this.lineGaps.map(n=>n.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let n=i?t.head:t.anchor;if(!e.some(({from:s,to:l})=>n>=s&&n<=l)){let{from:s,to:l}=this.lineBlockAt(n);e.push(new Yi(s,l))}}return this.viewports=e.sort((i,n)=>i.from-n.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Br:fn.get(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(oi(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=wl(this.state);let n=e.changedRanges,s=ye.extendWithRanges(n,Tf(i,this.stateDeco,e?e.changes:K.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);xl(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||Dt)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Pc)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),n=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?I.RTL:I.LTR;let l=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",o=t.getBoundingClientRect(),a=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let h=0,O=0;if(o.width&&o.height){let{scaleX:P,scaleY:Z}=aa(t,o);(P>.005&&Math.abs(this.scaleX-P)>.005||Z>.005&&Math.abs(this.scaleY-Z)>.005)&&(this.scaleX=P,this.scaleY=Z,h|=16,l=a=!0)}let c=(parseInt(i.paddingTop)||0)*this.scaleY,f=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=c||this.paddingBottom!=f)&&(this.paddingTop=c,this.paddingBottom=f,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let u=ha(this.view.contentDOM,!1).y;u!=this.scrollParent&&(this.scrollParent=u,this.scrollAnchorHeight=-1,this.scrollOffset=0);let d=this.getScrollOffset();this.scrollOffset!=d&&(this.scrollAnchorHeight=-1,this.scrollOffset=d),this.scrolledToBottom=ua(this.scrollParent||e.win);let p=(this.printing?jf:Cf)(t,this.paddingTop),m=p.top-this.pixelViewport.top,Q=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(a=!0)),!this.inView&&!this.scrollTarget&&!Rf(e.dom))return 0;let $=o.width;if((this.contentDOMWidth!=$||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),a){let P=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(P)&&(l=!0),l||n.lineWrapping&&Math.abs($-this.contentDOMWidth)>n.charWidth){let{lineHeight:Z,charWidth:v,textHeight:V}=e.docView.measureTextSize();l=Z>0&&n.refresh(s,Z,v,V,Math.max(5,$/v),P),l&&(e.docView.minWidth=0,h|=16)}m>0&&Q>0?O=Math.max(m,Q):m<0&&Q<0&&(O=Math.min(m,Q)),xl();for(let Z of this.viewports){let v=Z.from==this.viewport.from?P:e.docView.measureVisibleLineHeights(Z);this.heightMap=(l?Oe.empty().applyChanges(this.stateDeco,j.empty,this.heightOracle,[new ye(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,l,new wf(Z.from,v))}Dt&&(h|=2)}let A=!this.viewportIsAppropriate(this.viewport,O)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return A&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(O,this.scrollTarget),h|=this.updateForViewport()),(h&2||A)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,a=new Yi(n.lineAt(l-i*1e3,z.ByHeight,s,0,0).from,n.lineAt(o+(1-i)*1e3,z.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let O=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=n.lineAt(h,z.ByPos,s,0,0),f;t.y=="center"?f=(c.top+c.bottom)/2-O/2:t.y=="start"||t.y=="nearest"&&h=o+Math.max(10,Math.min(i,250)))&&n>l-2*1e3&&s>1,l=n<<1;if(this.defaultTextDirection!=I.LTR&&!i)return[];let o=[],a=(O,c,f,u)=>{if(c-OO&&QQ.from>=f.from&&Q.to<=f.to&&Math.abs(Q.from-O)Q.fromx));if(!m){if(c$.from<=c&&$.to>=c)){let $=t.moveToLineBoundary(S.cursor(c),!1,!0).head;$>O&&(c=$)}let Q=this.gapSize(f,O,c,u),x=i||Q<2e6?Q:2e6;m=new Hn(O,c,Q,x)}o.push(m)},h=O=>{if(O.length2e6)for(let Z of e)Z.from>=O.from&&Z.fromO.from&&a(O.from,u,O,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];M.spans(t,this.viewport.from,this.viewport.to,{span(s,l){i.push({from:s,to:l})},point(){}},20);let n=0;if(i.length!=this.visibleRanges.length)n=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||oi(this.heightMap.lineAt(e,z.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||oi(this.heightMap.lineAt(this.scaler.fromDOM(e),z.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+12-this.paddingTop);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return oi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Yi{constructor(e,t){this.from=e,this.to=t}}function Yf(r,e,t){let i=[],n=r,s=0;return M.spans(t,r,e,{span(){},point(l,o){l>n&&(i.push({from:n,to:l}),s+=l-n),n=o}},20),n=1)return e[e.length-1].to;let i=Math.floor(r*t);for(let n=0;;n++){let{from:s,to:l}=e[n],o=l-s;if(i<=o)return s+i;i-=o}}function Wi(r,e){let t=0;for(let{from:i,to:n}of r.ranges){if(e<=n){t+=e-i;break}t+=n-i}return t/r.total}function _f(r,e){for(let t of r)if(e(t))return t}const Br={toDOM(r){return r},fromDOM(r){return r},scale:1,eq(r){return r==this}};function wl(r){let e=r.facet(Tn).filter(i=>typeof i!="function"),t=r.facet($s).filter(i=>typeof i!="function");return t.length&&e.push(M.join(t)),e}class fn{constructor(e,t){this.scale=e,this.viewports=t}static get(e,t,i){let n=0,s=0,l=0,o=i.map(({from:h,to:O})=>{let c=t.lineAt(h,z.ByPos,e,0,0).top,f=t.lineAt(O,z.ByPos,e,0,0).bottom;return n+=f-c,{from:h,to:O,top:c,bottom:f,domTop:0,domBottom:0}});if(t.height-n<10)return Br;let a=(7e6-n)/(t.height-n);for(let h of o)h.domTop=l+(h.top-s)*a,l=h.domBottom=h.domTop+(h.bottom-h.top),s=h.bottom;return new fn(a,o)}toDOM(e){for(let t=0,i=0,n=0;;t++){let s=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function oi(r,e){if(e.scale==1)return r;let t=e.toDOM(r.top),i=e.toDOM(r.bottom);return new ve(r.from,r.length,t,i-t,Array.isArray(r._content)?r._content.map(n=>oi(n,e)):r._content)}const qi=w.define({combine:r=>r.join(" ")}),Ur=w.define({combine:r=>r.indexOf(!0)>-1}),Gr=ft.newName(),Ha=ft.newName(),Ka=ft.newName(),Ja={"&light":"."+Ha,"&dark":"."+Ka};function Ir(r,e,t){return new ft(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return r;if(!t||!t[n])throw new RangeError(`Unsupported selector: ${n}`);return t[n]}):r+" "+i}})}const Wf=Ir("."+Gr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"baseline",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{background:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat",backgroundSize:".4em",backgroundPosition:"calc(min(50%, 0px)) center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ja),qf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Kn=y.ie&&y.ie_version<=11;class zf{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new fc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(y.ie&&y.ie_version<=11||y.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&y.android&&e.constructor.EDIT_CONTEXT!==!1&&!(y.chrome&&y.chrome_version<126)&&(this.editContext=new Vf(e),e.state.facet(Je)&&(e.contentDOM.editContext=this.editContext.editContext)),Kn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(this.pendingRecords().length>0),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(Je)?i.root.activeElement!=this.dom:!ci(this.dom,n))return;let s=n.anchorNode&&i.docView.tile.nearest(n.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(y.ie&&y.ie_version<=11||y.android&&y.chrome)&&!i.state.selection.main.empty&&n.focusNode&&fi(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=mi(e.root);if(!t)return!1;let i=y.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Ef(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let n=ci(this.dom,i);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&jt(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,n=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(n=!0),t==-1?{from:t,to:i}=l:(t=Math.min(l.from,t),i=Math.max(l.to,i)))}return{from:t,to:i,typeOver:n}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),n=this.selectionChanged&&ci(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new rf(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.selectionChanged,i=this.readChange();if(!i)return this.view.requestMeasure(),!1;let n=this.view.state,s=za(this.view,i);return this.view.state==n&&(i.domChanged||t)&&this.view.update([]),s}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let i=vl(t,e.previousSibling||e.target.previousSibling,-1),n=vl(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Je)!=e.state.facet(Je)&&(e.view.contentDOM.editContext=e.state.facet(Je)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function vl(r,e,t){for(;e;){let i=N.get(e);if(i&&i.parent==r)return i;let n=e.parentNode;e=n!=r.dom?n:t>0?e.nextSibling:e.previousSibling}return null}function Xl(r,e){let t=e.startContainer,i=e.startOffset,n=e.endContainer,s=e.endOffset,l=r.docView.domAtPos(r.state.selection.main.anchor,1);return fi(l.node,l.offset,n,s)&&([t,i,n,s]=[n,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:s}}function Ef(r,e){if(e.getComposedRanges){let n=e.getComposedRanges(r.root)[0];if(n)return Xl(r,n)}let t=null;function i(n){n.preventDefault(),n.stopImmediatePropagation(),t=n.getTargetRanges()[0]}return r.contentDOM.addEventListener("beforeinput",i,!0),r.dom.ownerDocument.execCommand("indent"),r.contentDOM.removeEventListener("beforeinput",i,!0),t?Xl(r,t):null}class Vf{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let n=e.state.selection.main,{anchor:s,head:l}=n,o=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:o,drifted:!1});let h=a-o>i.text.length;o==this.from&&sthis.to&&(a=s);let O=Ea(e.state.sliceDoc(o,a),i.text,(h?n.from:n.to)-o,h?"end":null);if(!O){let f=S.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Dr(f,n)||e.dispatch({selection:f,userEvent:"select"});return}let c={from:O.from+o,to:O.toA+o,insert:j.of(i.text.slice(O.from,O.toB).split(` +`))};if((y.mac||y.android)&&c.from==l-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:o,to:a,insert:j.of([i.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let f=this.to-this.from+(c.to-c.from+c.insert.length);ys(e,c,S.single(this.toEditorPos(i.selectionStart,f),this.toEditorPos(i.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let n=[],s=null;for(let l=this.toEditorPos(i.rangeStart),o=this.toEditorPos(i.rangeEnd);l{let n=[];for(let s of i.getTextFormats()){let l=s.underlineStyle,o=s.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(o)){let a=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let n=mi(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,l,o,a,h)=>{if(i)return;let O=h.length-(l-s);if(n&&l>=n.to)if(n.from==s&&n.to==l&&n.insert.eq(h)){n=this.pendingContextChange=null,t+=O,this.to+=O;return}else n=null,this.revertPending(e.state);if(s+=t,l+=t,l<=this.from)this.from+=O,this.to+=O;else if(sthis.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(l),h.toString()),this.to+=O}t+=O}),n&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class X{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(n=>n.forEach(s=>i(s,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||uc(e.parent)||document,this.viewState=new kl(this,e.state||_.create(e)),e.scrollTo&&e.scrollTo.is(Ri)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Zt).map(n=>new Un(n));for(let n of this.plugins)n.update(this);this.observer=new zf(this),this.inputState=new af(this),this.inputState.ensureHandlers(this.plugins),this.docView=new fl(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof H?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,n,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,o=0,a=null;e.some(f=>f.annotation(Ga))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,a=Ia(s,l),a||(o=1));let h=this.observer.delayedAndroidKey,O=null;if(h?(this.observer.clearDelayedAndroidKey(),O=this.observer.readChange(),(O&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(O=null)):this.observer.clear(),s.facet(_.phrases)!=this.state.facet(_.phrases))return this.setState(s);n=an.create(this,s,e),n.flags|=o;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(c&&(c=c.map(f.changes)),f.scrollIntoView){let{main:u}=f.state.selection,{x:d,y:p}=this.state.facet(X.cursorScrollMargin);c=new Mt(u.empty?u:S.cursor(u.head,u.head>u.anchor?-1:1),"nearest","nearest",p,d)}for(let u of f.effects)u.is(Ri)&&(c=u.value.clip(this.state))}this.viewState.update(n,c),this.bidiCache=un.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),t=this.docView.update(n),this.state.facet(li)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(qi)!=n.state.facet(qi)&&(this.viewState.mustMeasureContent=!0),(t||i||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!n.empty)for(let f of this.state.facet(zr))try{f(n)}catch(u){Ee(this.state,u,"update listener")}(a||O)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),O&&!za(this,O)&&h.force&&jt(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new kl(this,e),this.plugins=e.facet(Zt).map(i=>new Un(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new fl(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Zt),i=e.state.facet(Zt);if(t!=i){let n=[];for(let s of i){let l=t.indexOf(s);if(l<0)n.push(new Un(s));else{let o=this.plugins[l];o.mustUpdate=e,n.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,n=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:l,scaleY:o}=this.viewState;Math.abs(n-this.viewState.scrollOffset)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(l<0){if(ua(i||this.win))s=-1,l=this.viewState.heightMap.height/this.viewState.scaleY;else{let d=this.viewState.scrollAnchorAt(n);s=d.from,l=d.top}o=this.viewState.scaleY}this.updateState=1;let h=this.viewState.measure();if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let O=[];h&4||([this.measureRequests,O]=[O,this.measureRequests]);let c=O.map(d=>{try{return d.read(this)}catch(p){return Ee(this.state,p),Zl}}),f=an.create(this,this.state,[]),u=!1;f.flags|=h,t?t.flags|=h:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1)&&!(y.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){n=n+p,i?s<0?i.scrollTop=i.scrollHeight:i.scrollTop+=p:this.win.scrollBy(0,p),l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(zr))a(t)}get themeClasses(){return Gr+" "+(this.state.facet(Ur)?Ka:Ha)+" "+this.state.facet(qi)}updateAttrs(){let e=Tl(this,Ta,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Je)?"true":"false",class:"cm-content",style:`${y.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Tl(this,bs,t);let i=this.observer.ignore(()=>{let n=ll(this.contentDOM,this.contentAttrs,t),s=ll(this.dom,this.editorAttrs,e);return n||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let n of i.effects)if(n.is(X.announce)){t&&(this.announceDOM.textContent="",this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=" "},200),t=!1);let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(li);let e=this.state.facet(X.cspNonce);ft.mount(this.root,this.styleModules.concat(Wf).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Fn(this,e,ul(this,e,t,i))}moveByGroup(e,t){return Fn(this,e,ul(this,e,t,i=>Hc(this,e.head,i)))}visualLineSide(e,t){return t?S.cursor(e.to,1):S.cursor(e.from,-1)}moveToLineBoundary(e,t,i=!0){return Fc(this,e,t,i)}moveVertically(e,t,i){return Fn(this,e,Kc(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=Vr(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Vr(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.state.doc.lineAt(e),n=this.bidiSpans(i),s=n[ze.find(n,e-i.from,-1,t)];return i.length&&(e==i.from&&t<0||e==i.to&&t>0)&&s.dir!=this.textDirectionAt(i.from)&&(e==i.to?(e=i.from+s.from,t=1):(e=i.from+s.to,t=-1)),this.docView.coordsAt(e,t,s.dir==I.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(va)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Df)return Sa(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||Qa(s.isolates,i=hl(this,e))))return s.order;i||(i=hl(this,e));let n=$c(e.text,t,i);return this.bidiCache.push(new un(e.from,e.to,t,i,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||y.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{fa(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,n,s,l;return Ri.of(new Mt(typeof e=="number"?S.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(n=t.x)!==null&&n!==void 0?n:"nearest",(s=t.yMargin)!==null&&s!==void 0?s:5,(l=t.xMargin)!==null&&l!==void 0?l:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Ri.of(new Mt(S.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ge.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ge.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ft.newName(),n=[qi.of(i),li.of(Ir(`.${i}`,e))];return t&&t.dark&&n.push(Ur.of(!0)),n}static baseTheme(e){return wn.lowest(li.of(Ir("."+Gr,e,Ja)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&N.get(i)||N.get(e);return((t=n?.root)===null||t===void 0?void 0:t.view)||null}}X.styleModule=li;X.inputHandler=ka;X.clipboardInputFilter=Qs;X.clipboardOutputFilter=Ss;X.scrollHandler=Xa;X.focusChangeEffect=wa;X.perLineTextDirection=va;X.exceptionSink=Pa;X.updateListener=zr;X.editable=Je;X.mouseSelectionStyle=xa;X.dragMovesSelection=ya;X.clickAddsSelectionRange=$a;X.decorations=Tn;X.blockWrappers=Aa;X.outerDecorations=$s;X.atomicRanges=wi;X.bidiIsolatedRanges=Ca;X.cursorScrollMargin=w.define({combine:r=>{let e=5,t=5;for(let i of r)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});X.scrollMargins=ja;X.darkTheme=Ur;X.cspNonce=w.define({combine:r=>r.length?r[0]:""});X.contentAttributes=bs;X.editorAttributes=Ta;X.lineWrapping=X.contentAttributes.of({class:"cm-lineWrapping"});X.announce=L.define();const Df=4096,Zl={};class un{constructor(e,t,i,n,s,l){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=s,this.order=l}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],n=e.length?e[e.length-1].dir:I.LTR;for(let s=Math.max(0,e.length-10);s=0;n--){let s=i[n],l=typeof s=="function"?s(r):s;l&&ps(l,t)}return t}const Lf=y.mac?"mac":y.windows?"win":y.linux?"linux":"key";function Bf(r,e){const t=r.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let n,s,l,o;for(let a=0;ai.concat(n),[]))),t}let ht=null;const If=4e3;function Nf(r,e=Lf){let t=Object.create(null),i=Object.create(null),n=(l,o)=>{let a=i[l];if(a==null)i[l]=o;else if(a!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},s=(l,o,a,h,O)=>{var c,f;let u=t[l]||(t[l]=Object.create(null)),d=o.split(/ (?!$)/).map(Q=>Bf(Q,e));for(let Q=1;Q{let A=ht={view:$,prefix:x,scope:l};return setTimeout(()=>{ht==A&&(ht=null)},If),!0}]})}let p=d.join(" ");n(p,!1);let m=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:((f=(c=u._any)===null||c===void 0?void 0:c.run)===null||f===void 0?void 0:f.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0),O&&(m.stopPropagation=!0)};for(let l of r){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of o){let O=t[h]||(t[h]=Object.create(null));O._any||(O._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:c}=l;for(let f in O)O[f].run.push(u=>c(u,Nr))}let a=l[e]||l.key;if(a)for(let h of o)s(h,a,l.run,l.preventDefault,l.stopPropagation),l.shift&&s(h,"Shift-"+a,l.shift,l.preventDefault,l.stopPropagation)}return t}let Nr=null;function Ff(r,e,t,i){Nr=e;let n=MO(e),s=BO(n,0),l=UO(s)==n.length&&n!=" ",o="",a=!1,h=!1,O=!1;ht&&ht.view==t&&ht.scope==i&&(o=ht.prefix+" ",Da.indexOf(e.keyCode)<0&&(h=!0,ht=null));let c=new Set,f=m=>{if(m){for(let Q of m.run)if(!c.has(Q)&&(c.add(Q),Q(t)))return m.stopPropagation&&(O=!0),!0;m.preventDefault&&(m.stopPropagation&&(O=!0),h=!0)}return!1},u=r[i],d,p;return u&&(f(u[o+zi(n,e,!l)])?a=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(y.windows&&e.ctrlKey&&e.altKey)&&!(y.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(d=YO[e.keyCode])&&d!=n?(f(u[o+zi(d,e,!0)])||e.shiftKey&&(p=_O[e.keyCode])!=n&&p!=d&&f(u[o+zi(p,e,!1)]))&&(a=!0):l&&e.shiftKey&&f(u[o+zi(n,e,!0)])&&(a=!0),!a&&f(u._any)&&(a=!0)),h&&(a=!0),a&&O&&e.stopPropagation(),Nr=null,a}function Cl(r,e,t,i,n){e.lastIndex=0;for(let s=r.iterRange(t,i),l=t,o;!s.next().done;l+=s.value.length)if(!s.lineBreak)for(;o=e.exec(s.value);)n(l+o.index,o)}function Hf(r,e){let t=r.visibleRanges;if(t.length==1&&t[0].from==r.viewport.from&&t[0].to==r.viewport.to)return t;let i=[];for(let{from:n,to:s}of t)n=Math.max(r.state.doc.lineAt(n).from,n-e),s=Math.min(r.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=n?i[i.length-1].to=s:i.push({from:n,to:s});return i}class Kf{constructor(e){const{regexp:t,decoration:i,decorate:n,boundary:s,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,n)this.addMatch=(o,a,h,O)=>n(O,h,h+o[0].length,o,a);else if(typeof i=="function")this.addMatch=(o,a,h,O)=>{let c=i(o,a,h);c&&O(h,h+o[0].length,c)};else if(i)this.addMatch=(o,a,h,O)=>O(h,h+o[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=l}createDeco(e){let t=new $t,i=t.add.bind(t);for(let{from:n,to:s}of Hf(e,this.maxLength))Cl(e.state.doc,this.regexp,n,s,(l,o)=>this.addMatch(o,e,l,i));return t.finish()}updateDeco(e,t){let i=1e9,n=-1;return e.docChanged&&e.changes.iterChanges((s,l,o,a)=>{a>=e.view.viewport.from&&o<=e.view.viewport.to&&(i=Math.min(o,i),n=Math.max(a,n))}),e.viewportMoved||n-i>1e3?this.createDeco(e.view):n>-1?this.updateRange(e.view,t.map(e.changes),i,n):t}updateRange(e,t,i,n){for(let s of e.visibleRanges){let l=Math.max(s.from,i),o=Math.min(s.to,n);if(o>=l){let a=e.state.doc.lineAt(l),h=a.toa.from;l--)if(this.boundary.test(a.text[l-1-a.from])){O=l;break}for(;of.push(Q.range(p,m));if(a==h)for(this.regexp.lastIndex=O-a.from;(u=this.regexp.exec(a.text))&&u.indexthis.addMatch(m,e,p,d));t=t.update({filterFrom:O,filterTo:c,filter:(p,m)=>pc,add:f})}}return t}}class Pt extends ct{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Pt.prototype.elementClass="";Pt.prototype.toDOM=void 0;Pt.prototype.mapMode=he.TrackBefore;Pt.prototype.startSide=Pt.prototype.endSide=-1;Pt.prototype.point=!0;const Jn=w.define(),Jf=w.define(),Fi=w.define(),Rl=w.define({combine:r=>r.some(e=>e)});function eu(r){return[tu]}const tu=Ge.fromClass(class{constructor(r){this.view=r,this.domAfter=null,this.prevViewport=r.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=r.state.facet(Fi).map(e=>new Ml(r,e)),this.fixed=!r.state.facet(Rl);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),r.scrollDOM.insertBefore(this.dom,r.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(r){if(this.updateGutters(r)){let e=this.prevViewport,t=r.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(r.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Rl)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=r.view.viewport}syncGutters(r){let e=this.dom.nextSibling;r&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=M.iter(this.view.state.facet(Jn),this.view.viewport.from),i=[],n=this.gutters.map(s=>new iu(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let l=!0;for(let o of s.type)if(o.type==ge.Text&&l){Fr(t,i,o.from);for(let a of n)a.line(this.view,o,i);l=!1}else if(o.widget)for(let a of n)a.widget(this.view,o)}else if(s.type==ge.Text){Fr(t,i,s.from);for(let l of n)l.line(this.view,s,i)}else if(s.widget)for(let l of n)l.widget(this.view,s);for(let s of n)s.finish();r&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(r){let e=r.startState.facet(Fi),t=r.state.facet(Fi),i=r.docChanged||r.heightChanged||r.viewportChanged||!M.eq(r.startState.facet(Jn),r.state.facet(Jn),r.view.viewport.from,r.view.viewport.to);if(e==t)for(let n of this.gutters)n.update(r)&&(i=!0);else{i=!0;let n=[];for(let s of t){let l=e.indexOf(s);l<0?n.push(new Ml(this.view,s)):(this.gutters[l].update(r),n.push(this.gutters[l]))}for(let s of this.gutters)s.dom.remove(),n.indexOf(s)<0&&s.destroy();for(let s of n)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=n}return i}destroy(){for(let r of this.gutters)r.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:r=>X.scrollMargins.of(e=>{let t=e.plugin(r);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,n=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==I.LTR?{left:i,right:n}:{right:i,left:n}})});function jl(r){return Array.isArray(r)?r:[r]}function Fr(r,e,t){for(;r.value&&r.from<=t;)r.from==t&&e.push(r.value),r.next()}class iu{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=M.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:n}=this,s=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==n.elements.length){let o=new eh(e,l,s,i);n.elements.push(o),n.dom.appendChild(o.dom)}else n.elements[this.i].update(e,l,s,i);this.height=t.bottom,this.i++}line(e,t,i){let n=[];Fr(this.cursor,n,t.from),i.length&&(n=n.concat(i));let s=this.gutter.config.lineMarker(e,t,n);s&&n.unshift(s);let l=this.gutter;n.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,n)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),n=i?[i]:null;for(let s of e.state.facet(Jf)){let l=s(e,t.widget,t);l&&(n||(n=[])).push(l)}n&&this.addElement(e,t,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Ml{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,n=>{let s=n.target,l;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=n.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[i](e,o,n)&&n.preventDefault()});this.markers=jl(t.markers(e)),t.initialSpacer&&(this.spacer=new eh(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=jl(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}let i=e.view.viewport;return!M.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class eh{constructor(e,t,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,n)}update(e,t,i,n){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),nu(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,t){let i="cm-gutterElement",n=this.dom.firstChild;for(let s=0,l=0;;){let o=l,a=ss(o,a,h)||l(o,a,h):l}return i}})}});class er extends Pt{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function tr(r,e){return r.state.facet(Tt).formatNumber(e,r.state)}const lu=Fi.compute([Tt],r=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(ru)},lineMarker(e,t,i){return i.some(n=>n.toDOM)?null:new er(tr(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let n of e.state.facet(su)){let s=n(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Tt)!=e.state.facet(Tt),initialSpacer(e){return new er(tr(e,Yl(e.state.doc.lines)))},updateSpacer(e,t){let i=tr(t.view,Yl(t.view.state.doc.lines));return i==e.number?e:new er(i)},domEventHandlers:r.facet(Tt).domEventHandlers,side:"before"}));function ou(r={}){return[Tt.of(r),eu(),lu]}function Yl(r){let e=9;for(;e{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=fe.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}C.closedBy=new C({deserialize:r=>r.split(" ")});C.openedBy=new C({deserialize:r=>r.split(" ")});C.group=new C({deserialize:r=>r.split(" ")});C.isolate=new C({deserialize:r=>{if(r&&r!="rtl"&&r!="ltr"&&r!="auto")throw new RangeError("Invalid value for isolate: "+r);return r||"auto"}});C.contextHash=new C({perNode:!0});C.lookAhead=new C({perNode:!0});C.mounted=new C({perNode:!0});class Yt{constructor(e,t,i,n=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=n}static get(e){return e&&e.props&&e.props[C.mounted.id]}}const hu=Object.create(null);class fe{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):hu,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new fe(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(n)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return n}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(C.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let n of i.split(" "))t[n]=e[i];return i=>{for(let n=i.prop(C.group),s=-1;s<(n?n.length:0);s++){let l=t[s<0?i.name:n[s]];if(l)return l}}}}fe.none=new fe("",Object.create(null),0,8);class ks{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|Y.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=n&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(o||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Xs(fe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,n)=>new U(this.type,t,i,n,this.propValues),e.makeTree||((t,i,n)=>new U(fe.none,t,i,n)))}static build(e){return uu(e)}}U.empty=new U(fe.none,[],[],0);class ws{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ws(this.buffer,this.index)}}class dt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return fe.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,i){let n=this.buffer,s=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Si(r,e,t,i){for(var n;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to0?o.length:-1;e!=h;e+=t){let O=o[e],c=a[e]+l.from,f;if(!(!(s&Y.EnterBracketed&&O instanceof U&&(f=Yt.get(O))&&!f.overlay&&f.bracketed&&i>=c&&i<=c+O.length)&&!ih(n,i,c,c+O.length))){if(O instanceof dt){if(s&Y.ExcludeBuffers)continue;let u=O.findChild(0,O.buffer.length,t,i-c,n);if(u>-1)return new Ve(new Ou(l,O,e,c),null,u)}else if(s&Y.IncludeAnonymous||!O.type.isAnonymous||vs(O)){let u;if(!(s&Y.IgnoreMounts)&&(u=Yt.get(O))&&!u.overlay)return new re(u.tree,c,e,l);let d=new re(O,c,e,l);return s&Y.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?O.children.length-1:0,t,i,n,s)}}}if(s&Y.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let n;if(!(i&Y.IgnoreOverlays)&&(n=Yt.get(this._tree))&&n.overlay){let s=e-this.from,l=i&Y.EnterBracketed&&n.bracketed;for(let{from:o,to:a}of n.overlay)if((t>0||l?o<=s:o=s:a>s))return new re(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Wl(r,e,t,i){let n=r.cursor(),s=[];if(!n.firstChild())return s;if(t!=null){for(let l=!1;!l;)if(l=n.type.is(t),!n.nextSibling())return s}for(;;){if(i!=null&&n.type.is(i))return s;if(n.type.is(e)&&s.push(n.node),!n.nextSibling())return i==null?s:[]}}function Hr(r,e,t=e.length-1){for(let i=r;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Ou{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class Ve extends nh{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new Ve(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&Y.ExcludeBuffers)return null;let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Ve(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Ve(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Ve(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,s=i.buffer[this.index+3];if(s>n){let l=i.buffer[this.index+1];e.push(i.slice(n,s,l)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function rh(r){if(!r.length)return null;let e=0,t=r[0];for(let s=1;st.from||l.to=e){let o=new re(l.tree,l.overlay[0].from+s.from,-1,s);(n||(n=[i])).push(Si(o,e,t,!1))}}return n?rh(n):i}class dn{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Y.EnterBracketed,e instanceof re)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=i+n.buffer[e+1],this.to=i+n.buffer[e+2],!0}yield(e){return e?e instanceof re?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:n}=this.buffer,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&Y.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Y.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Y.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:n}=this;if(n){if(e>0){if(this.index-1)for(let s=t+e,l=e<0?-1:i._tree.children.length;s!=l;s+=e){let o=i._tree.children[s];if(this.mode&Y.IncludeAnonymous||o instanceof dt||!o.type.isAnonymous||vs(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let l=e;l;l=l._parent)if(l.index==n){if(n==this.index)return l;t=l,i=s+1;break e}n=this.stack[--s]}for(let n=i;n=0;s--){if(s<0)return Hr(this._tree,e,n);let l=i[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[n]&&e[n]!=l.name)return!1;n--}}return!0}}function vs(r){return r.children.some(e=>e instanceof dt||!e.type.isAnonymous||vs(e))}function uu(r){var e;let{buffer:t,nodeSet:i,maxBufferLength:n=th,reused:s=[],minRepeatType:l=i.types.length}=r,o=Array.isArray(t)?new ws(t,t.length):t,a=i.types,h=0,O=0;function c(P,Z,v,V,W,G){let{id:R,start:T,end:D,size:B}=o,te=O,Ie=h;if(B<0)if(o.next(),B==-1){let Ne=s[R];v.push(Ne),V.push(T-P);return}else if(B==-3){h=R;return}else if(B==-4){O=R;return}else throw new RangeError(`Unrecognized record size: ${B}`);let Ht=a[R],Zi,gt,Ls=T-P;if(D-T<=n&&(gt=m(o.pos-Z,W))){let Ne=new Uint16Array(gt.size-gt.skip),oe=o.pos-gt.size,we=Ne.length;for(;o.pos>oe;)we=Q(gt.start,Ne,we);Zi=new dt(Ne,D-gt.start,i),Ls=gt.start-P}else{let Ne=o.pos-B;o.next();let oe=[],we=[],Re=R>=l?R:-1,Fe=0,wt=D,Kt=te;for(;o.pos>Ne;)Re>=0&&o.id==Re&&o.size>=0?(o.end<=wt-n&&(d(oe,we,T,Fe,o.end,wt,Re,Kt,Ie),Fe=oe.length,wt=o.end,Kt=O),o.next()):G>2500?f(T,Ne,oe,we):(Re>=0&&o.size==-1&&s[o.id].type==i.types[Re]&&(Fe=0&&Fe>0&&Fe-1&&Fe>0){let Bs=u(Ht,Ie);Zi=Xs(Ht,oe,we,0,oe.length,0,D-T,Bs,Bs)}else Zi=p(Ht,oe,we,D-T,te-D,Ie)}v.push(Zi),V.push(Ls)}function f(P,Z,v,V){let W=[],G=0,R=-1;for(;o.pos>Z;){let{id:T,start:D,end:B,size:te}=o;if(te>4)o.next();else{if(R>-1&&D=0;B-=3)T[te++]=W[B],T[te++]=W[B+1]-D,T[te++]=W[B+2]-D,T[te++]=te;v.push(new dt(T,W[2]-D,i)),V.push(D-P)}}function u(P,Z){return(v,V,W)=>{let G=0,R=v.length-1,T,D;if(R>=0&&(T=v[R])instanceof U){if(!R&&T.type==P&&T.length==W)return T;(D=T.prop(C.lookAhead))&&(G=V[R]+T.length+D-W)}return p(P,v,V,W,G,Z)}}function d(P,Z,v,V,W,G,R,T,D){let B=[],te=[];for(;P.length>V;)B.push(P.pop()),te.push(Z.pop()+v-W);P.push(p(i.types[R],B,te,G-W,T-G,D)),Z.push(W-v)}function p(P,Z,v,V,W,G,R){if(G){let T=[C.contextHash,G];R=R?[T].concat(R):[T]}if(W>25){let T=[C.lookAhead,W];R=R?[T].concat(R):[T]}return new U(P,Z,v,V,R)}function m(P,Z){let v=o.fork(),V=0,W=0,G=0,R=v.end-n,T={size:0,start:0,skip:0};e:for(let D=v.pos-P;v.pos>D;){let B=v.size;if(v.id==Z&&B>=0){T.size=V,T.start=W,T.skip=G,G+=4,V+=4,v.next();continue}let te=v.pos-B;if(B<0||te=l?4:0,Ht=v.start;for(v.next();v.pos>te;){if(v.size<0)if(v.size==-3||v.size==-4)Ie+=4;else break e;else v.id>=l&&(Ie+=4);v.next()}W=Ht,V+=B,G+=Ie}return(Z<0||V==P)&&(T.size=V,T.start=W,T.skip=G),T.size>4?T:void 0}function Q(P,Z,v){let{id:V,start:W,end:G,size:R}=o;if(o.next(),R>=0&&V4){let D=o.pos-(R-4);for(;o.pos>D;)v=Q(P,Z,v)}Z[--v]=T,Z[--v]=G-P,Z[--v]=W-P,Z[--v]=V}else R==-3?h=V:R==-4&&(O=V);return v}let x=[],$=[];for(;o.pos>0;)c(r.start||0,r.bufferStart||0,x,$,-1,0);let A=(e=r.length)!==null&&e!==void 0?e:x.length?$[0]+x[0].length:0;return new U(a[r.topID],x.reverse(),$.reverse(),A)}const ql=new WeakMap;function Hi(r,e){if(!r.isAnonymous||e instanceof dt||e.type!=r)return 1;let t=ql.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=r||!(i instanceof U)){t=1;break}t+=Hi(r,i)}ql.set(e,t)}return t}function Xs(r,e,t,i,n,s,l,o,a){let h=0;for(let d=i;d=O)break;Z+=v}if($==A+1){if(Z>O){let v=d[A];u(v.children,v.positions,0,v.children.length,p[A]+x);continue}c.push(d[A])}else{let v=p[$-1]+d[$-1].length-P;c.push(Xs(r,d,p,A,$,P,v,null,a))}f.push(P+x-s)}}return u(e,t,i,n,0),(o||a)(c,f,l)}class sh{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let n=this.map.get(e);n||this.map.set(e,n=new Map),n.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Ve?this.setBuffer(e.context.buffer,e.index,t):e instanceof re&&this.map.set(e.tree,t)}get(e){return e instanceof Ve?this.getBuffer(e.context.buffer,e.index):e instanceof re?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class it{constructor(e,t,i,n,s=!1,l=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let n=[new it(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&n.push(s);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],s=1,l=e.length?e[0]:null;for(let o=0,a=0,h=0;;o++){let O=o=i)for(;l&&l.from=f.from||c<=f.to||h){let u=Math.max(f.from,a)-h,d=Math.min(f.to,c)-h;f=u>=d?null:new it(u,d,f.tree,f.offset+h,o>0,!!O)}if(f&&n.push(f),l.to>c)break;l=snew xe(n.from,n.to)):[new xe(0,0)]:[new xe(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let s=n.advance();if(s)return s}}}class du{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function pu(r){return(e,t,i,n)=>new mu(e,r,t,i,n)}class zl{constructor(e,t,i,n,s,l){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=n,this.target=s,this.from=l}}function El(r){if(!r.length||r.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}class gu{constructor(e,t,i,n,s,l,o,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=n,this.start=s,this.bracketed=l,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const oh=new C({perNode:!0});class mu{constructor(e,t,i,n,s){this.nest=t,this.input=i,this.fragments=n,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new U(i.type,i.children,i.positions,i.length,i.propValues.concat([[oh,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[C.mounted.id]=new Yt(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)o=!1;else if(e.hasNode(n)){if(t){let h=t.mounts.find(O=>O.frag.from<=n.from&&O.frag.to>=n.to&&O.mount.overlay);if(h)for(let O of h.mount.overlay){let c=O.from+h.pos,f=O.to+h.pos;c>=n.from&&f<=n.to&&!t.ranges.some(u=>u.fromc)&&t.ranges.push({from:c,to:f})}}o=!1}else if(i&&(l=Qu(i.ranges,n.from,n.to)))o=l!=2;else if(!n.type.isAnonymous&&(s=this.nest(n,this.input))&&(n.fromnew xe(c.from-n.from,c.to-n.from)):null,!!s.bracketed,n.tree,O.length?O[0].from:n.from)),s.overlay?O.length&&(i={ranges:O,depth:0,prev:i}):o=!1}}else if(t&&(a=t.predicate(n))&&(a===!0&&(a=new xe(n.from,n.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(o&&n.firstChild())t&&t.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break e;if(t&&!--t.depth){let h=Bl(this.ranges,t.ranges);h.length&&(El(h),this.inner.splice(t.index,0,new zl(t.parser,t.parser.startParse(this.input,Ul(t.mounts,h),h),t.ranges.map(O=>new xe(O.from-t.start,O.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Qu(r,e,t){for(let i of r){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Vl(r,e,t,i,n,s){if(e=i&&t.enter(i,1,Y.IncludeAnonymous|Y.IgnoreMounts|Y.IgnoreOverlays|Y.ExcludeBuffers)))if(t.to<=i)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}function Ll(r){let e=r.tree.prop(oh);return e==null?r.to:Math.min(r.to,e-r.offset)}let bu=class{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=Ll(t),this.inner=new Dl(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=Ll(e),this.inner=new Dl(e.tree,-e.offset)}}findMounts(e,t){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(i=s.tree)===null||i===void 0?void 0:i.prop(C.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=s.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:s.from-a.offset,mount:l})}}}return n}};function Bl(r,e){let t=null,i=e;for(let n=1,s=0;n=o)break;a.to<=l||(t||(i=t=e.slice()),a.fromo&&t.splice(s+1,0,new xe(o,a.to))):a.to>o?t[s--]=new xe(o,a.to):t.splice(s--,1))}}return i}function $u(r,e,t,i){let n=0,s=0,l=!1,o=!1,a=-1e9,h=[];for(;;){let O=n==r.length?1e9:l?r[n].to:r[n].from,c=s==e.length?1e9:o?e[s].to:e[s].from;if(l!=o){let f=Math.max(a,t),u=Math.min(O,c,i);fnew xe(f.from+i,f.to+i)),c=$u(e,O,a,h);for(let f=0,u=a;;f++){let d=f==c.length,p=d?h:c[f].from;if(p>u&&t.push(new it(u,p,n.tree,-l,s.from>=u||s.openStart,s.to<=p||s.openEnd)),d)break;u=c[f].to}}else t.push(new it(a,h,n.tree,-l,s.from>=l||s.openStart,s.to<=o||s.openEnd))}return t}let yu=0;class $e{constructor(e,t,i,n){this.name=e,this.set=t,this.base=i,this.modified=n,this.id=yu++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof $e&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let n=new $e(i,[],null,[]);if(n.set.push(n),t)for(let s of t.set)n.set.push(s);return n}static defineModifier(e){let t=new pn(e);return i=>i.modified.indexOf(t)>-1?i:pn.get(i.base||i,i.modified.concat(t).sort((n,s)=>n.id-s.id))}}let xu=0;class pn{constructor(e){this.name=e,this.instances=[],this.id=xu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(o=>o.base==e&&Pu(t,o.modified));if(i)return i;let n=[],s=new $e(e.name,n,e,t);for(let o of t)o.instances.push(s);let l=ku(t);for(let o of e.set)if(!o.modified.length)for(let a of l)n.push(pn.get(o,a));return s}}function Pu(r,e){return r.length==e.length&&r.every((t,i)=>t==e[i])}function ku(r){let e=[[]];for(let t=0;ti.length-t.length)}function jn(r){let e=Object.create(null);for(let t in r){let i=r[t];Array.isArray(i)||(i=[i]);for(let n of t.split(" "))if(n){let s=[],l=2,o=n;for(let c=0;;){if(o=="..."&&c>0&&c+3==n.length){l=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!f)throw new RangeError("Invalid path: "+n);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),c+=f[0].length,c==n.length)break;let u=n[c++];if(c==n.length&&u=="!"){l=0;break}if(u!="/")throw new RangeError("Invalid path: "+n);o=n.slice(c)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+n);let O=new bi(i,l,a>0?s.slice(0,a):null);e[h]=O.sort(e[h])}}return ah.add(e)}const ah=new C({combine(r,e){let t,i,n;for(;r||e;){if(!r||e&&r.depth<=e.depth?(n=e,e=e.next):(n=r,r=r.next),t&&t.mode==n.mode&&!n.context&&!t.context)continue;let s=new bi(n.tags,n.mode,n.context);t?t.next=s:i=s,t=s}return i}});class bi{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=n;for(let o of s)for(let a of o.set){let h=t[a.id];if(h){l=l?l+" "+h:h;break}}return l},scope:i}}function wu(r,e){let t=null;for(let i of r){let n=i.style(e);n&&(t=t?t+" "+n:n)}return t}function vu(r,e,t,i=0,n=r.length){let s=new Xu(i,Array.isArray(e)?e:[e],t);s.highlightRange(r.cursor(),i,n,"",s.highlighters),s.flush(n)}class Xu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,n,s){let{type:l,from:o,to:a}=e;if(o>=i||a<=t)return;l.isTop&&(s=this.highlighters.filter(u=>!u.scope||u.scope(l)));let h=n,O=Zu(e)||bi.empty,c=wu(s,O.tags);if(c&&(h&&(h+=" "),h+=c,O.mode==1&&(n+=(n?" ":"")+c)),this.startSpan(Math.max(t,o),h),O.opaque)return;let f=e.tree&&e.tree.prop(C.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+o,1),d=this.highlighters.filter(m=>!m.scope||m.scope(f.tree.type)),p=e.firstChild();for(let m=0,Q=o;;m++){let x=m=$||!e.nextSibling())););if(!x||$>i)break;Q=x.to+o,Q>t&&(this.highlightRange(u.cursor(),Math.max(t,x.from+o),Math.min(i,Q),"",d),this.startSpan(Math.min(i,Q),h))}p&&e.parent()}else if(e.firstChild()){f&&(n="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,n,s),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Zu(r){let e=r.type.prop(ah);for(;e&&e.context&&!r.matchContext(e.context);)e=e.next;return e||null}const b=$e.define,Vi=b(),lt=b(),Gl=b(lt),Il=b(lt),ot=b(),Di=b(ot),ir=b(ot),_e=b(),mt=b(_e),Me=b(),Ye=b(),Kr=b(),ti=b(Kr),Li=b(),g={comment:Vi,lineComment:b(Vi),blockComment:b(Vi),docComment:b(Vi),name:lt,variableName:b(lt),typeName:Gl,tagName:b(Gl),propertyName:Il,attributeName:b(Il),className:b(lt),labelName:b(lt),namespace:b(lt),macroName:b(lt),literal:ot,string:Di,docString:b(Di),character:b(Di),attributeValue:b(Di),number:ir,integer:b(ir),float:b(ir),bool:b(ot),regexp:b(ot),escape:b(ot),color:b(ot),url:b(ot),keyword:Me,self:b(Me),null:b(Me),atom:b(Me),unit:b(Me),modifier:b(Me),operatorKeyword:b(Me),controlKeyword:b(Me),definitionKeyword:b(Me),moduleKeyword:b(Me),operator:Ye,derefOperator:b(Ye),arithmeticOperator:b(Ye),logicOperator:b(Ye),bitwiseOperator:b(Ye),compareOperator:b(Ye),updateOperator:b(Ye),definitionOperator:b(Ye),typeOperator:b(Ye),controlOperator:b(Ye),punctuation:Kr,separator:b(Kr),bracket:ti,angleBracket:b(ti),squareBracket:b(ti),paren:b(ti),brace:b(ti),content:_e,heading:mt,heading1:b(mt),heading2:b(mt),heading3:b(mt),heading4:b(mt),heading5:b(mt),heading6:b(mt),contentSeparator:b(_e),list:b(_e),quote:b(_e),emphasis:b(_e),strong:b(_e),link:b(_e),monospace:b(_e),strikethrough:b(_e),inserted:b(),deleted:b(),changed:b(),invalid:b(),meta:Li,documentMeta:b(Li),annotation:b(Li),processingInstruction:b(Li),definition:$e.defineModifier("definition"),constant:$e.defineModifier("constant"),function:$e.defineModifier("function"),standard:$e.defineModifier("standard"),local:$e.defineModifier("local"),special:$e.defineModifier("special")};for(let r in g){let e=g[r];e instanceof $e&&(e.name=r)}hh([{tag:g.link,class:"tok-link"},{tag:g.heading,class:"tok-heading"},{tag:g.emphasis,class:"tok-emphasis"},{tag:g.strong,class:"tok-strong"},{tag:g.keyword,class:"tok-keyword"},{tag:g.atom,class:"tok-atom"},{tag:g.bool,class:"tok-bool"},{tag:g.url,class:"tok-url"},{tag:g.labelName,class:"tok-labelName"},{tag:g.inserted,class:"tok-inserted"},{tag:g.deleted,class:"tok-deleted"},{tag:g.literal,class:"tok-literal"},{tag:g.string,class:"tok-string"},{tag:g.number,class:"tok-number"},{tag:[g.regexp,g.escape,g.special(g.string)],class:"tok-string2"},{tag:g.variableName,class:"tok-variableName"},{tag:g.local(g.variableName),class:"tok-variableName tok-local"},{tag:g.definition(g.variableName),class:"tok-variableName tok-definition"},{tag:g.special(g.variableName),class:"tok-variableName2"},{tag:g.definition(g.propertyName),class:"tok-propertyName tok-definition"},{tag:g.typeName,class:"tok-typeName"},{tag:g.namespace,class:"tok-namespace"},{tag:g.className,class:"tok-className"},{tag:g.macroName,class:"tok-macroName"},{tag:g.propertyName,class:"tok-propertyName"},{tag:g.operator,class:"tok-operator"},{tag:g.comment,class:"tok-comment"},{tag:g.meta,class:"tok-meta"},{tag:g.invalid,class:"tok-invalid"},{tag:g.punctuation,class:"tok-punctuation"}]);var nr;const At=new C;function Oh(r){return w.define({combine:r?e=>e.concat(r):void 0})}const Zs=new C;class Ze{constructor(e,t,i=[],n=""){this.data=e,this.name=n,_.prototype.hasOwnProperty("tree")||Object.defineProperty(_.prototype,"tree",{get(){return se(this)}}),this.parser=t,this.extension=[Ut.of(this),_.languageData.of((s,l,o)=>{let a=Nl(s,l,o),h=a.type.prop(At);if(!h)return[];let O=s.facet(h),c=a.type.prop(Zs);if(c){let f=a.resolve(l-a.from,o);for(let u of c)if(u.test(f,s)){let d=s.facet(u.facet);return u.type=="replace"?d:d.concat(O)}}return O})].concat(i)}isActiveAt(e,t,i=-1){return Nl(e,t,i).type.prop(At)==this.data}findRegions(e){let t=e.facet(Ut);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(s,l)=>{if(s.prop(At)==this.data){i.push({from:l,to:l+s.length});return}let o=s.prop(C.mounted);if(o){if(o.tree.prop(At)==this.data){if(o.overlay)for(let a of o.overlay)i.push({from:a.from+l,to:a.to+l});else i.push({from:l,to:l+s.length});return}else if(o.overlay){let a=i.length;if(n(o.tree,o.overlay[0].from+l),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Lt(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function se(r){let e=r.field(Ze.state,!1);return e?e.tree:U.empty}class Tu{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let ii=null;class gn{constructor(e,t,i=[],n,s,l,o,a){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new gn(e,t,[],U.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Tu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=U.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(it.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ii;ii=this;try{return e()}finally{ii=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Fl(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,O,c,f)=>a.push({fromA:h,toA:O,fromB:c,toB:f})),i=it.applyChanges(i,a),n=U.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let O=e.mapPos(h.from,1),c=e.mapPos(h.to,-1);Oe.from&&(this.fragments=Fl(this.fragments,n,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends lh{createParse(t,i,n){let s=n[0].from,l=n[n.length-1].to;return{parsedPos:s,advance(){let a=ii;if(a){for(let h of n)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new U(fe.none,[],[],l-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ii}}function Fl(r,e,t){return it.applyChanges(r,[{fromA:e,toA:t,fromB:e,toB:t}])}class Bt{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Bt(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=gn.create(e.facet(Ut).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Bt(i)}}Ze.state=rt.define({create:Bt.init,update(r,e){for(let t of e.effects)if(t.is(Ze.setState))return t.value;return e.startState.facet(Ut)!=e.state.facet(Ut)?Bt.init(e.state):r.apply(e)}});let ch=r=>{let e=setTimeout(()=>r(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ch=r=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(r,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const rr=typeof navigator<"u"&&(!((nr=navigator.scheduling)===null||nr===void 0)&&nr.isInputPending)?()=>navigator.scheduling.isInputPending():null,Au=Ge.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ze.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ze.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=ch(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,a=s.context.work(()=>rr&&rr()||Date.now()>l,n+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Ze.setState.of(new Bt(s.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ee(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ut=w.define({combine(r){return r.length?r[0]:null},enables:r=>[Ze.state,Au,X.contentAttributes.compute([r],e=>{let t=e.facet(r);return t&&t.name?{"data-language":t.name}:{}})]});class Ts{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Cu=w.define(),Mn=w.define({combine:r=>{if(!r.length)return" ";let e=r[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(r[0]));return e}});function mn(r){let e=r.facet(Mn);return e.charCodeAt(0)==9?r.tabSize*e.length:e.length}function Qn(r,e){let t="",i=r.tabSize,n=r.facet(Mn)[0];if(n==" "){for(;e>=i;)t+=" ",e-=i;n=" "}for(let s=0;s=e?Ru(r,t,e):null}class Yn{constructor(e,t={}){this.state=e,this.options=t,this.unit=mn(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:s}=this.options;return n!=null&&n>=i.from&&n<=i.to?s&&n==e?{text:"",from:e}:(t<0?n-1&&(s+=l-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return Xn(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let l=s(n);if(l>-1)return l}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const _n=new C;function Ru(r,e,t){let i=e.resolveStack(t),n=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(n!=i.node){let s=[];for(let l=n;l&&!(l.fromi.node.to||l.from==i.node.from&&l.type==i.node.type);l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)i={node:s[l],next:i}}return uh(i,r,t)}function uh(r,e,t){for(let i=r;i;i=i.next){let n=Mu(i.node);if(n)return n(As.create(e,t,i))}return 0}function ju(r){return r.pos==r.options.simulateBreak&&r.options.simulateDoubleBreak}function Mu(r){let e=r.type.prop(_n);if(e)return e;let t=r.firstChild,i;if(t&&(i=t.type.prop(C.closedBy))){let n=r.lastChild,s=n&&i.indexOf(n.name)>-1;return l=>dh(l,!0,1,void 0,s&&!ju(l)?n.from:void 0)}return r.parent==null?Yu:null}function Yu(){return 0}class As extends Yn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new As(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(_u(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return uh(this.context.next,this.base,this.pos)}}function _u(r,e){for(let t=e;t;t=t.parent)if(r==t)return!0;return!1}function Wu(r){let e=r.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let n=r.options.simulateBreak,s=r.state.doc.lineAt(t.from),l=n==null||n<=s.from?s.to:Math.min(s.to,n);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=l)return null;let h=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+h}}o=a.to}}function qu({closing:r,align:e=!0,units:t=1}){return i=>dh(i,e,t,r)}function dh(r,e,t,i,n){let s=r.textAfter,l=s.match(/^\s*/)[0].length,o=i&&s.slice(l,l+i.length)==i||n==r.pos+l,a=e?Wu(r):null;return a?o?r.column(a.from):r.column(a.to):r.baseIndent+(o?0:r.unit*t)}const zu=r=>r.baseIndent;function Ki({except:r,units:e=1}={}){return t=>{let i=r&&r.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const Cs=new C;function ph(r){let e=r.firstChild,t=r.lastChild;return e&&e.too.prop(At)==l.data:l?o=>o==l:void 0,this.style=hh(e.map(o=>({tag:o.tag,class:o.class||n(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=i?new ft(i):null,this.themeType=t.themeType}static define(e,t){return new Wn(e,t||{})}}const Jr=w.define(),Eu=w.define({combine(r){return r.length?[r[0]]:null}});function sr(r){let e=r.facet(Jr);return e.length?e:r.facet(Eu)}function Vu(r,e){let t=[Lu],i;return r instanceof Wn&&(r.module&&t.push(X.styleModule.of(r.module)),i=r.themeType),i?t.push(Jr.computeN([X.darkTheme],n=>n.facet(X.darkTheme)==(i=="dark")?[r]:[])):t.push(Jr.of(r)),t}class Du{constructor(e){this.markCache=Object.create(null),this.tree=se(e.state),this.decorations=this.buildDeco(e,sr(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=se(e.state),i=sr(e.state),n=i!=sr(e.startState),{viewport:s}=e.view,l=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return E.none;let i=new $t;for(let{from:n,to:s}of e.visibleRanges)vu(this.tree,t,(l,o,a)=>{i.add(l,o,this.markCache[a]||(this.markCache[a]=E.mark({class:a})))},n,s);return i.finish()}}const Lu=wn.high(Ge.fromClass(Du,{decorations:r=>r.decorations})),Bu=X.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),gh=1e4,mh="()[]{}",Qh=w.define({combine(r){return fs(r,{afterCursor:!0,brackets:mh,maxScanDistance:gh,renderMatch:Iu})}}),Uu=E.mark({class:"cm-matchingBracket"}),Gu=E.mark({class:"cm-nonmatchingBracket"});function Iu(r){let e=[],t=r.matched?Uu:Gu;return e.push(t.range(r.start.from,r.start.to)),r.end&&e.push(t.range(r.end.from,r.end.to)),e}function Hl(r){let e=[],t=r.facet(Qh);for(let i of r.selection.ranges){if(!i.empty)continue;let n=De(r,i.head,-1,t)||i.head>0&&De(r,i.head-1,1,t)||t.afterCursor&&(De(r,i.head,1,t)||i.headr.decorations}),Fu=[Nu,Bu];function Hu(r={}){return[Qh.of(r),Fu]}const Sh=new C;function es(r,e,t){let i=r.prop(e<0?C.openedBy:C.closedBy);if(i)return i;if(r.name.length==1){let n=t.indexOf(r.name);if(n>-1&&n%2==(e<0?1:0))return[t[n+e]]}return null}function ts(r){let e=r.type.prop(Sh);return e?e(r.node):r}function De(r,e,t,i={}){let n=i.maxScanDistance||gh,s=i.brackets||mh,l=se(r),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let h=es(a.type,t,s);if(h&&a.from0?e>=O.from&&eO.from&&e<=O.to))return Ku(r,e,t,a,O,h,s)}}return Ju(r,e,t,l,o.type,n,s)}function Ku(r,e,t,i,n,s,l){let o=i.parent,a={from:n.from,to:n.to},h=0,O=o?.cursor();if(O&&(t<0?O.childBefore(i.from):O.childAfter(i.to)))do if(t<0?O.to<=i.from:O.from>=i.to){if(h==0&&s.indexOf(O.type.name)>-1&&O.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},O=r.doc.iterRange(e,t>0?r.doc.length:0),c=0;for(let f=0;!O.next().done&&f<=s;){let u=O.value;t<0&&(f+=u.length);let d=e+f*t;for(let p=t>0?0:u.length-1,m=t>0?u.length:-1;p!=m;p+=t){let Q=l.indexOf(u[p]);if(!(Q<0||i.resolveInner(d+p,1).type!=n))if(Q%2==0==t>0)c++;else{if(c==1)return{start:h,end:{from:d+p,to:d+p+1},matched:Q>>1==a>>1};c--}}t>0&&(f+=u.length)}return O.done?{start:h,matched:!1}:null}const ed=Object.create(null),Kl=[fe.none],Jl=[],eo=Object.create(null),td=Object.create(null);for(let[r,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])td[r]=id(ed,e);function lr(r,e){Jl.indexOf(r)>-1||(Jl.push(r),console.warn(e))}function id(r,e){let t=[];for(let o of e.split(" ")){let a=[];for(let h of o.split(".")){let O=r[h]||g[h];O?typeof O=="function"?a.length?a=a.map(O):lr(h,`Modifier ${h} used at start of tag`):a.length?lr(h,`Tag ${h} used as modifier`):a=Array.isArray(O)?O:[O]:lr(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),n=i+" "+t.map(o=>o.id),s=eo[n];if(s)return s.id;let l=eo[n]=fe.define({id:Kl.length,name:i,props:[jn({[i]:t})]});return Kl.push(l),l.id}I.RTL,I.LTR;const nd=r=>{let{state:e}=r,t=e.doc.lineAt(e.selection.main.from),i=js(r.state,t.from);return i.line?rd(r):i.block?ld(r):!1};function Rs(r,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=r(e,t);return n?(i(t.update(n)),!0):!1}}const rd=Rs(hd,0),sd=Rs(bh,0),ld=Rs((r,e)=>bh(r,e,ad(e)),0);function js(r,e){let t=r.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const ni=50;function od(r,{open:e,close:t},i,n){let s=r.sliceDoc(i-ni,i),l=r.sliceDoc(n,n+ni),o=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(l)[0].length,h=s.length-o;if(s.slice(h-e.length,h)==e&&l.slice(a,a+t.length)==t)return{open:{pos:i-o,margin:o&&1},close:{pos:n+a,margin:a&&1}};let O,c;n-i<=2*ni?O=c=r.sliceDoc(i,n):(O=r.sliceDoc(i,i+ni),c=r.sliceDoc(n-ni,n));let f=/^\s*/.exec(O)[0].length,u=/\s*$/.exec(c)[0].length,d=c.length-u-t.length;return O.slice(f,f+e.length)==e&&c.slice(d,d+t.length)==t?{open:{pos:i+f+e.length,margin:/\s/.test(O.charAt(f+e.length))?1:0},close:{pos:n-u-t.length,margin:/\s/.test(c.charAt(d-1))?1:0}}:null}function ad(r){let e=[];for(let t of r.selection.ranges){let i=r.doc.lineAt(t.from),n=t.to<=i.to?i:r.doc.lineAt(t.to);n.from>i.from&&n.from==t.to&&(n=t.to==i.to+1?i:r.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=n.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return e}function bh(r,e,t=e.selection.ranges){let i=t.map(s=>js(e,s.from).block);if(!i.every(s=>s))return null;let n=t.map((s,l)=>od(e,i[l],s.from,s.to));if(r!=2&&!n.every(s=>s))return{changes:e.changes(t.map((s,l)=>n[l]?[]:[{from:s.from,insert:i[l].open+" "},{from:s.to,insert:" "+i[l].close}]))};if(r!=1&&n.some(s=>s)){let s=[];for(let l=0,o;ln&&(s==l||l>c.from)){n=c.from;let f=/^\s*/.exec(c.text)[0].length,u=f==c.length,d=c.text.slice(f,f+h.length)==h?f:-1;fs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:a,indent:h,empty:O,single:c}of i)(c||!O)&&s.push({from:o.from+h,insert:a+" "});let l=e.changes(s);return{changes:l,selection:e.selection.map(l,1)}}else if(r!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:l,comment:o,token:a}of i)if(o>=0){let h=l.from+o,O=h+a.length;l.text[O-l.from]==" "&&O++,s.push({from:h,to:O})}return{changes:s}}return null}const is=st.define(),Od=st.define(),cd=w.define(),$h=w.define({combine(r){return fs(r,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}}),yh=rt.define({create(){return Le.empty},update(r,e){let t=e.state.facet($h),i=e.annotation(is);if(i){let a=pe.fromTransaction(e,i.selection),h=i.side,O=h==0?r.undone:r.done;return a?O=Sn(O,O.length,t.minDepth,a):O=kh(O,e.startState.selection),new Le(h==0?i.rest:O,h==0?O:i.rest)}let n=e.annotation(Od);if((n=="full"||n=="before")&&(r=r.isolate()),e.annotation(H.addToHistory)===!1)return e.changes.empty?r:r.addMapping(e.changes.desc);let s=pe.fromTransaction(e),l=e.annotation(H.time),o=e.annotation(H.userEvent);return s?r=r.addChanges(s,l,o,t,e):e.selection&&(r=r.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(n=="full"||n=="after")&&(r=r.isolate()),r},toJSON(r){return{done:r.done.map(e=>e.toJSON()),undone:r.undone.map(e=>e.toJSON())}},fromJSON(r){return new Le(r.done.map(pe.fromJSON),r.undone.map(pe.fromJSON))}});function fd(r={}){return[yh,$h.of(r),X.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?xh:e.inputType=="historyRedo"?ns:null;return i?(e.preventDefault(),i(t)):!1}})]}function qn(r,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let n=t.field(yh,!1);if(!n)return!1;let s=n.pop(r,t,e);return s?(i(s),!0):!1}}const xh=qn(0,!1),ns=qn(1,!1),ud=qn(0,!0),dd=qn(1,!0);class pe{constructor(e,t,i,n,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(e){return new pe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(e){return new pe(e.changes&&K.fromJSON(e.changes),[],e.mapped&&Be.fromJSON(e.mapped),e.startSelection&&S.fromJSON(e.startSelection),e.selectionsAfter.map(S.fromJSON))}static fromTransaction(e,t){let i=Pe;for(let n of e.startState.facet(cd)){let s=n(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new pe(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Pe)}static selection(e){return new pe(void 0,Pe,void 0,void 0,e)}}function Sn(r,e,t,i){let n=e+1>t+20?e-t-1:0,s=r.slice(n,e);return s.push(i),s}function pd(r,e){let t=[],i=!1;return r.iterChangedRanges((n,s)=>t.push(n,s)),e.iterChangedRanges((n,s,l,o)=>{for(let a=0;a=h&&l<=O&&(i=!0)}}),i}function gd(r,e){return r.ranges.length==e.ranges.length&&r.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Ph(r,e){return r.length?e.length?r.concat(e):r:e}const Pe=[],md=200;function kh(r,e){if(r.length){let t=r[r.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-md));return i.length&&i[i.length-1].eq(e)?r:(i.push(e),Sn(r,r.length-1,1e9,t.setSelAfter(i)))}else return[pe.selection([e])]}function Qd(r){let e=r[r.length-1],t=r.slice();return t[r.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function or(r,e){if(!r.length)return r;let t=r.length,i=Pe;for(;t;){let n=Sd(r[t-1],e,i);if(n.changes&&!n.changes.empty||n.effects.length){let s=r.slice(0,t);return s[t-1]=n,s}else e=n.mapped,t--,i=n.selectionsAfter}return i.length?[pe.selection(i)]:Pe}function Sd(r,e,t){let i=Ph(r.selectionsAfter.length?r.selectionsAfter.map(o=>o.map(e)):Pe,t);if(!r.changes)return pe.selection(i);let n=r.changes.map(e),s=e.mapDesc(r.changes,!0),l=r.mapped?r.mapped.composeDesc(s):s;return new pe(n,L.mapEffects(r.effects,e),l,r.startSelection.map(s),i)}const bd=/^(input\.type|delete)($|\.)/;class Le{constructor(e,t,i=0,n=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Le(this.done,this.undone):this}addChanges(e,t,i,n,s){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!i||bd.test(i))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?r.moveByChar(t,e):zn(t,e))}function le(r){return r.textDirectionAt(r.state.selection.main.head)==I.LTR}const vh=r=>wh(r,!le(r)),Xh=r=>wh(r,le(r));function Zh(r,e){return Ce(r,t=>t.empty?r.moveByGroup(t,e):zn(t,e))}const yd=r=>Zh(r,!le(r)),xd=r=>Zh(r,le(r));function Pd(r,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(r.sliceDoc(e.from,e.to)))||e.firstChild}function En(r,e,t){let i=se(r).resolveInner(e.head),n=t?C.closedBy:C.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Pd(r,h,n)?i=h:a=t?h.to:h.from}let s=i.type.prop(n),l,o;return s&&(l=t?De(r,i.from,1):De(r,i.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?i.to:i.from,S.cursor(o,t?-1:1)}const kd=r=>Ce(r,e=>En(r.state,e,!le(r))),wd=r=>Ce(r,e=>En(r.state,e,le(r)));function Th(r,e){return Ce(r,t=>{if(!t.empty)return zn(t,e);let i=r.moveVertically(t,e);return i.head!=t.head?i:r.moveToLineBoundary(t,e)})}const Ah=r=>Th(r,!1),Ch=r=>Th(r,!0);function Rh(r){let e=r.scrollDOM.clientHeightl.empty?r.moveVertically(l,e,t.height):zn(l,e));if(n.eq(i.selection))return!1;let s;if(t.selfScroll){let l=r.coordsAtPos(i.selection.main.head),o=r.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,h=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomjh(r,!1),rs=r=>jh(r,!0);function pt(r,e,t){let i=r.lineBlockAt(e.head),n=r.moveToLineBoundary(e,t);if(n.head==e.head&&n.head!=(t?i.to:i.from)&&(n=r.moveToLineBoundary(e,t,!1)),!t&&n.head==i.from&&i.length){let s=/^\s*/.exec(r.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(n=S.cursor(i.from+s))}return n}const vd=r=>Ce(r,e=>pt(r,e,!0)),Xd=r=>Ce(r,e=>pt(r,e,!1)),Zd=r=>Ce(r,e=>pt(r,e,!le(r))),Td=r=>Ce(r,e=>pt(r,e,le(r))),Ad=r=>Ce(r,e=>r.moveToLineBoundary(e,!1,!1)),Cd=r=>Ce(r,e=>r.moveToLineBoundary(e,!0,!1));function Rd(r,e,t){let i=!1,n=Nt(r.selection,s=>{let l=De(r,s.head,-1)||De(r,s.head,1)||s.head>0&&De(r,s.head-1,1)||s.headRd(r,e);function ke(r,e,t){let i=Nt(r.state.selection,n=>{n.undirectional&&n.head>=n.anchor!=e&&(n=S.range(n.head,n.anchor));let s=t(n);return S.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(r.state.selection)?!1:(r.dispatch(Ae(r.state,i)),!0)}function Mh(r,e){return ke(r,e,t=>r.moveByChar(t,e))}const Yh=r=>Mh(r,!le(r)),_h=r=>Mh(r,le(r));function Wh(r,e){return ke(r,e,t=>r.moveByGroup(t,e))}const Md=r=>Wh(r,!le(r)),Yd=r=>Wh(r,le(r)),_d=r=>{let e=!le(r);return ke(r,e,t=>En(r.state,t,e))},Wd=r=>{let e=le(r);return ke(r,e,t=>En(r.state,t,e))};function qh(r,e){return ke(r,e,t=>r.moveVertically(t,e))}const zh=r=>qh(r,!1),Eh=r=>qh(r,!0);function Vh(r,e){return ke(r,e,t=>r.moveVertically(t,e,Rh(r).height))}const io=r=>Vh(r,!1),no=r=>Vh(r,!0),qd=r=>ke(r,!0,e=>pt(r,e,!0)),zd=r=>ke(r,!1,e=>pt(r,e,!1)),Ed=r=>{let e=!le(r);return ke(r,e,t=>pt(r,t,e))},Vd=r=>{let e=le(r);return ke(r,e,t=>pt(r,t,e))},Dd=r=>ke(r,!1,e=>S.cursor(r.lineBlockAt(e.head).from)),Ld=r=>ke(r,!0,e=>S.cursor(r.lineBlockAt(e.head).to)),ro=({state:r,dispatch:e})=>(e(Ae(r,{anchor:0})),!0),so=({state:r,dispatch:e})=>(e(Ae(r,{anchor:r.doc.length})),!0),lo=({state:r,dispatch:e})=>(e(Ae(r,{anchor:r.selection.main.anchor,head:0})),!0),oo=({state:r,dispatch:e})=>(e(Ae(r,{anchor:r.selection.main.anchor,head:r.doc.length})),!0),Bd=({state:r,dispatch:e})=>(e(r.update({selection:{anchor:0,head:r.doc.length},userEvent:"select"})),!0),Ud=({state:r,dispatch:e})=>{let t=Vn(r).map(({from:i,to:n})=>S.undirectionalRange(i,Math.min(n+1,r.doc.length)));return e(r.update({selection:S.create(t),userEvent:"select"})),!0},Gd=({state:r,dispatch:e})=>{let t=Nt(r.selection,i=>{let n=se(r),s=n.resolveStack(i.from,1);if(i.empty){let l=n.resolveStack(i.from,-1);l.node.from>=s.node.from&&l.node.to<=s.node.to&&(s=l)}for(let l=s;l;l=l.next){let{node:o}=l;if((o.from=i.to||o.to>i.to&&o.from<=i.from)&&l.next)return S.undirectionalRange(o.from,o.to)}return i});return t.eq(r.selection)?!1:(e(Ae(r,t)),!0)};function Dh(r,e){let{state:t}=r,i=t.selection,n=t.selection.ranges.slice();for(let s of t.selection.ranges){let l=t.doc.lineAt(s.head);if(e?l.to0)for(let o=s;;){let a=r.moveVertically(o,e);if(a.headl.to){n.some(h=>h.head==a.head)||n.push(a);break}else{if(a.head==o.head)break;o=a}}}return n.length==i.ranges.length?!1:(r.dispatch(Ae(t,S.create(n,n.length-1))),!0)}const Id=r=>Dh(r,!1),Nd=r=>Dh(r,!0),Fd=({state:r,dispatch:e})=>{let t=r.selection,i=null;return t.ranges.length>1?i=S.create([t.main]):t.main.empty||(i=S.create([S.cursor(t.main.head)])),i?(e(Ae(r,i)),!0):!1};function vi(r,e){if(r.state.readOnly)return!1;let t="delete.selection",{state:i}=r,n=i.changeByRange(s=>{let{from:l,to:o}=s;if(l==o){let a=e(s);al&&(t="delete.forward",a=Bi(r,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=Bi(r,l,!1),o=Bi(r,o,!0);return l==o?{range:s}:{changes:{from:l,to:o},range:S.cursor(l,ln(r)))i.between(e,e,(n,s)=>{ne&&(e=t?s:n)});return e}const Lh=(r,e,t)=>vi(r,i=>{let n=i.from,{state:s}=r,l=s.doc.lineAt(n),o,a;if(t&&!e&&n>l.from&&nLh(r,!1,!0),Bh=r=>Lh(r,!0,!1),Uh=(r,e)=>vi(r,t=>{let i=t.head,{state:n}=r,s=n.doc.lineAt(i),l=n.charCategorizer(i);for(let o=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?n.doc.lines:1)&&(i+=e?1:-1);break}let a=ne(s.text,i-s.from,e)+s.from,h=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),O=l(h);if(o!=null&&O!=o)break;(h!=" "||i!=t.head)&&(o=O),i=a}return i}),Gh=r=>Uh(r,!1),Hd=r=>Uh(r,!0),Kd=r=>vi(r,e=>{let t=r.lineBlockAt(e.head).to;return e.headvi(r,e=>{let t=r.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),ep=r=>vi(r,e=>{let t=r.moveToLineBoundary(e,!0).head;return e.head{if(r.readOnly)return!1;let t=r.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:j.of(["",""])},range:S.cursor(i.from)}));return e(r.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ip=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=r.changeByRange(i=>{if(!i.empty||i.from==0||i.from==r.doc.length)return{range:i};let n=i.from,s=r.doc.lineAt(n),l=n==s.from?n-1:ne(s.text,n-s.from,!1)+s.from,o=n==s.to?n+1:ne(s.text,n-s.from,!0)+s.from;return{changes:{from:l,to:o,insert:r.doc.slice(n,o).append(r.doc.slice(l,n))},range:S.cursor(o)}});return t.changes.empty?!1:(e(r.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Vn(r){let e=[],t=-1;for(let i of r.selection.ranges){let n=r.doc.lineAt(i.from),s=r.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=r.doc.lineAt(i.to-1)),t>=n.number){let l=e[e.length-1];l.to=s.to,l.ranges.push(i)}else e.push({from:n.from,to:s.to,ranges:[i]});t=s.number+1}return e}function Ih(r,e,t){if(r.readOnly)return!1;let i=[],n=[];for(let s of Vn(r)){if(t?s.to==r.doc.length:s.from==0)continue;let l=r.doc.lineAt(t?s.to+1:s.from-1),o=l.length+1;if(t){i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+r.lineBreak});for(let a of s.ranges)n.push(S.range(Math.min(r.doc.length,a.anchor+o),Math.min(r.doc.length,a.head+o)))}else{i.push({from:l.from,to:s.from},{from:s.to,insert:r.lineBreak+l.text});for(let a of s.ranges)n.push(S.range(a.anchor-o,a.head-o))}}return i.length?(e(r.update({changes:i,scrollIntoView:!0,selection:S.create(n,r.selection.mainIndex),userEvent:"move.line"})),!0):!1}const np=({state:r,dispatch:e})=>Ih(r,e,!1),rp=({state:r,dispatch:e})=>Ih(r,e,!0);function Nh(r,e,t){if(r.readOnly)return!1;let i=[];for(let s of Vn(r))t?i.push({from:s.from,insert:r.doc.slice(s.from,s.to)+r.lineBreak}):i.push({from:s.to,insert:r.lineBreak+r.doc.slice(s.from,s.to)});let n=r.changes(i);return e(r.update({changes:n,selection:r.selection.map(n,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const sp=({state:r,dispatch:e})=>Nh(r,e,!1),lp=({state:r,dispatch:e})=>Nh(r,e,!0),op=r=>{if(r.state.readOnly)return!1;let{state:e}=r,t=e.changes(Vn(e).map(({from:n,to:s})=>(n>0?n--:s{let s;if(r.lineWrapping){let l=r.lineBlockAt(n.head),o=r.coordsAtPos(n.head,n.assoc||1);o&&(s=l.bottom+r.documentTop-o.bottom+r.defaultLineHeight/2)}return r.moveVertically(n,!0,s)}).map(t);return r.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ap(r,e){if(/\(\)|\[\]|\{\}/.test(r.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=se(r).resolveInner(e),i=t.childBefore(e),n=t.childAfter(e),s;return i&&n&&i.to<=e&&n.from>=e&&(s=i.type.prop(C.closedBy))&&s.indexOf(n.name)>-1&&r.doc.lineAt(i.to).from==r.doc.lineAt(n.from).from&&!/\S/.test(r.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const ao=Fh(!1),hp=Fh(!0);function Fh(r){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(n=>{let{from:s,to:l}=n,o=e.doc.lineAt(s),a=!r&&s==l&&ap(e,s);r&&(s=l=(l<=o.to?o:e.doc.lineAt(l)).to);let h=new Yn(e,{simulateBreak:s,simulateDoubleBreak:!!a}),O=fh(h,s);for(O==null&&(O=Xn(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));lo.from&&s{let n=[];for(let l=i.from;l<=i.to;){let o=r.doc.lineAt(l);o.number>t&&(i.empty||i.to>o.from)&&(e(o,n,i),t=o.number),l=o.to+1}let s=r.changes(n);return{changes:n,range:S.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const Op=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=Object.create(null),i=new Yn(r,{overrideIndentation:s=>{let l=t[s];return l??-1}}),n=Ms(r,(s,l,o)=>{let a=fh(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let h=/^\s*/.exec(s.text)[0],O=Qn(r,a);(h!=O||o.fromr.readOnly?!1:(e(r.update(Ms(r,(t,i)=>{i.push({from:t.from,insert:r.facet(Mn)})}),{userEvent:"input.indent"})),!0),fp=({state:r,dispatch:e})=>r.readOnly?!1:(e(r.update(Ms(r,(t,i)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let s=Xn(n,r.tabSize),l=0,o=Qn(r,Math.max(0,s-mn(r)));for(;l(r.setTabFocusMode(),!0),dp=[{key:"Ctrl-b",run:vh,shift:Yh,preventDefault:!0},{key:"Ctrl-f",run:Xh,shift:_h},{key:"Ctrl-p",run:Ah,shift:zh},{key:"Ctrl-n",run:Ch,shift:Eh},{key:"Ctrl-a",run:Ad,shift:Dd},{key:"Ctrl-e",run:Cd,shift:Ld},{key:"Ctrl-d",run:Bh},{key:"Ctrl-h",run:ss},{key:"Ctrl-k",run:Kd},{key:"Ctrl-Alt-h",run:Gh},{key:"Ctrl-o",run:tp},{key:"Ctrl-t",run:ip},{key:"Ctrl-v",run:rs}],pp=[{key:"ArrowLeft",run:vh,shift:Yh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:yd,shift:Md,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Zd,shift:Ed,preventDefault:!0},{key:"ArrowRight",run:Xh,shift:_h,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:xd,shift:Yd,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Td,shift:Vd,preventDefault:!0},{key:"ArrowUp",run:Ah,shift:zh,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ro,shift:lo},{mac:"Ctrl-ArrowUp",run:to,shift:io},{key:"ArrowDown",run:Ch,shift:Eh,preventDefault:!0},{mac:"Cmd-ArrowDown",run:so,shift:oo},{mac:"Ctrl-ArrowDown",run:rs,shift:no},{key:"PageUp",run:to,shift:io},{key:"PageDown",run:rs,shift:no},{key:"Home",run:Xd,shift:zd,preventDefault:!0},{key:"Mod-Home",run:ro,shift:lo},{key:"End",run:vd,shift:qd,preventDefault:!0},{key:"Mod-End",run:so,shift:oo},{key:"Enter",run:ao,shift:ao},{key:"Mod-a",run:Bd},{key:"Backspace",run:ss,shift:ss,preventDefault:!0},{key:"Delete",run:Bh,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Gh,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Hd,preventDefault:!0},{mac:"Mod-Backspace",run:Jd,preventDefault:!0},{mac:"Mod-Delete",run:ep,preventDefault:!0}].concat(dp.map(r=>({mac:r.key,run:r.run,shift:r.shift}))),gp=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:kd,shift:_d},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:wd,shift:Wd},{key:"Alt-ArrowUp",run:np},{key:"Shift-Alt-ArrowUp",run:sp},{key:"Alt-ArrowDown",run:rp},{key:"Shift-Alt-ArrowDown",run:lp},{key:"Mod-Alt-ArrowUp",run:Id},{key:"Mod-Alt-ArrowDown",run:Nd},{key:"Escape",run:Fd},{key:"Mod-Enter",run:hp},{key:"Alt-l",mac:"Ctrl-l",run:Ud},{key:"Mod-i",run:Gd,preventDefault:!0},{key:"Mod-[",run:fp},{key:"Mod-]",run:cp},{key:"Mod-Alt-\\",run:Op},{key:"Shift-Mod-k",run:op},{key:"Shift-Mod-\\",run:jd},{key:"Mod-/",run:nd},{key:"Alt-A",mac:"Ctrl-A",run:sd},{key:"Ctrl-m",mac:"Shift-Alt-m",run:up}].concat(pp);var ho={};class bn{constructor(e,t,i,n,s,l,o,a,h,O=0,c){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=s,this.score=l,this.buffer=o,this.bufferBase=a,this.curContext=h,this.lookAhead=O,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new bn(e,[],t,i,i,0,[],0,n?new Oo(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,n=e&65535,{parser:s}=this.p,l=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[n])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=O):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(n,h)}storeNode(e,t,i,n=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[l-4]==0&&this.buffer[l-1]>-1){if(t==i)return;if(this.buffer[l-2]>=t){this.buffer[l-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,n);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let o=!1;for(let a=l;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){o=!0;break}if(o)for(;l>0&&this.buffer[l-2]>i;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,n>4&&(n-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=i,this.buffer[l+3]=n}}shift(e,t,i,n){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:l}=this.p;this.pos=n;let o=l.stateFlag(s,1);!o&&(n>i||t<=l.maxNode)&&(this.reducePos=n),this.pushState(s,o?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=l.maxNode&&this.buffer.push(t,i,n,4)}else this.pos=n,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,n,4)}apply(e,t,i,n){e&65536?this.reduce(e):this.shift(e,t,i,n)}useNode(e,t,i){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let s=this.reducePos=this.pos=i+e.length;this.pushState(t,i),this.buffer.push(n,i,s,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new bn(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new mp(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let s=0,l;sa&1&&o==l)||n.push(t[s],l)}t=n}let i=[];for(let n=0;n>19,n=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],n,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(n,s)=>{if(!t.includes(n))return t.push(n),e.allActions(n,l=>{if(!(l&393216))if(l&65536){let o=(l>>19)-s;if(o>1){let a=l&65535,h=this.stack.length-o*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return o<<19|65536|a}}else{let o=i(l,s+1);if(o!=null)return o}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}}class Oo{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class mp{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class $n{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new $n(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new $n(this.stack,this.pos,this.index)}}function ai(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let i=0,n=0;i=92&&l--,l>=34&&l--;let a=l-32;if(a>=46&&(a-=46,o=!0),s+=a,o)break;s*=46}t?t[n++]=s:t=new e(s)}return t}class Ji{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const co=new Ji;class Qp{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=co,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,s=this.pos+e;for(;si.to:s>=i.to;){if(n==this.ranges.length-1)return null;let l=this.ranges[++n];s+=l.from-i.to,i=l}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,n;if(t>=0&&t=this.chunk2Pos&&io.to&&(this.chunk2=this.chunk2.slice(0,o.to-i)),n=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),n}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=co,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class _t{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;Hh(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}_t.prototype.contextual=_t.prototype.fallback=_t.prototype.extend=!1;class yn{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?ai(e):e}token(e,t){let i=e.pos,n=0;for(;;){let s=e.next<0,l=e.resolveOffset(1,1);if(Hh(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||n++,l==null)break;e.reset(l,e.token)}n&&(e.reset(i,e.token),e.acceptToken(this.elseToken,n))}}yn.prototype.contextual=_t.prototype.fallback=_t.prototype.extend=!1;class be{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Hh(r,e,t,i,n,s){let l=0,o=1<0){let d=r[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||Sp(d,e.token.value,n,s))){e.acceptToken(d);break}}let O=e.next,c=0,f=r[l+2];if(e.next<0&&f>c&&r[h+f*3-3]==65535){l=r[h+f*3-1];continue e}for(;c>1,d=h+u+(u<<1),p=r[d],m=r[d+1]||65536;if(O=m)c=u+1;else{l=r[d+2],e.advance();continue e}}break}}function fo(r,e,t){for(let i=e,n;(n=r[i])!=65535;i++)if(n==t)return i-e;return-1}function Sp(r,e,t,i){let n=fo(t,i,e);return n<0||fo(t,i,r)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(r.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:r.length}}class bp{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?uo(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?uo(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=l,null;if(s instanceof U){let o=l>this.lastRepeatPos&&s.type.id>=this.minRepeat;if(l==e||o){let a=l+s.length,h;if(l>=this.safeFrom&&a<=this.safeTo&&(!(h=s.prop(C.lookAhead))||a+h=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+s.length}}}class $p{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Ji)}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:s}=n,l=n.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hc.end+25&&(a=Math.max(c.lookAhead,a)),c.value!=0)){let f=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!O.extend&&(i=c,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Ji,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ji,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){let n=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(n,e),i),e.value>-1){let{parser:s}=i.p;for(let l=0;l=0&&i.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(n+1)}putAction(e,t,i,n){for(let s=0;se.bufferLength*4?new bp(i,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],n,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;lt)i.push(o);else{if(this.advanceStack(o,i,e))continue;{n||(n=[],s=[]),n.push(o);let a=this.tokens.getMainToken(o);s.push(a.value,a.end)}}break}}if(!i.length){let l=n&&Pp(n);if(l)return me&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw me&&n&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&n){let l=this.stoppedAt!=null&&n[0].pos>this.stoppedAt?n[0]:this.runRecovery(n,s,i);if(l)return me&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(i.length>l)for(i.sort((o,a)=>a.score-o.score);i.length>l;)i.pop();i.some(o=>o.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let l=0;l500&&h.buffer.length>500)if((o.score-h.score||o.buffer.length-h.buffer.length)>0)i.splice(a--,1);else{i.splice(l--,1);continue e}}}i.length>12&&(i.sort((l,o)=>o.score-l.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let l=1;l-1&&i.length&&(!s||(i.prop(C.contextHash)||0)==l))return e.useNode(i,o,t),i;if(i.children.length==0||i.positions[0]>0)break;let a=i.children[0];if(a instanceof U&&(!n||a.type.id>=this.parser.minRepeatTerm))i=a;else break}return null}advanceStack(e,t,i){let n=e.pos,{parser:s}=this,l=me?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.reducePos0)return e.reduce(o),me&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hn?t.push(d):i.push(d)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return po(e,t),!0}}runRecovery(e,t,i){let n=null,s=!1;for(let l=0;l ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),me&&console.log(O+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))))continue;let c=o.split(),f=O;for(let u=0;u<10&&c.forceReduce()&&(me&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,i));u++)me&&(f=this.stackID(c)+" -> ");for(let u of o.recoverByInsert(a))me&&console.log(O+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,i);this.stream.end>o.pos?(h==o.pos&&(h++,a=0),o.recoverByDelete(a,h),me&&console.log(O+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),po(o,i)):(!n||n.scorer;class Kh{constructor(e){this.start=e.start,this.shift=e.shift||hr,this.reduce=e.reduce||hr,this.reuse=e.reuse||hr,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Gt extends lh{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;oe.topRules[o][1]),n=[];for(let o=0;o=0)s(O,a,o[h++]);else{let c=o[h+-O];for(let f=-O;f>0;f--)s(o[h++],a,c);h++}}}this.nodeSet=new ks(t.map((o,a)=>fe.define({name:a>=this.minRepeatTerm?void 0:o,id:a,props:n[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=th;let l=ai(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new _t(l,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new yp(this,e,t,i);for(let s of this.wrappers)n=s(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let s=n[t+1];;){let l=n[s++],o=l&1,a=n[s++];if(o&&i)return a;for(let h=s+(l>>1);s0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),n=i?t(i):void 0;for(let s=this.stateSlot(e,1);n==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ke(this.data,s+2);else break;n=t(Ke(this.data,s+1))}return n}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ke(this.data,i+2);else break;if((this.data[i+2]&1)==0){let n=this.data[i+1];t.some((s,l)=>l&1&&s==n)||t.push(this.data[i],n)}}return t}configure(e){let t=Object.assign(Object.create(Gt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let n=e.tokenizers.find(s=>s.from==i);return n?n.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,n)=>{let s=e.specializers.find(o=>o.from==i.external);if(!s)return i;let l=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[n]=go(l),l})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let l=t.indexOf(s);l>=0&&(i[l]=!0)}let n=null;for(let s=0;si)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorer.external(t,i)<<1|e}return r.get}const kp=55,wp=1,vp=56,Xp=2,Zp=57,Tp=3,mo=4,Ap=5,Ys=6,Jh=7,eO=8,tO=9,iO=10,Cp=11,Rp=12,jp=13,Or=58,Mp=14,Yp=15,Qo=59,nO=21,_p=23,rO=24,Wp=25,ls=27,sO=28,qp=29,zp=32,Ep=35,Vp=37,Dp=38,Lp=0,Bp=1,Up={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Gp={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},So={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ip(r){return r==45||r==46||r==58||r>=65&&r<=90||r==95||r>=97&&r<=122||r>=161}let bo=null,$o=null,yo=0;function os(r,e){let t=r.pos+e;if(yo==t&&$o==r)return bo;let i=r.peek(e),n="";for(;Ip(i);)n+=String.fromCharCode(i),i=r.peek(++e);return $o=r,yo=t,bo=n?n.toLowerCase():i==Np||i==Fp?void 0:null}const lO=60,xn=62,_s=47,Np=63,Fp=33,Hp=45;function xo(r,e){this.name=r,this.parent=e}const Kp=[Ys,iO,Jh,eO,tO],Jp=new Kh({start:null,shift(r,e,t,i){return Kp.indexOf(e)>-1?new xo(os(i,1)||"",r):r},reduce(r,e){return e==nO&&r?r.parent:r},reuse(r,e,t,i){let n=e.type.id;return n==Ys||n==Vp?new xo(os(i,1)||"",r):r},strict:!1}),eg=new be((r,e)=>{if(r.next!=lO){r.next<0&&e.context&&r.acceptToken(Or);return}r.advance();let t=r.next==_s;t&&r.advance();let i=os(r,0);if(i===void 0)return;if(!i)return r.acceptToken(t?Yp:Mp);let n=e.context?e.context.name:null;if(t){if(i==n)return r.acceptToken(Cp);if(n&&Gp[n])return r.acceptToken(Or,-2);if(e.dialectEnabled(Lp))return r.acceptToken(Rp);for(let s=e.context;s;s=s.parent)if(s.name==i)return;r.acceptToken(jp)}else{if(i=="script")return r.acceptToken(Jh);if(i=="style")return r.acceptToken(eO);if(i=="textarea")return r.acceptToken(tO);if(Up.hasOwnProperty(i))return r.acceptToken(iO);n&&So[n]&&So[n][i]?r.acceptToken(Or,-1):r.acceptToken(Ys)}},{contextual:!0}),tg=new be(r=>{for(let e=0,t=0;;t++){if(r.next<0){t&&r.acceptToken(Qo);break}if(r.next==Hp)e++;else if(r.next==xn&&e>=2){t>=3&&r.acceptToken(Qo,-2);break}else e=0;r.advance()}});function ig(r){for(;r;r=r.parent)if(r.name=="svg"||r.name=="math")return!0;return!1}const ng=new be((r,e)=>{if(r.next==_s&&r.peek(1)==xn){let t=e.dialectEnabled(Bp)||ig(e.context);r.acceptToken(t?Ap:mo,2)}else r.next==xn&&r.acceptToken(mo,1)});function Ws(r,e,t){let i=2+r.length;return new be(n=>{for(let s=0,l=0,o=0;;o++){if(n.next<0){o&&n.acceptToken(e);break}if(s==0&&n.next==lO||s==1&&n.next==_s||s>=2&&sl?n.acceptToken(e,-l):n.acceptToken(t,-(l-2));break}else if((n.next==10||n.next==13)&&o){n.acceptToken(e,1);break}else s=l=0;n.advance()}})}const rg=Ws("script",kp,wp),sg=Ws("style",vp,Xp),lg=Ws("textarea",Zp,Tp),og=jn({"Text RawText IncompleteTag IncompleteCloseTag":g.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":g.angleBracket,TagName:g.tagName,"MismatchedCloseTag/TagName":[g.tagName,g.invalid],AttributeName:g.attributeName,"AttributeValue UnquotedAttributeValue":g.attributeValue,Is:g.definitionOperator,"EntityReference CharacterReference":g.character,Comment:g.blockComment,ProcessingInst:g.processingInstruction,DoctypeDecl:g.documentMeta}),ag=Gt.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:Jp,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[og],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let h=o.type.id;if(h==qp)return cr(o,a,t);if(h==zp)return cr(o,a,i);if(h==Ep)return cr(o,a,n);if(h==nO&&s.length){let O=o.node,c=O.firstChild,f=c&&Po(c,a),u;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(u||(u=oO(c,a))))){let p=O.lastChild,m=p.type.id==Dp?p.from:O.to;if(m>c.to)return{parser:d.parser,overlay:[{from:c.to,to:m}]}}}}if(l&&h==rO){let O=o.node,c;if(c=O.firstChild){let f=l[a.read(c.from,c.to)];if(f)for(let u of f){if(u.tagName&&u.tagName!=Po(O.parent,a))continue;let d=O.lastChild;if(d.type.id==ls){let p=d.from+1,m=d.lastChild,Q=d.to-(m&&m.isError?0:1);if(Q>p)return{parser:u.parser,overlay:[{from:p,to:Q}],bracketed:!0}}else if(d.type.id==sO)return{parser:u.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const hg=148,ko=1,Og=149,cg=150,hO=2,fg=151,ug=3,dg=4,pg=152,OO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],gg=58,mg=40,cO=95,Qg=91,en=45,Sg=46,bg=35,$g=37,yg=38,xg=92,Pg=10,kg=42;function $i(r){return r>=65&&r<=90||r>=97&&r<=122||r>=161}function qs(r){return r>=48&&r<=57}function wo(r){return qs(r)||r>=97&&r<=102||r>=65&&r<=70}const fO=(r,e,t)=>(i,n)=>{for(let s=!1,l=0,o=0;;o++){let{next:a}=i;if($i(a)||a==en||a==cO||s&&qs(a))!s&&(a!=en||o>0)&&(s=!0),l===o&&a==en&&l++,i.advance();else if(a==xg&&i.peek(1)!=Pg){if(i.advance(),wo(i.next)){do i.advance();while(wo(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(l>=2&&n.canShift(hO)?e:a==mg?t:r);break}}},wg=new be(fO(Og,hO,cg),{contextual:!0}),vg=new be(fO(fg,ug,dg),{contextual:!0}),Xg=new be(r=>{if(OO.includes(r.peek(-1))){let{next:e}=r;($i(e)||e==cO||e==bg||e==Sg||e==kg||e==Qg||e==gg&&$i(r.peek(1))||e==en||e==yg)&&r.acceptToken(hg)}}),Zg=new be(r=>{if(!OO.includes(r.peek(-1))){let{next:e}=r;if(e==$g&&(r.advance(),r.acceptToken(ko)),$i(e)){do r.advance();while($i(r.next)||qs(r.next));r.acceptToken(ko)}}});function vo(r){let e=r.length;return(e==4||e==5||e==7||e==9)&&/^#[a-f\d]+$/i.test(r)?pg:-1}const Tg=jn({"AtKeyword import charset namespace keyframes media supports font-feature-values":g.definitionKeyword,"from to selector scope MatchFlag":g.keyword,NamespaceName:g.namespace,KeyframeName:g.labelName,KeyframeRangeName:g.operatorKeyword,TagName:g.tagName,ClassName:g.className,PseudoClassName:g.constant(g.className),IdName:g.labelName,"FeatureName PropertyName":g.propertyName,AttributeName:g.attributeName,NumberLiteral:g.number,KeywordQuery:g.keyword,UnaryQueryOp:g.operatorKeyword,"CallTag ValueName FontName":g.atom,VariableName:g.variableName,Callee:g.operatorKeyword,Unit:g.unit,"UniversalSelector NestingSelector":g.definitionOperator,"MatchOp CompareOp":g.compareOperator,"ChildOp SiblingOp, LogicOp":g.logicOperator,BinOp:g.arithmeticOperator,Important:g.modifier,Comment:g.blockComment,ColorLiteral:g.color,"ParenthesizedContent StringLiteral":g.string,":":g.punctuation,PseudoOp:g.derefOperator,"; , |":g.separator,"( )":g.paren,"[ ]":g.squareBracket,"{ }":g.brace}),Ag={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:88,url:158,"url-prefix":158,domain:158,regexp:158},Cg={__proto__:null,or:102,and:102,not:112,only:112,layer:212},Rg={__proto__:null,selector:118,style:124,layer:208},jg={__proto__:null,"@import":204,"@media":216,"@charset":220,"@namespace":224,"@keyframes":230,"@supports":242,"@scope":246,"@font-feature-values":252},Mg={__proto__:null,to:249},Yg=Gt.deserialize({version:14,states:"MrQYQdOOO$TQdOOP$[O`OOO%XQaO'#CfOOQP'#Ce'#CeO%`QdO'#CgO%eQ`O'#CgO%jQaO'#FrO&eQdO'#CkO'XQaO'#CcO'cQdO'#CnOOQP'#ES'#ESOOQP'#ER'#ERO'nQdO'#ETO'yQdO'#E[O'yQdO'#E_OOQP'#Fr'#FrO)`QhO'#FQOOQS'#Fq'#FqOOQS'#FT'#FTQYQdOOO)gQdO'#EeO*vQhO'#EkO)gQdO'#EmO*}QdO'#EoO+YQdO'#ErO*[QhO'#ExO+bQdO'#EzO+mQdO'#E}O+rQaO'#CfO+yQ`O'#EbO,OQ`O'#GPO,ZQdO'#GPQOQ`OOP,eO&jO'#CaPOOO)CAa)CAaOOQP'#Ci'#CiOOQP,59R,59RO%`QdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&eQdO,59VO,pQdO,59YOOQP,5:m,5:mO'nQdO,5:oO'yQdO,5:vO'yQdO,5:xO'yQdO,5:yO'yQdO'#F[O,{Q`O,58}O-TQdO'#EaOOQS,58},58}OOQP'#Cq'#CqOOQO'#EP'#EPOOQP,59Y,59YO-[Q`O,59YO-aQ`O,59YO-fQpO'#EUO-qQdO'#EVO-vQ`O'#EVO-{QpO,5:oO.iQaO,5:vO/PQaO,5:yOOQW'#D]'#D]O0OQhO'#DgO0cQhO,5;lO*[QhO'#DeO0pQ`O'#DnO0uQhO'#D{OOQW'#Fx'#FxOOQS,5;l,5;lO0zQ`O'#DhO1PQ`O'#DkOOQS-E9R-E9ROOQ['#Cv'#CvO1UQdO'#CwO1iQdO'#C|O1|QdO'#DPOOQ['#DQ'#DQO2aQ!pO'#DRO4jQ!jO,5;POOQO'#DW'#DWO-aQ`O'#DVO4zQ!nO'#FuO6}Q`O'#DXO7SQ`O'#D|OOQ['#Fu'#FuO7XQhO'#GSO7gQ`O,5;VO7lQ!bO,5;XOOQS'#Eq'#EqO7tQ`O,5;ZO7yQdO,5;ZOOQO'#Et'#EtO8RQ`O,5;^O8WQhO,5;dO'yQdO'#DjOOQS,5;f,5;fO0zQ`O,5;fO8`QdO,5;fOOQS'#Fc'#FcO8hQdO'#FPO7gQ`O,5;iO8pQdO,5:|O9QQdO'#F^O9_Q`O,5mQhO'#DoOOQW,5:Y,5:YOOQW,5:g,5:gOOQW,5:S,5:SO>wQhO,5:VO?cQ!fO'#FvOOQS'#Fv'#FvOOQS'#FV'#FVO@pQdO,59cOOQ[,59c,59cOATQdO,59hOOQ[,59h,59hOAhQdO,59kOOQ[,59k,59kOOQ[,59m,59mO)gQdO,59oOA{QhO'#EgOOQW'#Eg'#EgOBjQ`O1G0kO4sQhO1G0kOOQ[,59q,59qO*[QhO'#DZOOQ[,59s,59sOBoQ#tO,5:hOBzQhO'#F`OCXQ`O,5wQhO'#DmOISQhO'#DsOI[QhO'#DuOIaQ!jO'#F{OOQO'#F{'#F{OIlQ`O'#DxOItQ!bO'#DzOOQO'#Fz'#FzOIyQ`O1G/qOOQS-E9T-E9TOOQ[1G.}1G.}OOQ[1G/S1G/SOOQ[1G/V1G/VOOQ[1G/Z1G/ZOJOQdO,5;ROOQS7+&V7+&VOJTQ`O7+&VOJYQhO'#D[OJbQ`O,59uO*[QhO,59uOOQ[1G0S1G0SOJjQ`O1G0SOJoQhO,5;zOOQO-E9^-E9^OOQS7+&a7+&aOJ}QbO'#DROOQO'#Ew'#EwOK]Q`O'#EvOOQO'#Ev'#EvOKhQ`O'#FaOKpQdO,5;aOOQS,5;a,5;aOOQ[1G/p1G/pOOQS7+&l7+&lO7gQ`O7+&lOK{Q!fO'#F]O)gQdO'#F]OMSQdO7+&SOOQO7+&S7+&SOOQO,5;O,5;OOOQO1G1d1G1dOMgQ!bO<wQhO'#DtOOQO,5:_,5:_O! hQhO,5:aO! pQhO,5:fO)gQdO,5:dOOQW7+%]7+%]OOQO'#Ei'#EiO! wQ`O1G0mOOQS<{AN>{O!$RQ`OAN>{O!$WQaO,5;uOOQO-E9X-E9XO!$bQdO,5;tOOQO-E9W-E9WOOQW<wQhO'#DwOOQO1G/{1G/{O!&UQ!bO1G0QO!&^QdO1G0OOJOQdO'#F_O!&eQ`O7+&XOOQW7+&X7+&XO!&mQ!bO1G/bOOQ[7+${7+${O!&xQhO7+${P!'PQ`O'#FWOOQO,5;|,5;|OOQO-E9`-E9`OOQS1G1g1G1gOOQPG24gG24gO!'UQ`OAN>YO)gQdO1G1_O!'ZQ`O7+'nOOQO1G/z1G/zO!'cQ`O,5:cO!'hQhO7+%lOOQO,5;y,5;yOOQO-E9]-E9]OOQW<^!a!b%Z!b!c?_!c!k%Z!k!lAl!l!u%Z!u!vAl!v!}%Z!}#OA}#O#P%Z#P#QB`#Q#R/w#R#]%Z#]#^Bq#^#g%Z#g#hAl#h#o%Z#o#pGU#p#qGg#q#rHO#r#sHa#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`Hx<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!r`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$`~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$`~!r`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$uYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOv~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+maOy%jz}%j}!O,r!O!Q%j!Q![,r![!c%j!c!},r!}#O%j#O#P.O#P#R%j#R#S,r#S#T%j#T#o,r#o$g%j$g;'S,r;'S;=`/q<%lO,rj,ya$rY!r`Oy%jz}%j}!O,r!O!Q%j!Q![,r![!c%j!c!},r!}#O%j#O#P.O#P#R%j#R#S,r#S#T%j#T#o,r#o$g%j$g;'S,r;'S;=`/q<%lO,rj.TV!r`OY,rYZ%jZy,ryz.jz;'S,r;'S;=`/q<%lO,rY.oX$rY}!O.j!Q![.j!c!}.j#O#P/[#R#S.j#T#o.j$g;'S.j;'S;=`/k<%lO.jY/_SOY.jZ;'S.j;'S;=`/k<%lO.jY/nP;=`<%l.jj/tP;=`<%l,rd/zUOy%jz!_%j!_!`0^!`;'S%j;'S;=`%{<%lO%jd0eS!|S!r`Oy%jz;'S%j;'S;=`%{<%lO%jb0vS^QOy%jz;'S%j;'S;=`%{<%lO%j~1VWOY1SZw1Swx*cx#O1S#O#P1o#P;'S1S;'S;=`2k<%lO1S~1rRO;'S1S;'S;=`1{;=`O1S~2OXOY1SZw1Swx*cx#O1S#O#P1o#P;'S1S;'S;=`2k;=`<%l1S<%lO1S~2nP;=`<%l1Sj2vShYOy%jz;'S%j;'S;=`%{<%lO%j~3XOg~n3`UWQxWOy%jz!_%j!_!`0^!`;'S%j;'S;=`%{<%lO%jj3yWxW#SQOy%jz!O%j!O!P4c!P!Q%j!Q![7h![;'S%j;'S;=`%{<%lO%jj4hU!r`Oy%jz!Q%j!Q![4z![;'S%j;'S;=`%{<%lO%jj5RY!r`$kYOy%jz!Q%j!Q![4z![!g%j!g!h5q!h#X%j#X#Y5q#Y;'S%j;'S;=`%{<%lO%jj5vY!r`Oy%jz{%j{|6f|}%j}!O6f!O!Q%j!Q![6}![;'S%j;'S;=`%{<%lO%jj6kU!r`Oy%jz!Q%j!Q![6}![;'S%j;'S;=`%{<%lO%jj7UU!r`$kYOy%jz!Q%j!Q![6}![;'S%j;'S;=`%{<%lO%jj7o[!r`$kYOy%jz!O%j!O!P4z!P!Q%j!Q![7h![!g%j!g!h5q!h#X%j#X#Y5q#Y;'S%j;'S;=`%{<%lO%jj8jS!eYOy%jz;'S%j;'S;=`%{<%lO%jj8{WxWOy%jz!O%j!O!P4c!P!Q%j!Q![7h![;'S%j;'S;=`%{<%lO%jj9jU`YOy%jz!Q%j!Q![4z![;'S%j;'S;=`%{<%lO%j~:RTxWOy%jz{:b{;'S%j;'S;=`%{<%lO%j~:iS!r`$a~Oy%jz;'S%j;'S;=`%{<%lO%jj:z[$kYOy%jz!O%j!O!P4z!P!Q%j!Q![7h![!g%j!g!h5q!h#X%j#X#Y5q#Y;'S%j;'S;=`%{<%lO%jj;uUcYOy%jz![%j![!]QS!WW!|SOy%jz;'S%j;'S;=`%{<%lO%jj>eV#PQ!WWOy%jz!_%j!_!`=f!`!a>z!a;'S%j;'S;=`%{<%lO%jb?RS#PQ!r`Oy%jz;'S%j;'S;=`%{<%lO%jj?bYOy%jz}%j}!O@Q!O!c%j!c!}@o!}#T%j#T#o@o#o;'S%j;'S;=`%{<%lO%jj@VW!r`Oy%jz!c%j!c!}@o!}#T%j#T#o@o#o;'S%j;'S;=`%{<%lO%jj@v[lY!r`Oy%jz}%j}!O@o!O!Q%j!Q![@o![!c%j!c!}@o!}#T%j#T#o@o#o;'S%j;'S;=`%{<%lO%jhAqS!}WOy%jz;'S%j;'S;=`%{<%lO%jjBSSoYOy%jz;'S%j;'S;=`%{<%lO%jnBeSn^Oy%jz;'S%j;'S;=`%{<%lO%jjBvU!}WOy%jz#a%j#a#bCY#b;'S%j;'S;=`%{<%lO%jbC_U!r`Oy%jz#d%j#d#eCq#e;'S%j;'S;=`%{<%lO%jbCvU!r`Oy%jz#c%j#c#dDY#d;'S%j;'S;=`%{<%lO%jbD_U!r`Oy%jz#f%j#f#gDq#g;'S%j;'S;=`%{<%lO%jbDvU!r`Oy%jz#h%j#h#iEY#i;'S%j;'S;=`%{<%lO%jbE_U!r`Oy%jz#T%j#T#UEq#U;'S%j;'S;=`%{<%lO%jbEvU!r`Oy%jz#b%j#b#cFY#c;'S%j;'S;=`%{<%lO%jbF_U!r`Oy%jz#h%j#h#iFq#i;'S%j;'S;=`%{<%lO%jbFxS$tQ!r`Oy%jz;'S%j;'S;=`%{<%lO%jjGZSrYOy%jz;'S%j;'S;=`%{<%lO%jfGlU$gUOy%jz!_%j!_!`0^!`;'S%j;'S;=`%{<%lO%jjHTSqYOy%jz;'S%j;'S;=`%{<%lO%jfHfU#SQOy%jz!_%j!_!`0^!`;'S%j;'S;=`%{<%lO%j`H{P;=`<%l%Z",tokenizers:[Xg,Zg,wg,vg,1,2,3,4,new yn("m~RRYZ[z{a~~g~aO$c~~dP!P!Qg~lO$d~~",28,156)],topRules:{StyleSheet:[0,6],Styles:[1,129]},dynamicPrecedences:{97:1},specialized:[{term:172,get:(r,e)=>vo(r)<<1,external:vo},{term:150,get:r=>Ag[r]||-1},{term:151,get:r=>Cg[r]||-1},{term:4,get:r=>Rg[r]||-1},{term:28,get:r=>jg[r]||-1},{term:149,get:r=>Mg[r]||-1}],tokenPrec:2433});let fr=null;function ur(){if(!fr&&typeof document=="object"&&document.body){let{style:r}=document.body,e=[],t=new Set;for(let i in r)i!="cssText"&&i!="cssFloat"&&typeof r[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));fr=e.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return fr||[]}const Xo=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(r=>({type:"class",label:r})),Zo=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(r=>({type:"keyword",label:r})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(r=>({type:"constant",label:r}))),_g=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(r=>({type:"type",label:r})),Wg=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(r=>({type:"keyword",label:r})),He=/^(\w[\w-]*|-\w[\w-]*|)$/,qg=/^-(-[\w-]*)?$/;function zg(r,e){var t;if((r.name=="("||r.type.isError)&&(r=r.parent||r),r.name!="ArgList")return!1;let i=(t=r.parent)===null||t===void 0?void 0:t.firstChild;return i?.name!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const To=new sh,Eg=["Declaration"];function Vg(r){for(let e=r;;){if(e.type.isTop)return e;if(!(e=e.parent))return r}}function uO(r,e,t){if(e.to-e.from>4096){let i=To.get(e);if(i)return i;let n=[],s=new Set,l=e.cursor(Y.IncludeAnonymous);if(l.firstChild())do for(let o of uO(r,l.node,t))s.has(o.label)||(s.add(o.label),n.push(o));while(l.nextSibling());return To.set(e,n),n}else{let i=[],n=new Set;return e.cursor().iterate(s=>{var l;if(t(s)&&s.matchContext(Eg)&&((l=s.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let o=r.sliceString(s.from,s.to);n.has(o)||(n.add(o),i.push({label:o,type:"variable"}))}}),i}}const Dg=r=>e=>{let{state:t,pos:i}=e,n=se(t).resolveInner(i,-1),s=n.type.isError&&n.from==n.to-1&&t.doc.sliceString(n.from,n.to)=="-";if(n.name=="PropertyName"||(s||n.name=="TagName")&&/^(Block|Styles)$/.test(n.resolve(n.to).name))return{from:n.from,options:ur(),validFor:He};if(n.name=="ValueName")return{from:n.from,options:Zo,validFor:He};if(n.name=="PseudoClassName")return{from:n.from,options:Xo,validFor:He};if(r(n)||(e.explicit||s)&&zg(n,t.doc))return{from:r(n)||s?n.from:i,options:uO(t.doc,Vg(n),r),validFor:qg};if(n.name=="TagName"){for(let{parent:a}=n;a;a=a.parent)if(a.name=="Block")return{from:n.from,options:ur(),validFor:He};return{from:n.from,options:_g,validFor:He}}if(n.name=="AtKeyword")return{from:n.from,options:Wg,validFor:He};if(!e.explicit)return null;let l=n.resolve(i),o=l.childBefore(i);return o&&o.name==":"&&l.name=="PseudoClassSelector"?{from:i,options:Xo,validFor:He}:o&&o.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:i,options:Zo,validFor:He}:l.name=="Block"||l.name=="Styles"?{from:i,options:ur(),validFor:He}:null},Lg=Dg(r=>r.name=="VariableName"),Pn=Lt.define({name:"css",parser:Yg.configure({props:[_n.add({Declaration:Ki()}),Cs.add({"Block KeyframeList":ph})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function dO(){return new Ts(Pn,Pn.data.of({autocomplete:Lg}))}const Bg=317,Ug=318,Ao=1,Gg=2,Ig=3,Ng=4,Fg=319,Hg=321,Kg=322,Jg=5,em=6,tm=0,as=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],pO=125,im=59,hs=47,nm=42,rm=43,sm=45,lm=60,om=44,am=63,hm=46,Om=91,cm=new Kh({start:!1,shift(r,e){return e==Jg||e==em||e==Hg?r:e==Kg},strict:!1}),fm=new be((r,e)=>{let{next:t}=r;(t==pO||t==-1||e.context)&&r.acceptToken(Fg)},{contextual:!0,fallback:!0}),um=new be((r,e)=>{let{next:t}=r,i;as.indexOf(t)>-1||t==hs&&((i=r.peek(1))==hs||i==nm)||t!=pO&&t!=im&&t!=-1&&!e.context&&r.acceptToken(Bg)},{contextual:!0}),dm=new be((r,e)=>{r.next==Om&&!e.context&&r.acceptToken(Ug)},{contextual:!0}),pm=new be((r,e)=>{let{next:t}=r;if(t==rm||t==sm){if(r.advance(),t==r.next){r.advance();let i=!e.context&&e.canShift(Ao);r.acceptToken(i?Ao:Gg)}}else t==am&&r.peek(1)==hm&&(r.advance(),r.advance(),(r.next<48||r.next>57)&&r.acceptToken(Ig))},{contextual:!0});function dr(r,e){return r>=65&&r<=90||r>=97&&r<=122||r==95||r>=192||!e&&r>=48&&r<=57}const gm=new be((r,e)=>{if(r.next!=lm||!e.dialectEnabled(tm)||(r.advance(),r.next==hs))return;let t=0;for(;as.indexOf(r.next)>-1;)r.advance(),t++;if(dr(r.next,!0)){for(r.advance(),t++;dr(r.next,!1);)r.advance(),t++;for(;as.indexOf(r.next)>-1;)r.advance(),t++;if(r.next==om)return;for(let i=0;;i++){if(i==7){if(!dr(r.next,!0))return;break}if(r.next!="extends".charCodeAt(i))break;r.advance(),t++}}r.acceptToken(Ng,-t)}),mm=jn({"get set async static":g.modifier,"for while do if else switch try catch finally return throw break continue default case defer":g.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":g.operatorKeyword,"let var const using function class extends":g.definitionKeyword,"import export from":g.moduleKeyword,"with debugger new":g.keyword,TemplateString:g.special(g.string),super:g.atom,BooleanLiteral:g.bool,this:g.self,null:g.null,Star:g.modifier,VariableName:g.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":g.function(g.variableName),VariableDefinition:g.definition(g.variableName),Label:g.labelName,PropertyName:g.propertyName,PrivatePropertyName:g.special(g.propertyName),"CallExpression/MemberExpression/PropertyName":g.function(g.propertyName),"FunctionDeclaration/VariableDefinition":g.function(g.definition(g.variableName)),"ClassDeclaration/VariableDefinition":g.definition(g.className),"NewExpression/VariableName":g.className,PropertyDefinition:g.definition(g.propertyName),PrivatePropertyDefinition:g.definition(g.special(g.propertyName)),UpdateOp:g.updateOperator,"LineComment Hashbang":g.lineComment,BlockComment:g.blockComment,Number:g.number,String:g.string,Escape:g.escape,ArithOp:g.arithmeticOperator,LogicOp:g.logicOperator,BitOp:g.bitwiseOperator,CompareOp:g.compareOperator,RegExp:g.regexp,Equals:g.definitionOperator,Arrow:g.function(g.punctuation),": Spread":g.punctuation,"( )":g.paren,"[ ]":g.squareBracket,"{ }":g.brace,"InterpolationStart InterpolationEnd":g.special(g.brace),".":g.derefOperator,", ;":g.separator,"@":g.meta,TypeName:g.typeName,TypeDefinition:g.definition(g.typeName),"type enum interface implements namespace module declare":g.definitionKeyword,"abstract global Privacy readonly override":g.modifier,"is keyof unique infer asserts":g.operatorKeyword,JSXAttributeValue:g.attributeValue,JSXText:g.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":g.angleBracket,"JSXIdentifier JSXNameSpacedName":g.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":g.attributeName,"JSXBuiltin/JSXIdentifier":g.standard(g.tagName)}),Qm={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:237,private:237,protected:237,readonly:239,instanceof:258,satisfies:261,import:294,keyof:351,unique:355,infer:361,asserts:397,is:399,abstract:419,implements:421,type:423,let:426,var:428,using:431,interface:437,enum:441,namespace:447,module:449,declare:453,global:457,defer:473,for:478,of:487,while:490,with:494,do:498,if:502,else:504,switch:508,case:514,try:520,catch:524,finally:528,return:532,throw:536,break:540,continue:544,debugger:548},Sm={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:403},bm={__proto__:null,"<":193},$m=Gt.deserialize({version:14,states:"$GSQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Im'#ImO1XQ`O'#GtO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JsO6[Q!0MxO'#JtO6uQ`O'#F^O6zQ,UO'#FuOOQ!0Lf'#Fg'#FgO7VO7dO'#FgO9XQMhO'#F}O9`Q`O'#F|OOQ!0Lf'#Jt'#JtOOQ!0Lb'#Js'#JsO9eQ`O'#GxOOQ['#K`'#K`O9pQ`O'#IZO9uQ!0LrO'#I[OOQ['#Ja'#JaOOQ['#I`'#I`Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GtO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EzO;hQMhO'#FfO;xQ`O'#GtOOQO'#Ka'#KaO;}Q`O'#KaO<]Q`O'#G|O<]Q`O'#G}O<]Q`O'#HPO9kQ`O'#HSO=SQ`O'#HVO>kQ`O'#CeO>{Q`O'#HdO?TQ`O'#HjO?TQ`O'#HlO`QlO'#HnO?TQ`O'#HpO?TQ`O'#HsO?YQ`O'#HyO?_Q!0LsO'#IPO%[QlO'#IRO?jQ!0LsO'#ITO?uQ!0LsO'#IVO9uQ!0LrO'#IXO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FfOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jw'#JwO%[QlO'#JwOOQO'#Jz'#JzOOQO'#Ii'#IiOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#KO'#KOOC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jy'#JyODlQpO'#JzOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CEO)CEOOOOO'#Ia'#IaOFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ib'#IbOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Id'#IdOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IeOGyQ`O'#JuOIxQ!fO'#JuO+}QlO'#JuOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KUOKPQ`O'#KTOKPQ`O'#KTOKXQ`O,5;^OK^Q`O'#KSOOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KRONtQ`O'#KQO9eQ`O'#KQO! YQ`O'#KQO! bQ`O,5;]O! gQ`O'#KQO!#lQ!fO'#JtOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#J{'#J{OOQO-EuOOQ['#Ji'#JiOOQ[,5>v,5>vOOQ[-E<^-E<^O!OO!LOQ`O,5>OO`QlO,5>UO`QlO,5>WO!LTQ`O,5>YO`QlO,5>[O!LYQ`O,5>_O!L_QlO,5>eOOQ[,5>k,5>kO%[QlO,5>kO9uQ!0LrO,5>mOOQ[,5>o,5>oO#!iQ`O,5>oOOQ[,5>q,5>qO#!iQ`O,5>qOOQ[,5>s,5>sO##VQpO'#D_O%[QlO'#JwO##aQpO'#JwO##{QpO'#DmO#$^QpO'#DmO#&oQlO'#DmO#&vQ`O'#JvO#'OQ`O,5:WO#'TQ`O'#EtO#'`Q`O'#EtO#'eQ`O'#KVO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CZQpO,5;YO!CcQMhO,5;YO:dQMhO,5;YO#(`Q`O,5@cO#(eQ07dO,5:sOOQO-EQO$6lQ`O,5>QOOQ[1G3j1G3jO`QlO1G3jOOQ[1G3p1G3pOOQ[1G3r1G3rO?TQ`O1G3tO$6qQlO1G3vO$:uQlO'#HuOOQ[1G3y1G3yO$;SQ`O'#H{O?YQ`O'#H}OOQ[1G4P1G4PO$;[QlO1G4PO9uQ!0LrO1G4VOOQ[1G4X1G4XOOQ!0Lb'#G`'#G`O9uQ!0LrO1G4ZO9uQ!0LrO1G4]O$?cQ`O,5@cO9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CZQpO,5:XO$?hQ?MtO,5:XOOQO,5;`,5;`O$?rQpO'#IfO$@YQ`O,5@bOOQ!0Lf1G/r1G/rO!)[QlO,5;`O$@bQpO'#IlO$@lQ`O,5@qOOQ!0Lb1G0y1G0yO#$^QpO,5:XOOQO'#Ih'#IhO$@tQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CZQpO1G0tO!CcQMhO1G0tOOQ!0Lb1G5}1G5}O!COQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@{Q!0LrO1G0mO$AWQ!0LrO1G0mO!CZQpO1G0^ODWQpO1G0^O$AfQ!0LrO1G0mOOQO1G0^1G0^O$AzQ!0MxO1G0mPOOO-E<]-E<]POOO1G.h1G.hOOOO1G/i1G/iO$BUQ!bO,5WQ`O,5AOO%>`QpO,5AOOOQ!0Lb1G3d1G3dOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>kQ`O7+$VO%[QlO1G6mO%[QlO1G6nO%>pQ!0LrO1G6mO%>zQlO1G3lO%?RQ`O1G3lO%?WQlO1G3lOOQ[7+)U7+)UO9uQ!0LrO7+)`O`QlO7+)bOOQ['#Ki'#KiOOQ['#JT'#JTO%?_QlO,5>aOOQ[,5>a,5>aO%[QlO'#HvO%?lQ`O'#HxOOQ[,5>g,5>gO9eQ`O,5>gOOQ[,5>i,5>iOOQ[7+)k7+)kOOQ[7+)q7+)qOOQ[7+)u7+)uOOQ[7+)w7+)wO%?qQpO1G5}O%@]Q`O1G0zOOQO1G/s1G/sO%@hQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?Q,5?QOOQO-EXQ`O1G6jO9uQ!0LrO<aQ`O7+,XO&>fQ`O7+,YO%[QlO7+,XO%[QlO7+,YOOQ[7+)W7+)WO&>kQ`O7+)WO&>pQlO7+)WO&>wQ`O7+)WOOQ[<|Q`O,5>bOOQ[,5>d,5>dO&?RQ`O1G4RO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&?WQ?MtO1G6[O?YQ`O7+%_OOQ!0Lf<WO!l$xO#k<{O$X%`O$uSOe!iOpkOrQO(U)^O(WTO(ZUO(bVO(p[O~O!]$_Oa$ra'{$ra'x$ra!k$ra!Y$ra!_$ra%j$ra!g$ra~Ol)eO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#k%cO$X%`O$u%^O$w%_O$z%aO(U(wO(WTO(ZUO(b$uO(z$}O({%PO~Og(qP~P!,TO!Q)jO!g)iO!_$_X$[$_X$^$_X$`$_X$g$_X~O!g)iO!_(|X$[(|X$^(|X$`(|X$g(|X~O!Q)jO~P!.^O!Q)jO!_(|X$[(|X$^(|X$`(|X$g(|X~O!_)lO$[)pO$^)kO$`)kO$g)qO~O![)tO~P!)[O$^$hO$`$gO$g)xO~On${X!Q${X#S${X'z${X(z${X({${X~OgmXg${XnmX!]mX#`mX~P!0SOx)zO(c){O(d)}O~On*WO!Q*PO'z*QO(z$}O({%PO~Og*OO~P!1WOg*XO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OWO!l$xO#k<{O$X%`O$uWO!l$xO#k<{O$X%`O$uSOe!iOpkOrQO(WTO(ZUO(bVO(p[O~O(U=RO~P#$oO!]-^O!^(jX~O!^-`O~O#`-aO!]#hX!^#hX~O!g-WO~O!]-bO!^(yX~O!^-dO~O!c-eO!d-eO(V!lO~P#$^O!^-hO~P'_On-kO!_'aO~O!Y-pO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(V!{a(W!{a(Z!{a(f!{a(p!{a~P!#vO!p-uO#`-sO~PChO!c-wO!d-wO(V!lO~PDWOa%nO#`-sO'{%nO~Oa%nO!g#vO#`-sO'{%nO~Oa%nO!g#vO!p-uO#`-sO'{%nO(s'qO~O(Q'yO(R'yO(S-|O~Ov-}O~O!Y'Xa!]'Xa~P!:tO![.RO!Y'XX!]'XX~P%[O!](WO!Y(ia~O!Y(ia~PHRO!](_O!Y(wa~O!S%hO![.VO!_%iO(U%gO!Y'_X!]'_X~O#`.XO!](ua!k(uaa(ua'{(ua~O!g#vO~P#,wO!](kO!k(ta~O!S%hO!_%iO#k.]O(U%gO~Op.bO!S%hO![._O!_%iO!|]O#j.aO#k._O(U%gO!]'bX!k'bX~OR.fO!l#xO~Oh%VOn.iO!_'aO%j.hO~Oa#ci!]#ci'{#ci'x#ci!Y#ci!k#civ#ci!_#ci%j#ci!g#ci~P!:tOn>^O!Q*PO'z*QO(z$}O({%PO~O#l#_aa#_a#`#_a'{#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#l(aXP(aXR(aX[(aXa(aXj(aXr(aX!S(aX!l(aX!p(aX#R(aX#o(aX#p(aX#q(aX#r(aX#s(aX#t(aX#u(aX#v(aX#w(aX#y(aX#{(aX#|(aX'{(aX(b(aX(s(aX!k(aX!Y(aX'x(aXv(aX!_(aX%j(aX!g(aX~P!6kO!].vO!k(lX~P!:tO!k.yO~O!Y.{O~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(bVO[#nia#nij#nir#ni!]#ni#R#ni#p#ni#q#ni#r#ni#s#ni#t#ni#u#ni#v#ni#w#ni#y#ni#{#ni#|#ni'{#ni(s#ni(z#ni({#ni'x#ni!Y#ni!k#niv#ni!_#ni%j#ni!g#ni~O#o#ni~P#3cO#o$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#o$OO#p$PO#q$PO#r$PO(bVO[#nia#nij#ni!]#ni#R#ni#t#ni#u#ni#v#ni#w#ni#y#ni#{#ni#|#ni'{#ni(s#ni(z#ni({#ni'x#ni!Y#ni!k#niv#ni!_#ni%j#ni!g#ni~O#s#ni~P#6QO#s$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#o$OO#p$PO#q$PO#r$PO#s$QO#t$RO#u$RO#v$bO(bVOa#ni!]#ni#y#ni#{#ni#|#ni'{#ni(s#ni(z#ni({#ni'x#ni!Y#ni!k#niv#ni!_#ni%j#ni!g#ni~O#w#ni~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#o$OO#p$PO#q$PO#r$PO#s$QO#t$RO#u$RO#v$bO#w$SO(bVO({#}Oa#ni!]#ni#{#ni#|#ni'{#ni(s#ni(z#ni'x#ni!Y#ni!k#niv#ni!_#ni%j#ni!g#ni~O#y$UO~P#;VO#y#ni~P#;VO#w$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#o$OO#p$PO#q$PO#r$PO#s$QO#t$RO#u$RO#v$bO#w$SO#y$UO(bVO(z#|O({#}Oa#ni!]#ni#|#ni'{#ni(s#ni'x#ni!Y#ni!k#niv#ni!_#ni%j#ni!g#ni~O#{#ni~P#={O#{$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#lfX#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#w]X#y]X#{]X#|]X$R]X(b]X(s]X(z]X({]X!]]X!^]X~O$P]X~P#@jOP$[OR#zO[^O!Q*PO'z*QO(z$}O({%POP#niR#ni!S#ni!l#ni!p#ni#o#ni#p#ni#q#ni#r#ni(b#ni~P#EyO!]/ROg(qX~P!1WOg/TO~Oa$Qi!]$Qi'{$Qi'x$Qi!Y$Qi!k$Qiv$Qi!_$Qi%j$Qi!g$Qi~P!:tO$^/UO$`/UO~O$^/VO$`/VO~O!g)iO#`/WO!_$dX$[$dX$^$dX$`$dX$g$dX~O![/XO~O!_)lO$[/ZO$^)kO$`)kO$g/[O~O!]WO!l$xO#k<{O$X%`O$u_O!Q*PO'z*QO(z$}O({%POP#niR#ni!S#ni!l#ni!p#ni#o#ni#p#ni#q#ni#r#ni(b#ni~P&,`O#S$dOP(aXR(aX[(aXj(aXn(aXr(aX!Q(aX!S(aX!l(aX!p(aX#R(aX#o(aX#p(aX#q(aX#r(aX#s(aX#t(aX#u(aX#v(aX#w(aX#y(aX#{(aX#|(aX$P(aX'z(aX(b(aX(s(aX(z(aX({(aX!](aX!^(aX~O$P$Qi!]$Qi!^$Qi~P#BwO$P!ri!^!ri~P$+}Og'^a!]'^a~P!1WO!^7pO~O!]'ea!^'ea~P#BwO!Y7qO~P#/sO!g#vO(s'qO!]'fa!k'fa~O!]/rO!k)Pi~O!]/rO!g#vO!k)Pi~Og$}q!]$}q#`$}q$P$}q~P!1WO!Y'ha!]'ha~P#/sO!g7xO~O!]/{O!Y)Qi~P#/sO!]/{O!Y)Qi~O!Y7{O~Oh%VOr8QO!l%eO(s'qO~Oj8SO!g#vO~Or8VO!g#vO(s'qO~O!Q*PO'z*QO({%POn'ka(z'ka!]'ka#`'ka~Og'ka$P'ka~P&5aO!Q*PO'z*QOn'ma(z'ma({'ma!]'ma#`'ma~Og'ma$P'ma~P&6SOg(`q!](`q~P!1WO#`8XOg(`q!](`q~P!1WO!Y8YO~Og%Pq!]%Pq#`%Pq$P%Pq~P!1WOa$py!]$py'{$py'x$py!Y$py!k$pyv$py!_$py%j$py!g$py~P!:tO!g6tO~O!]5^O!_)Ra~O!_'aOP$UaR$Ua[$Uaj$Uar$Ua!Q$Ua!S$Ua!]$Ua!l$Ua!p$Ua#R$Ua#o$Ua#p$Ua#q$Ua#r$Ua#s$Ua#t$Ua#u$Ua#v$Ua#w$Ua#y$Ua#{$Ua#|$Ua(b$Ua(s$Ua(z$Ua({$Ua~O%j7YO~P&8tO%_8^Oa%]i!_%]i'{%]i!]%]i~Oa#cy!]#cy'{#cy'x#cy!Y#cy!k#cyv#cy!_#cy%j#cy!g#cy~P!:tO[8`O~Ob8bO(U+sO(WTO(ZUO~O!]1VO!^)Yi~O`8fO~O(f(}O!]'qX!^'qX~O!]5wO!^)Va~O!^8pO~P%;sO(p!sO~P$&YO#[8qO~O!_1qO~O!_1qO%j8sO~On8vO!_1qO%j8sO~O[8{O!]'ta!^'ta~O!]1|O!^)Wi~O!k9PO~O!k9QO~O!k9TO~O!k9TO~P%[Oa9VO~O!g9WO~O!k9XO~O!](xi!^(xi~P#BwOa%nO#`9aO'{%nO~O!](uy!k(uya(uy'{(uy~P!:tO!](kO!k(ty~O%j9dO~P&8tO!_'aO%j9dO~O#l$}qP$}qR$}q[$}qa$}qj$}qr$}q!S$}q!]$}q!l$}q!p$}q#R$}q#o$}q#p$}q#q$}q#r$}q#s$}q#t$}q#u$}q#v$}q#w$}q#y$}q#{$}q#|$}q'{$}q(b$}q(s$}q!k$}q!Y$}q'x$}q#`$}qv$}q!_$}q%j$}q!g$}q~P#/sO#l'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#w'ka#y'ka#{'ka#|'ka'{'ka(b'ka(s'ka!k'ka!Y'ka'x'kav'ka!_'ka%j'ka!g'ka~P&5aO#l'maP'maR'ma['maa'maj'mar'ma!S'ma!l'ma!p'ma#R'ma#o'ma#p'ma#q'ma#r'ma#s'ma#t'ma#u'ma#v'ma#w'ma#y'ma#{'ma#|'ma'{'ma(b'ma(s'ma!k'ma!Y'ma'x'mav'ma!_'ma%j'ma!g'ma~P&6SO#l%PqP%PqR%Pq[%Pqa%Pqj%Pqr%Pq!S%Pq!]%Pq!l%Pq!p%Pq#R%Pq#o%Pq#p%Pq#q%Pq#r%Pq#s%Pq#t%Pq#u%Pq#v%Pq#w%Pq#y%Pq#{%Pq#|%Pq'{%Pq(b%Pq(s%Pq!k%Pq!Y%Pq'x%Pq#`%Pqv%Pq!_%Pq%j%Pq!g%Pq~P#/sO!]'Zi!k'Zi~P!:tO$P#cq!]#cq!^#cq~P#BwO(z$}OP%baR%ba[%baj%bar%ba!S%ba!l%ba!p%ba#R%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#v%ba#w%ba#y%ba#{%ba#|%ba$P%ba(b%ba(s%ba!]%ba!^%ba~On%ba!Q%ba'z%ba({%ba~P&JXO({%POP%daR%da[%daj%dar%da!S%da!l%da!p%da#R%da#o%da#p%da#q%da#r%da#s%da#t%da#u%da#v%da#w%da#y%da#{%da#|%da$P%da(b%da(s%da!]%da!^%da~On%da!Q%da'z%da(z%da~P&L`On>_O!Q*PO'z*QO({%PO~P&JXOn>_O!Q*PO'z*QO(z$}O~P&L`OR0mO!Q0mO!S0nO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#w}a#y}a#{}a#|}a$P}a'z}a(b}a(s}a(z}a({}a!]}a!^}a~O!Q*PO'z*QOP$taR$ta[$taj$tan$tar$ta!S$ta!l$ta!p$ta#R$ta#o$ta#p$ta#q$ta#r$ta#s$ta#t$ta#u$ta#v$ta#w$ta#y$ta#{$ta#|$ta$P$ta(b$ta(s$ta(z$ta({$ta!]$ta!^$ta~O!Q*PO'z*QOP$vaR$va[$vaj$van$var$va!S$va!l$va!p$va#R$va#o$va#p$va#q$va#r$va#s$va#t$va#u$va#v$va#w$va#y$va#{$va#|$va$P$va(b$va(s$va(z$va({$va!]$va!^$va~On>_O!Q*PO'z*QO(z$}O({%PO~OP%UaR%Ua[%Uaj%Uar%Ua!S%Ua!l%Ua!p%Ua#R%Ua#o%Ua#p%Ua#q%Ua#r%Ua#s%Ua#t%Ua#u%Ua#v%Ua#w%Ua#y%Ua#{%Ua#|%Ua$P%Ua(b%Ua(s%Ua!]%Ua!^%Ua~P''eO$P$nq!]$nq!^$nq~P#BwO$P$pq!]$pq!^$pq~P#BwO!^9qO~O$P9rO~P!1WO!g#vO!]'fi!k'fi~O!g#vO(s'qO!]'fi!k'fi~O!]/rO!k)Pq~O!Y'hi!]'hi~P#/sO!]/{O!Y)Qq~Or9yO!g#vO(s'qO~O[9{O!Y9zO~P#/sO!Y9zO~Oj:RO!g#vO~Og(`y!](`y~P!1WO!]'oa!_'oa~P#/sOa%]q!_%]q'{%]q!]%]q~P#/sO[:WO~O!]1VO!^)Yq~O`:[O~O#`:]O!]'qa!^'qa~O!]5wO!^)Vi~P#BwO!S:_O~O!_1qO%j:bO~O(WTO(ZUO(f:gO~O!]1|O!^)Wq~O!k:jO~O!k:kO~O!k:lO~O!k:lO~P%[O#`:oO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%j:tO~P&8tO!_'aO%j:tO~O$P#}y!]#}y!^#}y~P#BwOP$}iR$}i[$}ij$}ir$}i!S$}i!l$}i!p$}i#R$}i#o$}i#p$}i#q$}i#r$}i#s$}i#t$}i#u$}i#v$}i#w$}i#y$}i#{$}i#|$}i$P$}i(b$}i(s$}i!]$}i!^$}i~P''eO!Q*PO'z*QO({%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#w'ja#y'ja#{'ja#|'ja$P'ja(b'ja(s'ja(z'ja!]'ja!^'ja~O!Q*PO'z*QOP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#w'la#y'la#{'la#|'la$P'la(b'la(s'la(z'la({'la!]'la!^'la~O(z$}OP%biR%bi[%bij%bin%bir%bi!Q%bi!S%bi!l%bi!p%bi#R%bi#o%bi#p%bi#q%bi#r%bi#s%bi#t%bi#u%bi#v%bi#w%bi#y%bi#{%bi#|%bi$P%bi'z%bi(b%bi(s%bi({%bi!]%bi!^%bi~O({%POP%diR%di[%dij%din%dir%di!Q%di!S%di!l%di!p%di#R%di#o%di#p%di#q%di#r%di#s%di#t%di#u%di#v%di#w%di#y%di#{%di#|%di$P%di'z%di(b%di(s%di(z%di!]%di!^%di~O$P$py!]$py!^$py~P#BwO$P#cy!]#cy!^#cy~P#BwO!g#vO!]'fq!k'fq~O!]/rO!k)Py~O!Y'hq!]'hq~P#/sOr;OO!g#vO(s'qO~O[;SO!Y;RO~P#/sO!Y;RO~Og(`!R!](`!R~P!1WOa%]y!_%]y'{%]y!]%]y~P#/sO!]1VO!^)Yy~O!]5wO!^)Vq~O(U;ZO~O!_1qO%j;^O~O!k;aO~O%j;fO~P&8tOP$}qR$}q[$}qj$}qr$}q!S$}q!l$}q!p$}q#R$}q#o$}q#p$}q#q$}q#r$}q#s$}q#t$}q#u$}q#v$}q#w$}q#y$}q#{$}q#|$}q$P$}q(b$}q(s$}q!]$}q!^$}q~P''eO!Q*PO'z*QO({%POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#w'ka#y'ka#{'ka#|'ka$P'ka(b'ka(s'ka(z'ka!]'ka!^'ka~O!Q*PO'z*QOP'maR'ma['maj'man'mar'ma!S'ma!l'ma!p'ma#R'ma#o'ma#p'ma#q'ma#r'ma#s'ma#t'ma#u'ma#v'ma#w'ma#y'ma#{'ma#|'ma$P'ma(b'ma(s'ma(z'ma({'ma!]'ma!^'ma~OP%PqR%Pq[%Pqj%Pqr%Pq!S%Pq!l%Pq!p%Pq#R%Pq#o%Pq#p%Pq#q%Pq#r%Pq#s%Pq#t%Pq#u%Pq#v%Pq#w%Pq#y%Pq#{%Pq#|%Pq$P%Pq(b%Pq(s%Pq!]%Pq!^%Pq~P''eOg%f!Z!]%f!Z#`%f!Z$P%f!Z~P!1WO!Y;jO~P#/sOr;kO!g#vO(s'qO~O[;mO!Y;jO~P#/sO!]'qq!^'qq~P#BwO!]#h!Z!^#h!Z~P#BwO#l%f!ZP%f!ZR%f!Z[%f!Za%f!Zj%f!Zr%f!Z!S%f!Z!]%f!Z!l%f!Z!p%f!Z#R%f!Z#o%f!Z#p%f!Z#q%f!Z#r%f!Z#s%f!Z#t%f!Z#u%f!Z#v%f!Z#w%f!Z#y%f!Z#{%f!Z#|%f!Z'{%f!Z(b%f!Z(s%f!Z!k%f!Z!Y%f!Z'x%f!Z#`%f!Zv%f!Z!_%f!Z%j%f!Z!g%f!Z~P#/sOr;vO!g#vO(s'qO~O!Y;wO~P#/sOrSOe!iOpkOrQO(U)^O(WTO(ZUO(bVO(p[O~O!]XO!l$xO#k<|O$X%`O$uf!>nPPP!>tIZPPPPPPPPP!BTP!CbPPIZ!DsPIZPIZIZIZIZIZPIZ!FVP!IaP!LgP!Lk!Lu!Ly!LyP!I^P!L}!L}P#!TP#!XIZPIZ#!_#%dCiA]PA]PA]A]P#&qA]A]#)TA]#+{A]#.XA]A]#.w#1]#1]#1b#1k#1]#1vPP#1]PA]#2`A]#6_A]A]6lPPP#:dPPP#:}#:}P#:}P#;e#:}PP#;kP#;bP#;b#O#>U#>[#>b#>p#>v#?Q#?W#?b#?h#?x#@O#@p#AS#AY#A`#An#BT#Cx#DW#D_#Ey#FX#Gy#HX#H_#He#Hk#Hu#H{#IR#I]#Io#IuPPPPPPPPPPP#I{PPPPPPP#Jp#M}$ g$ n$ vPPP$'bP$'k$*d$0}$1Q$1T$2S$2V$2^$2fP$2l$2oP$3]$3a$4X$5g$5l$6SPP$6X$6_$6c$6f$6j$6n$7j$8R$8j$8n$8q$8t$9O$9R$9V$9ZR!|RoqOXst!Z#d%m&r&t&u&w,u,z2^2aY!vQ'a-g1q5}Q%tvQ%|yQ&T|Q&j!VS'W!e-^Q'g!iS'm!r!yU*l$|*[*pQ+q%}S,O&V&WQ,f&dQ-e'`Q-o'hQ-w'nQ0^*rQ1d,QQ1{,gR<}<[%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'c's(U(W(^(e(y({)P*O*j+Y+_,r,u,z-k-s.R.X.v.}/p0_0n0t1U1t2U2V2X2Z2^2a2c3S3Y3n4|6V6g6h6k7O8v9V9aS#q]TU+Q%]T!S!nQ!r!v!y!z$|'W'`'a'm'n'o*l*p*r*s-^-e-g-w0^0a1q5}6P%[$ti#v$b$c$d$x${%O%Q%^%_%c)z*S*U*W*Z*b*h*x*y+h+k,U,X.h/R/f/o/z/{/}0b0d0k0l0q1h1k1s3e4`4a4l4q5S5^5a6U7Y7x8S8X8^8s9d9r9{:R:b:t;S;^;f;mQ>Y>Z>^>_Q&X|S'U!e*[S']%i-bQ+v&PQ,R&WQ,h&gQ0p+TQ1[+wQ1a+}Q2S,lQ2T,mQ5h1VQ5q1cQ6^1|Q6a2OQ6b2RQ8b5iQ8e5nQ9O6dQ:Z8fQ:h8{R;X:[rnOXst!V!Z#d%m&i&r&t&u&w,u,z2^2aR,j&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'c's(W(^(e(y({)P)t*O*j+Y+_+i,r,u,z-Y-a-k-s.R.X.i.v.}/X/p0_0n0t1U1t2U2V2X2Z2^2a2c2q3S3Y3f3n4V4|5y6V6g6h6k6u7O7^8v9V9a:]:oS>T[#]WZ#W#Z'X(U!b%jm#h#i#l$x%e%h(_(i(j(k*Z*_*c+[+^+`,q-W.V.].^._.a/o/r2f3^3_4c6t7VQ%wxQ%{yW&Q|&V&W,QQ&_!TQ'd!hQ'f!iQ(r#sS+p%|%}Q+t&PQ,a&bQ,e&dS-n'g'hQ.k(sQ1T+qQ1Z+wQ1]+xQ1`+|Q1v,bS1z,f,gQ3O-oQ5g1VQ5k1YQ5p1bQ6]1{Q8a5iQ8d5mQ8h5rQ:V8`R;V:W!U$zi$d%O%Q%^%_%c*S*U*b*x*y/R/z0b0d0k0l0q4a5S8X9r>Q>Y>Z!^%yy!i!u%{%|%}'V'f'g'h'l'v*k+p+q-Z-n-o-v0T0W1T2w3O3V4t4u4x8P9}Q+j%wQ,V&[Q,Y&]Q,d&dQ.j(rQ1u,aU1y,e,f,gQ3g.kQ6W1vS6[1z1{Q8z6]#f>U#v$b$c$x${)z*W*Z*h+h+k,U,X.h/f/o/{/}1h1k1s3e4`4l4q5^5a6U7Y7x8S8^8s9d9{:R:b:t;S;^;f;m^>_o>VQS&[!Q&iQ&]!RQ&^!SU+O%[%d=tR,T&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)z*S*U*W*Z*b*h*x*y+h+k,U,X.h/R/f/o/z/{/}0b0d0k0l0q1h1k1s3e4`4a4l4q5S5^5a6U7Y7x8S8X8^8s9d9r9{:R:b:t;S;^;f;mQ>Y>Z>^>_T){$u)|V+Q%]T$i$^c#Y#e%q%s%u(T(Z(u(z)S)T)U)V)W)X)Y)Z)[)])_)a)c)h)r+f+z-[-z.P.U.W.u.x.|/O/P/Q/d0r2o2t3Q3X3m3r3s3t3u3v3w3x3y3z3{3|3}4O4R4S4Z5Z5e6w6}7S7c7d7m7n8m9Z9_9i9o9p:q;Y;bTQ'Y!eR2r-^!W!nQ!e!r!v!y!z$|'W'`'a'm'n'o*[*l*p*r*s-^-e-g-w0^0a1q5}6PR1n,]nqOXst!Z#d%m&r&t&u&w,u,z2^2aQ&y!^Q'w!xS(t#u<`Q+n%zQ,_&_Q,`&aQ-l'eQ-y'pS.t(y=QS0s+Y=[Q1R+oQ1p,^Q2e,|Q2g,}Q2n-XQ2|-mQ3P-qS5[0t=fQ5c1SS5f1U=gQ6v2pQ6z2}Q7P3UQ8_5dQ9[6xQ9]6{Q9`7QR:n9X$d$]c#Y#e%s%u(T(Z(u(z)S)T)U)V)W)X)Y)Z)[)])_)a)c)h)r+f+z-[-z.P.U.W.u.x.|/P/Q/d0r2o2t3Q3X3m3r3s3t3u3v3w3x3y3z3{3|3}4O4R4S4Z5Z5e6w6}7S7c7d7m7n8m9Z9_9i9o9p:q;Y;bTS#q]TU$fd)`,oS(q#p'jU*w%R(x4QU0o+P.p7iQ5`0zQ7X3bQ9f7[R:u9gm!tQ!r!v!y!z'a'm'n'o-g-w1q5}6PQ'u!uS(g#g2WS-u'l'xQ/u*^Q0T*kQ3W-xQ4h/vQ4t0VQ4u0WQ4z0`Q7t4bS8P4v4xS8T4{4}Q9t7uQ9x7{Q9}8QQ:S8VS:}9y9zS;i;O;RS;u;j;kS;};v;wSTR=p>S%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'c's(U(W(^(e(y({)P*O*j+Y+_+i,r,u,z-k-s.R.X.i.v.}/p0_0n0t1U1t2U2V2X2Z2^2a2c3S3Y3f3n4|6V6g6h6k7O7^8v9V9aQ%fj!^%xy!i!u%{%|%}'V'f'g'h'l'v*k+p+q-Z-n-o-v0T0W1T2w3O3V4t4u4x8P9}S&Oz!jQ+m%yQ,c&dW1x,d,e,f,gU6Z1y1z1{S8y6[6]Q:f8z!r=k$Z$n'X)t-Y-a/X2q4V5y6u:]:oTQ=u>RR=v>S%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'c's(W(^(e(y({)P*O*j+Y+_+i,r,u,z-k-s.R.X.i.v.}/p0_0n0t1U1t2U2V2X2Z2^2a2c3S3Y3f3n4|6V6g6h6k7O7^8v9V9aY#bWZ#W#Z(U!b%jm#h#i#l$x%e%h(_(i(j(k*Z*_*c+[+^+`,q-W.V.].^._.a/o/r2f3^3_4c6t7VQ,p&o!p=l$Z$n)t-Y-a/X2q4V5y6u:]:oTR=o'XU'^!e%i*[R2u-bX'[!e%i*[-b%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'c's(U(W(^(e(y({)P*O*j+Y+_,r,u,z-k-s.R.X.v.}/p0_0n0t1U1t2U2V2X2Z2^2a2c3S3Y3n4|6V6g6h6k7O8v9V9a!r)`$Z$n'X)t-Y-a/X2q4V5y6u:]:oTQ,o&oQ0z+iQ3b.iQ7[3fR9g7^!b$Tc#Y%q(T(Z(u(z)[)])a)h+z-z.P.U.W.u.x/d0r3Q3X3m3}5Z5e6}7S7c9_:qT)_)r-[/O2o2t3r4R4Z6w7d7m7n8m9Z9i9o9p;Y;b=wQ>Y>[R>Z>]'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'c's(U(W(^(e(y({)P)t*O*j+Y+_+i,r,u,z-Y-a-k-s.R.X.i.v.}/X/p0_0n0t1U1t2U2V2X2Z2^2a2c2q3S3Y3f3n4V4|5y6V6g6h6k6u7O7^8v9V9a:]:oTS$oh$pR4W/W'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'c's(U(W(^(e(y({)P)t*O*j+Y+_+i,r,u,z-Y-a-k-s.R.X.i.v.}/W/X/p0_0n0t1U1t2U2V2X2Z2^2a2c2q3S3Y3f3n4V4|5y6V6g6h6k6u7O7^8v9V9a:]:oTT$kf$qQ$ifS)k$l)oR)w$qT$jf$qT)m$l)o'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'c's(U(W(^(e(y({)P)t*O*j+Y+_+i,r,u,z-Y-a-k-s.R.X.i.v.}/W/X/p0_0n0t1U1t2U2V2X2Z2^2a2c2q3S3Y3f3n4V4|5y6V6g6h6k6u7O7^8v9V9a:]:oTT$oh$pQ$rhR)v$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'c's(U(W(^(e(y({)P*O*j+Y+_+i,r,u,z-k-s.R.X.i.v.}/p0_0n0t1U1t2U2V2X2Z2^2a2c3S3Y3f3n4|6V6g6h6k7O7^8v9V9a!s>R$Z$n'X)t-Y-a/X2q4V5y6u:]:oT#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'c)P)t*j+_+i,r,u,z-k.i/X/p0_0n1t2U2V2X2Z2^2a2c3f4V4|6V6g6h6k7^8v9V!U%Ri$d%O%Q%^%_%c*S*U*b*x*y/R/z0b0d0k0l0q4a5S8X9r>Q>Y>Z#f(x#v$b$c$x${)z*W*Z*h+h+k,U,X.h/f/o/{/}1h1k1s3e4`4l4q5^5a6U7Y7x8S8^8s9d9{:R:b:t;S;^;f;m^>_Q+U%aQ/e*Po4QQ>Y>ZQ*d$zU*m$|*[*pQ+V%bQ0Y*n#f=r#v$b$c$x${)z*W*Z*h+h+k,U,X.h/f/o/{/}1h1k1s3e4`4l4q5^5a6U7Y7x8S8^8s9d9{:R:b:t;S;^;f;m^>_n=sUQ=y>VQ=z>WR={>X!U%Ri$d%O%Q%^%_%c*S*U*b*x*y/R/z0b0d0k0l0q4a5S8X9r>Q>Y>Z#f(x#v$b$c$x${)z*W*Z*h+h+k,U,X.h/f/o/{/}1h1k1s3e4`4l4q5^5a6U7Y7x8S8^8s9d9{:R:b:t;S;^;f;m^>_o4QQ>Y>Z>^>_Q,W&]Q1j,YQ5u1iR8j5vV*o$|*[*pU*o$|*[*pT5|1q5}S0R*j/pQ4y0_T8U4|:_Q+l%xQ0X*mQ1Q+mQ1w,cQ6Y1xQ8x6ZQ:e8yR;`:f!U%Oi$d%O%Q%^%_%c*S*U*b*x*y/R/z0b0d0k0l0q4a5S8X9r>Q>Y>Zx*S$v)f*T*v+W/x0f0g4T4i5T5U5Y7r8W:T:z=q>O>PS0b*u0c#f^>_n[>]`=U4P7e7h7l9j:v:y;{S=`.n3kT=a7g9m!U%Qi$d%O%Q%^%_%c*S*U*b*x*y/R/z0b0d0k0l0q4a5S8X9r>Q>Y>Z|*U$v)f*V*u+W/i/x0f0g4T4i5O5T5U5Y7r8W:T:z=q>O>PS0d*v0e#f^>_n[>]d=W4P7f7g7l9j9k:v:w:y;{S=b.o3lT=c7h9nrnOXst!V!Z#d%m&i&r&t&u&w,u,z2^2aQ&f!UR,r&ornOXst!V!Z#d%m&i&r&t&u&w,u,z2^2aR&f!UQ,[&^R1f,TsnOXst!V!Z#d%m&i&r&t&u&w,u,z2^2aQ1r,aS6T1u1vU8r6R6S6WS:a8t8uS;[:`:cQ;o;]R;y;pQ&m!VR,k&iR6a2OR:h8{W&Q|&V&W,QR1]+xQ&r!WR,u&sR,{&xT2_,z2aR-P&yQ-O&yR2h-PQ'z!{R-{'zSsOtQ#dXT%ps#dQ#OTR'|#OQ#RUR(O#RQ)|$uR/b)|Q#UVR(R#UQ#XWU(X#X(Y.SQ(Y#YR.S(ZQ-_'YR2s-_Q.w(zS3o.w3pR3p.xQ-g'aR2x-gY!rQ'a-g1q5}R'k!rQ/S)fR4U/SU#_W%h*ZU(`#_(a.TQ(a#`R.T([Q-c'^R2v-ct`OXst!V!Z#d%m&i&k&r&t&u&w,u,z2^2aS#hZ%eU#r`#h.^R.^(kQ(l#jQ.Z(hW.c(l.Z3Z7TQ3Z.[R7T3[Q)o$lR/Y)oQ$phR)u$pQ$`cU)b$`.OO>P>[>]Q/|*fU4m/|4o7zQ4o0OR7z4nS*p$|*[R0[*px*T$v)f*u*v+W/x0f0g4T4i5T5U5Y7r8W:T:z=q>O>P!d.l(v)d*]*f.n.o.s/a/m0O0x1g3j4^4j4n5t7_7b7y7|8Z8]9v:O:U;P;T;g;l;x>[>]U/j*T.l7ea7e4P7g7h7l9j:v:y;{Q0c*uQ3k.nU5P0c3k9mR9m7g|*V$v)f*u*v+W/i/x0f0g4T4i5O5T5U5Y7r8W:T:z=q>O>P!h.m(v)d*]*f.n.o.s/a/m0O0x1g3h3j4^4j4n5t7_7`7b7y7|8Z8]9v:O:U;P;T;g;l;x>[>]U/l*V.m7fe7f4P7g7h7l9j9k:v:w:y;{Q0e*vQ3l.oU5R0e3l9nR9n7hQ*{%UR0i*{Q5_0xR8[5_Q+a%kR0w+aQ5x1lS8l5x:^R:^8mQ,^&_R1o,^Q5}1qR8o5}Q1},hS6_1}8|R8|6aQ1W+tW5j1W5l8c:XQ5l1ZQ8c5kR:X8dQ+y&QR1^+yQ2a,zR6o2aYrOXst#dQ&v!ZQ+c%mQ,t&rQ,v&tQ,w&uQ,y&wQ2[,uS2_,z2aR6n2^Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'r!uQ+b%lQ+n%zQ,S&XQ,j&mQ-R&|W-r'l't'u'xQ-y'pQ0Z*oQ1R+oQ1e,RS2Q,k,nQ2i-QQ2j-TQ2k-UQ3P-qW3R-t-u-x-zQ5c1SQ5o1aQ5s1gQ6X1wQ6c2SQ6m2]U6|3Q3T3WQ7P3UQ8_5dQ8g5qQ8i5tQ8n5|Q8w6YQ8}6bS9^6}7RQ9`7QQ:Y8eQ:d8xQ:i9OQ:p9_Q;W:ZQ;_:eQ;c:qQ;n;XR;q;`Q%zyQ'e!iQ'p!uU+o%{%|%}Q-X'VU-m'f'g'hS-q'l'vQ0S*kS1S+p+qQ2p-ZS2}-n-oQ3U-vS4r0T0WQ5d1TQ6x2wQ6{3OQ7Q3VU7}4t4u4xQ9|8PR;Q9}S$wi>QR*|%VU%Ui%V>QR0h*zQ$viS(v#v+kS)d$b$cQ)f$dQ*]$xS*f${*ZQ*u%OQ*v%QQ+R%^Q+S%_Q+W%cQ.nQQ>O>YQ>P>ZQ>[>^R>]>_Q+P%]Q.pTR#[WR'Z!el!tQ!r!v!y!z'a'm'n'o-g-w1q5}6PS'V!e-^U*k$|*[*pS-Z'W'`S0W*l*rQ0`*sQ2w-eQ4x0^R4}0aR(|#xQ!fQT-f'a-g]!qQ!r'a-g1q5}Q#p]R'j < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty VariableDefinition Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:381,context:cm,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,208,212,216,217,219,222,225,235,238,244,246,248,250,253,259,265,267,269,271,273,275,276,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,121,122,137,140,142,143,144,145,146,148,149,168,170,172,"Expression",-23,31,33,37,41,43,45,174,176,178,179,181,182,183,185,186,187,189,190,191,202,204,206,207,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",161,"JSXStartCloseTag"],["closedBy",-2,24,169,">",40,"InterpolationEnd",50,"]",61,"}",74,")",166,"JSXEndTag"]],propSources:[mm],skippedNodes:[0,5,6,279],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$j&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$j&j([!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU([!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$j&j(XpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(XpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Xp([!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$j&j(Xp([!b'}0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(Y#S$j&j(O0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$j&j(Xp([!b(O0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$j&j!p),Q(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#w(Ch$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#w(Ch$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(W':f$j&j([!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$j&j([!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$j&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$e`$j&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$e``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$e`$j&j([!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ([!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$e`([!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$j&j(Xp([!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$j&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS([!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$j&j(XpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(XpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Xp([!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$j&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$j&j([!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ([!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse([!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX([!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$j&j([!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$j&j(Xp([!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$j&j(Xp([!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$j&j(Xp([!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$j&j(Xp([!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$j&j$P)Lv(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$j&j(Xp([!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$j&j(Xp([!b'}0/l$^#t(U,2j(f$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$j&j(Xp([!b(O0/l$^#t(U,2j(f$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[um,dm,pm,gm,2,3,4,5,6,7,8,9,10,11,12,13,14,fm,new yn("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(d~~",141,341),new yn("j~RQYZXz{^~^O(R~~aP!P!Qd~iO(S~~",25,324)],topRules:{Script:[0,7],SingleExpression:[1,277],SingleClassItem:[2,278]},dialects:{jsx:0,ts:15179},dynamicPrecedences:{80:1,82:1,94:1,170:1,200:1},specialized:[{term:328,get:r=>Qm[r]||-1},{term:344,get:r=>Sm[r]||-1},{term:95,get:r=>bm[r]||-1}],tokenPrec:15205});function Co(r){let e=Object.keys(r).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function ym(r){let e=Object.create(null),t=Object.create(null);for(let{label:n}of r){e[n[0]]=!0;for(let s=1;stypeof n=="string"?{label:n}:n),[t,i]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:ym(e);return n=>{let s=n.matchBefore(i);return s||n.explicit?{from:s?s.from:n.pos,options:e,validFor:t}:null}}function Pm(r,e){return t=>{for(let i=se(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(r.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}const km=st.define(),wm=X.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class vm{constructor(e,t,i,n){this.field=e,this.line=t,this.from=i,this.to=n}}class zs{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,he.TrackDel),i=e.mapPos(this.to,1,he.TrackDel);return t==null||i==null?null:new zs(this.field,t,i)}}class Es{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],n=[t],s=e.doc.lineAt(t),l=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(i.length){let h=l,O=/^\t*/.exec(a)[0].length;for(let c=0;cnew zs(a.field,n[a.line]+a.from,n[a.line]+a.to));return{text:i,ranges:o}}static parse(e){let t=[],i=[],n=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let o=s[1]?+s[1]:null,a=s[2]||s[3]||"",h=-1;o===0&&(o=1e9);let O=a.replace(/\\[{}]/g,c=>c[1]);for(let c=0;c=h&&f.field++}for(let c of n)if(c.line==i.length&&c.from>s.index){let f=s[2]?3+(s[1]||"").length:2;c.from-=f,c.to-=f}n.push(new vm(h,i.length,s.index,s.index+O.length)),l=l.slice(0,s.index)+a+l.slice(s.index+s[0].length)}l=l.replace(/\\([{}])/g,(o,a,h)=>{for(let O of n)O.line==i.length&&O.from>h&&(O.from--,O.to--);return a}),i.push(l)}return new Es(i,n)}}let Xm=E.widget({widget:new class extends xi{toDOM(){let r=document.createElement("span");return r.className="cm-snippetFieldPosition",r}ignoreEvent(){return!1}}}),Zm=E.mark({class:"cm-snippetField"});class Ft{constructor(e,t){this.ranges=e,this.active=t,this.deco=E.set(e.map(i=>(i.from==i.to?Xm:Zm).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let n=i.map(e);if(!n)return null;t.push(n)}return new Ft(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Xi=L.define({map(r,e){return r&&r.map(e)}}),Tm=L.define(),yi=rt.define({create(){return null},update(r,e){for(let t of e.effects){if(t.is(Xi))return t.value;if(t.is(Tm)&&r)return new Ft(r.ranges,t.value)}return r&&e.docChanged&&(r=r.map(e.changes)),r&&e.selection&&!r.selectionInsideField(e.selection)&&(r=null),r},provide:r=>X.decorations.from(r,e=>e?e.deco:E.none)});function Vs(r,e){return S.create(r.filter(t=>t.field==e).map(t=>S.range(t.from,t.to)))}function Am(r){let e=Es.parse(r);return(t,i,n,s)=>{let{text:l,ranges:o}=e.instantiate(t.state,n),{main:a}=t.state.selection,h={changes:{from:n,to:s==a.from?a.to:s,insert:j.of(l)},scrollIntoView:!0,annotations:i?[km.of(i),H.userEvent.of("input.complete")]:void 0};if(o.length&&(h.selection=Vs(o,0)),o.some(O=>O.field>0)){let O=new Ft(o,0),c=h.effects=[Xi.of(O)];t.state.field(yi,!1)===void 0&&c.push(L.appendConfig.of([yi,Ym,_m,wm]))}t.dispatch(t.state.update(h))}}function gO(r){return({state:e,dispatch:t})=>{let i=e.field(yi,!1);if(!i||r<0&&i.active==0)return!1;let n=i.active+r,s=r>0&&!i.ranges.some(l=>l.field==n+r);return t(e.update({selection:Vs(i.ranges,n),effects:Xi.of(s?null:new Ft(i.ranges,n)),scrollIntoView:!0})),!0}}const Cm=({state:r,dispatch:e})=>r.field(yi,!1)?(e(r.update({effects:Xi.of(null)})),!0):!1,Rm=gO(1),jm=gO(-1),Mm=[{key:"Tab",run:Rm,shift:jm},{key:"Escape",run:Cm}],Ro=w.define({combine(r){return r.length?r[0]:Mm}}),Ym=wn.highest(Ps.compute([Ro],r=>r.facet(Ro)));function ue(r,e){return{...e,apply:Am(r)}}const _m=X.domEventHandlers({mousedown(r,e){let t=e.state.field(yi,!1),i;if(!t||(i=e.posAtCoords({x:r.clientX,y:r.clientY}))==null)return!1;let n=t.ranges.find(s=>s.from<=i&&s.to>=i);return!n||n.field==t.active?!1:(e.dispatch({selection:Vs(t.ranges,n.field),effects:Xi.of(t.ranges.some(s=>s.field>n.field)?new Ft(t.ranges,n.field):null),scrollIntoView:!0}),!0)}}),mO=new class extends ct{};mO.startSide=1;mO.endSide=-1;const QO=[ue("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ue("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ue("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ue("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ue("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ue(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),ue("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),ue(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),ue(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),ue('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ue('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Wm=QO.concat([ue("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ue("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ue("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),jo=new sh,SO=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function ri(r){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,r),!0}}const qm=["FunctionDeclaration"],zm={FunctionDeclaration:ri("function"),ClassDeclaration:ri("class"),ClassExpression:()=>!0,EnumDeclaration:ri("constant"),TypeAliasDeclaration:ri("type"),NamespaceDeclaration:ri("namespace"),VariableDefinition(r,e){r.matchContext(qm)||e(r,"variable")},TypeDefinition(r,e){e(r,"type")},__proto__:null};function bO(r,e){let t=jo.get(e);if(t)return t;let i=[],n=!0;function s(l,o){let a=r.sliceString(l.from,l.to);i.push({label:a,type:o})}return e.cursor(Y.IncludeAnonymous).iterate(l=>{if(n)n=!1;else if(l.name){let o=zm[l.name];if(o&&o(l,s)||SO.has(l.name))return!1}else if(l.to-l.from>8192){for(let o of bO(r,l.node))i.push(o);return!1}}),jo.set(e,i),i}const Mo=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,$O=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Em(r){let e=se(r.state).resolveInner(r.pos,-1);if($O.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Mo.test(r.state.sliceDoc(e.from,e.to));if(!t&&!r.explicit)return null;let i=[];for(let n=e;n;n=n.parent)SO.has(n.name)&&(i=i.concat(bO(r.state.doc,n)));return{options:i,from:t?e.from:r.pos,validFor:Mo}}const Ue=Lt.define({name:"javascript",parser:$m.configure({props:[_n.add({IfStatement:Ki({except:/^\s*({|else\b)/}),TryStatement:Ki({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:zu,SwitchBody:r=>{let e=r.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return r.baseIndent+(t?0:i?1:2)*r.unit},Block:qu({closing:"}"}),ArrowFunction:r=>r.baseIndent+r.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ki({except:/^\s*{/}),JSXElement(r){let e=/^\s*<\//.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},JSXEscape(r){let e=/\s*\}/.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},"JSXOpenTag JSXSelfClosingTag"(r){return r.column(r.node.from)+r.unit}}),Cs.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":ph,BlockComment(r){return{from:r.from+2,to:r.to-2}},JSXElement(r){let e=r.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=r.lastChild;return{from:e.to,to:t.type.isError?r.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(r){var e;let t=(e=r.firstChild)===null||e===void 0?void 0:e.nextSibling,i=r.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?r.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),yO={test:r=>/^JSX/.test(r.name),facet:Oh({commentTokens:{block:{open:"{/*",close:"*/}"}}})},xO=Ue.configure({dialect:"ts"},"typescript"),PO=Ue.configure({dialect:"jsx",props:[Zs.add(r=>r.isTop?[yO]:void 0)]}),kO=Ue.configure({dialect:"jsx ts",props:[Zs.add(r=>r.isTop?[yO]:void 0)]},"typescript");let wO=r=>({label:r,type:"keyword"});const vO="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(wO),Vm=vO.concat(["declare","implements","private","protected","public"].map(wO));function Dm(r={}){let e=r.jsx?r.typescript?kO:PO:r.typescript?xO:Ue,t=r.typescript?Wm.concat(Vm):QO.concat(vO);return new Ts(e,[Ue.data.of({autocomplete:Pm($O,xm(t))}),Ue.data.of({autocomplete:Em}),r.jsx?Um:[]])}function Lm(r){for(;;){if(r.name=="JSXOpenTag"||r.name=="JSXSelfClosingTag"||r.name=="JSXFragmentTag")return r;if(r.name=="JSXEscape"||!r.parent)return null;r=r.parent}}function Yo(r,e,t=r.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return r.sliceString(i.from,Math.min(i.to,t));return""}const Bm=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Um=X.inputHandler.of((r,e,t,i,n)=>{if((Bm?r.composing:r.compositionStarted)||r.state.readOnly||e!=t||i!=">"&&i!="/"||!Ue.isActiveAt(r.state,e,-1))return!1;let s=n(),{state:l}=s,o=l.changeByRange(a=>{var h;let{head:O}=a,c=se(l).resolveInner(O-1,-1),f;if(c.name=="JSXStartTag"&&(c=c.parent),!(l.doc.sliceString(O-1,O)!=i||c.name=="JSXAttributeValue"&&c.to>O)){if(i==">"&&c.name=="JSXFragmentTag")return{range:a,changes:{from:O,insert:""}};if(i=="/"&&c.name=="JSXStartCloseTag"){let u=c.parent,d=u.parent;if(d&&u.from==O-2&&((f=Yo(l.doc,d.firstChild,O))||((h=d.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let p=`${f}>`;return{range:S.cursor(O+p.length,-1),changes:{from:O,insert:p}}}}else if(i==">"){let u=Lm(c);if(u&&u.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(l.doc.sliceString(O,O+2))&&(f=Yo(l.doc,u,O)))return{range:a,changes:{from:O,insert:``}}}}return{range:a}});return o.changes.empty?!1:(r.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),si=["_blank","_self","_top","_parent"],pr=["ascii","utf-8","utf-16","latin1","latin1"],gr=["get","post","put","delete"],mr=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Qe=["true","false"],k={},Gm={a:{attrs:{href:null,ping:null,type:null,media:null,target:si,hreflang:null}},abbr:k,address:k,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:k,aside:k,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:k,base:{attrs:{href:null,target:si}},bdi:k,bdo:k,blockquote:{attrs:{cite:null}},body:k,br:k,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:mr,formmethod:gr,formnovalidate:["novalidate"],formtarget:si,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:k,center:k,cite:k,code:k,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:k,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:k,div:k,dl:k,dt:k,em:k,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:k,figure:k,footer:k,form:{attrs:{action:null,name:null,"accept-charset":pr,autocomplete:["on","off"],enctype:mr,method:gr,novalidate:["novalidate"],target:si}},h1:k,h2:k,h3:k,h4:k,h5:k,h6:k,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:k,hgroup:k,hr:k,html:{attrs:{manifest:null}},i:k,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:mr,formmethod:gr,formnovalidate:["novalidate"],formtarget:si,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:k,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:k,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:k,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:pr,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:k,noscript:k,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:k,param:{attrs:{name:null,value:null}},pre:k,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:k,rt:k,ruby:k,samp:k,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:pr}},section:k,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:k,source:{attrs:{src:null,type:null,media:null}},span:k,strong:k,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:k,summary:k,sup:k,table:k,tbody:k,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:k,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:k,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:k,time:{attrs:{datetime:null}},title:k,tr:k,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:k,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:k},XO={accesskey:null,class:null,contenteditable:Qe,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Qe,autocorrect:Qe,autocapitalize:Qe,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Qe,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Qe,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Qe,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Qe,"aria-hidden":Qe,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Qe,"aria-multiselectable":Qe,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Qe,"aria-relevant":null,"aria-required":Qe,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},ZO="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(r=>"on"+r);for(let r of ZO)XO[r]=null;class kn{constructor(e,t){this.tags={...Gm,...e},this.globalAttrs={...XO,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}kn.default=new kn;function kt(r,e,t=r.length){if(!e)return"";let i=e.firstChild,n=i&&i.getChild("TagName");return n?r.sliceString(n.from,Math.min(n.to,t)):""}function It(r,e=!1){for(;r;r=r.parent)if(r.name=="Element")if(e)e=!1;else return r;return null}function TO(r,e,t){let i=t.tags[kt(r,It(e))];return i?.children||t.allTags}function Ds(r,e){let t=[];for(let i=It(e);i&&!i.type.isTop;i=It(i.parent)){let n=kt(r,i);if(n&&i.lastChild.name=="CloseTag")break;n&&t.indexOf(n)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(n)}return t}const AO=/^[:\-\.\w\u00b7-\uffff]*$/;function _o(r,e,t,i,n){let s=/\s*>/.test(r.sliceDoc(n,n+5))?"":">",l=It(t,t.name=="StartTag"||t.name=="TagName");return{from:i,to:n,options:TO(r.doc,l,e).map(o=>({label:o,type:"type"})).concat(Ds(r.doc,t).map((o,a)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Wo(r,e,t,i){let n=/\s*>/.test(r.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:Ds(r.doc,e).map((s,l)=>({label:s,apply:s+n,type:"type",boost:99-l})),validFor:AO}}function Im(r,e,t,i){let n=[],s=0;for(let l of TO(r.doc,t,e))n.push({label:"<"+l,type:"type"});for(let l of Ds(r.doc,t))n.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:n,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Nm(r,e,t,i,n){let s=It(t),l=s?e.tags[kt(r.doc,s)]:null,o=l&&l.attrs?Object.keys(l.attrs):[],a=l&&l.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:n,options:a.map(h=>({label:h,type:"property"})),validFor:AO}}function Fm(r,e,t,i,n){var s;let l=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],a;if(l){let h=r.sliceDoc(l.from,l.to),O=e.globalAttrs[h];if(!O){let c=It(t),f=c?e.tags[kt(r.doc,c)]:null;O=f?.attrs&&f.attrs[h]}if(O){let c=r.sliceDoc(i,n).toLowerCase(),f='"',u='"';/^['"]/.test(c)?(a=c[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",u=r.sliceDoc(n,n+1)==c[0]?"":c[0],c=c.slice(1),i++):a=/^[^\s<>='"]*$/;for(let d of O)o.push({label:d,apply:f+d+u,type:"constant"})}}return{from:i,to:n,options:o,validFor:a}}function Hm(r,e){let{state:t,pos:i}=e,n=se(t).resolveInner(i,-1),s=n.resolve(i);for(let l=i,o;s==n&&(o=n.childBefore(l));){let a=o.lastChild;if(!a||!a.type.isError||a.fromHm(i,n)}const Jm=Ue.parser.configure({top:"SingleExpression"}),CO=[{tag:"script",attrs:r=>r.type=="text/typescript"||r.lang=="ts",parser:xO.parser},{tag:"script",attrs:r=>r.type=="text/babel"||r.type=="text/jsx",parser:PO.parser},{tag:"script",attrs:r=>r.type=="text/typescript-jsx",parser:kO.parser},{tag:"script",attrs(r){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(r.type)},parser:Jm},{tag:"script",attrs(r){return!r.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(r.type)},parser:Ue.parser},{tag:"style",attrs(r){return(!r.lang||r.lang=="css")&&(!r.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(r.type))},parser:Pn.parser}],RO=[{name:"style",parser:Pn.parser.configure({top:"Styles"})}].concat(ZO.map(r=>({name:r,parser:Ue.parser}))),jO=Lt.define({name:"html",parser:ag.configure({props:[_n.add({Element(r){let e=/^(\s*)(<\/)?/.exec(r.textAfter);return r.node.to<=r.pos+e[0].length?r.continue():r.lineIndent(r.node.from)+(e[2]?0:r.unit)},"OpenTag CloseTag SelfClosingTag"(r){return r.column(r.node.from)+r.unit},Document(r){if(r.pos+/\s*/.exec(r.textAfter)[0].lengthr.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),tn=jO.configure({wrap:aO(CO,RO)});function e0(r={}){let e="",t;r.matchClosingTags===!1&&(e="noMatch"),r.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(r.nestedLanguages&&r.nestedLanguages.length||r.nestedAttributes&&r.nestedAttributes.length)&&(t=aO((r.nestedLanguages||[]).concat(CO),(r.nestedAttributes||[]).concat(RO)));let i=t?jO.configure({wrap:t,dialect:e}):e?tn.configure({dialect:e}):tn;return new Ts(i,[tn.data.of({autocomplete:Km(r)}),r.autoCloseTags!==!1?i0:[],Dm().support,dO().support])}const qo=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));function t0(r,e,t){for(var i;;){if(((i=e.lastChild)===null||i===void 0?void 0:i.name)!="CloseTag")return!1;let n=e.parent;if(!n||kt(r,n)!=t)return!0;e=n}}const i0=X.inputHandler.of((r,e,t,i,n)=>{if(r.composing||r.state.readOnly||e!=t||i!=">"&&i!="/"||!tn.isActiveAt(r.state,e,-1))return!1;let s=n(),{state:l}=s,o=l.changeByRange(a=>{var h;let O=l.doc.sliceString(a.from-1,a.to)==i,{head:c}=a,f=se(l).resolveInner(c,-1),u;if(O&&i==">"&&f.name=="EndTag"){let d=f.parent;if((u=kt(l.doc,d.parent,c))&&!qo.has(u)&&!t0(l.doc,d.parent,u)){let p=c+(l.doc.sliceString(c,c+1)===">"?1:0),m=``;return{range:a,changes:{from:c,to:p,insert:m}}}}else if(O&&i=="/"&&f.name=="IncompleteCloseTag"){let d=f.parent;if(f.from==c-2&&((h=d.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(u=kt(l.doc,d,c))&&!qo.has(u)){let p=c+(l.doc.sliceString(c,c+1)===">"?1:0),m=`${u}>`;return{range:S.cursor(c+m.length,-1),changes:{from:c,to:p,insert:m}}}}return{range:a}});return o.changes.empty?!1:(r.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),zo=new Kf({regexp:/\{\{[\s\S]*?\}\}/g,decoration:()=>E.mark({class:"cm-summer-action"})}),n0=Ge.fromClass(class{decorations;constructor(r){this.decorations=zo.createDeco(r)}update(r){this.decorations=zo.updateDeco(r,this.decorations)}},{decorations:r=>r.decorations}),r0=Wn.define([{tag:[g.tagName,g.propertyName,g.keyword],color:"var(--c-primary)",fontStyle:"normal",fontWeight:"400"},{tag:[g.string,g.attributeValue],color:"var(--c-ok-text)",fontStyle:"normal",fontWeight:"400"},{tag:[g.attributeName,g.name,g.variableName],color:"var(--c-text)",fontStyle:"normal",fontWeight:"400"},{tag:[g.comment,g.punctuation,g.bracket,g.paren],color:"var(--c-muted)",fontStyle:"normal",fontWeight:"400"}]);function s0(r){return r==="html"?e0():r==="css"?dO():[]}function l0(r){return X.theme({"&":{height:`${r}px`,fontFamily:"var(--font-mono)",fontSize:"13px",lineHeight:"1.5",color:"var(--c-text)",backgroundColor:"var(--c-surface)"},".cm-scroller":{overflow:"auto",fontFamily:"inherit"},".cm-content":{padding:"10px 14px",caretColor:"var(--c-text)",fontFamily:"inherit"},".cm-gutters":{backgroundColor:"var(--c-subtle)",color:"var(--c-muted)",border:"none"},".cm-activeLine":{backgroundColor:"var(--c-hover)"},".cm-activeLineGutter":{backgroundColor:"var(--c-hover)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--c-sel)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--c-text)"},".cm-summer-action":{color:"var(--c-primary)",backgroundColor:"var(--c-subtle)",borderRadius:"4px"}})}function c0(r){const e=Ps.of([...$d,...gp.filter(n=>n.key!=="Mod-Enter")]);let t=!1;const i=new X({parent:r.parent,state:_.create({doc:r.doc,extensions:[ou(),Hu(),fd(),s0(r.language),n0,Vu(r0),l0(r.height),e,...r.language==="text"?[X.lineWrapping]:[],X.contentAttributes.of(r.attributes),X.updateListener.of(n=>{n.view.hasFocus&&(t=!0),n.docChanged&&r.onChange(n.state.doc.toString())})]})});return{view:i,insert(n){const{state:s}=i,l=t?s.selection.main:null,o=l?l.from:s.doc.length,a=l?l.to:s.doc.length;i.dispatch({changes:{from:o,to:a,insert:n},selection:{anchor:o+n.length}}),i.focus()},destroy(){i.destroy()},setDoc(n){i.state.doc.toString()!==n&&i.dispatch({changes:{from:0,to:i.state.doc.length,insert:n}})}}}export{c0 as createCodeEditor}; diff --git a/modules/boardwalk/dist/assets/index-Bvfii4cZ.css b/modules/boardwalk/dist/assets/index-Bvfii4cZ.css new file mode 100644 index 00000000..a8d6575b --- /dev/null +++ b/modules/boardwalk/dist/assets/index-Bvfii4cZ.css @@ -0,0 +1 @@ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:"DM Sans", ui-sans-serif, system-ui, sans-serif;--font-mono:"DM Mono", ui-monospace, monospace;--color-white:#fff;--spacing:.25rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-tight:1.25;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:var(--c-bg);--color-surface:var(--c-surface);--color-subtle:var(--c-subtle);--color-border:var(--c-border);--color-border-strong:var(--c-border-strong);--color-text:var(--c-text);--color-muted:var(--c-muted);--color-placeholder:var(--c-placeholder);--color-primary:var(--c-primary);--color-on-primary:var(--c-on-primary);--color-danger:var(--c-danger);--color-danger-soft:var(--c-danger-soft);--color-ok-bg:var(--c-ok-bg);--color-ok-text:var(--c-ok-text);--color-hover:var(--c-hover);--color-sel:var(--c-sel);--color-skel:var(--c-skel);--color-overlay:var(--c-overlay);--color-side:var(--c-side);--color-side-border:var(--c-side-border);--color-accent:#fcd34d;--color-on-accent:#1b2540;--color-accent-soft:#fcd34d24;--color-side-text:#c3cbda;--color-side-hover:#ffffff14;--radius-control:10px;--radius-card:16px;--radius-modal:20px;--radius-inner:12px;--radius-tab:9px;--radius-checkbox:5px;--radius-pager:8px;--radius-pill:999px;--spacing-button:42px;--spacing-input:44px;--spacing-header:64px;--spacing-nav:40px;--spacing-row:54px;--spacing-row-head:44px;--spacing-pager:34px;--spacing-rail:96px;--spacing-panel:224px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{font-family:var(--font-sans);color:var(--c-text);background:var(--c-bg);font-size:14px;line-height:1.5}body{min-height:100vh;margin:0}a:focus-visible,button:focus-visible,[role=button]:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--c-ring);outline-offset:2px}input:focus-visible,select:focus-visible,textarea:focus-visible{border-color:var(--c-primary);box-shadow:0 0 0 3px var(--c-ring);outline:none}input::placeholder,textarea::placeholder{color:var(--c-placeholder)}}@layer components{.bg-overlay[data-state=open]{animation:.2s ease-out summer-fade-in}[data-dialog-content][data-state=open],[role=alertdialog][data-state=open]{animation:.2s ease-out summer-dialog-in}.toast-enter-active{transition:opacity .2s ease-out,scale .2s ease-out}.toast-enter-from{opacity:0;scale:.98}.summer-partial{color:var(--c-text);overflow-wrap:anywhere;font-size:14px;line-height:1.5}.summer-partial :where(p,ul,ol){margin:0 0 8px}.summer-partial :where(p,ul,ol):last-child{margin-bottom:0}.summer-partial a{color:var(--c-text);text-decoration:underline}.summer-partial a:focus-visible{outline:3px solid var(--c-ring);outline-offset:2px}.summer-markdown{color:var(--c-text);overflow-wrap:anywhere;font-size:14px;line-height:1.6}.summer-markdown :where(h1,h2,h3,h4){color:var(--c-text);margin:0 0 8px;font-weight:600;line-height:1.3}.summer-markdown :where(h1){font-size:22px}.summer-markdown :where(h2){font-size:18px}.summer-markdown :where(h3){font-size:16px}.summer-markdown :where(h4){font-size:14px}.summer-markdown :where(p,ul,ol,blockquote,pre,table){margin:0 0 10px}.summer-markdown :where(h1,h2,h3,h4,p,ul,ol,blockquote,pre,table):last-child{margin-bottom:0}.summer-markdown :where(ul){padding-left:22px;list-style:outside}.summer-markdown :where(ol){padding-left:22px;list-style:decimal}.summer-markdown :where(code){font-family:var(--font-mono);background:var(--c-subtle);border-radius:4px;padding:1px 4px;font-size:13px}.summer-markdown :where(pre){font-family:var(--font-mono);background:var(--c-subtle);white-space:pre;border-radius:8px;padding:10px 12px;font-size:13px;overflow-x:auto}.summer-markdown :where(pre code){background:0 0;padding:0}.summer-markdown :where(blockquote){border-left:3px solid var(--c-border-strong);color:var(--c-muted);padding-left:12px}.summer-markdown :where(a){color:var(--c-text);text-decoration:underline}.summer-markdown :where(a):focus-visible{outline:3px solid var(--c-ring);outline-offset:2px}.summer-markdown :where(hr){border:0;border-top:1px solid var(--c-border);margin:12px 0}.summer-markdown :where(table){border-collapse:collapse}.summer-markdown :where(th,td){border:1px solid var(--c-border);text-align:left;padding:4px 8px}.summer-markdown :where(img){max-width:100%;height:auto}.summer-stats{background:var(--c-surface);border:1px solid var(--c-border);box-shadow:var(--c-shadow-card);border-radius:16px;flex-wrap:wrap;gap:8px 32px;margin:0;padding:16px 20px;display:flex}.summer-stat{flex-direction:column-reverse;gap:4px;min-width:0;display:flex}.summer-stat__label{color:var(--c-muted);overflow-wrap:anywhere;margin:0;font-size:13px;font-weight:400;line-height:1.5}.summer-stat__value{color:var(--c-text);font-variant-numeric:tabular-nums;margin:0;font-size:20px;font-weight:600;line-height:1.2}.summer-stat__note{color:var(--c-muted);margin-top:4px;font-size:13px;font-weight:400;line-height:1.5;display:block}.summer-table-wrap{max-width:100%;overflow-x:auto}.summer-table{border-collapse:collapse;width:100%;color:var(--c-text);font-size:14px;line-height:1.5}.summer-table th{height:var(--spacing-row-head);color:var(--c-muted);text-align:start;border-bottom:1px solid var(--c-border);white-space:nowrap;padding:0 14px;font-size:12px;font-weight:600}.summer-table td{vertical-align:top;border-bottom:1px solid var(--c-border);overflow-wrap:anywhere;padding:12px 14px}.summer-table :where(th,td):first-child{padding-inline-start:0}.summer-table :where(th,td):last-child{padding-inline-end:0}.summer-table__num{text-align:end;font-variant-numeric:tabular-nums;white-space:nowrap}.summer-table__sub{color:var(--c-muted);font-size:13px;display:block}.summer-table tfoot td{border-bottom:0;padding-top:16px;font-weight:600}.summer-callout{overflow-wrap:anywhere;border-radius:12px;flex-direction:column;gap:4px;margin:0;padding:14px 18px;font-size:14px;line-height:1.5;display:flex}.summer-partial .summer-callout:not(:last-child){margin-bottom:12px}.summer-callout--warning{background:var(--c-sel);color:var(--c-text)}.summer-callout--danger{background:var(--c-danger-soft);color:var(--c-danger)}.summer-callout__title{margin:0;font-weight:600}.summer-callout__text{margin:0;font-weight:400}.summer-diff{border:1px solid var(--c-border);background:var(--c-subtle);max-height:480px;font-family:var(--font-mono);white-space:pre;color:var(--c-text);border-radius:12px;margin:0;padding:12px 16px;font-size:13px;line-height:1.5;overflow:auto}.summer-diff__add,.summer-diff__del,.summer-diff__ctx{display:block}.summer-diff__add{background:var(--c-ok-bg);color:var(--c-ok-text)}.summer-diff__del{background:var(--c-danger-soft);color:var(--c-danger)}.summer-diff__ctx{color:var(--c-text)}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.inset-y-px{inset-block:1px}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-\[3px\]{top:3px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-1\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-3\.5{right:calc(var(--spacing) * 3.5)}.right-4{right:calc(var(--spacing) * 4)}.right-px{right:1px}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-\[88px\]{bottom:88px}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-3\.5{left:calc(var(--spacing) * 3.5)}.left-\[3px\]{left:3px}.left-\[calc\(var\(--spacing-rail\)\+8px\)\]{left:calc(var(--spacing-rail) + 8px)}.left-\[var\(--shell-offset\,0px\)\]{left:var(--shell-offset,0px)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[80\]{z-index:80}.z-\[90\]{z-index:90}.col-span-4{grid-column:span 4/span 4}.col-span-full{grid-column:1/-1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.my-1{margin-block:calc(var(--spacing) * 1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-px{margin-top:1px}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-3\.5{margin-bottom:calc(var(--spacing) * 3.5)}.mb-\[18px\]{margin-bottom:18px}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-10\!{width:calc(var(--spacing) * 10)!important;height:calc(var(--spacing) * 10)!important}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20)}.size-40{width:calc(var(--spacing) * 40);height:calc(var(--spacing) * 40)}.size-\[18px\]{width:18px;height:18px}.size-\[20px\]{width:20px;height:20px}.size-\[22px\]{width:22px;height:22px}.size-\[26px\]{width:26px;height:26px}.size-\[30px\]{width:30px;height:30px}.size-\[34px\]{width:34px;height:34px}.size-\[96px\]{width:96px;height:96px}.size-full{width:100%;height:100%}.size-input{width:var(--spacing-input);height:var(--spacing-input)}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-3{height:calc(var(--spacing) * 3)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-\[26px\]{height:26px}.h-\[30px\]{height:30px}.h-\[34px\]{height:34px}.h-\[38px\]{height:38px}.h-\[42px\]{height:42px}.h-\[44px\]{height:44px}.h-\[54px\]{height:54px}.h-\[56px\]{height:56px}.h-\[68px\]{height:68px}.h-\[80px\]{height:80px}.h-\[112px\]{height:112px}.h-\[200px\]{height:200px}.h-\[640px\]{height:640px}.h-button{height:var(--spacing-button)}.h-full{height:100%}.h-header{height:var(--spacing-header)}.h-input{height:var(--spacing-input)}.h-nav{height:var(--spacing-nav)}.h-pager{height:var(--spacing-pager)}.h-px{height:1px}.h-row{height:var(--spacing-row)}.h-row-head{height:var(--spacing-row-head)}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[480px\]{max-height:480px}.max-h-\[640px\]{max-height:640px}.max-h-\[calc\(100vh-32px\)\]{max-height:calc(100vh - 32px)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-14{min-height:calc(var(--spacing) * 14)}.min-h-\[30px\]{min-height:30px}.min-h-\[56px\]{min-height:56px}.min-h-\[112px\]{min-height:112px}.min-h-\[160px\]{min-height:160px}.min-h-input{min-height:var(--spacing-input)}.min-h-row{min-height:var(--spacing-row)}.min-h-screen{min-height:100vh}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-2\/3{width:66.6667%}.w-2\/5{width:40%}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-9{width:calc(var(--spacing) * 9)}.w-24{width:calc(var(--spacing) * 24)}.w-40{width:calc(var(--spacing) * 40)}.w-48{width:calc(var(--spacing) * 48)}.w-64{width:calc(var(--spacing) * 64)}.w-\[44px\]{width:44px}.w-\[52px\]{width:52px}.w-\[56px\]{width:56px}.w-\[92px\]{width:92px}.w-\[160px\]{width:160px}.w-\[220px\]{width:220px}.w-\[230px\]{width:230px}.w-\[240px\]{width:240px}.w-\[280px\]{width:280px}.w-\[284px\]{width:284px}.w-\[320px\]{width:320px}.w-\[360px\]{width:360px}.w-\[calc\(100\%-32px\)\]{width:calc(100% - 32px)}.w-full{width:100%}.w-panel{width:var(--spacing-panel)}.w-px{width:1px}.w-rail{width:var(--spacing-rail)}.max-w-\[320px\]{max-width:320px}.max-w-\[400px\]{max-width:400px}.max-w-\[420px\]{max-width:420px}.max-w-\[440px\]{max-width:440px}.max-w-\[560px\]{max-width:560px}.max-w-\[640px\]{max-width:640px}.max-w-\[720px\]{max-width:720px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-6{min-width:calc(var(--spacing) * 6)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[52px\]{min-width:52px}.min-w-\[120px\]{min-width:120px}.min-w-\[480px\]{min-width:480px}.min-w-\[640px\]{min-width:640px}.min-w-pager{min-width:var(--spacing-pager)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[18px\]{--tw-translate-x:18px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.animate-spin{animation:var(--animate-spin)}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.list-none{list-style-type:none}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(160px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-start\!{align-items:flex-start!important}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-7{gap:calc(var(--spacing) * 7)}.gap-\[18px\]{gap:18px}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-\[22px\]{row-gap:22px}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[4px\]{border-radius:4px}.rounded-\[6px\]{border-radius:6px}.rounded-\[14px\]{border-radius:14px}.rounded-card{border-radius:var(--radius-card)}.rounded-checkbox{border-radius:var(--radius-checkbox)}.rounded-control{border-radius:var(--radius-control)}.rounded-full{border-radius:3.40282e38px}.rounded-inner{border-radius:var(--radius-inner)}.rounded-modal{border-radius:var(--radius-modal)}.rounded-pager{border-radius:var(--radius-pager)}.rounded-pill{border-radius:var(--radius-pill)}.rounded-tab{border-radius:var(--radius-tab)}.rounded-t-inner{border-top-left-radius:var(--radius-inner);border-top-right-radius:var(--radius-inner)}.rounded-r-control{border-top-right-radius:var(--radius-control);border-bottom-right-radius:var(--radius-control)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-solid{--tw-border-style:solid;border-style:solid}.border-\[\#c62828\]{border-color:#c62828}.border-\[\#d2d8e2\]{border-color:#d2d8e2}.border-\[\#e0b020\]{border-color:#e0b020}.border-border{border-color:var(--color-border)}.border-border-strong{border-color:var(--color-border-strong)}.border-danger{border-color:var(--color-danger)}.border-primary{border-color:var(--color-primary)}.border-side-border{border-color:var(--color-side-border)}.border-transparent{border-color:#0000}.bg-\[\#1d2740\]{background-color:#1d2740}.bg-\[\#22304d\]{background-color:#22304d}.bg-\[\#f58a8a\]{background-color:#f58a8a}.bg-\[\#fdf0f0\]{background-color:#fdf0f0}.bg-accent{background-color:var(--color-accent)}.bg-accent-soft{background-color:var(--color-accent-soft)}.bg-bg{background-color:var(--color-bg)}.bg-border{background-color:var(--color-border)}.bg-border-strong{background-color:var(--color-border-strong)}.bg-danger{background-color:var(--color-danger)}.bg-danger-soft{background-color:var(--color-danger-soft)}.bg-hover{background-color:var(--color-hover)}.bg-ok-bg{background-color:var(--color-ok-bg)}.bg-on-primary{background-color:var(--color-on-primary)}.bg-overlay{background-color:var(--color-overlay)}.bg-primary{background-color:var(--color-primary)}.bg-sel{background-color:var(--color-sel)}.bg-side{background-color:var(--color-side)}.bg-skel{background-color:var(--color-skel)}.bg-subtle{background-color:var(--color-subtle)}.bg-surface{background-color:var(--color-surface)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.p-8{padding:calc(var(--spacing) * 8)}.px-0\!{padding-inline:calc(var(--spacing) * 0)!important}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-\[18px\]{padding-inline:18px}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-7{padding-block:calc(var(--spacing) * 7)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\.5{padding-top:calc(var(--spacing) * 3.5)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-3\.5{padding-right:calc(var(--spacing) * 3.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-5{padding-right:calc(var(--spacing) * 5)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pr-16{padding-right:calc(var(--spacing) * 16)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.pl-1{padding-left:calc(var(--spacing) * 1)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3\.5{padding-left:calc(var(--spacing) * 3.5)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-\[-2px\]{vertical-align:-2px}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[13px\]\!{font-size:13px!important}.text-\[14px\]{font-size:14px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[20px\]{font-size:20px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[26px\]{font-size:26px}.leading-\[1\.2\]{--tw-leading:1.2;line-height:1.2}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.01em\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[0\.02em\]{--tw-tracking:.02em;letter-spacing:.02em}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#1d2740\]{color:#1d2740}.text-\[\#141b2d\]{color:#141b2d}.text-\[\#c3cbda\]{color:#c3cbda}.text-\[\#c62828\]{color:#c62828}.text-accent{color:var(--color-accent)}.text-danger{color:var(--color-danger)}.text-muted{color:var(--color-muted)}.text-ok-text{color:var(--color-ok-text)}.text-on-accent{color:var(--color-on-accent)}.text-on-primary{color:var(--color-on-primary)}.text-primary{color:var(--color-primary)}.text-side-text{color:var(--color-side-text)}.text-text{color:var(--color-text)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.accent-primary{accent-color:var(--color-primary)}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-card{--tw-shadow:var(--c-shadow-card);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-login{--tw-shadow:0 24px 60px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-menu{--tw-shadow:0 16px 40px var(--tw-shadow-color,#141b2d29);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-pop{--tw-shadow:0 16px 40px var(--tw-shadow-color,#141b2d2e);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-tab{--tw-shadow:0 1px 3px var(--tw-shadow-color,#141b2d1f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-toast{--tw-shadow:0 16px 40px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-2{outline-style:var(--tw-outline-style);outline-width:2px}.-outline-offset-2{outline-offset:-2px}.outline-primary{outline-color:var(--color-primary)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-dashed{--tw-outline-style:dashed;outline-style:dashed}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first\:pl-5:first-child{padding-left:calc(var(--spacing) * 5)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.last\:pr-5:last-child{padding-right:calc(var(--spacing) * 5)}.focus-within\:border-primary:focus-within{border-color:var(--color-primary)}.focus-within\:shadow-\[0_0_0_3px_var\(--c-ring\)\]:focus-within{--tw-shadow:0 0 0 3px var(--tw-shadow-color,var(--c-ring));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.hover\:bg-border:hover{background-color:var(--color-border)}.hover\:bg-danger-soft:hover{background-color:var(--color-danger-soft)}.hover\:bg-hover:hover{background-color:var(--color-hover)}.hover\:bg-side-hover:hover{background-color:var(--color-side-hover)}.hover\:text-danger:hover{color:var(--color-danger)}.hover\:text-text:hover{color:var(--color-text)}.hover\:text-white:hover{color:var(--color-white)}.hover\:opacity-90:hover{opacity:.9}}.focus\:border-primary:focus{border-color:var(--color-primary)}.focus\:bg-sel:focus{background-color:var(--color-sel)}.focus\:text-text:focus{color:var(--color-text)}.focus-visible\:shadow-none:focus-visible{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-60:disabled{opacity:.6}@media(hover:hover){.disabled\:hover\:text-muted:disabled:hover{color:var(--color-muted)}}.has-\[\[data-invalid\]\]\:border-danger:has([data-invalid]){border-color:var(--color-danger)}.aria-pressed\:bg-sel[aria-pressed=true]{background-color:var(--color-sel)}.aria-pressed\:text-text[aria-pressed=true]{color:var(--color-text)}.data-\[disabled\]\:cursor-not-allowed[data-disabled]{cursor:not-allowed}.data-\[disabled\]\:text-placeholder[data-disabled]{color:var(--color-placeholder)}.data-\[disabled\]\:opacity-40[data-disabled]{opacity:.4}@media(hover:hover){.data-\[disabled\]\:hover\:bg-transparent[data-disabled]:hover{background-color:#0000}}.data-\[highlighted\]\:bg-hover[data-highlighted]{background-color:var(--color-hover)}.data-\[outside-view\]\:text-placeholder[data-outside-view],.data-\[placeholder\]\:text-placeholder[data-placeholder]{color:var(--color-placeholder)}.focus\:data-\[placeholder\]\:text-text:focus[data-placeholder]{color:var(--color-text)}.data-\[selected\]\:bg-primary[data-selected]{background-color:var(--color-primary)}.data-\[selected\]\:font-semibold[data-selected]{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.data-\[selected\]\:text-on-primary[data-selected]{color:var(--color-on-primary)}.data-\[state\=active\]\:bg-surface[data-state=active]{background-color:var(--color-surface)}.data-\[state\=active\]\:text-text[data-state=active]{color:var(--color-text)}.data-\[state\=active\]\:shadow-tab[data-state=active]{--tw-shadow:0 1px 3px var(--tw-shadow-color,#141b2d1f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--color-primary)}.data-\[state\=checked\]\:bg-danger-soft[data-state=checked]{background-color:var(--color-danger-soft)}.data-\[state\=checked\]\:bg-ok-bg[data-state=checked]{background-color:var(--color-ok-bg)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--color-primary)}.data-\[state\=checked\]\:bg-surface[data-state=checked]{background-color:var(--color-surface)}.data-\[state\=checked\]\:text-\[14px\][data-state=checked]{font-size:14px}.data-\[state\=checked\]\:font-semibold[data-state=checked]{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.data-\[state\=checked\]\:text-danger[data-state=checked]{color:var(--color-danger)}.data-\[state\=checked\]\:text-ok-text[data-state=checked]{color:var(--color-ok-text)}.data-\[state\=checked\]\:text-on-primary[data-state=checked]{color:var(--color-on-primary)}.data-\[state\=checked\]\:text-text[data-state=checked]{color:var(--color-text)}.data-\[state\=checked\]\:shadow-tab[data-state=checked]{--tw-shadow:0 1px 3px var(--tw-shadow-color,#141b2d1f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[today\]\:font-semibold[data-today]{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.data-\[today\]\:shadow-\[inset_0_0_0_1px_var\(--c-border-strong\)\][data-today]{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,var(--c-border-strong));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[unavailable\]\:cursor-not-allowed[data-unavailable]{cursor:not-allowed}.data-\[unavailable\]\:opacity-40[data-unavailable]{opacity:.4}@media not all and (min-width:1099px){.max-\[1099px\]\:hidden{display:none}}@media not all and (min-width:40rem){.max-sm\:flex-col{flex-direction:column}.max-sm\:items-start{align-items:flex-start}.max-sm\:self-start{align-self:flex-start}}@media(min-width:600px){.min-\[600px\]\:col-start-1{grid-column-start:1}.min-\[600px\]\:col-start-2{grid-column-start:2}.min-\[600px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:900px){.min-\[900px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:1100px){.min-\[1100px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:400;src:url(./dm-sans-latin-ext-400-normal-BtiwyxMk.woff2)format("woff2"),url(./dm-sans-latin-ext-400-normal-BjWJ59Pq.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:400;src:url(./dm-sans-latin-400-normal-CW0RaeGs.woff2)format("woff2"),url(./dm-sans-latin-400-normal-BwCSEQnW.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:500;src:url(./dm-sans-latin-ext-500-normal-BJfUCQsA.woff2)format("woff2"),url(./dm-sans-latin-ext-500-normal-DR84L5F-.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:500;src:url(./dm-sans-latin-500-normal-B9HHJjqV.woff2)format("woff2"),url(./dm-sans-latin-500-normal-Dr3UlScf.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:600;src:url(./dm-sans-latin-ext-600-normal-4vooXBpG.woff2)format("woff2"),url(./dm-sans-latin-ext-600-normal-DRtaDpgU.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:600;src:url(./dm-sans-latin-600-normal-Aqo67rzb.woff2)format("woff2"),url(./dm-sans-latin-600-normal-BmdmIIQ2.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:700;src:url(./dm-sans-latin-ext-700-normal-CJIcxD6K.woff2)format("woff2"),url(./dm-sans-latin-ext-700-normal-BLI3TTWz.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Sans;font-style:normal;font-display:swap;font-weight:700;src:url(./dm-sans-latin-700-normal-DvUfVpUG.woff2)format("woff2"),url(./dm-sans-latin-700-normal-CUSSCpQX.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:400;src:url(./dm-mono-latin-ext-400-normal-C2zvOubV.woff2)format("woff2"),url(./dm-mono-latin-ext-400-normal-1aZr6b2b.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:400;src:url(./dm-mono-latin-400-normal-4GdczIuU.woff2)format("woff2"),url(./dm-mono-latin-400-normal--0xN8mdc.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:500;src:url(./dm-mono-latin-ext-500-normal-BtRyHRi6.woff2)format("woff2"),url(./dm-mono-latin-ext-500-normal-Dw3M13d8.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:DM Mono;font-style:normal;font-display:swap;font-weight:500;src:url(./dm-mono-latin-500-normal-DRMDZjhP.woff2)format("woff2"),url(./dm-mono-latin-500-normal-CN8Miw6E.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--c-bg:#f4f6f9;--c-surface:#fff;--c-subtle:#f3f5f8;--c-border:#e6e9ef;--c-border-strong:#d2d8e2;--c-text:#141b2d;--c-muted:#566175;--c-placeholder:#6b7588;--c-primary:#22304d;--c-on-primary:#fff;--c-danger:#c62828;--c-danger-soft:#fdf0f0;--c-ok-bg:#e3f4e8;--c-ok-text:#1c6b35;--c-ring:#fcc4288c;--c-hover:#f1f3f7;--c-sel:#fdf3cf;--c-skel:#eceff4;--c-overlay:#141b2d80;--c-side:#1d2740;--c-side-border:transparent;--c-shadow-card:0 1px 2px #141b2d0a, 0 4px 16px #141b2d0d}.dark{color-scheme:dark;--c-bg:#111726;--c-surface:#182033;--c-subtle:#1f283d;--c-border:#29334b;--c-border-strong:#3a4661;--c-text:#eef1f6;--c-muted:#a9b3c6;--c-placeholder:#8a95ab;--c-primary:#fcd34d;--c-on-primary:#1b2540;--c-danger:#f58a8a;--c-danger-soft:#3a1d24;--c-ok-bg:#173826;--c-ok-text:#8fdfa8;--c-ring:#fcd34d73;--c-hover:#212b42;--c-sel:#3a3622;--c-skel:#263049;--c-overlay:#050810b3;--c-side:#0d1320;--c-side-border:#222b40;--c-shadow-card:none}@keyframes summer-fade-in{0%{opacity:0}}@keyframes summer-dialog-in{0%{opacity:0;scale:.98}}@media(prefers-reduced-motion:reduce){.bg-overlay,[data-dialog-content],[role=alertdialog]{animation:none!important}.toast-enter-active{transition:none}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/modules/boardwalk/dist/assets/index-CGlcvAra.js b/modules/boardwalk/dist/assets/index-CGlcvAra.js deleted file mode 100644 index 8d510e93..00000000 --- a/modules/boardwalk/dist/assets/index-CGlcvAra.js +++ /dev/null @@ -1,11 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const l of r)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const l={};return r.integrity&&(l.integrity=r.integrity),r.referrerPolicy&&(l.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?l.credentials="include":r.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(r){if(r.ep)return;r.ep=!0;const l=n(r);fetch(r.href,l)}})();function zd(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const bt={},Tl=[],oa=()=>{},Bh=()=>!1,Hi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ki=e=>e.startsWith("onUpdate:"),It=Object.assign,jd=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},u_=Object.prototype.hasOwnProperty,vt=(e,t)=>u_.call(e,t),We=Array.isArray,Dl=e=>ms(e)==="[object Map]",Fh=e=>ms(e)==="[object Set]",Pp=e=>ms(e)==="[object Date]",et=e=>typeof e=="function",kt=e=>typeof e=="string",xn=e=>typeof e=="symbol",pt=e=>e!==null&&typeof e=="object",Vh=e=>(pt(e)||et(e))&&et(e.then)&&et(e.catch),zh=Object.prototype.toString,ms=e=>zh.call(e),c_=e=>ms(e).slice(8,-1),jh=e=>ms(e)==="[object Object]",Wi=e=>kt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,qo=zd(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gi=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},d_=/-\w/g,Wt=Gi(e=>e.replace(d_,t=>t.slice(1).toUpperCase())),f_=/\B([A-Z])/g,br=Gi(e=>e.replace(f_,"-$1").toLowerCase()),Yi=Gi(e=>e.charAt(0).toUpperCase()+e.slice(1)),Lo=Gi(e=>e?`on${Yi(e)}`:""),na=(e,t)=>!Object.is(e,t),ai=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:a,value:n})},Ud=e=>{const t=parseFloat(e);return isNaN(t)?e:t},p_=e=>{const t=kt(e)?Number(e):NaN;return isNaN(t)?e:t};let Ip;const Ji=()=>Ip||(Ip=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function bn(e){if(We(e)){const t={};for(let n=0;n{if(n){const a=n.split(v_);a.length>1&&(t[a[0].trim()]=a[1].trim())}}),t}function ve(e){let t="";if(kt(e))t=e;else if(We(e))for(let n=0;n!!(e&&e.__v_isRef===!0),$=e=>kt(e)?e:e==null?"":We(e)||pt(e)&&(e.toString===zh||!et(e.toString))?Kh(e)?$(e.value):JSON.stringify(e,Wh,2):String(e),Wh=(e,t)=>Kh(t)?Wh(e,t.value):Dl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[a,r],l)=>(n[ju(a,l)+" =>"]=r,n),{})}:Fh(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ju(n))}:xn(t)?ju(t):pt(t)&&!We(t)&&!jh(t)?String(t):t,ju=(e,t="")=>{var n;return xn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let Nt;class Gh{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Nt&&(Nt.active?(this.parent=Nt,this.index=(Nt.scopes||(Nt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(Nt===this)Nt=this.prevScope;else{let t=Nt;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,a;for(n=0,a=this.effects.length;n0)return;if(Bo){let t=Bo;for(Bo=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;No;){let t=No;for(No=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(a){e||(e=a)}t=n}}if(e)throw e}function ey(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ty(e){let t,n=e.depsTail,a=n;for(;a;){const r=a.prevDep;a.version===-1?(a===n&&(n=r),Yd(a),x_(a)):t=a,a.dep.activeLink=a.prevActiveLink,a.prevActiveLink=void 0,a=r}e.deps=t,e.depsTail=n}function Wc(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ny(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ny(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Yo)||(e.globalVersion=Yo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Wc(e))))return;e.flags|=2;const t=e.dep,n=_t,a=Rn;_t=e,Rn=!0;try{ey(e);const r=e.fn(e._value);(t.version===0||na(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{_t=n,Rn=a,ty(e),e.flags&=-3}}function Yd(e,t=!1){const{dep:n,prevSub:a,nextSub:r}=e;if(a&&(a.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=a,e.nextSub=void 0),n.subs===e&&(n.subs=a,!a&&n.computed)){n.computed.flags&=-5;for(let l=n.computed.deps;l;l=l.nextDep)Yd(l,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function x_(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Rn=!0;const ay=[];function Da(){ay.push(Rn),Rn=!1}function Oa(){const e=ay.pop();Rn=e===void 0?!0:e}function Rp(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=_t;_t=void 0;try{t()}finally{_t=n}}}let Yo=0,k_=class{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class Zi{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!_t||!Rn||_t===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==_t)n=this.activeLink=new k_(_t,this),_t.deps?(n.prevDep=_t.depsTail,_t.depsTail.nextDep=n,_t.depsTail=n):_t.deps=_t.depsTail=n,ry(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const a=n.nextDep;a.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=a),n.prevDep=_t.depsTail,n.nextDep=void 0,_t.depsTail.nextDep=n,_t.depsTail=n,_t.deps===n&&(_t.deps=a)}return n}trigger(t){this.version++,Yo++,this.notify(t)}notify(t){Wd();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Gd()}}}function ry(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let a=t.deps;a;a=a.nextDep)ry(a)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const fi=new WeakMap,Fr=Symbol(""),Gc=Symbol(""),Jo=Symbol("");function Zt(e,t,n){if(Rn&&_t){let a=fi.get(e);a||fi.set(e,a=new Map);let r=a.get(n);r||(a.set(n,r=new Zi),r.map=a,r.key=n),r.track()}}function xa(e,t,n,a,r,l){const o=fi.get(e);if(!o){Yo++;return}const i=u=>{u&&u.trigger()};if(Wd(),t==="clear")o.forEach(i);else{const u=We(e),d=u&&Wi(n);if(u&&n==="length"){const c=Number(a);o.forEach((f,v)=>{(v==="length"||v===Jo||!xn(v)&&v>=c)&&i(f)})}else switch((n!==void 0||o.has(void 0))&&i(o.get(n)),d&&i(o.get(Jo)),t){case"add":u?d&&i(o.get("length")):(i(o.get(Fr)),Dl(e)&&i(o.get(Gc)));break;case"delete":u||(i(o.get(Fr)),Dl(e)&&i(o.get(Gc)));break;case"set":Dl(e)&&i(o.get(Fr));break}}Gd()}function w_(e,t){const n=fi.get(e);return n&&n.get(t)}function cl(e){const t=dt(e);return t===e?t:(Zt(t,"iterate",Jo),_n(e)?t:t.map(Nn))}function Xi(e){return Zt(e=dt(e),"iterate",Jo),e}function ea(e,t){return Ma(e)?Vl(Vr(e)?Nn(t):t):Nn(t)}const $_={__proto__:null,[Symbol.iterator](){return Hu(this,Symbol.iterator,e=>ea(this,e))},concat(...e){return cl(this).concat(...e.map(t=>We(t)?cl(t):t))},entries(){return Hu(this,"entries",e=>(e[1]=ea(this,e[1]),e))},every(e,t){return ha(this,"every",e,t,void 0,arguments)},filter(e,t){return ha(this,"filter",e,t,n=>n.map(a=>ea(this,a)),arguments)},find(e,t){return ha(this,"find",e,t,n=>ea(this,n),arguments)},findIndex(e,t){return ha(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ha(this,"findLast",e,t,n=>ea(this,n),arguments)},findLastIndex(e,t){return ha(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ha(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ku(this,"includes",e)},indexOf(...e){return Ku(this,"indexOf",e)},join(e){return cl(this).join(e)},lastIndexOf(...e){return Ku(this,"lastIndexOf",e)},map(e,t){return ha(this,"map",e,t,void 0,arguments)},pop(){return vo(this,"pop")},push(...e){return vo(this,"push",e)},reduce(e,...t){return qp(this,"reduce",e,t)},reduceRight(e,...t){return qp(this,"reduceRight",e,t)},shift(){return vo(this,"shift")},some(e,t){return ha(this,"some",e,t,void 0,arguments)},splice(...e){return vo(this,"splice",e)},toReversed(){return cl(this).toReversed()},toSorted(e){return cl(this).toSorted(e)},toSpliced(...e){return cl(this).toSpliced(...e)},unshift(...e){return vo(this,"unshift",e)},values(){return Hu(this,"values",e=>ea(this,e))}};function Hu(e,t,n){const a=Xi(e),r=a[t]();return a!==e&&!_n(e)&&(r._next=r.next,r.next=()=>{const l=r._next();return l.done||(l.value=n(l.value)),l}),r}const C_=Array.prototype;function ha(e,t,n,a,r,l){const o=Xi(e),i=o!==e&&!_n(e),u=o[t];if(u!==C_[t]){const f=u.apply(e,l);return i?Nn(f):f}let d=n;o!==e&&(i?d=function(f,v){return n.call(this,ea(e,f),v,e)}:n.length>2&&(d=function(f,v){return n.call(this,f,v,e)}));const c=u.call(o,d,a);return i&&r?r(c):c}function qp(e,t,n,a){const r=Xi(e),l=r!==e&&!_n(e);let o=n,i=!1;r!==e&&(l?(i=a.length===0,o=function(d,c,f){return i&&(i=!1,d=ea(e,d)),n.call(this,d,ea(e,c),f,e)}):n.length>3&&(o=function(d,c,f){return n.call(this,d,c,f,e)}));const u=r[t](o,...a);return i?ea(e,u):u}function Ku(e,t,n){const a=dt(e);Zt(a,"iterate",Jo);const r=a[t](...n);return(r===-1||r===!1)&&tu(n[0])?(n[0]=dt(n[0]),a[t](...n)):r}function vo(e,t,n=[]){Da(),Wd();const a=dt(e)[t].apply(e,n);return Gd(),Oa(),a}const S_=zd("__proto__,__v_isRef,__isVue"),ly=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(xn));function E_(e){xn(e)||(e=String(e));const t=dt(this);return Zt(t,"has",e),t.hasOwnProperty(e)}class oy{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,a){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,l=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return l;if(n==="__v_raw")return a===(r?l?fy:dy:l?cy:uy).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(a)?t:void 0;const o=We(t);if(!r){let u;if(o&&(u=$_[n]))return u;if(n==="hasOwnProperty")return E_}const i=Reflect.get(t,n,Ct(t)?t:a);if((xn(n)?ly.has(n):S_(n))||(r||Zt(t,"get",n),l))return i;if(Ct(i)){const u=o&&Wi(n)?i:i.value;return r&&pt(u)?xt(u):u}return pt(i)?r?xt(i):Ln(i):i}}class sy extends oy{constructor(t=!1){super(!1,t)}set(t,n,a,r){let l=t[n];const o=We(t)&&Wi(n);if(!this._isShallow){const d=Ma(l);if(!_n(a)&&!Ma(a)&&(l=dt(l),a=dt(a)),!o&&Ct(l)&&!Ct(a))return d||(l.value=a),!0}const i=o?Number(n)e,Is=e=>Reflect.getPrototypeOf(e);function M_(e,t,n){return function(...a){const r=this.__v_raw,l=dt(r),o=Dl(l),i=e==="entries"||e===Symbol.iterator&&o,u=e==="keys"&&o,d=r[e](...a),c=n?Yc:t?Vl:Nn;return!t&&Zt(l,"iterate",u?Gc:Fr),It(Object.create(d),{next(){const{value:f,done:v}=d.next();return v?{value:f,done:v}:{value:i?[c(f[0]),c(f[1])]:c(f),done:v}}})}}function Rs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function P_(e,t){const n={get(r){const l=this.__v_raw,o=dt(l),i=dt(r);e||(na(r,i)&&Zt(o,"get",r),Zt(o,"get",i));const{has:u}=Is(o),d=t?Yc:e?Vl:Nn;if(u.call(o,r))return d(l.get(r));if(u.call(o,i))return d(l.get(i));l!==o&&l.get(r)},get size(){const r=this.__v_raw;return!e&&Zt(dt(r),"iterate",Fr),r.size},has(r){const l=this.__v_raw,o=dt(l),i=dt(r);return e||(na(r,i)&&Zt(o,"has",r),Zt(o,"has",i)),r===i?l.has(r):l.has(r)||l.has(i)},forEach(r,l){const o=this,i=o.__v_raw,u=dt(i),d=t?Yc:e?Vl:Nn;return!e&&Zt(u,"iterate",Fr),i.forEach((c,f)=>r.call(l,d(c),d(f),o))}};return It(n,e?{add:Rs("add"),set:Rs("set"),delete:Rs("delete"),clear:Rs("clear")}:{add(r){const l=dt(this),o=Is(l),i=dt(r),u=!t&&!_n(r)&&!Ma(r)?i:r;return o.has.call(l,u)||na(r,u)&&o.has.call(l,r)||na(i,u)&&o.has.call(l,i)||(l.add(u),xa(l,"add",u,u)),this},set(r,l){!t&&!_n(l)&&!Ma(l)&&(l=dt(l));const o=dt(this),{has:i,get:u}=Is(o);let d=i.call(o,r);d||(r=dt(r),d=i.call(o,r));const c=u.call(o,r);return o.set(r,l),d?na(l,c)&&xa(o,"set",r,l):xa(o,"add",r,l),this},delete(r){const l=dt(this),{has:o,get:i}=Is(l);let u=o.call(l,r);u||(r=dt(r),u=o.call(l,r)),i&&i.call(l,r);const d=l.delete(r);return u&&xa(l,"delete",r,void 0),d},clear(){const r=dt(this),l=r.size!==0,o=r.clear();return l&&xa(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=M_(r,e,t)}),n}function Qi(e,t){const n=P_(e,t);return(a,r,l)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?a:Reflect.get(vt(n,r)&&r in a?n:a,r,l)}const I_={get:Qi(!1,!1)},R_={get:Qi(!1,!0)},q_={get:Qi(!0,!1)},L_={get:Qi(!0,!0)},uy=new WeakMap,cy=new WeakMap,dy=new WeakMap,fy=new WeakMap;function N_(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ln(e){return Ma(e)?e:eu(e,!1,A_,I_,uy)}function py(e){return eu(e,!1,D_,R_,cy)}function xt(e){return eu(e,!0,T_,q_,dy)}function dl(e){return eu(e,!0,O_,L_,fy)}function eu(e,t,n,a,r){if(!pt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const l=r.get(e);if(l)return l;const o=N_(c_(e));if(o===0)return e;const i=new Proxy(e,o===2?a:n);return r.set(e,i),i}function Vr(e){return Ma(e)?Vr(e.__v_raw):!!(e&&e.__v_isReactive)}function Ma(e){return!!(e&&e.__v_isReadonly)}function _n(e){return!!(e&&e.__v_isShallow)}function tu(e){return e?!!e.__v_raw:!1}function dt(e){const t=e&&e.__v_raw;return t?dt(t):e}function pi(e){return!vt(e,"__v_skip")&&Object.isExtensible(e)&&Uh(e,"__v_skip",!0),e}const Nn=e=>pt(e)?Ln(e):e,Vl=e=>pt(e)?xt(e):e;function Ct(e){return e?e.__v_isRef===!0:!1}function M(e){return my(e,!1)}function Jl(e){return my(e,!0)}function my(e,t){return Ct(e)?e:new B_(e,t)}class B_{constructor(t,n){this.dep=new Zi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:dt(t),this._value=n?t:Nn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,a=this.__v_isShallow||_n(t)||Ma(t);t=a?t:dt(t),na(t,n)&&(this._rawValue=t,this._value=a?t:Nn(t),this.dep.trigger())}}function F_(e){e.dep&&e.dep.trigger()}function s(e){return Ct(e)?e.value:e}function ln(e){return et(e)?e():s(e)}const V_={get:(e,t,n)=>t==="__v_raw"?e:s(Reflect.get(e,t,n)),set:(e,t,n,a)=>{const r=e[t];return Ct(r)&&!Ct(n)?(r.value=n,!0):Reflect.set(e,t,n,a)}};function vy(e){return Vr(e)?e:new Proxy(e,V_)}class z_{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Zi,{get:a,set:r}=t(n.track.bind(n),n.trigger.bind(n));this._get=a,this._set=r}get value(){return this._value=this._get()}set value(t){this._set(t)}}function j_(e){return new z_(e)}function Vt(e){const t=We(e)?new Array(e.length):{};for(const n in e)t[n]=hy(e,n);return t}class U_{constructor(t,n,a){this._object=t,this._defaultValue=a,this.__v_isRef=!0,this._value=void 0,this._key=xn(n)?n:String(n),this._raw=dt(t);let r=!0,l=t;if(!We(t)||xn(this._key)||!Wi(this._key))do r=!tu(l)||_n(l);while(r&&(l=l.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=s(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ct(this._raw[this._key])){const n=this._object[this._key];if(Ct(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return w_(this._raw,this._key)}}class H_{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function K_(e,t,n){return Ct(e)?e:et(e)?new H_(e):pt(e)&&arguments.length>1?hy(e,t,n):M(e)}function hy(e,t,n){return new U_(e,t,n)}class W_{constructor(t,n,a){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Zi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Yo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=a}notify(){if(this.flags|=16,!(this.flags&8)&&_t!==this)return Qh(this,!0),!0}get value(){const t=this.dep.track();return ny(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function G_(e,t,n=!1){let a,r;return et(e)?a=e:(a=e.get,r=e.set),new W_(a,r,n)}const qs={},mi=new WeakMap;let Pr;function Y_(e,t=!1,n=Pr){if(n){let a=mi.get(n);a||mi.set(n,a=[]),a.push(e)}}function J_(e,t,n=bt){const{immediate:a,deep:r,once:l,scheduler:o,augmentJob:i,call:u}=n,d=D=>r?D:_n(D)||r===!1||r===0?ka(D,1):ka(D);let c,f,v,p,h=!1,k=!1;if(Ct(e)?(f=()=>e.value,h=_n(e)):Vr(e)?(f=()=>d(e),h=!0):We(e)?(k=!0,h=e.some(D=>Vr(D)||_n(D)),f=()=>e.map(D=>{if(Ct(D))return D.value;if(Vr(D))return d(D);if(et(D))return u?u(D,2):D()})):et(e)?t?f=u?()=>u(e,2):e:f=()=>{if(v){Da();try{v()}finally{Oa()}}const D=Pr;Pr=c;try{return u?u(e,3,[p]):e(p)}finally{Pr=D}}:f=oa,t&&r){const D=f,A=r===!0?1/0:r;f=()=>ka(D(),A)}const S=Kd(),x=()=>{c.stop(),S&&S.active&&jd(S.effects,c)};if(l&&t){const D=t;t=(...A)=>{D(...A),x()}}let E=k?new Array(e.length).fill(qs):qs;const L=D=>{if(!(!(c.flags&1)||!c.dirty&&!D))if(t){const A=c.run();if(r||h||(k?A.some((R,F)=>na(R,E[F])):na(A,E))){v&&v();const R=Pr;Pr=c;try{const F=[A,E===qs?void 0:k&&E[0]===qs?[]:E,p];E=A,u?u(t,3,F):t(...F)}finally{Pr=R}}}else c.run()};return i&&i(L),c=new Zh(f),c.scheduler=o?()=>o(L,!1):L,p=D=>Y_(D,!1,c),v=c.onStop=()=>{const D=mi.get(c);if(D){if(u)u(D,4);else for(const A of D)A();mi.delete(c)}},t?a?L(!0):E=c.run():o?o(L.bind(null,!0),!0):c.run(),x.pause=c.pause.bind(c),x.resume=c.resume.bind(c),x.stop=x,x}function ka(e,t=1/0,n){if(t<=0||!pt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ct(e))ka(e.value,t,n);else if(We(e))for(let a=0;a{ka(a,t,n)});else if(jh(e)){for(const a in e)ka(e[a],t,n);for(const a of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,a)&&ka(e[a],t,n)}return e}function vs(e,t,n,a){try{return a?e(...a):e()}catch(r){nu(r,t,n)}}function On(e,t,n,a){if(et(e)){const r=vs(e,t,n,a);return r&&Vh(r)&&r.catch(l=>{nu(l,t,n)}),r}if(We(e)){const r=[];for(let l=0;l>>1,r=rn[a],l=Zo(r);l=Zo(n)?rn.push(e):rn.splice(X_(t),0,e),e.flags|=1,gy()}}function gy(){vi||(vi=yy.then(_y))}function Q_(e){We(e)?Ol.push(...e):Xa&&e.id===-1?Xa.splice(bl+1,0,e):e.flags&1||(Ol.push(e),e.flags|=1),gy()}function Lp(e,t,n=Xn+1){for(;nZo(n)-Zo(a));if(Ol.length=0,Xa){Xa.push(...t);return}for(Xa=t,bl=0;ble.id==null?e.flags&2?-1:1/0:e.id;function _y(e){try{for(Xn=0;Xn{a._d&&bi(-1);const l=hi(t);let o;try{o=e(...r)}finally{hi(l),a._d&&bi(1)}return o};return a._n=!0,a._c=!0,a._d=!0,a}function sa(e,t){if(Kt===null)return e;const n=su(Kt),a=e.dirs||(e.dirs=[]);for(let r=0;r1)return n&&et(t)?t.call(a&&a.proxy):t}}const ex=Symbol.for("v-scx"),tx=()=>it(ex);function kn(e,t){return au(e,null,t)}function ky(e,t){return au(e,null,{flush:"post"})}function Ve(e,t,n){return au(e,t,n)}function au(e,t,n=bt){const{immediate:a,deep:r,flush:l,once:o}=n,i=It({},n),u=t&&a||!t&&l!=="post";let d;if(ts){if(l==="sync"){const p=tx();d=p.__watcherHandles||(p.__watcherHandles=[])}else if(!u){const p=()=>{};return p.stop=oa,p.resume=oa,p.pause=oa,p}}const c=Xt;i.call=(p,h,k)=>On(p,c,h,k);let f=!1;l==="post"?i.scheduler=p=>{an(p,c&&c.suspense)}:l!=="sync"&&(f=!0,i.scheduler=(p,h)=>{h?p():Jd(p)}),i.augmentJob=p=>{t&&(p.flags|=4),f&&(p.flags|=2,c&&(p.id=c.uid,p.i=c))};const v=J_(e,t,i);return ts&&(d?d.push(v):u&&v()),v}function nx(e,t,n){const a=this.proxy,r=kt(e)?e.includes(".")?wy(a,e):()=>a[e]:e.bind(a,a);let l;et(t)?l=t:(l=t.handler,n=t);const o=hs(this),i=au(r,l.bind(a),n);return o(),i}function wy(e,t){const n=t.split(".");return()=>{let a=e;for(let r=0;re.__isTeleport,qr=e=>e&&(e.disabled||e.disabled===""),rx=e=>e&&(e.defer||e.defer===""),Np=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Bp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Jc=(e,t)=>{const n=e&&e.to;return kt(n)?t?t(n):null:n},lx={name:"Teleport",__isTeleport:!0,process(e,t,n,a,r,l,o,i,u,d){const{mc:c,pc:f,pbc:v,o:{insert:p,querySelector:h,createText:k,createComment:S,parentNode:x}}=d,E=qr(t.props);let{dynamicChildren:L}=t;const D=(F,W,C)=>{F.shapeFlag&16&&c(F.children,W,C,r,l,o,i,u)},A=(F=t)=>{const W=qr(F.props),C=F.target=Jc(F.props,h),I=Zc(C,F,k,p);C&&(o!=="svg"&&Np(C)?o="svg":o!=="mathml"&&Bp(C)&&(o="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(C),W||(D(F,C,I),Do(F,!1)))},R=F=>{const W=()=>{if(Ya.get(F)===W){if(Ya.delete(F),qr(F.props)){const C=x(F.el)||n;D(F,C,F.anchor),Do(F,!0)}A(F)}};Ya.set(F,W),an(W,l)};if(e==null){const F=t.el=k(""),W=t.anchor=k("");if(p(F,n,a),p(W,n,a),rx(t.props)||l&&l.pendingBranch){R(t);return}E&&(D(t,n,W),Do(t,!0)),A()}else{t.el=e.el;const F=t.anchor=e.anchor,W=Ya.get(e);if(W){W.flags|=8,Ya.delete(e),R(t);return}t.targetStart=e.targetStart;const C=t.target=e.target,I=t.targetAnchor=e.targetAnchor,z=qr(e.props),O=z?n:C,B=z?F:I;if(o==="svg"||Np(C)?o="svg":(o==="mathml"||Bp(C))&&(o="mathml"),L?(v(e.dynamicChildren,L,O,r,l,o,i),ef(e,t,!0)):u||f(e,t,O,B,r,l,o,i,!1),E)z?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ls(t,n,F,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const J=t.target=Jc(t.props,h);J&&Ls(t,J,null,d,0)}else z&&Ls(t,C,I,d,1);Do(t,E)}},remove(e,t,n,{um:a,o:{remove:r}},l){const{shapeFlag:o,children:i,anchor:u,targetStart:d,targetAnchor:c,target:f,props:v}=e,p=l||!qr(v),h=Ya.get(e);if(h&&(h.flags|=8,Ya.delete(e)),f&&(r(d),r(c)),l&&r(u),!h&&o&16)for(let k=0;k{e.isMounted=!0}),St(()=>{e.isUnmounting=!0}),e}const Cn=[Function,Array],ux={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Cn,onEnter:Cn,onAfterEnter:Cn,onEnterCancelled:Cn,onBeforeLeave:Cn,onLeave:Cn,onAfterLeave:Cn,onLeaveCancelled:Cn,onBeforeAppear:Cn,onAppear:Cn,onAfterAppear:Cn,onAppearCancelled:Cn};function cx(e,t){const{leavingVNodes:n}=e;let a=n.get(t.type);return a||(a=Object.create(null),n.set(t.type,a)),a}function Xc(e,t,n,a,r){const{appear:l,mode:o,persisted:i=!1,onBeforeEnter:u,onEnter:d,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:v,onLeave:p,onAfterLeave:h,onLeaveCancelled:k,onBeforeAppear:S,onAppear:x,onAfterAppear:E,onAppearCancelled:L}=t,D=String(e.key),A=cx(n,e),R=(C,I)=>{C&&On(C,a,9,I)},F=(C,I)=>{const z=I[1];R(C,I),We(C)?C.every(O=>O.length<=1)&&z():C.length<=1&&z()},W={mode:o,persisted:i,beforeEnter(C){let I=u;if(!n.isMounted)if(l)I=S||u;else return;C[Qn]&&C[Qn](!0);const z=A[D];z&&_l(e,z)&&z.el[Qn]&&z.el[Qn](),R(I,[C])},enter(C){if(A[D]===e)return;let I=d,z=c,O=f;if(!n.isMounted)if(l)I=x||d,z=E||c,O=L||f;else return;let B=!1;C[ho]=K=>{B||(B=!0,K?R(O,[C]):R(z,[C]),W.delayedLeave&&W.delayedLeave(),C[ho]=void 0)};const J=C[ho].bind(null,!1);I?F(I,[C,J]):J()},leave(C,I){const z=String(e.key);if(C[ho]&&C[ho](!0),n.isUnmounting)return I();R(v,[C]);let O=!1;C[Qn]=J=>{O||(O=!0,I(),J?R(k,[C]):R(h,[C]),C[Qn]=void 0,A[z]===e&&delete A[z])};const B=C[Qn].bind(null,!1);A[z]=e,p?F(p,[C,B]):B()},clone(C){return Xc(C,t,n,a)}};return W}function Xo(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Xo(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Cy(e,t=!1,n){let a=[],r=0;for(let l=0;l1)for(let l=0;lFo(k,t&&(We(t)?t[S]:t),n,a,r));return}if(Ml(a)&&!r){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&Fo(e,t,n,a.component.subTree);return}const l=a.shapeFlag&4?su(a.component):a.el,o=r?null:l,{i,r:u}=e,d=t&&t.r,c=i.refs===bt?i.refs={}:i.refs,f=i.setupState,v=dt(f),p=f===bt?Bh:k=>Fp(c,k)?!1:vt(v,k),h=(k,S)=>!(S&&Fp(c,S));if(d!=null&&d!==u){if(Vp(t),kt(d))c[d]=null,p(d)&&(f[d]=null);else if(Ct(d)){const k=t;h(d,k.k)&&(d.value=null),k.k&&(c[k.k]=null)}}if(et(u))vs(u,i,12,[o,c]);else{const k=kt(u),S=Ct(u);if(k||S){const x=()=>{if(e.f){const E=k?p(u)?f[u]:c[u]:h()||!e.k?u.value:c[e.k];if(r)We(E)&&jd(E,l);else if(We(E))E.includes(l)||E.push(l);else if(k)c[u]=[l],p(u)&&(f[u]=c[u]);else{const L=[l];h(u,e.k)&&(u.value=L),e.k&&(c[e.k]=L)}}else k?(c[u]=o,p(u)&&(f[u]=o)):S&&(h(u,e.k)&&(u.value=o),e.k&&(c[e.k]=o))};if(o){const E=()=>{x(),yi.delete(e)};E.id=-1,yi.set(e,E),an(E,n)}else Vp(e),x()}}}function Vp(e){const t=yi.get(e);t&&(t.flags|=8,yi.delete(e))}Ji().requestIdleCallback;Ji().cancelIdleCallback;const Ml=e=>!!e.type.__asyncLoader,Ay=e=>e.type.__isKeepAlive;function Ty(e,t){Oy(e,"a",t)}function Dy(e,t){Oy(e,"da",t)}function Oy(e,t,n=Xt){const a=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(ru(t,a,n),n){let r=n.parent;for(;r&&r.parent;)Ay(r.parent.vnode)&&dx(a,t,n,r),r=r.parent}}function dx(e,t,n,a){const r=ru(t,e,a,!0);La(()=>{jd(a[t],r)},n)}function ru(e,t,n=Xt,a=!1){if(n){const r=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...o)=>{Da();const i=hs(n),u=On(t,n,e,o);return i(),Oa(),u});return a?r.unshift(l):r.push(l),l}}const qa=e=>(t,n=Xt)=>{(!ts||e==="sp")&&ru(e,(...a)=>t(...a),n)},My=qa("bm"),wt=qa("m"),fx=qa("bu"),Zd=qa("u"),St=qa("bum"),La=qa("um"),px=qa("sp"),mx=qa("rtg"),vx=qa("rtc");function hx(e,t=Xt){ru("ec",e,t)}const Py="components";function yx(e,t){return Ry(Py,e,!0,t)||e}const Iy=Symbol.for("v-ndc");function zt(e){return kt(e)?Ry(Py,e,!1)||e:e||Iy}function Ry(e,t,n=!0,a=!1){const r=Kt||Xt;if(r){const l=r.type;{const i=Qx(l,!1);if(i&&(i===t||i===Wt(t)||i===Yi(Wt(t))))return l}const o=zp(r[e]||l[e],t)||zp(r.appContext[e],t);return!o&&a?l:o}}function zp(e,t){return e&&(e[t]||e[Wt(t)]||e[Yi(Wt(t))])}function Ie(e,t,n,a){let r;const l=n,o=We(e);if(o||kt(e)){const i=o&&Vr(e);let u=!1,d=!1;i&&(u=!_n(e),d=Ma(e),e=Xi(e)),r=new Array(e.length);for(let c=0,f=e.length;ct(i,u,void 0,l));else{const i=Object.keys(e);r=new Array(i.length);for(let u=0,d=i.length;u0;return t!=="default"&&(n.name=t),m(),j(pe,null,[N("slot",n,a&&a())],d?-2:64)}let l=e[t];l&&l._c&&(l._d=!1),m();const o=l&&qy(l(n)),i=n.key||o&&o.key,u=j(pe,{key:(i&&!xn(i)?i:`_${t}`)+(!o&&a?"_fb":"")},o||(a?a():[]),o&&e._===1?64:-2);return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),l&&l._c&&(l._d=!0),u}function qy(e){return e.some(t=>es(t)?!(t.type===Bn||t.type===pe&&!qy(t.children)):!0)?e:null}function Ly(e,t){const n={};for(const a in e)n[Lo(a)]=e[a];return n}const Qc=e=>e?ag(e)?su(e):Qc(e.parent):null,Vo=It(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Qc(e.parent),$root:e=>Qc(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Fy(e),$forceUpdate:e=>e.f||(e.f=()=>{Jd(e.update)}),$nextTick:e=>e.n||(e.n=Je.bind(e.proxy)),$watch:e=>nx.bind(e)}),Wu=(e,t)=>e!==bt&&!e.__isScriptSetup&&vt(e,t),gx={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:a,data:r,props:l,accessCache:o,type:i,appContext:u}=e;if(t[0]!=="$"){const v=o[t];if(v!==void 0)switch(v){case 1:return a[t];case 2:return r[t];case 4:return n[t];case 3:return l[t]}else{if(Wu(a,t))return o[t]=1,a[t];if(r!==bt&&vt(r,t))return o[t]=2,r[t];if(vt(l,t))return o[t]=3,l[t];if(n!==bt&&vt(n,t))return o[t]=4,n[t];td&&(o[t]=0)}}const d=Vo[t];let c,f;if(d)return t==="$attrs"&&Zt(e.attrs,"get",""),d(e);if((c=i.__cssModules)&&(c=c[t]))return c;if(n!==bt&&vt(n,t))return o[t]=4,n[t];if(f=u.config.globalProperties,vt(f,t))return f[t]},set({_:e},t,n){const{data:a,setupState:r,ctx:l}=e;return Wu(r,t)?(r[t]=n,!0):a!==bt&&vt(a,t)?(a[t]=n,!0):vt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:a,appContext:r,props:l,type:o}},i){let u;return!!(n[i]||e!==bt&&i[0]!=="$"&&vt(e,i)||Wu(t,i)||vt(l,i)||vt(a,i)||vt(Vo,i)||vt(r.config.globalProperties,i)||(u=o.__cssModules)&&u[i])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:vt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ed(e){return We(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Ny(e,t){const n=ed(e);for(const a in t){if(a.startsWith("__skip"))continue;let r=n[a];r?We(r)||et(r)?r=n[a]={type:r,default:t[a]}:r.default=t[a]:r===null&&(r=n[a]={default:t[a]}),r&&t[`__skip_${a}`]&&(r.skipFactory=!0)}return n}let td=!0;function bx(e){const t=Fy(e),n=e.proxy,a=e.ctx;td=!1,t.beforeCreate&&jp(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:o,watch:i,provide:u,inject:d,created:c,beforeMount:f,mounted:v,beforeUpdate:p,updated:h,activated:k,deactivated:S,beforeDestroy:x,beforeUnmount:E,destroyed:L,unmounted:D,render:A,renderTracked:R,renderTriggered:F,errorCaptured:W,serverPrefetch:C,expose:I,inheritAttrs:z,components:O,directives:B,filters:J}=t;if(d&&_x(d,a,null),o)for(const le in o){const ue=o[le];et(ue)&&(a[le]=ue.bind(n))}if(r){const le=r.call(n,n);pt(le)&&(e.data=Ln(le))}if(td=!0,l)for(const le in l){const ue=l[le],we=et(ue)?ue.bind(n,n):et(ue.get)?ue.get.bind(n,n):oa,Oe=!et(ue)&&et(ue.set)?ue.set.bind(n):oa,Ae=_({get:we,set:Oe});Object.defineProperty(a,le,{enumerable:!0,configurable:!0,get:()=>Ae.value,set:ie=>Ae.value=ie})}if(i)for(const le in i)By(i[le],a,n,le);if(u){const le=et(u)?u.call(n):u;Reflect.ownKeys(le).forEach(ue=>{ht(ue,le[ue])})}c&&jp(c,e,"c");function H(le,ue){We(ue)?ue.forEach(we=>le(we.bind(n))):ue&&le(ue.bind(n))}if(H(My,f),H(wt,v),H(fx,p),H(Zd,h),H(Ty,k),H(Dy,S),H(hx,W),H(vx,R),H(mx,F),H(St,E),H(La,D),H(px,C),We(I))if(I.length){const le=e.exposed||(e.exposed={});I.forEach(ue=>{Object.defineProperty(le,ue,{get:()=>n[ue],set:we=>n[ue]=we,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===oa&&(e.render=A),z!=null&&(e.inheritAttrs=z),O&&(e.components=O),B&&(e.directives=B),C&&Ey(e)}function _x(e,t,n=oa){We(e)&&(e=nd(e));for(const a in e){const r=e[a];let l;pt(r)?"default"in r?l=it(r.from||a,r.default,!0):l=it(r.from||a):l=it(r),Ct(l)?Object.defineProperty(t,a,{enumerable:!0,configurable:!0,get:()=>l.value,set:o=>l.value=o}):t[a]=l}}function jp(e,t,n){On(We(e)?e.map(a=>a.bind(t.proxy)):e.bind(t.proxy),t,n)}function By(e,t,n,a){let r=a.includes(".")?wy(n,a):()=>n[a];if(kt(e)){const l=t[e];et(l)&&Ve(r,l)}else if(et(e))Ve(r,e.bind(n));else if(pt(e))if(We(e))e.forEach(l=>By(l,t,n,a));else{const l=et(e.handler)?e.handler.bind(n):t[e.handler];et(l)&&Ve(r,l,e)}}function Fy(e){const t=e.type,{mixins:n,extends:a}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:o}}=e.appContext,i=l.get(t);let u;return i?u=i:!r.length&&!n&&!a?u=t:(u={},r.length&&r.forEach(d=>gi(u,d,o,!0)),gi(u,t,o)),pt(t)&&l.set(t,u),u}function gi(e,t,n,a=!1){const{mixins:r,extends:l}=t;l&&gi(e,l,n,!0),r&&r.forEach(o=>gi(e,o,n,!0));for(const o in t)if(!(a&&o==="expose")){const i=xx[o]||n&&n[o];e[o]=i?i(e[o],t[o]):t[o]}return e}const xx={data:Up,props:Hp,emits:Hp,methods:Oo,computed:Oo,beforeCreate:nn,created:nn,beforeMount:nn,mounted:nn,beforeUpdate:nn,updated:nn,beforeDestroy:nn,beforeUnmount:nn,destroyed:nn,unmounted:nn,activated:nn,deactivated:nn,errorCaptured:nn,serverPrefetch:nn,components:Oo,directives:Oo,watch:wx,provide:Up,inject:kx};function Up(e,t){return t?e?function(){return It(et(e)?e.call(this,this):e,et(t)?t.call(this,this):t)}:t:e}function kx(e,t){return Oo(nd(e),nd(t))}function nd(e){if(We(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Wt(t)}Modifiers`]||e[`${br(t)}Modifiers`];function Ex(e,t,...n){if(e.isUnmounted)return;const a=e.vnode.props||bt;let r=n;const l=t.startsWith("update:"),o=l&&Sx(a,t.slice(7));o&&(o.trim&&(r=n.map(c=>kt(c)?c.trim():c)),o.number&&(r=n.map(Ud)));let i,u=a[i=Lo(t)]||a[i=Lo(Wt(t))];!u&&l&&(u=a[i=Lo(br(t))]),u&&On(u,e,6,r);const d=a[i+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,On(d,e,6,r)}}const Ax=new WeakMap;function zy(e,t,n=!1){const a=n?Ax:t.emitsCache,r=a.get(e);if(r!==void 0)return r;const l=e.emits;let o={},i=!1;if(!et(e)){const u=d=>{const c=zy(d,t,!0);c&&(i=!0,It(o,c))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!l&&!i?(pt(e)&&a.set(e,null),null):(We(l)?l.forEach(u=>o[u]=null):It(o,l),pt(e)&&a.set(e,o),o)}function lu(e,t){return!e||!Hi(t)?!1:(t=t.slice(2).replace(/Once$/,""),vt(e,t[0].toLowerCase()+t.slice(1))||vt(e,br(t))||vt(e,t))}function Kp(e){const{type:t,vnode:n,proxy:a,withProxy:r,propsOptions:[l],slots:o,attrs:i,emit:u,render:d,renderCache:c,props:f,data:v,setupState:p,ctx:h,inheritAttrs:k}=e,S=hi(e);let x,E;try{if(n.shapeFlag&4){const D=r||a,A=D;x=ta(d.call(A,D,c,f,p,v,h)),E=i}else{const D=t;x=ta(D.length>1?D(f,{attrs:i,slots:o,emit:u}):D(f,null)),E=t.props?i:Tx(i)}}catch(D){zo.length=0,nu(D,e,1),x=N(Bn)}let L=x;if(E&&k!==!1){const D=Object.keys(E),{shapeFlag:A}=L;D.length&&A&7&&(l&&D.some(Ki)&&(E=Dx(E,l)),L=sr(L,E,!1,!0))}return n.dirs&&(L=sr(L,null,!1,!0),L.dirs=L.dirs?L.dirs.concat(n.dirs):n.dirs),n.transition&&Xo(L,n.transition),x=L,hi(S),x}const Tx=e=>{let t;for(const n in e)(n==="class"||n==="style"||Hi(n))&&((t||(t={}))[n]=e[n]);return t},Dx=(e,t)=>{const n={};for(const a in e)(!Ki(a)||!(a.slice(9)in t))&&(n[a]=e[a]);return n};function Ox(e,t,n){const{props:a,children:r,component:l}=e,{props:o,children:i,patchFlag:u}=t,d=l.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return a?Wp(a,o,d):!!o;if(u&8){const c=t.dynamicProps;for(let f=0;fObject.create(Uy),Ky=e=>Object.getPrototypeOf(e)===Uy;function Px(e,t,n,a=!1){const r={},l=Hy();e.propsDefaults=Object.create(null),Wy(e,t,r,l);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=a?r:py(r):e.type.props?e.props=r:e.props=l,e.attrs=l}function Ix(e,t,n,a){const{props:r,attrs:l,vnode:{patchFlag:o}}=e,i=dt(r),[u]=e.propsOptions;let d=!1;if((a||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let f=0;f{u=!0;const[v,p]=Gy(f,t,!0);It(o,v),p&&i.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!l&&!u)return pt(e)&&a.set(e,Tl),Tl;if(We(l))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",Qd=e=>We(e)?e.map(ta):[ta(e)],qx=(e,t,n)=>{if(t._n)return t;const a=q((...r)=>Qd(t(...r)),n);return a._c=!1,a},Yy=(e,t,n)=>{const a=e._ctx;for(const r in e){if(Xd(r))continue;const l=e[r];if(et(l))t[r]=qx(r,l,a);else if(l!=null){const o=Qd(l);t[r]=()=>o}}},Jy=(e,t)=>{const n=Qd(t);e.slots.default=()=>n},Zy=(e,t,n)=>{for(const a in t)(n||!Xd(a))&&(e[a]=t[a])},Lx=(e,t,n)=>{const a=e.slots=Hy();if(e.vnode.shapeFlag&32){const r=t._;r?(Zy(a,t,n),n&&Uh(a,"_",r,!0)):Yy(t,a)}else t&&Jy(e,t)},Nx=(e,t,n)=>{const{vnode:a,slots:r}=e;let l=!0,o=bt;if(a.shapeFlag&32){const i=t._;i?n&&i===1?l=!1:Zy(r,t,n):(l=!t.$stable,Yy(t,r)),o=t}else t&&(Jy(e,t),o={default:1});if(l)for(const i in r)!Xd(i)&&o[i]==null&&delete r[i]},an=jx;function Bx(e){return Fx(e)}function Fx(e,t){const n=Ji();n.__VUE__=!0;const{insert:a,remove:r,patchProp:l,createElement:o,createText:i,createComment:u,setText:d,setElementText:c,parentNode:f,nextSibling:v,setScopeId:p=oa,insertStaticContent:h}=e,k=(b,T,P,re=null,ee=null,ce=null,Ee=void 0,Ce=null,Te=!!T.dynamicChildren)=>{if(b===T)return;b&&!_l(b,T)&&(re=Y(b),ie(b,ee,ce,!0),b=null),T.patchFlag===-2&&(Te=!1,T.dynamicChildren=null);const{type:oe,ref:$e,shapeFlag:ye}=T;switch(oe){case ou:S(b,T,P,re);break;case Bn:x(b,T,P,re);break;case Yu:b==null&&E(T,P,re,Ee);break;case pe:O(b,T,P,re,ee,ce,Ee,Ce,Te);break;default:ye&1?A(b,T,P,re,ee,ce,Ee,Ce,Te):ye&6?B(b,T,P,re,ee,ce,Ee,Ce,Te):(ye&64||ye&128)&&oe.process(b,T,P,re,ee,ce,Ee,Ce,Te,X)}$e!=null&&ee?Fo($e,b&&b.ref,ce,T||b,!T):$e==null&&b&&b.ref!=null&&Fo(b.ref,null,ce,b,!0)},S=(b,T,P,re)=>{if(b==null)a(T.el=i(T.children),P,re);else{const ee=T.el=b.el;T.children!==b.children&&d(ee,T.children)}},x=(b,T,P,re)=>{b==null?a(T.el=u(T.children||""),P,re):T.el=b.el},E=(b,T,P,re)=>{[b.el,b.anchor]=h(b.children,T,P,re,b.el,b.anchor)},L=({el:b,anchor:T},P,re)=>{let ee;for(;b&&b!==T;)ee=v(b),a(b,P,re),b=ee;a(T,P,re)},D=({el:b,anchor:T})=>{let P;for(;b&&b!==T;)P=v(b),r(b),b=P;r(T)},A=(b,T,P,re,ee,ce,Ee,Ce,Te)=>{if(T.type==="svg"?Ee="svg":T.type==="math"&&(Ee="mathml"),b==null)R(T,P,re,ee,ce,Ee,Ce,Te);else{const oe=b.el&&b.el._isVueCE?b.el:null;try{oe&&oe._beginPatch(),C(b,T,ee,ce,Ee,Ce,Te)}finally{oe&&oe._endPatch()}}},R=(b,T,P,re,ee,ce,Ee,Ce)=>{let Te,oe;const{props:$e,shapeFlag:ye,transition:qe,dirs:Be}=b;if(Te=b.el=o(b.type,ce,$e&&$e.is,$e),ye&8?c(Te,b.children):ye&16&&W(b.children,Te,null,re,ee,Gu(b,ce),Ee,Ce),Be&&Ar(b,null,re,"created"),F(Te,b,b.scopeId,Ee,re),$e){for(const Ze in $e)Ze!=="value"&&!qo(Ze)&&l(Te,Ze,null,$e[Ze],ce,re);"value"in $e&&l(Te,"value",null,$e.value,ce),(oe=$e.onVnodeBeforeMount)&&Yn(oe,re,b)}Be&&Ar(b,null,re,"beforeMount");const He=Vx(ee,qe);He&&qe.beforeEnter(Te),a(Te,T,P),((oe=$e&&$e.onVnodeMounted)||He||Be)&&an(()=>{oe&&Yn(oe,re,b),He&&qe.enter(Te),Be&&Ar(b,null,re,"mounted")},ee)},F=(b,T,P,re,ee)=>{if(P&&p(b,P),re)for(let ce=0;ce{for(let oe=Te;oe{const Ce=T.el=b.el;let{patchFlag:Te,dynamicChildren:oe,dirs:$e}=T;Te|=b.patchFlag&16;const ye=b.props||bt,qe=T.props||bt;let Be;if(P&&Tr(P,!1),(Be=qe.onVnodeBeforeUpdate)&&Yn(Be,P,T,b),$e&&Ar(T,b,P,"beforeUpdate"),P&&Tr(P,!0),(ye.innerHTML&&qe.innerHTML==null||ye.textContent&&qe.textContent==null)&&c(Ce,""),oe?I(b.dynamicChildren,oe,Ce,P,re,Gu(T,ee),ce):Ee||ue(b,T,Ce,null,P,re,Gu(T,ee),ce,!1),Te>0){if(Te&16)z(Ce,ye,qe,P,ee);else if(Te&2&&ye.class!==qe.class&&l(Ce,"class",null,qe.class,ee),Te&4&&l(Ce,"style",ye.style,qe.style,ee),Te&8){const He=T.dynamicProps;for(let Ze=0;Ze{Be&&Yn(Be,P,T,b),$e&&Ar(T,b,P,"updated")},re)},I=(b,T,P,re,ee,ce,Ee)=>{for(let Ce=0;Ce{if(T!==P){if(T!==bt)for(const ce in T)!qo(ce)&&!(ce in P)&&l(b,ce,T[ce],null,ee,re);for(const ce in P){if(qo(ce))continue;const Ee=P[ce],Ce=T[ce];Ee!==Ce&&ce!=="value"&&l(b,ce,Ce,Ee,ee,re)}"value"in P&&l(b,"value",T.value,P.value,ee)}},O=(b,T,P,re,ee,ce,Ee,Ce,Te)=>{const oe=T.el=b?b.el:i(""),$e=T.anchor=b?b.anchor:i("");let{patchFlag:ye,dynamicChildren:qe,slotScopeIds:Be}=T;Be&&(Ce=Ce?Ce.concat(Be):Be),b==null?(a(oe,P,re),a($e,P,re),W(T.children||[],P,$e,ee,ce,Ee,Ce,Te)):ye>0&&ye&64&&qe&&b.dynamicChildren&&b.dynamicChildren.length===qe.length?(I(b.dynamicChildren,qe,P,ee,ce,Ee,Ce),(T.key!=null||ee&&T===ee.subTree)&&ef(b,T,!0)):ue(b,T,P,$e,ee,ce,Ee,Ce,Te)},B=(b,T,P,re,ee,ce,Ee,Ce,Te)=>{T.slotScopeIds=Ce,b==null?T.shapeFlag&512?ee.ctx.activate(T,P,re,Ee,Te):J(T,P,re,ee,ce,Ee,Te):K(b,T,Te)},J=(b,T,P,re,ee,ce,Ee)=>{const Ce=b.component=Gx(b,re,ee);if(Ay(b)&&(Ce.ctx.renderer=X),Yx(Ce,!1,Ee),Ce.asyncDep){if(ee&&ee.registerDep(Ce,H,Ee),!b.el){const Te=Ce.subTree=N(Bn);x(null,Te,T,P),b.placeholder=Te.el}}else H(Ce,b,T,P,ee,ce,Ee)},K=(b,T,P)=>{const re=T.component=b.component;if(Ox(b,T,P))if(re.asyncDep&&!re.asyncResolved){le(re,T,P);return}else re.next=T,re.update();else T.el=b.el,re.vnode=T},H=(b,T,P,re,ee,ce,Ee)=>{const Ce=()=>{if(b.isMounted){let{next:ye,bu:qe,u:Be,parent:He,vnode:Ze}=b;{const Tt=Xy(b);if(Tt){ye&&(ye.el=Ze.el,le(b,ye,Ee)),Tt.asyncDep.then(()=>{an(()=>{b.isUnmounted||oe()},ee)});return}}let Xe=ye,ot;Tr(b,!1),ye?(ye.el=Ze.el,le(b,ye,Ee)):ye=Ze,qe&&ai(qe),(ot=ye.props&&ye.props.onVnodeBeforeUpdate)&&Yn(ot,He,ye,Ze),Tr(b,!0);const at=Kp(b),Et=b.subTree;b.subTree=at,k(Et,at,f(Et.el),Y(Et),b,ee,ce),ye.el=at.el,Xe===null&&Mx(b,at.el),Be&&an(Be,ee),(ot=ye.props&&ye.props.onVnodeUpdated)&&an(()=>Yn(ot,He,ye,Ze),ee)}else{let ye;const{el:qe,props:Be}=T,{bm:He,m:Ze,parent:Xe,root:ot,type:at}=b,Et=Ml(T);Tr(b,!1),He&&ai(He),!Et&&(ye=Be&&Be.onVnodeBeforeMount)&&Yn(ye,Xe,T),Tr(b,!0);{ot.ce&&ot.ce._hasShadowRoot()&&ot.ce._injectChildStyle(at,b.parent?b.parent.type:void 0);const Tt=b.subTree=Kp(b);k(null,Tt,P,re,b,ee,ce),T.el=Tt.el}if(Ze&&an(Ze,ee),!Et&&(ye=Be&&Be.onVnodeMounted)){const Tt=T;an(()=>Yn(ye,Xe,Tt),ee)}(T.shapeFlag&256||Xe&&Ml(Xe.vnode)&&Xe.vnode.shapeFlag&256)&&b.a&&an(b.a,ee),b.isMounted=!0,T=P=re=null}};b.scope.on();const Te=b.effect=new Zh(Ce);b.scope.off();const oe=b.update=Te.run.bind(Te),$e=b.job=Te.runIfDirty.bind(Te);$e.i=b,$e.id=b.uid,Te.scheduler=()=>Jd($e),Tr(b,!0),oe()},le=(b,T,P)=>{T.component=b;const re=b.vnode.props;b.vnode=T,b.next=null,Ix(b,T.props,re,P),Nx(b,T.children,P),Da(),Lp(b),Oa()},ue=(b,T,P,re,ee,ce,Ee,Ce,Te=!1)=>{const oe=b&&b.children,$e=b?b.shapeFlag:0,ye=T.children,{patchFlag:qe,shapeFlag:Be}=T;if(qe>0){if(qe&128){Oe(oe,ye,P,re,ee,ce,Ee,Ce,Te);return}else if(qe&256){we(oe,ye,P,re,ee,ce,Ee,Ce,Te);return}}Be&8?($e&16&&me(oe,ee,ce),ye!==oe&&c(P,ye)):$e&16?Be&16?Oe(oe,ye,P,re,ee,ce,Ee,Ce,Te):me(oe,ee,ce,!0):($e&8&&c(P,""),Be&16&&W(ye,P,re,ee,ce,Ee,Ce,Te))},we=(b,T,P,re,ee,ce,Ee,Ce,Te)=>{b=b||Tl,T=T||Tl;const oe=b.length,$e=T.length,ye=Math.min(oe,$e);let qe;for(qe=0;qe$e?me(b,ee,ce,!0,!1,ye):W(T,P,re,ee,ce,Ee,Ce,Te,ye)},Oe=(b,T,P,re,ee,ce,Ee,Ce,Te)=>{let oe=0;const $e=T.length;let ye=b.length-1,qe=$e-1;for(;oe<=ye&&oe<=qe;){const Be=b[oe],He=T[oe]=Te?_a(T[oe]):ta(T[oe]);if(_l(Be,He))k(Be,He,P,null,ee,ce,Ee,Ce,Te);else break;oe++}for(;oe<=ye&&oe<=qe;){const Be=b[ye],He=T[qe]=Te?_a(T[qe]):ta(T[qe]);if(_l(Be,He))k(Be,He,P,null,ee,ce,Ee,Ce,Te);else break;ye--,qe--}if(oe>ye){if(oe<=qe){const Be=qe+1,He=Be<$e?T[Be].el:re;for(;oe<=qe;)k(null,T[oe]=Te?_a(T[oe]):ta(T[oe]),P,He,ee,ce,Ee,Ce,Te),oe++}}else if(oe>qe)for(;oe<=ye;)ie(b[oe],ee,ce,!0),oe++;else{const Be=oe,He=oe,Ze=new Map;for(oe=He;oe<=qe;oe++){const de=T[oe]=Te?_a(T[oe]):ta(T[oe]);de.key!=null&&Ze.set(de.key,oe)}let Xe,ot=0;const at=qe-He+1;let Et=!1,Tt=0;const qt=new Array(at);for(oe=0;oe=at){ie(de,ee,ce,!0);continue}let be;if(de.key!=null)be=Ze.get(de.key);else for(Xe=He;Xe<=qe;Xe++)if(qt[Xe-He]===0&&_l(de,T[Xe])){be=Xe;break}be===void 0?ie(de,ee,ce,!0):(qt[be-He]=oe+1,be>=Tt?Tt=be:Et=!0,k(de,T[be],P,null,ee,ce,Ee,Ce,Te),ot++)}const Fe=Et?zx(qt):Tl;for(Xe=Fe.length-1,oe=at-1;oe>=0;oe--){const de=He+oe,be=T[de],je=T[de+1],rt=de+1<$e?je.el||Qy(je):re;qt[oe]===0?k(null,be,P,rt,ee,ce,Ee,Ce,Te):Et&&(Xe<0||oe!==Fe[Xe]?Ae(be,P,rt,2):Xe--)}}},Ae=(b,T,P,re,ee=null)=>{const{el:ce,type:Ee,transition:Ce,children:Te,shapeFlag:oe}=b;if(oe&6){Ae(b.component.subTree,T,P,re);return}if(oe&128){b.suspense.move(T,P,re);return}if(oe&64){Ee.move(b,T,P,X);return}if(Ee===pe){a(ce,T,P);for(let ye=0;yeCe.enter(ce),ee));else{const{leave:ye,delayLeave:qe,afterLeave:Be}=Ce,He=()=>{b.ctx.isUnmounted?r(ce):a(ce,T,P)},Ze=()=>{const Xe=ce._isLeaving||!!ce[Qn];ce._isLeaving&&ce[Qn](!0),Ce.persisted&&!Xe?He():ye(ce,()=>{He(),Be&&Be()})};qe?qe(ce,He,Ze):Ze()}else a(ce,T,P)},ie=(b,T,P,re=!1,ee=!1)=>{const{type:ce,props:Ee,ref:Ce,children:Te,dynamicChildren:oe,shapeFlag:$e,patchFlag:ye,dirs:qe,cacheIndex:Be,memo:He}=b;if(ye===-2&&(ee=!1),Ce!=null&&(Da(),Fo(Ce,null,P,b,!0),Oa()),Be!=null&&(T.renderCache[Be]=void 0),$e&256){T.ctx.deactivate(b);return}const Ze=$e&1&&qe,Xe=!Ml(b);let ot;if(Xe&&(ot=Ee&&Ee.onVnodeBeforeUnmount)&&Yn(ot,T,b),$e&6)ke(b.component,P,re);else{if($e&128){b.suspense.unmount(P,re);return}Ze&&Ar(b,null,T,"beforeUnmount"),$e&64?b.type.remove(b,T,P,X,re):oe&&!oe.hasOnce&&(ce!==pe||ye>0&&ye&64)?me(oe,T,P,!1,!0):(ce===pe&&ye&384||!ee&&$e&16)&&me(Te,T,P),re&&xe(b)}const at=He!=null&&Be==null;(Xe&&(ot=Ee&&Ee.onVnodeUnmounted)||Ze||at)&&an(()=>{ot&&Yn(ot,T,b),Ze&&Ar(b,null,T,"unmounted"),at&&(b.el=null)},P)},xe=b=>{const{type:T,el:P,anchor:re,transition:ee}=b;if(T===pe){U(P,re);return}if(T===Yu){D(b);return}const ce=()=>{r(P),ee&&!ee.persisted&&ee.afterLeave&&ee.afterLeave()};if(b.shapeFlag&1&&ee&&!ee.persisted){const{leave:Ee,delayLeave:Ce}=ee,Te=()=>Ee(P,ce);Ce?Ce(b.el,ce,Te):Te()}else ce()},U=(b,T)=>{let P;for(;b!==T;)P=v(b),r(b),b=P;r(T)},ke=(b,T,P)=>{const{bum:re,scope:ee,job:ce,subTree:Ee,um:Ce,m:Te,a:oe}=b;Yp(Te),Yp(oe),re&&ai(re),ee.stop(),ce&&(ce.flags|=8,ie(Ee,b,T,P)),Ce&&an(Ce,T),an(()=>{b.isUnmounted=!0},T)},me=(b,T,P,re=!1,ee=!1,ce=0)=>{for(let Ee=ce;Ee{if(b.shapeFlag&6)return Y(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const T=v(b.anchor||b.el),P=T&&T[$y];return P?v(P):T};let fe=!1;const G=(b,T,P)=>{let re;b==null?T._vnode&&(ie(T._vnode,null,null,!0),re=T._vnode.component):k(T._vnode||null,b,T,null,null,null,P),T._vnode=b,fe||(fe=!0,Lp(re),by(),fe=!1)},X={p:k,um:ie,m:Ae,r:xe,mt:J,mc:W,pc:ue,pbc:I,n:Y,o:e};return{render:G,hydrate:void 0,createApp:Cx(G)}}function Gu({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Tr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Vx(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ef(e,t,n=!1){const a=e.children,r=t.children;if(We(a)&&We(r))for(let l=0;l>1,e[n[i]]0&&(t[a]=n[l-1]),n[l]=a)}}for(l=n.length,o=n[l-1];l-- >0;)n[l]=o,o=t[o];return n}function Xy(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Xy(t)}function Yp(e){if(e)for(let t=0;te.__isSuspense;function jx(e,t){t&&t.pendingBranch?We(e)?t.effects.push(...e):t.effects.push(e):Q_(e)}const pe=Symbol.for("v-fgt"),ou=Symbol.for("v-txt"),Bn=Symbol.for("v-cmt"),Yu=Symbol.for("v-stc"),zo=[];let yn=null;function m(e=!1){zo.push(yn=e?null:[])}function Ux(){zo.pop(),yn=zo[zo.length-1]||null}let Qo=1;function bi(e,t=!1){Qo+=e,e<0&&yn&&t&&(yn.hasOnce=!0)}function tg(e){return e.dynamicChildren=Qo>0?yn||Tl:null,Ux(),Qo>0&&yn&&yn.push(e),e}function y(e,t,n,a,r,l){return tg(w(e,t,n,a,r,l,!0))}function j(e,t,n,a,r){return tg(N(e,t,n,a,r,!0))}function es(e){return e?e.__v_isVNode===!0:!1}function _l(e,t){return e.type===t.type&&e.key===t.key}const ng=({key:e})=>e??null,ri=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?kt(e)||Ct(e)||et(e)?{i:Kt,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,a=0,r=null,l=e===pe?0:1,o=!1,i=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ng(t),ref:t&&ri(t),scopeId:xy,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:a,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Kt};return i?(tf(u,n),l&128&&e.normalize(u)):n&&(u.shapeFlag|=kt(n)?8:16),Qo>0&&!o&&yn&&(u.patchFlag>0||l&6)&&u.patchFlag!==32&&yn.push(u),u}const N=Hx;function Hx(e,t=null,n=null,a=0,r=null,l=!1){if((!e||e===Iy)&&(e=Bn),es(e)){const i=sr(e,t,!0);return n&&tf(i,n),Qo>0&&!l&&yn&&(i.shapeFlag&6?yn[yn.indexOf(e)]=i:yn.push(i)),i.patchFlag=-2,i}if(ek(e)&&(e=e.__vccOpts),t){t=lt(t);let{class:i,style:u}=t;i&&!kt(i)&&(t.class=ve(i)),pt(u)&&(tu(u)&&!We(u)&&(u=It({},u)),t.style=bn(u))}const o=kt(e)?1:eg(e)?128:ax(e)?64:pt(e)?4:et(e)?2:0;return w(e,t,n,a,r,o,l,!0)}function lt(e){return e?tu(e)||Ky(e)?It({},e):e:null}function sr(e,t,n=!1,a=!1){const{props:r,ref:l,patchFlag:o,children:i,transition:u}=e,d=t?ze(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&ng(d),ref:t&&t.ref?n&&l?We(l)?l.concat(ri(t)):[l,ri(t)]:ri(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==pe?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&sr(e.ssContent),ssFallback:e.ssFallback&&sr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&a&&Xo(c,u.clone(c)),c}function _e(e=" ",t=0){return N(ou,null,e,t)}function Q(e="",t=!1){return t?(m(),j(Bn,null,e)):N(Bn,null,e)}function ta(e){return e==null||typeof e=="boolean"?N(Bn):We(e)?N(pe,null,e.slice()):es(e)?_a(e):N(ou,null,String(e))}function _a(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:sr(e)}function tf(e,t){let n=0;const{shapeFlag:a}=e;if(t==null)t=null;else if(We(t))n=16;else if(typeof t=="object")if(a&65){const r=t.default;r&&(r._c&&(r._d=!1),tf(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Ky(t)?t._ctx=Kt:r===3&&Kt&&(Kt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else et(t)?(t={default:t,_ctx:Kt},n=32):(t=String(t),a&64?(n=16,t=[_e(t)]):n=8);e.children=t,e.shapeFlag|=n}function ze(...e){const t={};for(let n=0;nXt||Kt;let _i,rd;{const e=Ji(),t=(n,a)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(a),l=>{r.length>1?r.forEach(o=>o(l)):r[0](l)}};_i=t("__VUE_INSTANCE_SETTERS__",n=>Xt=n),rd=t("__VUE_SSR_SETTERS__",n=>ts=n)}const hs=e=>{const t=Xt;return _i(e),e.scope.on(),()=>{e.scope.off(),_i(t)}},Jp=()=>{Xt&&Xt.scope.off(),_i(null)};function ag(e){return e.vnode.shapeFlag&4}let ts=!1;function Yx(e,t=!1,n=!1){t&&rd(t);const{props:a,children:r}=e.vnode,l=ag(e);Px(e,a,l,t),Lx(e,r,n||t);const o=l?Jx(e,t):void 0;return t&&rd(!1),o}function Jx(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,gx);const{setup:a}=n;if(a){Da();const r=e.setupContext=a.length>1?Xx(e):null,l=hs(e),o=vs(a,e,0,[e.props,r]),i=Vh(o);if(Oa(),l(),(i||e.sp)&&!Ml(e)&&Ey(e),i){if(o.then(Jp,Jp),t)return o.then(u=>{Zp(e,u)}).catch(u=>{nu(u,e,0)});e.asyncDep=o}else Zp(e,o)}else rg(e)}function Zp(e,t,n){et(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pt(t)&&(e.setupState=vy(t)),rg(e)}function rg(e,t,n){const a=e.type;e.render||(e.render=a.render||oa);{const r=hs(e);Da();try{bx(e)}finally{Oa(),r()}}}const Zx={get(e,t){return Zt(e,"get",""),e[t]}};function Xx(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Zx),slots:e.slots,emit:e.emit,expose:t}}function su(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(vy(pi(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Vo)return Vo[n](e)},has(t,n){return n in t||n in Vo}})):e.proxy}function Qx(e,t=!0){return et(e)?e.displayName||e.name:e.name||t&&e.__name}function ek(e){return et(e)&&"__vccOpts"in e}const _=(e,t)=>G_(e,t,ts);function Dn(e,t,n){try{bi(-1);const a=arguments.length;return a===2?pt(t)&&!We(t)?es(t)?N(e,null,[t]):N(e,t):N(e,null,t):(a>3?n=Array.prototype.slice.call(arguments,2):a===3&&es(n)&&(n=[n]),N(e,t,n))}finally{bi(1)}}const tk="3.5.35";let ld;const Xp=typeof window<"u"&&window.trustedTypes;if(Xp)try{ld=Xp.createPolicy("vue",{createHTML:e=>e})}catch{}const lg=ld?e=>ld.createHTML(e):e=>e,nk="http://www.w3.org/2000/svg",ak="http://www.w3.org/1998/Math/MathML",ga=typeof document<"u"?document:null,Qp=ga&&ga.createElement("template"),rk={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,a)=>{const r=t==="svg"?ga.createElementNS(nk,e):t==="mathml"?ga.createElementNS(ak,e):n?ga.createElement(e,{is:n}):ga.createElement(e);return e==="select"&&a&&a.multiple!=null&&r.setAttribute("multiple",a.multiple),r},createText:e=>ga.createTextNode(e),createComment:e=>ga.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ga.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,a,r,l){const o=n?n.previousSibling:t.lastChild;if(r&&(r===l||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===l||!(r=r.nextSibling)););else{Qp.innerHTML=lg(a==="svg"?`${e}`:a==="mathml"?`${e}`:e);const i=Qp.content;if(a==="svg"||a==="mathml"){const u=i.firstChild;for(;u.firstChild;)i.appendChild(u.firstChild);i.removeChild(u)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ua="transition",yo="animation",zl=Symbol("_vtc"),og={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},lk=It({},ux,og),Dr=(e,t=[])=>{We(e)?e.forEach(n=>n(...t)):e&&e(...t)},em=e=>e?We(e)?e.some(t=>t.length>1):e.length>1:!1;function ok(e){const t={};for(const O in e)O in og||(t[O]=e[O]);if(e.css===!1)return t;const{name:n="v",type:a,duration:r,enterFromClass:l=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:i=`${n}-enter-to`,appearFromClass:u=l,appearActiveClass:d=o,appearToClass:c=i,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:v=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,h=sk(r),k=h&&h[0],S=h&&h[1],{onBeforeEnter:x,onEnter:E,onEnterCancelled:L,onLeave:D,onLeaveCancelled:A,onBeforeAppear:R=x,onAppear:F=E,onAppearCancelled:W=L}=t,C=(O,B,J,K)=>{O._enterCancelled=K,Ja(O,B?c:i),Ja(O,B?d:o),J&&J()},I=(O,B)=>{O._isLeaving=!1,Ja(O,f),Ja(O,p),Ja(O,v),B&&B()},z=O=>(B,J)=>{const K=O?F:E,H=()=>C(B,O,J);Dr(K,[B,H]),tm(()=>{Ja(B,O?u:l),Zn(B,O?c:i),em(K)||nm(B,a,k,H)})};return It(t,{onBeforeEnter(O){Dr(x,[O]),Zn(O,l),Zn(O,o)},onBeforeAppear(O){Dr(R,[O]),Zn(O,u),Zn(O,d)},onEnter:z(!1),onAppear:z(!0),onLeave(O,B){O._isLeaving=!0;const J=()=>I(O,B);Zn(O,f),O._enterCancelled?(Zn(O,v),od(O)):(od(O),Zn(O,v)),tm(()=>{O._isLeaving&&(Ja(O,f),Zn(O,p),em(D)||nm(O,a,S,J))}),Dr(D,[O,J])},onEnterCancelled(O){C(O,!1,void 0,!0),Dr(L,[O])},onAppearCancelled(O){C(O,!0,void 0,!0),Dr(W,[O])},onLeaveCancelled(O){I(O),Dr(A,[O])}})}function sk(e){if(e==null)return null;if(pt(e))return[Ju(e.enter),Ju(e.leave)];{const t=Ju(e);return[t,t]}}function Ju(e){return p_(e)}function Zn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[zl]||(e[zl]=new Set)).add(t)}function Ja(e,t){t.split(/\s+/).forEach(a=>a&&e.classList.remove(a));const n=e[zl];n&&(n.delete(t),n.size||(e[zl]=void 0))}function tm(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ik=0;function nm(e,t,n,a){const r=e._endId=++ik,l=()=>{r===e._endId&&a()};if(n!=null)return setTimeout(l,n);const{type:o,timeout:i,propCount:u}=sg(e,t);if(!o)return a();const d=o+"end";let c=0;const f=()=>{e.removeEventListener(d,v),l()},v=p=>{p.target===e&&++c>=u&&f()};setTimeout(()=>{c(n[h]||"").split(", "),r=a(`${Ua}Delay`),l=a(`${Ua}Duration`),o=am(r,l),i=a(`${yo}Delay`),u=a(`${yo}Duration`),d=am(i,u);let c=null,f=0,v=0;t===Ua?o>0&&(c=Ua,f=o,v=l.length):t===yo?d>0&&(c=yo,f=d,v=u.length):(f=Math.max(o,d),c=f>0?o>d?Ua:yo:null,v=c?c===Ua?l.length:u.length:0);const p=c===Ua&&/\b(?:transform|all)(?:,|$)/.test(a(`${Ua}Property`).toString());return{type:c,timeout:f,propCount:v,hasTransform:p}}function am(e,t){for(;e.lengthrm(n)+rm(e[a])))}function rm(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function od(e){return(e?e.ownerDocument:document).body.offsetHeight}function uk(e,t,n){const a=e[zl];a&&(t=(t?[t,...a]:[...a]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const xi=Symbol("_vod"),ig=Symbol("_vsh"),ki={name:"show",beforeMount(e,{value:t},{transition:n}){e[xi]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):go(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:a}){!t!=!n&&(a?t?(a.beforeEnter(e),go(e,!0),a.enter(e)):a.leave(e,()=>{go(e,!1)}):go(e,t))},beforeUnmount(e,{value:t}){go(e,t)}};function go(e,t){e.style.display=t?e[xi]:"none",e[ig]=!t}const ck=Symbol(""),dk=/(?:^|;)\s*display\s*:/;function fk(e,t,n){const a=e.style,r=kt(n);let l=!1;if(n&&!r){if(t)if(kt(t))for(const o of t.split(";")){const i=o.slice(0,o.indexOf(":")).trim();n[i]==null&&Mo(a,i,"")}else for(const o in t)n[o]==null&&Mo(a,o,"");for(const o in n){o==="display"&&(l=!0);const i=n[o];i!=null?mk(e,o,!kt(t)&&t?t[o]:void 0,i)||Mo(a,o,i):Mo(a,o,"")}}else if(r){if(t!==n){const o=a[ck];o&&(n+=";"+o),a.cssText=n,l=dk.test(n)}}else t&&e.removeAttribute("style");xi in e&&(e[xi]=l?a.display:"",e[ig]&&(a.display="none"))}const lm=/\s*!important$/;function Mo(e,t,n){if(We(n))n.forEach(a=>Mo(e,t,a));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const a=pk(e,t);lm.test(n)?e.setProperty(br(a),n.replace(lm,""),"important"):e[a]=n}}const om=["Webkit","Moz","ms"],Zu={};function pk(e,t){const n=Zu[t];if(n)return n;let a=Wt(t);if(a!=="filter"&&a in e)return Zu[t]=a;a=Yi(a);for(let r=0;rXu||(gk.then(()=>Xu=0),Xu=Date.now());function _k(e,t){const n=a=>{if(!a._vts)a._vts=Date.now();else if(a._vts<=n.attached)return;const r=n.value;if(We(r)){const l=a.stopImmediatePropagation;a.stopImmediatePropagation=()=>{l.call(a),a._stopped=!0};const o=r.slice(),i=[a];for(let u=0;ue.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,xk=(e,t,n,a,r,l)=>{const o=r==="svg";t==="class"?uk(e,a,o):t==="style"?fk(e,n,a):Hi(t)?Ki(t)||hk(e,t,n,a,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):kk(e,t,a,o))?(um(e,t,a),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&im(e,t,a,o,l,t!=="value")):e._isVueCE&&(wk(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!kt(a)))?um(e,Wt(t),a,l,t):(t==="true-value"?e._trueValue=a:t==="false-value"&&(e._falseValue=a),im(e,t,a,o))};function kk(e,t,n,a){if(a)return!!(t==="innerHTML"||t==="textContent"||t in e&&fm(t)&&et(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return fm(t)&&kt(n)?!1:t in e}function wk(e,t){const n=e._def.props;if(!n)return!1;const a=Wt(t);return Array.isArray(n)?n.some(r=>Wt(r)===a):Object.keys(n).some(r=>Wt(r)===a)}const ug=new WeakMap,cg=new WeakMap,wi=Symbol("_moveCb"),pm=Symbol("_enterCb"),$k=e=>(delete e.props.mode,e),Ck=$k({name:"TransitionGroup",props:It({},lk,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=pa(),a=ix();let r,l;return Zd(()=>{if(!r.length)return;const o=e.moveClass||`${e.name||"v"}-move`;if(!Dk(r[0].el,n.vnode.el,o)){r=[];return}r.forEach(Ek),r.forEach(Ak);const i=r.filter(Tk);od(n.vnode.el),i.forEach(u=>{const d=u.el,c=d.style;Zn(d,o),c.transform=c.webkitTransform=c.transitionDuration="";const f=d[wi]=v=>{v&&v.target!==d||(!v||v.propertyName.endsWith("transform"))&&(d.removeEventListener("transitionend",f),d[wi]=null,Ja(d,o))};d.addEventListener("transitionend",f)}),r=[]}),()=>{const o=dt(e),i=ok(o);let u=o.tag||pe;if(r=[],l)for(let d=0;d{i.split(/\s+/).forEach(u=>u&&a.classList.remove(u))}),n.split(/\s+/).forEach(i=>i&&a.classList.add(i)),a.style.display="none";const l=t.nodeType===1?t:t.parentNode;l.appendChild(a);const{hasTransform:o}=sg(a);return l.removeChild(a),o}const mm=e=>{const t=e.props["onUpdate:modelValue"]||!1;return We(t)?n=>ai(t,n):t};function Ok(e){e.target.composing=!0}function vm(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Qu=Symbol("_assign");function hm(e,t,n){return t&&(e=e.trim()),n&&(e=Ud(e)),e}const jl={created(e,{modifiers:{lazy:t,trim:n,number:a}},r){e[Qu]=mm(r);const l=a||r.props&&r.props.type==="number";xl(e,t?"change":"input",o=>{o.target.composing||e[Qu](hm(e.value,n,l))}),(n||l)&&xl(e,"change",()=>{e.value=hm(e.value,n,l)}),t||(xl(e,"compositionstart",Ok),xl(e,"compositionend",vm),xl(e,"change",vm))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:a,trim:r,number:l}},o){if(e[Qu]=mm(o),e.composing)return;const i=(l||e.type==="number")&&!/^0\d/.test(e.value)?Ud(e.value):e.value,u=t??"";if(i===u)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(a&&t===n||r&&e.value.trim()===u)||(e.value=u)}},Mk=["ctrl","shift","alt","meta"],Pk={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Mk.some(n=>e[`${n}Key`]&&!t.includes(n))},ft=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),a=t.join(".");return n[a]||(n[a]=((r,...l)=>{for(let o=0;o{const n=e._withKeys||(e._withKeys={}),a=t.join(".");return n[a]||(n[a]=(r=>{if(!("key"in r))return;const l=br(r.key);if(t.some(o=>o===l||Ik[o]===l))return e(r)}))},Rk=It({patchProp:xk},rk);let ym;function qk(){return ym||(ym=Bx(Rk))}const Lk=((...e)=>{const t=qk().createApp(...e),{mount:n}=t;return t.mount=a=>{const r=Bk(a);if(!r)return;const l=t._component;!et(l)&&!l.render&&!l.template&&(l.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,Nk(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function Nk(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bk(e){return kt(e)?document.querySelector(e):e}const kl=typeof document<"u";function fg(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Fk(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&fg(e.default)}const mt=Object.assign;function ec(e,t){const n={};for(const a in t){const r=t[a];n[a]=Fn(r)?r.map(e):e(r)}return n}const jo=()=>{},Fn=Array.isArray;function gm(e,t){const n={};for(const a in e)n[a]=a in t?t[a]:e[a];return n}const pg=Symbol("");function Ul(e,t){return mt(new Error,{type:e,[pg]:!0},t)}function ya(e,t){return e instanceof Error&&pg in e&&(t==null||!!(e.type&t))}const nf=Symbol(""),bm=Symbol(""),iu=Symbol(""),af=Symbol(""),sd=Symbol("");function _r(){return it(iu)}function Mn(e){return it(af)}const mg=/#/g,Vk=/&/g,zk=/\//g,jk=/=/g,Uk=/\?/g,vg=/\+/g,Hk=/%5B/g,Kk=/%5D/g,hg=/%5E/g,Wk=/%60/g,yg=/%7B/g,Gk=/%7C/g,gg=/%7D/g,Yk=/%20/g;function rf(e){return e==null?"":encodeURI(""+e).replace(Gk,"|").replace(Hk,"[").replace(Kk,"]")}function Jk(e){return rf(e).replace(yg,"{").replace(gg,"}").replace(hg,"^")}function id(e){return rf(e).replace(vg,"%2B").replace(Yk,"+").replace(mg,"%23").replace(Vk,"%26").replace(Wk,"`").replace(yg,"{").replace(gg,"}").replace(hg,"^")}function Zk(e){return id(e).replace(jk,"%3D")}function Xk(e){return rf(e).replace(mg,"%23").replace(Uk,"%3F")}function Qk(e){return Xk(e).replace(zk,"%2F")}function $i(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const ew=/\/$/,tw=e=>e.replace(ew,"");function tc(e,t,n="/"){let a,r={},l="",o="";const i=t.indexOf("#");let u=t.indexOf("?");return u=i>=0&&u>i?-1:u,u>=0&&(a=t.slice(0,u),l=t.slice(u,i>0?i:t.length),r=e(l.slice(1))),i>=0&&(a=a||t.slice(0,i),o=t.slice(i,t.length)),a=lw(a??t,n),{fullPath:a+l+o,path:a,query:r,hash:$i(o)}}function nw(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function _m(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function aw(e,t,n){const a=t.matched.length-1,r=n.matched.length-1;return a>-1&&a===r&&Hl(t.matched[a],n.matched[r])&&bg(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Hl(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function bg(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!rw(e[n],t[n]))return!1;return!0}function rw(e,t){return Fn(e)?xm(e,t):Fn(t)?xm(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function xm(e,t){return Fn(t)?e.length===t.length&&e.every((n,a)=>n===t[a]):e.length===1&&e[0]===t}function lw(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),a=e.split("/"),r=a[a.length-1];(r===".."||r===".")&&a.push("");let l=n.length-1,o,i;for(o=0;o1&&l--;else break;return n.slice(0,l).join("/")+"/"+a.slice(o).join("/")}const Ha={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};function ow(e){if(!e)if(kl){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),tw(e)}const sw=/^[^#]+#/;function iw(e,t){return e.replace(sw,"#")+t}function uw(e,t){const n=document.documentElement.getBoundingClientRect(),a=e.getBoundingClientRect();return{behavior:t.behavior,left:a.left-n.left-(t.left||0),top:a.top-n.top-(t.top||0)}}const uu=()=>({left:window.scrollX,top:window.scrollY});function cw(e){let t;if("el"in e){const n=e.el,a=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?a?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=uw(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function km(e,t){return(history.state?history.state.position-t:-1)+e}const ud=new Map;function dw(e,t){ud.set(e,t)}function fw(e){const t=ud.get(e);return ud.delete(e),t}function pw(e){return typeof e=="string"||e&&typeof e=="object"}function _g(e){return typeof e=="string"||typeof e=="symbol"}function mw(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let a=0;ar&&id(r)):[a&&id(a)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function vw(e){const t={};for(const n in e){const a=e[n];a!==void 0&&(t[n]=Fn(a)?a.map(r=>r==null?null:""+r):a==null?a:""+a)}return t}function bo(){let e=[];function t(a){return e.push(a),()=>{const r=e.indexOf(a);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function xg(e,t,n){const a=e.value;if(!a)return;let r=a;const l=()=>{r[t].delete(n)};La(l),Dy(l),Ty(()=>{const o=e.value;o&&(r=o),r[t].add(n)}),r[t].add(n)}function kg(e){xg(it(nf,{}),"leaveGuards",e)}function hw(e){xg(it(nf,{}),"updateGuards",e)}function Qa(e,t,n,a,r,l=o=>o()){const o=a&&(a.enterCallbacks[r]=a.enterCallbacks[r]||[]);return()=>new Promise((i,u)=>{const d=v=>{v===!1?u(Ul(4,{from:n,to:t})):v instanceof Error?u(v):pw(v)?u(Ul(2,{from:t,to:v})):(o&&a.enterCallbacks[r]===o&&typeof v=="function"&&o.push(v),i())},c=l(()=>e.call(a&&a.instances[r],t,n,d));let f=Promise.resolve(c);e.length<3&&(f=f.then(d)),f.catch(v=>u(v))})}function nc(e,t,n,a,r=l=>l()){const l=[];for(const o of e)for(const i in o.components){let u=o.components[i];if(!(t!=="beforeRouteEnter"&&!o.instances[i]))if(fg(u)){const d=(u.__vccOpts||u)[t];d&&l.push(Qa(d,n,a,o,i,r))}else{let d=u();l.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${i}" at "${o.path}"`);const f=Fk(c)?c.default:c;o.mods[i]=c,o.components[i]=f;const v=(f.__vccOpts||f)[t];return v&&Qa(v,n,a,o,i,r)()}))}}return l}function yw(e,t){const n=[],a=[],r=[],l=Math.max(t.matched.length,e.matched.length);for(let o=0;oHl(d,i))?a.push(i):n.push(i));const u=e.matched[o];u&&(t.matched.find(d=>Hl(d,u))||r.push(u))}return[n,a,r]}let gw=()=>location.protocol+"//"+location.host;function wg(e,t){const{pathname:n,search:a,hash:r}=t,l=e.indexOf("#");if(l>-1){let o=r.includes(e.slice(l))?e.slice(l).length:1,i=r.slice(o);return i[0]!=="/"&&(i="/"+i),_m(i,"")}return _m(n,e)+a+r}function bw(e,t,n,a){let r=[],l=[],o=null;const i=({state:v})=>{const p=wg(e,location),h=n.value,k=t.value;let S=0;if(v){if(n.value=p,t.value=v,o&&o===h){o=null;return}S=k?v.position-k.position:0}else a(p);r.forEach(x=>{x(n.value,h,{delta:S,type:"pop",direction:S?S>0?"forward":"back":""})})};function u(){o=n.value}function d(v){r.push(v);const p=()=>{const h=r.indexOf(v);h>-1&&r.splice(h,1)};return l.push(p),p}function c(){if(document.visibilityState==="hidden"){const{history:v}=window;if(!v.state)return;v.replaceState(mt({},v.state,{scroll:uu()}),"")}}function f(){for(const v of l)v();l=[],window.removeEventListener("popstate",i),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",i),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:u,listen:d,destroy:f}}function $m(e,t,n,a=!1,r=!1){return{back:e,current:t,forward:n,replaced:a,position:window.history.length,scroll:r?uu():null}}function _w(e){const{history:t,location:n}=window,a={value:wg(e,n)},r={value:t.state};r.value||l(a.value,{back:null,current:a.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(u,d,c){const f=e.indexOf("#"),v=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+u:gw()+e+u;try{t[c?"replaceState":"pushState"](d,"",v),r.value=d}catch(p){console.error(p),n[c?"replace":"assign"](v)}}function o(u,d){l(u,mt({},t.state,$m(r.value.back,u,r.value.forward,!0),d,{position:r.value.position}),!0),a.value=u}function i(u,d){const c=mt({},r.value,t.state,{forward:u,scroll:uu()});l(c.current,c,!0),l(u,mt({},$m(a.value,u,null),{position:c.position+1},d),!1),a.value=u}return{location:a,state:r,push:i,replace:o}}function xw(e){e=ow(e);const t=_w(e),n=bw(e,t.state,t.location,t.replace);function a(l,o=!0){o||n.pauseListeners(),history.go(l)}const r=mt({location:"",base:e,go:a,createHref:iw.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}const kw={type:0,value:""},ww=/[a-zA-Z0-9_]/;function $w(e){if(!e)return[[]];if(e==="/")return[[kw]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${n})/"${d}": ${p}`)}let n=0,a=n;const r=[];let l;function o(){l&&r.push(l),l=[]}let i=0,u,d="",c="";function f(){d&&(n===0?l.push({type:0,value:d}):n===1||n===2||n===3?(l.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),l.push({type:1,value:d,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),d="")}function v(){d+=u}for(;it.length?t.length===1&&t[0]===80?1:-1:0}function $g(e,t){let n=0;const a=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Tw={strict:!1,end:!0,sensitive:!1};function Dw(e,t,n){const a=Ew($w(e.path),n),r=mt(a,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ow(e,t){const n=[],a=new Map;t=gm(Tw,t);function r(f){return a.get(f)}function l(f,v,p){const h=!p,k=Am(f);k.aliasOf=p&&p.record;const S=gm(t,f),x=[k];if("alias"in f){const D=typeof f.alias=="string"?[f.alias]:f.alias;for(const A of D)x.push(Am(mt({},k,{components:p?p.record.components:k.components,path:A,aliasOf:p?p.record:k})))}let E,L;for(const D of x){const{path:A}=D;if(v&&A[0]!=="/"){const R=v.record.path,F=R[R.length-1]==="/"?"":"/";D.path=v.record.path+(A&&F+A)}if(E=Dw(D,v,S),p?p.alias.push(E):(L=L||E,L!==E&&L.alias.push(E),h&&f.name&&!Tm(E)&&o(f.name)),Cg(E)&&u(E),k.children){const R=k.children;for(let F=0;F{o(L)}:jo}function o(f){if(_g(f)){const v=a.get(f);v&&(a.delete(f),n.splice(n.indexOf(v),1),v.children.forEach(o),v.alias.forEach(o))}else{const v=n.indexOf(f);v>-1&&(n.splice(v,1),f.record.name&&a.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function i(){return n}function u(f){const v=Iw(f,n);n.splice(v,0,f),f.record.name&&!Tm(f)&&a.set(f.record.name,f)}function d(f,v){let p,h={},k,S;if("name"in f&&f.name){if(p=a.get(f.name),!p)throw Ul(1,{location:f});S=p.record.name,h=mt(Em(v.params,p.keys.filter(L=>!L.optional).concat(p.parent?p.parent.keys.filter(L=>L.optional):[]).map(L=>L.name)),f.params&&Em(f.params,p.keys.map(L=>L.name))),k=p.stringify(h)}else if(f.path!=null)k=f.path,p=n.find(L=>L.re.test(k)),p&&(h=p.parse(k),S=p.record.name,p.keys.forEach(L=>{L.optional&&!h[L.name]&&delete h[L.name]}));else{if(p=v.name?a.get(v.name):n.find(L=>L.re.test(v.path)),!p)throw Ul(1,{location:f,currentLocation:v});S=p.record.name,h=mt({},v.params,f.params),k=p.stringify(h)}const x=[];let E=p;for(;E;)x.unshift(E.record),E=E.parent;return{name:S,path:k,params:h,matched:x,meta:Pw(x)}}e.forEach(f=>l(f));function c(){n.length=0,a.clear()}return{addRoute:l,resolve:d,removeRoute:o,clearRoutes:c,getRoutes:i,getRecordMatcher:r}}function Em(e,t){const n={};for(const a of t)a in e&&(n[a]=e[a]);return n}function Am(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Mw(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Mw(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const a in e.components)t[a]=typeof n=="object"?n[a]:n;return t}function Tm(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Pw(e){return e.reduce((t,n)=>mt(t,n.meta),{})}function Iw(e,t){let n=0,a=t.length;for(;n!==a;){const l=n+a>>1;$g(e,t[l])<0?a=l:n=l+1}const r=Rw(e);return r&&(a=t.lastIndexOf(r,a-1)),a}function Rw(e){let t=e;for(;t=t.parent;)if(Cg(t)&&$g(e,t)===0)return t}function Cg({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Dm(e){const t=it(iu),n=it(af),a=_(()=>{const u=s(e.to);return t.resolve(u)}),r=_(()=>{const{matched:u}=a.value,{length:d}=u,c=u[d-1],f=n.matched;if(!c||!f.length)return-1;const v=f.findIndex(Hl.bind(null,c));if(v>-1)return v;const p=Om(u[d-2]);return d>1&&Om(c)===p&&f[f.length-1].path!==p?f.findIndex(Hl.bind(null,u[d-2])):v}),l=_(()=>r.value>-1&&Nw(n.params,a.value.params)),o=_(()=>r.value>-1&&r.value===n.matched.length-1&&bg(n.params,a.value.params));function i(u={}){if(Lw(u)){const d=t[s(e.replace)?"replace":"push"](s(e.to)).catch(jo);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:a,href:_(()=>a.value.href),isActive:l,isExactActive:o,navigate:i}}function qw(e){return e.length===1?e[0]:e}const Vn=ae({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Dm,setup(e,{slots:t}){const n=Ln(Dm(e)),{options:a}=it(iu),r=_(()=>({[Mm(e.activeClass,a.linkActiveClass,"router-link-active")]:n.isActive,[Mm(e.exactActiveClass,a.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const l=t.default&&qw(t.default(n));return e.custom?l:Dn("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},l)}}});function Lw(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Nw(e,t){for(const n in t){const a=t[n],r=e[n];if(typeof a=="string"){if(a!==r)return!1}else if(!Fn(r)||r.length!==a.length||a.some((l,o)=>l.valueOf()!==r[o].valueOf()))return!1}return!0}function Om(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Mm=(e,t,n)=>e??t??n,Bw=ae({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const a=it(sd),r=_(()=>e.route||a.value),l=it(bm,0),o=_(()=>{let d=s(l);const{matched:c}=r.value;let f;for(;(f=c[d])&&!f.components;)d++;return d}),i=_(()=>r.value.matched[o.value]);ht(bm,_(()=>o.value+1)),ht(nf,i),ht(sd,r);const u=M();return Ve(()=>[u.value,i.value,e.name],([d,c,f],[v,p,h])=>{c&&(c.instances[f]=d,p&&p!==c&&d&&d===v&&(c.leaveGuards.size||(c.leaveGuards=p.leaveGuards),c.updateGuards.size||(c.updateGuards=p.updateGuards))),d&&c&&(!p||!Hl(c,p)||!v)&&(c.enterCallbacks[f]||[]).forEach(k=>k(d))},{flush:"post"}),()=>{const d=r.value,c=e.name,f=i.value,v=f&&f.components[c];if(!v)return Pm(n.default,{Component:v,route:d});const p=f.props[c],h=p?p===!0?d.params:typeof p=="function"?p(d):p:null,S=Dn(v,mt({},h,t,{onVnodeUnmounted:x=>{x.component.isUnmounted&&(f.instances[c]=null)},ref:u}));return Pm(n.default,{Component:S,route:d})||S}}});function Pm(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const cd=Bw;function Fw(e){const t=Ow(e.routes,e),n=e.parseQuery||mw,a=e.stringifyQuery||wm,r=e.history,l=bo(),o=bo(),i=bo(),u=Jl(Ha);let d=Ha;kl&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=ec.bind(null,Y=>""+Y),f=ec.bind(null,Qk),v=ec.bind(null,$i);function p(Y,fe){let G,X;return _g(Y)?(G=t.getRecordMatcher(Y),X=fe):X=Y,t.addRoute(X,G)}function h(Y){const fe=t.getRecordMatcher(Y);fe&&t.removeRoute(fe)}function k(){return t.getRoutes().map(Y=>Y.record)}function S(Y){return!!t.getRecordMatcher(Y)}function x(Y,fe){if(fe=mt({},fe||u.value),typeof Y=="string"){const P=tc(n,Y,fe.path),re=t.resolve({path:P.path},fe),ee=r.createHref(P.fullPath);return mt(P,re,{params:v(re.params),redirectedFrom:void 0,href:ee})}let G;if(Y.path!=null)G=mt({},Y,{path:tc(n,Y.path,fe.path).path});else{const P=mt({},Y.params);for(const re in P)P[re]==null&&delete P[re];G=mt({},Y,{params:f(P)}),fe.params=f(fe.params)}const X=t.resolve(G,fe),te=Y.hash||"";X.params=c(v(X.params));const b=nw(a,mt({},Y,{hash:Jk(te),path:X.path})),T=r.createHref(b);return mt({fullPath:b,hash:te,query:a===wm?vw(Y.query):Y.query||{}},X,{redirectedFrom:void 0,href:T})}function E(Y){return typeof Y=="string"?tc(n,Y,u.value.path):mt({},Y)}function L(Y,fe){if(d!==Y)return Ul(8,{from:fe,to:Y})}function D(Y){return F(Y)}function A(Y){return D(mt(E(Y),{replace:!0}))}function R(Y,fe){const G=Y.matched[Y.matched.length-1];if(G&&G.redirect){const{redirect:X}=G;let te=typeof X=="function"?X(Y,fe):X;return typeof te=="string"&&(te=te.includes("?")||te.includes("#")?te=E(te):{path:te},te.params={}),mt({query:Y.query,hash:Y.hash,params:te.path!=null?{}:Y.params},te)}}function F(Y,fe){const G=d=x(Y),X=u.value,te=Y.state,b=Y.force,T=Y.replace===!0,P=R(G,X);if(P)return F(mt(E(P),{state:typeof P=="object"?mt({},te,P.state):te,force:b,replace:T}),fe||G);const re=G;re.redirectedFrom=fe;let ee;return!b&&aw(a,X,G)&&(ee=Ul(16,{to:re,from:X}),Ae(X,X,!0,!1)),(ee?Promise.resolve(ee):I(re,X)).catch(ce=>ya(ce)?ya(ce,2)?ce:Oe(ce):ue(ce,re,X)).then(ce=>{if(ce){if(ya(ce,2))return F(mt({replace:T},E(ce.to),{state:typeof ce.to=="object"?mt({},te,ce.to.state):te,force:b}),fe||re)}else ce=O(re,X,!0,T,te);return z(re,X,ce),ce})}function W(Y,fe){const G=L(Y,fe);return G?Promise.reject(G):Promise.resolve()}function C(Y){const fe=U.values().next().value;return fe&&typeof fe.runWithContext=="function"?fe.runWithContext(Y):Y()}function I(Y,fe){let G;const[X,te,b]=yw(Y,fe);G=nc(X.reverse(),"beforeRouteLeave",Y,fe);for(const P of X)P.leaveGuards.forEach(re=>{G.push(Qa(re,Y,fe))});const T=W.bind(null,Y,fe);return G.push(T),me(G).then(()=>{G=[];for(const P of l.list())G.push(Qa(P,Y,fe));return G.push(T),me(G)}).then(()=>{G=nc(te,"beforeRouteUpdate",Y,fe);for(const P of te)P.updateGuards.forEach(re=>{G.push(Qa(re,Y,fe))});return G.push(T),me(G)}).then(()=>{G=[];for(const P of b)if(P.beforeEnter)if(Fn(P.beforeEnter))for(const re of P.beforeEnter)G.push(Qa(re,Y,fe));else G.push(Qa(P.beforeEnter,Y,fe));return G.push(T),me(G)}).then(()=>(Y.matched.forEach(P=>P.enterCallbacks={}),G=nc(b,"beforeRouteEnter",Y,fe,C),G.push(T),me(G))).then(()=>{G=[];for(const P of o.list())G.push(Qa(P,Y,fe));return G.push(T),me(G)}).catch(P=>ya(P,8)?P:Promise.reject(P))}function z(Y,fe,G){i.list().forEach(X=>C(()=>X(Y,fe,G)))}function O(Y,fe,G,X,te){const b=L(Y,fe);if(b)return b;const T=fe===Ha,P=kl?history.state:{};G&&(X||T?r.replace(Y.fullPath,mt({scroll:T&&P&&P.scroll},te)):r.push(Y.fullPath,te)),u.value=Y,Ae(Y,fe,G,T),Oe()}let B;function J(){B||(B=r.listen((Y,fe,G)=>{if(!ke.listening)return;const X=x(Y),te=R(X,ke.currentRoute.value);if(te){F(mt(te,{replace:!0,force:!0}),X).catch(jo);return}d=X;const b=u.value;kl&&dw(km(b.fullPath,G.delta),uu()),I(X,b).catch(T=>ya(T,12)?T:ya(T,2)?(F(mt(E(T.to),{force:!0}),X).then(P=>{ya(P,20)&&!G.delta&&G.type==="pop"&&r.go(-1,!1)}).catch(jo),Promise.reject()):(G.delta&&r.go(-G.delta,!1),ue(T,X,b))).then(T=>{T=T||O(X,b,!1),T&&(G.delta&&!ya(T,8)?r.go(-G.delta,!1):G.type==="pop"&&ya(T,20)&&r.go(-1,!1)),z(X,b,T)}).catch(jo)}))}let K=bo(),H=bo(),le;function ue(Y,fe,G){Oe(Y);const X=H.list();return X.length?X.forEach(te=>te(Y,fe,G)):console.error(Y),Promise.reject(Y)}function we(){return le&&u.value!==Ha?Promise.resolve():new Promise((Y,fe)=>{K.add([Y,fe])})}function Oe(Y){return le||(le=!Y,J(),K.list().forEach(([fe,G])=>Y?G(Y):fe()),K.reset()),Y}function Ae(Y,fe,G,X){const{scrollBehavior:te}=e;if(!kl||!te)return Promise.resolve();const b=!G&&fw(km(Y.fullPath,0))||(X||!G)&&history.state&&history.state.scroll||null;return Je().then(()=>te(Y,fe,b)).then(T=>T&&cw(T)).catch(T=>ue(T,Y,fe))}const ie=Y=>r.go(Y);let xe;const U=new Set,ke={currentRoute:u,listening:!0,addRoute:p,removeRoute:h,clearRoutes:t.clearRoutes,hasRoute:S,getRoutes:k,resolve:x,options:e,push:D,replace:A,go:ie,back:()=>ie(-1),forward:()=>ie(1),beforeEach:l.add,beforeResolve:o.add,afterEach:i.add,onError:H.add,isReady:we,install(Y){Y.component("RouterLink",Vn),Y.component("RouterView",cd),Y.config.globalProperties.$router=ke,Object.defineProperty(Y.config.globalProperties,"$route",{enumerable:!0,get:()=>s(u)}),kl&&!xe&&u.value===Ha&&(xe=!0,D(r.location).catch(X=>{}));const fe={};for(const X in Ha)Object.defineProperty(fe,X,{get:()=>u.value[X],enumerable:!0});Y.provide(iu,ke),Y.provide(af,py(fe)),Y.provide(sd,u);const G=Y.unmount;U.add(Y),Y.unmount=function(){U.delete(Y),U.size<1&&(d=Ha,B&&B(),B=null,u.value=Ha,xe=!1,le=!1),G()}}};function me(Y){return Y.reduce((fe,G)=>fe.then(()=>C(G)),Promise.resolve())}return ke}const Vw=/^[A-Za-z0-9_-]+$/;function cu(e){const t=e.split(".");if(t.length!==3||!t.every(l=>Vw.test(l)))return null;const[n,a,r]=t;return{vendor:n,plugin:a,controller:r}}function zn(e){const t=cu(e);return t?`/${t.vendor}/${t.plugin}/${t.controller}`:null}function ys(e){return`${e.vendor}.${e.plugin}.${e.controller}`}function Zl(e){const t=e.replace(/^\/+|\/+$/g,"").split("/");if(t.length<3)return null;const n=t.slice(0,3).join(".");return cu(n)?n:null}function Im(e){const t=cu(e);return t?`${t.vendor}.${t.plugin}`:null}const zw=/\{[^{}]+\}/g,jw=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function Uw(){return Math.random().toString(36).slice(2,11)}function Hw(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:a=globalThis.fetch,querySerializer:r,bodySerializer:l,pathSerializer:o,headers:i,requestInitExt:u=void 0,...d}={...e};u=jw()?u:void 0,t=Lm(t);const c=[];async function f(v,p){const{baseUrl:h,fetch:k=a,Request:S=n,headers:x,params:E={},parseAs:L="json",querySerializer:D,bodySerializer:A=l??Ww,pathSerializer:R,body:F,middleware:W=[],...C}=p||{};let I=t;h&&(I=Lm(h)??t);let z=typeof r=="function"?r:Rm(r);D&&(z=typeof D=="function"?D:Rm({...typeof r=="object"?r:{},...D}));const O=R||o||Kw,B=F===void 0?void 0:A(F,qm(i,x,E.header)),J=qm(B===void 0||B instanceof FormData?{}:{"Content-Type":"application/json"},i,x,E.header),K=[...c,...W],H={redirect:"follow",...d,...C,body:B,headers:J};let le,ue,we=new S(Gw(v,{baseUrl:I,params:E,querySerializer:z,pathSerializer:O}),H),Oe;for(const xe in C)xe in we||(we[xe]=C[xe]);if(K.length){le=Uw(),ue=Object.freeze({baseUrl:I,fetch:k,parseAs:L,querySerializer:z,bodySerializer:A,pathSerializer:O});for(const xe of K)if(xe&&typeof xe=="object"&&typeof xe.onRequest=="function"){const U=await xe.onRequest({request:we,schemaPath:v,params:E,options:ue,id:le});if(U)if(U instanceof S)we=U;else if(U instanceof Response){Oe=U;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!Oe){try{Oe=await k(we,u)}catch(xe){let U=xe;if(K.length)for(let ke=K.length-1;ke>=0;ke--){const me=K[ke];if(me&&typeof me=="object"&&typeof me.onError=="function"){const Y=await me.onError({request:we,error:U,schemaPath:v,params:E,options:ue,id:le});if(Y){if(Y instanceof Response){U=void 0,Oe=Y;break}if(Y instanceof Error){U=Y;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(U)throw U}if(K.length)for(let xe=K.length-1;xe>=0;xe--){const U=K[xe];if(U&&typeof U=="object"&&typeof U.onResponse=="function"){const ke=await U.onResponse({request:we,response:Oe,schemaPath:v,params:E,options:ue,id:le});if(ke){if(!(ke instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Oe=ke}}}}const Ae=Oe.headers.get("Content-Length");if(Oe.status===204||we.method==="HEAD"||Ae==="0"&&!Oe.headers.get("Transfer-Encoding")?.includes("chunked"))return Oe.ok?{data:void 0,response:Oe}:{error:void 0,response:Oe};if(Oe.ok)return{data:await(async()=>{if(L==="stream")return Oe.body;if(L==="json"&&!Ae){const U=await Oe.text();return U?JSON.parse(U):void 0}return await Oe[L]()})(),response:Oe};let ie=await Oe.text();try{ie=JSON.parse(ie)}catch{}return{error:ie,response:Oe}}return{request(v,p,h){return f(p,{...h,method:v.toUpperCase()})},GET(v,p){return f(v,{...p,method:"GET"})},PUT(v,p){return f(v,{...p,method:"PUT"})},POST(v,p){return f(v,{...p,method:"POST"})},DELETE(v,p){return f(v,{...p,method:"DELETE"})},OPTIONS(v,p){return f(v,{...p,method:"OPTIONS"})},HEAD(v,p){return f(v,{...p,method:"HEAD"})},PATCH(v,p){return f(v,{...p,method:"PATCH"})},TRACE(v,p){return f(v,{...p,method:"TRACE"})},use(...v){for(const p of v)if(p){if(typeof p!="object"||!("onRequest"in p||"onResponse"in p||"onError"in p))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");c.push(p)}},eject(...v){for(const p of v){const h=c.indexOf(p);h!==-1&&c.splice(h,1)}}}}function du(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function Sg(e,t,n){if(!t||typeof t!="object")return"";const a=[],r={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const i in t)a.push(i,n.allowReserved===!0?t[i]:encodeURIComponent(t[i]));const o=a.join(",");switch(n.style){case"form":return`${e}=${o}`;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return o}}for(const o in t){const i=n.style==="deepObject"?`${e}[${o}]`:o;a.push(du(i,t[o],n))}const l=a.join(r);return n.style==="label"||n.style==="matrix"?`${r}${l}`:l}function Eg(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const l={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",o=(n.allowReserved===!0?t:t.map(i=>encodeURIComponent(i))).join(l);switch(n.style){case"simple":return o;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return`${e}=${o}`}}const a={simple:",",label:".",matrix:";"}[n.style]||"&",r=[];for(const l of t)n.style==="simple"||n.style==="label"?r.push(n.allowReserved===!0?l:encodeURIComponent(l)):r.push(du(e,l,n));return n.style==="label"||n.style==="matrix"?`${a}${r.join(a)}`:r.join(a)}function Rm(e){return function(n){const a=[];if(n&&typeof n=="object")for(const r in n){const l=n[r];if(l!=null){if(Array.isArray(l)){if(l.length===0)continue;a.push(Eg(r,l,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof l=="object"){a.push(Sg(r,l,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}a.push(du(r,l,e))}}return a.join("&")}}function Kw(e,t){let n=e;for(const a of e.match(zw)??[]){let r=a.substring(1,a.length-1),l=!1,o="simple";if(r.endsWith("*")&&(l=!0,r=r.substring(0,r.length-1)),r.startsWith(".")?(o="label",r=r.substring(1)):r.startsWith(";")&&(o="matrix",r=r.substring(1)),!t||t[r]===void 0||t[r]===null)continue;const i=t[r];if(Array.isArray(i)){n=n.replace(a,Eg(r,i,{style:o,explode:l}));continue}if(typeof i=="object"){n=n.replace(a,Sg(r,i,{style:o,explode:l}));continue}if(o==="matrix"){n=n.replace(a,`;${du(r,i)}`);continue}n=n.replace(a,o==="label"?`.${encodeURIComponent(i)}`:encodeURIComponent(i))}return n}function Ww(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function Gw(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let a=t.querySerializer(t.params.query??{});return a.startsWith("?")&&(a=a.substring(1)),a&&(n+=`?${a}`),n}function qm(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const a=n instanceof Headers?n.entries():Object.entries(n);for(const[r,l]of a)if(l===null)t.delete(r);else if(Array.isArray(l))for(const o of l)t.append(r,o);else l!==void 0&&t.set(r,l)}return t}function Lm(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const Nm="/backend",Yw="__SUMMER_ADMIN_BASE__",Jw="__SUMMER_ADMIN_BUILD__",Zw=/^[0-9a-f]{6,64}$/;function Xw(e=document){const t=e.querySelector('meta[name="summer-admin-base"]')?.content.trim()??"";if(t===""||t===Yw||!t.startsWith("/"))return Nm;const n=t.replace(/\/+$/,"");return n===""?Nm:n}function Qw(e=document){const t=e.querySelector('meta[name="summer-admin-build"]')?.content.trim()??"";return t===Jw||!Zw.test(t)?"":t}const Bm=Xw(),Gr={base:Bm,api:`${Bm}/api/v1`,build:Qw()},Ag="XMLHttpRequest";let Ci=null,Tg=null,_o=null;const ac=new WeakMap;function e2(e){Ci=e}function t2(){Ci?.()}function n2(e){Tg=e}function a2(e){return new URL(e.url,"http://local").pathname}function Fm(e){const t=a2(e);return t.endsWith("/auth/login")||t.endsWith("/auth/refresh")}function lf(){return _o||(_o=(async()=>{try{const{data:e,response:t}=await Ne.POST("/auth/refresh");if(!t.ok||!e)return!1;const n=e.data.expires_in;return Tg?.(typeof n=="number"?n:null),!0}catch{return!1}finally{_o=null}})(),_o)}const r2={onRequest({request:e}){return e.headers.set("X-Requested-With",Ag),Fm(e)||ac.set(e,e.clone()),e},async onResponse({request:e,response:t}){if(t.status!==401||Fm(e))return t;const n=ac.get(e);if(ac.delete(e),!n||!await lf())return Ci?.(),t;const a=await globalThis.fetch(n);return a.status===401&&Ci?.(),a}},Ne=Hw({baseUrl:Gr.api,credentials:"same-origin",fetch:e=>globalThis.fetch(e)});Ne.use(r2);const of=M({}),sf=M(typeof document>"u"?"pl":document.documentElement.lang||"pl"),ua=xt(sf),Dg=M([]),l2=xt(Dg);function o2(e,t){of.value=e,t&&(sf.value=t,typeof document<"u"&&(document.documentElement.lang=t))}async function Og(e){const{data:t,response:n}=await Ne.GET("/lang",e?{params:{query:{locale:e}}}:{});!n.ok||!t||(Dg.value=Array.isArray(t.meta.locales)?[...t.meta.locales]:[],o2(t.data,t.meta.locale))}function Vm(e){const t=e.codePointAt(0);if(t===void 0)return e;const n=String.fromCodePoint(t);return n.toUpperCase()+e.slice(n.length)}function dd(e,t={}){if(e==="")return e;const n=[];for(const[r,l]of Object.entries(t)){const o=r.replace(/^:/,"");if(o==="")continue;const i=String(l);n.push([`:${Vm(o)}`,Vm(i)]),n.push([`:${o.toUpperCase()}`,i.toUpperCase()]),n.push([`:${o}`,i])}n.sort((r,l)=>l[0].length-r[0].length);let a=e;for(const[r,l]of n)a=a.split(r).join(l);return a}const zm=new Map;function s2(e,t=sf.value){let n=zm.get(t);if(n===void 0){try{n=new Intl.PluralRules(t)}catch{n=null}zm.set(t,n)}return n?n.select(e):"other"}function Ge(e,t,n={}){if(!e)return"";if(t===void 0)return dd(e.other??"",n);const a=e[s2(t)]??e.other??"";return dd(a,{count:t,...n})}function g(e,t={}){const n=of.value[e]?.other;return n===void 0?e:dd(n,t)}function zr(e,t,n={}){const a=of.value[e];return a?Ge(a,t,n):e}const uf=M(""),Po=xt(uf);function cf(e){uf.value=e}function df(){uf.value=""}const Si=M([]);async function Mg(){const{data:e,response:t}=await Ne.GET("/navigation");return Si.value=t.ok&&e?e.data:[],Si.value}function i2(e){Si.value=e}const Ei=_(()=>Si.value.filter(e=>e.sideMenu.length>0).map((e,t)=>({entry:e,index:t})).sort((e,t)=>e.entry.order-t.entry.order||e.index-t.index).map(({entry:e})=>e));function ff(e){for(const t of e.sideMenu){const n=zn(t.controller);if(n)return n}return zn(e.controller)}function gs(e,t){const n=`${e}.${t}`;return Ei.value.find(a=>Im(a.controller)===n||a.sideMenu.some(r=>Im(r.controller)===n))??null}function u2(){for(const e of Ei.value){const t=ff(e);if(t)return t}return null}const ir=M([]),c2=_(()=>ir.value.length>0);async function Pg(){const{data:e,response:t}=await Ne.GET("/settings");return ir.value=t.ok&&e?e.data:[],ir.value}function d2(e){ir.value=e}function ns(e){return ir.value.find(t=>t.code===e)??null}function pf(e){return e.path?e.path:e.controller?zn(e.controller)??"/settings":`/settings/${encodeURIComponent(e.code)}`}function fu(e){return e?ir.value.find(t=>t.controller!==""&&t.controller===e)??null:null}function Ig(e){return ir.value.find(t=>!!t.path&&t.path===e)??null}const fd=_(()=>{const e=ir.value.map((n,a)=>({entry:n,index:a})).sort((n,a)=>n.entry.order-a.entry.order||n.index-a.index).map(({entry:n})=>n),t=[];for(const n of e){let a=t.find(r=>r.category===n.category);a||(a={category:n.category,entries:[]},t.push(a)),a.entries.push(n)}return t});function rc(e){if(!e)return null;const t=fd.value.find(n=>n.category===e.category);return!t||t.entries.length<2?null:{category:t.category,current:e,entries:t.entries}}const jm="SummerCMS";function f2(e){if(e.name==="login")return g("backend::lang.auth.title");if(e.name==="settings")return g("backend::lang.settings.title");if(e.name==="account")return g("backend::lang.myaccount.menu_label");if(e.name==="plugins")return g("backend::lang.plugins.title");if(e.name==="settings-form")return ns(String(e.params.code??""))?.label??String(e.params.code??"");if(e.name==="home")return g("backend::lang.nav.empty");if(e.name==="not-found")return g("backend::lang.page.not_found");const t=gs(String(e.params.vendor??""),String(e.params.plugin??"")),n=Zl(e.path),r=t?.sideMenu.find(l=>l.controller===n)?.label??t?.label??fu(n)?.label??"";return(e.name==="create"||e.name==="record"||e.name==="preview")&&Po.value||r}function p2(e){const t=f2(e).trim();return t===""?jm:`${t} | ${jm}`}const Um=e=>e==="";const m2=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const Hm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const v2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const h2=e=>{const t=v2(e);return t.charAt(0).toUpperCase()+t.slice(1)};var fl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const y2=Symbol("lucide-icons");function g2(){return it(y2,{})}const b2=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":a,strokeWidth:r,"stroke-width":l,size:o,color:i,...u},{slots:d})=>{const{size:c,color:f,strokeWidth:v=2,absoluteStrokeWidth:p=!1,class:h=""}=g2(),k=_(()=>{const S=Um(n)||Um(a)||n===!0||a===!0||p===!0,x=r||l||v||fl["stroke-width"];return S?Number(x)*24/Number(o??c??fl.width):x});return Dn("svg",{...fl,...u,width:o??c??fl.width,height:o??c??fl.height,stroke:i??f??fl.stroke,"stroke-width":k.value,class:m2("lucide",h,...e?[`lucide-${Hm(h2(e))}-icon`,`lucide-${Hm(e)}`]:["lucide-icon"])},[...t.map(S=>Dn(...S)),...d.default?[d.default()]:[]])};const he=(e,t)=>(n,{slots:a,attrs:r})=>Dn(b2,{...r,...n,iconNode:t,name:e},a.default?{default:a.default}:void 0);const _2=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],x2=he("archive",_2);const k2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Rg=he("arrow-down",k2);const w2=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],bs=he("arrow-left",w2);const $2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],C2=he("arrow-right",$2);const S2=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],qg=he("arrow-up-down",S2);const E2=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Lg=he("arrow-up-right",E2);const A2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ng=he("arrow-up",A2);const T2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],D2=he("ban",T2);const O2=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],M2=he("bell",O2);const P2=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],I2=he("bold",P2);const R2=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],q2=he("book",R2);const L2=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],N2=he("bookmark",L2);const B2=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],F2=he("box",B2);const V2=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],z2=he("briefcase",V2);const j2=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],U2=he("building",j2);const H2=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Bg=he("calendar",H2);const K2=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],W2=he("camera",K2);const G2=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["circle",{cx:"8",cy:"10",r:"2",key:"1xl4ub"}],["path",{d:"M8 12h8",key:"1wcyev"}],["circle",{cx:"16",cy:"10",r:"2",key:"r14t7q"}],["path",{d:"m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3",key:"l01ucn"}]],Y2=he("cassette-tape",G2);const J2=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16h8",key:"srdodz"}],["path",{d:"M7 11h12",key:"127s9w"}],["path",{d:"M7 6h3",key:"w9rmul"}]],Z2=he("chart-bar",J2);const X2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jn=he("check",X2);const Q2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ur=he("chevron-down",Q2);const e$=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],pu=he("chevron-left",e$);const t$=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_s=he("chevron-right",t$);const n$=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Fg=he("chevron-up",n$);const a$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],gt=he("circle-alert",a$);const r$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],l$=he("circle-arrow-up",r$);const o$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],s$=he("circle-check",o$);const i$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],u$=he("circle-question-mark",i$);const c$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],d$=he("circle",c$);const f$=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],p$=he("clipboard-list",f$);const m$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],pd=he("clock",m$);const v$=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],h$=he("cloud",v$);const y$=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Vg=he("code",y$);const g$=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ai=he("copy",g$);const b$=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],_$=he("credit-card",b$);const x$=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],k$=he("database",x$);const w$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],$$=he("disc-3",w$);const C$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],S$=he("disc",C$);const E$=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],md=he("download",E$);const A$=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],zg=he("external-link",A$);const T$=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],D$=he("eye-off",T$);const O$=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],M$=he("eye",O$);const P$=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],El=he("file-text",P$);const I$=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],R$=he("file",I$);const q$=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],L$=he("files",q$);const N$=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],B$=he("flag",N$);const F$=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],V$=he("folder",F$);const z$=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],j$=he("funnel",z$);const U$=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],H$=he("gauge",U$);const K$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],W$=he("globe",K$);const G$=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],Y$=he("graduation-cap",G$);const J$=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ti=he("grip-vertical",J$);const Z$=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],X$=he("heading-3",Z$);const Q$=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],eC=he("heart",Q$);const tC=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],nC=he("house",tC);const aC=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],Km=he("image-off",aC);const rC=[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],lC=he("image-up",rC);const oC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],sC=he("image",oC);const iC=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],uC=he("inbox",iC);const cC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Xl=he("info",cC);const dC=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],fC=he("italic",dC);const pC=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],mC=he("key-round",pC);const vC=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],hC=he("key",vC);const yC=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],gC=he("languages",yC);const bC=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],_C=he("layout-grid",bC);const xC=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],kC=he("leaf",xC);const wC=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],$C=he("library",wC);const CC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],SC=he("life-buoy",CC);const EC=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],jg=he("link",EC);const AC=[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]],TC=he("list-indent-decrease",AC);const DC=[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]],OC=he("list-indent-increase",DC);const MC=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Ug=he("list-ordered",MC);const PC=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Hg=he("list",PC);const IC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Il=he("loader-circle",IC);const RC=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],tr=he("lock",RC);const qC=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Kg=he("log-out",qC);const LC=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],NC=he("mail",LC);const BC=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],FC=he("map-pin",BC);const VC=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],zC=he("message-circle",VC);const jC=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],UC=he("mic-vocal",jC);const HC=[["path",{d:"M5 12h14",key:"1ays0h"}]],Wg=he("minus",HC);const KC=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],WC=he("moon",KC);const GC=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],YC=he("network",GC);const JC=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],ZC=he("palette",JC);const XC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],mf=he("panel-left-close",XC);const QC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Gg=he("panel-left-open",QC);const eS=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],tS=he("paperclip",eS);const nS=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],aS=he("pause",nS);const rS=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Uo=he("pencil",rS);const lS=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],oS=he("phone",lS);const sS=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],iS=he("play",sS);const uS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xs=he("plus",uS);const cS=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Yg=he("puzzle",cS);const dS=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],fS=he("quote",dS);const pS=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],mS=he("redo-2",pS);const vS=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],hS=he("refresh-cw",vS);const yS=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],li=he("rotate-ccw",yS);const gS=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Jg=he("search-x",gS);const bS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ks=he("search",bS);const _S=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Zg=he("settings",_S);const xS=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],kS=he("shield-check",xS);const wS=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],$S=he("shopping-cart",wS);const CS=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],SS=he("sliders-horizontal",CS);const ES=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Xg=he("star",ES);const AS=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]],TS=he("sun-moon",AS);const DS=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],mu=he("sun",DS);const OS=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],MS=he("table",OS);const PS=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],IS=he("tags",PS);const RS=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],xr=he("trash-2",RS);const qS=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Di=he("triangle-alert",qS);const LS=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],NS=he("trophy",LS);const BS=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],FS=he("underline",BS);const VS=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Qg=he("undo-2",VS);const zS=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],jS=he("unlink",zS);const US=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],oi=he("upload",US);const HS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],eb=he("user-minus",HS);const KS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],tb=he("user-plus",KS);const WS=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],GS=he("user-round",WS);const YS=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],JS=he("user",YS);const ZS=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],XS=he("users-round",ZS);const QS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],e3=he("users",QS);const t3=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],n3=he("wand-sparkles",t3);const a3=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],r3=he("wrench",a3);const l3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qt=he("x",l3),Wm={archive:x2,"arrow-down":Rg,"arrow-left":bs,"arrow-right":C2,"arrow-up":Ng,"arrow-up-right":Lg,bell:M2,book:q2,bookmark:N2,box:F2,briefcase:z2,building:U2,calendar:Bg,camera:W2,"cassette-tape":Y2,"chart-bar":Z2,check:jn,"chevron-down":ur,"chevron-left":pu,"chevron-right":_s,circle:d$,"circle-alert":gt,"circle-check":s$,"circle-question-mark":u$,"clipboard-list":p$,clock:pd,cloud:h$,code:Vg,copy:Ai,"credit-card":_$,database:k$,disc:S$,"disc-3":$$,download:md,"external-link":zg,file:R$,"file-text":El,files:L$,flag:B$,folder:V$,funnel:j$,gauge:H$,globe:W$,"graduation-cap":Y$,heart:eC,house:nC,image:sC,inbox:uC,info:Xl,key:hC,languages:gC,"layout-grid":_C,leaf:kC,library:$C,"life-buoy":SC,link:jg,list:Hg,"list-ordered":Ug,lock:tr,"log-out":Kg,mail:NC,"map-pin":FC,"message-circle":zC,"mic-vocal":UC,minus:Wg,network:YC,palette:ZC,"panel-left-close":mf,"panel-left-open":Gg,paperclip:tS,pause:aS,pencil:Uo,phone:oS,play:iS,plus:xs,puzzle:Yg,"refresh-cw":hS,search:ks,"search-x":Jg,settings:Zg,"shield-check":kS,"shopping-cart":$S,star:Xg,sun:mu,table:MS,tags:IS,"trash-2":xr,"triangle-alert":Di,trophy:NS,upload:oi,user:JS,"user-minus":eb,"user-plus":tb,users:e3,"users-round":XS,"wand-sparkles":n3,wrench:r3,x:Qt},o3={"icon-archive":"archive","icon-bar-chart":"chart-bar","icon-bell":"bell","icon-book":"book","icon-bookmark":"bookmark","icon-briefcase":"briefcase","icon-building":"building","icon-calendar":"calendar","icon-camera":"camera","icon-check":"check","icon-check-circle":"circle-check","icon-circle":"circle","icon-clock":"clock","icon-clock-o":"clock","icon-cloud":"cloud","icon-code":"code","icon-cog":"settings","icon-cogs":"settings","icon-comment":"message-circle","icon-comments":"message-circle","icon-comments-o":"message-circle","icon-copy":"copy","icon-credit-card":"credit-card","icon-cube":"box","icon-dashboard":"gauge","icon-database":"database","icon-download":"download","icon-edit":"pencil","icon-envelope":"mail","icon-envelope-o":"mail","icon-exclamation-triangle":"triangle-alert","icon-external-link":"external-link","icon-file":"file","icon-file-o":"file","icon-file-text":"file-text","icon-file-text-o":"file-text","icon-files-o":"files","icon-filter":"funnel","icon-flag":"flag","icon-folder":"folder","icon-folder-o":"folder","icon-globe":"globe","icon-graduation-cap":"graduation-cap","icon-group":"users","icon-heart":"heart","icon-home":"house","icon-inbox":"inbox","icon-info-circle":"info","icon-key":"key","icon-language":"languages","icon-leaf":"leaf","icon-life-ring":"life-buoy","icon-link":"link","icon-list":"list","icon-list-alt":"clipboard-list","icon-list-ol":"list-ordered","icon-list-ul":"list","icon-lock":"lock","icon-magic":"wand-sparkles","icon-map-marker":"map-pin","icon-minus":"minus","icon-paperclip":"paperclip","icon-pause":"pause","icon-pencil":"pencil","icon-phone":"phone","icon-photo":"image","icon-picture-o":"image","icon-play":"play","icon-plus":"plus","icon-question":"circle-question-mark","icon-question-circle":"circle-question-mark","icon-refresh":"refresh-cw","icon-search":"search","icon-shopping-cart":"shopping-cart","icon-sign-out":"log-out","icon-sitemap":"network","icon-star":"star","icon-table":"table","icon-tachometer":"gauge","icon-tags":"tags","icon-th":"layout-grid","icon-th-large":"layout-grid","icon-times":"x","icon-trash":"trash-2","icon-trash-o":"trash-2","icon-trophy":"trophy","icon-upload":"upload","icon-user":"user","icon-users":"users","icon-warning":"triangle-alert","icon-wrench":"wrench"},Gm=mu;function lc(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function ws(e){if(!e)return Gm;const t=e.trim();return lc(Wm,t)??lc(Wm,lc(o3,t)??"")??Gm}const s3="(prefers-color-scheme: dark)",si=["system","light","dark"];function nb(e){return typeof e=="string"&&si.includes(e)}function i3(e=window,t="system"){const n=e.document.documentElement;if(t!=="system")return n.classList.toggle("dark",t==="dark"),()=>{};if(typeof e.matchMedia!="function")return n.classList.remove("dark"),()=>{};const a=e.matchMedia(s3),r=o=>{n.classList.toggle("dark",o)};r(a.matches);const l=o=>r(o.matches);return a.addEventListener("change",l),()=>a.removeEventListener("change",l)}const u3=4e3,as=M([]),vd=new Map;let c3=1;const d3=xt(as);function Le(e,t="success"){const n=c3++;return as.value=[{id:n,text:e,tone:t},...as.value],vd.set(n,setTimeout(()=>ab(n),u3)),n}function ab(e){const t=vd.get(e);t!==void 0&&(clearTimeout(t),vd.delete(e)),as.value=as.value.filter(n=>n.id!==e)}const rb="summer-admin.theme",vf="summer-admin.locale",f3=/^[A-Za-z]{2,8}(?:[-_][A-Za-z0-9]{1,8})?$/,Kl=M("system");let Ym=()=>{};const Jm=xt(Kl),Oi=M(""),p3=xt(Oi);function Mi(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function hf(e,t){try{t===null?Mi()?.removeItem(e):Mi()?.setItem(e,t)}catch{}}function hd(e){hf(rb,e==="system"?null:e)}function m3(){try{const e=Mi()?.getItem(rb);return nb(e)?e:"system"}catch{return"system"}}function v3(){try{const e=Mi()?.getItem(vf)??"";return e.length<=16&&f3.test(e)?e:""}catch{return""}}const lb={reload(){window.location.reload()}};function Pi(e){Ym(),Kl.value=e,Ym=typeof window>"u"?()=>{}:i3(window,e)}function h3(e){const t=si.indexOf(e);return si[(t+1)%si.length]??"system"}async function y3(e){const t=Kl.value;Pi(e),hd(e);let n=!1;try{const{response:a}=await Ne.PUT("/account/preferences",{body:{theme:e}});n=a.ok}catch{n=!1}n||(Kl.value===e&&(Pi(t),hd(t)),Le(g("backend::lang.myaccount.preferences_failed"),"danger"))}function Zm(){return y3(h3(Kl.value))}async function g3(e){const t=e?.preferences;t&&(nb(t.theme)&&(t.theme!==Kl.value&&Pi(t.theme),hd(t.theme)),typeof t.locale=="string"&&(Oi.value=t.locale,t.locale!==""&&t.locale!==ua.value&&await Og(t.locale).catch(()=>{}),hf(vf,t.locale===""?null:t.locale)))}async function b3(e){if(e===Oi.value)return;let t=!1;try{const{response:n}=await Ne.PUT("/account/preferences",{body:{locale:e}});t=n.ok}catch{t=!1}if(!t){Le(g("backend::lang.myaccount.preferences_failed"),"danger");return}Oi.value=e,hf(vf,e===""?null:e),lb.reload()}const ob="summer-admin.sidebar",_3="(max-width: 1099px)",vu=M(!1),Ho=M(!1),x3=_(()=>Ho.value||vu.value);function sb(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function k3(){try{return sb()?.getItem(ob)==="true"}catch{return!1}}function yf(e){vu.value=e;try{sb()?.setItem(ob,e?"true":"false")}catch{}}function w3(){if(vu.value=k3(),typeof window>"u"||typeof window.matchMedia!="function")return Ho.value=!1,()=>{};const e=window.matchMedia(_3);Ho.value=e.matches;const t=n=>{Ho.value=n.matches};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}function ib(){return{collapsed:x3,narrow:xt(Ho),manual:xt(vu),setCollapsed:yf,watchViewport:w3}}const $3=["id","aria-label"],C3={class:"px-2.5 pt-1 pb-2 text-[14px] font-bold","aria-hidden":"true"},S3=ae({__name:"SectionFlyout",props:{entry:{},id:{}},emits:["escape","leave","navigate"],setup(e,{expose:t,emit:n}){const a=e,r=n,l=Mn(),o=M(null),i=_(()=>Zl(l.path)),u=_(()=>a.entry.sideMenu.flatMap(p=>{const h=zn(p.controller);return h?[{item:p,to:h,icon:ws(p.icon),current:i.value===p.controller}]:[]}));function d(){return[...o.value?.querySelectorAll('[role="menuitem"]')??[]]}async function c(){await Je(),d()[0]?.focus()}function f(p){return!!p&&!!o.value?.contains(p)}function v(p){const h=d(),k=h.indexOf(document.activeElement);switch(p.key){case"ArrowDown":p.preventDefault(),h[(k+1)%h.length]?.focus();break;case"ArrowUp":p.preventDefault(),h[(k-1+h.length)%h.length]?.focus();break;case"Home":p.preventDefault(),h[0]?.focus();break;case"End":p.preventDefault(),h[h.length-1]?.focus();break;case"Escape":p.preventDefault(),r("escape");break;case"Tab":r("leave");break}}return t({focusFirst:c,contains:f}),(p,h)=>(m(),y("div",{id:e.id,ref_key:"root",ref:o,role:"menu","data-section-flyout":"","aria-label":e.entry.label,class:"fixed top-3 left-[calc(var(--spacing-rail)+8px)] z-40 flex w-[230px] flex-col gap-0.5 rounded-[14px] border border-border bg-surface p-2 text-text shadow-pop",onKeydown:v},[w("span",C3,$(e.entry.label),1),(m(!0),y(pe,null,Ie(u.value,k=>(m(),j(s(Vn),{key:k.item.code,to:k.to,role:"menuitem",tabindex:"-1","aria-current":k.current?"page":void 0,class:ve([k.current?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-[38px] items-center gap-3 rounded-tab px-2.5 no-underline transition-colors duration-150 ease-out"]),onClick:h[0]||(h[0]=S=>r("navigate"))},{default:q(()=>[(m(),j(zt(k.icon),{size:18,"aria-hidden":"true"})),w("span",null,$(k.item.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],40,$3))}}),E3=["aria-label"],A3=["aria-label","title"],T3={class:"max-w-full [overflow-wrap:anywhere]"},D3=["aria-label","title"],O3={class:"max-w-full [overflow-wrap:anywhere]"},M3=200,P3=ae({__name:"PluginRail",setup(e){const t=Mn(),{collapsed:n,narrow:a,setCollapsed:r}=ib(),l={system:{icon:TS,key:"backend::lang.nav.theme_system"},light:{icon:mu,key:"backend::lang.nav.theme_light"},dark:{icon:WC,key:"backend::lang.nav.theme_dark"}},o=_(()=>l[Jm.value].icon),i=_(()=>g("backend::lang.nav.theme",{mode:g(l[Jm.value].key)})),u=_(()=>gs(String(t.params.vendor??""),String(t.params.plugin??""))),d=_(()=>t.path==="/settings"||t.path.startsWith("/settings/")||Ig(t.path)!==null||u.value===null&&fu(Zl(t.path))!==null),c=_(()=>Ei.value.map(z=>({entry:z,to:ff(z)??"/",icon:ws(z.icon),current:u.value?.code===z.code}))),f=M(null),v=M(null),p=_(()=>Ei.value.find(z=>z.code===f.value)??null),h=new Map;let k=null,S=!1;function x(z){return`section-flyout-${z}`}function E(z,O){const B=O?.$el;B instanceof HTMLElement?h.set(z,B):h.delete(z)}function L(){k!==null&&(clearTimeout(k),k=null)}function D(){L(),f.value=null}function A(){L(),k=setTimeout(()=>{k=null;const z=document.activeElement,O=f.value;O!==null&&(h.get(O)===z||v.value?.contains(z))||(f.value=null)},M3)}function R(z){n.value&&(L(),f.value=z)}function F(z){S||R(z)}async function W(z,O){n.value&&(z.key==="Enter"||z.key==="ArrowDown"?(z.preventDefault(),R(O),await Je(),await v.value?.focusFirst()):z.key==="Escape"&&f.value!==null&&(z.preventDefault(),D()))}function C(){const z=f.value;D(),z!==null&&(S=!0,h.get(z)?.focus(),S=!1)}function I(){r(!1),Je(()=>document.querySelector("[data-sidebar-collapse]")?.focus())}return Ve(n,z=>{z||D()}),St(L),(z,O)=>(m(),y("nav",{"aria-label":s(g)("backend::lang.nav.plugins"),class:"sticky top-0 flex h-screen w-rail shrink-0 flex-col items-center gap-1.5 self-start overflow-y-auto border-r border-side-border bg-side pt-3.5 pb-3"},[w("button",{type:"button","data-theme-toggle":"","aria-label":i.value,title:i.value,class:"mb-3.5 flex size-10 shrink-0 items-center justify-center rounded-inner bg-accent-soft transition-colors duration-150 ease-out hover:bg-side-hover",onClick:O[0]||(O[0]=(...B)=>s(Zm)&&s(Zm)(...B))},[(m(),j(zt(o.value),{size:22,class:"text-accent","aria-hidden":"true"}))],8,A3),(m(!0),y(pe,null,Ie(c.value,B=>(m(),j(s(Vn),{key:B.entry.code,ref_for:!0,ref:J=>E(B.entry.code,J),to:B.to,"data-rail-item":B.entry.code,"aria-current":B.current?"page":void 0,"aria-haspopup":s(n)?"menu":void 0,"aria-expanded":s(n)?f.value===B.entry.code?"true":"false":void 0,"aria-controls":s(n)&&f.value===B.entry.code?x(B.entry.code):void 0,class:ve([B.current?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"]),onMouseenter:J=>R(B.entry.code),onMouseleave:A,onFocus:J=>F(B.entry.code),onBlur:A,onKeydown:J=>W(J,B.entry.code)},{default:q(()=>[(m(),j(zt(B.icon),{size:20,"aria-hidden":"true"})),w("span",T3,$(B.entry.label),1)]),_:2},1032,["to","data-rail-item","aria-current","aria-haspopup","aria-expanded","aria-controls","class","onMouseenter","onFocus","onKeydown"]))),128)),s(n)&&p.value?(m(),j(S3,{key:0,id:x(p.value.code),ref_key:"flyout",ref:v,entry:p.value,onMouseenter:L,onMouseleave:A,onFocusin:L,onFocusout:A,onEscape:C,onLeave:A,onNavigate:D},null,8,["id","entry"])):Q("",!0),O[1]||(O[1]=w("span",{class:"flex-1","aria-hidden":"true"},null,-1)),s(n)&&!s(a)?(m(),y("button",{key:1,type:"button","data-sidebar-expand":"","aria-label":s(g)("backend::lang.nav.expand"),title:s(g)("backend::lang.nav.expand"),class:"mb-1 flex size-10 items-center justify-center rounded-inner text-side-text transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:I},[N(s(Gg),{size:20,"aria-hidden":"true"})],8,D3)):Q("",!0),s(c2)?(m(),j(s(Vn),{key:2,to:"/settings","data-rail-settings":"","aria-current":d.value?"page":void 0,class:ve([d.value?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"])},{default:q(()=>[N(s(Zg),{size:20,"aria-hidden":"true"}),w("span",O3,$(s(g)("backend::lang.nav.settings")),1)]),_:1},8,["aria-current","class"])):Q("",!0)],8,E3))}}),I3=["aria-label"],R3={class:"mb-3.5 flex h-10 items-center justify-between gap-2 pl-2"},q3={class:"truncate text-[16px] font-bold"},L3=["aria-label","title"],N3=ae({__name:"SectionPanel",props:{entry:{}},setup(e){const t=e,n=Mn(),a=_(()=>Zl(n.path)),r=_(()=>t.entry.sideMenu.flatMap(o=>{const i=zn(o.controller);return i?[{item:o,to:i,icon:ws(o.icon),current:a.value===o.controller}]:[]}));function l(){yf(!0),Je(()=>document.querySelector("[data-sidebar-expand]")?.focus())}return(o,i)=>(m(),y("aside",{"aria-label":s(g)("backend::lang.nav.sections"),class:"sticky top-0 flex h-screen w-panel shrink-0 flex-col gap-0.5 self-start overflow-y-auto border-r border-border bg-surface px-3 py-3.5"},[w("div",R3,[w("span",q3,$(e.entry.label),1),w("button",{type:"button","data-sidebar-collapse":"","aria-label":s(g)("backend::lang.nav.collapse"),title:s(g)("backend::lang.nav.collapse"),class:"flex size-[30px] shrink-0 items-center justify-center rounded-tab text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:l},[N(s(mf),{size:18,"aria-hidden":"true"})],8,L3)]),(m(!0),y(pe,null,Ie(r.value,u=>(m(),j(s(Vn),{key:u.item.code,to:u.to,"aria-current":u.current?"page":void 0,class:ve([u.current?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-nav items-center gap-3 rounded-control px-3 no-underline transition-colors duration-150 ease-out"])},{default:q(()=>[(m(),j(zt(u.icon),{size:18,"aria-hidden":"true"})),w("span",null,$(u.item.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],8,I3))}}),B3=["aria-label"],F3={class:"mb-3.5 flex h-10 items-center justify-between gap-2 pl-2"},V3={class:"truncate text-[16px] font-bold"},z3=["aria-label","title"],j3=ae({__name:"SettingsPanel",props:{section:{}},setup(e){function t(){yf(!0),Je(()=>document.querySelector("[data-sidebar-expand]")?.focus())}return(n,a)=>(m(),y("aside",{"data-settings-panel":"","aria-label":s(g)("backend::lang.nav.sections"),class:"sticky top-0 flex h-screen w-panel shrink-0 flex-col gap-0.5 self-start overflow-y-auto border-r border-border bg-surface px-3 py-3.5"},[w("div",F3,[w("span",V3,$(e.section.category||s(g)("backend::lang.nav.settings")),1),w("button",{type:"button","data-sidebar-collapse":"","aria-label":s(g)("backend::lang.nav.collapse"),title:s(g)("backend::lang.nav.collapse"),class:"flex size-[30px] shrink-0 items-center justify-center rounded-tab text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:t},[N(s(mf),{size:18,"aria-hidden":"true"})],8,z3)]),(m(!0),y(pe,null,Ie(e.section.entries,r=>(m(),j(s(Vn),{key:r.code,to:s(pf)(r),"data-settings-panel-item":r.code,"aria-current":r.code===e.section.current.code?"page":void 0,class:ve([r.code===e.section.current.code?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-nav items-center gap-3 rounded-control px-3 no-underline transition-colors duration-150 ease-out"])},{default:q(()=>[(m(),j(zt(s(ws)(r.icon)),{size:18,"aria-hidden":"true"})),w("span",null,$(r.label),1)]),_:2},1032,["to","data-settings-panel-item","aria-current","class"]))),128))],8,B3))}}),U3=["aria-label"],H3={class:"flex min-w-0 items-center gap-2"},K3=["aria-current"],W3=ae({__name:"Breadcrumbs",setup(e){const t=Mn(),n=_(()=>{if(t.name==="account")return[{label:g("backend::lang.myaccount.menu_label")}];if(t.name==="plugins")return[{label:g("backend::lang.nav.settings"),to:"/settings"},{label:g("backend::lang.plugins.title")}];if(t.name==="settings"||t.name==="settings-form"){const i=[{label:g("backend::lang.nav.settings"),to:"/settings"}],u=t.name==="settings-form"?ns(String(t.params.code??"")):null;return u&&i.push({label:u.label}),i}const a=gs(String(t.params.vendor??""),String(t.params.plugin??"")),r=Zl(t.path);if(!a){const i=fu(r);if(!i)return[];const u=[{label:g("backend::lang.nav.settings"),to:"/settings"},{label:i.label,to:pf(i)}];return(t.name==="record"||t.name==="create")&&Po.value!==""&&u.push({label:Po.value}),u}const l=[{label:a.label,to:ff(a)??void 0}],o=a.sideMenu.find(i=>i.controller===r)??null;return o&&l.push({label:o.label,to:zn(o.controller)??void 0}),(t.name==="record"||t.name==="create")&&Po.value!==""&&l.push({label:Po.value}),l});return(a,r)=>(m(),y("nav",{"aria-label":s(g)("backend::lang.nav.breadcrumbs"),class:"min-w-0"},[w("ol",H3,[(m(!0),y(pe,null,Ie(n.value,(l,o)=>(m(),y("li",{key:o,"data-crumb":"",class:"flex min-w-0 items-center gap-2"},[o>0?(m(),j(s(_s),{key:0,size:14,class:"shrink-0 text-muted","aria-hidden":"true"})):Q("",!0),o===n.value.length-1||!l.to?(m(),y("span",{key:1,"aria-current":o===n.value.length-1?"page":void 0,class:ve([o===n.value.length-1?"font-semibold text-text":"text-muted","truncate"])},$(l.label),11,K3)):(m(),j(s(Vn),{key:2,to:l.to,class:"truncate text-muted no-underline transition-colors duration-150 ease-out hover:text-text"},{default:q(()=>[_e($(l.label),1)]),_:2},1032,["to"]))]))),128))])],8,U3))}});function Xm(e){return typeof e=="string"?`'${e}'`:new Y3().serialize(e)}const G3=" _-,;:!?.'\"()[]{}@*/\\&#%`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz",Ns=(function(){const e=new Uint8Array(128);for(let t=0;t<69;t++)e[G3.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function oc(e,t){if(e===t)return 0;const n=Math.min(e.length,t.length);let a=0;for(let r=0;ro?-1:1)}return e.length!==t.length?e.lengththis.compare(o[0],i[0]));let l=`${n}{`;for(let o=0;othis.compare(a,r)))}`}$Map(n){return this.serializeObjectEntries("Map",n.entries())}}for(const t of["Error","RegExp","URL"])e.prototype["$"+t]=function(n){return`${t}(${n})`};for(const t of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])e.prototype["$"+t]=function(n){return`${t}[${n.join(",")}]`};for(const t of["BigInt64Array","BigUint64Array"])e.prototype["$"+t]=function(n){return`${t}[${n.join("n,")}${n.length>0?"n":""}]`};return e})();function rs(e,t){return e===t||Xm(e)===Xm(t)}function Bs(e,t){let n=e;const a=t.toString(),r=a.indexOf("."),l=r>=0?a.length-r:0;if(l>0){const o=10**l;n=Math.round(n*o)/o}return n}function sc(e,t,n,a){t=Number(t),n=Number(n);const r=(e-(Number.isNaN(t)?0:t))%a;let l=Bs(Math.abs(r)*2>=a?e+Math.sign(r)*(a-Math.abs(r)):e-r,a);return Number.isNaN(t)?!Number.isNaN(n)&&l>n&&(l=Math.floor(Bs(n/a,a))*a):ln&&(l=t+Math.floor(Bs((n-t)/a,a))*a),l=Bs(l,a),l}function $t(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,a=Symbol(n);return[o=>{const i=it(a,o);if(i||i===null)return i;throw new Error(`Injection \`${a.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(ht(a,o),o)]}function Ut(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function gf(e,t,n){const a=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),a.dispatchEvent(r)}function gn(e){return e==null}function Qm(e,t){return gn(e)?!1:Array.isArray(e)?e.some(n=>rs(n,t)):rs(e,t)}function J3(e,t){var n;const a=Jl();return kn(()=>{a.value=e()},{...t,flush:(n=t?.flush)!==null&&n!==void 0?n:"sync"}),xt(a)}function ub(e,t){return Kd()?(Jh(e,t),!0):!1}function Z3(e){let t=!1,n;const a=Yh(!0);return((...r)=>(t||(n=a.run(()=>e(...r)),t=!0),n))}const Na=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const X3=e=>typeof e<"u",Q3=Object.prototype.toString,eE=e=>Q3.call(e)==="[object Object]",ev=tE();function tE(){var e,t,n;return Na&&!!(!((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function ic(e){return Array.isArray(e)?e:[e]}function nE(e){return pa()}function cb(e){if(!Na)return e;let t=0,n,a;const r=()=>{t-=1,a&&t<=0&&(a.stop(),n=void 0,a=void 0)};return((...l)=>(t+=1,a||(a=Yh(!0),n=a.run(()=>e(...l))),ub(r),n))}function aE(e){return Ln(Ct(e)?new Proxy({},{get(t,n,a){return s(Reflect.get(e.value,n,a))},set(t,n,a){return Ct(e.value[n])&&!Ct(a)?e.value[n].value=a:e.value[n]=a,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function rE(e){return aE(_(e))}function bf(e,...t){const n=t.flat(),a=n[0];return rE(()=>Object.fromEntries(typeof a=="function"?Object.entries(Vt(e)).filter(([r,l])=>!a(ln(l),r)):Object.entries(Vt(e)).filter(r=>!n.includes(r[0]))))}function lE(e,t=1e4){return j_((n,a)=>{let r=ln(e),l;const o=()=>setTimeout(()=>{r=ln(e),a()},ln(t));return ub(()=>{clearTimeout(l)}),{get(){return n(),r},set(i){r=i,a(),clearTimeout(l),l=o()}}})}function oE(e,t){nE()&&St(e,t)}function sE(e,t,n){return Ve(e,t,{...n,immediate:!0})}const _f=Na?window:void 0;function Yr(e){var t;const n=ln(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Wl(...e){const t=(a,r,l,o)=>(a.addEventListener(r,l,o),()=>a.removeEventListener(r,l,o)),n=_(()=>{const a=ic(ln(e[0])).filter(r=>r!=null);return a.every(r=>typeof r!="string")?a:void 0});return sE(()=>{var a,r;return[(a=(r=n.value)===null||r===void 0?void 0:r.map(l=>Yr(l)))!==null&&a!==void 0?a:[_f].filter(l=>l!=null),ic(ln(n.value?e[1]:e[0])),ic(s(n.value?e[2]:e[1])),ln(n.value?e[3]:e[2])]},([a,r,l,o],i,u)=>{if(!a?.length||!r?.length||!l?.length)return;const d=eE(o)?{...o}:o,c=a.flatMap(f=>r.flatMap(v=>l.map(p=>t(f,v,p,d))));u(()=>{c.forEach(f=>f())})},{flush:"post"})}function iE(){const e=Jl(!1),t=pa();return t&&wt(()=>{e.value=!0},t),e}function uE(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function cE(...e){let t,n,a={};e.length===3?(t=e[0],n=e[1],a=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],a=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=_f,eventName:l="keydown",passive:o=!1,dedupe:i=!1}=a,u=uE(t);return Wl(r,l,c=>{c.repeat&&ln(i)||u(c)&&n(c)},o)}function dE(e){return JSON.parse(JSON.stringify(e))}function Mt(e,t,n,a={}){var r,l;const{clone:o=!1,passive:i=!1,eventName:u,deep:d=!1,defaultValue:c,shouldEmit:f}=a,v=pa(),p=n||v?.emit||(v==null||(r=v.$emit)===null||r===void 0?void 0:r.bind(v))||(v==null||(l=v.proxy)===null||l===void 0||(l=l.$emit)===null||l===void 0?void 0:l.bind(v?.proxy));let h=u;t||(t="modelValue"),h=h||`update:${t.toString()}`;const k=E=>o?typeof o=="function"?o(E):dE(E):E,S=()=>X3(e[t])?k(e[t]):c,x=E=>{f?f(E)&&p(h,E):p(h,E)};if(i){const E=M(S());let L=!1;return Ve(()=>e[t],D=>{L||(L=!0,E.value=k(D),Je(()=>L=!1))}),Ve(E,D=>{!L&&(D!==e[t]||d)&&x(D)},{deep:d}),E}else return _({get(){return S()},set(E){x(E)}})}function xf(e){return e?e.flatMap(t=>t.type===pe?xf(t.children):[t]):[]}const fE=["INPUT","TEXTAREA"];function tv(e,t,n,a={}){if(!t||a.enableIgnoredElement&&fE.includes(t.nodeName))return null;const{arrowKeyOptions:r="both",attributeName:l="[data-reka-collection-item]",itemsArray:o=[],loop:i=!0,dir:u="ltr",preventScroll:d=!0,focus:c=!1}=a,[f,v,p,h,k,S]=[e.key==="ArrowRight",e.key==="ArrowLeft",e.key==="ArrowUp",e.key==="ArrowDown",e.key==="Home",e.key==="End"],x=p||h,E=f||v;if(!k&&!S&&(!x&&!E||r==="vertical"&&E||r==="horizontal"&&x))return null;const L=n?Array.from(n.querySelectorAll(l)):o;if(!L.length)return null;d&&e.preventDefault();let D=null;return E||x?D=db(L,t,{goForward:x?h:u==="ltr"?f:v,loop:i}):k?D=L.at(0)||null:S&&(D=L.at(-1)||null),c&&D?.focus(),D}function db(e,t,n,a=e.includes(t)?e.length:e.length+1){if(--a===0)return null;const r=e.indexOf(t);let l;if(r===-1?l=n.goForward?0:e.length-1:l=n.goForward?r+1:r-1,!n.loop&&(l<0||l>=e.length))return null;const o=(l+e.length)%e.length,i=e[o];return i?i.hasAttribute("disabled")&&i.getAttribute("disabled")!=="false"?db(e,i,n,a):i:null}const[hu]=$t("ConfigProvider");function uc(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function yd(e,t,n=".",a){if(!uc(t))return yd(e,{},n,a);const r={...t};for(const l of Object.keys(e)){if(l==="__proto__"||l==="constructor")continue;const o=e[l];o!=null&&(a&&a(r,l,o,n)||(Array.isArray(o)&&Array.isArray(r[l])?r[l]=[...o,...r[l]]:uc(o)&&uc(r[l])?r[l]=yd(o,r[l],(n?`${n}.`:"")+l.toString(),a):r[l]=o))}return r}function pE(e){return(...t)=>t.reduce((n,a)=>yd(n,a,"",e),{})}const fb=pE(),mE=cb(()=>{const e=M(new Map),t=M(),n=_(()=>{for(const o of e.value.values())if(o)return!0;return!1}),a=hu({scrollBody:M(!0)});let r=null;const l=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",ev&&r?.(),t.value=void 0};return Ve(n,(o,i)=>{if(!Na)return;if(!o){i&&l();return}t.value===void 0&&(t.value=document.body.style.overflow);const u=window.innerWidth-document.documentElement.clientWidth,d={padding:u,margin:0},c=a.scrollBody?.value?typeof a.scrollBody.value=="object"?fb({padding:a.scrollBody.value.padding===!0?u:a.scrollBody.value.padding,margin:a.scrollBody.value.margin===!0?u:a.scrollBody.value.margin},d):d:{padding:0,margin:0};u>0&&(document.body.style.paddingRight=typeof c.padding=="number"?`${c.padding}px`:String(c.padding),document.body.style.marginRight=typeof c.margin=="number"?`${c.margin}px`:String(c.margin),document.documentElement.style.setProperty("--scrollbar-width",`${u}px`),document.body.style.overflow="hidden"),ev&&(r=Wl(document,"touchmove",f=>vE(f),{passive:!1})),Je(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),e});function kf(e){const t=Math.random().toString(36).substring(2,7),n=mE();n.value.set(t,e??!1);const a=_({get:()=>n.value.get(t)??!1,set:r=>n.value.set(t,r)});return oE(()=>{n.value.delete(t)}),a}function pb(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Rl(e,t){return e-t*Math.floor(e/t)}const mb=1721426;function Nr(e,t,n,a){t=$s(e,t);let r=t-1,l=-2;return n<=2?l=0:nr(t)&&(l=-1),mb-1+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)+Math.floor((367*n-362)/12+l+a)}function nr(e){return e%4===0&&(e%100!==0||e%400===0)}function $s(e,t){return e==="BC"?1-t:t}function yu(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const hE={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Un{fromJulianDay(t){let n=t,a=n-mb,r=Math.floor(a/146097),l=Rl(a,146097),o=Math.floor(l/36524),i=Rl(l,36524),u=Math.floor(i/1461),d=Rl(i,1461),c=Math.floor(d/365),f=r*400+o*100+u*4+c+(o!==4&&c!==4?1:0),[v,p]=yu(f),h=n-Nr(v,p,1,1),k=2;n0&&t===Hn()&&!yb())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:a,day:r,hour:l,minute:o,second:i}=bb(e,t);return gb(n,a,r,l,o,i,0)-Math.floor(e/1e3)*1e3}const ov=new Map;function bb(e,t){let n=ov.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),ov.set(t,n));let a=n.formatToParts(new Date(e)),r={};for(let l of a)l.type!=="literal"&&(r[l.type]=l.value);return{year:r.era==="BC"||r.era==="B"?-r.year+1:+r.year,month:+r.month,day:+r.day,hour:r.hour==="24"?0:+r.hour,minute:+r.minute,second:+r.second}}const sv=864e5;function $E(e,t,n,a){return(n===a?[n]:[n,a]).filter(l=>CE(e,t,l))}function CE(e,t,n){let a=bb(n,t);return e.year===a.year&&e.month===a.month&&e.day===a.day&&e.hour===a.hour&&e.minute===a.minute&&e.second===a.second}function wa(e,t,n="compatible"){let a=ca(e);if(t==="UTC")return Gl(a);if(t===Hn()&&n==="compatible"&&!yb()){a=cn(a,new Un);let u=new Date,d=$s(a.era,a.year);return u.setFullYear(d,a.month-1,a.day),u.setHours(a.hour,a.minute,a.second,a.millisecond),u.getTime()}let r=Gl(a),l=bd(r-sv,t),o=bd(r+sv,t),i=$E(a,t,r-l,r-o);if(i.length===1)return i[0];if(i.length>1)switch(n){case"compatible":case"earlier":return i[0];case"later":return i[i.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(r-l,r-o);case"compatible":case"later":return Math.max(r-l,r-o);case"reject":throw new RangeError("No such absolute time found")}}function _b(e,t,n="compatible"){return new Date(wa(e,t,n))}function $a(e,t){let n=bd(e,t),a=new Date(e+n),r=a.getUTCFullYear(),l=a.getUTCMonth()+1,o=a.getUTCDate(),i=a.getUTCHours(),u=a.getUTCMinutes(),d=a.getUTCSeconds(),c=a.getUTCMilliseconds();return new Pa(r<1?"BC":"AD",r<1?-r+1:r,l,o,t,n,i,u,d,c)}function SE(e){return new yt(e.calendar,e.era,e.year,e.month,e.day)}function ca(e,t){let n=0,a=0,r=0,l=0;if("timeZone"in e)({hour:n,minute:a,second:r,millisecond:l}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:a,second:r,millisecond:l}=t),new dr(e.calendar,e.era,e.year,e.month,e.day,n,a,r,l)}function cn(e,t){if($f(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),a=e.copy();return a.calendar=t,a.era=n.era,a.year=n.year,a.month=n.month,a.day=n.day,jr(a),a}function Cf(e,t,n){if(e instanceof Pa)return e.timeZone===t?e:bu(e,t);let a=wa(e,t,n);return $a(a,t)}function EE(e){let t=Gl(e)-e.offset;return new Date(t)}function bu(e,t){let n=Gl(e)-e.offset;return cn($a(n,t),e.calendar)}const xo=36e5;function _u(e,t){let n=e.copy(),a="hour"in n?$b(n,t):0;_d(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,xd(n),xb(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=a,AE(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let r=n.calendar.getYearsInEra(n);if(n.year>r){let o=n.calendar.isInverseEra?.(n);n.year=r,n.month=o?1:n.calendar.getMonthsInYear(n),n.day=o?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let l=n.calendar.getMonthsInYear(n);return n.month>l&&(n.month=l,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function _d(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function xd(e){for(;e.month<1;)_d(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,_d(e,1)}function AE(e){for(;e.day<1;)e.month--,xd(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,xd(e)}function xb(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function jr(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),xb(e)}function Sf(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function kb(e,t){return _u(e,Sf(t))}function Ef(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),jr(n),n}function ls(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),wb(n),n}function TE(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Fs(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Fs(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Fs(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Fs(e.hour,24),t}function wb(e){e.millisecond=Math.max(0,Math.min(e.millisecond,999)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Fs(e,t){let n=e%t;return n<0&&(n+=t),n}function $b(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,TE(e)}function Cb(e,t){let n=e.copy();return $b(n,t),n}function DE(e,t){return Cb(e,Sf(t))}function Af(e,t,n,a){let r=e.copy();switch(t){case"era":{let l=e.calendar.getEras(),o=l.indexOf(e.era);if(o<0)throw new Error("Invalid era: "+e.era);o=Ca(o,n,0,l.length-1,a?.round),r.era=l[o],jr(r);break}case"year":r.calendar.isInverseEra?.(r)&&(n=-n),r.year=Ca(e.year,n,-1/0,9999,a?.round),r.year===-1/0&&(r.year=1),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e);break;case"month":r.month=Ca(e.month,n,1,e.calendar.getMonthsInYear(e),a?.round);break;case"day":r.day=Ca(e.day,n,1,e.calendar.getDaysInMonth(e),a?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(r),jr(r),r}function Tf(e,t,n,a){let r=e.copy();switch(t){case"hour":{let l=e.hour,o=0,i=23;if(a?.hourCycle===12){let u=l>=12;o=u?12:0,i=u?23:11}r.hour=Ca(l,n,o,i,a?.round);break}case"minute":r.minute=Ca(e.minute,n,0,59,a?.round);break;case"second":r.second=Ca(e.second,n,0,59,a?.round);break;case"millisecond":r.millisecond=Ca(e.millisecond,n,0,999,a?.round);break;default:throw new Error("Unsupported field "+t)}return r}function Ca(e,t,n,a,r=!1){if(r){e+=Math.sign(t),e0?e=Math.ceil(e/l)*l:e=Math.floor(e/l)*l,e>a&&(e=n)}else e+=t,ea&&(e=n+(e-a-1));return e}function Sb(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let r=_u(ca(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=wa(r,e.timeZone)}else n=Gl(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let a=$a(n,e.timeZone);return cn(a,e.calendar)}function OE(e,t){return Sb(e,Sf(t))}function ME(e,t,n,a){switch(t){case"hour":{let r=0,l=23;if(a?.hourCycle===12){let h=e.hour>=12;r=h?12:0,l=h?23:11}let o=ca(e),i=cn(ls(o,{hour:r}),new Un),u=[wa(i,e.timeZone,"earlier"),wa(i,e.timeZone,"later")].filter(h=>$a(h,e.timeZone).day===i.day)[0],d=cn(ls(o,{hour:l}),new Un),c=[wa(d,e.timeZone,"earlier"),wa(d,e.timeZone,"later")].filter(h=>$a(h,e.timeZone).day===d.day).pop(),f=Gl(e)-e.offset,v=Math.floor(f/xo),p=f%xo;return f=Ca(v,n,Math.floor(u/xo),Math.floor(c/xo),a?.round)*xo+p,cn($a(f,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Tf(e,t,n,a);case"era":case"year":case"month":case"day":{let r=Af(ca(e),t,n,a),l=wa(r,e.timeZone);return cn($a(l,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function PE(e,t,n){let a=ca(e),r=ls(Ef(a,t),t);if(r.compare(a)===0)return e;let l=wa(r,e.timeZone,n);return cn($a(l,e.timeZone),e.calendar)}const IE=/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,RE=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,Eb=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function qE(e){let t=e.match(IE);if(!t)throw new Error("Invalid ISO 8601 time string: "+e);return new aa(Jt(t[1],0,23),t[2]?Jt(t[2],0,59):0,t[3]?Jt(t[3],0,59):0,t[4]?Jt(t[4],0,1/0)*1e3:0)}function Ab(e){let t=e.match(RE);if(!t)throw Eb.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let n=new yt(Jt(t[1],0,9999),Jt(t[2],1,12),1);return n.day=Jt(t[3],1,n.calendar.getDaysInMonth(n)),n}function iv(e,t){let n=e.match(Eb);if(!n)throw new Error("Invalid ISO 8601 date time string: "+e);let a=Jt(n[1],-9999,9999),r=a<1?"BC":"AD",l=new Pa(r,a<1?-a+1:a,Jt(n[2],1,12),1,t,0,n[4]?Jt(n[4],0,23):0,n[5]?Jt(n[5],0,59):0,n[6]?Jt(n[6],0,59):0,n[7]?Jt(n[7],0,1/0)*1e3:0);return l.day=Jt(n[3],0,l.calendar.getDaysInMonth(l)),n[8]&&(l.offset=Jt(n[8],-23,23)*36e5+Jt(n[9]??"0",0,59)*6e4),bu(l,t)}function Jt(e,t,n){let a=Number(e);if(an)throw new RangeError(`Value out of range: ${t} <= ${a} <= ${n}`);return a}function Tb(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Db(e){let t=cn(e,new Un),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Ob(e){return`${Db(e)}T${Tb(e)}`}function LE(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),a=Math.floor(e%36e5/6e4),r=Math.floor(e%36e5%6e4/1e3),l=`${t}${String(n).padStart(2,"0")}:${String(a).padStart(2,"0")}`;return r!==0&&(l+=`:${String(r).padStart(2,"0")}`),l}function NE(e){return`${Ob(e)}${LE(e.offset)}[${e.timeZone}]`}function Df(e){let t=typeof e[0]=="object"?e.shift():new Un,n;if(typeof e[0]=="string")n=e.shift();else{let o=t.getEras();n=o[o.length-1]}let a=e.shift(),r=e.shift(),l=e.shift();return[t,n,a,r,l]}class yt{#e;constructor(...t){let[n,a,r,l,o]=Df(t);this.calendar=n,this.era=a,this.year=r,this.month=l,this.day=o,jr(this)}copy(){return this.era?new yt(this.calendar,this.era,this.year,this.month,this.day):new yt(this.calendar,this.year,this.month,this.day)}add(t){return _u(this,t)}subtract(t){return kb(this,t)}set(t){return Ef(this,t)}cycle(t,n,a){return Af(this,t,n,a)}toDate(t){return _b(this,t)}toString(){return Db(this)}compare(t){return vb(this,t)}}class aa{#e;constructor(t=0,n=0,a=0,r=0){this.hour=t,this.minute=n,this.second=a,this.millisecond=r,wb(this)}copy(){return new aa(this.hour,this.minute,this.second,this.millisecond)}add(t){return Cb(this,t)}subtract(t){return DE(this,t)}set(t){return ls(this,t)}cycle(t,n,a){return Tf(this,t,n,a)}toString(){return Tb(this)}compare(t){return hb(this,t)}}class dr{#e;constructor(...t){let[n,a,r,l,o]=Df(t);this.calendar=n,this.era=a,this.year=r,this.month=l,this.day=o,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,jr(this)}copy(){return this.era?new dr(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new dr(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return _u(this,t)}subtract(t){return kb(this,t)}set(t){return Ef(ls(this,t),t)}cycle(t,n,a){switch(t){case"era":case"year":case"month":case"day":return Af(this,t,n,a);default:return Tf(this,t,n,a)}}toDate(t,n){return _b(this,t,n)}toString(){return Ob(this)}compare(t){let n=vb(this,t);return n===0?hb(this,ca(t)):n}}class Pa{#e;constructor(...t){let[n,a,r,l,o]=Df(t),i=t.shift(),u=t.shift();this.calendar=n,this.era=a,this.year=r,this.month=l,this.day=o,this.timeZone=i,this.offset=u,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,jr(this)}copy(){return this.era?new Pa(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Pa(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Sb(this,t)}subtract(t){return OE(this,t)}set(t,n){return PE(this,t,n)}cycle(t,n,a){return ME(this,t,n,a)}toDate(){return EE(this)}toString(){return NE(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Cf(t,this.timeZone).toDate().getTime()}}const Ll=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],BE=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],ii=[1867,1911,1925,1988,2018],er=["meiji","taisho","showa","heisei","reiwa"];function uv(e){const t=Ll.findIndex(([n,a,r])=>e.year=0){let[,r,l]=Ll[n];t.month=Math.max(r,t.month),t.month===r&&(t.day=Math.max(l,t.day))}}getEras(){return er}getYearsInEra(t){let n=er.indexOf(t.era),a=Ll[n],r=Ll[n+1];if(r==null)return 9999-a[0]+1;let l=r[0]-a[0];return(t.month0?["minguo",t]:["before_minguo",1-t]}class zE extends Un{fromJulianDay(t){let n=super.fromJulianDay(t),a=$s(n.era,n.year),[r,l]=fv(a);return new yt(this,r,l,n.month,n.day)}toJulianDay(t){return super.toJulianDay(pv(t))}getEras(){return["before_minguo","minguo"]}balanceDate(t){let[n,a]=fv(Pb(t));t.era=n,t.year=a}isInverseEra(t){return t.era==="before_minguo"}getDaysInMonth(t){return super.getDaysInMonth(pv(t))}getYearsInEra(t){return t.era==="before_minguo"?9999:9999-Ii}constructor(...t){super(...t),this.identifier="roc"}}function pv(e){let[t,n]=yu(Pb(e));return new yt(t,n,e.month,e.day)}const mv=1948320,vv=[0,31,62,93,124,155,186,216,246,276,306,336];class jE{fromJulianDay(t){let n=t-mv,a=1+Math.floor((33*n+3)/12053),r=365*(a-1)+Math.floor((8*a+21)/33),l=n-r,o=l<216?Math.floor(l/31):Math.floor((l-6)/30),i=l-vv[o]+1;return new yt(this,a,o+1,i)}toJulianDay(t){let n=mv-1+365*(t.year-1)+Math.floor((8*t.year+21)/33);return n+=vv[t.month-1],n+=t.day,n}getMonthsInYear(){return 12}getDaysInMonth(t){return t.month<=6?31:t.month<=11||Rl(25*t.year+11,33)<8?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}const pc=78,hv=80;class UE extends Un{fromJulianDay(t){let n=super.fromJulianDay(t),a=n.year-pc,r=t-Nr(n.era,n.year,1,1),l;r=8&&(o+=(t.month-7)*30),o+=t.day-1,o)}getDaysInMonth(t){return t.month===1&&nr(t.year+pc)||t.month>=2&&t.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...t){super(...t),this.identifier="indian"}}const Ri=1948440,yv=1948439,En=1300,pl=1600,HE=460322;function qi(e,t,n,a){return a+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function Ib(e,t,n){let a=Math.floor((30*(n-t)+10646)/10631),r=Math.min(12,Math.ceil((n-(29+qi(t,a,1,1)))/29.5)+1),l=n-qi(t,a,r,1)+1;return new yt(e,a,r,l)}function gv(e){return(14+11*e)%30<11}class Of{fromJulianDay(t){return Ib(this,Ri,t)}toJulianDay(t){return qi(Ri,t.year,t.month,t.day)}getDaysInMonth(t){let n=29+t.month%2;return t.month===12&&gv(t.year)&&n++,n}getMonthsInYear(){return 12}getDaysInYear(t){return gv(t.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class KE extends Of{fromJulianDay(t){return Ib(this,yv,t)}toJulianDay(t){return qi(yv,t.year,t.month,t.day)}constructor(...t){super(...t),this.identifier="islamic-tbla"}}const WE="qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";let kd,Nl;function ui(e){return HE+Nl[e-En]}function Io(e,t){let n=e-En,a=1<<11-(t-1);return(kd[n]&a)===0?29:30}function bv(e,t){let n=ui(e);for(let a=1;at.charCodeAt(0)).buffer)),!Nl){Nl=new Uint32Array(pl-En+1);let t=0;for(let n=En;n<=pl;n++){Nl[n-En]=t;for(let a=1;a<=12;a++)t+=Io(n,a)}}}fromJulianDay(t){let n=t-Ri,a=ui(En),r=ui(pl);if(nr)return super.fromJulianDay(t);{let l=En-1,o=1,i=1;for(;i>0;){l++,i=n-ui(l)+1;let u=_v(l);if(i===u){o=12;break}else if(id;)i-=d,o++,d=Io(l,o);break}}return new yt(this,l,o,n-bv(l,o)+1)}}toJulianDay(t){return t.yearpl?super.toJulianDay(t):Ri+bv(t.year,t.month)+(t.day-1)}getDaysInMonth(t){return t.yearpl?super.getDaysInMonth(t):Io(t.year,t.month)}getDaysInYear(t){return t.yearpl?super.getDaysInYear(t):_v(t.year)}}const xv=347997,Rb=1080,qb=24*Rb,YE=29,JE=12*Rb+793,ZE=YE*qb+JE;function Lr(e){return Rl(e*7+1,19)<7}function ci(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,a=t*29+Math.floor(n/25920);return Rl(3*(a+1),7)<3&&(a+=1),a}function XE(e){let t=ci(e-1),n=ci(e);return ci(e+1)-n===356?2:n-t===382?1:0}function Ko(e){return ci(e)+XE(e)}function Lb(e){return Ko(e+1)-Ko(e)}function QE(e){let t=Lb(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function Vs(e,t){if(t>=6&&!Lr(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=QE(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?Lr(e)?30:0:30}class eA{fromJulianDay(t){let n=t-xv,a=n*qb/ZE,r=Math.floor((19*a+234)/235)+1,l=Ko(r),o=Math.floor(n-l);for(;o<1;)r--,l=Ko(r),o=Math.floor(n-l);let i=1,u=0;for(;u6?t.month--:!Lr(n.year)&&Lr(t.year)&&n.month>6&&t.month++)}constructor(){this.identifier="hebrew"}}const wd=1723856,kv=1824665,$d=5500;function Wo(e,t,n,a){return e+365*t+Math.floor(t/4)+30*(n-1)+a-1}function Mf(e,t){let n=Math.floor(4*(t-e)/1461);t>=Wo(e,n+1,1,1)&&n++;let a=1+Math.floor((t-Wo(e,n,1,1))/30),r=t+1-Wo(e,n,a,1);return[n,a,r]}function Nb(e){return Math.floor(e%4/3)}function Bb(e,t){return t%13!==0?30:Nb(e)+5}class Pf{fromJulianDay(t){let[n,a,r]=Mf(wd,t),l="AM";return n<=0&&(l="AA",n+=$d),new yt(this,l,n,a,r)}toJulianDay(t){let n=t.year;return t.era==="AA"&&(n-=$d),Wo(wd,n,t.month,t.day)}getDaysInMonth(t){return Bb(t.year,t.month)}getMonthsInYear(){return 13}getDaysInYear(t){return 365+Nb(t.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(t){return t.era==="AA"?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class tA extends Pf{fromJulianDay(t){let[n,a,r]=Mf(wd,t);return n+=$d,new yt(this,"AA",n,a,r)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...t){super(...t),this.identifier="ethioaa"}}class nA extends Pf{fromJulianDay(t){let[n,a,r]=Mf(kv,t),l="CE";return n<=0&&(l="BCE",n=1-n),new yt(this,l,n,a,r)}toJulianDay(t){let n=t.year;return t.era==="BCE"&&(n=1-n),Wo(kv,n,t.month,t.day)}getDaysInMonth(t){let n=t.year;return t.era==="BCE"&&(n=1-n),Bb(n,t.month)}isInverseEra(t){return t.era==="BCE"}balanceDate(t){t.year<=0&&(t.era=t.era==="BCE"?"CE":"BCE",t.year=1-t.year)}getEras(){return["BCE","CE"]}getYearsInEra(t){return t.era==="BCE"?9999:9715}constructor(...t){super(...t),this.identifier="coptic"}}function aA(e){switch(e){case"buddhist":return new VE;case"ethiopic":return new Pf;case"ethioaa":return new tA;case"coptic":return new nA;case"hebrew":return new eA;case"indian":return new UE;case"islamic-civil":return new Of;case"islamic-tbla":return new KE;case"islamic-umalqura":return new GE;case"japanese":return new FE;case"persian":return new jE;case"roc":return new zE;default:return new Un}}let mc=new Map;class In{constructor(t,n={}){this.formatter=Fb(t,n),this.options=n}format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n= start date");let a=this.formatter.formatToParts(t),r=this.formatter.formatToParts(n);return[...a.map(l=>({...l,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(l=>({...l,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return oA()&&(this.resolvedHourCycle||(this.resolvedHourCycle=sA(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}}const rA={true:{ja:"h11"},false:{}};function Fb(e,t={}){if(typeof t.hour12=="boolean"&&lA()){t={...t};let r=rA[String(t.hour12)][e.split("-")[0]],l=t.hour12?"h12":"h23";t.hourCycle=r??l,delete t.hour12}let n=e+(t?Object.entries(t).sort((r,l)=>r[0]l.type==="hour").value,10),r=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(l=>l.type==="hour").value,10);if(a===0&&r===23)return"h23";if(a===24&&r===23)return"h24";if(a===0&&r===11)return"h11";if(a===12&&r===11)return"h12";throw new Error("Unexpected hour cycle result")}function An(e,t=Hn()){return os(e)?e.toDate():e.toDate(t)}function iA(e){return e instanceof dr}function os(e){return e instanceof Pa}function Cd(e){return iA(e)||os(e)}function or(e){if(e instanceof Date){const t=e.getFullYear(),n=e.getMonth()+1;return new Date(t,n,0).getDate()}else return e.set({day:100}).day}function ar(e,t){return e.compare(t)<0}function yc(e,t){return e.compare(t)>0}function uA(e,t,n){const a=gu(e,n,"sun");return t>a?e.subtract({days:a+7-t}):t===a?e:e.subtract({days:a-t})}function cA(e,t,n){const a=gu(e,n,"sun"),r=t===0?6:t-1;return a===r?e:a>r?e.add({days:7-a+r}):e.add({days:r-a})}function If(e){const{defaultValue:t,defaultPlaceholder:n,granularity:a="day",locale:r="en"}=e;if(Array.isArray(t)&&t.length)return t.at(-1).copy();if(t&&!Array.isArray(t))return t.copy();if(n)return n.copy();const l=new Date,o=l.getFullYear(),i=l.getMonth()+1,u=l.getDate(),d=["hour","minute","second"],c=new In(r),f=aA(c.resolvedOptions().calendar);return d.includes(a??"day")?cn(new dr(o,i,u,0,0,0),f):cn(new yt(o,i,u),f)}function dA(e){const{defaultValue:t,defaultPlaceholder:n}=e;return t?t.copy():n?n.copy():new aa(0,0,0)}function fA(e,t){const n=[];for(let a=0;at.set({day:x+1})),i=gd(t),u=rv(t),d=uA(i,n,r),c=cA(u,n,r),f=wv(d.subtract({days:1}),i),v=wv(u,c.add({days:1})),p=f.length+o.length+v.length;if(a&&p<42){const S=42-p;let x=v.at(-1);x||(x=rv(t));const E=Array.from({length:S},(L,D)=>{const A=D+1;return x.add({days:A})});v.push(...E)}const h=f.concat(o,v),k=fA(h,7);return{value:t,cells:h,rows:k}}function Or(e){const{numberOfMonths:t,dateObj:n,...a}=e,r=[];if(!t||t===1)return r.push(bc({...a,dateObj:n})),r;r.push(bc({...a,dateObj:n}));for(let l=1;l({label:u(An(S.set({month:E}))),value:E}))}function c(S,x={}){return new In(n.value,{...t,year:"numeric",...x}).format(S)}function f(S,x){return os(S)?new In(n.value,{...t,...x,timeZone:S.timeZone}).formatToParts(An(S)):new In(n.value,{...t,...x}).formatToParts(An(S))}function v(S,x="narrow"){return new In(n.value,{...t,weekday:x}).format(S)}function p(S){const E=new In(n.value,{...t,hour:"numeric",minute:"numeric"}).formatToParts(S).find(L=>L.type==="dayPeriod")?.value;return E==="PM"||E==="pm"||E==="p.m."?"PM":"AM"}const h={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};function k(S,x,E={}){const L={...h,...E},A=f(S,L).find(R=>R.type===x);return A?A.value:""}return{setLocale:r,getLocale:a,fullMonth:u,fullYear:c,fullMonthAndYear:i,toParts:f,custom:l,part:k,dayPeriod:p,selectedDate:o,dayOfWeek:v,getMonths:d}}function ma(e){const t=hu({dir:M("ltr")});return _(()=>e?.value||t.dir?.value||"ltr")}function Jr(e){const t=pa(),n=t?.type.emits,a={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(r=>{a[Lo(Wt(r))]=(...l)=>e(r,...l)}),a}let _c=0;function Hb(){kn(e=>{if(!Na)return;const t=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",t[0]??$v()),document.body.insertAdjacentElement("beforeend",t[1]??$v()),_c++,e(()=>{_c===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),_c--})})}function $v(){const e=document.createElement("span");return e.setAttribute("data-reka-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function qf(e){return _(()=>ln(e)?!!Yr(e)?.closest("form"):!0)}function Ye(){const e=pa(),t=M(),n=_(()=>a());Zd(()=>{n.value!==a()&&F_(t)});function a(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:Yr(t)}const r=Object.assign({},e.exposed),l={};for(const i in e.props)Object.defineProperty(l,i,{enumerable:!0,configurable:!0,get:()=>e.props[i]});if(Object.keys(r).length>0)for(const i in r)Object.defineProperty(l,i,{enumerable:!0,configurable:!0,get:()=>r[i]});Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=l;function o(i){if(t.value=i,!!i&&(Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>i instanceof Element?i:i.$el}),!(i instanceof Element)&&!Object.hasOwn(i,"$el"))){const u=i.$.exposed,d=Object.assign({},l);for(const c in u)Object.defineProperty(d,c,{enumerable:!0,configurable:!0,get:()=>u[c]});e.exposed=d}}return{forwardRef:o,currentRef:t,currentElement:n}}function xu(e){const t=pa(),n=Object.keys(t?.type.props??{}).reduce((r,l)=>{const o=(t?.type.props[l]).default;return o!==void 0&&(r[l]=o),r},{}),a=K_(e);return _(()=>{const r={},l=t?.vnode.props??{};return Object.keys(l).forEach(o=>{r[Wt(o)]=l[o]}),Object.keys({...n,...r}).reduce((o,i)=>(a.value[i]!==void 0&&(o[i]=a.value[i]),o),{})})}function va(e,t){const n=xu(e),a=t?Jr(t):{};return _(()=>({...n.value,...a}))}var vA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ml=new WeakMap,zs=new WeakMap,js={},xc=0,Kb=function(e){return e&&(e.host||Kb(e.parentNode))},hA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=Kb(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},yA=function(e,t,n,a){var r=hA(t,Array.isArray(e)?e:[e]);js[n]||(js[n]=new WeakMap);var l=js[n],o=[],i=new Set,u=new Set(r),d=function(f){!f||i.has(f)||(i.add(f),d(f.parentNode))};r.forEach(d);var c=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(v){if(i.has(v))c(v);else try{var p=v.getAttribute(a),h=p!==null&&p!=="false",k=(ml.get(v)||0)+1,S=(l.get(v)||0)+1;ml.set(v,k),l.set(v,S),o.push(v),k===1&&h&&zs.set(v,!0),S===1&&v.setAttribute(n,"true"),h||v.setAttribute(a,"true")}catch(x){console.error("aria-hidden: cannot operate on ",v,x)}})};return c(t),i.clear(),xc++,function(){o.forEach(function(f){var v=ml.get(f)-1,p=l.get(f)-1;ml.set(f,v),l.set(f,p),v||(zs.has(f)||f.removeAttribute(a),zs.delete(f)),p||f.removeAttribute(n)}),xc--,xc||(ml=new WeakMap,ml=new WeakMap,zs=new WeakMap,js={})}},gA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=vA(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),yA(a,r,n,"aria-hidden")):function(){return null}};function Lf(e){let t;Ve(()=>Yr(e),n=>{let a=!1;try{a=!!n?.closest("[popover]:not(:popover-open)")}catch{}n&&!a?t=gA(n):t&&t()}),La(()=>{t&&t()})}function Ia(e,t="reka"){let n;const a=hu({useId:void 0});return a.useId?n=a.useId():n=Sy?.(),t?`${t}-${n}`:n}function Ql(){return{ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",SPACE_CODE:"Space"}}function ku(e){const t=hu({locale:M("en")});return _(()=>e?.value||t.locale?.value||"en")}function bA(e){const t=M(),n=_(()=>t.value?.width??0),a=_(()=>t.value?.height??0);return wt(()=>{const r=Yr(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const l=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let u,d;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;u=f.inlineSize,d=f.blockSize}else u=r.offsetWidth,d=r.offsetHeight;t.value={width:u,height:d}});return l.observe(r,{box:"border-box"}),()=>l.unobserve(r)}else t.value=void 0}),{width:n,height:a}}function _A(e,t){const n=M(e);function a(l){return t[n.value][l]??n.value}return{state:n,dispatch:l=>{n.value=a(l)}}}function xA(e){const t=lE("",1e3);return{search:t,handleTypeaheadSearch:(r,l)=>{t.value=t.value+r;{const o=Ut(),i=l.map(v=>({...v,textValue:v.value?.textValue??v.ref.textContent?.trim()??""})),u=i.find(v=>v.ref===o),d=i.map(v=>v.textValue),c=wA(d,t.value,u?.textValue),f=i.find(v=>v.textValue===c);return f&&f.ref.focus(),f?.ref}},resetTypeahead:()=>{t.value=""}}}function kA(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function wA(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let o=kA(e,Math.max(l,0));r.length===1&&(o=o.filter(d=>d!==n));const u=o.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return u!==n?u:void 0}function $A(e,t){const n=M({}),a=M("none"),r=M(e),l=e.value?"mounted":"unmounted";let o;const i=t.value?.ownerDocument.defaultView??_f,{state:u,dispatch:d}=_A(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),c=S=>{if(Na){const x=new CustomEvent(S,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(x)}};Ve(e,async(S,x)=>{const E=x!==S;if(await Je(),E){const L=a.value,D=Us(t.value);S?(d("MOUNT"),c("enter"),D==="none"&&c("after-enter")):D==="none"||D==="undefined"||n.value?.display==="none"?(d("UNMOUNT"),c("leave"),c("after-leave")):x&&L!==D?(d("ANIMATION_OUT"),c("leave")):(d("UNMOUNT"),c("after-leave"))}},{immediate:!0});const f=S=>{const x=Us(t.value),E=x.includes(CSS.escape(S.animationName)),L=u.value==="mounted"?"enter":"leave";if(S.target===t.value&&E&&(c(`after-${L}`),d("ANIMATION_END"),!r.value)){const D=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",o=i?.setTimeout(()=>{t.value?.style.animationFillMode==="forwards"&&(t.value.style.animationFillMode=D)})}S.target===t.value&&x==="none"&&d("ANIMATION_END")},v=S=>{S.target===t.value&&(a.value=Us(t.value))},p=Ve(t,(S,x)=>{S?(n.value=getComputedStyle(S),S.addEventListener("animationstart",v),S.addEventListener("animationcancel",f),S.addEventListener("animationend",f)):(d("ANIMATION_END"),o!==void 0&&i?.clearTimeout(o),x?.removeEventListener("animationstart",v),x?.removeEventListener("animationcancel",f),x?.removeEventListener("animationend",f))},{immediate:!0}),h=Ve(u,()=>{const S=Us(t.value);a.value=u.value==="mounted"?S:"none"});return La(()=>{p(),h()}),{isPresent:_(()=>["mounted","unmountSuspended"].includes(u.value))}}function Us(e){return e&&getComputedStyle(e).animationName||"none"}var Zr=ae({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){const{present:a,forceMount:r}=Vt(e),l=M(),{isPresent:o}=$A(a,l);n({present:o});let i=t.default({present:o.value});i=xf(i||[]);const u=pa();if(i&&i?.length>1){const d=u?.parent?.type.name?`<${u.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${d}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(c=>` - ${c}`).join(` -`)].join(` -`))}return()=>r.value||a.value||o.value?Dn(t.default({present:o.value})[0],{ref:d=>{const c=Yr(d);return typeof c?.hasAttribute>"u"||(c?.hasAttribute("data-reka-popper-content-wrapper")?l.value=c.firstElementChild:l.value=c),c}}):null}});const Sd=ae({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;const a=xf(n.default()),r=a.findIndex(u=>u.type!==Bn);if(r===-1)return a;const l=a[r];delete l.props?.ref;const o=l.props?ze(t,l.props):t,i=sr({...l,props:{}},o);return a.length===1?i:(a[r]=i,a)}}}),CA=["area","img","input"],Qe=ae({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const a=e.asChild?"template":e.as;return typeof a=="string"&&CA.includes(a)?()=>Dn(a,t):a!=="template"?()=>Dn(e.as,t,{default:n.default}):()=>Dn(Sd,t,{default:n.default})}});function Ur(){const e=M(),t=_(()=>["#text","#comment"].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Yr(e));return{primitiveElement:e,currentElement:t}}const[Ba,SA]=$t("DialogRoot");var EA=ae({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const n=e,r=Mt(n,"open",t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),l=M(),o=M(),{modal:i}=Vt(n);return SA({open:r,modal:i,openModal:()=>{r.value=!0},onOpenChange:u=>{r.value=u},onOpenToggle:()=>{r.value=!r.value},contentId:"",titleId:"",descriptionId:"",triggerElement:l,contentElement:o}),(u,d)=>ge(u.$slots,"default",{open:s(r),close:()=>r.value=!1})}}),Xr=EA,AA=ae({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e;Ye();const n=Ba();return(a,r)=>(m(),j(s(Qe),ze(t,{type:a.as==="button"?"button":void 0,onClick:r[0]||(r[0]=l=>s(n).onOpenChange(!1))}),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["type"]))}}),Hr=AA;const TA="dismissableLayer.pointerDownOutside",DA="dismissableLayer.focusOutside";function Wb(e,t){if(!(t instanceof Element))return!1;const n=t.closest("[data-dismissable-layer]"),a=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),r=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(a===n||r.indexOf(a){});return kn(o=>{if(!Na||!ln(n))return;const i=async d=>{const c=d.target;if(!(!t?.value||!c)){if(Wb(t.value,c)){r.value=!1;return}if(d.target&&!r.value){let v=function(){gf(TA,e,f)};const f={originalEvent:d};d.pointerType==="touch"?(a.removeEventListener("click",l.value),l.value=v,a.addEventListener("click",l.value,{once:!0})):v()}else a.removeEventListener("click",l.value);r.value=!1}},u=window.setTimeout(()=>{a.addEventListener("pointerdown",i)},0);o(()=>{window.clearTimeout(u),a.removeEventListener("pointerdown",i),a.removeEventListener("click",l.value)})}),{onPointerDownCapture:()=>{ln(n)&&(r.value=!0)}}}function MA(e,t,n=!0){const a=t?.value?.ownerDocument??globalThis?.document,r=M(!1);return kn(l=>{if(!Na||!ln(n))return;const o=async i=>{if(!t?.value)return;await Je(),await Je();const u=i.target;!t.value||!u||Wb(t.value,u)||i.target&&!r.value&&gf(DA,e,{originalEvent:i})};a.addEventListener("focusin",o),l(()=>a.removeEventListener("focusin",o))}),{onFocusCapture:()=>{ln(n)&&(r.value=!0)},onBlurCapture:()=>{ln(n)&&(r.value=!1)}}}const mn=Ln({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var PA=ae({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=Ye(),o=_(()=>l.value?.ownerDocument??globalThis.document),i=_(()=>mn.layersRoot),u=_(()=>l.value?Array.from(i.value).indexOf(l.value):-1),d=_(()=>mn.layersWithOutsidePointerEventsDisabled.size>0),c=_(()=>{const p=Array.from(i.value),[h]=[...mn.layersWithOutsidePointerEventsDisabled].slice(-1),k=p.indexOf(h);return u.value>=k}),f=OA(async p=>{const h=[...mn.branches].some(k=>k?.contains(p.target));!c.value||h||(a("pointerDownOutside",p),a("interactOutside",p),await Je(),p.defaultPrevented||a("dismiss"))},l),v=MA(p=>{[...mn.branches].some(k=>k?.contains(p.target))||(a("focusOutside",p),a("interactOutside",p),p.defaultPrevented||a("dismiss"))},l);return cE("Escape",p=>{u.value===i.value.size-1&&(a("escapeKeyDown",p),p.defaultPrevented||a("dismiss"))}),Ve([l,()=>n.disableOutsidePointerEvents],([p,h],k,S)=>{p&&(h&&(mn.layersWithOutsidePointerEventsDisabled.size===0&&(mn.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),mn.layersWithOutsidePointerEventsDisabled.add(p),S(()=>{mn.layersWithOutsidePointerEventsDisabled.delete(p),mn.layersWithOutsidePointerEventsDisabled.size===0&&!gn(mn.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=mn.originalBodyPointerEvents)})),i.value.add(p))},{immediate:!0}),kn(p=>{p(()=>{l.value&&(i.value.delete(l.value),mn.layersWithOutsidePointerEventsDisabled.delete(l.value))})}),(p,h)=>(m(),j(s(Qe),{ref:s(r),"as-child":p.asChild,as:p.as,"data-dismissable-layer":"",style:bn({pointerEvents:d.value?c.value?"auto":"none":void 0}),onFocusCapture:s(v).onFocusCapture,onBlurCapture:s(v).onBlurCapture,onPointerdownCapture:s(f).onPointerDownCapture},{default:q(()=>[ge(p.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Nf=PA;const IA=Z3(()=>M([]));function RA(){const e=IA();return{add(t){const n=e.value[0];t!==n&&n?.pause(),e.value=Cv(e.value,t),e.value.unshift(t)},remove(t){e.value=Cv(e.value,t),e.value[0]?.resume()}}}function Cv(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}const kc="focusScope.autoFocusOnMount",wc="focusScope.autoFocusOnUnmount",Sv={bubbles:!1,cancelable:!0};function qA(e,{select:t=!1}={}){const n=Ut();for(const a of e)if(Za(a,{select:t}),Ut()!==n)return!0}function LA(e){const t=Gb(e),n=Ev(t,e),a=Ev(t.reverse(),e);return[n,a]}function Gb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ev(e,t){for(const n of e)if(!NA(n,{upTo:t}))return n}function NA(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function BA(e){return e instanceof HTMLInputElement&&"select"in e}function Za(e,{select:t=!1}={}){if(e&&e.focus){const n=Ut();e.focus({preventScroll:!0}),e!==n&&BA(e)&&t&&e.select()}}var FA=ae({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,a=t,{currentRef:r,currentElement:l}=Ye(),o=M(null),i=RA(),u=Ln({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});kn(c=>{if(!Na)return;const f=l.value;if(!n.trapped)return;function v(S){if(u.paused||!f)return;const x=S.target;f.contains(x)?o.value=x:Za(o.value,{select:!0})}function p(S){if(u.paused||!f)return;const x=S.relatedTarget;x!==null&&(f.contains(x)||Za(o.value,{select:!0}))}function h(S){const x=o.value;if(x===null||!S.some(D=>D.removedNodes.length>0))return;f.contains(x)||Za(f)}document.addEventListener("focusin",v),document.addEventListener("focusout",p);const k=new MutationObserver(h);f&&k.observe(f,{childList:!0,subtree:!0}),c(()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",p),k.disconnect()})}),kn(async c=>{const f=l.value;if(await Je(),!f)return;i.add(u);const v=Ut();if(!f.contains(v)){const h=new CustomEvent(kc,Sv);f.addEventListener(kc,k=>a("mountAutoFocus",k)),f.dispatchEvent(h),h.defaultPrevented||(qA(Gb(f),{select:!0}),Ut()===v&&Za(f))}c(()=>{f.removeEventListener(kc,S=>a("mountAutoFocus",S));const h=new CustomEvent(wc,Sv),k=S=>{a("unmountAutoFocus",S)};f.addEventListener(wc,k),f.dispatchEvent(h),f.setAttribute("data-focus-scope-unmounting",""),setTimeout(()=>{h.defaultPrevented||Za(v??document.body,{select:!0}),f.removeEventListener(wc,k),i.remove(u),f.removeAttribute("data-focus-scope-unmounting")},0)})});function d(c){if(!n.loop&&!n.trapped||u.paused)return;const f=c.key==="Tab"&&!c.altKey&&!c.ctrlKey&&!c.metaKey,v=Ut();if(f&&v){const p=c.currentTarget,[h,k]=LA(p);h&&k?!c.shiftKey&&v===k?(c.preventDefault(),n.loop&&Za(h,{select:!0})):c.shiftKey&&v===h&&(c.preventDefault(),n.loop&&Za(k,{select:!0})):v===p&&c.preventDefault()}}return(c,f)=>(m(),j(s(Qe),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":c.asChild,as:c.as,onKeydown:d},{default:q(()=>[ge(c.$slots,"default")]),_:3},8,["as-child","as"]))}}),Bf=FA;const VA="menu.itemSelect",Ed=["Enter"," "],zA=["ArrowDown","PageUp","Home"],Yb=["ArrowUp","PageDown","End"],jA=[...zA,...Yb];[...Ed],[...Ed];function Jb(e){return e?"open":"closed"}function Zb(e){return e==="indeterminate"}function Xb(e){return Zb(e)?"indeterminate":e?"checked":"unchecked"}function UA(e){const t=Ut();for(const n of e)if(n===t||(n.focus(),Ut()!==t))return}function HA(e,t){const{x:n,y:a}=e;let r=!1;for(let l=0,o=t.length-1;la!=c>a&&n<(d-i)*(a-u)/(c-u)+i&&(r=!r)}return r}function KA(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return HA(n,t)}function Li(e){return e.pointerType==="mouse"}var WA=ae({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=Ba(),{forwardRef:l,currentElement:o}=Ye();return r.titleId||=Ia(void 0,"reka-dialog-title"),r.descriptionId||=Ia(void 0,"reka-dialog-description"),wt(()=>{r.contentElement=o,Ut()!==document.body&&(r.triggerElement.value=Ut())}),(i,u)=>(m(),j(s(Bf),{"as-child":"",loop:"",trapped:n.trapFocus,onMountAutoFocus:u[5]||(u[5]=d=>a("openAutoFocus",d)),onUnmountAutoFocus:u[6]||(u[6]=d=>a("closeAutoFocus",d))},{default:q(()=>[N(s(Nf),ze({id:s(r).contentId,ref:s(l),as:i.as,"as-child":i.asChild,"disable-outside-pointer-events":i.disableOutsidePointerEvents,role:"dialog","aria-describedby":s(r).descriptionId,"aria-labelledby":s(r).titleId,"data-state":s(Jb)(s(r).open.value)},i.$attrs,{onDismiss:u[0]||(u[0]=d=>s(r).onOpenChange(!1)),onEscapeKeyDown:u[1]||(u[1]=d=>a("escapeKeyDown",d)),onFocusOutside:u[2]||(u[2]=d=>a("focusOutside",d)),onInteractOutside:u[3]||(u[3]=d=>a("interactOutside",d)),onPointerDownOutside:u[4]||(u[4]=d=>a("pointerDownOutside",d))}),{default:q(()=>[ge(i.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),Qb=WA,GA=ae({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=Ba(),l=Jr(a),{forwardRef:o,currentElement:i}=Ye();return Lf(i),(u,d)=>(m(),j(Qb,ze({...n,...s(l)},{ref:s(o),"trap-focus":s(r).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:d[0]||(d[0]=c=>{c.defaultPrevented||(c.preventDefault(),s(r).triggerElement.value?.focus())}),onPointerDownOutside:d[1]||(d[1]=c=>{const f=c.detail.originalEvent,v=f.button===0&&f.ctrlKey===!0;(f.button===2||v)&&c.preventDefault()}),onFocusOutside:d[2]||(d[2]=c=>{c.preventDefault()})}),{default:q(()=>[ge(u.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),YA=GA,JA=ae({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,r=Jr(t);Ye();const l=Ba(),o=M(!1),i=M(!1);return(u,d)=>(m(),j(Qb,ze({...n,...s(r)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{c.defaultPrevented||(o.value||s(l).triggerElement.value?.focus(),c.preventDefault()),o.value=!1,i.value=!1}),onInteractOutside:d[1]||(d[1]=c=>{c.defaultPrevented||(o.value=!0,c.detail.originalEvent.type==="pointerdown"&&(i.value=!0));const f=c.target;s(l).triggerElement.value?.contains(f)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&i.value&&c.preventDefault()})}),{default:q(()=>[ge(u.$slots,"default")]),_:3},16))}}),ZA=JA,XA=ae({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=Ba(),l=Jr(a),{forwardRef:o}=Ye();return(i,u)=>(m(),j(s(Zr),{present:i.forceMount||s(r).open.value},{default:q(()=>[s(r).modal.value?(m(),j(YA,ze({key:0,ref:s(o)},{...n,...s(l),...i.$attrs}),{default:q(()=>[ge(i.$slots,"default")]),_:3},16)):(m(),j(ZA,ze({key:1,ref:s(o)},{...n,...s(l),...i.$attrs}),{default:q(()=>[ge(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Qr=XA,QA=ae({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(e){const t=e;Ye();const n=Ba();return(a,r)=>(m(),j(s(Qe),ze(t,{id:s(n).descriptionId}),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["id"]))}}),fr=QA,e4=ae({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=Ba();return kf(!0),Ye(),(n,a)=>(m(),j(s(Qe),{as:n.as,"as-child":n.asChild,"data-state":s(t).open.value?"open":"closed",style:{"pointer-events":"auto"},onPointerdown:a[0]||(a[0]=ft(()=>{},["left","self","prevent"]))},{default:q(()=>[ge(n.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),t4=e4,n4=ae({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=Ba(),{forwardRef:n}=Ye();return(a,r)=>s(t)?.modal.value?(m(),j(s(Zr),{key:0,present:a.forceMount||s(t).open.value},{default:q(()=>[N(t4,ze(a.$attrs,{ref:s(n),as:a.as,"as-child":a.asChild}),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):Q("v-if",!0)}}),el=n4,a4=ae({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=iE();return(n,a)=>s(t)||n.forceMount?(m(),j(sx,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[ge(n.$slots,"default")],8,["to","disabled","defer"])):Q("v-if",!0)}}),wu=a4,r4=ae({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(wu),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),eo=r4,l4=ae({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(e){const t=e,n=Ba();return Ye(),(a,r)=>(m(),j(s(Qe),ze(t,{id:s(n).titleId}),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["id"]))}}),tl=l4;const[o4,s4]=$t("AlertDialogContent");var i4=ae({__name:"AlertDialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,r=Jr(t);Ye();const l=M();return s4({onCancelElementChange:o=>{l.value=o}}),(o,i)=>(m(),j(s(Qr),ze({...n,...s(r)},{role:"alertdialog",onPointerDownOutside:i[0]||(i[0]=ft(()=>{},["prevent"])),onInteractOutside:i[1]||(i[1]=ft(()=>{},["prevent"])),onOpenAutoFocus:i[2]||(i[2]=()=>{Je(()=>{l.value?.focus({preventScroll:!0})})})}),{default:q(()=>[ge(o.$slots,"default")]),_:3},16))}}),u4=i4,c4=ae({__name:"AlertDialogCancel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=o4(),{forwardRef:a,currentElement:r}=Ye();return wt(()=>{n.onCancelElementChange(r.value)}),(l,o)=>(m(),j(s(Hr),ze(t,{ref:s(a)}),{default:q(()=>[ge(l.$slots,"default")]),_:3},16))}}),d4=c4,f4=ae({__name:"AlertDialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(e){const t=e;return Ye(),(n,a)=>(m(),j(s(fr),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),p4=f4,m4=ae({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return Ye(),(n,a)=>(m(),j(s(el),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),v4=m4,h4=ae({__name:"AlertDialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(wu),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),y4=h4,g4=ae({__name:"AlertDialogRoot",props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1}},emits:["update:open"],setup(e,{emit:t}){const r=va(e,t);return Ye(),(l,o)=>(m(),j(s(Xr),ze(s(r),{modal:!0}),{default:q(i=>[ge(l.$slots,"default",nt(lt(i)))]),_:3},16))}}),b4=g4,_4=ae({__name:"AlertDialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(e){const t=e;return Ye(),(n,a)=>(m(),j(s(tl),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),x4=_4;const Av="data-reka-collection-item";function Ff(e={}){const{key:t="",isProvider:n=!1}=e,a=`${t}CollectionProvider`;let r;n?(r={collectionRef:M(),itemMap:M(new Map)},ht(a,r)):r=it(a);const l=(c=!1)=>{const f=r.collectionRef.value;if(!f)return[];const v=Array.from(f.querySelectorAll(`[${Av}]`)),h=Array.from(r.itemMap.value.values()).sort((k,S)=>v.indexOf(k.ref)-v.indexOf(S.ref));return c?h:h.filter(k=>k.ref.dataset.disabled!=="")},o=ae({name:"CollectionSlot",inheritAttrs:!1,setup(c,{slots:f,attrs:v}){const{primitiveElement:p,currentElement:h}=Ur();return Ve(h,()=>{r.collectionRef.value=h.value}),()=>Dn(Sd,{ref:p,...v},f)}}),i=ae({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(c,{slots:f,attrs:v}){const{primitiveElement:p,currentElement:h}=Ur();return kn(k=>{if(h.value){const S=pi(h.value);r.itemMap.value.set(S,{ref:h.value,value:c.value}),k(()=>r.itemMap.value.delete(S))}}),()=>Dn(Sd,{...v,[Av]:"",ref:p},f)}}),u=_(()=>Array.from(r.itemMap.value.values())),d=_(()=>r.itemMap.value.size);return{getItems:l,reactiveItems:u,itemMapSize:d,CollectionSlot:o,CollectionItem:i}}var k4=ae({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,n)=>(m(),j(s(Qe),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:q(()=>[ge(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),Vf=k4,w4=ae({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,{primitiveElement:n,currentElement:a}=Ur(),r=_(()=>t.checked??t.value);return Ve(r,(l,o)=>{if(!a.value)return;const i=a.value,u=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(u,"value").set;if(c&&l!==o){const f=new Event("input",{bubbles:!0}),v=new Event("change",{bubbles:!0});c.call(i,l),i.dispatchEvent(f),i.dispatchEvent(v)}}),(l,o)=>(m(),j(Vf,ze({ref_key:"primitiveElement",ref:n},{...t,...l.$attrs},{as:"input"}),null,16))}}),Tv=w4,$4=ae({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,n=_(()=>typeof t.value=="object"&&Array.isArray(t.value)&&t.value.length===0&&t.required),a=_(()=>typeof t.value=="string"||typeof t.value=="number"||typeof t.value=="boolean"||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value=="object"&&Array.isArray(t.value)?t.value.flatMap((r,l)=>typeof r=="object"?Object.entries(r).map(([o,i])=>({name:`${t.name}[${l}][${o}]`,value:i})):{name:`${t.name}[${l}]`,value:r}):t.value!==null&&typeof t.value=="object"&&!Array.isArray(t.value)?Object.entries(t.value).map(([r,l])=>({name:`${t.name}[${r}]`,value:l})):[]);return(r,l)=>(m(),y(pe,null,[Q(" We render single input if it's required "),n.value?(m(),j(Tv,ze({key:r.name},{...t,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(m(!0),y(pe,{key:1},Ie(a.value,o=>(m(),j(Tv,ze({key:o.name},{ref_for:!0},{...t,...r.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),zf=$4;const C4="rovingFocusGroup.onEntryFocus",S4={bubbles:!1,cancelable:!0},E4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function A4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function T4(e,t,n){const a=A4(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return E4[a]}function e1(e,t=!1){const n=Ut();for(const a of e)if(a===n||(a.focus({preventScroll:t}),Ut()!==n))return}function D4(e,t){return e.map((n,a)=>e[(t+a)%e.length])}const[t1,O4]=$t("PopperRoot");var M4=ae({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=M();return O4({anchor:t,onAnchorChange:n=>t.value=n}),(n,a)=>ge(n.$slots,"default")}}),n1=M4,P4=ae({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:a}=Ye(),r=t1();return ky(()=>{r.onAnchorChange(t.reference??a.value)}),(l,o)=>(m(),j(s(Qe),{ref:s(n),as:l.as,"as-child":l.asChild},{default:q(()=>[ge(l.$slots,"default")]),_:3},8,["as","as-child"]))}}),jf=P4;function I4(e){return e!==null}function R4(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:a,middlewareData:r}=t,o=r.arrow?.centerOffset!==0,i=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[d,c]=Ad(n),f={start:"0%",center:"50%",end:"100%"}[c],v=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+u/2;let h="",k="";return d==="bottom"?(h=o?f:`${v}px`,k=`${-u}px`):d==="top"?(h=o?f:`${v}px`,k=`${a.floating.height+u}px`):d==="right"?(h=`${-u}px`,k=o?f:`${p}px`):d==="left"&&(h=`${a.floating.width+u}px`,k=o?f:`${p}px`),{data:{x:h,y:k}}}}}function Ad(e){const[t,n="center"]=e.split("-");return[t,n]}const q4=["top","right","bottom","left"],pr=Math.min,Ea=Math.max,Ni=Math.round,Hs=Math.floor,Aa=e=>({x:e,y:e}),L4={left:"right",right:"left",bottom:"top",top:"bottom"};function a1(e,t,n){return Ea(e,pr(t,n))}function Ra(e,t){return typeof e=="function"?e(t):e}function mr(e){return e.split("-")[0]}function to(e){return e.split("-")[1]}function Uf(e){return e==="x"?"y":"x"}function Hf(e){return e==="y"?"height":"width"}function ra(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Kf(e){return Uf(ra(e))}function N4(e,t,n){n===void 0&&(n=!1);const a=to(e),r=Kf(e),l=Hf(r);let o=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(o=Bi(o)),[o,Bi(o)]}function B4(e){const t=Bi(e);return[Td(e),t,Td(t)]}function Td(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Dv=["left","right"],Ov=["right","left"],F4=["top","bottom"],V4=["bottom","top"];function z4(e,t,n){switch(e){case"top":case"bottom":return n?t?Ov:Dv:t?Dv:Ov;case"left":case"right":return t?F4:V4;default:return[]}}function j4(e,t,n,a){const r=to(e);let l=z4(mr(e),n==="start",a);return r&&(l=l.map(o=>o+"-"+r),t&&(l=l.concat(l.map(Td)))),l}function Bi(e){const t=mr(e);return L4[t]+e.slice(t.length)}function U4(e){var t,n,a,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(a=e.bottom)!=null?a:0,left:(r=e.left)!=null?r:0}}function r1(e){return typeof e!="number"?U4(e):{top:e,right:e,bottom:e,left:e}}function Fi(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}function Mv(e,t,n){let{reference:a,floating:r}=e;const l=ra(t),o=Kf(t),i=Hf(o),u=mr(t),d=l==="y",c=a.x+a.width/2-r.width/2,f=a.y+a.height/2-r.height/2,v=a[i]/2-r[i]/2;let p;switch(u){case"top":p={x:c,y:a.y-r.height};break;case"bottom":p={x:c,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:f};break;case"left":p={x:a.x-r.width,y:f};break;default:p={x:a.x,y:a.y}}const h=to(t);return h&&(p[o]+=v*(h==="end"?1:-1)*(n&&d?-1:1)),p}async function H4(e,t){var n;t===void 0&&(t={});const{x:a,y:r,platform:l,rects:o,elements:i,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:v=!1,padding:p=0}=Ra(t,e),h=r1(p),S=i[v?f==="floating"?"reference":"floating":f],x=Fi(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(S)))==null||n?S:S.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(i.floating)),boundary:d,rootBoundary:c,strategy:u})),E=f==="floating"?{x:a,y:r,width:o.floating.width,height:o.floating.height}:o.reference,L=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i.floating)),D=await(l.isElement==null?void 0:l.isElement(L))&&await(l.getScale==null?void 0:l.getScale(L))||{x:1,y:1},A=Fi(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:E,offsetParent:L,strategy:u}):E);return{top:(x.top-A.top+h.top)/D.y,bottom:(A.bottom-x.bottom+h.bottom)/D.y,left:(x.left-A.left+h.left)/D.x,right:(A.right-x.right+h.right)/D.x}}const K4=50,W4=async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:l=[],platform:o}=n,i=o.detectOverflow?o:{...o,detectOverflow:H4},u=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:f}=Mv(d,a,u),v=a,p=0;const h={};for(let k=0;k({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:l,platform:o,elements:i,middlewareData:u}=t,{element:d,padding:c=0}=Ra(e,t)||{};if(d==null)return{};const f=r1(c),v={x:n,y:a},p=Kf(r),h=Hf(p),k=await o.getDimensions(d),S=p==="y",x=S?"top":"left",E=S?"bottom":"right",L=S?"clientHeight":"clientWidth",D=l.reference[h]+l.reference[p]-v[p]-l.floating[h],A=v[p]-l.reference[p],R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let F=R?R[L]:0;(!F||!await(o.isElement==null?void 0:o.isElement(R)))&&(F=i.floating[L]||l.floating[h]);const W=D/2-A/2,C=F/2-k[h]/2-1,I=pr(f[x],C),z=pr(f[E],C),O=F-k[h]-z,B=F/2-k[h]/2+W,J=a1(I,B,O),K=!u.arrow&&to(r)!=null&&B!==J&&l.reference[h]/2-(BJ<=0)){var z,O;const J=(((z=l.flip)==null?void 0:z.index)||0)+1,K=F[J];if(K&&(!(f==="alignment"?E!==ra(K):!1)||I.every(ue=>ra(ue.placement)===E?ue.overflows[0]>0:!0)))return{data:{index:J,overflows:I},reset:{placement:K}};let H=(O=I.filter(le=>le.overflows[0]<=0).sort((le,ue)=>le.overflows[1]-ue.overflows[1])[0])==null?void 0:O.placement;if(!H)switch(p){case"bestFit":{var B;const le=(B=I.filter(ue=>{if(R){const we=ra(ue.placement);return we===E||we==="y"}return!0}).map(ue=>[ue.placement,ue.overflows.filter(we=>we>0).reduce((we,Oe)=>we+Oe,0)]).sort((ue,we)=>ue[1]-we[1])[0])==null?void 0:B[0];le&&(H=le);break}case"initialPlacement":H=i;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function Pv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Iv(e){return q4.some(t=>e[t]>=0)}const J4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:a}=t,{strategy:r="referenceHidden",...l}=Ra(e,t);switch(r){case"referenceHidden":{const o=await a.detectOverflow(t,{...l,elementContext:"reference"}),i=Pv(o,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Iv(i)}}}case"escaped":{const o=await a.detectOverflow(t,{...l,altBoundary:!0}),i=Pv(o,n.floating);return{data:{escapedOffsets:i,escaped:Iv(i)}}}default:return{}}}}},l1=new Set(["left","top"]);async function Z4(e,t){const{placement:n,platform:a,elements:r}=e,l=await(a.isRTL==null?void 0:a.isRTL(r.floating)),o=mr(n),i=to(n),u=ra(n)==="y",d=l1.has(o)?-1:1,c=l&&u?-1:1,f=Ra(t,e);let{mainAxis:v,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof h=="number"&&(p=i==="end"?h*-1:h),u?{x:p*c,y:v*d}:{x:v*d,y:p*c}}const X4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:l,placement:o,middlewareData:i}=t,u=await Z4(t,e);return o===((n=i.offset)==null?void 0:n.placement)&&(a=i.arrow)!=null&&a.alignmentOffset?{}:{x:r+u.x,y:l+u.y,data:{...u,placement:o}}}}},Q4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r,platform:l}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:u={fn:E=>{let{x:L,y:D}=E;return{x:L,y:D}}},...d}=Ra(e,t),c={x:n,y:a},f=await l.detectOverflow(t,d),v=ra(r),p=Uf(v);let h=c[p],k=c[v];const S=(E,L)=>a1(L+f[E==="y"?"top":"left"],L,L-f[E==="y"?"bottom":"right"]);o&&(h=S(p,h)),i&&(k=S(v,k));const x=u.fn({...t,[p]:h,[v]:k});return{...x,data:{x:x.x-n,y:x.y-a,enabled:{[p]:o,[v]:i}}}}}},eT=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,a;const{x:r,y:l,placement:o,rects:i,middlewareData:u}=t,{offset:d=0,mainAxis:c=!0,crossAxis:f=!0}=Ra(e,t),v={x:r,y:l},p=ra(o),h=Uf(p);let k=v[h],S=v[p];const x=Ra(d,t),E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(a=x.crossAxis)!=null?a:0};if(c){const A=h==="y"?"height":"width",R=i.reference[h]-i.floating[A]+E.mainAxis,F=i.reference[h]+i.reference[A]-E.mainAxis;kF&&(k=F)}if(f){var L,D;const A=h==="y"?"width":"height",R=l1.has(mr(o)),F=i.reference[p]-i.floating[A]+(R&&((L=u.offset)==null?void 0:L[p])||0)+(R?0:E.crossAxis),W=i.reference[p]+i.reference[A]+(R?0:((D=u.offset)==null?void 0:D[p])||0)-(R?E.crossAxis:0);SW&&(S=W)}return{[h]:k,[p]:S}}}},tT=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:a,platform:r,elements:l}=t,{apply:o=()=>{},...i}=Ra(e,t),u=await r.detectOverflow(t,i),d=mr(n),c=to(n),f=ra(n)==="y",{width:v,height:p}=a.floating;let h,k;d==="top"||d==="bottom"?(h=d,k=c===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(k=d,h=c==="end"?"top":"bottom");const S=p-u.top-u.bottom,x=v-u.left-u.right,E=pr(p-u[h],S),L=pr(v-u[k],x),D=t.middlewareData.shift,A=!D;let R=E,F=L;D!=null&&D.enabled.x&&(F=x),D!=null&&D.enabled.y&&(R=S),A&&!c&&(f?F=v-2*Ea(u.left,u.right):R=p-2*Ea(u.top,u.bottom)),await o({...t,availableWidth:F,availableHeight:R});const W=await r.getDimensions(l.floating);return v!==W.width||p!==W.height?{reset:{rects:!0}}:{}}}};function $u(){return typeof window<"u"}function nl(e){return Wf(e)?(e.nodeName||"").toLowerCase():"#document"}function fn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fa(e){var t;return(t=(Wf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wf(e){return $u()?e instanceof Node||e instanceof fn(e).Node:!1}function da(e){return $u()?e instanceof Element||e instanceof fn(e).Element:!1}function kr(e){return $u()?e instanceof HTMLElement||e instanceof fn(e).HTMLElement:!1}function Rv(e){return!$u()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fn(e).ShadowRoot}function Cu(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=fa(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&r!=="inline"&&r!=="contents"}function nT(e){return/^(table|td|th)$/.test(nl(e))}function Su(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const aT=/transform|translate|scale|rotate|perspective|filter/,rT=/paint|layout|strict|content/,Mr=e=>!!e&&e!=="none";let $c;function Gf(e){const t=da(e)?fa(e):e;return Mr(t.transform)||Mr(t.translate)||Mr(t.scale)||Mr(t.rotate)||Mr(t.perspective)||!Yf()&&(Mr(t.backdropFilter)||Mr(t.filter))||aT.test(t.willChange||"")||rT.test(t.contain||"")}function lT(e){let t=Kr(e);for(;kr(t)&&!is(t);){if(Gf(t))return t;if(Su(t))return null;t=Kr(t)}return null}function Yf(){return $c==null&&($c=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$c}function is(e){return/^(html|body|#document)$/.test(nl(e))}function fa(e){return fn(e).getComputedStyle(e)}function Eu(e){return da(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kr(e){if(nl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rv(e)&&e.host||Fa(e);return Rv(t)?t.host:t}function o1(e){const t=Kr(e);return is(t)?(e.ownerDocument||e).body:kr(t)&&Cu(t)?t:o1(t)}function us(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=o1(e),l=r===((a=e.ownerDocument)==null?void 0:a.body),o=fn(r);if(l){const i=Dd(o);return t.concat(o,o.visualViewport||[],Cu(r)?r:[],i&&n?us(i):[])}else return t.concat(r,us(r,[],n))}function Dd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function s1(e){const t=fa(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=kr(e),l=r?e.offsetWidth:n,o=r?e.offsetHeight:a,i=Ni(n)!==l||Ni(a)!==o;return i&&(n=l,a=o),{width:n,height:a,$:i}}function Jf(e){return da(e)?e:e.contextElement}function Bl(e){const t=Jf(e);if(!kr(t))return Aa(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:l}=s1(t);let o=(l?Ni(n.width):n.width)/a,i=(l?Ni(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!i||!Number.isFinite(i))&&(i=1),{x:o,y:i}}const oT=Aa(0);function i1(e){const t=fn(e);return!Yf()||!t.visualViewport?oT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sT(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===fn(e)}function Wr(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),l=Jf(e);let o=Aa(1);t&&(a?da(a)&&(o=Bl(a)):o=Bl(e));const i=sT(l,n,a)?i1(l):Aa(0);let u=(r.left+i.x)/o.x,d=(r.top+i.y)/o.y,c=r.width/o.x,f=r.height/o.y;if(l&&a){const v=fn(l),p=da(a)?fn(a):a;let h=v,k=Dd(h);for(;k&&p!==h;){const S=Bl(k),x=k.getBoundingClientRect(),E=fa(k),L=x.left+(k.clientLeft+parseFloat(E.paddingLeft))*S.x,D=x.top+(k.clientTop+parseFloat(E.paddingTop))*S.y;u*=S.x,d*=S.y,c*=S.x,f*=S.y,u+=L,d+=D,h=fn(k),k=Dd(h)}}return Fi({width:c,height:f,x:u,y:d})}function Au(e,t){const n=Eu(e).scrollLeft;return t?t.left+n:Wr(Fa(e)).left+n}function u1(e,t){const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-Au(e,n),r=n.top+t.scrollTop;return{x:a,y:r}}function iT(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const l=r==="fixed",o=Fa(a),i=t?Su(t.floating):!1;if(a===o||i&&l)return n;let u={scrollLeft:0,scrollTop:0},d=Aa(1);const c=Aa(0),f=kr(a);if((f||!l)&&((nl(a)!=="body"||Cu(o))&&(u=Eu(a)),f)){const p=Wr(a);d=Bl(a),c.x=p.x+a.clientLeft,c.y=p.y+a.clientTop}const v=o&&!f&&!l?u1(o,u):Aa(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+c.x+v.x,y:n.y*d.y-u.scrollTop*d.y+c.y+v.y}}function uT(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function cT(e){const t=Eu(e),n=e.ownerDocument.body,a=Ea(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Ea(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let l=-t.scrollLeft+Au(e);const o=-t.scrollTop;return fa(n).direction==="rtl"&&(l+=Ea(e.clientWidth,n.clientWidth)-a),{width:a,height:r,x:l,y:o}}const dT=25;function fT(e,t,n){n===void 0&&(n="viewport");const a=n==="layoutViewport",r=fn(e),l=Fa(e),o=r.visualViewport;let i=l.clientWidth,u=l.clientHeight,d=0,c=0;if(o){const v=!Yf()||t==="fixed";a?v||(d=-o.offsetLeft,c=-o.offsetTop):(i=o.width,u=o.height,v&&(d=o.offsetLeft,c=o.offsetTop))}if(Au(l)<=0){const v=l.ownerDocument,p=v.body,h=getComputedStyle(p),k=v.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,S=Math.abs(l.clientWidth-p.clientWidth-k),x=getComputedStyle(l).scrollbarGutter==="stable both-edges"?S/2:S;x<=dT&&(i-=x)}return{width:i,height:u,x:d,y:c}}function pT(e,t){const n=Wr(e,!0,t==="fixed"),a=n.top+e.clientTop,r=n.left+e.clientLeft,l=Bl(e),o=e.clientWidth*l.x,i=e.clientHeight*l.y,u=r*l.x,d=a*l.y;return{width:o,height:i,x:u,y:d}}function qv(e,t,n){let a;if(t==="viewport"||t==="layoutViewport")a=fT(e,n,t);else if(t==="document")a=cT(Fa(e));else if(da(t))a=pT(t,n);else{const r=i1(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Fi(a)}function mT(e,t){const n=t.get(e);if(n)return n;let a=us(e,[],!1).filter(i=>da(i)&&nl(i)!=="body"),r=null;const l=fa(e).position==="fixed";let o=l?Kr(e):e;for(;da(o)&&!is(o);){const i=fa(o),u=Gf(o),d=r?r.position:l?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&i.position==="static")?a=a.filter(f=>f!==o):r=i,o=Kr(o)}return t.set(e,a),a}function vT(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const o=[...n==="clippingAncestors"?Su(t)?[]:mT(t,this._c):[].concat(n),a],i=qv(t,o[0],r);let u=i.top,d=i.right,c=i.bottom,f=i.left;for(let v=1;v{i(!1,1e-7)},1e3)}F=!1}try{a=new IntersectionObserver(W,{...R,root:l.ownerDocument})}catch{a=new IntersectionObserver(W,R)}a.observe(e)}const u=fn(e),d=()=>i(n);return u.addEventListener("resize",d),i(!0),()=>{u.removeEventListener("resize",d),o()}}function kT(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=a,d=Jf(e),c=r||l?[...d?us(d):[],...t?us(t):[]]:[];c.forEach(x=>{r&&x.addEventListener("scroll",n),l&&x.addEventListener("resize",n)});const f=d&&i?xT(d,n,l):null;let v=-1,p=null;o&&(p=new ResizeObserver(x=>{let[E]=x;E&&E.target===d&&p&&t&&(p.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var L;(L=p)==null||L.observe(t)})),n()}),d&&!u&&p.observe(d),t&&p.observe(t));let h,k=u?Wr(e):null;u&&S();function S(){const x=Wr(e);k&&!d1(k,x)&&n(),k=x,h=requestAnimationFrame(S)}return n(),()=>{var x;c.forEach(E=>{r&&E.removeEventListener("scroll",n),l&&E.removeEventListener("resize",n)}),f?.(),(x=p)==null||x.disconnect(),p=null,u&&cancelAnimationFrame(h)}}const wT=X4,$T=Q4,Nv=Y4,CT=tT,ST=J4,ET=G4,AT=eT,TT=(e,t,n)=>{const a=new Map,r=n??{},l={..._T,...r.platform,_c:a};return W4(e,t,{...r,platform:l})};function DT(e){return e!=null&&typeof e=="object"&&"$el"in e}function Od(e){if(DT(e)){const t=e.$el;return Wf(t)&&nl(t)==="#comment"?null:t}return e}function wl(e){return typeof e=="function"?e():s(e)}function OT(e){return{name:"arrow",options:e,fn(t){const n=Od(wl(e.element));return n==null?{}:ET({element:n,padding:e.padding}).fn(t)}}}function f1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bv(e,t){const n=f1(e);return Math.round(t*n)/n}function MT(e,t,n){n===void 0&&(n={});const a=n.whileElementsMounted,r=_(()=>{var F;return(F=wl(n.open))!=null?F:!0}),l=_(()=>wl(n.middleware)),o=_(()=>{var F;return(F=wl(n.placement))!=null?F:"bottom"}),i=_(()=>{var F;return(F=wl(n.strategy))!=null?F:"absolute"}),u=_(()=>{var F;return(F=wl(n.transform))!=null?F:!0}),d=_(()=>Od(e.value)),c=_(()=>Od(t.value)),f=M(0),v=M(0),p=M(i.value),h=M(o.value),k=Jl({}),S=M(!1),x=_(()=>{const F={position:p.value,left:"0",top:"0"};if(!c.value)return F;const W=Bv(c.value,f.value),C=Bv(c.value,v.value);return u.value?{...F,transform:"translate("+W+"px, "+C+"px)",...f1(c.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:W+"px",top:C+"px"}});let E;function L(){if(d.value==null||c.value==null)return;const F=r.value;TT(d.value,c.value,{middleware:l.value,placement:o.value,strategy:i.value}).then(W=>{f.value=W.x,v.value=W.y,p.value=W.strategy,h.value=W.placement,k.value=W.middlewareData,S.value=F!==!1})}function D(){typeof E=="function"&&(E(),E=void 0)}function A(){if(D(),a===void 0){L();return}if(d.value!=null&&c.value!=null){E=a(d.value,c.value,L);return}}function R(){r.value||(S.value=!1)}return Ve([l,o,i,r],L,{flush:"sync"}),Ve([d,c],A,{flush:"sync"}),Ve(r,R,{flush:"sync"}),Kd()&&Jh(D),{x:dl(f),y:dl(v),strategy:dl(p),placement:dl(h),middlewareData:dl(k),isPositioned:dl(S),floatingStyles:x,update:L}}const p1={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[CU,PT]=$t("PopperContent");var IT=ae({inheritAttrs:!1,__name:"PopperContent",props:Ny({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...p1}),emits:["placed"],setup(e,{emit:t}){const n=e,a=t,r=t1(),{forwardRef:l,currentElement:o}=Ye(),i=M(),u=M(),{width:d,height:c}=bA(u),f=_(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),v=_(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),p=_(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=_(()=>({padding:v.value,boundary:p.value.filter(I4),altBoundary:p.value.length>0})),k=_(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),S=J3(()=>[wT({mainAxis:n.sideOffset+c.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&Nv({...h.value,...k.value}),n.avoidCollisions&&$T({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?AT():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&Nv({...h.value,...k.value}),CT({...h.value,apply:({elements:O,rects:B,availableWidth:J,availableHeight:K})=>{const{width:H,height:le}=B.reference,ue=O.floating.style;ue.setProperty("--reka-popper-available-width",`${J}px`),ue.setProperty("--reka-popper-available-height",`${K}px`),ue.setProperty("--reka-popper-anchor-width",`${H}px`),ue.setProperty("--reka-popper-anchor-height",`${le}px`)}}),u.value&&OT({element:u.value,padding:n.arrowPadding}),R4({arrowWidth:d.value,arrowHeight:c.value}),n.hideWhenDetached&&ST({strategy:"referenceHidden",...h.value})]),x=_(()=>n.reference??r.anchor.value),{floatingStyles:E,placement:L,isPositioned:D,middlewareData:A}=MT(x,i,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...O)=>kT(...O,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:S}),R=_(()=>Ad(L.value)[0]),F=_(()=>Ad(L.value)[1]);ky(()=>{D.value&&a("placed")});const W=_(()=>{const O=A.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&O}),C=M("");kn(()=>{o.value&&(C.value=window.getComputedStyle(o.value).zIndex)});const I=_(()=>A.value.arrow?.x??0),z=_(()=>A.value.arrow?.y??0);return PT({placedSide:R,onArrowChange:O=>u.value=O,arrowX:I,arrowY:z,shouldHideArrow:W}),(O,B)=>(m(),y("div",{ref_key:"floatingRef",ref:i,"data-reka-popper-content-wrapper":"",style:bn({...s(E),transform:s(D)?s(E).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:C.value,"--reka-popper-transform-origin":[s(A).transformOrigin?.x,s(A).transformOrigin?.y].join(" "),...s(A).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[N(s(Qe),ze({ref:s(l)},O.$attrs,{"as-child":n.asChild,as:O.as,"data-side":R.value,"data-align":F.value,style:{animation:s(D)?void 0:"none"}}),{default:q(()=>[ge(O.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),m1=IT;const Zf=["day","month","year"],Xf=["hour","minute","second","dayPeriod"],v1=[...Zf,...Xf];function RT(e){return Zf.includes(e)}function h1(e){return v1.includes(e)}const qT=["ach","af","am","an","ar","ast","az","be","bg","bn","br","bs","ca","cak","ckb","cs","cy","da","de","dsb","el","en","eo","es","et","eu","fa","ff","fi","fr","fy","ga","gd","gl","he","hr","hsb","hu","ia","id","it","ja","ka","kk","kn","ko","lb","lo","lt","lv","meh","ml","ms","nl","nn","no","oc","pl","pt","rm","ro","ru","sc","scn","sk","sl","sr","sv","szl","tg","th","tr","uk","zh-CN","zh-TW"],LT=["year","month","day"],Sc={ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"ዓዓዓዓ",month:"ሚሜ",day:"ቀቀ"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"سنة",month:"شهر",day:"يوم"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"гггг",month:"мм",day:"дд"},bg:{year:"гггг",month:"мм",day:"дд"},bn:{year:"yyyy",month:"মিমি",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"ساڵ",month:"مانگ",day:"ڕۆژ"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"åååå",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"źź"},el:{year:"εεεε",month:"μμ",day:"ηη"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"سال",month:"ماه",day:"روز"},ff:{year:"hhhh",month:"ll",day:"ññ"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"שנה",month:"חודש",day:"יום"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"éééé",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:" 年 ",month:"月",day:"日"},ka:{year:"წწწწ",month:"თთ",day:"რრ"},kk:{year:"жжжж",month:"аа",day:"кк"},kn:{year:"ವವವವ",month:"ಮಿಮೀ",day:"ದಿದಿ"},ko:{year:"연도",month:"월",day:"일"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"ປປປປ",month:"ດດ",day:"ວວ"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"വർഷം",month:"മാസം",day:"തീയതി"},ms:{year:"tttt",month:"mm",day:"hh"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"åååå",month:"mm",day:"dd"},no:{year:"åååå",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"гггг",month:"мм",day:"дд"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"гггг",month:"мм",day:"дд"},sv:{year:"åååå",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"сссс",month:"мм",day:"рр"},th:{year:"ปปปป",month:"ดด",day:"วว"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"рррр",month:"мм",day:"дд"},"zh-CN":{year:"年",month:"月",day:"日"},"zh-TW":{year:"年",month:"月",day:"日"}};function NT(e){if(Fv(e))return Sc[e];{const t=zT(e);return Fv(t)?Sc[t]:Sc.en}}function Ec(e,t,n){return BT(e)?NT(n)[e]:VT(e)?t:FT(e)?"––":""}function Fv(e){return qT.includes(e)}function BT(e){return LT.includes(e)}function FT(e){return e==="hour"||e==="minute"||e==="second"}function VT(e){return e==="era"||e==="dayPeriod"}function zT(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const jT=["hour","minute","second"];function Md(e){return Object.fromEntries(Xf.map(t=>t==="dayPeriod"?[t,e.formatter.dayPeriod(An(e.value))]:[t,e.value[t]]))}function Vv(e){const{formatter:t}=e,n=Zf.map(a=>[a,e.value[a]]);if("hour"in e.value){const a=Md({value:e.value,formatter:t});return{...Object.fromEntries(n),...a}}return Object.fromEntries(n)}function UT(e){return Object.fromEntries(Xf.map(t=>t==="dayPeriod"?[t,"AM"]:[t,null]).filter(([t])=>!(t==="literal"||t===null||e==="minute"&&t==="second"||e==="hour"&&(t==="second"||t==="minute"))))}function HT(e){const t=v1.map(n=>n==="dayPeriod"?[n,"AM"]:[n,null]).filter(([n])=>n==="literal"||n===null||e==="minute"&&n==="second"||e==="hour"&&(n==="second"||n==="minute")?!1:e==="day"?!jT.includes(n)&&n!=="dayPeriod":!0);return Object.fromEntries(t)}function KT(e){const{segmentValues:t,formatter:n,locale:a}=e;function r(o){if("hour"in t){const i=t[o];return i!==null?o==="day"?n.part(e.dateRef.set({[o]:i,month:t.month??1}),o,{hourCycle:ss(e.hourCycle)}):n.part(e.dateRef.set({[o]:i}),o,{hourCycle:ss(e.hourCycle)}):Ec(o,"",a.value)}else{if(RT(o)){const i=t[o];return i!==null?o==="day"?n.part(e.dateRef.set({[o]:i,month:t.month??1}),o):n.part(e.dateRef.set({[o]:i}),o):Ec(o,"",a.value)}return""}}return Object.keys(t).reduce((o,i)=>{if(!h1(i))return o;if("hour"in t&&i==="dayPeriod"){const u=t[i];u!==null?o[i]=u:o[i]=Ec(i,"AM",a.value)}else o[i]=r(i);return o},{})}function WT(e){const{granularity:t,formatter:n,contentObj:a,hideTimeZone:r,hourCycle:l,isTimeValue:o}=e;return n.toParts(e.dateRef,pA(t,l,o)).map(d=>["literal","timeZoneName",null].includes(d.type)||!h1(d.type)?{part:d.type,value:d.value}:{part:d.type,value:a[d.type]}).filter(d=>!(d.part===null||d.value===null||d.part==="timeZoneName"&&(!os(e.dateRef)||r)||(!os(e.dateRef)||r)&&d.part==="literal"&&["[","]"].includes(d.value.trim())))}function y1(e){const t=KT(e),n=WT({contentObj:t,...e});return{obj:t,arr:n}}function ba(e){const t=Ql();return e===t.ARROW_RIGHT||e===t.ARROW_LEFT}function Ir(e){return!Number.isNaN(Number.parseInt(e))}function Ka(e){const t=Ql();return!!([t.ENTER,t.ARROW_UP,t.ARROW_DOWN,t.ARROW_LEFT,t.ARROW_RIGHT,t.BACKSPACE,t.SPACE,"a","A","p","P"].includes(e)||Ir(e))}function zv(e){return Array.from(e.querySelectorAll("[data-reka-date-field-segment]")).filter(t=>t.getAttribute("data-reka-date-field-segment")!=="literal")}function jv(e){return Array.from(e.querySelectorAll("[data-reka-time-field-segment]")).filter(t=>t.getAttribute("data-reka-time-field-segment")!=="literal")}const GT=/^\d$/;function wr(e){return{role:"spinbutton",contenteditable:!0,tabindex:e.disabled?void 0:0,spellcheck:!1,inputmode:"numeric",autocorrect:"off",enterkeyhint:"next",style:"caret-color: transparent;"}}function YT(e){const{segmentValues:t,placeholder:n}=e,a=t.day===null,r={};t.day&&(r.day=t.day),t.month&&(r.month=t.month);const l=Object.keys(r).length>0?n.set(r):n,o=l.day,i=1,u=or(l),d=a?"Empty":`${o}`;return{...wr(e),"aria-label":"day,","aria-valuemin":i,"aria-valuemax":u,"aria-valuenow":o,"aria-valuetext":d,"data-placeholder":a?"":void 0}}function JT(e){const{segmentValues:t,placeholder:n,formatter:a}=e,r=t.month===null,l=t.month?n.set({month:t.month}):n,o=l.month,i=1,u=12,d=r?"Empty":`${o} - ${a.fullMonth(An(l))}`;return{...wr(e),"aria-label":"month, ",contenteditable:!0,"aria-valuemin":i,"aria-valuemax":u,"aria-valuenow":o,"aria-valuetext":d,"data-placeholder":r?"":void 0}}function ZT(e){const{segmentValues:t,placeholder:n}=e,a=t.year===null,r=t.year?n.set({year:t.year}):n,l=1,o=9999,i=r.year,u=a?"Empty":`${i}`;return{...wr(e),"aria-label":"year, ","aria-valuemin":l,"aria-valuemax":o,"aria-valuenow":i,"aria-valuetext":u,"data-placeholder":a?"":void 0}}function XT(e){const{segmentValues:t,hourCycle:n,placeholder:a}=e;if(!("hour"in t)||!("hour"in a))return{};const r=t.hour===null,l=t.hour?a.set({hour:t.hour}):a,o=n===12?1:0,i=n===12?12:23,u=l.hour,d=r?"Empty":`${u} ${t.dayPeriod??""}`;return{...wr(e),"aria-label":"hour, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":u,"aria-valuetext":d,"data-placeholder":r?"":void 0}}function QT(e){const{segmentValues:t,placeholder:n}=e;if(!("minute"in t)||!("minute"in n))return{};const a=t.minute===null,l=(t.minute?n.set({minute:t.minute}):n).minute,o=0,i=59,u=a?"Empty":`${l}`;return{...wr(e),"aria-label":"minute, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":l,"aria-valuetext":u,"data-placeholder":a?"":void 0}}function eD(e){const{segmentValues:t,placeholder:n}=e;if(!("second"in t)||!("second"in n))return{};const a=t.second===null,l=(t.second?n.set({second:t.second}):n).second,o=0,i=59,u=a?"Empty":`${l}`;return{...wr(e),"aria-label":"second, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":l,"aria-valuetext":u,"data-placeholder":a?"":void 0}}function tD(e){const{segmentValues:t}=e;if(!("dayPeriod"in t))return{};const n=0,a=12,r=t.hour?t.hour>12?t.hour-12:t.hour:0,l=t.dayPeriod??"AM";return{...wr(e),inputmode:"text","aria-label":"AM/PM","aria-valuemin":n,"aria-valuemax":a,"aria-valuenow":r,"aria-valuetext":l}}function nD(e){return{"aria-hidden":!0,"data-segment":"literal"}}function aD(e){return{role:"textbox","aria-label":"timezone, ","data-readonly":!0,"data-segment":"timeZoneName",tabindex:e.disabled?void 0:0,style:"caret-color: transparent;"}}function rD(e){const{segmentValues:t,placeholder:n}=e,a=0,r=0,l=0,o="era"in t?t.era:n.era;return{...wr(e),"aria-label":"era","aria-valuemin":a,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":o}}const lD={day:{attrs:YT},month:{attrs:JT},year:{attrs:ZT},hour:{attrs:XT},minute:{attrs:QT},second:{attrs:eD},dayPeriod:{attrs:tD},literal:{attrs:nD},timeZoneName:{attrs:aD},era:{attrs:rD}};function g1(e){const t=Ql();function n({e:C,part:I,dateRef:z,prevValue:O}){const B=e.step.value[I]??1,J=C.key===t.ARROW_UP?B:-B,K=0,H=59;if(O===null)return J>0?K:H;const le=[I,J];return z.set({[I]:O}).cycle(...le)[I]}function a(C){if(e.hasLeftFocus.value=!1,C===null)return C;const I=C.toString();return I.length===1?(e.modelValue.value=void 0,null):Number.parseInt(I.slice(0,-1))}function r({e:C,part:I,dateRef:z,prevValue:O}){const B=e.step.value[I]??1,J=C.key===t.ARROW_UP?B:-B;if(O===null)return z[I];if(I==="hour"&&"hour"in z){const H=[I,J];return z.set({[I]:O}).cycle(...H)[I]}const K=[I,J];return I==="day"?z.set({[I]:O,month:e.segmentValues.value.month??1}).cycle(...K)[I]:z.set({[I]:O}).cycle(...K)[I]}function l(C,I,z){let O=!1;const B=Math.floor(C/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,z=null),z===null)return I===0?(e.lastKeyZero.value=!0,{value:null,moveToNext:O}):((e.lastKeyZero.value||I>B)&&(O=!0),e.lastKeyZero.value=!1,{value:I,moveToNext:O});const J=z.toString().length,K=Number.parseInt(z.toString()+I.toString());return J===2||K>C?((I>B||K>C)&&(O=!0),{value:I,moveToNext:O}):(O=!0,{value:K,moveToNext:O})}function o(C,I){let O=!1;const B=Math.floor(59/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,I=null),I===null)return C===0?(e.lastKeyZero.value=!0,{value:0,moveToNext:O}):((e.lastKeyZero.value||C>B)&&(O=!0),e.lastKeyZero.value=!1,{value:C,moveToNext:O});const J=I.toString().length,K=Number.parseInt(I.toString()+C.toString());return J===2||K>59?(C>B&&(O=!0),{value:C,moveToNext:O}):(O=!0,{value:K,moveToNext:O})}function i(C,I,z){let O=!1;const B=Math.floor(C/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,z=null),z===null)return I===0?(e.lastKeyZero.value=!0,{value:0,moveToNext:O}):((e.lastKeyZero.value||I>B)&&(O=!0),e.lastKeyZero.value=!1,{value:I,moveToNext:O});const J=z.toString().length,K=Number.parseInt(z.toString()+I.toString());return J===2||K>C?(I>B&&(O=!0),{value:I,moveToNext:O}):(O=!0,{value:K,moveToNext:O})}function u(C,I){let z=!1;if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,I=null),I===null)return{value:C===0?1:C,moveToNext:z};const O=I.toString()+C.toString();return O.length>4?{value:C===0?1:C,moveToNext:z}:(O.length===4&&(z=!0),{value:Number.parseInt(O),moveToNext:z})}const d=_(()=>lD[e.part]?.attrs({disabled:e.disabled.value,placeholder:e.placeholder.value,hourCycle:e.hourCycle,segmentValues:e.segmentValues.value,formatter:e.formatter})??{});function c(C){if(!Ka(C.key)||ba(C.key))return;const I=e.segmentValues.value.day;if(C.key===t.ARROW_DOWN||C.key===t.ARROW_UP){e.segmentValues.value.day=r({e:C,part:"day",dateRef:e.placeholder.value,prevValue:I});return}if(Ir(C.key)){const z=Number.parseInt(C.key),O=e.segmentValues.value.month,B=O?or(e.placeholder.value.set({month:O})):31,{value:J,moveToNext:K}=l(B,z,I);e.segmentValues.value.day=J,K&&e.focusNext()}C.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.day=a(I))}function f(C){if(!Ka(C.key)||ba(C.key))return;const I=e.segmentValues.value.month;if(C.key===t.ARROW_DOWN||C.key===t.ARROW_UP){e.segmentValues.value.month=r({e:C,part:"month",dateRef:e.placeholder.value,prevValue:I});return}if(Ir(C.key)){const z=Number.parseInt(C.key),{value:O,moveToNext:B}=l(12,z,I);e.segmentValues.value.month=O,B&&e.focusNext()}C.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.month=a(I))}function v(C){if(!Ka(C.key)||ba(C.key))return;const I=e.segmentValues.value.year;if(C.key===t.ARROW_DOWN||C.key===t.ARROW_UP){e.segmentValues.value.year=r({e:C,part:"year",dateRef:e.placeholder.value,prevValue:I});return}if(Ir(C.key)){const z=Number.parseInt(C.key),{value:O,moveToNext:B}=u(z,I);e.segmentValues.value.year=O,B&&e.focusNext()}C.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.year=a(I))}function p(C){const I=new In(C,{hour:"numeric"}).resolvedOptions().hourCycle;return I==="h11"||I==="h12"}function h(C){const I=e.placeholder.value;if(!Ka(C.key)||ba(C.key)||!("hour"in I)||!("hour"in e.segmentValues.value))return;const z=e.segmentValues.value.hour;if(C.key===t.ARROW_UP||C.key===t.ARROW_DOWN){const O=r({e:C,part:"hour",dateRef:e.placeholder.value,prevValue:z});e.segmentValues.value.hour=O,"dayPeriod"in e.segmentValues.value&&O!==null&&(e.segmentValues.value.dayPeriod=O>=12?"PM":"AM");return}if(Ir(C.key)){const O=Number.parseInt(C.key),B=e.hourCycle!==void 0?e.hourCycle===12:p(e.formatter.getLocale()),J=B?12:24;let K=z;B&&z!==null&&(K=z%12===0?0:z>12?z-12:z);const{value:H,moveToNext:le}=i(J,O,K);let ue=H;if(B&&H!==null){const we=e.segmentValues.value.dayPeriod||"AM";H===12?ue=we==="AM"?0:12:ue=we==="PM"?H+12:H}e.segmentValues.value.hour=ue,le&&e.focusNext()}C.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.hour=a(z))}function k(C){const I=e.placeholder.value;if(!Ka(C.key)||ba(C.key)||!("minute"in I)||!("minute"in e.segmentValues.value))return;const z=e.segmentValues.value.minute;if((C.key===t.ARROW_UP||C.key===t.ARROW_DOWN)&&(e.segmentValues.value.minute=n({e:C,part:"minute",dateRef:e.placeholder.value,prevValue:z})),Ir(C.key)){const O=Number.parseInt(C.key),{value:B,moveToNext:J}=o(O,z);e.segmentValues.value.minute=B,J&&e.focusNext()}C.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.minute=a(z))}function S(C){const I=e.placeholder.value;if(!Ka(C.key)||ba(C.key)||!("second"in I)||!("second"in e.segmentValues.value))return;const z=e.segmentValues.value.second;if((C.key===t.ARROW_UP||C.key===t.ARROW_DOWN)&&(e.segmentValues.value.second=n({e:C,part:"second",dateRef:e.placeholder.value,prevValue:z})),Ir(C.key)){const O=Number.parseInt(C.key),{value:B,moveToNext:J}=o(O,z);e.segmentValues.value.second=B,J&&e.focusNext()}C.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.second=a(z))}function x(C){if(!((!Ka(C.key)||ba(C.key))&&C.key!=="a"&&C.key!=="p"||!("hour"in e.placeholder.value)||!("dayPeriod"in e.segmentValues.value))){if(C.key===t.ARROW_UP||C.key===t.ARROW_DOWN){if(e.segmentValues.value.dayPeriod==="AM"){e.segmentValues.value.dayPeriod="PM",e.segmentValues.value.hour=e.segmentValues.value.hour+12;return}e.segmentValues.value.dayPeriod="AM",e.segmentValues.value.hour=e.segmentValues.value.hour-12;return}if(["a","A"].includes(C.key)&&e.segmentValues.value.dayPeriod!=="AM"){e.segmentValues.value.dayPeriod="AM",e.segmentValues.value.hour=e.segmentValues.value.hour-12;return}["p","P"].includes(C.key)&&e.segmentValues.value.dayPeriod!=="PM"&&(e.segmentValues.value.dayPeriod="PM",e.segmentValues.value.hour=e.segmentValues.value.hour+12)}}function E(C){e.disabled.value&&C.preventDefault()}function L(C){if(C.isComposing||C.key==="Process")return;const I=e.disabled.value,z=e.readonly.value;if(I||z)return;if(C.key!==t.TAB&&C.preventDefault(),{day:c,month:f,year:v,hour:h,minute:k,second:S,dayPeriod:x,timeZoneName:()=>{}}[e.part](C),![t.ARROW_LEFT,t.ARROW_RIGHT].includes(C.key)&&C.key!==t.TAB&&C.key!==t.SHIFT&&Ka(C.key)&&Object.values(e.segmentValues.value).every(B=>B!==null)){const B={...e.segmentValues.value},J=e.placeholder.value.set(B);e.modelValue.value=J.copy()}}function D(){if(e.stepSnapping?.value&&(e.part==="hour"&&"hour"in e.segmentValues.value&&e.segmentValues.value.hour!==null&&e.step.value.hour&&e.step.value.hour>1?(e.segmentValues.value.hour=sc(e.segmentValues.value.hour,0,23,e.step.value.hour),"dayPeriod"in e.segmentValues.value&&(e.segmentValues.value.hour<12?e.segmentValues.value.dayPeriod="AM":e.segmentValues.value.hour&&(e.segmentValues.value.dayPeriod="PM"))):e.part==="minute"&&"minute"in e.segmentValues.value&&e.segmentValues.value.minute!==null&&e.step.value.minute&&e.step.value.minute>1?e.segmentValues.value.minute=sc(e.segmentValues.value.minute,0,59,e.step.value.minute):e.part==="second"&&"second"in e.segmentValues.value&&e.segmentValues.value.second!==null&&e.step.value.second&&e.step.value.second>1&&(e.segmentValues.value.second=sc(e.segmentValues.value.second,0,59,e.step.value.second)),Object.values(e.segmentValues.value).every(C=>C!==null))){const C=e.placeholder.value.set({...e.segmentValues.value});e.modelValue.value=C.copy()}}let A=null;function R(C){C.isComposing||C.preventDefault()}function F(C){const I=C.target;A=Array.from(I.childNodes,z=>({node:z,value:z.nodeValue}))}function W(C){const I=C.target,z=A;if(A=null,z){for(const{node:B,value:J}of z)B.nodeValue=J;I.replaceChildren(...z.map(B=>B.node))}const O=C.data;if(O)for(const B of O){if(!GT.test(B))continue;const J=Ut();if(!(J instanceof HTMLElement))break;J.dispatchEvent(new KeyboardEvent("keydown",{key:B,bubbles:!0,cancelable:!0}))}}return{handleSegmentClick:E,handleSegmentKeydown:L,handleSegmentBeforeInput:R,handleSegmentCompositionStart:F,handleSegmentCompositionEnd:W,handleSegmentFocusOut:D,attributes:d}}function oD(e){function t(l){return Array.isArray(e.date.value)?e.date.value.some(o=>cr(o,l)):e.date.value?cr(e.date.value,l):!1}const n=_(()=>{if(Array.isArray(e.date.value)){if(!e.date.value.length)return!1;for(const l of e.date.value)if(e.isDateDisabled?.(l)||e.isDateUnavailable?.(l))return!0}else{if(!e.date.value)return!1;if(e.isDateDisabled?.(e.date.value)||e.isDateUnavailable?.(e.date.value))return!0}return!1}),a=_(()=>Array.isArray(e.date.value)?e.date.value.length>0:!!e.date.value),r=_(()=>Array.isArray(e.date.value)?e.date.value.length?e.date.value.some(l=>e.isDateDisabled?.(l)):!1:e.date.value?!!e.isDateDisabled?.(e.date.value):!1);return{isDateSelected:t,isInvalid:n,hasSelectedDate:a,isSelectedDateDisabled:r}}function sD(e,t){const n=t(e),a=n.compare(e),r={};return a>=7&&(r.day=1),a>=or(e)&&(r.month=1),n.set({...r})}function iD(e,t){const n=t(e),a=e.compare(n),r={};return a>=7&&(r.day=35),a>=or(e)&&(r.month=13),n.set({...r})}function uD(e,t){return t(e)}function cD(e,t){return t(e)}function dD(e){const t=Rf(e.locale.value),n=_(()=>{const x={calendar:e.placeholder.value.calendar.identifier};return e.placeholder.value.calendar.identifier==="gregory"&&e.placeholder.value.era==="BC"&&(x.era="short"),x}),a=M(Or({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})),r=_(()=>a.value.map(x=>x.value));function l(x){return!r.value.some(E=>nv(x,E))}const o=x=>{if(!e.maxValue.value||!a.value.length)return!1;if(e.disabled.value)return!0;const E=a.value.at(-1).value;if(!x&&!e.nextPage.value){const D=E.add({months:1}).set({day:1});return yc(D,e.maxValue.value)}const L=sD(E,x||e.nextPage.value);return yc(L,e.maxValue.value)},i=x=>{if(!e.minValue.value||!a.value.length)return!1;if(e.disabled.value)return!0;const E=a.value[0].value;if(!x&&!e.prevPage.value){const D=E.subtract({months:1}).set({day:35});return ar(D,e.minValue.value)}const L=iD(E,x||e.prevPage.value);return ar(L,e.minValue.value)};function u(x){return!!(e.isDateDisabled?.(x)||e.disabled.value||e.maxValue.value&&yc(x,e.maxValue.value)||e.minValue.value&&ar(x,e.minValue.value))}const d=x=>!!e.isDateUnavailable?.(x),c=_(()=>a.value.length?a.value[0].rows[0].map(x=>t.dayOfWeek(An(x),e.weekdayFormat.value)):[]),f=x=>{const E=a.value[0].value;if(!x&&!e.nextPage.value){const R=E.add({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),F=Or({dateObj:R,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});a.value=F,e.placeholder.value=F[0].value.set({day:1});return}const L=uD(E,x||e.nextPage.value),D=Or({dateObj:L,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});a.value=D;const A={};if(!x){const R=D[0].value.compare(E);R>=or(E)&&(A.day=1),R>=365&&(A.month=1)}e.placeholder.value=D[0].value.set({...A})},v=x=>{const E=a.value[0].value;if(!x&&!e.prevPage.value){const R=E.subtract({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),F=Or({dateObj:R,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});a.value=F,e.placeholder.value=F[0].value.set({day:1});return}const L=cD(E,x||e.prevPage.value),D=Or({dateObj:L,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});a.value=D;const A={};if(!x){const R=E.compare(D[0].value);R>=or(E)&&(A.day=1),R>=365&&(A.month=1)}e.placeholder.value=D[0].value.set({...A})};Ve(e.placeholder,x=>{r.value.some(E=>nv(E,x))||(a.value=Or({dateObj:x,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value}))}),Ve([e.locale,e.weekStartsOn,e.fixedWeeks,e.numberOfMonths],()=>{a.value=Or({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})});const p=_(()=>{if(!a.value.length)return"";if(e.locale.value!==t.getLocale()&&t.setLocale(e.locale.value),a.value.length===1){const W=a.value[0].value;return`${t.fullMonthAndYear(An(W),n.value)}`}const x=An(a.value[0].value),E=An(a.value.at(-1).value),L=t.fullMonth(x,n.value),D=t.fullMonth(E,n.value),A=t.fullYear(x,n.value),R=t.fullYear(E,n.value);return A===R?`${L} - ${D} ${R}`:`${L} ${A} - ${D} ${R}`}),h=_(()=>`${e.calendarLabel.value??"Event Date"}, ${p.value}`),k=_(()=>!(u(e.placeholder.value)||d(e.placeholder.value)||l(e.placeholder.value))),S=_(()=>{for(const x of a.value){if(e.minValue.value&&ar(x.value,e.minValue.value))continue;const E=or(x.value),L=e.minValue.value&&wf(e.minValue.value,x.value)?e.minValue.value.day:1;for(let D=L;D<=E;D++){const A=x.value.set({day:D});if(!(u(A)||d(A)))return A}}});return{isDateDisabled:u,isDateUnavailable:d,isNextButtonDisabled:o,isPrevButtonDisabled:i,grid:a,weekdays:c,visibleView:r,isOutsideVisibleView:l,formatter:t,nextPage:f,prevPage:v,headingValue:p,fullCalendarLabel:h,isPlaceholderFocusable:k,firstFocusableDate:S}}const fD={style:{border:"0px",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute","white-space":"nowrap",width:"1px"}},pD={role:"heading","aria-level":"2"},[no,mD]=$t("CalendarRoot");var vD=ae({__name:"CalendarRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},pagedNavigation:{type:Boolean,required:!1,default:!1},preventDeselect:{type:Boolean,required:!1,default:!1},weekStartsOn:{type:Number,required:!1},weekdayFormat:{type:String,required:!1,default:"narrow"},calendarLabel:{type:String,required:!1},fixedWeeks:{type:Boolean,required:!1,default:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},numberOfMonths:{type:Number,required:!1,default:1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},initialFocus:{type:Boolean,required:!1,default:!1},isDateDisabled:{type:Function,required:!1,default:void 0},isDateUnavailable:{type:Function,required:!1,default:void 0},dir:{type:String,required:!1},nextPage:{type:Function,required:!1},prevPage:{type:Function,required:!1},modelValue:{type:null,required:!1},multiple:{type:Boolean,required:!1,default:!1},disableDaysOutsideCurrentView:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},emits:["update:modelValue","update:placeholder"],setup(e,{emit:t}){const n=e,a=t,{disabled:r,readonly:l,initialFocus:o,pagedNavigation:i,weekdayFormat:u,fixedWeeks:d,multiple:c,minValue:f,maxValue:v,numberOfMonths:p,preventDeselect:h,isDateDisabled:k,isDateUnavailable:S,calendarLabel:x,defaultValue:E,nextPage:L,prevPage:D,dir:A,locale:R,disableDaysOutsideCurrentView:F}=Vt(n),{primitiveElement:W,currentElement:C}=Ur(),I=ku(R),z=ma(A),O=_(()=>n.weekStartsOn??Ub(I.value)),B=Mt(n,"modelValue",a,{defaultValue:E.value,passive:n.modelValue===void 0}),J=If({defaultPlaceholder:n.placeholder,defaultValue:B.value,locale:n.locale}),K=Mt(n,"placeholder",a,{defaultValue:n.defaultPlaceholder??J.copy(),passive:n.placeholder===void 0});function H(ee){K.value=ee.copy()}const{fullCalendarLabel:le,headingValue:ue,isDateDisabled:we,isDateUnavailable:Oe,isNextButtonDisabled:Ae,isPrevButtonDisabled:ie,weekdays:xe,isOutsideVisibleView:U,nextPage:ke,prevPage:me,formatter:Y,grid:fe,isPlaceholderFocusable:G,firstFocusableDate:X}=dD({locale:I,placeholder:K,weekStartsOn:O,fixedWeeks:d,numberOfMonths:p,minValue:f,maxValue:v,disabled:r,weekdayFormat:u,pagedNavigation:i,isDateDisabled:k.value,isDateUnavailable:S.value,calendarLabel:x,nextPage:L,prevPage:D}),{isInvalid:te,isDateSelected:b,hasSelectedDate:T,isSelectedDateDisabled:P}=oD({date:B,isDateDisabled:we,isDateUnavailable:Oe});Ve(B,ee=>{if(Array.isArray(ee)&&ee.length){const ce=ee.at(-1);ce&&!ql(K.value,ce)&&H(ce)}else!Array.isArray(ee)&&ee&&!ql(K.value,ee)&&H(ee)});function re(ee){if(c.value){if(!B.value)B.value=[ee.copy()];else if(Array.isArray(B.value)){if(B.value.findIndex(Ee=>cr(Ee,ee))===-1)B.value=[...B.value,ee];else if(!h.value){const Ee=B.value.filter(Ce=>!cr(Ce,ee));if(!Ee.length){K.value=ee.copy(),B.value=void 0;return}B.value=Ee.map(Ce=>Ce.copy())}}}else{if(!B.value){B.value=ee.copy();return}!h.value&&ql(B.value,ee)?(K.value=ee.copy(),B.value=void 0):B.value=ee.copy()}}return wt(()=>{o.value&&zb(C.value)}),mD({isDateUnavailable:Oe,dir:z,isDateDisabled:we,locale:I,formatter:Y,modelValue:B,placeholder:K,disabled:r,initialFocus:o,pagedNavigation:i,grid:fe,weekDays:xe,weekStartsOn:O,weekdayFormat:u,fixedWeeks:d,multiple:c,numberOfMonths:p,readonly:l,preventDeselect:h,fullCalendarLabel:le,headingValue:ue,isInvalid:te,isDateSelected:b,isNextButtonDisabled:Ae,isPrevButtonDisabled:ie,isOutsideVisibleView:U,nextPage:ke,prevPage:me,parentElement:C,onPlaceholderChange:H,onDateChange:re,disableDaysOutsideCurrentView:F,minValue:f,maxValue:v,isPlaceholderFocusable:G,firstFocusableDate:X,hasSelectedDate:T,isSelectedDateDisabled:P}),(ee,ce)=>(m(),j(s(Qe),{ref_key:"primitiveElement",ref:W,as:ee.as,"as-child":ee.asChild,"aria-label":s(le),"data-readonly":s(l)?"":void 0,"data-disabled":s(r)?"":void 0,"data-invalid":s(te)?"":void 0,dir:s(z)},{default:q(()=>[ge(ee.$slots,"default",{date:s(K),grid:s(fe),weekDays:s(xe),weekStartsOn:O.value,locale:s(I),fixedWeeks:s(d),modelValue:s(B)}),w("div",fD,[w("div",pD,$(s(le)),1)])]),_:3},8,["as","as-child","aria-label","data-readonly","data-disabled","data-invalid","dir"]))}}),hD=vD,yD=ae({__name:"CalendarCell",props:{date:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"td"}},setup(e){const t=no();return(n,a)=>(m(),j(s(Qe),{as:n.as,"as-child":n.asChild,role:"gridcell","aria-selected":s(t).isDateSelected(n.date)?!0:void 0,"aria-disabled":s(t).isDateDisabled(n.date)||s(t).isDateUnavailable?.(n.date)||s(t).disableDaysOutsideCurrentView.value,"data-disabled":s(t).isDateDisabled(n.date)||s(t).disableDaysOutsideCurrentView.value?"":void 0},{default:q(()=>[ge(n.$slots,"default")]),_:3},8,["as","as-child","aria-selected","aria-disabled","data-disabled"]))}}),gD=yD,bD=ae({__name:"CalendarCellTrigger",props:{day:{type:null,required:!0},month:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,n=Ql(),a=no(),{primitiveElement:r}=Ur(),l=_(()=>t.day.day.toLocaleString(a.locale.value)),o=_(()=>a.formatter.custom(An(t.day),{weekday:"long",month:"long",day:"numeric",year:"numeric"})),i=_(()=>a.isDateUnavailable?.(t.day)??!1),u=_(()=>gE(t.day,Hn())),d=_(()=>!wf(t.day,t.month)),c=_(()=>a.isOutsideVisibleView(t.day)),f=_(()=>a.isDateDisabled(t.day)||a.disableDaysOutsideCurrentView.value&&d.value),v=_(()=>d.value||f.value?!1:!a.disabled.value&&a.isPlaceholderFocusable.value&&cr(t.day,a.placeholder.value)?!0:(!a.hasSelectedDate.value||a.isSelectedDateDisabled.value)&&!a.isPlaceholderFocusable.value?a.firstFocusableDate.value&&cr(t.day,a.firstFocusableDate.value):!1),p=_(()=>a.isDateSelected(t.day));function h(x){a.readonly.value||a.isDateDisabled(x)||a.isDateUnavailable?.(x)||a.onDateChange(x)}function k(){f.value||h(t.day)}function S(x){if(f.value)return;x.preventDefault(),x.stopPropagation();const E=a.parentElement.value,L=7,D=a.dir.value==="rtl"?-1:1;switch(x.code){case n.ARROW_RIGHT:A(t.day,D);break;case n.ARROW_LEFT:A(t.day,-D);break;case n.ARROW_UP:A(t.day,-L);break;case n.ARROW_DOWN:A(t.day,L);break;case n.ENTER:case n.SPACE_CODE:h(t.day)}function A(R,F){const W=R.add({days:F});if(a.minValue.value&&W.compare(a.minValue.value)<0||a.maxValue.value&&W.compare(a.maxValue.value)>0)return;const C=E.querySelector(`[data-value='${W.toString()}']:not([data-outside-view])`);if(!C){if(F>0){if(a.isNextButtonDisabled())return;a.nextPage()}else{if(a.isPrevButtonDisabled())return;a.prevPage()}Je(()=>{A(R,F)});return}if(C&&C.hasAttribute("data-disabled"))return A(W,F);a.onPlaceholderChange(W),C?.focus()}}return(x,E)=>(m(),j(s(Qe),{ref_key:"primitiveElement",ref:r,as:t.as,"as-child":t.asChild,role:"button","aria-label":o.value,"data-reka-calendar-cell-trigger":"","aria-disabled":f.value||i.value?!0:void 0,"data-selected":p.value?!0:void 0,"data-value":x.day.toString(),"data-disabled":f.value?"":void 0,"data-unavailable":i.value?"":void 0,"data-today":u.value?"":void 0,"data-outside-view":d.value?"":void 0,"data-outside-visible-view":c.value?"":void 0,"data-focused":v.value?"":void 0,tabindex:v.value?0:d.value||f.value?void 0:-1,onClick:k,onKeydown:[ia(S,["up","down","left","right","space","enter"]),E[0]||(E[0]=ia(ft(()=>{},["prevent"]),["enter"]))]},{default:q(()=>[ge(x.$slots,"default",{dayValue:l.value,disabled:f.value,today:u.value,selected:p.value,outsideView:d.value,outsideVisibleView:c.value,unavailable:i.value},()=>[_e($(l.value),1)])]),_:3},8,["as","as-child","aria-label","aria-disabled","data-selected","data-value","data-disabled","data-unavailable","data-today","data-outside-view","data-outside-visible-view","data-focused","tabindex"]))}}),_D=bD,xD=ae({__name:"CalendarGrid",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"table"}},setup(e){const t=e,n=no(),a=_(()=>n.disabled.value?!0:void 0),r=_(()=>n.readonly.value?!0:void 0);return(l,o)=>(m(),j(s(Qe),ze(t,{tabindex:"-1",role:"application","aria-readonly":r.value,"aria-disabled":a.value,"data-readonly":r.value&&"","data-disabled":a.value&&""}),{default:q(()=>[ge(l.$slots,"default")]),_:3},16,["aria-readonly","aria-disabled","data-readonly","data-disabled"]))}}),kD=xD,wD=ae({__name:"CalendarGridBody",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"tbody"}},setup(e){const t=e;return(n,a)=>(m(),j(s(Qe),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),$D=wD,CD=ae({__name:"CalendarGridHead",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"thead"}},setup(e){const t=e;return(n,a)=>(m(),j(s(Qe),ze(t,{"aria-hidden":"true"}),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),SD=CD,ED=ae({__name:"CalendarGridRow",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"tr"}},setup(e){const t=e;return(n,a)=>(m(),j(s(Qe),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),AD=ED,TD=ae({__name:"CalendarHeadCell",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"th"}},setup(e){const t=e;return(n,a)=>(m(),j(s(Qe),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),DD=TD,OD=ae({__name:"CalendarHeader",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e;return(n,a)=>(m(),j(s(Qe),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),MD=OD,PD=ae({__name:"CalendarHeading",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,n=no();return(a,r)=>(m(),j(s(Qe),ze(t,{"data-disabled":s(n).disabled.value?"":void 0}),{default:q(()=>[ge(a.$slots,"default",{headingValue:s(n).headingValue.value},()=>[_e($(s(n).headingValue.value),1)])]),_:3},16,["data-disabled"]))}}),ID=PD,RD=ae({__name:"CalendarNext",props:{nextPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=_(()=>a.disabled.value||a.isNextButtonDisabled(t.nextPage)),a=no();function r(){n.value||a.nextPage(t.nextPage)}return(l,o)=>(m(),j(s(Qe),{as:t.as,"as-child":t.asChild,"aria-label":"Next page",type:t.as==="button"?"button":void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:r},{default:q(()=>[ge(l.$slots,"default",{disabled:n.value},()=>[o[0]||(o[0]=_e(" Next page "))])]),_:3},8,["as","as-child","type","aria-disabled","data-disabled","disabled"]))}}),qD=RD,LD=ae({__name:"CalendarPrev",props:{prevPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=_(()=>a.disabled.value||a.isPrevButtonDisabled(t.prevPage)),a=no();function r(){n.value||a.prevPage(t.prevPage)}return(l,o)=>(m(),j(s(Qe),{"aria-label":"Previous page",as:t.as,"as-child":t.asChild,type:t.as==="button"?"button":void 0,"aria-disabled":n.value||void 0,"data-disabled":n.value||void 0,disabled:n.value,onClick:r},{default:q(()=>[ge(l.$slots,"default",{disabled:n.value},()=>[o[0]||(o[0]=_e(" Prev page "))])]),_:3},8,["as","as-child","type","aria-disabled","data-disabled","disabled"]))}}),ND=LD;const[BD,FD]=$t("RovingFocusGroup");var VD=ae({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(e,{expose:t,emit:n}){const a=e,r=n,{loop:l,orientation:o,dir:i}=Vt(a),u=ma(i),d=Mt(a,"currentTabStopId",r,{defaultValue:a.defaultCurrentTabStopId,passive:a.currentTabStopId===void 0}),c=M(!1),f=M(!1),v=M(0),{getItems:p,CollectionSlot:h}=Ff({isProvider:!0});function k(x){const E=!f.value;if(x.currentTarget&&x.target===x.currentTarget&&E&&!c.value){const L=new CustomEvent(C4,S4);if(x.currentTarget.dispatchEvent(L),r("entryFocus",L),!L.defaultPrevented){const D=p().map(C=>C.ref).filter(C=>C.dataset.disabled!==""),A=D.find(C=>C.getAttribute("data-active")===""),R=D.find(C=>C.getAttribute("data-highlighted")===""),F=D.find(C=>C.id===d.value),W=[A,R,F,...D].filter(Boolean);e1(W,a.preventScrollOnEntryFocus)}}f.value=!1}function S(){setTimeout(()=>{f.value=!1},1)}return t({getItems:p}),FD({loop:l,dir:u,orientation:o,currentTabStopId:d,onItemFocus:x=>{d.value=x},onItemShiftTab:()=>{c.value=!0},onFocusableItemAdd:()=>{v.value++},onFocusableItemRemove:()=>{v.value--}}),(x,E)=>(m(),j(s(h),null,{default:q(()=>[N(s(Qe),{tabindex:c.value||v.value===0?-1:0,"data-orientation":s(o),as:x.as,"as-child":x.asChild,dir:s(u),style:{outline:"none"},onMousedown:E[0]||(E[0]=L=>f.value=!0),onMouseup:S,onFocus:k,onBlur:E[1]||(E[1]=L=>c.value=!1)},{default:q(()=>[ge(x.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),Tu=VD,zD=ae({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,n=BD(),a=Ia(),r=_(()=>t.tabStopId||a),l=_(()=>n.currentTabStopId.value===r.value),{getItems:o,CollectionItem:i}=Ff();wt(()=>{t.focusable&&n.onFocusableItemAdd()}),La(()=>{t.focusable&&n.onFocusableItemRemove()});function u(d){if(d.key==="Tab"&&d.shiftKey){n.onItemShiftTab();return}if(d.target!==d.currentTarget)return;const c=T4(d,n.orientation.value,n.dir.value);if(c!==void 0){if(d.metaKey||d.ctrlKey||d.altKey||!t.allowShiftKey&&d.shiftKey)return;d.preventDefault();let f=[...o().map(v=>v.ref).filter(v=>v.dataset.disabled!=="")];if(c==="last")f.reverse();else if(c==="prev"||c==="next"){c==="prev"&&f.reverse();const v=f.indexOf(d.currentTarget);f=n.loop.value?D4(f,v+1):f.slice(v+1)}Je(()=>e1(f))}}return(d,c)=>(m(),j(s(i),null,{default:q(()=>[N(s(Qe),{tabindex:l.value?0:-1,"data-orientation":s(n).orientation.value,"data-active":d.active?"":void 0,"data-disabled":d.focusable?void 0:"",as:d.as,"as-child":d.asChild,onMousedown:c[0]||(c[0]=f=>{d.focusable?s(n).onItemFocus(r.value):f.preventDefault()}),onFocus:c[1]||(c[1]=f=>s(n).onItemFocus(r.value)),onKeydown:u},{default:q(()=>[ge(d.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),Du=zD;const[jD]=$t("CheckboxGroupRoot");function Qf(e){return e==="indeterminate"}function b1(e){return Qf(e)?"indeterminate":e?"checked":"unchecked"}const[UD,HD]=$t("CheckboxRoot");var KD=ae({inheritAttrs:!1,__name:"CheckboxRoot",props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:"on"},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=Ye(),o=jD(null),i=Mt(n,"modelValue",a,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),u=_(()=>o?.disabled.value||n.disabled),d=_(()=>rs(i.value,n.trueValue)),c=_(()=>gn(o?.modelValue.value)?i.value==="indeterminate"?"indeterminate":d.value:Qm(o.modelValue.value,n.value));function f(){if(gn(o?.modelValue.value))i.value==="indeterminate"?i.value=n.trueValue:i.value=d.value?n.falseValue:n.trueValue;else{const h=[...o.modelValue.value||[]];if(Qm(h,n.value)){const k=h.findIndex(S=>rs(S,n.value));h.splice(k,1)}else h.push(n.value);o.modelValue.value=h}}const v=qf(l),p=_(()=>n.id&&l.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);return HD({disabled:u,state:c}),(h,k)=>(m(),j(zt(s(o)?.rovingFocus.value?s(Du):s(Qe)),ze(h.$attrs,{id:h.id,ref:s(r),role:"checkbox","as-child":h.asChild,as:h.as,type:h.as==="button"?"button":void 0,"aria-checked":s(Qf)(c.value)?"mixed":c.value,"aria-required":h.required,"aria-label":h.$attrs["aria-label"]||p.value,"data-state":s(b1)(c.value),"data-disabled":u.value?"":void 0,disabled:u.value,focusable:s(o)?.rovingFocus.value?!u.value:void 0,onKeydown:ia(ft(()=>{},["prevent"]),["enter"]),onClick:f}),{default:q(()=>[ge(h.$slots,"default",{modelValue:s(i),state:c.value}),s(v)&&h.name&&!s(o)?(m(),j(s(zf),{key:0,type:"checkbox",checked:!!c.value,name:h.name,value:h.value,disabled:u.value,required:h.required},null,8,["checked","name","value","disabled","required"])):Q("v-if",!0)]),_:3},16,["id","as-child","as","type","aria-checked","aria-required","aria-label","data-state","data-disabled","disabled","focusable","onKeydown"]))}}),WD=KD,GD=ae({__name:"CheckboxIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const{forwardRef:t}=Ye(),n=UD();return(a,r)=>(m(),j(s(Zr),{present:a.forceMount||s(Qf)(s(n).state.value)||s(n).state.value===!0},{default:q(()=>[N(s(Qe),ze({ref:s(t),"data-state":s(b1)(s(n).state.value),"data-disabled":s(n).disabled.value?"":void 0,style:{pointerEvents:"none"},"as-child":a.asChild,as:a.as},a.$attrs),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),YD=GD,JD=ae({__name:"MenuAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(jf),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),ZD=JD;function XD(){const e=M(!1);return wt(()=>{Wl("keydown",()=>{e.value=!0},{capture:!0,passive:!0}),Wl(["pointerdown","pointermove"],()=>{e.value=!1},{capture:!0,passive:!0})}),e}const QD=cb(XD),[Ou,eO]=$t(["MenuRoot","MenuSub"],"MenuContext"),[ep,tO]=$t("MenuRoot");var nO=ae({__name:"MenuRoot",props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const n=e,a=t,{modal:r,dir:l}=Vt(n),o=ma(l),i=Mt(n,"open",a),u=M(),d=QD();return eO({open:i,onOpenChange:c=>{i.value=c},content:u,onContentChange:c=>{u.value=c}}),tO({onClose:()=>{i.value=!1},isUsingKeyboardRef:d,dir:o,modal:r}),(c,f)=>(m(),j(s(n1),null,{default:q(()=>[ge(c.$slots,"default")]),_:3}))}}),aO=nO;const[_1,rO]=$t("MenuContent");var lO=ae({__name:"MenuContentImpl",props:Ny({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...p1}),emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus","dismiss"],setup(e,{emit:t}){const n=e,a=t,r=Ou(),l=ep(),{trapFocus:o,disableOutsidePointerEvents:i,loop:u}=Vt(n);Hb(),kf(i.value);const d=M(""),c=M(0),f=M(0),v=M(null),p=M("right"),h=M(0),k=M(null),S=M(),{forwardRef:x,currentElement:E}=Ye(),{handleTypeaheadSearch:L}=xA(),D=M();function A(K){const H=tv(K,D.value||Ut(),E.value,{loop:u.value,arrowKeyOptions:"vertical",dir:l?.dir.value,focus:!1,attributeName:"[data-reka-collection-item]:not([data-disabled])"});H&&(D.value=H,H.scrollIntoView({block:"nearest"}))}function R(){D.value&&D.value.click()}const F=M(),W=M();Ve(D,K=>{W.value&&(K===void 0||K!==W.value.trigger.value)&&(W.value.onOpenChange(!1),W.value=void 0)}),Ve(E,K=>{r.onContentChange(K)}),La(()=>{window.clearTimeout(c.value)});function C(K){return p.value===v.value?.side&&KA(K,v.value?.area)}async function I(K){a("openAutoFocus",K),!K.defaultPrevented&&(K.preventDefault(),E.value?.focus({preventScroll:!0}))}function z(K){if(K.defaultPrevented)return;const H=K.target,le=H.closest("[data-reka-menu-content]")===K.currentTarget,ue=["input","textarea"].includes(H.tagName.toLowerCase()),we=K.ctrlKey||K.altKey||K.metaKey,Oe=K.key.length===1,Ae=tv(K,Ut(),E.value,{loop:u.value,arrowKeyOptions:"vertical",dir:l?.dir.value,focus:!0,attributeName:"[data-reka-collection-item]:not([data-disabled])"});if(Ae)return Ae?.focus();if(K.code==="Space")return;const ie=S.value?.getItems()??[];if(le&&(K.key==="Tab"&&K.preventDefault(),!we&&Oe&&!ue&&L(K.key,ie)),K.target!==E.value||!jA.includes(K.key))return;K.preventDefault();const xe=[...ie.map(U=>U.ref)];Yb.includes(K.key)&&xe.reverse(),UA(xe)}function O(K){K?.currentTarget?.contains?.(K.target)||(window.clearTimeout(c.value),d.value="")}function B(K){if(!Li(K))return;const H=K.target,le=h.value!==K.clientX;if(K?.currentTarget?.contains(H)&&le){const ue=K.clientX>h.value?"right":"left";p.value=ue,h.value=K.clientX}}function J(K){Li(K)&&F.value&&F.value.focus()}return rO({onItemEnter:K=>!!C(K),onItemLeave:K=>C(K)?!0:(["INPUT","TEXTAREA"].includes(Ut()?.tagName||"")||E.value?.focus(),k.value=null,!1),onTriggerLeave:K=>!!C(K),searchRef:d,highlightedElement:D,onKeydownNavigation:A,onKeydownEnter:R,filterElement:F,onFilterElementChange:K=>{F.value=K},activeSubmenuContext:W,pointerGraceTimerRef:f,onPointerGraceIntentChange:K=>{v.value=K}}),(K,H)=>(m(),j(s(Bf),{"as-child":"",trapped:s(o),onMountAutoFocus:I,onUnmountAutoFocus:H[7]||(H[7]=le=>a("closeAutoFocus",le))},{default:q(()=>[N(s(Nf),{"as-child":"","disable-outside-pointer-events":s(i),onEscapeKeyDown:H[2]||(H[2]=le=>a("escapeKeyDown",le)),onPointerDownOutside:H[3]||(H[3]=le=>a("pointerDownOutside",le)),onFocusOutside:H[4]||(H[4]=le=>a("focusOutside",le)),onInteractOutside:H[5]||(H[5]=le=>a("interactOutside",le)),onDismiss:H[6]||(H[6]=le=>a("dismiss"))},{default:q(()=>[N(s(Tu),{ref_key:"rovingFocusGroupRef",ref:S,"current-tab-stop-id":k.value,"onUpdate:currentTabStopId":H[0]||(H[0]=le=>k.value=le),"as-child":"",orientation:"vertical",dir:s(l).dir.value,loop:s(u),onEntryFocus:H[1]||(H[1]=le=>{a("entryFocus",le),s(l).isUsingKeyboardRef.value||le.preventDefault()})},{default:q(()=>[N(s(m1),{ref:s(x),role:"menu",as:K.as,"as-child":K.asChild,"aria-orientation":"vertical","data-reka-menu-content":"","data-state":s(Jb)(s(r).open.value),dir:s(l).dir.value,side:K.side,"side-offset":K.sideOffset,align:K.align,"align-offset":K.alignOffset,"avoid-collisions":K.avoidCollisions,"collision-boundary":K.collisionBoundary,"collision-padding":K.collisionPadding,"arrow-padding":K.arrowPadding,"prioritize-position":K.prioritizePosition,"position-strategy":K.positionStrategy,"update-position-strategy":K.updatePositionStrategy,sticky:K.sticky,"hide-when-detached":K.hideWhenDetached,reference:K.reference,onKeydown:z,onBlur:O,onPointermove:B,onPointerenter:J},{default:q(()=>[ge(K.$slots,"default")]),_:3},8,["as","as-child","data-state","dir","side","side-offset","align","align-offset","avoid-collisions","collision-boundary","collision-padding","arrow-padding","prioritize-position","position-strategy","update-position-strategy","sticky","hide-when-detached","reference"])]),_:3},8,["current-tab-stop-id","dir","loop"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),x1=lO,oO=ae({inheritAttrs:!1,__name:"MenuItemImpl",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=_1(),{forwardRef:a,currentElement:r}=Ye(),{CollectionItem:l}=Ff(),o=M(!1),i=_(()=>o.value||r.value!=null&&n.highlightedElement.value===r.value);async function u(c){if(!(c.defaultPrevented||!Li(c))){if(t.disabled)n.onItemLeave(c);else if(!n.onItemEnter(c)){const v=c.currentTarget;n.highlightedElement.value=v,["INPUT","TEXTAREA"].includes(Ut()?.tagName||"")||v.focus({preventScroll:!0})}}}async function d(c){if(await Je(),c.defaultPrevented||!Li(c)||n.highlightedElement.value!==r.value)return;!n.onItemLeave(c)&&n.highlightedElement.value===r.value&&(n.highlightedElement.value=void 0)}return(c,f)=>(m(),j(s(l),{value:{textValue:c.textValue}},{default:q(()=>[N(s(Qe),ze({ref:s(a),role:"menuitem",tabindex:"-1"},c.$attrs,{as:c.as,"as-child":c.asChild,"aria-disabled":c.disabled||void 0,"data-disabled":c.disabled?"":void 0,"data-highlighted":i.value?"":void 0,onPointermove:u,onPointerleave:d,onFocus:f[0]||(f[0]=async v=>{await Je(),!(v.defaultPrevented||c.disabled)&&(o.value=!0,s(n).highlightedElement.value=v.currentTarget)}),onBlur:f[1]||(f[1]=async v=>{await Je(),!v.defaultPrevented&&(o.value=!1)})}),{default:q(()=>[ge(c.$slots,"default")]),_:3},16,["as","as-child","aria-disabled","data-disabled","data-highlighted"])]),_:3},8,["value"]))}}),sO=oO,iO=ae({__name:"MenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=Ye(),o=ep(),i=_1(),u=M(!1);async function d(){const c=l.value;if(!n.disabled&&c){const f=new CustomEvent(VA,{bubbles:!0,cancelable:!0});a("select",f),await Je(),f.defaultPrevented?u.value=!1:o.onClose()}}return(c,f)=>(m(),j(sO,ze(n,{ref:s(r),onClick:d,onPointerdown:f[0]||(f[0]=()=>{u.value=!0}),onPointerup:f[1]||(f[1]=async v=>{await Je(),!v.defaultPrevented&&(u.value||v.currentTarget?.click())}),onKeydown:f[2]||(f[2]=async v=>{const p=s(i).searchRef.value!=="";c.disabled||p&&v.key===" "||s(Ed).includes(v.key)&&(v.currentTarget?.click(),v.preventDefault())})}),{default:q(()=>[ge(c.$slots,"default")]),_:3},16))}}),k1=iO;const[uO,cO]=$t(["MenuCheckboxItem","MenuRadioItem"],"MenuItemIndicatorContext");var dO=ae({__name:"MenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=uO({modelValue:M(!1)});return(n,a)=>(m(),j(s(Zr),{present:n.forceMount||s(Zb)(s(t).modelValue.value)||s(t).modelValue.value===!0},{default:q(()=>[N(s(Qe),{as:n.as,"as-child":n.asChild,"data-state":s(Xb)(s(t).modelValue.value)},{default:q(()=>[ge(n.$slots,"default")]),_:3},8,["as","as-child","data-state"])]),_:3},8,["present"]))}}),fO=dO,pO=ae({__name:"MenuRootContentModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=va(n,a),l=Ou(),{forwardRef:o,currentElement:i}=Ye();return Lf(i),(u,d)=>(m(),j(x1,ze(s(r),{ref:s(o),"trap-focus":s(l).open.value,"disable-outside-pointer-events":s(l).open.value,"disable-outside-scroll":!0,onDismiss:d[0]||(d[0]=c=>s(l).onOpenChange(!1)),onFocusOutside:d[1]||(d[1]=ft(c=>a("focusOutside",c),["prevent"]))}),{default:q(()=>[ge(u.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),mO=pO,vO=ae({__name:"MenuRootContentNonModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const r=va(e,t),l=Ou();return(o,i)=>(m(),j(x1,ze(s(r),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:i[0]||(i[0]=u=>s(l).onOpenChange(!1))}),{default:q(()=>[ge(o.$slots,"default")]),_:3},16))}}),hO=vO,yO=ae({__name:"MenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const r=va(e,t),l=Ou(),o=ep();return(i,u)=>(m(),j(s(Zr),{present:i.forceMount||s(l).open.value},{default:q(()=>[s(o).modal.value?(m(),j(mO,nt(ze({key:0},{...i.$attrs,...s(r)})),{default:q(()=>[ge(i.$slots,"default")]),_:3},16)):(m(),j(hO,nt(ze({key:1},{...i.$attrs,...s(r)})),{default:q(()=>[ge(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),gO=yO;const[bO,_O]=$t("MenuGroup");var xO=ae({__name:"MenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=Ia(void 0,"reka-menu-group");return _O({id:n}),(a,r)=>(m(),j(s(Qe),ze({role:"group"},t,{"aria-labelledby":s(n)}),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),kO=xO,wO=ae({__name:"MenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,n=bO({id:""});return(a,r)=>(m(),j(s(Qe),ze(t,{id:s(n).id||void 0}),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["id"]))}}),$O=wO,CO=ae({__name:"MenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(wu),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),SO=CO;const[EO,AO]=$t("MenuRadioGroup");var TO=ae({__name:"MenuRadioGroup",props:{modelValue:{type:null,required:!1,default:""},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=bf(n,["modelValue"]),l=xu(r),o=Mt(n,"modelValue",a);return AO({modelValue:o,onValueChange:i=>{o.value=i}}),(i,u)=>(m(),j(kO,nt(lt(s(l))),{default:q(()=>[ge(i.$slots,"default",{modelValue:s(o)})]),_:3},16))}}),DO=TO,OO=ae({__name:"MenuRadioItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,a=t,r=bf(n,["value"]),l=xu(r),{value:o}=Vt(n),i=EO(),u=_(()=>i.modelValue.value===o?.value);return cO({modelValue:u}),(d,c)=>(m(),j(k1,ze({role:"menuitemradio"},s(l),{"aria-checked":u.value,"data-state":s(Xb)(u.value),onSelect:c[0]||(c[0]=async f=>{a("select",f),s(i).onValueChange(s(o))})}),{default:q(()=>[ge(d.$slots,"default")]),_:3},16,["aria-checked","data-state"]))}}),MO=OO,PO=ae({__name:"MenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(Qe),ze(t,{role:"separator","aria-orientation":"horizontal"}),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),IO=PO;const[RO,qO]=$t("DateFieldRoot");var LO=ae({inheritAttrs:!1,__name:"DateFieldRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},modelValue:{type:null,required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},isDateUnavailable:{type:Function,required:!1,default:void 0},id:{type:String,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:placeholder"],setup(e,{expose:t,emit:n}){const a=e,r=n,{disabled:l,readonly:o,isDateUnavailable:i,granularity:u,defaultValue:d,dir:c,locale:f}=Vt(a),v=ku(f),p=ma(c),h=Rf(v.value,{hourCycle:ss(a.hourCycle)}),{primitiveElement:k,currentElement:S}=Ur(),x=M(new Set);wt(()=>{zv(S.value).forEach(U=>x.value.add(U))});const E=Mt(a,"modelValue",r,{defaultValue:d.value,passive:a.modelValue===void 0}),L=If({defaultPlaceholder:a.placeholder,granularity:u.value,defaultValue:E.value,locale:a.locale}),D=Mt(a,"placeholder",r,{defaultValue:a.defaultPlaceholder??L.copy(),passive:a.placeholder===void 0}),A=_(()=>Vb(a)),R=_(()=>a.granularity?Cd(D.value)?a.granularity:"day":Cd(D.value)?"minute":"day"),F=_(()=>E.value?!!(i.value?.(E.value)||a.minValue&&ar(E.value,a.minValue)||a.maxValue&&ar(a.maxValue,E.value)):!1),W=HT(R.value),C=M(E.value?{...Vv({value:E.value,formatter:h})}:{...W}),I=_(()=>y1({granularity:R.value,dateRef:D.value,formatter:h,hideTimeZone:a.hideTimeZone,hourCycle:a.hourCycle,segmentValues:C.value,locale:v})),z=_(()=>I.value.arr),O=_(()=>z.value.filter(({part:U})=>U!=="literal"));Ve(v,U=>{h.getLocale()!==U&&(h.setLocale(U),Je(()=>{x.value.clear(),zv(S.value).forEach(ke=>x.value.add(ke))}))}),Ve(E,U=>{!gn(U)&&D.value.compare(U)!==0&&(D.value=U.copy())}),Ve([E,v],([U])=>{gn(U)?Object.values(C.value).every(ke=>ke!==null)&&gn(U)&&(C.value={...W}):C.value={...Vv({value:U,formatter:h})}});const B=M(null),J=_(()=>Array.from(x.value).findIndex(U=>U.getAttribute("data-reka-date-field-segment")===B.value?.getAttribute("data-reka-date-field-segment"))),K=_(()=>{const U=p.value==="rtl"?-1:1;return(U<0?J.value<0:J.value>x.value.size-1)?null:Array.from(x.value)[J.value+U]}),H=_(()=>{const U=p.value==="rtl"?-1:1;return(U>0?J.value<0:J.value>x.value.size-1)?null:Array.from(x.value)[J.value-U]}),le=_(()=>jb(R.value)),ue=_(()=>gc(E.value,R.value)),we=_(()=>a.maxValue?gc(a.maxValue,R.value):void 0),Oe=_(()=>a.minValue?gc(a.minValue,R.value):void 0),Ae=Ql();function ie(U){U.isComposing||ba(U.key)&&(U.key===Ae.ARROW_LEFT&&H.value?.focus(),U.key===Ae.ARROW_RIGHT&&K.value?.focus())}function xe(U){B.value=U}return qO({isDateUnavailable:i.value,locale:v,modelValue:E,placeholder:D,disabled:l,formatter:h,hourCycle:a.hourCycle,step:A,readonly:o,segmentValues:C,isInvalid:F,segmentContents:O,elements:x,setFocusedElement:xe,focusNext(){K.value?.focus()}}),t({setFocusedElement:xe}),(U,ke)=>(m(),j(s(Qe),ze(U.$attrs,{ref_key:"primitiveElement",ref:k,role:"group","aria-disabled":s(l)?!0:void 0,"data-disabled":s(l)?"":void 0,"data-readonly":s(o)?"":void 0,"data-invalid":F.value?"":void 0,dir:s(p),onKeydown:ia(ie,["left","right"])}),{default:q(()=>[ge(U.$slots,"default",{modelValue:s(E),segments:z.value,isInvalid:F.value}),N(s(Vf),{id:U.id,as:"input",type:le.value,feature:"focusable",tabindex:"-1",value:ue.value,name:U.name,disabled:s(l),required:U.required,max:we.value,min:Oe.value,onFocus:ke[0]||(ke[0]=me=>Array.from(x.value)?.[0]?.focus())},null,8,["id","type","value","name","disabled","required","max","min"])]),_:3},16,["aria-disabled","data-disabled","data-readonly","data-invalid","dir"]))}}),NO=LO,BO=ae({__name:"DateFieldInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=RO(),a=M(!0),r=M(!1),{handleSegmentClick:l,handleSegmentKeydown:o,handleSegmentBeforeInput:i,handleSegmentCompositionStart:u,handleSegmentCompositionEnd:d,attributes:c}=g1({hasLeftFocus:a,lastKeyZero:r,placeholder:n.placeholder,hourCycle:n.hourCycle,step:n.step,segmentValues:n.segmentValues,formatter:n.formatter,part:t.part,disabled:n.disabled,readonly:n.readonly,focusNext:n.focusNext,modelValue:n.modelValue}),f=_(()=>n.disabled.value),v=_(()=>n.readonly.value),p=_(()=>n.isInvalid.value);return(h,k)=>(m(),j(s(Qe),ze({as:h.as,"as-child":h.asChild},s(c),{contenteditable:f.value||v.value?!1:h.part!=="literal","data-reka-date-field-segment":h.part,"aria-disabled":f.value?!0:void 0,"aria-readonly":v.value?!0:void 0,"data-disabled":f.value?"":void 0,"data-invalid":p.value?"":void 0,"aria-invalid":p.value?!0:void 0},Ly(h.part!=="literal"?{mousedown:s(l),keydown:s(o),beforeinput:s(i),compositionstart:s(u),compositionend:s(d),focusout:()=>{a.value=!0},focusin:S=>{s(n).setFocusedElement(S.target)}}:{})),{default:q(()=>[ge(h.$slots,"default")]),_:3},16,["as","as-child","contenteditable","data-reka-date-field-segment","aria-disabled","aria-readonly","data-disabled","data-invalid","aria-invalid"]))}}),FO=BO;const[ao,VO]=$t("PopoverRoot");var zO=ae({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(e,{emit:t}){const n=e,a=t,{modal:r}=Vt(n),l=Mt(n,"open",a,{defaultValue:n.defaultOpen,passive:n.open===void 0});return VO({contentId:"",triggerId:"",modal:r,open:l,onOpenChange:u=>{l.value=u},onOpenToggle:()=>{l.value=!l.value},triggerElement:M(),hasCustomAnchor:M(!1)}),(u,d)=>(m(),j(s(n1),null,{default:q(()=>[ge(u.$slots,"default",{open:s(l),close:()=>l.value=!1})]),_:3}))}}),w1=zO,jO=ae({__name:"PopoverAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;Ye();const n=ao();return My(()=>{n.hasCustomAnchor.value=!0}),La(()=>{n.hasCustomAnchor.value=!1}),(a,r)=>(m(),j(s(jf),nt(lt(t)),{default:q(()=>[ge(a.$slots,"default")]),_:3},16))}}),UO=jO;const[tp,HO]=$t("DatePickerRoot");var KO=ae({inheritAttrs:!1,__name:"DatePickerRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},modelValue:{type:null,required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},isDateUnavailable:{type:Function,required:!1,default:void 0},id:{type:String,required:!1},dir:{type:String,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1},isDateDisabled:{type:Function,required:!1,default:void 0},pagedNavigation:{type:Boolean,required:!1,default:!1},weekStartsOn:{type:Number,required:!1},weekdayFormat:{type:String,required:!1,default:"narrow"},fixedWeeks:{type:Boolean,required:!1,default:!1},numberOfMonths:{type:Number,required:!1,default:1},preventDeselect:{type:Boolean,required:!1,default:!1},closeOnSelect:{type:Boolean,required:!1,default:!1}},emits:["update:open","update:modelValue","update:placeholder"],setup(e,{emit:t}){const n=e,a=t,{locale:r,disabled:l,readonly:o,pagedNavigation:i,weekdayFormat:u,fixedWeeks:d,numberOfMonths:c,preventDeselect:f,isDateDisabled:v,isDateUnavailable:p,defaultOpen:h,modal:k,id:S,name:x,required:E,minValue:L,maxValue:D,granularity:A,hideTimeZone:R,hourCycle:F,defaultValue:W,dir:C,step:I,closeOnSelect:z}=Vt(n),O=ma(C),B=ku(r),J=_(()=>n.weekStartsOn??Ub(B.value)),K=Mt(n,"modelValue",a,{defaultValue:W.value,passive:n.modelValue===void 0}),H=_(()=>If({defaultPlaceholder:n.placeholder,granularity:n.granularity,defaultValue:K.value,locale:B.value})),le=Mt(n,"placeholder",a,{defaultValue:n.defaultPlaceholder??H.value.copy(),passive:n.placeholder===void 0}),ue=Mt(n,"open",a,{defaultValue:h.value,passive:n.open===void 0}),we=M();function Oe(Ae){return"hour"in Ae?Ae.set({hour:0,minute:0,second:0,millisecond:0}):Ae}return Ve(K,Ae=>{Ae&&Ae.compare(le.value)!==0?le.value=Ae.copy():!Ae&&"hour"in le.value&&(le.value=Oe(le.value)),z.value&&(ue.value=!1)}),HO({isDateUnavailable:p.value,isDateDisabled:v.value,locale:B,disabled:l,pagedNavigation:i,weekStartsOn:J,weekdayFormat:u,fixedWeeks:d,numberOfMonths:c,readonly:o,preventDeselect:f,modelValue:K,placeholder:le,defaultOpen:h,modal:k,open:ue,id:S,name:x,required:E,minValue:L,maxValue:D,granularity:A,hideTimeZone:R,hourCycle:F,dateFieldRef:we,dir:O,step:I,onDateChange(Ae){Ae?K.value&&!f.value&&Ae&&K.value.compare(Ae)===0?K.value=void 0:K.value=Ae.copy():K.value=void 0},onPlaceholderChange(Ae){le.value=Ae.copy()},closeOnSelect:z}),(Ae,ie)=>(m(),j(s(w1),{open:s(ue),"onUpdate:open":ie[0]||(ie[0]=xe=>Ct(ue)?ue.value=xe:null),"default-open":s(h),modal:s(k)},{default:q(()=>[ge(Ae.$slots,"default")]),_:3},8,["open","default-open","modal"]))}}),WO=KO,GO=ae({__name:"DatePickerCalendar",setup(e){const t=tp();return(n,a)=>(m(),j(s(hD),ze({isDateDisabled:s(t).isDateDisabled,isDateUnavailable:s(t).isDateUnavailable,minValue:s(t).minValue.value,maxValue:s(t).maxValue.value,locale:s(t).locale.value,disabled:s(t).disabled.value,pagedNavigation:s(t).pagedNavigation.value,weekStartsOn:s(t).weekStartsOn.value,weekdayFormat:s(t).weekdayFormat.value,fixedWeeks:s(t).fixedWeeks.value,numberOfMonths:s(t).numberOfMonths.value,readonly:s(t).readonly.value,preventDeselect:s(t).preventDeselect.value,dir:s(t).dir.value},{"model-value":s(t).modelValue.value,placeholder:s(t).placeholder.value,multiple:!1,"onUpdate:modelValue":a[0]||(a[0]=r=>{r&&s(t).modelValue.value&&s(ql)(r,s(t).modelValue.value)||s(t).onDateChange(r)}),"onUpdate:placeholder":a[1]||(a[1]=r=>{s(ql)(r,s(t).placeholder.value)||s(t).onPlaceholderChange(r)})}),{default:q(({weekDays:r,grid:l,date:o,weekStartsOn:i,locale:u,fixedWeeks:d})=>[ge(n.$slots,"default",{date:o,grid:l,weekDays:r,weekStartsOn:i,locale:u,fixedWeeks:d})]),_:3},16,["model-value","placeholder"]))}}),YO=GO,JO=ae({__name:"DatePickerCell",props:{date:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(gD),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),ZO=JO,XO=ae({__name:"DatePickerCellTrigger",props:{day:{type:null,required:!0},month:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(_D),nt(lt(t)),{default:q(r=>[ge(n.$slots,"default",nt(lt(r)))]),_:3},16))}}),QO=XO,eM=ae({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=xu(bf(n,"trapFocus","disableOutsidePointerEvents")),{forwardRef:l}=Ye(),o=ao();return Hb(),(i,u)=>(m(),j(s(Bf),{"as-child":"",loop:"",trapped:i.trapFocus,onMountAutoFocus:u[5]||(u[5]=d=>a("openAutoFocus",d)),onUnmountAutoFocus:u[6]||(u[6]=d=>a("closeAutoFocus",d))},{default:q(()=>[N(s(Nf),{"as-child":"","disable-outside-pointer-events":i.disableOutsidePointerEvents,onPointerDownOutside:u[0]||(u[0]=d=>a("pointerDownOutside",d)),onInteractOutside:u[1]||(u[1]=d=>a("interactOutside",d)),onEscapeKeyDown:u[2]||(u[2]=d=>a("escapeKeyDown",d)),onFocusOutside:u[3]||(u[3]=d=>a("focusOutside",d)),onDismiss:u[4]||(u[4]=d=>s(o).onOpenChange(!1))},{default:q(()=>[N(s(m1),ze(s(r),{id:s(o).contentId,ref:s(l),"data-state":s(o).open.value?"open":"closed","aria-labelledby":s(o).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:q(()=>[ge(i.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),$1=eM,tM=ae({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=ao(),l=M(!1);kf(!0);const o=va(n,a),{forwardRef:i,currentElement:u}=Ye();return Lf(u),(d,c)=>(m(),j($1,ze(s(o),{ref:s(i),"trap-focus":s(r).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:c[0]||(c[0]=ft(f=>{a("closeAutoFocus",f),l.value||s(r).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:c[1]||(c[1]=f=>{a("pointerDownOutside",f);const v=f.detail.originalEvent,p=v.button===0&&v.ctrlKey===!0,h=v.button===2||p;l.value=h}),onFocusOutside:c[2]||(c[2]=ft(()=>{},["prevent"]))}),{default:q(()=>[ge(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),nM=tM,aM=ae({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=ao(),l=M(!1),o=M(!1),i=va(n,a);return(u,d)=>(m(),j($1,ze(s(i),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{a("closeAutoFocus",c),c.defaultPrevented||(l.value||s(r).triggerElement.value?.focus(),c.preventDefault()),l.value=!1,o.value=!1}),onInteractOutside:d[1]||(d[1]=async c=>{a("interactOutside",c),c.defaultPrevented||(l.value=!0,c.detail.originalEvent.type==="pointerdown"&&(o.value=!0));const f=c.target;s(r).triggerElement.value?.contains(f)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.value&&c.preventDefault()})}),{default:q(()=>[ge(u.$slots,"default")]),_:3},16))}}),rM=aM,lM=ae({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=ao(),l=va(n,a),{forwardRef:o}=Ye();return r.contentId||=Ia(void 0,"reka-popover-content"),(i,u)=>(m(),j(s(Zr),{present:i.forceMount||s(r).open.value},{default:q(()=>[s(r).modal.value?(m(),j(nM,ze({key:0},s(l),{ref:s(o)}),{default:q(()=>[ge(i.$slots,"default")]),_:3},16)):(m(),j(rM,ze({key:1},s(l),{ref:s(o)}),{default:q(()=>[ge(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),C1=lM,oM=ae({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(wu),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),S1=oM,sM=ae({__name:"DatePickerContent",props:{portal:{type:Object,required:!1},forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,a=t,r=_(()=>({...n,portal:void 0})),l=va(r,a);return(o,i)=>(m(),j(s(S1),nt(lt(o.portal)),{default:q(()=>[N(s(C1),ze({...s(l),...o.$attrs},{onOpenAutoFocus:i[0]||(i[0]=u=>{a("openAutoFocus",u),!u.defaultPrevented&&u.target&&(s(zb)(u.target),u.preventDefault())})}),{default:q(()=>[ge(o.$slots,"default")]),_:3},16)]),_:3},16))}}),iM=sM,uM=ae({__name:"DatePickerField",setup(e){const t=tp();return(n,a)=>(m(),j(s(NO),ze({ref:s(t).dateFieldRef,"model-value":s(t).modelValue.value,placeholder:s(t).placeholder.value},{id:s(t).id.value,name:s(t).name.value,disabled:s(t).disabled.value,minValue:s(t).minValue.value,maxValue:s(t).maxValue.value,readonly:s(t).readonly.value,hourCycle:s(t).hourCycle.value,granularity:s(t).granularity.value,hideTimeZone:s(t).hideTimeZone.value,locale:s(t).locale.value,isDateUnavailable:s(t).isDateUnavailable,required:s(t).required.value,dir:s(t).dir.value,step:s(t).step.value},{"onUpdate:modelValue":a[0]||(a[0]=r=>{r&&s(t).modelValue.value&&r.compare(s(t).modelValue.value)===0||s(t).onDateChange(r)}),"onUpdate:placeholder":a[1]||(a[1]=r=>{r.compare(s(t).placeholder.value)!==0&&s(t).onPlaceholderChange(r)})}),{default:q(({segments:r,modelValue:l})=>[ge(n.$slots,"default",{segments:r,modelValue:l})]),_:3},16,["model-value","placeholder"]))}}),cM=uM,dM=ae({__name:"DatePickerGrid",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(kD),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),fM=dM,pM=ae({__name:"DatePickerGridBody",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s($D),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),mM=pM,vM=ae({__name:"DatePickerGridHead",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(SD),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),hM=vM,yM=ae({__name:"DatePickerGridRow",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(AD),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),Uv=yM,gM=ae({__name:"DatePickerHeadCell",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(DD),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),bM=gM,_M=ae({__name:"DatePickerHeader",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(MD),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),xM=_M,kM=ae({__name:"DatePickerHeading",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(ID),nt(lt(t)),{default:q(({headingValue:r})=>[ge(n.$slots,"default",{headingValue:r},()=>[_e($(r),1)])]),_:3},16))}}),wM=kM,$M=ae({__name:"DatePickerInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(FO),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),CM=$M,SM=ae({__name:"DatePickerNext",props:{nextPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(qD),nt(lt(t)),{default:q(r=>[ge(n.$slots,"default",nt(lt(r)))]),_:3},16))}}),EM=SM,AM=ae({__name:"DatePickerPrev",props:{prevPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(ND),nt(lt(t)),{default:q(r=>[ge(n.$slots,"default",nt(lt(r)))]),_:3},16))}}),TM=AM,DM=ae({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=ao(),{forwardRef:a,currentElement:r}=Ye();return n.triggerId||=Ia(void 0,"reka-popover-trigger"),wt(()=>{n.triggerElement.value=r.value}),(l,o)=>(m(),j(zt(s(n).hasCustomAnchor.value?s(Qe):s(jf)),{"as-child":""},{default:q(()=>[N(s(Qe),{id:s(n).triggerId,ref:s(a),type:l.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":s(n).open.value,"aria-controls":s(n).contentId,"data-state":s(n).open.value?"open":"closed",as:l.as,"as-child":t.asChild,onClick:s(n).onOpenToggle},{default:q(()=>[ge(l.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),OM=DM,MM=ae({__name:"DatePickerTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=tp();return(a,r)=>(m(),j(s(OM),ze({"data-reka-date-field-segment":"trigger"},t,{disabled:s(n).disabled.value,onFocusin:r[0]||(r[0]=l=>{s(n).dateFieldRef.value?.setFocusedElement(l.target)})}),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["disabled"]))}}),PM=MM;const[E1,IM]=$t("DropdownMenuRoot");var RM=ae({__name:"DropdownMenuRoot",props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const n=e,a=t;Ye();const r=Mt(n,"open",a,{defaultValue:n.defaultOpen,passive:n.open===void 0}),l=M(),{modal:o,dir:i}=Vt(n),u=ma(i);return IM({open:r,onOpenChange:d=>{r.value=d},onOpenToggle:()=>{r.value=!r.value},triggerId:"",triggerElement:l,contentId:"",modal:o,dir:u}),(d,c)=>(m(),j(s(aO),{open:s(r),"onUpdate:open":c[0]||(c[0]=f=>Ct(r)?r.value=f:null),dir:s(u),modal:s(o)},{default:q(()=>[ge(d.$slots,"default",{open:s(r)})]),_:3},8,["open","dir","modal"]))}}),A1=RM,qM=ae({__name:"DropdownMenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(e,{emit:t}){const r=va(e,t);Ye();const l=E1(),o=M(!1);function i(u){u.defaultPrevented||(o.value||setTimeout(()=>{l.triggerElement.value?.focus()},0),o.value=!1,u.preventDefault())}return l.contentId||=Ia(void 0,"reka-dropdown-menu-content"),(u,d)=>(m(),j(s(gO),ze(s(r),{id:s(l).contentId,"aria-labelledby":s(l)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-dropdown-menu-content-available-width":"var(--reka-popper-available-width)","--reka-dropdown-menu-content-available-height":"var(--reka-popper-available-height)","--reka-dropdown-menu-trigger-width":"var(--reka-popper-anchor-width)","--reka-dropdown-menu-trigger-height":"var(--reka-popper-anchor-height)"},onCloseAutoFocus:i,onInteractOutside:d[0]||(d[0]=c=>{if(c.defaultPrevented)return;const f=c.detail.originalEvent,v=f.button===0&&f.ctrlKey===!0,p=f.button===2||v;(!s(l).modal.value||p)&&(o.value=!0),s(l).triggerElement.value?.contains(c.target)&&c.preventDefault()})}),{default:q(()=>[ge(u.$slots,"default")]),_:3},16,["id","aria-labelledby"]))}}),T1=qM,LM=ae({__name:"DropdownMenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,r=Jr(t);return Ye(),(l,o)=>(m(),j(s(k1),nt(lt({...n,...s(r)})),{default:q(()=>[ge(l.$slots,"default")]),_:3},16))}}),Pd=LM,NM=ae({__name:"DropdownMenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return Ye(),(n,a)=>(m(),j(s(fO),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),BM=NM,FM=ae({__name:"DropdownMenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return Ye(),(n,a)=>(m(),j(s($O),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),VM=FM,zM=ae({__name:"DropdownMenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,a)=>(m(),j(s(SO),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),D1=zM,jM=ae({__name:"DropdownMenuRadioGroup",props:{modelValue:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=Jr(t);return Ye(),(l,o)=>(m(),j(s(DO),nt(lt({...n,...s(r)})),{default:q(()=>[ge(l.$slots,"default")]),_:3},16))}}),UM=jM,HM=ae({__name:"DropdownMenuRadioItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const r=va(e,t);return Ye(),(l,o)=>(m(),j(s(MO),nt(lt(s(r))),{default:q(()=>[ge(l.$slots,"default")]),_:3},16))}}),KM=HM,WM=ae({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return Ye(),(n,a)=>(m(),j(s(IO),nt(lt(t)),{default:q(()=>[ge(n.$slots,"default")]),_:3},16))}}),Hv=WM,GM=ae({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=E1(),{forwardRef:a,currentElement:r}=Ye();return wt(()=>{n.triggerElement=r}),n.triggerId||=Ia(void 0,"reka-dropdown-menu-trigger"),(l,o)=>(m(),j(s(ZD),{"as-child":""},{default:q(()=>[N(s(Qe),{id:s(n).triggerId,ref:s(a),type:l.as==="button"?"button":void 0,"as-child":t.asChild,as:l.as,"aria-haspopup":"menu","aria-expanded":s(n).open.value,"aria-controls":s(n).open.value?s(n).contentId:void 0,"data-disabled":l.disabled?"":void 0,disabled:l.disabled,"data-state":s(n).open.value?"open":"closed",onClick:o[0]||(o[0]=async i=>{!l.disabled&&i.button===0&&i.ctrlKey===!1&&(s(n)?.onOpenToggle(),await Je(),s(n).open.value&&i.preventDefault())}),onKeydown:o[1]||(o[1]=ia(i=>{l.disabled||(["Enter"," "].includes(i.key)&&s(n).onOpenToggle(),i.key==="ArrowDown"&&s(n).onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())},["enter","space","arrow-down"]))},{default:q(()=>[ge(l.$slots,"default")]),_:3},8,["id","type","as-child","as","aria-expanded","aria-controls","data-disabled","disabled","data-state"])]),_:3}))}}),O1=GM;const cs=100,[YM,JM]=$t("ProgressRoot"),Vi=e=>typeof e=="number";function ZM(e,t){return gn(e)||Vi(e)&&!Number.isNaN(e)&&e<=t&&e>=0?e:(console.error(`Invalid prop \`value\` of value \`${e}\` supplied to \`ProgressRoot\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${cs} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`),null)}function XM(e){return Vi(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${cs}\`.`),cs)}var QM=ae({__name:"ProgressRoot",props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:cs},getValueLabel:{type:Function,required:!1,default:(e,t)=>Vi(e)?`${Math.round(e/t*cs)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue","update:max"],setup(e,{emit:t}){const n=e,a=t;Ye();const r=Mt(n,"modelValue",a,{passive:n.modelValue===void 0}),l=Mt(n,"max",a,{passive:n.max===void 0});Ve(()=>r.value,async i=>{const u=ZM(i,n.max);u!==i&&(await Je(),r.value=u)},{immediate:!0}),Ve(()=>n.max,i=>{const u=XM(n.max);u!==i&&(l.value=u)},{immediate:!0});const o=_(()=>gn(r.value)?"indeterminate":r.value===l.value?"complete":"loading");return JM({modelValue:r,max:l,progressState:o}),(i,u)=>(m(),j(s(Qe),{"as-child":i.asChild,as:i.as,"aria-valuemax":s(l),"aria-valuemin":0,"aria-valuenow":Vi(s(r))?s(r):void 0,"aria-valuetext":i.getValueText?.(s(r),s(l)),"aria-label":i.getValueLabel(s(r),s(l)),role:"progressbar","data-state":o.value,"data-value":s(r)??void 0,"data-max":s(l)},{default:q(()=>[ge(i.$slots,"default",{modelValue:s(r)})]),_:3},8,["as-child","as","aria-valuemax","aria-valuenow","aria-valuetext","aria-label","data-state","data-value","data-max"]))}}),Ac=QM,e5=ae({__name:"ProgressIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=YM();return Ye(),(a,r)=>(m(),j(s(Qe),ze(t,{"data-state":s(n).progressState.value,"data-value":s(n).modelValue?.value??void 0,"data-max":s(n).max.value}),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["data-state","data-value","data-max"]))}}),Tc=e5;const t5="radio.select";function n5(e,t,n){gf(t5,n,{originalEvent:e,value:t})}var a5=ae({__name:"Radio",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:checked","select"],setup(e,{emit:t}){const n=e,a=t,r=Mt(n,"checked",a,{passive:n.checked===void 0}),{value:l}=Vt(n),{forwardRef:o,currentElement:i}=Ye(),u=qf(i),d=_(()=>n.id&&i.value?document.querySelector(`[for="${n.id}"]`)?.innerText??n.value:void 0);function c(f){n.disabled||n5(f,n.value,v=>{a("select",v),!v?.defaultPrevented&&(r.value=!0,u.value&&v.stopPropagation())})}return(f,v)=>(m(),j(s(Qe),ze(f.$attrs,{id:f.id,ref:s(o),role:"radio",type:f.as==="button"?"button":void 0,as:f.as,"aria-checked":s(r),"aria-label":d.value,"as-child":f.asChild,disabled:f.disabled?"":void 0,"data-state":s(r)?"checked":"unchecked","data-disabled":f.disabled?"":void 0,value:s(l),required:f.required,name:f.name,onClick:ft(c,["stop"])}),{default:q(()=>[ge(f.$slots,"default",{checked:s(r)}),s(u)&&f.name?(m(),j(s(zf),{key:0,type:"radio",tabindex:"-1",value:s(l),checked:!!s(r),name:f.name,disabled:f.disabled,required:f.required},null,8,["value","checked","name","disabled","required"])):Q("v-if",!0)]),_:3},16,["id","type","as","aria-checked","aria-label","as-child","disabled","data-state","data-disabled","value","required","name"]))}}),r5=a5;const[l5,o5]=$t("RadioGroupRoot");var s5=ae({__name:"RadioGroupRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=Ye(),o=Mt(n,"modelValue",a,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:i,loop:u,orientation:d,name:c,required:f,dir:v}=Vt(n),p=ma(v),h=qf(l);return o5({modelValue:o,changeModelValue:k=>{o.value=k},disabled:i,loop:u,orientation:d,name:c?.value,required:f}),(k,S)=>(m(),j(s(Tu),{"as-child":"",orientation:s(d),dir:s(p),loop:s(u)},{default:q(()=>[N(s(Qe),{ref:s(r),role:"radiogroup","data-disabled":s(i)?"":void 0,"as-child":k.asChild,as:k.as,"aria-orientation":s(d),"aria-required":s(f),dir:s(p)},{default:q(()=>[ge(k.$slots,"default",{modelValue:s(o)}),s(h)&&s(c)?(m(),j(s(zf),{key:0,required:s(f),disabled:s(i),value:s(o),name:s(c)},null,8,["required","disabled","value","name"])):Q("v-if",!0)]),_:3},8,["data-disabled","as-child","as","aria-orientation","aria-required","dir"])]),_:3},8,["orientation","dir","loop"]))}}),M1=s5;const[SU,i5]=$t("RadioGroupItem");var u5=ae({inheritAttrs:!1,__name:"RadioGroupItem",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=Ye(),o=l5(),i=_(()=>o.disabled.value||n.disabled),u=_(()=>o.required.value||n.required),d=_(()=>rs(o.modelValue?.value,n.value));i5({disabled:i,checked:d});const c=M(!1),f=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];Wl("keydown",p=>{f.includes(p.key)&&(c.value=!0)}),Wl("keyup",()=>{c.value=!1});function v(){setTimeout(()=>{c.value&&l.value?.click()},0)}return(p,h)=>(m(),j(s(Du),{checked:d.value,disabled:i.value,"as-child":"",focusable:!i.value,active:d.value},{default:q(()=>[N(r5,ze({...p.$attrs,...n},{ref:s(r),checked:d.value,required:u.value,disabled:i.value,"onUpdate:checked":h[0]||(h[0]=k=>s(o).changeModelValue(p.value)),onSelect:h[1]||(h[1]=k=>a("select",k)),onKeydown:h[2]||(h[2]=ia(ft(()=>{},["prevent"]),["enter"])),onFocus:v}),{default:q(()=>[ge(p.$slots,"default",{checked:d.value,required:u.value,disabled:i.value})]),_:3},16,["checked","required","disabled"])]),_:3},8,["checked","disabled","focusable","active"]))}}),P1=u5,c5=ae({__name:"BaseSeparator",props:{orientation:{type:String,required:!1,default:"horizontal"},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=["horizontal","vertical"];function a(i){return n.includes(i)}const r=_(()=>a(t.orientation)?t.orientation:"horizontal"),l=_(()=>r.value==="vertical"?t.orientation:void 0),o=_(()=>t.decorative?{role:"none"}:{"aria-orientation":l.value,role:"separator"});return(i,u)=>(m(),j(s(Qe),ze({as:i.as,"as-child":i.asChild,"data-orientation":r.value},o.value),{default:q(()=>[ge(i.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),d5=c5;const[np,f5]=$t("TabsRoot");var p5=ae({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,{orientation:r,unmountOnHide:l,dir:o}=Vt(n),i=ma(o);Ye();const u=Mt(n,"modelValue",a,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),d=M(),c=Jl(new Set);return f5({modelValue:u,changeModelValue:f=>{u.value=f},orientation:r,dir:i,unmountOnHide:l,activationMode:n.activationMode,baseId:Ia(void 0,"reka-tabs"),tabsList:d,contentIds:c,registerContent:f=>{c.value=new Set([...c.value,f])},unregisterContent:f=>{const v=new Set(c.value);v.delete(f),c.value=v}}),(f,v)=>(m(),j(s(Qe),{dir:s(i),"data-orientation":s(r),"as-child":f.asChild,as:f.as},{default:q(()=>[ge(f.$slots,"default",{modelValue:s(u)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),m5=p5;function I1(e,t){return`${e}-trigger-${t}`}function R1(e,t){return`${e}-content-${t}`}var v5=ae({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n}=Ye(),a=np(),r=_(()=>I1(a.baseId,t.value)),l=_(()=>R1(a.baseId,t.value)),o=_(()=>t.value===a.modelValue.value),i=M(o.value);return wt(()=>{a.registerContent(t.value),requestAnimationFrame(()=>{i.value=!1})}),St(()=>{a.unregisterContent(t.value)}),(u,d)=>(m(),j(s(Zr),{present:u.forceMount||o.value,"force-mount":""},{default:q(({present:c})=>[N(s(Qe),{id:l.value,ref:s(n),"as-child":u.asChild,as:u.as,role:"tabpanel","data-state":o.value?"active":"inactive","data-orientation":s(a).orientation.value,"aria-labelledby":r.value,hidden:!c,tabindex:"0",style:bn({animationDuration:i.value?"0s":void 0})},{default:q(()=>[!s(a).unmountOnHide.value||c?ge(u.$slots,"default",{key:0}):Q("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),Kv=v5,h5=ae({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{loop:n}=Vt(t),{forwardRef:a,currentElement:r}=Ye(),l=np();return l.tabsList=r,(o,i)=>(m(),j(s(Tu),{"as-child":"",orientation:s(l).orientation.value,dir:s(l).dir.value,loop:s(n)},{default:q(()=>[N(s(Qe),{ref:s(a),role:"tablist","as-child":o.asChild,as:o.as,"aria-orientation":s(l).orientation.value},{default:q(()=>[ge(o.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),y5=h5,g5=ae({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,{forwardRef:n}=Ye(),a=np(),r=_(()=>I1(a.baseId,t.value)),l=_(()=>a.contentIds.value.has(t.value)?R1(a.baseId,t.value):void 0),o=_(()=>t.value===a.modelValue.value);return(i,u)=>(m(),j(s(Du),{"as-child":"",focusable:!i.disabled,active:o.value},{default:q(()=>[N(s(Qe),{id:r.value,ref:s(n),role:"tab",type:i.as==="button"?"button":void 0,as:i.as,"as-child":i.asChild,"aria-selected":o.value?"true":"false","aria-controls":l.value,"data-state":o.value?"active":"inactive",disabled:i.disabled,"data-disabled":i.disabled?"":void 0,"data-orientation":s(a).orientation.value,onMousedown:u[0]||(u[0]=ft(d=>{!i.disabled&&d.ctrlKey===!1?s(a).changeModelValue(i.value):d.preventDefault()},["left"])),onKeydown:u[1]||(u[1]=ia(d=>s(a).changeModelValue(i.value),["enter","space"])),onFocus:u[2]||(u[2]=()=>{const d=s(a).activationMode!=="manual";!o.value&&!i.disabled&&d&&s(a).changeModelValue(i.value)})},{default:q(()=>[ge(i.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),Wv=g5;const[b5,_5]=$t("TimeFieldRoot");function Ks(e,t=Cs(Hn())){return e&&"day"in e?e:ca(t,e)}var x5=ae({inheritAttrs:!1,__name:"TimeFieldRoot",props:{defaultValue:{type:Object,required:!1,default:void 0},defaultPlaceholder:{type:Object,required:!1},placeholder:{type:Object,required:!1,default:void 0},modelValue:{type:[Object,null],required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},stepSnapping:{type:Boolean,required:!1,default:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:Object,required:!1},minValue:{type:Object,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},id:{type:String,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:placeholder"],setup(e,{expose:t,emit:n}){const a=e,r=n,{disabled:l,readonly:o,granularity:i,defaultValue:u,minValue:d,maxValue:c,stepSnapping:f,dir:v,locale:p}=Vt(a),h=ku(p),k=ma(v),S=Rf(h.value,{hourCycle:ss(a.hourCycle)}),{primitiveElement:x,currentElement:E}=Ur(),L=M(new Set),D=_(()=>Vb(a)),A=_(()=>d.value?Ks(d.value):void 0),R=_(()=>c.value?Ks(c.value):void 0);wt(()=>{jv(E.value).forEach(me=>L.value.add(me))});const F=Mt(a,"modelValue",r,{defaultValue:u.value,passive:a.modelValue===void 0}),W=_({get(){return gn(F.value)?F.value:Ks(F.value)},set(me){return me?F.value=F.value&&"day"in F.value?me:new aa(me.hour,me.minute,me.second,F.value?.millisecond):F.value=me,me}}),C=dA({defaultPlaceholder:a.placeholder,defaultValue:F.value}),I=Mt(a,"placeholder",r,{defaultValue:a.defaultPlaceholder??C.copy(),passive:a.placeholder===void 0}),z=_({get(){return Ks(I.value)},set(me){return me&&(I.value="day"in I.value?me.copy():new aa(me.hour,me.minute,me.second,I.value?.millisecond)),me}}),O=_(()=>i.value?i.value:"minute"),B=_(()=>F.value?!!(A.value&&ar(W.value,A.value)||R.value&&ar(R.value,W.value)):!1),J=UT(O.value),K=M(F.value?{...Md({value:W.value,formatter:S})}:{...J}),H=_(()=>y1({granularity:O.value,dateRef:z.value,formatter:S,hideTimeZone:a.hideTimeZone,hourCycle:a.hourCycle,segmentValues:K.value,locale:h,isTimeValue:!0})),le=_(()=>{const me=H.value.arr;return a.hourCycle===12?me.map(Y=>{if(Y.part==="hour"&&"hour"in K.value){const fe=K.value.hour;if(fe!==null){const G=fe===0?12:fe>12?fe-12:fe;return{...Y,value:G.toString()}}}return Y}):me}),ue=_(()=>le.value.filter(({part:me})=>me!=="literal"));Ve(h,me=>{S.getLocale()!==me&&(S.setLocale(me),Je(()=>{L.value.clear(),jv(E.value).forEach(Y=>L.value.add(Y))}))}),Ve(W,me=>{!gn(me)&&(!ql(z.value,me)||z.value.compare(me)!==0)&&(I.value=me.copy())}),Ve([W,h],([me])=>{gn(me)?Object.values(K.value).every(Y=>Y!==null)&&gn(me)&&(K.value={...J}):K.value={...Md({value:me,formatter:S})}});const we=M(null),Oe=_(()=>Array.from(L.value).findIndex(me=>me.getAttribute("data-reka-time-field-segment")===we.value?.getAttribute("data-reka-time-field-segment"))),Ae=_(()=>{const me=k.value==="rtl"?-1:1;return(me<0?Oe.value<0:Oe.value>L.value.size-1)?null:Array.from(L.value)[Oe.value+me]}),ie=_(()=>{const me=k.value==="rtl"?-1:1;return(me>0?Oe.value<0:Oe.value>L.value.size-1)?null:Array.from(L.value)[Oe.value-me]}),xe=Ql();function U(me){me.isComposing||ba(me.key)&&(me.key===xe.ARROW_LEFT&&ie.value?.focus(),me.key===xe.ARROW_RIGHT&&Ae.value?.focus())}function ke(me){we.value=me}return _5({locale:h,modelValue:W,placeholder:z,disabled:l,formatter:S,hourCycle:a.hourCycle,step:D,stepSnapping:f,readonly:o,segmentValues:K,isInvalid:B,segmentContents:ue,elements:L,setFocusedElement:ke,focusNext(){Ae.value?.focus()}}),t({setFocusedElement:ke}),(me,Y)=>(m(),j(s(Qe),ze(me.$attrs,{ref_key:"primitiveElement",ref:x,role:"group","aria-disabled":s(l)?!0:void 0,"data-disabled":s(l)?"":void 0,"data-readonly":s(o)?"":void 0,"data-invalid":B.value?"":void 0,dir:s(k),onKeydown:ia(U,["left","right"])}),{default:q(()=>[ge(me.$slots,"default",{modelValue:s(F),segments:le.value,isInvalid:B.value}),N(s(Vf),{id:me.id,as:"input",feature:"focusable",tabindex:"-1",value:s(F)?s(F).toString():"",name:me.name,disabled:s(l),required:me.required,onFocus:Y[0]||(Y[0]=fe=>Array.from(L.value)?.[0]?.focus())},null,8,["id","value","name","disabled","required"])]),_:3},16,["aria-disabled","data-disabled","data-readonly","data-invalid","dir"]))}}),Gv=x5,k5=ae({__name:"TimeFieldInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=b5(),a=M(!0),r=M(!1),{handleSegmentClick:l,handleSegmentKeydown:o,handleSegmentBeforeInput:i,handleSegmentCompositionStart:u,handleSegmentCompositionEnd:d,handleSegmentFocusOut:c,attributes:f}=g1({hasLeftFocus:a,lastKeyZero:r,placeholder:n.placeholder,hourCycle:n.hourCycle,step:n.step,stepSnapping:n.stepSnapping,segmentValues:n.segmentValues,formatter:n.formatter,part:t.part,disabled:n.disabled,readonly:n.readonly,focusNext:n.focusNext,modelValue:n.modelValue}),v=_(()=>n.disabled.value),p=_(()=>n.readonly.value),h=_(()=>n.isInvalid.value);return(k,S)=>(m(),j(s(Qe),ze({as:k.as,"as-child":k.asChild},s(f),{contenteditable:v.value||p.value?!1:k.part!=="literal","data-reka-time-field-segment":k.part,"aria-disabled":v.value?!0:void 0,"aria-readonly":p.value?!0:void 0,"data-disabled":v.value?"":void 0,"data-invalid":h.value?"":void 0,"aria-invalid":h.value?!0:void 0},Ly(k.part!=="literal"?{mousedown:s(l),keydown:s(o),beforeinput:s(i),compositionstart:s(u),compositionend:s(d),focusout:()=>{a.value=!0,s(c)()},focusin:x=>{s(n).setFocusedElement(x.target)}}:{})),{default:q(()=>[ge(k.$slots,"default")]),_:3},16,["as","as-child","contenteditable","data-reka-time-field-segment","aria-disabled","aria-readonly","data-disabled","data-invalid","aria-invalid"]))}}),Yv=k5,w5=ae({__name:"ToolbarButton",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,{forwardRef:n}=Ye();return(a,r)=>(m(),j(s(Du),{"as-child":"",focusable:!a.disabled},{default:q(()=>[N(s(Qe),ze({ref:s(n),type:a.as==="button"?"button":void 0},t),{default:q(()=>[ge(a.$slots,"default")]),_:3},16,["type"])]),_:3},8,["focusable"]))}}),ko=w5;const[$5,C5]=$t("ToolbarRoot");var S5=ae({__name:"ToolbarRoot",props:{orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},loop:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{orientation:n,dir:a}=Vt(t),r=ma(a),{forwardRef:l}=Ye();return C5({orientation:n,dir:r}),(o,i)=>(m(),j(s(Tu),{"as-child":"",orientation:s(n),dir:s(r),loop:o.loop},{default:q(()=>[N(s(Qe),{ref:s(l),role:"toolbar","aria-orientation":s(n),"as-child":o.asChild,as:o.as},{default:q(()=>[ge(o.$slots,"default")]),_:3},8,["aria-orientation","as-child","as"])]),_:3},8,["orientation","dir","loop"]))}}),E5=S5,A5=ae({__name:"ToolbarSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=$5();return Ye(),(a,r)=>(m(),j(d5,{orientation:s(n).orientation.value,"as-child":t.asChild,as:a.as},{default:q(()=>[ge(a.$slots,"default")]),_:3},8,["orientation","as-child","as"]))}}),Dc=A5;const T5=/^filter\[(.+)\]$/,D5=/^[1-9]\d*$/;function vl(e){const t=Array.isArray(e)?e[e.length-1]:e;return typeof t=="string"?t:""}function Jv(e){return D5.test(e)?Number(e):void 0}function q1(e){const t={},n=vl(e.search).trim();n!==""&&(t.search=n);const a=vl(e.sort).trim();if(a!==""){t.sort=a;const i=vl(e.dir);t.dir=i==="desc"?"desc":"asc"}const r=Jv(vl(e.page));r!==void 0&&(t.page=r);const l=Jv(vl(e.per_page));l!==void 0&&(t.per_page=l);const o={};for(const i of Object.keys(e).sort()){const u=T5.exec(i)?.[1],d=vl(e[i]);u&&d!==""&&(o[u]=d)}return Object.keys(o).length>0&&(t.filter=o),t}function zi(e){const t={};e.search&&(t.search=e.search),e.sort&&(t.sort=e.sort,t.dir=e.dir==="desc"?"desc":"asc"),e.page!==void 0&&e.page>1&&(t.page=String(e.page)),e.per_page!==void 0&&(t.per_page=String(e.per_page));for(const n of Object.keys(e.filter??{}).sort()){const a=e.filter?.[n];a!==void 0&&a!==""&&(t[`filter[${n}]`]=a)}return t}function Al(e){return JSON.stringify(zi(e))}const L1="summer-admin.list:",O5=Al({});let Id=null;function Mu(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function N1(e){return`${L1}${e}:`}function B1(e){return Id===null?null:N1(Id)+e}function Rd(e){try{Mu()?.removeItem(e)}catch{}}function Zv(e){const t=Mu();if(t)try{const n=[];for(let a=0;a!0);return}const n=N1(t);Zv(a=>!a.startsWith(n))}function M5(e){const t=B1(e);if(t===null)return{};let n=null;try{n=Mu()?.getItem(t)??null}catch{return{}}if(n===null)return{};let a;try{a=JSON.parse(n)}catch{return Rd(t),{}}return typeof a!="object"||a===null||Array.isArray(a)||Object.getPrototypeOf(a)!==Object.prototype||!Object.values(a).every(r=>typeof r=="string")?(Rd(t),{}):q1(a)}function Ws(e,t){const n=B1(e);if(n!==null){if(Al(t)===O5){Rd(n);return}try{Mu()?.setItem(n,JSON.stringify(zi(t)))}catch{}}}const Br=M(null),F1=M(null);let Go=null;function V1(e){z1(),F1.value=e,!(e===null||e<=0)&&(Go=setTimeout(()=>{Go=null,lf()},e*800))}function z1(){Go!==null&&(clearTimeout(Go),Go=null)}n2(V1);const un=xt(Br);async function P5(e,t){const{data:n,response:a}=await Ne.POST("/auth/login",{body:{login:e,password:t}});return!a.ok||!n?!1:(V1(typeof n.data.expires_in=="number"?n.data.expires_in:null),!0)}async function j1(){const{data:e,response:t}=await Ne.GET("/auth/me");return Br.value=t.ok&&e?e.data:null,ap(Br.value?.id??null),await g3(Br.value),Br.value}function U1(e){if(!e)return"";const t=[e.first_name,e.last_name].map(n=>n.trim()).filter(Boolean);return t.length>0?t.slice(0,2).map(n=>n.charAt(0).toUpperCase()).join(""):e.login.slice(0,2).toUpperCase()}function Oc(e){Br.value=e,ap(e.id)}function H1(){z1(),Br.value=null,F1.value=null,ap(null)}function I5(e){H1();const t=e.currentRoute.value;t.name!=="login"&&e.push({name:"login",query:{redirect:t.fullPath}}).catch(()=>{})}async function R5(e){try{await Ne.POST("/auth/logout")}catch{}finally{H1(),i2([]),d2([])}e&&await e.replace({name:"login"}).catch(()=>{})}const q5=["src"],L5={key:1,class:"flex size-[34px] shrink-0 items-center justify-center rounded-full bg-accent text-[13px] font-bold text-on-accent","aria-hidden":"true","data-user-initials":""},N5={class:"flex flex-col leading-tight max-[1099px]:hidden","data-user-identity":""},B5={class:"font-semibold"},F5={key:0,class:"text-[12px] text-muted","data-user-role":""},V5={class:"flex items-center gap-3 px-2 py-2"},z5=["src"],j5={key:1,class:"flex size-10 shrink-0 items-center justify-center rounded-full bg-accent text-[14px] font-bold text-on-accent","aria-hidden":"true"},U5={class:"flex min-w-0 flex-col leading-tight"},H5={class:"truncate font-bold"},K5={class:"truncate text-[13px] text-muted"},W5={class:"flex size-[18px] items-center justify-center"},G5=ae({__name:"UserMenu",setup(e){const t=_r(),n=_(()=>{const v=un.value;if(!v)return"";const p=`${v.first_name} ${v.last_name}`.trim();return p===""?v.login:p}),a=_(()=>U1(un.value)),r=_(()=>un.value?.avatar?.thumb_url||un.value?.avatar?.url||""),l=_(()=>un.value?.role?.name??""),o=_(()=>p3.value||ua.value);function i(v){try{const p=new Intl.DisplayNames([v],{type:"language"}).of(v);if(p&&p!==v)return p.charAt(0).toLocaleUpperCase(v)+p.slice(1)}catch{}return v.toUpperCase()}const u=_(()=>l2.value.map(v=>({code:v,name:i(v)})));function d(v){typeof v=="string"&&v!==""&&b3(v)}async function c(){await t.push({name:"account"}).catch(()=>{})}async function f(){await R5(t)}return(v,p)=>(m(),j(s(A1),{modal:!1},{default:q(()=>[N(s(O1),{"data-user-menu":"",disabled:!s(un),"aria-label":`${s(g)("backend::lang.nav.user_menu")}: ${n.value}`,class:"flex h-input items-center gap-2.5 rounded-inner px-2 text-left transition-colors duration-150 ease-out hover:bg-hover"},{default:q(()=>[r.value?(m(),y("img",{key:0,src:r.value,alt:"","data-user-avatar":"",class:"size-[34px] shrink-0 rounded-full object-cover"},null,8,q5)):(m(),y("span",L5,$(a.value),1)),w("span",N5,[w("span",B5,$(n.value),1),l.value?(m(),y("span",F5,$(l.value),1)):Q("",!0)]),N(s(ur),{size:16,class:"text-muted","aria-hidden":"true"})]),_:1},8,["disabled","aria-label"]),N(s(D1),null,{default:q(()=>[N(s(T1),{"data-user-menu-content":"",align:"end","side-offset":8,class:"z-50 flex w-[280px] flex-col rounded-[14px] border border-border bg-surface p-2 text-text shadow-menu"},{default:q(()=>[w("div",V5,[r.value?(m(),y("img",{key:0,src:r.value,alt:"","data-user-avatar":"",class:"size-10 shrink-0 rounded-full object-cover"},null,8,z5)):(m(),y("span",j5,$(a.value),1)),w("span",U5,[w("span",H5,$(n.value),1),w("span",K5,$(s(un)?.email),1)])]),N(s(Pd),{"data-action":"account",class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:c},{default:q(()=>[N(s(GS),{size:18,"aria-hidden":"true"}),w("span",null,$(s(g)("backend::lang.myaccount.menu_label")),1)]),_:1}),u.value.length>1?(m(),y(pe,{key:0},[N(s(Hv),{class:"my-1 h-px bg-border"}),N(s(VM),{class:"px-3 pt-1 pb-1 text-[12px] font-semibold text-muted","data-language-label":""},{default:q(()=>[_e($(s(g)("backend::lang.nav.language")),1)]),_:1}),N(s(UM),{"model-value":o.value,"onUpdate:modelValue":d},{default:q(()=>[(m(!0),y(pe,null,Ie(u.value,h=>(m(),j(s(KM),{key:h.code,value:h.code,"data-locale-option":h.code,lang:h.code,class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover"},{default:q(()=>[w("span",W5,[N(s(BM),null,{default:q(()=>[N(s(jn),{size:18,"aria-hidden":"true"})]),_:1})]),w("span",null,$(h.name),1)]),_:2},1032,["value","data-locale-option","lang"]))),128))]),_:1},8,["model-value"])],64)):Q("",!0),N(s(Hv),{class:"my-1 h-px bg-border"}),N(s(Pd),{"data-action":"logout",class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:f},{default:q(()=>[N(s(Kg),{size:18,"aria-hidden":"true"}),w("span",null,$(s(g)("backend::lang.auth.logout")),1)]),_:1})]),_:1})]),_:1})]),_:1}))}}),Y5=["role","data-tone"],J5={class:"font-medium"},Z5=["aria-label","onClick"],X5=ae({__name:"Toast",setup(e){return(t,n)=>(m(),j(Sk,{tag:"div",name:"toast",class:"pointer-events-none fixed inset-x-0 bottom-[88px] z-50 flex flex-col items-center gap-2 px-4"},{default:q(()=>[(m(!0),y(pe,null,Ie(s(d3),a=>(m(),y("div",{key:a.id,role:a.tone==="danger"?"alert":"status","data-tone":a.tone,class:"pointer-events-auto flex max-w-[560px] items-center gap-3 rounded-[14px] bg-[#1d2740] py-3 pr-2.5 pl-3.5 text-white shadow-toast"},[w("span",{class:ve([a.tone==="danger"?"bg-[#f58a8a] text-[#1d2740]":"bg-accent text-on-accent","flex size-[26px] shrink-0 items-center justify-center rounded-full"]),"aria-hidden":"true"},[a.tone==="danger"?(m(),j(s(gt),{key:0,size:16})):(m(),j(s(jn),{key:1,size:16}))],2),w("span",J5,$(a.text),1),w("button",{type:"button","aria-label":s(g)("backend::lang.form.close"),class:"flex size-8 items-center justify-center rounded-pager text-[#c3cbda] transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:r=>s(ab)(a.id)},[N(s(Qt),{size:16,"aria-hidden":"true"})],8,Z5)],8,Y5))),128))]),_:1}))}}),Q5=[{combo:"mod+s",labelKey:"backend::lang.form.save"},{combo:"mod+enter",labelKey:"backend::lang.form.save_and_close"},{combo:"mod+shift+s",labelKey:"backend::lang.form.create_and_new"},{combo:"escape",labelKey:"backend::lang.shortcuts.leave"},{combo:"/",labelKey:"backend::lang.shortcuts.search"},{combo:"?",labelKey:"backend::lang.shortcuts.help"}],e8=new Set(["mod+s","mod+enter","mod+shift+s"]);function rp(e){const t=typeof navigator>"u"?"":navigator.platform||"";return/mac|iphone|ipad|ipod/i.test(t)}function t8(e){if(/^[a-z]$/i.test(e.key))return e.key.toLowerCase();const t=/^Key([A-Z])$/.exec(e.code??"");return t?t[1].toLowerCase():""}function K1(e){if(e.isComposing)return null;if(e.ctrlKey||e.metaKey)return e.altKey?null:e.key==="Enter"?e.shiftKey?null:"mod+enter":t8(e)==="s"?e.shiftKey?"mod+shift+s":"mod+s":null;if(e.altKey)return null;switch(e.key){case"Escape":return"escape";case"/":return"/";case"?":return"?";default:return null}}function n8(e){if(!e||typeof e.closest!="function")return!1;const t=e;return t.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])')!==null?!0:t.tagName.includes("-")&&t.closest('form, [role="form"]')!==null}function a8(e){return(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target}function W1(e,t=rp()){switch(e){case"mod+s":return t?["⌘","S"]:["Ctrl","S"];case"mod+enter":return t?["⌘","↩"]:["Ctrl","Enter"];case"mod+shift+s":return t?["⇧","⌘","S"]:["Ctrl","Shift","S"];case"escape":return["Esc"];default:return[e]}}function r8(e,t=rp()){return W1(e,t).join(t?"":"+")}function qn(e,t,n=rp()){return g("backend::lang.shortcuts.hint",{label:e,keys:r8(t,n)})}const Xv={"mod+s":"Control+S Meta+S","mod+enter":"Control+Enter Meta+Enter","mod+shift+s":"Control+Shift+S Meta+Shift+S",escape:"Escape","/":"/","?":"?"};function Pu(e){return e.split(/\s+/).filter(t=>t in Xv).map(t=>Xv[t]).join(" ")}function G1(e=document){return Array.from(e.querySelectorAll('[role="dialog"][aria-modal="true"], [role="alertdialog"]')).filter(n=>n.getAttribute("data-state")!=="closed").at(-1)??e}function lp(e,t){return t.querySelector(`[data-hotkey~="${e}"]`)}function l8(e=document){const t=G1(e);return Q5.filter(n=>n.combo==="?"||lp(n.combo,t)!==null)}const op=M(null),Qv=xt(op);function o8(){op.value=l8()}function Y1(){op.value=null}function J1(e){return e.disabled===!0||e.getAttribute("aria-disabled")==="true"}function eh(e){const t=K1(e);if(!t||!e8.has(t))return;t==="mod+s"&&e.preventDefault();const n=e.target?.ownerDocument??document,a=lp(t,G1(n));if(!a||(e.preventDefault(),e.stopPropagation(),e.repeat||J1(a)))return;const r=th(n),l=r instanceof HTMLElement&&r!==a&&r!==n.body?r:null;l&&(a.focus({preventScroll:!0}),th(n)===l&&l.blur()),a.click();const o=n.activeElement;l?.isConnected&&(o===a||o===n.body||o===null)&&l.focus({preventScroll:!0})}function th(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function nh(e){const t=K1(e);if(t!=="escape"&&t!=="/"&&t!=="?"||e.defaultPrevented||n8(a8(e)))return;const n=e.target?.ownerDocument??document;if(n.querySelector("[data-dismissable-layer]"))return;if(t==="?"){e.preventDefault(),o8();return}const a=lp(t,n);!a||J1(a)||(e.preventDefault(),a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement?(a.focus(),a.select()):a.click())}let Gs=0;function s8(){Gs===0&&(window.addEventListener("keydown",eh,!0),window.addEventListener("keydown",nh)),Gs++;let e=!1;return()=>{e||(e=!0,Gs--,Gs===0&&(window.removeEventListener("keydown",eh,!0),window.removeEventListener("keydown",nh)))}}const i8={class:"flex items-start gap-3"},u8={class:"flex min-w-0 flex-1 flex-col gap-1"},c8={class:"flex flex-col gap-2.5"},d8=["data-shortcut"],f8={class:"flex shrink-0 items-center gap-1"},p8={class:"text-right text-muted"},m8=ae({__name:"ShortcutHelpDialog",setup(e){function t(n){n||Y1()}return(n,a)=>(m(),j(s(Xr),{open:s(Qv)!==null,"onUpdate:open":t},{default:q(()=>[N(s(eo),null,{default:q(()=>[N(s(el),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),N(s(Qr),{"data-shortcut-help":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop"},{default:q(()=>[w("div",i8,[w("div",u8,[N(s(tl),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:q(()=>[_e($(s(g)("backend::lang.shortcuts.title")),1)]),_:1}),N(s(fr),{class:"text-muted"},{default:q(()=>[_e($(s(g)("backend::lang.shortcuts.description")),1)]),_:1})]),N(s(Hr),{"data-action":"close","aria-label":s(g)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:q(()=>[N(s(Qt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),w("dl",c8,[(m(!0),y(pe,null,Ie(s(Qv)??[],r=>(m(),y("div",{key:r.combo,"data-shortcut":r.combo,class:"flex items-center justify-between gap-4"},[w("dt",f8,[(m(!0),y(pe,null,Ie(s(W1)(r.combo),l=>(m(),y("kbd",{key:l,class:"inline-flex min-w-6 items-center justify-center rounded-pager border border-border bg-subtle px-1.5 font-mono text-[13px]"},$(l),1))),128))]),w("dd",p8,$(s(g)(r.labelKey)),1)],8,d8))),128))])]),_:1})]),_:1})]),_:1},8,["open"]))}}),v8={class:"flex min-w-0 flex-1 flex-col"},h8={class:"flex h-header shrink-0 items-center justify-between gap-4 border-b border-border bg-surface pr-6 pl-8"},y8={class:"flex shrink-0 items-center gap-1"},g8=["title","aria-label"],b8={class:"min-w-0 flex-1 px-8 py-7"},_8=ae({__name:"AppShell",setup(e){const t=Mn(),{collapsed:n,watchViewport:a}=ib(),r=a();St(r);const l=s8();St(()=>{l(),Y1()});const o=`${window.location.origin}/`,i=_(()=>gs(String(t.params.vendor??""),String(t.params.plugin??""))),u=_(()=>i.value?null:t.name==="settings-form"?rc(ns(String(t.params.code??""))):t.name==="plugins"?rc(Ig(t.path)):rc(fu(Zl(t.path)))),d=_(()=>(i.value||u.value)&&!n.value?"calc(var(--spacing-rail) + var(--spacing-panel))":"var(--spacing-rail)");return(c,f)=>(m(),y("div",{class:"flex min-h-screen bg-bg text-text",style:bn({"--shell-offset":d.value})},[N(P3),i.value&&!s(n)?(m(),j(N3,{key:0,entry:i.value},null,8,["entry"])):u.value&&!s(n)?(m(),j(j3,{key:1,section:u.value},null,8,["section"])):Q("",!0),w("div",v8,[w("header",h8,[N(W3),w("div",y8,[w("a",{"data-view-site":"",href:o,target:"_blank",rel:"noopener noreferrer",title:s(g)("backend::lang.nav.view_site"),"aria-label":s(g)("backend::lang.nav.view_site"),class:"flex size-input items-center justify-center rounded-inner text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text"},[N(s(zg),{class:"size-[18px]","aria-hidden":"true"})],8,g8),N(G5)])]),w("main",b8,[ge(c.$slots,"default")])]),N(X5),N(m8)],4))}}),x8=300*1e3,k8=30*1e3;function w8(e,t){return e!==""&&t!==""&&e!==t}async function $8(){try{const e=await globalThis.fetch(`${Gr.base}/build.json`,{cache:"no-store",credentials:"same-origin"});if(!e.ok)return"";const t=await e.json();if(typeof t!="object"||t===null)return"";const n=t.build;return typeof n=="string"?n:""}catch{return""}}const sp=M(!1);let Z1="",X1="";const C8=xt(sp);function S8(e,t=Gr.build){w8(t,e)&&e!==X1&&(Z1=e,sp.value=!0)}function E8(){X1=Z1,sp.value=!1}function A8(e={}){const t=e.booted??Gr.build;if(t==="")return()=>{};const n=e.check??$8,a=e.interval??x8,r=e.minGap??k8,l=e.win??window,o=e.doc??document,i=e.now??Date.now;let u=!1,d=Number.NEGATIVE_INFINITY;const c=async()=>{if(!(o.visibilityState==="hidden"||u||i()-d{c().catch(()=>{})};o.addEventListener("visibilitychange",f),l.addEventListener("focus",f);const v=l.setInterval(f,a);return()=>{o.removeEventListener("visibilitychange",f),l.removeEventListener("focus",f),l.clearInterval(v)}}const T8={key:0,"data-update-banner":"",role:"status","aria-live":"polite",class:"fixed right-4 bottom-[88px] z-50 flex max-w-[420px] items-center gap-3 rounded-[14px] bg-[#1d2740] py-3 pr-2.5 pl-3.5 text-white shadow-toast"},D8={class:"font-medium"},O8=["aria-label"],M8=ae({__name:"UpdateBanner",setup(e){return(t,n)=>s(C8)?(m(),y("div",T8,[w("span",D8,$(s(g)("backend::lang.version.available")),1),w("button",{type:"button","data-update-reload":"",class:"shrink-0 rounded-pager bg-accent px-3 py-1.5 font-medium text-on-accent transition-opacity duration-150 ease-out hover:opacity-90",onClick:n[0]||(n[0]=a=>s(lb).reload())},$(s(g)("backend::lang.version.reload")),1),w("button",{type:"button","data-update-close":"","aria-label":s(g)("backend::lang.form.close"),class:"flex size-8 shrink-0 items-center justify-center rounded-pager text-[#c3cbda] transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:n[1]||(n[1]=a=>s(E8)())},[N(s(Qt),{size:16,"aria-hidden":"true"})],8,O8)])):Q("",!0)}}),Q1=M(0),P8=xt(Q1);function I8(){Q1.value++}const R8=ae({__name:"App",setup(e){const t=Mn(),n=_(()=>t.meta.shell===!0);return kn(()=>{document.title=p2(t)}),(a,r)=>(m(),y(pe,null,[n.value?(m(),j(_8,{key:0},{default:q(()=>[N(s(cd),null,{default:q(({Component:l,route:o})=>[(m(),j(zt(l),{key:`${o.path}#${s(P8)}`}))]),_:1})]),_:1})):(m(),j(s(cd),{key:1})),N(M8)],64))}}),q8="data-summer-controller",e0="*",Mc=new Map,qd=new Map;let t0="";function n0(){return`${Gr.base}/assets/`}function a0(e){if(!e.startsWith(n0())||e.includes("\\"))return!1;for(const n of e){const a=n.codePointAt(0)??0;if(a<=32||a===127)return!1}return!(e.split(/[?#]/,1)[0]??"").split("/").some(n=>{const a=n.toLowerCase().replaceAll("%2e",".");return a==="."||a===".."})}function r0(e){if(!a0(e))return Promise.reject(new Error(`plugin script outside ${n0()}: ${e}`));const t=Mc.get(e);if(t)return t;const n=new Promise((a,r)=>{const l=document.createElement("script");l.type="module",l.addEventListener("load",()=>a(),{once:!0}),l.addEventListener("error",()=>{Mc.delete(e),l.remove(),r(new Error(`plugin script failed to load: ${e}`))},{once:!0}),l.src=e,document.head.appendChild(l)});return Mc.set(e,n),n}function l0(e,t){for(const n of t){const a=`${e} -${n}`;if(!a0(n)||qd.has(a))continue;const r=document.createElement("link");r.rel="stylesheet",r.setAttribute(q8,e),r.disabled=!o0(e),r.href=n,qd.set(a,{owner:e,link:r}),document.head.appendChild(r)}}function L8(e){t0=e;for(const{owner:t,link:n}of qd.values())n.disabled=!o0(t)}function o0(e){return e===e0||e===t0}function N8(e){l0(e0,e)}async function ip(e,t){l0(e,t?.styles??[]);const n=t?.scripts??[],a=await Promise.allSettled(n.map(r=>r0(r)));return n.filter((r,l)=>a[l]?.status==="rejected")}const s0=new Map;async function i0(){let e=[];try{const{data:t,response:n}=await Ne.GET("/field-types");e=n.ok&&t?t.data:[]}catch{return[]}for(const t of e){N8(t.styles??[]);const n=t.scripts??[];s0.set(t.element,Promise.allSettled(n.map(a=>r0(a))).then(a=>n.filter((r,l)=>a[l]?.status==="rejected")))}return e}function B8(e){return s0.get(e)??Promise.resolve([])}const F8={class:"flex min-h-screen items-center justify-center px-4",style:{background:"radial-gradient(ellipse at 50% 35%, #2b3a5c 0%, #1d2740 60%)"}},V8={class:"flex w-full max-w-[400px] flex-col gap-6"},z8={class:"flex items-center justify-center gap-3"},j8={class:"flex size-[34px] items-center justify-center rounded-full bg-accent-soft"},U8={class:"text-[22px] font-bold tracking-[-0.02em]"},H8={class:"flex flex-col gap-1.5"},K8={class:"font-semibold"},W8={class:"flex flex-col gap-1.5"},G8={class:"font-semibold"},Y8=["aria-invalid"],J8={key:0,role:"alert",class:"flex items-center gap-2.5 rounded-control bg-[#fdf0f0] px-3.5 py-3 text-[#c62828]"},Z8=["disabled"],X8=ae({__name:"LoginView",setup(e){const t=Mn(),n=_r(),a=M(""),r=M(""),l=M(!1),o=M(!1);async function i(){if(!o.value){o.value=!0,l.value=!1;try{if(!await P5(a.value.trim(),r.value)||!await j1()){l.value=!0;return}r.value="",await Promise.all([Mg(),Pg().catch(()=>[]),i0()]),await n.replace(J0(t.query.redirect)??"/")}finally{o.value=!1}}}return(u,d)=>(m(),y("main",F8,[w("div",V8,[w("div",z8,[w("span",j8,[N(s(mu),{size:20,class:"text-accent","aria-hidden":"true"})]),d[2]||(d[2]=w("span",{class:"text-[18px] font-bold text-white"},[_e("Summer"),w("span",{class:"text-accent"},"CMS")],-1))]),w("form",{class:"flex flex-col gap-[18px] rounded-card bg-white p-8 text-[#141b2d] shadow-login",novalidate:"",onSubmit:ft(i,["prevent"])},[w("h1",U8,$(s(g)("backend::lang.auth.title")),1),w("label",H8,[w("span",K8,$(s(g)("backend::lang.auth.login")),1),sa(w("input",{"onUpdate:modelValue":d[0]||(d[0]=c=>a.value=c),name:"login",type:"text",autocomplete:"username",required:"",class:"h-input rounded-control border border-[#d2d8e2] bg-white px-3.5"},null,512),[[jl,a.value]])]),w("label",W8,[w("span",G8,$(s(g)("backend::lang.auth.password")),1),sa(w("input",{"onUpdate:modelValue":d[1]||(d[1]=c=>r.value=c),name:"password",type:"password",autocomplete:"current-password",required:"","aria-invalid":l.value?"true":void 0,class:ve([l.value?"border-[#c62828]":"border-[#d2d8e2]","h-input rounded-control border bg-white px-3.5"])},null,10,Y8),[[jl,r.value]])]),l.value?(m(),y("div",J8,[N(s(gt),{size:18,"aria-hidden":"true"}),w("span",null,$(s(g)("backend::lang.auth.invalid")),1)])):Q("",!0),w("button",{type:"submit",disabled:o.value,class:"h-input rounded-control bg-[#22304d] font-semibold text-white disabled:opacity-60"},$(s(g)("backend::lang.auth.submit")),9,Z8)],32)])]))}}),ah=/^\d+$/;function u0(e,t,n){const a=cu(t),r=zn(t);if(!a||!r)return"/";const o=((e??"").trim().split(/[?#]/,1)[0]??"").split("/").filter(c=>c!==""),i=[a.vendor,a.plugin,a.controller];if(!i.every((c,f)=>o[f]?.toLowerCase()===c.toLowerCase()))return r;const d=o.slice(i.length);if(d.length===0)return r;if(d.length===1&&d[0]==="create")return`${r}/create`;if(d.length===2&&d[0]==="update"){const c=d[1]===":id"?String(n??""):d[1]??"";return ah.test(c)?`${r}/${c}`:r}if(d.length===2&&d[0]==="preview"){const c=d[1]===":id"?String(n??""):d[1]??"";return ah.test(c)?`${r}/${c}/preview`:r}return r}const rh=/^[0-9]+$/;function Q8(e,t){const n=e.replace(/[\s ]/g,"");if(n==="")return{value:null,error:null};let a=n,r=!1;a.startsWith("-")&&(r=!0,a=a.slice(1));const l=a.match(/[.,]/g)??[];if(l.length>1)return{value:null,error:"invalid"};const[o,i=""]=a.split(/[.,]/);if(!rh.test(o??"")||l.length===1&&!rh.test(i))return{value:null,error:"invalid"};if(i.replace(/0+$/,"").length>t)return{value:null,error:"too_precise"};const u=i===""?o:`${o}.${i}`;return{value:`${r?"-":""}${u}`,error:null}}function e6(e){const[t,n]=e.split(".");if(n===void 0||n.length<=2)return e;let a=n.length;for(;a>2&&n.charAt(a-1)==="0";)a-=1;return`${t}.${n.slice(0,a)}`}function t6(e){return new Intl.NumberFormat(e).formatToParts(1.1).find(n=>n.type==="decimal")?.value??"."}function c0(e,t,n,a=4){const r={minimumFractionDigits:2,maximumFractionDigits:Math.max(2,a)},l=t===""?{style:"decimal",...r}:{style:"currency",currency:t,currencyDisplay:"code",...r};let o;try{o=new Intl.NumberFormat(n,l)}catch{return`${new Intl.NumberFormat(n,{style:"decimal",...r}).format(e)} ${t}`.trim()}return o.format(e)}const n6={key:0,"data-switch":"true",class:"inline-flex h-6 items-center gap-1 rounded-pill bg-ok-bg px-2.5 text-[12px] font-semibold text-ok-text"},a6={key:1,"data-switch":"false",class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[12px] font-semibold text-muted"},r6={key:1,class:"text-muted","data-empty":""},l6={key:2,class:"text-[13px] text-muted tabular-nums"},o6={key:3,"data-money":"",class:"tabular-nums whitespace-nowrap"},hl=ae({__name:"CellValue",props:{column:{},value:{},row:{}},setup(e){const t=e;function n(p){return p==null||p===""}function a(p){return n(p)?"":Array.isArray(p)?p.map(a).filter(h=>h!=="").join(", "):typeof p=="boolean"?g(p?"backend::lang.list.column_switch_true":"backend::lang.list.column_switch_false"):typeof p=="object"?"":String(p)}function r(p){return String(p).padStart(2,"0")}function l(p){if(typeof p!="string"&&typeof p!="number")return"";const h=new Date(p);return Number.isNaN(h.getTime())?String(p):`${h.getFullYear()}-${r(h.getMonth()+1)}-${r(h.getDate())} ${r(h.getHours())}:${r(h.getMinutes())}`}function o(p){if(typeof p!="string")return"";const h=/^\d{4}-\d{2}-\d{2}/.exec(p.trim());return h?h[0]:p.trim()}function i(p){if(typeof p!="string")return"";const h=/(\d{2}):(\d{2})/.exec(p);return h?`${h[1]}:${h[2]}`:p.trim()}function u(p){return typeof p=="string"?p!==""&&p!=="0"&&p.toLowerCase()!=="false":!!p}function d(){if(t.column.currencyFrom){const p=t.row?.[t.column.currencyFrom];return typeof p=="string"?p.trim():""}return t.column.currency??""}function c(p){return typeof p!="string"||p.trim()===""?"":c0(p.trim(),d(),ua.value,4)}const f=_(()=>t.column.type==="switch"?"switch":t.column.type==="money"?"money":t.column.type==="datetime"?"datetime":t.column.type==="date"?"date":t.column.type==="time"?"time":"text"),v=_(()=>{switch(f.value){case"datetime":return l(t.value);case"date":return o(t.value);case"time":return i(t.value);case"money":return c(t.value);default:return a(t.value)}});return(p,h)=>f.value==="switch"&&!n(e.value)?(m(),y(pe,{key:0},[u(e.value)?(m(),y("span",n6,[N(s(Lg),{size:14,"aria-hidden":"true"}),_e($(s(g)("backend::lang.list.column_switch_true")),1)])):(m(),y("span",a6,$(s(g)("backend::lang.list.column_switch_false")),1))],64)):v.value===""?(m(),y("span",r6,"—")):f.value==="datetime"||f.value==="date"||f.value==="time"?(m(),y("span",l6,$(v.value),1)):f.value==="money"?(m(),y("span",o6,$(v.value),1)):(m(),y(pe,{key:4},[_e($(v.value),1)],64))}}),s6={key:0,class:"flex shrink-0 gap-2"},i6=["data-row-state"],u6=ae({__name:"RowStateBadges",props:{states:{},labels:{}},setup(e){const t=e,n={deleted:"border border-border-strong text-muted",negative:"bg-danger-soft text-danger",disabled:"bg-subtle text-muted"},a=["deleted","negative","disabled"],r=_(()=>a.filter(l=>t.states.includes(l)));return(l,o)=>r.value.length>0?(m(),y("span",s6,[(m(!0),y(pe,null,Ie(r.value,i=>(m(),y("span",{key:i,"data-row-state":i,class:ve([n[i],"inline-flex h-6 shrink-0 items-center rounded-pill px-2.5 text-[12px] font-semibold whitespace-nowrap"])},$(e.labels[i]??i),11,i6))),128))])):Q("",!0)}}),c6={class:"overflow-x-auto"},d6={class:"sticky top-0 z-10"},f6={class:"h-row-head border-y border-border bg-subtle"},p6={key:0,scope:"col","data-select":"",class:"w-[52px] pl-5"},m6=["aria-checked","aria-label","disabled"],v6=["aria-sort"],h6=["data-sort","onClick"],y6={key:1,class:"w-[56px] pr-5"},g6=["aria-busy"],b6={key:0,class:"pl-5"},_6={key:1,class:"pr-5"},x6={key:1},k6=["colspan"],w6={class:"text-muted"},$6=["aria-selected","data-row-states","onClick"],C6={key:0,"data-select":"",class:"pl-5"},S6=["aria-checked","aria-label","onClick"],E6={key:0,class:"flex items-center gap-3"},A6={"data-avatar":"",class:"flex size-[30px] shrink-0 items-center justify-center rounded-full bg-subtle text-[12px] font-bold text-text","aria-hidden":"true"},T6=["onClick"],D6={key:1,class:"flex items-center gap-2"},O6={key:1,"data-trailing":"",class:"w-[56px] pr-5"},d0=ae({__name:"DataTable",props:{columns:{},rows:{},loading:{type:Boolean,default:!1},rowLink:{type:Function,default:void 0},selectable:{type:Boolean,default:!1},selected:{default:()=>[]},sortable:{type:Boolean,default:!1},sort:{default:null},variant:{default:"list"},openable:{type:Boolean,default:!1},trailing:{type:Boolean,default:!1},rowStates:{default:()=>({})},stateLabels:{default:()=>({})}},emits:["update:selected","sort","open"],setup(e,{emit:t}){const n=e,a=t,r=_r();function l(J){const K=J.id;return typeof K=="number"||typeof K=="string"?K:null}function o(J,K){const H=l(J);return H===null?`row-${K}`:String(H)}function i(J){return n.rowLink?n.rowLink(J):null}function u(J,K){if(J.target?.closest("a, button, input, label, select"))return;if(n.openable){const ue=J.currentTarget?.querySelector("[data-row-open]")??null;a("open",K,ue);return}const le=i(K);le&&r.push(le)}const d=_(()=>n.rows.map(l).filter(J=>J!==null)),c=_(()=>new Set(n.selected.map(String))),f=_(()=>{const J=d.value,K=J.filter(H=>c.value.has(String(H))).length;return K===0?"false":K===J.length?"true":"mixed"});function v(J){const K=l(J);return K!==null&&c.value.has(String(K))}function p(){a("update:selected",f.value==="true"?[]:[...d.value])}function h(J){const K=l(J);K!==null&&(c.value.has(String(K))?a("update:selected",n.selected.filter(H=>String(H)!==String(K))):a("update:selected",[...n.selected,K]))}function k(J){if(n.sort?.column===J.key)return n.sort.dir==="desc"?"descending":"ascending"}function S(J){return n.sortable&&J.sortable}const x=_(()=>n.variant==="relation"),E=_(()=>x.value?"h-[56px]":"h-row"),L=_(()=>x.value?3:8);function D(J){return(typeof J=="string"||typeof J=="number"?String(J):"").split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(H=>H.charAt(0).toUpperCase()).join("")}const A=["deleted","negative","disabled"];function R(J){const K=l(J),H=K===null?void 0:n.rowStates[String(K)];return Array.isArray(H)?A.filter(le=>H.includes(le)):[]}function F(J,K,H=[]){const le=H.includes("deleted")||H.includes("disabled"),ue=W(J);return K===0?[le?"font-semibold text-muted":"font-semibold",ue].filter(Boolean).join(" "):[le||x.value||J.relation?"text-muted":"",ue].filter(Boolean).join(" ")}function W(J){return J.type==="money"?"text-right":""}function C(J){return["min-w-0 truncate",J.includes("deleted")?"line-through":"no-underline",J.includes("negative")?"text-danger":J.includes("deleted")||J.includes("disabled")?"text-muted":"text-text"]}const I=_(()=>n.columns.filter(J=>!J.invisible)),z=_(()=>Math.max(I.value.length+(n.selectable?1:0)+(n.trailing?1:0),1));function O(J,K){a("open",K,J.currentTarget)}const B=["w-3/5","w-2/5","w-1/2","w-3/4","w-1/3","w-2/3","w-1/2","w-2/5"];return(J,K)=>(m(),y("div",c6,[w("table",{class:ve([x.value?"min-w-[480px]":"min-w-[640px]","w-full border-collapse text-left"])},[w("thead",d6,[w("tr",f6,[e.selectable?(m(),y("th",p6,[w("button",{type:"button",role:"checkbox","aria-checked":f.value,"aria-label":s(g)("backend::lang.list.select_all"),disabled:e.loading||d.value.length===0,class:ve([f.value==="false"?"border-border-strong bg-surface":"border-primary bg-primary text-on-primary","flex size-[18px] items-center justify-center rounded-checkbox border disabled:opacity-60"]),onClick:p},[f.value==="mixed"?(m(),j(s(Wg),{key:0,size:14,"aria-hidden":"true"})):f.value==="true"?(m(),j(s(jn),{key:1,size:14,"aria-hidden":"true"})):Q("",!0)],10,m6)])):Q("",!0),(m(!0),y(pe,null,Ie(I.value,H=>(m(),y("th",{key:H.key,scope:"col","aria-sort":S(H)?k(H)??"none":void 0,class:ve([[k(H)?"text-text":"text-muted",W(H)],"px-3.5 text-[12px] font-semibold first:pl-5 last:pr-5"])},[S(H)?(m(),y("button",{key:0,type:"button","data-sort":H.key,class:"inline-flex items-center gap-1 font-semibold",onClick:le=>a("sort",H.key)},[_e($(H.label)+" ",1),k(H)==="ascending"?(m(),j(s(Ng),{key:0,size:14,"aria-hidden":"true"})):k(H)==="descending"?(m(),j(s(Rg),{key:1,size:14,"aria-hidden":"true"})):Q("",!0)],8,h6)):(m(),y(pe,{key:1},[_e($(H.label),1)],64))],10,v6))),128)),e.trailing?(m(),y("td",y6)):Q("",!0)])]),w("tbody",{"aria-busy":e.loading?"true":void 0},[e.loading?(m(!0),y(pe,{key:0},Ie(L.value,H=>(m(),y("tr",{key:`skeleton-${H}`,"data-skeleton":"",class:ve([E.value,"border-b border-border"])},[e.selectable?(m(),y("td",b6,[...K[0]||(K[0]=[w("span",{class:"block size-[18px] rounded-checkbox bg-skel"},null,-1)])])):Q("",!0),(m(!0),y(pe,null,Ie(I.value,le=>(m(),y("td",{key:le.key,class:"px-3.5 first:pl-5 last:pr-5"},[w("span",{class:ve([B[(H-1)%B.length],"block h-3 rounded-[6px] bg-skel"])},null,2)]))),128)),e.trailing?(m(),y("td",_6)):Q("",!0)],2))),128)):e.rows.length===0?(m(),y("tr",x6,[w("td",{colspan:z.value,class:"px-5 py-20 text-center"},[ge(J.$slots,"empty",{},()=>[w("span",w6,$(s(g)("backend::lang.list.no_records")),1)])],8,k6)])):(m(!0),y(pe,{key:2},Ie(e.rows,(H,le)=>(m(),y("tr",{key:o(H,le),class:ve([[E.value,v(H)?"bg-sel":i(H)||e.openable?"hover:bg-hover":"",i(H)||e.openable?"cursor-pointer":""],"border-b border-border transition-colors duration-150 ease-out"]),"aria-selected":e.selectable?v(H)?"true":"false":void 0,"data-row-states":R(H).length>0?R(H).join(" "):void 0,onClick:ue=>u(ue,H)},[e.selectable?(m(),y("td",C6,[w("button",{type:"button",role:"checkbox","aria-checked":v(H)?"true":"false","aria-label":s(g)("backend::lang.list.select_row"),class:ve([v(H)?"border-primary bg-primary text-on-primary":"border-border-strong bg-surface","flex size-[18px] items-center justify-center rounded-checkbox border"]),onClick:ue=>h(H)},[v(H)?(m(),j(s(jn),{key:0,size:14,"aria-hidden":"true"})):Q("",!0)],10,S6)])):Q("",!0),(m(!0),y(pe,null,Ie(I.value,(ue,we)=>(m(),y("td",{key:ue.key,class:ve([F(ue,we,R(H)),"px-3.5 first:pl-5 last:pr-5"])},[x.value&&we===0?(m(),y("span",E6,[w("span",A6,$(D(H[ue.key])),1),e.openable?(m(),y("button",{key:0,type:"button","data-row-open":"",class:"min-w-0 truncate text-left font-semibold text-text",onClick:Oe=>O(Oe,H)},[N(hl,{column:ue,value:H[ue.key],row:H},null,8,["column","value","row"])],8,T6)):(m(),j(hl,{key:1,column:ue,value:H[ue.key],row:H},null,8,["column","value","row"]))])):we===0&&R(H).length>0?(m(),y("span",D6,[i(H)?(m(),j(s(Vn),{key:0,to:i(H),class:ve(C(R(H)))},{default:q(()=>[N(hl,{column:ue,value:H[ue.key],row:H},null,8,["column","value","row"])]),_:2},1032,["to","class"])):(m(),y("span",{key:1,class:ve(C(R(H)))},[N(hl,{column:ue,value:H[ue.key],row:H},null,8,["column","value","row"])],2)),N(u6,{states:R(H),labels:e.stateLabels},null,8,["states","labels"])])):we===0&&i(H)?(m(),j(s(Vn),{key:2,to:i(H),class:"text-text no-underline"},{default:q(()=>[N(hl,{column:ue,value:H[ue.key],row:H},null,8,["column","value","row"])]),_:2},1032,["to"])):(m(),j(hl,{key:3,column:ue,value:H[ue.key],row:H},null,8,["column","value","row"]))],2))),128)),e.trailing?(m(),y("td",O6,[ge(J.$slots,"trailing",{row:H})])):Q("",!0)],10,$6))),128))],8,g6)],2)]))}}),M6=["aria-label"],P6={key:0,class:"flex flex-col gap-1 text-[13px]"},I6={class:"font-semibold text-muted"},R6=["data-filter","value","onChange"],q6=["value"],L6={key:1,class:"flex flex-col gap-1 text-[13px]"},N6={class:"mb-1 font-semibold text-muted"},B6={class:"flex items-center gap-2"},F6=["data-filter","aria-label","value","onChange"],V6=["data-filter","aria-label","value","onChange"],z6={key:2,class:"flex flex-col gap-1 text-[13px]"},j6={class:"font-semibold text-muted"},U6=["data-filter","value","onChange"],H6=["value"],wo="",Ys="h-button rounded-control border border-border-strong bg-surface px-3 text-text",K6=ae({__name:"FilterBar",props:{filters:{},values:{},source:{}},emits:["update"],setup(e,{emit:t}){const n=e,a=t;function r(f){if(f.options&&f.options.length>0)return f.options.map(p=>({value:JSON.stringify(p.value),label:p.label}));const v=[];return f.trueValue!==void 0&&v.push({value:JSON.stringify(f.trueValue),label:g("backend::lang.list.column_switch_true")}),f.falseValue!==void 0&&v.push({value:JSON.stringify(f.falseValue),label:g("backend::lang.list.column_switch_false")}),v}const l=M({});async function o(f){const{data:v}=await Ne.GET("/{vendor}/{plugin}/{controller}/filters/{scope}/options",{params:{path:{...n.source,scope:f.name}}});l.value={...l.value,[f.name]:v?.data??[]}}wt(()=>{for(const f of n.filters)f.type==="scope"&&o(f)});const i=Ln({});function u(){for(const f of n.filters){if(f.type!=="daterange")continue;const[v="",p=""]=(n.values[f.name]??"").split(".."),h=i[f.name];(!h||n.values[f.name]!==void 0||h.from!==""&&h.to!=="")&&(i[f.name]={from:v,to:p})}}Ve(()=>n.values,u,{immediate:!0,deep:!0});function d(f,v,p){const h={...i[f.name]??{from:"",to:""},[v]:p};i[f.name]=h,h.from!==""&&h.to!==""?a("update",f.name,`${h.from}..${h.to}`):(h.from===""&&h.to===""||n.values[f.name]!==void 0)&&a("update",f.name,null)}function c(f,v){a("update",f.name,v===wo?null:v)}return(f,v)=>(m(),y("div",{role:"group","aria-label":s(g)("backend::lang.list.filters"),"data-filter-bar":"",class:"flex flex-wrap items-end gap-4 border-t border-border px-5 py-3.5"},[(m(!0),y(pe,null,Ie(e.filters,p=>(m(),y(pe,{key:p.name},[p.type==="switch"?(m(),y("label",P6,[w("span",I6,$(p.label||p.name),1),w("select",{"data-filter":p.name,value:e.values[p.name]??wo,class:ve(Ys),onChange:h=>c(p,h.target.value)},[w("option",{value:wo},$(s(g)("backend::lang.list.filter_all")),1),(m(!0),y(pe,null,Ie(r(p),h=>(m(),y("option",{key:h.value,value:h.value},$(h.label),9,q6))),128))],40,R6)])):p.type==="daterange"?(m(),y("fieldset",L6,[w("legend",N6,$(p.label||p.name),1),w("div",B6,[w("input",{type:"date","data-filter":`${p.name}-from`,"aria-label":s(g)("backend::lang.list.filter_from"),value:i[p.name]?.from??"",class:ve(Ys),onChange:h=>d(p,"from",h.target.value)},null,40,F6),v[0]||(v[0]=w("span",{"aria-hidden":"true"},"–",-1)),w("input",{type:"date","data-filter":`${p.name}-to`,"aria-label":s(g)("backend::lang.list.filter_to"),value:i[p.name]?.to??"",class:ve(Ys),onChange:h=>d(p,"to",h.target.value)},null,40,V6)])])):p.type==="scope"?(m(),y("label",z6,[w("span",j6,$(p.label||p.name),1),(m(),y("select",{key:`${p.name}-${l.value[p.name]?.length??-1}`,"data-filter":p.name,value:e.values[p.name]??wo,class:ve(Ys),onChange:h=>c(p,h.target.value)},[w("option",{value:wo},$(s(g)("backend::lang.list.filter_all")),1),(m(!0),y(pe,null,Ie(l.value[p.name]??[],h=>(m(),y("option",{key:h.value,value:h.value},$(h.label),9,H6))),128))],40,U6))])):Q("",!0)],64))),128))],8,M6))}}),W6=["type","disabled","data-hotkey","aria-keyshortcuts"],Ke=ae({__name:"Button",props:{variant:{default:"outline"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},icon:{default:void 0},to:{default:void 0},hotkey:{default:void 0}},setup(e){const t=e,n={primary:"bg-primary text-on-primary hover:opacity-90",outline:"border border-border-strong bg-surface text-text hover:bg-hover",ghost:"text-muted hover:bg-hover hover:text-text",danger:"border border-danger bg-surface text-danger hover:bg-danger-soft"},a=_(()=>t.hotkey?Pu(t.hotkey):void 0),r=_(()=>["inline-flex shrink-0 items-center justify-center gap-2 rounded-control px-4 font-semibold whitespace-nowrap no-underline transition-colors duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-60",t.size==="sm"?"h-[38px]":"h-button",n[t.variant]]);return(l,o)=>e.to!==void 0?(m(),j(s(Vn),{key:0,to:e.to,class:ve(r.value),"data-hotkey":e.hotkey,"aria-keyshortcuts":a.value},{default:q(()=>[e.icon?(m(),j(zt(e.icon),{key:0,size:16,"aria-hidden":"true"})):Q("",!0),ge(l.$slots,"default")]),_:3},8,["to","class","data-hotkey","aria-keyshortcuts"])):(m(),y("button",{key:1,type:e.type,disabled:e.disabled,class:ve(r.value),"data-hotkey":e.hotkey,"aria-keyshortcuts":a.value},[e.icon?(m(),j(zt(e.icon),{key:0,size:16,"aria-hidden":"true"})):Q("",!0),ge(l.$slots,"default")],10,W6))}}),G6=ae({__name:"BulkActionsMenu",props:{actions:{},disabled:{type:Boolean}},emits:["select"],setup(e,{expose:t,emit:n}){const a=n,r=M(null);function l(){const o=r.value?.$el;o instanceof HTMLElement&&o.focus()}return t({focus:l}),(o,i)=>(m(),j(s(A1),{modal:!1},{default:q(()=>[N(s(O1),{"as-child":"",disabled:e.disabled},{default:q(()=>[N(Ke,{ref_key:"trigger",ref:r,variant:"outline",size:"md","data-action":"bulk-actions",disabled:e.disabled},{default:q(()=>[_e($(s(g)("backend::lang.list.bulk_actions"))+" ",1),N(s(ur),{size:16,class:"text-muted","aria-hidden":"true"})]),_:1},8,["disabled"])]),_:1},8,["disabled"]),N(s(D1),null,{default:q(()=>[N(s(T1),{"data-bulk-menu":"",align:"end","side-offset":8,class:"z-50 flex w-[240px] max-w-[320px] flex-col rounded-[14px] border border-border bg-surface p-2 text-text shadow-menu"},{default:q(()=>[(m(!0),y(pe,null,Ie(e.actions,u=>(m(),j(s(Pd),{key:u.name,"data-bulk-action":u.name,class:"flex min-h-10 cursor-pointer items-center rounded-control px-3 py-2 outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:d=>a("select",u.name)},{default:q(()=>[_e($(u.label),1)]),_:2},1032,["data-bulk-action","onSelect"]))),128))]),_:1})]),_:1})]),_:1}))}}),Y6={class:"flex flex-wrap items-center justify-between gap-3 px-5 py-4"},J6={key:0,class:"relative block w-[320px] max-w-full"},Z6={class:"sr-only"},X6=["value","placeholder"],Q6={key:1},eP={class:"flex flex-wrap items-center justify-end gap-2.5"},tP={key:0,"data-selected-pill":"",class:"inline-flex h-8 items-center gap-1.5 rounded-pill bg-sel px-3 text-[13px] font-semibold"},nP=ae({__name:"ListToolbar",props:{showSearch:{type:Boolean},search:{},searchPrompt:{},buttons:{},selectedCount:{},selectedLabel:{},deleteLabel:{},actions:{default:()=>[]},busyAction:{default:null},bulkActions:{default:()=>[]},bulkBusy:{type:Boolean,default:!1}},emits:["update:search","delete","action","bulk"],setup(e,{expose:t,emit:n}){const a=e,r=n,l=_(()=>new Map(a.actions.map(u=>[u.name,u.label]))),o=M(null);function i(){o.value?.focus()}return t({focusBulk:i}),(u,d)=>(m(),y("div",Y6,[e.showSearch?(m(),y("label",J6,[w("span",Z6,$(s(g)("backend::lang.list.search")),1),N(s(ks),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),w("input",{type:"search","data-list-search":"","data-hotkey":"/","aria-keyshortcuts":"/",value:e.search,placeholder:e.searchPrompt,class:"h-button w-full rounded-control border border-transparent bg-subtle pr-3.5 pl-10",onInput:d[0]||(d[0]=c=>r("update:search",c.target.value))},null,40,X6)])):(m(),y("span",Q6)),w("div",eP,[e.selectedCount>0?(m(),y("span",tP,[N(s(jn),{size:14,"aria-hidden":"true"}),_e($(e.selectedLabel),1)])):Q("",!0),e.bulkActions.length>0?(m(),j(G6,{key:1,ref_key:"bulkMenu",ref:o,actions:e.bulkActions,disabled:e.selectedCount===0||e.bulkBusy,onSelect:d[1]||(d[1]=c=>r("bulk",c))},null,8,["actions","disabled"])):Q("",!0),(m(!0),y(pe,null,Ie(e.buttons,c=>(m(),y(pe,{key:c},[c==="delete"?(m(),j(Ke,{key:0,"data-action":"delete",variant:e.selectedCount>0?"danger":"outline",icon:s(xr),disabled:e.selectedCount===0,onClick:d[2]||(d[2]=f=>r("delete"))},{default:q(()=>[_e($(e.deleteLabel),1)]),_:1},8,["variant","icon","disabled"])):l.value.has(c)?(m(),j(Ke,{key:1,variant:"outline",size:"md","data-action":c,disabled:e.busyAction===c,"aria-busy":e.busyAction===c?"true":void 0,onClick:f=>r("action",c)},{default:q(()=>[_e($(l.value.get(c)),1)]),_:2},1032,["data-action","disabled","aria-busy","onClick"])):Q("",!0)],64))),128))])]))}}),aP={class:"flex flex-wrap items-center gap-x-6 gap-y-3 border-t border-border px-5 py-3.5 text-[13px] text-muted"},rP={"data-range":""},lP={key:0,class:"flex items-center gap-2"},oP=["value"],sP=["value"],iP=["aria-label"],uP=["disabled"],cP={key:0,"aria-hidden":"true",class:"px-1"},dP=["data-page","aria-current","onClick"],fP=["disabled"],Pc="inline-flex h-pager min-w-pager items-center justify-center gap-1 rounded-pager border border-border px-2.5 text-[13px] text-text disabled:cursor-not-allowed disabled:opacity-60 hover:bg-hover",f0=ae({__name:"Pagination",props:{meta:{},loading:{type:Boolean},perPageOptions:{},perPage:{}},emits:["page","perPage"],setup(e,{emit:t}){const n=e,a=t,r=_(()=>n.meta?.total??0),l=_(()=>n.meta?.page??1),o=_(()=>Math.max(n.meta?.last_page??1,1)),i=_(()=>{const c=n.meta;if(!c||c.total===0)return zr("backend::lang.list.results",0);const f=(c.page-1)*c.per_page+1,v=Math.min(c.page*c.per_page,c.total);return g("backend::lang.list.pagination_range",{from:f,to:v,total:c.total})}),u=_(()=>{const c=o.value,f=l.value,v=new Set([1,c,f-1,f,f+1].filter(k=>k>=1&&k<=c));f<=3&&[2,3].forEach(k=>k<=c&&v.add(k)),f>=c-2&&[c-1,c-2].forEach(k=>k>=1&&v.add(k));const p=[...v].sort((k,S)=>k-S),h=[];return p.forEach((k,S)=>{const x=p[S-1];x!==void 0&&k-x>1&&h.push(null),h.push(k)}),h});function d(c){const f=Number(c.target.value);Number.isFinite(f)&&f>0&&a("perPage",f)}return(c,f)=>(m(),y("footer",aP,[w("span",rP,$(e.loading?s(g)("backend::lang.list.loading"):i.value),1),e.perPageOptions.length>1?(m(),y("label",lP,[w("span",null,$(s(g)("backend::lang.list.records_per_page")),1),w("select",{"data-per-page":"",value:String(e.perPage),class:"h-pager rounded-pager border border-border-strong bg-surface px-2 text-text",onChange:d},[(m(!0),y(pe,null,Ie(e.perPageOptions,v=>(m(),y("option",{key:v,value:String(v)},$(v),9,sP))),128))],40,oP)])):Q("",!0),!e.loading&&r.value>0?(m(),y("nav",{key:1,"aria-label":s(g)("backend::lang.list.pagination"),class:"ml-auto flex items-center gap-1.5"},[w("button",{type:"button","data-page":"prev",class:ve(Pc),disabled:l.value<=1,onClick:f[0]||(f[0]=v=>a("page",l.value-1))},[N(s(pu),{size:14,"aria-hidden":"true"}),_e($(s(g)("backend::lang.list.prev_page")),1)],8,uP),(m(!0),y(pe,null,Ie(u.value,(v,p)=>(m(),y(pe,{key:v??`gap-${p}`},[v===null?(m(),y("span",cP,"…")):(m(),y("button",{key:1,type:"button","data-page":v,"aria-current":v===l.value?"page":void 0,class:ve([Pc,v===l.value?"border-transparent bg-sel font-bold":""]),onClick:h=>v!==l.value&&a("page",v)},$(v),11,dP))],64))),128)),w("button",{type:"button","data-page":"next",class:ve(Pc),disabled:l.value>=o.value,onClick:f[1]||(f[1]=v=>a("page",l.value+1))},[_e($(s(g)("backend::lang.list.next_page")),1),N(s(_s),{size:14,"aria-hidden":"true"})],8,fP)],8,iP)):Q("",!0)]))}}),pP={role:"alert","data-extension-failure":"",class:"flex min-h-input items-center rounded-control border-[1.5px] border-dashed border-border-strong bg-subtle px-3.5 py-2.5 text-[13px] text-muted"},mP={class:"flex min-w-0 items-start gap-2.5"},vP={class:"min-w-0 [overflow-wrap:anywhere]"},Iu=ae({__name:"ExtensionFailure",props:{text:{}},setup(e){return(t,n)=>(m(),y("div",pP,[w("span",mP,[N(s(gt),{size:16,class:"mt-0.5 shrink-0 text-danger","aria-hidden":"true"}),w("span",vP,$(e.text),1)])]))}}),hP=new Set(["div","span","p","strong","em","b","i","u","s","small","mark","code","pre","br","hr","ul","ol","li","dl","dt","dd","h2","h3","h4","h5","h6","table","thead","tbody","tfoot","tr","th","td","caption","section","header","footer","figure","figcaption","blockquote","q","abbr","time","data","meter","progress","sup","sub","a","img"]),yP=new Set(["script","style","template","iframe","object","embed","noscript","textarea","title","xmp","svg","math","form","input","button","select","link","meta","base"]),gP=32,bP=2e3,_P=new Set(["class","title","lang","dir","role"]),xP={a:new Set(["href"]),img:new Set(["src","alt","width","height"]),td:new Set(["colspan","rowspan","scope"]),th:new Set(["colspan","rowspan","scope"]),time:new Set(["datetime"]),data:new Set(["value"]),meter:new Set(["value","min","max","low","high","optimum"]),progress:new Set(["value","max"])},kP=/^(aria|data)-[a-z0-9_-]+$/;function wP(e,t){if(e==="")return!1;for(const n of e){const a=n.codePointAt(0)??0;if(a<=32||a===127)return!1}return e.startsWith("#")?t:e.startsWith("/")?e.length===1||e[1]!=="/"&&e[1]!=="\\":!1}function $P(e,t,n){return _P.has(t)||xP[e]?.has(t)===!0||kP.test(t)?e==="a"&&t==="href"||e==="img"&&t==="src"?wP(n,e==="a"):!0:!1}function CP(e,t){const n={};for(const[a,r]of Object.entries(t??{})){const l=a.toLowerCase();typeof r=="string"&&$P(e,l,r)&&(n[l]=r)}return n}function Ld(e,t,n){const a=[];for(const r of e??[]){if(n.left<=0)break;if(r.tag===void 0||r.tag===""){typeof r.text=="string"&&r.text!==""&&(n.left-=1,a.push(r.text));continue}const l=r.tag.toLowerCase();if(yP.has(l))continue;if(!hP.has(l)){a.push(...Ld(r.children,t,n));continue}if(t+1>gP)continue;n.left-=1;const o=Ld(r.children,t+1,n);a.push(Dn(l,CP(l,r.attrs),o.length>0?o:void 0))}return a}function SP(e){return Ld(e,0,{left:bP})}const EP={key:1,"data-partial-loading":"","aria-busy":"true"},AP=["data-partial","aria-busy"],up=ae({__name:"PartialHost",props:{source:{},name:{},recordId:{default:null},variant:{},reloadKey:{default:0},hint:{type:Boolean,default:!1}},setup(e){const t=e,n=M(null),a=M(!1),r=M(!1);let l=0;const o=u=>SP(u.nodes);o.props=["nodes"];async function i(){const u=++l;r.value=!0;let d=null;try{d=(await Ne.GET("/{vendor}/{plugin}/{controller}/partials/{name}",{params:{path:{...t.source,name:t.name},query:t.recordId!=null?{id:t.recordId}:void 0}})).data?.data.nodes??null}catch{d=null}u===l&&(r.value=!1,a.value=d===null,n.value=d)}return Ve(()=>t.reloadKey,()=>{i()}),i(),(u,d)=>a.value?(m(),j(Iu,{key:0,"data-partial-failed":"",text:s(g)("backend::lang.extension.partial_failed")},null,8,["text"])):n.value===null?(m(),y("div",EP,[w("div",{"data-partial-skeleton":"",class:ve([e.hint?"h-[68px] w-full rounded-inner":e.variant==="header"?"h-[80px] w-full rounded-card":"h-[44px] w-full rounded-control","bg-skel"]),"aria-hidden":"true"},null,2)])):n.value.length>0?(m(),y("div",{key:2,class:"summer-partial","data-partial":e.variant,"aria-busy":r.value?"true":void 0},[N(o,{nodes:n.value},null,8,["nodes"])],8,AP)):Q("",!0)}}),TP={key:0,class:"flex flex-col gap-1.5","data-confirm-prompt":""},DP=["for"],OP=["id","maxlength","placeholder","aria-describedby","disabled","value","onKeydown"],MP=["id"],PP={class:"flex gap-2.5"},IP=["disabled","aria-busy"],$r=ae({__name:"ConfirmDialog",props:{open:{type:Boolean},message:{},title:{default:void 0},confirmLabel:{default:void 0},cancelLabel:{default:void 0},danger:{type:Boolean,default:!1},busy:{type:Boolean,default:!1},prompt:{default:null},value:{default:""}},emits:["update:open","update:value","confirm","cancel"],setup(e,{emit:t}){const n=e,a=t,r=`confirm-${Sy()}`,l=M(null),o=_(()=>!!n.prompt&&n.value.trim()==="");function i(c){!c&&n.busy||(a("update:open",c),c||a("cancel"))}function u(){n.busy||o.value||(a("confirm"),a("update:open",!1))}function d(c){a("update:value",c.target.value)}return Ve(()=>n.open&&!!n.prompt,async c=>{c&&(await Je(),l.value?.focus())}),(c,f)=>(m(),j(s(b4),{open:e.open,"onUpdate:open":i},{default:q(()=>[N(s(y4),null,{default:q(()=>[N(s(v4),{class:"pointer-events-auto fixed inset-0 z-[80] bg-overlay"}),N(s(u4),{"data-confirm-dialog":"",class:"pointer-events-auto fixed top-1/2 left-1/2 z-[90] flex w-[calc(100%-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-modal bg-surface p-6 text-text shadow-pop"},{default:q(()=>[N(s(x4),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:q(()=>[_e($(e.title??s(g)("backend::lang.form.confirm")),1)]),_:1}),N(s(p4),{class:"text-muted [overflow-wrap:anywhere]"},{default:q(()=>[_e($(e.message),1)]),_:1}),e.prompt?(m(),y("div",TP,[w("label",{for:`${r}-value`,class:"text-[13px] font-semibold"},$(e.prompt.label),9,DP),w("input",{id:`${r}-value`,ref_key:"promptInput",ref:l,type:"text",autocomplete:"off",maxlength:e.prompt.maxLength,placeholder:e.prompt.placeholder,"aria-describedby":e.prompt.comment?`${r}-comment`:void 0,disabled:e.busy,value:e.value,class:"h-control w-full rounded-control border border-border-strong bg-surface px-3 text-text outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-60",onInput:d,onKeydown:ia(ft(u,["prevent"]),["enter"])},null,40,OP),e.prompt.comment?(m(),y("p",{key:0,id:`${r}-comment`,class:"text-[13px] text-muted"},$(e.prompt.comment),9,MP)):Q("",!0)])):Q("",!0),w("div",PP,[N(s(d4),{"data-action":"cancel",disabled:e.busy,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60"},{default:q(()=>[_e($(e.cancelLabel??s(g)("backend::lang.form.cancel")),1)]),_:1},8,["disabled"]),w("button",{type:"button","data-action":"confirm",disabled:e.busy||o.value,"aria-busy":e.busy?"true":void 0,class:ve([e.danger?"bg-danger text-white":"bg-primary text-on-primary","inline-flex h-button flex-1 items-center justify-center gap-2 rounded-control font-semibold hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"]),onClick:ft(u,["prevent"])},[e.busy?(m(),j(s(Il),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Q("",!0),_e(" "+$(e.confirmLabel??s(g)("backend::lang.form.confirm")),1)],10,IP)])]),_:1})]),_:1})]),_:1},8,["open"]))}});function Cr(){const e=M(null),t=M(!1),n=M("");let a=null,r=null;function l(c){const f=a;a=null,r=null,e.value=null,f?.(c)}function o(c,f){return l(!1),n.value="",e.value=c,r=f??null,new Promise(v=>{a=v})}async function i(){if(t.value||e.value?.prompt&&n.value.trim()==="")return;const c=r;if(c){t.value=!0;try{await c()}finally{t.value=!1}}l(!0)}function u(){t.value||l(!1)}function d(c){n.value=c}return{request:e,busy:t,value:n,ask:o,confirm:i,cancel:u,setValue:d}}const RP={class:"flex flex-col gap-5"},qP={class:"flex flex-wrap items-end justify-between gap-4"},LP={class:"flex flex-col"},NP={class:"text-[26px] font-bold tracking-[-0.02em]"},BP={key:0,"data-record-count":"",class:"text-muted"},FP={key:0,class:"flex items-center gap-2.5"},VP={class:"overflow-hidden rounded-card border border-border bg-surface shadow-card"},zP={key:2,"data-list-failed":"",class:"flex flex-wrap items-center justify-between gap-3 border-t border-border px-5 py-4"},jP={role:"alert",class:"text-danger"},UP={key:0,"data-empty-search":"",class:"flex flex-col items-center gap-3"},HP={class:"flex size-14 items-center justify-center rounded-full bg-subtle text-muted"},KP={class:"text-[17px] font-bold"},WP={class:"max-w-[420px] text-muted"},GP={key:1,"data-empty-list":"",class:"text-muted"},YP=300,JP=ae({__name:"ListView",setup(e){const t=Mn(),n=_r(),a={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},r=ys(a),l=zn(r)??"/",o=M(null),i=M([]),u=M(null),d=M(!0),c=M(!1),f=M(!1),v=_(()=>c.value||f.value),p=M([]),h=M(!1),k=M(0),S=Cr(),x=_(()=>q1(t.query)),E=M(x.value.search??""),L=_(()=>o.value?.messages),D=_(()=>o.value?.title?o.value.title:gs(a.vendor,a.plugin)?.sideMenu.find($e=>$e.controller===r)?.label??r),A=_(()=>u.value?Ge(L.value?.recordCount,u.value.total):""),R=_(()=>o.value?.toolbarButtons??[]),F=_(()=>R.value.filter(oe=>oe==="create")),W=_(()=>{const oe=o.value?.reorder;if(!oe)return null;const $e=oe.partition?.column,ye=$e?o.value?.filters.find(Be=>Be.column===$e||Be.name===$e):void 0,qe=ye?x.value.filter?.[ye.name]:void 0;return{path:`${l}/reorder`,query:qe!==void 0&&qe!==""?{partition:String(qe)}:{}}}),C=_(()=>o.value?.toolbarActions??[]),I=_(()=>R.value.filter(oe=>oe==="delete"||C.value.some($e=>$e.name===oe))),z=M(null),O=_(()=>u.value?.row_states??{}),B=_(()=>({deleted:Ge(L.value?.rowStateDeleted),negative:Ge(L.value?.rowStateNegative),disabled:Ge(L.value?.rowStateDisabled)})),J=_(()=>(o.value?.bulkActions??[]).filter(oe=>oe.name!=="delete")),K=M(!1),H=M(null),le=_(()=>{const oe=o.value?.perPageOptions??[];return oe.length>0?oe:[o.value?.recordsPerPage||20]}),ue=_(()=>x.value.per_page??u.value?.per_page??o.value?.recordsPerPage??20),we=_(()=>x.value.sort?{column:x.value.sort,dir:x.value.dir==="desc"?"desc":"asc"}:null);function Oe(oe){const $e=o.value?.recordUrl,ye=oe.id;return!$e||typeof ye!="number"&&typeof ye!="string"?null:u0($e,r,ye)}function Ae(oe){Ws(r,oe),n.replace({path:t.path,query:zi(oe)})}const ie=Al({}),xe=_(()=>Al(x.value)!==ie);let U=0,ke=null;function me(){Ae({})}async function Y(oe=!1){const $e=++U;d.value=!0,f.value=!1;let ye=null;try{ye=await G()}catch{ye=null}if($e!==U)return;if(!ye?.data&&oe){Ws(r,{}),n.replace({path:t.path,query:{}});return}if(!ye?.data&&ye?.response?.status===404&&await fe($e))return;if(i.value=ye?.data?.data??[],u.value=ye?.data?.meta??null,f.value=!ye?.data,d.value=!1,ye?.response?.status===422){Ws(r,{});return}const qe=u.value?.last_page??0;qe>=1&&(u.value?.page??0)>qe&&Ae({...x.value,page:qe})}async function fe(oe){try{const{data:$e}=await Ne.GET("/{vendor}/{plugin}/{controller}/singleton",{params:{path:a}});return oe!==U?!0:$e?(await n.replace(`${l}/${$e.data.id}`),!0):!1}catch{return!1}}function G(){return Ne.GET("/{vendor}/{plugin}/{controller}",{params:{path:a,query:x.value}})}async function X(){const oe=await Ne.GET("/{vendor}/{plugin}/{controller}/schema/list",{params:{path:a}});o.value=oe.data?.data??null,c.value=!o.value,o.value&&ip(r,o.value.assets)}X(),Ve(()=>Al(x.value),oe=>{if(oe===ie){const ye=M5(r),qe=Al(ye);if(qe!==ie){ke=qe,n.replace({path:t.path,query:zi(ye)});return}}const $e=ke!==null&&ke===oe;ke=null,Ws(r,x.value),p.value=[],E.value=x.value.search??"",Y($e)},{immediate:!0});let te=null;function b(oe){E.value=oe,te!==null&&clearTimeout(te),te=setTimeout(()=>{te=null;const $e=oe.trim();Ae({...x.value,search:$e===""?void 0:$e,page:void 0})},YP)}St(()=>{te!==null&&clearTimeout(te)});function T(){E.value="",Ae({...x.value,search:void 0,page:void 0})}function P(oe){const $e=we.value;$e?.column!==oe?Ae({...x.value,sort:oe,dir:"asc",page:void 0}):$e.dir==="asc"?Ae({...x.value,sort:oe,dir:"desc",page:void 0}):Ae({...x.value,sort:void 0,dir:void 0,page:void 0})}function re(oe){Ae({...x.value,page:oe})}function ee(oe){Ae({...x.value,per_page:oe,page:void 0})}function ce(oe,$e){const ye={...x.value.filter??{}};$e===null?delete ye[oe]:ye[oe]=$e,Ae({...x.value,filter:ye,page:void 0})}async function Ee(){const oe=p.value.map(Number).filter(ye=>Number.isInteger(ye)&&ye>0);if(!(oe.length===0||h.value||!await S.ask({message:Ge(L.value?.deleteConfirm,oe.length),confirmLabel:g("backend::lang.form.delete"),danger:!0}))){h.value=!0;try{const ye=await Ne.POST("/{vendor}/{plugin}/{controller}/bulk-delete",{params:{path:a},body:{ids:oe}});if(ye.data){Le(Ge(L.value?.deleted,ye.data.data.deleted)),p.value=[],await Y(),k.value+=1;return}Le(ye.error?.error.message||g("backend::lang.list.delete_failed"),"danger")}catch{Le(g("backend::lang.list.delete_failed"),"danger")}finally{h.value=!1}}}async function Ce(oe){const $e=J.value.find(at=>at.name===oe),ye=p.value.map(Number).filter(at=>Number.isInteger(at)&&at>0);if(!$e||ye.length===0||K.value)return;const qe=$e.label??oe;let Be=0,He=null,Ze="";const Xe=await S.ask({message:$e.confirm||zr("backend::lang.list.bulk_confirm",ye.length,{action:qe}),confirmLabel:qe,danger:!1},async()=>{K.value=!0;try{const at=await Ne.POST("/{vendor}/{plugin}/{controller}/bulk/{action}",{params:{path:{...a,action:oe}},body:{ids:ye}});Be=at.response.status,He=at.data?.data??null,Ze=at.error?.error.message??""}catch{Be=0}finally{K.value=!1}});if(await new Promise(at=>setTimeout(at,0)),H.value?.focusBulk(),!Xe)return;const ot=He;if(ot){Le(ot.message||zr("backend::lang.list.bulk_done",ot.affected)),p.value=[],await Y(),k.value+=1;return}if(Be===409){Le(g("backend::lang.list.bulk_stale"),"danger"),p.value=[],await Y();return}if(Be===403){Le(Ze||g("backend::lang.list.action_forbidden"),"danger");return}Le(Ze||g("backend::lang.extension.action_failed"),"danger")}async function Te(oe){if(z.value===null){z.value=oe;try{const $e=await Ne.POST("/{vendor}/{plugin}/{controller}/toolbar/{action}",{params:{path:{...a,action:oe}},body:{}});if($e.data){$e.data.data.message&&Le($e.data.data.message),await Y(),k.value+=1;return}Le($e.error?.error.message||g("backend::lang.extension.action_failed"),"danger")}catch{Le(g("backend::lang.extension.action_failed"),"danger")}finally{z.value=null}}}return(oe,$e)=>(m(),y("section",RP,[w("header",qP,[w("div",LP,[w("h1",NP,$(D.value),1),A.value?(m(),y("p",BP,$(A.value),1)):Q("",!0)]),F.value.length>0||W.value?(m(),y("div",FP,[W.value?(m(),j(Ke,{key:0,"data-action":"reorder",variant:"outline",icon:s(qg),to:W.value},{default:q(()=>[_e($(s(g)("backend::lang.messages.list.reorder")),1)]),_:1},8,["icon","to"])):Q("",!0),(m(!0),y(pe,null,Ie(F.value,ye=>(m(),j(Ke,{key:ye,"data-action":"create",variant:"primary",icon:s(xs),to:`${s(l)}/create`},{default:q(()=>[_e($(s(Ge)(L.value?.create)),1)]),_:1},8,["icon","to"]))),128))])):Q("",!0)]),o.value?.headerPartial?(m(),j(up,{key:0,variant:"header",source:a,name:o.value.headerPartial,"reload-key":k.value},null,8,["name","reload-key"])):Q("",!0),w("div",VP,[o.value?(m(),j(nP,{key:0,ref_key:"toolbar",ref:H,"show-search":o.value.showSearch,search:E.value,"search-prompt":s(Ge)(L.value?.searchPrompt),buttons:I.value,"selected-count":p.value.length,"selected-label":s(Ge)(L.value?.selected,p.value.length),"delete-label":s(Ge)(L.value?.deleteSelected,p.value.length),actions:C.value,"busy-action":z.value,"bulk-actions":J.value,"bulk-busy":K.value,"onUpdate:search":b,onDelete:Ee,onAction:Te,onBulk:Ce},null,8,["show-search","search","search-prompt","buttons","selected-count","selected-label","delete-label","actions","busy-action","bulk-actions","bulk-busy"])):Q("",!0),o.value&&o.value.filters.length>0?(m(),j(K6,{key:1,filters:o.value.filters,values:x.value.filter??{},source:a,onUpdate:ce},null,8,["filters","values"])):Q("",!0),v.value&&!d.value?(m(),y("div",zP,[w("p",jP,$(s(g)("backend::lang.list.load_failed")),1),f.value&&xe.value?(m(),j(Ke,{key:0,"data-action":"reset-list",onClick:me},{default:q(()=>[_e($(s(g)("backend::lang.list.reset_list")),1)]),_:1})):Q("",!0)])):(m(),j(d0,{key:3,columns:o.value?.columns??[],rows:i.value,loading:d.value||!o.value,"row-link":Oe,selectable:o.value?.showCheckboxes??!1,selected:p.value,sortable:o.value?.showSorting??!1,sort:we.value,"row-states":O.value,"state-labels":B.value,"onUpdate:selected":$e[0]||($e[0]=ye=>p.value=ye),onSort:P},{empty:q(()=>[x.value.search?(m(),y("div",UP,[w("span",HP,[N(s(Jg),{size:24,"aria-hidden":"true"})]),w("p",KP,$(s(Ge)(L.value?.emptySearch,void 0,{term:x.value.search})),1),w("p",WP,$(s(Ge)(L.value?.emptySearchHint,void 0,{term:x.value.search})),1),N(Ke,{"data-action":"clear-search",onClick:T},{default:q(()=>[_e($(s(g)("backend::lang.list.clear_search")),1)]),_:1})])):(m(),y("p",GP,$(s(Ge)(L.value?.empty)||o.value?.noRecordsMessage||s(g)("backend::lang.list.no_records")),1))]),_:1},8,["columns","rows","loading","selectable","selected","sortable","sort","row-states","state-labels"])),N(f0,{meta:u.value,loading:d.value||!o.value,"per-page-options":le.value,"per-page":ue.value,onPage:re,onPerPage:ee},null,8,["meta","loading","per-page-options","per-page"])]),N($r,{open:s(S).request.value!==null,message:s(S).request.value?.message??"","confirm-label":s(S).request.value?.confirmLabel,danger:s(S).request.value?.danger,busy:s(S).busy.value,onConfirm:s(S).confirm,onCancel:s(S).cancel},null,8,["open","message","confirm-label","danger","busy","onConfirm","onCancel"])]))}}),vr="X-Session-Key",p0="X-Child-Session-Key",ZP=32;function ds(){const e=new Uint8Array(ZP);globalThis.crypto.getRandomValues(e);let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const XP="X-Upload-Id";async function rr(e){try{const t=await e();return{data:t.data?t.data.data:null,status:t.response.status,error:t.error?.error??null}}catch{return{data:null,status:0,error:null}}}async function ji(e){try{const t=await e();return t.response.ok&&t.data instanceof Blob?t.data:null}catch{return null}}function Sa(e){return encodeURIComponent(String(e))}function m0(e){return`${Gr.api}/${Sa(e.vendor)}/${Sa(e.plugin)}/${Sa(e.controller)}`}function QP(e){try{return e===""?null:JSON.parse(e)}catch{return null}}function cp(e){if(!e)return"";for(const t of Object.values(e.details??{})){const n=Array.isArray(t)?t.find(a=>typeof a=="string"&&a!==""):t;if(typeof n=="string"&&n!=="")return n}return e.message??""}function eI(e,t){const n=t;if((e===200||e===201)&&n?.data)return{ok:!0,item:n.data};const a=cp(n?.error);return e===413?{ok:!1,reason:"too_large",status:e,message:a}:e===422?{ok:!1,reason:"invalid",status:e,message:a}:e===0?{ok:!1,reason:"network",status:e,message:a}:{ok:!1,reason:"failed",status:e,message:a}}function v0(e,t,n,a,r){let l=null,o=!1;const i=()=>new Promise(d=>{const c=new XMLHttpRequest;l=c,c.open("POST",e),c.setRequestHeader("X-Requested-With",Ag),c.setRequestHeader("Accept","application/json");for(const[v,p]of Object.entries(n))c.setRequestHeader(v,p);r&&c.setRequestHeader(XP,r),c.upload.onprogress=v=>{v.lengthComputable&&a?.(v.loaded,v.total)},c.onload=()=>d({status:c.status,body:QP(c.responseText)}),c.onerror=()=>d("network"),c.ontimeout=()=>d("network"),c.onabort=()=>d("aborted");const f=new FormData;f.append("file_data",t,t.name),c.send(f)});return{promise:(async()=>{let d=await i();return typeof d=="object"&&d.status===401&&!o&&(await lf()&&(d=o?"aborted":await i()),typeof d=="object"&&d.status===401&&t2()),d==="aborted"||o?{ok:!1,reason:"aborted",status:0,message:""}:d==="network"?{ok:!1,reason:"network",status:0,message:""}:eI(d.status,d.body)})(),abort(){o=!0,l?.abort()}}}function h0(e,t,n,a){const r={...e,id:t,field:n},l={[vr]:a},o=`${m0(e)}/${Sa(t)}/files/${Sa(n)}`;return{list:()=>rr(()=>Ne.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}",{params:{path:r,header:l}})),upload:(i,u,d)=>v0(o,i,{...l},u,d),update:(i,u)=>rr(()=>Ne.PUT("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}",{params:{path:{...r,file:i},header:l},body:u})),remove:i=>rr(()=>Ne.DELETE("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}",{params:{path:{...r,file:i},header:l}})),reorder:i=>rr(()=>Ne.POST("/{vendor}/{plugin}/{controller}/{id}/files/{field}/reorder",{params:{path:r,header:l},body:{ids:i}})),download:i=>ji(()=>Ne.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}/download",{params:{path:{...r,file:i},header:l},parseAs:"blob"})),thumb:i=>ji(()=>Ne.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}/thumb",{params:{path:{...r,file:i},header:l},parseAs:"blob"}))}}function tI(e,t,n,a,r,l,o){const i={...e,id:t,name:n,child:a,field:r},u={[vr]:l,[p0]:o},d=`${m0(e)}/${Sa(t)}/relations/${Sa(n)}/records/${Sa(a)}/files/${Sa(r)}`;return{list:()=>rr(()=>Ne.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}",{params:{path:i,header:u}})),upload:(c,f,v)=>v0(d,c,{...u},f,v),update:(c,f)=>rr(()=>Ne.PUT("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}",{params:{path:{...i,file:c},header:u},body:f})),remove:c=>rr(()=>Ne.DELETE("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}",{params:{path:{...i,file:c},header:u}})),reorder:c=>rr(()=>Ne.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/reorder",{params:{path:i,header:u},body:{ids:c}})),download:c=>ji(()=>Ne.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}/download",{params:{path:{...i,file:c},header:u},parseAs:"blob"})),thumb:c=>ji(()=>Ne.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}/thumb",{params:{path:{...i,file:c},header:u},parseAs:"blob"}))}}const nI=new Set(["readonly","placeholder","maxlength","minlength","min","max","step","autocomplete","spellcheck","pattern"]);function Sr(e){const t={};for(const[n,a]of Object.entries(e.attributes??{})){const r=n.toLowerCase();!nI.has(r)||a===null||a===!1||(t[r]=a)}return t}function Ft(e){return["w-full rounded-control border bg-surface px-3.5 text-text transition-colors duration-150 ease-out",e?"border-danger":"border-border-strong"].join(" ")}function Ru(e){return typeof e=="string"?e!==""&&e!=="0"&&e.toLowerCase()!=="false":!!e}function y0(e,t){return typeof e=="number"?t?1:0:t}function g0(e,t,n){const a={};if(t===null||typeof t!="object"||Array.isArray(t))return a;const r=t;for(const l of e.permissionOptions??[]){if(n?.has(l.code))continue;const o=Number(r[l.code]);(o===1||e.mode==="radio"&&o===-1)&&(a[l.code]=o)}return a}const aI=new Set(["mltext","mltextarea","mlmarkdown"]);function rI(e){return e!==void 0&&aI.has(e)}function hr(e){return e?rI(e.type)||!!e.element&&e.translatable===!0:!1}const fs="summer:ml-locale";function lI(e){typeof window>"u"||e===""||window.dispatchEvent(new CustomEvent(fs,{detail:e}))}function la(e){const t={};if(e===null||typeof e!="object"||Array.isArray(e))return t;for(const[n,a]of Object.entries(e))typeof a=="string"&&(t[n]=a);return t}const oI={class:"flex min-w-0 flex-col"},sI=["for"],iI={key:0,class:"text-danger","aria-hidden":"true"},uI=["id"],cI=["id","name","checked","aria-invalid","aria-describedby"],dI=ae({__name:"CheckboxField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=_(()=>Ru(n.modelValue));function l(o){a("update:modelValue",y0(n.modelValue,o.target.checked))}return(o,i)=>(m(),y("div",{class:ve([e.invalid?"border-danger":"border-border","flex items-center justify-between gap-4 rounded-inner border px-4 py-3.5"]),"data-toggle-card":""},[w("div",oI,[w("label",{for:e.controlId,class:"font-semibold"},[_e($(e.field.label||e.field.name),1),e.field.required?(m(),y("span",iI," *")):Q("",!0)],8,sI),e.field.comment?(m(),y("p",{key:0,id:`${e.controlId}-comment`,class:"text-[13px] text-muted"},$(e.field.comment),9,uI)):Q("",!0)]),w("input",{id:e.controlId,type:"checkbox",name:e.field.name,checked:r.value,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"size-5 shrink-0 rounded-[6px] accent-primary",onChange:l},null,40,cI)],2))}});function fI(e){return e==="date"||e==="time"?e:"datetime"}function sn(e,t=2){return String(e).padStart(t,"0")}const pI=/(Z|[+-]\d{2}:?\d{2})$/i;function mI(e,t,n=!1){if(typeof t!="string"||t.trim()==="")return null;const a=t.trim();try{if(e==="date")return Ab(a.slice(0,10));if(e==="time"){const l=/(\d{2}:\d{2}(:\d{2})?)/.exec(a.includes("T")?a.slice(a.indexOf("T")):a);return l?qE(l[1]):null}const r=pI.test(a)?a.replace(" ","T"):`${a.replace(" ","T")}Z`;return n?ca(iv(r,"UTC")):iv(r,Hn())}catch{return null}}function Ic(e){return`${sn(e.year,4)}-${sn(e.month)}-${sn(e.day)}`}function Rc(e){return`${sn(e.hour)}:${sn(e.minute)}:${sn(e.second)}`}function lh(e,t,n=!1){if(!t)return null;if(e==="time")return"hour"in t?Rc(t):null;if(!("year"in t))return null;if(e==="date")return Ic(t);if(n){const l=t instanceof Pa?ca(t):t,o="hour"in l?Rc(l):"00:00:00";return`${Ic(l)}T${o}Z`}const a=t instanceof Pa?t:Cf(t instanceof yt?ca(t):t,Hn()),r=bu(a,"UTC");return`${Ic(r)}T${Rc(r)}Z`}const vI={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm",time:"HH:mm"},hI=/\[([^\]]*)\]|YYYY|YY|MMMM|MMM|MM|M|dddd|ddd|DD|D|HH|H|hh|h|mm|ss|A|a/g;function yI(e){return"year"in e?new yt(e.year,e.month,e.day):null}function qc(e,t,n,a){return new In(e,{...n,timeZone:"UTC"}).formatToParts(t.toDate("UTC")).find(l=>l.type===a)?.value??""}function gI(e,t,n,a){if(!e)return"";const r=n||vI[t],l=yI(e),o="hour"in e?e:null,i=/D/.test(r.replace(/\[[^\]]*\]/g,""));return r.replace(hI,(u,d)=>{if(d!==void 0)return d;switch(u){case"YYYY":return l?sn(l.year,4):"";case"YY":return l?sn(l.year%100):"";case"MMMM":case"MMM":{if(!l)return"";const c=u==="MMMM"?"long":"short";return i?qc(a,l,{day:"numeric",month:c},"month"):qc(a,l,{month:c},"month")}case"MM":return l?sn(l.month):"";case"M":return l?String(l.month):"";case"dddd":case"ddd":return l?qc(a,l,{weekday:u==="dddd"?"long":"short"},"weekday"):"";case"DD":return l?sn(l.day):"";case"D":return l?String(l.day):"";case"HH":return o?sn(o.hour):"";case"H":return o?String(o.hour):"";case"hh":return o?sn(o.hour%12||12):"";case"h":return o?String(o.hour%12||12):"";case"mm":return o?sn(o.minute):"";case"ss":return o?sn(o.second):"";case"A":return o?o.hour<12?"AM":"PM":"";case"a":return o?o.hour<12?"am":"pm":"";default:return u}})}const bI=new yt(2026,10,4);function _I(e,t){if(typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=6)return t;try{return(7-gu(bI,e))%7}catch{return 1}}function oh(e){if(e)try{return Ab(e.slice(0,10))}catch{return}}function xI(e,t=Cs(Hn())){const n=oh(e.minDate),a=oh(e.maxDate);if(n||a)return{min:n,max:a};const r=e.yearRange??[];return r.length===1&&typeof r[0]=="number"?{min:new yt(t.year-r[0],1,1),max:new yt(t.year+r[0],12,31)}:r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"?{min:new yt(r[0],1,1),max:new yt(r[1],12,31)}:{}}function Nd(e,t,n,a){if(!e||t==="time")return;if(t==="date")return e;const r=new dr(e.year,e.month,e.day,a?23:0,a?59:0,a?59:0);return n?r:bu(Cf(r,"UTC"),Hn())}function kI(e,t){const n=Cs(Hn());return Nd(n,e==="time"?"datetime":e,t,!1)??n}const wI=["id","aria-describedby"],$I={key:0},CI={key:1,class:"text-muted","data-empty":""},SI=["aria-label"],EI={class:"flex size-8 shrink-0 items-center justify-center text-muted","aria-hidden":"true"},AI=["data-mode"],TI=["aria-label"],DI={key:0,"data-datepicker-time":"",class:"mt-3 flex items-center gap-2 border-t border-border pt-3"},$o="flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",OI=ae({__name:"DatepickerField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=_(()=>fI(n.field.mode)),l=_(()=>r.value==="datetime"&&!!n.field.ignoreTimezone),o=_(()=>ua.value||"pl"),i=_(()=>{const ie=n.field.attributes?.readonly;return!!n.field.readOnly||ie!=null&&ie!==!1}),u=_(()=>mI(r.value,n.modelValue,l.value)),d=_(()=>r.value==="time"?null:u.value),c=_(()=>r.value==="time"?u.value:null),f=_(()=>xI(n.field)),v=_(()=>Nd(f.value.min,r.value,l.value,!1)),p=_(()=>Nd(f.value.max,r.value,l.value,!0)),h=kI(r.value,l.value),k=_(()=>_I(o.value,n.field.firstDay)),S=_(()=>n.field.twelveHour?12:24),x=_(()=>r.value==="date"?"day":"minute"),E=_(()=>gI(u.value,r.value,n.field.displayFormat,o.value)),L=_(()=>!n.field.required&&u.value!==null&&!i.value),D=_(()=>{const ie=d.value;return ie?!!v.value&&ie.compare(v.value)<0||!!p.value&&ie.compare(p.value)>0:!1}),A=new Set(["day","month","year","hour","minute","second"]),R=M(null),F=M(!1);function W(){const ie=R.value;if(!ie){F.value=!1;return}const xe=Array.from(ie.querySelectorAll("[data-reka-date-field-segment], [data-reka-time-field-segment]")).filter(ke=>A.has(ke.dataset.rekaDateFieldSegment??ke.dataset.rekaTimeFieldSegment??"")),U=xe.filter(ke=>!ke.hasAttribute("data-placeholder")).length;F.value=U>0&&U!!n.invalid||D.value||F.value),z=_(()=>lh(r.value,u.value,l.value));function O(ie){const xe=lh(r.value,ie??null,l.value);C(),!(xe===z.value&&(xe!==null||n.modelValue===null))&&a("update:modelValue",xe)}function B(ie){if(!ie||r.value!=="datetime"){O(ie);return}const xe=d.value,U=H.value,ke=!xe||xe.year!==ie.year||xe.month!==ie.month||xe.day!==ie.day,me=!("hour"in ie)||ie.hour!==U.hour||ie.minute!==U.minute;ke&&me&&(ie=le(ie,U)),K.value=ie,O(ie)}function J(){a("update:modelValue",null),C()}const K=M(null);Ve(d,ie=>{K.value=ie},{immediate:!0});const H=_(()=>{const ie=K.value??d.value;return ie&&"hour"in ie?new aa(ie.hour,ie.minute):new aa(0,0)});function le(ie,xe){return"hour"in ie?ie.set({hour:xe.hour,minute:xe.minute,second:0,millisecond:0}):new dr(ie.year,ie.month,ie.day,xe.hour,xe.minute)}function ue(ie){if(!ie)return;const xe=ie instanceof aa?ie:new aa(ie.hour,ie.minute),U=K.value??d.value??h,ke=le(U,xe);K.value=ke,O(ke)}function we(ie){return ie.charAt(0).toLocaleUpperCase(o.value)+ie.slice(1)}const Oe=_(()=>[Ft(I.value),"h-input flex min-w-0 items-center gap-1 pl-3.5 pr-1.5","focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]","has-[[data-invalid]]:border-danger"]);function Ae(ie){return ie==="literal"?"text-muted":ie==="timeZoneName"?"ml-2 min-w-0 truncate text-[13px] text-muted":"rounded-[4px] px-0.5 tabular-nums outline-none focus:bg-sel focus:text-text focus-visible:outline-none data-[placeholder]:text-placeholder focus:data-[placeholder]:text-text"}return(ie,xe)=>i.value?(m(),y("p",{key:0,id:e.controlId,"data-datepicker-readonly":"","aria-describedby":e.describedBy||void 0,class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 tabular-nums"},[E.value!==""?(m(),y("span",$I,$(E.value),1)):(m(),y("span",CI,"—"))],8,wI)):r.value==="time"?(m(),y("div",{key:1,ref_key:"container",ref:R,"data-datepicker":"","data-mode":"time",class:ve(Oe.value),onKeyup:C,onFocusout:C},[N(s(Gv),{id:e.controlId,"model-value":c.value,locale:o.value,"hour-cycle":S.value,granularity:"minute",name:e.field.name,required:e.field.required||void 0,"aria-invalid":I.value?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"flex min-w-0 flex-1 items-center","onUpdate:modelValue":O},{default:q(({segments:U})=>[(m(!0),y(pe,null,Ie(U,ke=>(m(),j(s(Yv),{key:ke.part,part:ke.part,class:ve(Ae(ke.part))},{default:q(()=>[_e($(ke.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["id","model-value","locale","hour-cycle","name","required","aria-invalid","aria-describedby"]),L.value?(m(),y("button",{key:0,type:"button","data-action":"clear","aria-label":s(g)("backend::lang.datepicker.clear"),class:ve($o),onClick:J},[N(s(Qt),{size:16,"aria-hidden":"true"})],8,SI)):Q("",!0),w("span",EI,[N(s(pd),{size:16})])],34)):(m(),j(s(WO),{key:2,id:e.controlId,"model-value":d.value,"default-placeholder":s(h),locale:o.value,granularity:x.value,"hour-cycle":S.value,"hide-time-zone":r.value!=="datetime"||l.value,"min-value":v.value,"max-value":p.value,"week-starts-on":k.value,name:e.field.name,required:e.field.required||void 0,"close-on-select":r.value==="date","prevent-deselect":"","onUpdate:modelValue":B},{default:q(()=>[w("div",{ref_key:"container",ref:R,"data-datepicker":"","data-mode":r.value,class:ve(Oe.value),onKeyup:C,onFocusout:C},[N(s(cM),{"aria-invalid":I.value?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"flex min-w-0 flex-1 items-center overflow-hidden"},{default:q(({segments:U})=>[(m(!0),y(pe,null,Ie(U,ke=>(m(),j(s(CM),{key:ke.part,part:ke.part,class:ve(Ae(ke.part))},{default:q(()=>[_e($(ke.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["aria-invalid","aria-describedby"]),L.value?(m(),y("button",{key:0,type:"button","data-action":"clear","aria-label":s(g)("backend::lang.datepicker.clear"),class:ve($o),onClick:J},[N(s(Qt),{size:16,"aria-hidden":"true"})],8,TI)):Q("",!0),N(s(PM),{"data-action":"open-calendar","aria-label":s(g)("backend::lang.datepicker.open_calendar"),class:ve($o)},{default:q(()=>[N(s(Bg),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])],42,AI),N(s(iM),{"data-datepicker-calendar":"","side-offset":4,align:"end",class:"z-50 w-[284px] rounded-inner border border-border bg-surface p-4 text-text shadow-menu"},{default:q(()=>[N(s(YO),null,{default:q(({weekDays:U,grid:ke})=>[N(s(xM),{class:"flex h-9 items-center justify-between"},{default:q(()=>[N(s(TM),{"aria-label":s(g)("backend::lang.datepicker.prev_month"),class:ve($o)},{default:q(()=>[N(s(pu),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"]),N(s(wM),{class:"font-semibold"},{default:q(({headingValue:me})=>[_e($(we(me)),1)]),_:1}),N(s(EM),{"aria-label":s(g)("backend::lang.datepicker.next_month"),class:ve($o)},{default:q(()=>[N(s(_s),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),_:1}),(m(!0),y(pe,null,Ie(ke,me=>(m(),j(s(fM),{key:me.value.toString(),class:"mt-2 w-full border-collapse select-none"},{default:q(()=>[N(s(hM),null,{default:q(()=>[N(s(Uv),{class:"flex"},{default:q(()=>[(m(!0),y(pe,null,Ie(U,Y=>(m(),j(s(bM),{key:Y,class:"flex h-9 w-9 items-center justify-center text-[13px] font-normal text-muted"},{default:q(()=>[_e($(Y),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),N(s(mM),null,{default:q(()=>[(m(!0),y(pe,null,Ie(me.rows,(Y,fe)=>(m(),j(s(Uv),{key:`week-${fe}`,class:"flex"},{default:q(()=>[(m(!0),y(pe,null,Ie(Y,G=>(m(),j(s(ZO),{key:G.toString(),date:G,class:"p-0"},{default:q(()=>[N(s(QO),{day:G,month:me.value,class:"flex size-9 items-center justify-center rounded-pager tabular-nums text-text transition-colors duration-150 ease-out hover:bg-hover data-[outside-view]:text-placeholder data-[today]:font-semibold data-[today]:shadow-[inset_0_0_0_1px_var(--c-border-strong)] data-[selected]:bg-primary data-[selected]:font-semibold data-[selected]:text-on-primary data-[disabled]:cursor-not-allowed data-[disabled]:text-placeholder data-[disabled]:opacity-40 data-[disabled]:hover:bg-transparent data-[unavailable]:cursor-not-allowed data-[unavailable]:opacity-40"},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1}),r.value==="datetime"?(m(),y("div",DI,[N(s(pd),{size:16,class:"shrink-0 text-muted","aria-hidden":"true"}),N(s(Gv),{"model-value":H.value,locale:o.value,"hour-cycle":S.value,granularity:"minute","hide-time-zone":"",class:"flex min-w-0 items-center","onUpdate:modelValue":ue},{default:q(({segments:U})=>[(m(!0),y(pe,null,Ie(U,ke=>(m(),j(s(Yv),{key:ke.part,part:ke.part,class:ve(Ae(ke.part))},{default:q(()=>[_e($(ke.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["model-value","locale","hour-cycle"])])):Q("",!0)]),_:1})]),_:1},8,["id","model-value","default-placeholder","locale","granularity","hour-cycle","hide-time-zone","min-value","max-value","week-starts-on","name","required","close-on-select"]))}}),dp=Symbol("summer.form.values"),fp=Symbol("summer.form.patch"),pp=Symbol("summer.form.locale"),Ui=Symbol("summer.form.enabledLocales"),b0=Symbol("summer.form.assets");function mp(){const e=M(0);return{activeUploads:e,beginUpload(){e.value++;let t=!1;return()=>{t||(t=!0,e.value>0&&e.value--)}}}}const ro=Symbol("summer.form.session"),_0=Symbol("summer.settings.secrets"),vp=Symbol("summer.form.permissionLocks"),hp=Symbol("summer.form.triggerNotes"),sh="summer-action",MI="summer-result",ih="summer-change",uh="summer-upload",PI="summer-upload-result",x0=5e3,yp=Symbol("summer.form.feedback"),Ss=Symbol("summer.form.fieldScope"),gp=Symbol("summer.form.rememberLabel"),k0=Symbol("summer.form.dependentCache"),II=["data-dependent"],RI={class:"relative"},qI=["id","name","value","disabled","required","aria-required","aria-invalid","aria-busy","aria-describedby"],LI={key:0,value:"state",class:"text-muted"},NI=["value"],BI=["id"],FI={key:1,class:"flex flex-wrap items-center gap-2"},VI=["id"],Js="empty",Zs="placeholder",zI=ae({__name:"DropdownField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=" ".repeat(4),l=it(Ss,null),o=it(yp,null),i=it(k0,null)??new Map,u=_(()=>n.field.dependsOn??""),d=_(()=>u.value!==""),c=M("waiting"),f=M([]),v=_(()=>{const H=l?.values.value[u.value];return H==null||H===""||typeof H=="object"?null:String(H)}),p=_(()=>l?.fields.value.find(H=>H.name===u.value)),h=_(()=>p.value?.label||u.value),k=_(()=>(p.value?.options??[]).find(le=>x(le.value,v.value))?.label??v.value??""),S=_(()=>d.value?f.value:n.field.options??[]);function x(H,le){return H==null||le===null||le===void 0?H===le||H==null&&le==null:String(H)===String(le)}function E(){return n.modelValue!==null&&n.modelValue!==void 0&&n.modelValue!==""}function L(){E()&&(a("update:modelValue",null),o?.announce(g("backend::lang.form.dependent_cleared",{field:n.field.label||n.field.name})))}function D(H,le){if(!H.applies){f.value=[],c.value="unused",le&&L();return}f.value=H.options.map(ue=>({value:ue.value,label:r.repeat(Math.max(0,ue.depth))+ue.label})),c.value=f.value.length>0?"ready":"empty",le&&E()&&!f.value.some(ue=>x(ue.value,n.modelValue))&&L()}let A=0,R=!1;async function F(H){const le=++A,ue=v.value;if(ue===null){f.value=[],c.value="waiting",H&&L();return}const we=l?.path(n.field.name)??n.field.name,Oe=`${we}\0${ue}`,Ae=i.get(Oe);if(Ae){D(Ae,H);return}if(!n.source){R=H,c.value="failed";return}c.value="loading";try{const{data:ie}=await Ne.GET("/{vendor}/{plugin}/{controller}/fields/{field}/dependent-options",{params:{path:{...n.source,field:we},query:{[`values[${u.value}]`]:ue}}});if(le!==A)return;if(!ie){R=H,c.value="failed";return}i.set(Oe,ie.data),D(ie.data,H)}catch{le===A&&(R=H,c.value="failed")}}function W(){F(R)}Ve(v,(H,le)=>{d.value&&H!==le&&F(!0)}),wt(()=>{d.value&&F(!1)}),St(()=>{A++});const C=_(()=>{const H=S.value.findIndex(le=>x(le.value,n.modelValue));return H>=0?String(H):n.field.emptyOption!==void 0&&!E()?Js:Zs}),I=_(()=>{switch(c.value){case"waiting":return g("backend::lang.form.dependent_waiting",{field:h.value});case"loading":return g("backend::lang.form.loading_options");case"unused":return g("backend::lang.form.dependent_not_used");case"empty":return g("backend::lang.form.dependent_empty",{type:k.value});case"failed":return g("backend::lang.form.dependent_failed");default:return""}}),z=_(()=>d.value&&c.value!=="ready"),O=_(()=>z.value||C.value===Js||C.value===Zs),B=_(()=>`${n.controlId}-dependent`),J=_(()=>[n.describedBy??"",d.value&&(c.value==="empty"||c.value==="failed")?B.value:""].filter(Boolean).join(" "));function K(H){const le=H.target.value;if(le===Js){a("update:modelValue",null);return}const ue=S.value[Number(le)];ue&&a("update:modelValue",ue.value)}return(H,le)=>(m(),y("div",{class:"flex flex-col gap-1.5","data-dependent":d.value?c.value:void 0},[w("div",RI,[w("select",{id:e.controlId,name:e.field.name,value:z.value?"state":C.value,disabled:z.value||void 0,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-busy":d.value&&c.value==="loading"?"true":void 0,"aria-describedby":J.value||void 0,class:ve([[s(Ft)(e.invalid),O.value?"text-muted":""],"h-input appearance-none pr-10 disabled:cursor-not-allowed"]),onChange:K},[z.value?(m(),y("option",LI,$(I.value),1)):(m(),y(pe,{key:1},[e.field.emptyOption!==void 0?(m(),y("option",{key:0,value:Js,class:"text-muted"},$(e.field.emptyOption),1)):Q("",!0),C.value===Zs?(m(),y("option",{key:1,value:Zs,disabled:""},$(s(g)("backend::lang.form.select_placeholder")),1)):Q("",!0),(m(!0),y(pe,null,Ie(S.value,(ue,we)=>(m(),y("option",{key:we,value:String(we),class:"text-text"},$(ue.label),9,NI))),128))],64))],42,qI),N(s(ur),{size:16,class:"pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"})]),d.value&&c.value==="empty"?(m(),y("p",{key:0,id:B.value,"data-dependent-hint":"",class:"text-[13px] text-muted"},$(I.value),9,BI)):d.value&&c.value==="failed"?(m(),y("div",FI,[w("p",{id:B.value,role:"alert",class:"flex items-center gap-1.5 text-[13px] text-danger"},[N(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(s(g)("backend::lang.form.dependent_failed")),1)],8,VI),N(Ke,{variant:"ghost",size:"sm",icon:s(li),"data-action":"dependent-retry",onClick:W},{default:q(()=>[_e($(s(g)("backend::lang.form.dependent_retry")),1)]),_:1},8,["icon"])])):Q("",!0)],8,II))}}),jI={class:"flex items-start gap-3"},UI={class:"flex min-w-0 flex-1 flex-col gap-1"},HI={key:0,class:"flex items-center gap-4"},KI=["src"],WI={key:1,class:"flex size-16 shrink-0 items-center justify-center rounded-inner bg-subtle","aria-hidden":"true"},GI=["title"],YI={class:"flex flex-col gap-1.5"},JI=["for"],ZI=["id","disabled","aria-invalid","aria-describedby"],XI=["id"],QI={class:"flex flex-col gap-1.5"},eR=["for"],tR=["id","disabled","aria-invalid","aria-describedby"],nR=["id"],aR={class:"flex gap-2.5"},rR=["disabled"],lR=["aria-keyshortcuts","title","disabled"],oR=ae({__name:"FileCaptionModal",props:{open:{type:Boolean},file:{},routes:{},preview:{},idPrefix:{}},emits:["update:open","saved","closed"],setup(e,{emit:t}){const n=e,a=t,r=M(""),l=M(""),o=M({}),i=M(!1),u=Cr();function d(S){const x={};for(const[E,L]of Object.entries(S??{})){const D=(Array.isArray(L)?L:[L]).filter(A=>typeof A=="string"&&A!=="");D.length>0&&(x[E]=D)}return x}const c=_(()=>`${n.idPrefix}-caption-title`),f=_(()=>`${n.idPrefix}-caption-description`),v=_(()=>!!n.file&&(r.value!==n.file.title||l.value!==n.file.description));Ve(()=>n.open,S=>{S&&n.file&&(r.value=n.file.title??"",l.value=n.file.description??"",o.value={},i.value=!1)},{immediate:!0});async function p(S){if(S){a("update:open",!0);return}i.value||v.value&&!await u.ask({message:g("backend::lang.form.unsaved_confirm"),confirmLabel:g("backend::lang.form.discard"),danger:!0})||a("update:open",!1)}async function h(){if(!(i.value||!n.file||!n.routes)){i.value=!0;try{const S=await n.routes.update(n.file.id,{title:r.value,description:l.value});if(S.data){o.value={},a("saved",S.data),a("update:open",!1),Le(g("backend::lang.fileupload.details_saved"));return}if(S.status===422){o.value=d(S.error?.details),Object.keys(o.value).length===0&&(o.value={title:[cp(S.error)||g("backend::lang.form.error_generic")]});return}Le(S.error?.message||g("backend::lang.form.error_generic"),"danger")}finally{i.value=!1}}}function k(S){S.preventDefault(),a("closed")}return(S,x)=>(m(),y(pe,null,[N(s(Xr),{open:e.open,"onUpdate:open":p},{default:q(()=>[N(s(eo),null,{default:q(()=>[N(s(el),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),N(s(Qr),{"data-caption-modal":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop",onCloseAutoFocus:k},{default:q(()=>[w("div",jI,[w("div",UI,[N(s(tl),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:q(()=>[_e($(s(g)("backend::lang.fileupload.attachment")),1)]),_:1}),N(s(fr),{class:"text-muted"},{default:q(()=>[_e($(s(g)("backend::lang.fileupload.help")),1)]),_:1})]),N(s(Hr),{"data-action":"close","aria-label":s(g)("backend::lang.form.close"),disabled:i.value,class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:q(()=>[N(s(Qt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","disabled"])]),e.file?(m(),y("div",HI,[e.preview?(m(),y("img",{key:0,src:e.preview,alt:"",class:"size-16 shrink-0 rounded-inner object-cover"},null,8,KI)):(m(),y("span",WI,[N(s(El),{size:16,class:"text-muted"})])),w("span",{class:"min-w-0 truncate text-[13px] text-muted",title:e.file.file_name},$(e.file.file_name),9,GI)])):Q("",!0),w("form",{class:"flex flex-col gap-4",novalidate:"",onSubmit:ft(h,["prevent"])},[w("div",YI,[w("label",{for:c.value,class:"font-semibold"},$(s(g)("backend::lang.fileupload.title_label")),9,JI),sa(w("input",{id:c.value,"onUpdate:modelValue":x[0]||(x[0]=E=>r.value=E),type:"text","data-caption-title":"",disabled:i.value,"aria-invalid":o.value.title?"true":void 0,"aria-describedby":o.value.title?`${c.value}-error`:void 0,class:ve([s(Ft)(!!o.value.title),"h-input"])},null,10,ZI),[[jl,r.value]]),o.value.title?(m(),y("p",{key:0,id:`${c.value}-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[N(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(o.value.title.join(" ")),1)],8,XI)):Q("",!0)]),w("div",QI,[w("label",{for:f.value,class:"font-semibold"},$(s(g)("backend::lang.fileupload.description_label")),9,eR),sa(w("textarea",{id:f.value,"onUpdate:modelValue":x[1]||(x[1]=E=>l.value=E),rows:"3","data-caption-description":"",disabled:i.value,"aria-invalid":o.value.description?"true":void 0,"aria-describedby":o.value.description?`${f.value}-error`:void 0,class:ve([s(Ft)(!!o.value.description),"min-h-input resize-y py-2.5"])},null,10,tR),[[jl,l.value]]),o.value.description?(m(),y("p",{key:0,id:`${f.value}-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[N(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(o.value.description.join(" ")),1)],8,nR)):Q("",!0)]),w("div",aR,[w("button",{type:"button","data-action":"cancel",disabled:i.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:x[2]||(x[2]=E=>p(!1))},$(s(g)("backend::lang.form.cancel")),9,rR),w("button",{type:"submit","data-action":"save-caption","data-hotkey":"mod+s mod+enter","aria-keyshortcuts":s(Pu)("mod+s mod+enter"),title:s(qn)(s(g)("backend::lang.fileupload.details_submit"),"mod+s"),disabled:i.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"},$(i.value?s(g)("backend::lang.form.saving"):s(g)("backend::lang.fileupload.details_submit")),9,lR)])],32)]),_:1})]),_:1})]),_:1},8,["open"]),N($r,{open:s(u).request.value!==null,message:s(u).request.value?.message??"","confirm-label":s(u).request.value?.confirmLabel,danger:s(u).request.value?.danger,onConfirm:s(u).confirm,onCancel:s(u).cancel},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])],64))}}),sR=["id","data-field-name","aria-labelledby","aria-describedby","aria-busy"],iR={key:0,"data-fileupload-loading":"",class:"h-[112px] rounded-control bg-skel","aria-hidden":"true"},uR={key:1,role:"alert","data-fileupload-failed":"",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},cR={key:0,"data-fileupload-empty":"",class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 text-muted"},dR={key:1,"data-fileupload-grid":"",class:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-4"},fR=["data-file-item","data-state","onDragover","onDrop"],pR={class:"relative flex aspect-square items-center justify-center bg-subtle"},mR=["href","aria-label"],vR=["src","alt","onError"],hR=["aria-label","onClick"],yR=["src","alt"],gR={key:2,"data-preview-unavailable":"",class:"flex flex-col items-center gap-2 text-[13px] text-muted"},bR=["data-handle","aria-label","onKeydown","onDragstart"],_R={key:5,class:"absolute top-2 right-2 flex gap-1"},xR=["data-caption","aria-label","onClick"],kR=["aria-label","onClick"],wR=["aria-label","onClick"],$R={class:"flex flex-col gap-1 p-2"},CR=["title"],SR={class:"flex items-center gap-2 text-[13px] text-muted tabular-nums"},ER={key:0},AR={key:1},TR={key:2},DR={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},OR={key:1,"data-file-error":"",class:"text-[13px] text-danger"},MR={class:"sr-only"},PR={key:2,"data-fileupload-single":"",class:"flex flex-col gap-2"},IR=["data-file-item","data-state"],RR=["src","alt","onError"],qR={key:3,"data-preview-unavailable":"",class:"flex flex-col items-center gap-2 text-[13px] text-muted"},LR={class:"flex min-w-0 flex-1 flex-col gap-1"},NR=["title"],BR={class:"flex items-center gap-2 text-[13px] text-muted tabular-nums"},FR={key:0},VR={key:1},zR={key:2},jR={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},UR={key:1,"data-file-error":"",class:"text-[13px] text-danger"},HR={class:"sr-only"},KR={key:2,class:"mt-1 flex flex-wrap gap-2"},WR={key:3,"data-fileupload-rows":"",class:"flex flex-col gap-2"},GR=["data-file-item","data-state","onDragover","onDrop"],YR={class:"flex items-center gap-3"},JR=["data-handle","aria-label","onKeydown","onDragstart"],ZR={class:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-pager bg-subtle"},XR=["src","onError"],QR={class:"flex min-w-0 flex-1 flex-col leading-tight"},eq=["title"],tq=["title"],nq=["title"],aq={class:"flex shrink-0 items-center gap-2 text-[13px] text-muted tabular-nums"},rq={key:0},lq={key:1},oq={key:2},sq={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},iq={class:"flex shrink-0 items-center gap-1"},uq=["href","aria-label"],cq=["aria-label","onClick"],dq=["data-caption","aria-label","onClick"],fq=["aria-label","onClick"],pq=["aria-label","onClick"],mq={key:1,"data-file-error":"",class:"text-[13px] text-danger"},vq={class:"sr-only"},hq=["aria-describedby"],yq={class:"flex size-10 items-center justify-center rounded-full bg-surface","aria-hidden":"true"},gq={class:"text-text"},bq={key:0,"data-fileupload-limits":"",class:"text-[13px] text-muted tabular-nums"},_q={key:5,"data-fileupload-limits":"",class:"text-[13px] text-muted tabular-nums"},xq={key:6,role:"alert","data-fileupload-too-many":"",class:"flex items-center gap-1.5 text-[13px] text-danger"},kq=["accept","multiple"],wq={class:"sr-only","aria-live":"polite","data-fileupload-live":""},$q=1<<20,Cq=400,Lc="inline-flex size-8 items-center justify-center rounded-pager border border-border bg-surface text-muted hover:text-text",Sq="inline-flex size-8 items-center justify-center rounded-pager border border-border bg-surface text-muted hover:bg-danger-soft hover:text-danger",yl="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted hover:bg-hover hover:text-text",Eq=ae({__name:"FileuploadField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,n=it(ro,null),a=["jpg","jpeg","png","gif","webp"],r=["image/jpeg","image/png","image/gif","image/webp"];let l=1;const o=M([]),i=M("loading"),u=M(!1),d=M(0),c=M(""),f=M(null),v=M(null),p=M(null),h=M(null),k=M(null),S=M(!1),x=M({}),E=M(new Set),L=M(new Set),D=new Set,A=[],R=n?n.routes(t.field.name):null;let F=null,W=null,C=!1,I=null,z=0,O=!1;const B=_(()=>{const Z=t.field.attributes?.readonly;return!!t.field.readOnly||Z!=null&&Z!==!1}),J=_(()=>t.field.multiple===!0),K=_(()=>t.field.mode==="image"),H=_(()=>J.value?t.field.maxFiles:1),le=_(()=>(n?.recordId??0)!==0),ue=_(()=>o.value.filter(Z=>Z.state!=="failed")),we=_(()=>{if(J.value)return o.value;const Z=ue.value,De=Z[Z.length-1];return o.value.filter(ne=>ne.state==="failed"||ne===De)}),Oe=_(()=>we.value.filter(Z=>Z.state!=="failed").length),Ae=_(()=>B.value||i.value!=="ready"?!1:J.value?H.value===void 0||H.value===null||ue.value.lengthJ.value&&!B.value&&typeof H.value=="number"&&ue.value.length>=H.value),xe=_(()=>t.field.fileTypes?.length?t.field.fileTypes.map(Z=>Z.toLowerCase()):K.value&&!t.field.mimeTypes?.length?a:null),U=_(()=>(t.field.fileTypes?.length?t.field.fileTypes:t.field.mimeTypes??[]).join(", ")),ke=_(()=>{const Z=[];for(const De of t.field.fileTypes??[])Z.push(`.${De.toLowerCase()}`);for(const De of t.field.mimeTypes??[])Z.push(De.includes("/")?De:`.${De.toLowerCase()}`);return Z.length===0&&K.value&&Z.push(...r),Z.length>0?Z.join(","):void 0}),me=_(()=>t.field.prompt||g(J.value?"backend::lang.fileupload.default_prompt_many":"backend::lang.fileupload.default_prompt"));function Y(Z,De){return new Intl.NumberFormat(ua.value,{minimumFractionDigits:De,maximumFractionDigits:De}).format(Z)}function fe(Z){const De=["B","kB","MB","GB"];let ne=Z,Re=0;for(;ne>=1e3&&Re{const Z=t.field.maxFilesize;return typeof Z=="number"?`${new Intl.NumberFormat(ua.value).format(Z)} MB`:""}),X=_(()=>{const Z=[];return U.value!==""&&Z.push(g("backend::lang.fileupload.limits_types",{types:U.value})),G.value!==""&&Z.push(g("backend::lang.fileupload.limits_size",{size:G.value})),J.value&&typeof H.value=="number"&&Z.push(g("backend::lang.fileupload.limits_count",{current:ue.value.length,max:H.value})),Z.join(" · ")});function te(Z){const De=Z.lastIndexOf(".");return De<0?"":Z.slice(De+1).toLowerCase()}function b(Z){const De=t.field.mimeTypes??[];if(De.length===0||Z.type==="")return!0;const ne=Z.type.toLowerCase(),Re=te(Z.name);return De.some(tt=>{const Dt=tt.toLowerCase();return Dt.includes("/")?Dt.endsWith("/*")?ne.startsWith(Dt.slice(0,-1)):ne===Dt:Dt===Re})}function T(Z){const De=xe.value;if(De&&!De.includes(te(Z.name)))return g("backend::lang.fileupload.wrong_type",{name:Z.name,types:De.join(", ")});if(!b(Z))return g("backend::lang.fileupload.wrong_type",{name:Z.name,types:U.value});const ne=t.field.maxFilesize;return typeof ne=="number"&&Z.size>Math.ceil(ne*$q)?g("backend::lang.fileupload.too_large",{name:Z.name,size:G.value}):""}function P(Z){return Ln({uid:l++,name:Z.file_name,size:Z.file_size,state:"done",progress:100,error:"",retryable:!1,file:Z,source:null,handle:null,uploadId:""})}function re(){return globalThis.crypto?.randomUUID?.()??`u${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}function ee(Z,De){return Ln({uid:l++,name:Z.name,size:Z.size,state:De===""?"queued":"failed",progress:0,error:De,retryable:!1,file:null,source:pi(Z),handle:null,uploadId:re()})}function ce(Z){return o.value.find(De=>De.uid===Z)}async function Ee(Z){if(!R){i.value="failed";return}Z&&(i.value="loading");const De=await R.list();if(O)return;if(!De.data){Z&&(i.value="failed");return}const ne=o.value.filter(Re=>Re.state!=="done");for(const Re of o.value)Re.state==="done"&&rl(Re.uid);o.value=[...De.data.map(P),...ne],i.value="ready"}function Ce(){B.value||f.value?.click()}function Te(Z){if(Z.length===0||B.value)return;if(d.value=0,!J.value)for(const tt of[...o.value])tt.state!=="failed"&&(tt.state!=="done"||tt.file?.pending)&&ot(tt);let De=J.value?typeof H.value=="number"?Math.max(H.value-ue.value.length,0):Number.POSITIVE_INFINITY:1,ne=0;const Re=[];for(const tt of Z.slice(0,J.value?Z.length:1)){const Dt=T(tt);if(Dt===""&&De<=0){ne++;continue}Dt===""&&De--,Re.push(ee(tt,Dt))}o.value=[...o.value,...Re],d.value=ne,Be()}function oe(Z){const De=Z.target;Te(Array.from(De.files??[])),De.value=""}function $e(Z){return p.value===null&&Array.from(Z.dataTransfer?.types??[]).includes("Files")}function ye(Z){$e(Z)&&(Z.preventDefault(),u.value=!0)}function qe(Z){$e(Z)&&(Z.preventDefault(),u.value=!1,Te(Array.from(Z.dataTransfer?.files??[])))}function Be(){if(!R||o.value.some(De=>De.state==="uploading"))return;const Z=o.value.find(De=>De.state==="queued");Z&&He(Z)}async function He(Z){if(!R||!Z.source)return;Z.state="uploading",Z.progress=0,Z.error="",Z.retryable=!1;const De=new Set(o.value.filter(Re=>Re.file).map(Re=>Re.file.id)),ne=n?.beginUpload();try{const Re=R.upload(Z.source,(Wn,za)=>{Z.progress=za>0?Math.min(100,Math.round(Wn/za*100)):0},Z.uploadId||void 0);Z.handle=pi(Re);const tt=await Re.promise;Z.handle=null;const Dt=!!ce(Z.uid);if(tt.ok)!Dt||O?R.remove(tt.item.id):(Z.state="done",Z.progress=100,Z.file=tt.item,Z.name=tt.item.file_name,Z.size=tt.item.file_size,n?.markDirty());else if(tt.reason==="aborted"||tt.reason==="network"){const Wn=await Ze(De);if(tt.reason==="aborted"){for(const za of Wn)R.remove(za.id);o.value=o.value.filter(za=>za.uid!==Z.uid),rl(Z.uid)}else Dt&&Wn[0]&&Wn.length===1?(Z.state="done",Z.progress=100,Z.file=Wn[0],Z.name=Wn[0].file_name,Z.size=Wn[0].file_size,n?.markDirty()):(Z.state="failed",Z.error=g("backend::lang.fileupload.upload_failed"),Z.retryable=!0)}else if(Dt)switch(Z.state="failed",tt.reason){case"too_large":Z.error=G.value?g("backend::lang.fileupload.too_large",{name:Z.name,size:G.value}):tt.message||g("backend::lang.fileupload.upload_failed");break;case"invalid":Z.error=tt.message||g("backend::lang.fileupload.upload_failed");break;default:Z.error=tt.message||g("backend::lang.fileupload.upload_failed"),Z.retryable=tt.status>=500}}finally{ne?.(),O||Be()}}async function Ze(Z){if(!R)return[];const De=await R.list();return De.data?De.data.filter(ne=>ne.pending&&!Z.has(ne.id)):[]}function Xe(Z){Z.state!=="failed"||!Z.source||(Z.state="queued",Z.error="",Z.retryable=!1,Be())}async function ot(Z){const De=o.value.findIndex(Re=>Re.uid===Z.uid);if(De<0)return;switch(o.value=o.value.filter(Re=>Re.uid!==Z.uid),rl(Z.uid),Z.state){case"uploading":Z.handle?.abort(),n?.markDirty(),Be();return;case"queued":case"failed":return}if(!R||!Z.file)return;n?.markDirty();const ne=await R.remove(Z.file.id);if(!ne.data&&!O){const Re=[...o.value];Re.splice(Math.min(De,Re.length),0,Z),o.value=Re,Le(ne.error?.message||g("backend::lang.form.error_generic"),"danger")}}function at(){return o.value.map(Z=>Z.uid)}function Et(Z){const De=new Map(o.value.map(tt=>[tt.uid,tt])),ne=Z.map(tt=>De.get(tt)).filter(tt=>!!tt),Re=o.value.filter(tt=>!Z.includes(tt.uid));o.value=[...ne,...Re]}function Tt(){F!==null&&clearTimeout(F),F=setTimeout(()=>{F=null,Fe()},Cq)}function qt(){return o.value.filter(Z=>Z.state==="done"&&Z.file).map(Z=>Z.file.id)}async function Fe(){if(!R)return;const Z=qt();if(C){I=Z;return}const De=W;W=null;const ne=++z;C=!0;try{const Re=await R.reorder(Z);if(I)return;!Re.data&&!O&&ne===z&&(De&&Et(De),Le(g("backend::lang.fileupload.reorder_failed"),"danger"))}finally{C=!1,I&&(I=null,Fe())}}function de(Z,De){const ne=o.value.findIndex(Dt=>Dt.uid===Z);if(ne<0||De<0||De>=o.value.length||De===ne)return!1;W===null&&(W=at());const Re=[...o.value],[tt]=Re.splice(ne,1);return Re.splice(De,0,tt),o.value=Re,c.value=g("backend::lang.fileupload.moved",{name:tt.name,position:De+1,total:Re.length}),Tt(),!0}async function be(Z,De){const ne=o.value.findIndex(tt=>tt.uid===De.uid);let Re;switch(Z.key){case"ArrowUp":case"ArrowLeft":Re=ne-1;break;case"ArrowDown":case"ArrowRight":Re=ne+1;break;default:return}Z.preventDefault(),de(De.uid,Re)&&(await Je(),v.value?.querySelector(`[data-handle="${De.uid}"]`)?.focus())}function je(Z,De){p.value=De.uid,Z.dataTransfer&&(Z.dataTransfer.effectAllowed="move",Z.dataTransfer.setData("text/plain",De.name))}function rt(Z,De){p.value!==null&&(Z.preventDefault(),h.value=De.uid)}function jt(Z,De){p.value!==null&&(Z.preventDefault(),de(p.value,o.value.findIndex(ne=>ne.uid===De.uid)),Lt())}function Lt(){p.value=null,h.value=null}function Pn(Z){const De=Z.file?.content_type??Z.source?.type??"";return r.includes(De.toLowerCase())}function Gt(Z){return!Z.file||!Pn(Z)||E.value.has(Z.uid)?null:!t.field.protected&&!L.value.has(Z.uid)?Z.file.thumb_url||Z.file.url||null:x.value[Z.uid]??null}function so(){return typeof URL.revokeObjectURL=="function"}function rl(Z){const De=x.value[Z];if(De!==void 0){so()&&URL.revokeObjectURL(De);const ne={...x.value};delete ne[Z],x.value=ne}if(D.delete(Z),L.value.has(Z)){const ne=new Set(L.value);ne.delete(Z),L.value=ne}}async function io(Z){if(!R||!Z.file||D.has(Z.uid)||typeof URL.createObjectURL!="function")return;D.add(Z.uid);const De=await R.thumb(Z.file.id);if(!(O||!ce(Z.uid)||!D.has(Z.uid))){if(!De){E.value=new Set([...E.value,Z.uid]);return}x.value={...x.value,[Z.uid]:URL.createObjectURL(De)}}}Ve(()=>o.value.map(Z=>`${Z.uid}:${Z.state}`).join(","),()=>{if(t.field.protected)for(const Z of o.value)Z.state==="done"&&Pn(Z)&&io(Z)});function ll(Z){if(!t.field.protected&&!L.value.has(Z.uid)&&(L.value=new Set([...L.value,Z.uid]),R&&typeof URL.createObjectURL=="function")){io(Z);return}E.value=new Set([...E.value,Z.uid])}async function uo(Z,De){if(!R||!Z.file||typeof URL.createObjectURL!="function")return;const ne=await R.download(Z.file.id);if(!ne){Le(g("backend::lang.form.error_generic"),"danger");return}const Re=URL.createObjectURL(ne);A.push(Re);const tt=document.createElement("a");tt.href=Re,tt.rel="noopener",De?tt.download=Z.file.file_name:tt.target="_blank",tt.click()}function wn(Z){return t.field.useCaption&&Z.file?.title?Z.file.title:Z.name}function Va(Z){return le.value&&!!Z.file?.pending}const en=_(()=>k.value===null?void 0:ce(k.value));function Kn(Z){k.value=Z.uid,S.value=!0}function co(Z){const De=en.value;De&&(De.file=Z)}function fo(){const Z=k.value;k.value=null,Z!==null&&v.value?.querySelector(`[data-caption="${Z}"]`)?.focus()}const po=_(()=>{const Z=t.field.thumbOptions?.mode;return Z==="fit"||Z==="auto"?"object-contain":"object-cover"});return wt(()=>{Ee(!0)}),n&&Ve(n.revision,()=>{Ee(!1)}),St(()=>{O=!0,F!==null&&(clearTimeout(F),F=null);for(const Z of o.value)Z.handle?.abort();if(so()){for(const Z of Object.values(x.value))URL.revokeObjectURL(Z);for(const Z of A)URL.revokeObjectURL(Z)}}),(Z,De)=>(m(),y("div",{id:e.controlId,ref_key:"root",ref:v,role:"group","data-fileupload":"","data-field-name":e.field.name,"aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":i.value==="loading"?"true":void 0,class:"flex min-w-0 flex-col gap-4"},[i.value==="loading"?(m(),y("span",iR)):i.value==="failed"?(m(),y("p",uR,$(s(g)("backend::lang.fileupload.load_failed")),1)):(m(),y(pe,{key:2},[B.value&&we.value.length===0?(m(),y("p",cR,$(s(g)("backend::lang.fileupload.empty")),1)):K.value&&J.value&&we.value.length>0?(m(),y("ul",dR,[(m(!0),y(pe,null,Ie(we.value,ne=>(m(),y("li",{key:ne.uid,"data-file-item":ne.uid,"data-state":ne.state,class:ve([[ne.state==="failed"?"border-danger":"border-border",p.value===ne.uid?"opacity-50":"",h.value===ne.uid&&p.value!==ne.uid?"border-2 border-dashed border-primary bg-sel":""],"relative overflow-hidden rounded-inner border bg-surface"]),onDragover:Re=>rt(Re,ne),onDrop:Re=>jt(Re,ne)},[w("div",pR,[ne.state==="uploading"?(m(),j(s(Il),{key:0,size:20,class:"animate-spin text-muted","aria-hidden":"true"})):ne.state==="failed"?(m(),j(s(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):ne.state==="done"?(m(),y(pe,{key:2},[Gt(ne)&&!e.field.protected&&ne.file?.url?(m(),y("a",{key:0,href:ne.file.url,target:"_blank",rel:"noopener",class:"block size-full","aria-label":s(g)("backend::lang.fileupload.open_preview",{name:ne.name})},[w("img",{src:Gt(ne)??void 0,alt:wn(ne),class:ve([po.value,"size-full"]),onError:Re=>ll(ne)},null,42,vR)],8,mR)):Gt(ne)?(m(),y("button",{key:1,type:"button",class:"block size-full","aria-label":s(g)("backend::lang.fileupload.open_preview",{name:ne.name}),onClick:Re=>uo(ne,!1)},[w("img",{src:Gt(ne)??void 0,alt:wn(ne),class:ve([po.value,"size-full"])},null,10,yR)],8,hR)):E.value.has(ne.uid)?(m(),y("span",gR,[N(s(Km),{size:20,"aria-hidden":"true"}),_e(" "+$(s(g)("backend::lang.fileupload.preview_unavailable")),1)])):(m(),j(s(El),{key:3,size:20,class:"text-muted","aria-hidden":"true"}))],64)):(m(),j(s(El),{key:3,size:20,class:"text-muted","aria-hidden":"true"})),!B.value&&ne.state==="done"?(m(),y("button",{key:4,type:"button",draggable:"true","data-handle":ne.uid,"aria-label":s(g)("backend::lang.fileupload.move",{name:ne.name}),class:ve([Lc,"absolute top-2 left-2 cursor-grab"]),onKeydown:Re=>be(Re,ne),onDragstart:Re=>je(Re,ne),onDragend:Lt},[N(s(Ti),{size:16,"aria-hidden":"true"})],40,bR)):Q("",!0),B.value?Q("",!0):(m(),y("div",_R,[e.field.useCaption&&ne.state==="done"?(m(),y("button",{key:0,type:"button","data-caption":ne.uid,"aria-label":s(g)("backend::lang.fileupload.edit_details",{name:ne.name}),class:ve(Lc),onClick:Re=>Kn(ne)},[N(s(Uo),{size:16,"aria-hidden":"true"})],8,xR)):Q("",!0),ne.state==="failed"&&ne.retryable?(m(),y("button",{key:1,type:"button","data-action":"retry","aria-label":s(g)("backend::lang.fileupload.retry"),class:ve(Lc),onClick:Re=>Xe(ne)},[N(s(li),{size:16,"aria-hidden":"true"})],8,kR)):Q("",!0),w("button",{type:"button","data-action":"remove-file","aria-label":ne.state==="uploading"||ne.state==="queued"?s(g)("backend::lang.fileupload.cancel_upload",{name:ne.name}):s(g)("backend::lang.form.remove_item",{name:ne.name}),class:ve(Sq),onClick:Re=>ot(ne)},[N(s(Qt),{size:16,"aria-hidden":"true"})],8,wR)]))]),w("div",$R,[w("span",{class:"truncate text-[13px]",title:wn(ne)},$(wn(ne)),9,CR),w("span",SR,[ne.state==="queued"?(m(),y("span",ER,$(s(g)("backend::lang.fileupload.queued")),1)):ne.state==="uploading"?(m(),y("span",AR,$(s(g)("backend::lang.fileupload.uploading",{percent:ne.progress})),1)):(m(),y("span",TR,$(fe(ne.size)),1)),Va(ne)?(m(),y("span",DR,$(s(g)("backend::lang.fileupload.unsaved")),1)):Q("",!0)]),ne.state==="uploading"?(m(),j(s(Ac),{key:0,"model-value":ne.progress,max:100,"aria-label":s(g)("backend::lang.fileupload.uploading",{percent:ne.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:q(()=>[N(s(Tc),{class:"h-full bg-primary",style:bn({width:`${ne.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Q("",!0),ne.state==="failed"?(m(),y("p",OR,[w("span",MR,$(s(g)("backend::lang.fileupload.upload_error"))+": ",1),_e($(ne.error),1)])):Q("",!0)])],42,fR))),128))])):K.value&&!J.value&&we.value.length>0?(m(),y("div",PR,[(m(!0),y(pe,null,Ie(we.value,ne=>(m(),y("div",{key:ne.uid,"data-file-item":ne.uid,"data-state":ne.state,class:"flex items-start gap-4"},[w("div",{class:ve([ne.state==="failed"?"border-danger":"border-border","flex size-40 shrink-0 items-center justify-center overflow-hidden rounded-inner border bg-subtle"])},[ne.state==="uploading"?(m(),j(s(Il),{key:0,size:20,class:"animate-spin text-muted","aria-hidden":"true"})):ne.state==="failed"?(m(),j(s(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):Gt(ne)?(m(),y("img",{key:2,src:Gt(ne)??void 0,alt:wn(ne),class:ve([po.value,"size-full"]),onError:Re=>ll(ne)},null,42,RR)):E.value.has(ne.uid)?(m(),y("span",qR,[N(s(Km),{size:20,"aria-hidden":"true"}),_e(" "+$(s(g)("backend::lang.fileupload.preview_unavailable")),1)])):(m(),j(s(El),{key:4,size:20,class:"text-muted","aria-hidden":"true"}))],2),w("div",LR,[w("span",{class:"truncate font-semibold",title:wn(ne)},$(wn(ne)),9,NR),w("span",BR,[ne.state==="queued"?(m(),y("span",FR,$(s(g)("backend::lang.fileupload.queued")),1)):ne.state==="uploading"?(m(),y("span",VR,$(s(g)("backend::lang.fileupload.uploading",{percent:ne.progress})),1)):(m(),y("span",zR,$(fe(ne.size)),1)),Va(ne)?(m(),y("span",jR,$(s(g)("backend::lang.fileupload.unsaved")),1)):Q("",!0)]),ne.state==="uploading"?(m(),j(s(Ac),{key:0,"model-value":ne.progress,max:100,"aria-label":s(g)("backend::lang.fileupload.uploading",{percent:ne.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:q(()=>[N(s(Tc),{class:"h-full bg-primary",style:bn({width:`${ne.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Q("",!0),ne.state==="failed"?(m(),y("p",UR,[w("span",HR,$(s(g)("backend::lang.fileupload.upload_error"))+": ",1),_e($(ne.error),1)])):Q("",!0),B.value?Q("",!0):(m(),y("div",KR,[ne.state!=="failed"?(m(),j(Ke,{key:0,size:"sm",variant:"outline","data-action":"replace-file",icon:s(oi),onClick:Ce},{default:q(()=>[_e($(s(g)("backend::lang.fileupload.replace_file")),1)]),_:1},8,["icon"])):Q("",!0),ne.state==="failed"&&ne.retryable?(m(),j(Ke,{key:1,size:"sm",variant:"outline","data-action":"retry",icon:s(li),onClick:Re=>Xe(ne)},{default:q(()=>[_e($(s(g)("backend::lang.fileupload.retry")),1)]),_:1},8,["icon","onClick"])):Q("",!0),e.field.useCaption&&ne.state==="done"?(m(),j(Ke,{key:2,size:"sm",variant:"outline","data-caption":ne.uid,icon:s(Uo),onClick:Re=>Kn(ne)},{default:q(()=>[_e($(s(g)("backend::lang.fileupload.details_submit")),1)]),_:1},8,["data-caption","icon","onClick"])):Q("",!0),N(Ke,{size:"sm",variant:"danger","data-action":"remove-file",icon:s(Qt),onClick:Re=>ot(ne)},{default:q(()=>[_e($(s(g)("backend::lang.fileupload.remove_file")),1)]),_:1},8,["icon","onClick"])]))])],8,IR))),128))])):we.value.length>0?(m(),y("ul",WR,[(m(!0),y(pe,null,Ie(we.value,ne=>(m(),y("li",{key:ne.uid,"data-file-item":ne.uid,"data-state":ne.state,class:ve([[ne.state==="failed"?"border-danger":"border-border",p.value===ne.uid?"opacity-50":"",h.value===ne.uid&&p.value!==ne.uid?"border-2 border-dashed border-primary bg-sel":""],"flex min-h-14 flex-col justify-center gap-1 rounded-inner border bg-surface px-3 py-2"]),onDragover:Re=>rt(Re,ne),onDrop:Re=>jt(Re,ne)},[w("div",YR,[J.value&&!B.value&&ne.state==="done"?(m(),y("button",{key:0,type:"button",draggable:"true","data-handle":ne.uid,"aria-label":s(g)("backend::lang.fileupload.move",{name:ne.name}),class:ve([yl,"cursor-grab"]),onKeydown:Re=>be(Re,ne),onDragstart:Re=>je(Re,ne),onDragend:Lt},[N(s(Ti),{size:16,"aria-hidden":"true"})],40,JR)):Q("",!0),w("span",ZR,[ne.state==="uploading"?(m(),j(s(Il),{key:0,size:16,class:"animate-spin text-muted","aria-hidden":"true"})):ne.state==="failed"?(m(),j(s(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):Gt(ne)?(m(),y("img",{key:2,src:Gt(ne)??void 0,alt:"",class:"size-8 object-cover",onError:Re=>ll(ne)},null,40,XR)):(m(),j(s(El),{key:3,size:16,class:"text-muted","aria-hidden":"true"}))]),w("span",QR,[e.field.useCaption&&ne.file?.title?(m(),y(pe,{key:0},[w("span",{class:"truncate font-semibold",title:ne.file.title},$(ne.file.title),9,eq),w("span",{class:"truncate text-[13px] text-muted",title:ne.name},$(ne.name),9,tq)],64)):(m(),y("span",{key:1,class:"truncate",title:ne.name},$(ne.name),9,nq))]),w("span",aq,[ne.state==="queued"?(m(),y("span",rq,$(s(g)("backend::lang.fileupload.queued")),1)):ne.state==="uploading"?(m(),y("span",lq,$(s(g)("backend::lang.fileupload.uploading",{percent:ne.progress})),1)):(m(),y("span",oq,$(fe(ne.size)),1)),Va(ne)?(m(),y("span",sq,$(s(g)("backend::lang.fileupload.unsaved")),1)):Q("",!0)]),!J.value&&!B.value&&ne.state!=="failed"?(m(),j(Ke,{key:1,size:"sm",variant:"outline","data-action":"replace-file",icon:s(oi),onClick:Ce},{default:q(()=>[_e($(s(g)("backend::lang.fileupload.replace_file")),1)]),_:1},8,["icon"])):Q("",!0),w("span",iq,[ne.state==="done"&&ne.file?(m(),y(pe,{key:0},[!e.field.protected&&ne.file.url?(m(),y("a",{key:0,href:ne.file.url,download:"",target:"_blank",rel:"noopener","aria-label":s(g)("backend::lang.fileupload.download",{name:ne.name}),class:ve(yl)},[N(s(md),{size:16,"aria-hidden":"true"})],8,uq)):e.field.protected?(m(),y("button",{key:1,type:"button","data-action":"download","aria-label":s(g)("backend::lang.fileupload.download",{name:ne.name}),class:ve(yl),onClick:Re=>uo(ne,!0)},[N(s(md),{size:16,"aria-hidden":"true"})],8,cq)):Q("",!0),e.field.useCaption&&!B.value?(m(),y("button",{key:2,type:"button","data-caption":ne.uid,"aria-label":s(g)("backend::lang.fileupload.edit_details",{name:ne.name}),class:ve(yl),onClick:Re=>Kn(ne)},[N(s(Uo),{size:16,"aria-hidden":"true"})],8,dq)):Q("",!0)],64)):Q("",!0),ne.state==="failed"&&ne.retryable?(m(),y("button",{key:1,type:"button","data-action":"retry","aria-label":s(g)("backend::lang.fileupload.retry"),class:ve(yl),onClick:Re=>Xe(ne)},[N(s(li),{size:16,"aria-hidden":"true"})],8,fq)):Q("",!0),B.value?Q("",!0):(m(),y("button",{key:2,type:"button","data-action":"remove-file","aria-label":ne.state==="uploading"||ne.state==="queued"?s(g)("backend::lang.fileupload.cancel_upload",{name:ne.name}):s(g)("backend::lang.form.remove_item",{name:ne.name}),class:ve([yl,"hover:bg-danger-soft hover:text-danger"]),onClick:Re=>ot(ne)},[N(s(Qt),{size:16,"aria-hidden":"true"})],8,pq))])]),ne.state==="uploading"?(m(),j(s(Ac),{key:0,"model-value":ne.progress,max:100,"aria-label":s(g)("backend::lang.fileupload.uploading",{percent:ne.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:q(()=>[N(s(Tc),{class:"h-full bg-primary",style:bn({width:`${ne.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Q("",!0),ne.state==="failed"?(m(),y("p",mq,[w("span",vq,$(s(g)("backend::lang.fileupload.upload_error"))+": ",1),_e($(ne.error),1)])):Q("",!0)],42,GR))),128))])):Q("",!0),Ae.value?(m(),y("button",{key:4,type:"button","data-fileupload-dropzone":"","aria-describedby":e.describedBy||void 0,class:ve([[u.value?"border-solid border-primary bg-sel":e.invalid?"border-dashed border-danger bg-subtle":"border-dashed border-border-strong bg-subtle"],"flex min-h-[112px] w-full flex-col items-center justify-center gap-2 rounded-control border-[1.5px] px-4 py-6 text-center transition-colors duration-150 ease-out hover:bg-hover"]),onClick:Ce,onDragover:ye,onDragleave:De[0]||(De[0]=ne=>u.value=!1),onDrop:qe},[w("span",yq,[N(s(oi),{size:20,class:"text-muted"})]),w("span",gq,$(me.value),1),X.value!==""?(m(),y("span",bq,$(X.value),1)):Q("",!0)],42,hq)):ie.value&&X.value!==""?(m(),y("p",_q,$(X.value),1)):Q("",!0),d.value>0?(m(),y("p",xq,[N(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(s(zr)("backend::lang.fileupload.too_many",d.value,{max:H.value??0})),1)])):Q("",!0)],64)),w("input",{ref_key:"input",ref:f,type:"file",hidden:"",tabindex:"-1","data-fileupload-input":"",accept:ke.value,multiple:J.value||void 0,onChange:oe},null,40,kq),w("p",wq,$(c.value),1),e.field.useCaption?(m(),j(oR,{key:3,open:S.value,"onUpdate:open":De[1]||(De[1]=ne=>S.value=ne),file:en.value?.file??null,routes:s(R),preview:en.value?Gt(en.value):null,"id-prefix":e.controlId,onSaved:co,onClosed:fo},null,8,["open","file","routes","preview","id-prefix"])):Q("",!0)],8,sR))}}),Aq=["id","name","value","required","aria-required","aria-invalid","aria-describedby"],Tq=ae({__name:"NumberField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=_(()=>n.modelValue===null||n.modelValue===void 0?"":String(n.modelValue)),l=_(()=>Sr(n.field));function o(i){const u=i.target.value.trim();if(u===""){a("update:modelValue",null);return}const d=Number(u);a("update:modelValue",Number.isFinite(d)?d:null)}return(i,u)=>(m(),y("input",ze({id:e.controlId},l.value,{name:e.field.name,type:"number",inputmode:"decimal",value:r.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(Ft)(e.invalid),"h-input tabular-nums"],onInput:o}),null,16,Aq))}}),Dq=["id","aria-labelledby","aria-describedby"],Oq=ae({__name:"PartialField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e;return(n,a)=>(m(),y("div",{id:e.controlId,role:"group","data-partial-field":"","aria-labelledby":t.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0},[e.source?(m(),j(up,{key:0,variant:"field",source:e.source,name:t.field.path||t.field.name,"record-id":e.recordId??null},null,8,["source","name","record-id"])):(m(),j(Iu,{key:1,"data-partial-failed":"",text:s(g)("backend::lang.extension.partial_failed")},null,8,["text"]))],8,Dq))}}),Mq={class:"flex min-w-0 flex-col gap-1.5"},Pq={class:"relative"},Iq=["id","name","type","value","placeholder","disabled","required","aria-required","aria-invalid","aria-describedby"],Rq=["aria-pressed","aria-label","disabled"],qq=["id","data-secret-state","role"],Lq={key:3},Nq=ae({__name:"PasswordField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=M(!1),l=_(()=>typeof n.modelValue=="string"?n.modelValue:""),o=_(()=>Sr(n.field)),i=it(ro,null);i&&Ve(i.revision,()=>{r.value=!1});const u=it(_0,null),d=_(()=>u?.value[n.field.name]??""),c=_(()=>d.value!==""),f=_(()=>d.value==="stored"&&n.modelValue===null),v=_(()=>`${n.controlId}-secret`),p=_(()=>[n.describedBy??"",c.value?v.value:""].filter(Boolean).join(" ")),h=_(()=>{if(d.value==="stored"&&!f.value)return g("backend::lang.secret.placeholder_stored");const x=o.value.placeholder;return typeof x=="string"?x:void 0});function k(){r.value=!1,a("update:modelValue",null)}function S(){a("update:modelValue","")}return(x,E)=>(m(),y("div",Mq,[w("div",Pq,[w("input",ze({id:e.controlId,autocomplete:"new-password",spellcheck:"false"},o.value,{name:e.field.name,type:r.value?"text":"password",value:f.value?"":l.value,placeholder:h.value,disabled:f.value||void 0,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":p.value||void 0,class:[s(Ft)(e.invalid),"h-input pr-12"],onInput:E[0]||(E[0]=L=>a("update:modelValue",L.target.value))}),null,16,Iq),w("button",{type:"button","data-password-toggle":"","aria-pressed":r.value?"true":"false","aria-label":s(g)(r.value?"backend::lang.form.hide_password":"backend::lang.form.show_password"),disabled:f.value||void 0,class:"absolute top-1/2 right-1.5 flex size-8 -translate-y-1/2 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:opacity-60",onClick:E[1]||(E[1]=L=>r.value=!r.value)},[(m(),j(zt(r.value?s(D$):s(M$)),{size:16,"aria-hidden":"true"}))],8,Rq)]),c.value?(m(),y("p",{key:0,id:v.value,"data-secret-state":f.value?"clearing":d.value,role:f.value?"status":void 0,class:ve([f.value?"text-danger":"text-muted","flex flex-wrap items-center gap-2 text-[13px]"])},[f.value?(m(),y(pe,{key:0},[N(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(s(g)("backend::lang.secret.clear_pending")),1),N(Ke,{variant:"ghost",size:"sm",icon:s(Qg),"data-action":"secret-undo",onClick:S},{default:q(()=>[_e($(s(g)("backend::lang.secret.undo")),1)]),_:1},8,["icon"])],64)):d.value==="stored"?(m(),y(pe,{key:1},[N(s(tr),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(s(g)("backend::lang.secret.stored")),1),N(Ke,{variant:"ghost",size:"sm",icon:s(xr),"data-action":"secret-clear",onClick:k},{default:q(()=>[_e($(s(g)("backend::lang.secret.clear")),1)]),_:1},8,["icon"])],64)):d.value==="env"?(m(),y(pe,{key:2},[N(s(Xl),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(s(g)("backend::lang.secret.env")),1)],64)):(m(),y("span",Lq,$(s(g)("backend::lang.secret.empty")),1))],10,qq)):Q("",!0)]))}}),Bq=["aria-labelledby","data-ml-field"],Fq={class:"flex flex-wrap items-center gap-2"},Vq=["value","aria-label"],zq=["value"],qu=ae({__name:"MLField",props:{inner:{},innerType:{},mlType:{},contentLocale:{type:Boolean},field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=_(()=>la(n.modelValue)),l=it(Ui,null),o=_(()=>{const x=l?.value;return x&&x.length>0?[...x]:[]}),i=M(o.value[0]??"en"),u=_(()=>`${n.controlId}-label`),d=_(()=>`${n.controlId}-editor`),c=_(()=>r.value[i.value]??""),f=_(()=>({...n.field,type:n.innerType})),v=_(()=>n.contentLocale?{contentLocale:i.value}:{});function p(x){x&&(i.value=x)}function h(x){const E=x.target.value;p(E),lI(E)}function k(x){a("update:modelValue",{...r.value,[i.value]:x})}function S(x){const E=x.detail;typeof E=="string"&&E!==""&&p(E)}return wt(()=>{window.addEventListener(fs,S)}),La(()=>{window.removeEventListener(fs,S)}),(x,E)=>(m(),y("div",{class:"flex flex-col gap-1.5",role:"group","aria-labelledby":u.value,"data-ml-field":e.mlType},[w("div",Fq,[w("select",{"data-ml-locale":"",class:"rounded-control border border-border-strong bg-surface px-2 py-1 text-[13px]",value:i.value,"aria-label":`Locale for ${e.field.label||e.field.name}`,onChange:h},[(m(!0),y(pe,null,Ie(o.value,L=>(m(),y("option",{key:L,value:L},$(L),9,zq))),128))],40,Vq)]),(m(),j(zt(e.inner),ze({field:f.value,"model-value":c.value,"control-id":d.value,invalid:e.invalid,"described-by":e.describedBy,source:e.source,"record-id":e.recordId},v.value,{"onUpdate:modelValue":k}),null,16,["field","model-value","control-id","invalid","described-by","source","record-id"]))],8,Bq))}}),jq=["id","aria-labelledby","aria-describedby","aria-busy"],Uq={key:0,"data-plugin-field-skeleton":"",class:"h-[42px] w-full rounded-control bg-skel","aria-hidden":"true"},w0=ae({__name:"PluginField",props:{contentLocale:{},field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=it(pp,null),l=M("loading"),o=M(null);let i=null,u=!1;const d=_(()=>r?.value||ua.value),c=_(()=>JSON.stringify(n.field.typeOptions??{})),f=_(()=>n.field.readOnly===!0);function v(A,R){if(Object.is(A,R))return!0;if(A===null||R===null||typeof A!="object"||typeof R!="object")return!1;try{return JSON.stringify(A)===JSON.stringify(R)}catch{return!1}}function p(A,R){v(A.value,R)||(A.value=R)}function h(A,R,F){F?A.setAttribute(R,""):A.removeAttribute(R)}function k(A){A.setAttribute("field-name",n.field.name),A.setAttribute("record-id",n.recordId==null?"":String(n.recordId)),A.setAttribute("locale",n.contentLocale??""),A.setAttribute("ui-locale",d.value),A.setAttribute("options",c.value),h(A,"disabled",f.value),h(A,"invalid",n.invalid===!0)}function S(A){let R;return{promise:new Promise((W,C)=>{R=setTimeout(()=>C(new Error("field type element was not defined in time")),A)}),cancel:()=>clearTimeout(R)}}async function x(A){const R=await B8(A);if(customElements.get(A))return;if(R.length>0)throw new Error(`plugin script failed: ${R.join(", ")}`);const F=S(x0);try{await Promise.race([customElements.whenDefined(A),F.promise])}finally{F.cancel()}}async function E(A){const R=i,F=A.detail;if(!R||F===null||typeof F!="object")return;const{id:W,file:C}=F,I=J=>{!u&&i===R&&R.dispatchEvent(new CustomEvent(PI,{detail:{id:W,...J}}))},z=()=>g("backend::lang.fileupload.upload_failed"),O=n.source;if(!(C instanceof Blob)||!O){I({error:z()});return}const B=C instanceof File&&C.name!==""?C.name:"upload";try{const J=await Ne.POST("/{vendor}/{plugin}/{controller}/{id}/fields/{field}/upload",{params:{path:{...O,id:n.recordId??0,field:n.field.name}},body:{file:""},bodySerializer:()=>{const H=new FormData;return H.append("file",C,B),H}});if(J.data){I({url:J.data.data.url});return}const K=J.response.status===422?cp(J.error?.error):"";I({error:K||z()})}catch{I({error:z()})}}function L(A){E(A)}function D(A){const R=A.detail;R!==null&&typeof R=="object"&&Object.hasOwn(R,"value")&&a("update:modelValue",R.value)}return wt(async()=>{const A=n.field.element??"";try{if(A==="")throw new Error("plugin field without an element");if(await x(A),u||!o.value)return;const R=document.createElement(A);k(R),p(R,n.modelValue),R.addEventListener(ih,D),R.addEventListener(uh,L),o.value.append(R),i=R,l.value="ready"}catch{u||(l.value="failed")}}),Ve(()=>[n.recordId,n.invalid,n.contentLocale,f.value,d.value,c.value],()=>{i&&k(i)}),Ve(()=>n.modelValue,A=>{i&&p(i,A)},{deep:!0}),St(()=>{u=!0,i?.removeEventListener(ih,D),i?.removeEventListener(uh,L),i=null}),(A,R)=>l.value==="failed"?(m(),j(Iu,{key:0,id:e.controlId,"data-plugin-field-failed":"","aria-describedby":e.describedBy||void 0,text:s(g)("backend::lang.extension.widget_failed")},null,8,["id","aria-describedby","text"])):(m(),y("div",{key:1,id:e.controlId,role:"group","data-plugin-field":"","aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":l.value==="loading"?"true":void 0,class:"flex min-h-input min-w-0 flex-col"},[l.value==="loading"?(m(),y("span",Uq)):Q("",!0),w("div",{ref_key:"mountPoint",ref:o,class:"contents"},null,512)],8,jq))}}),Hq=ae({__name:"MLPluginField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t;return(r,l)=>(m(),j(qu,ze(n,{inner:w0,"inner-type":e.field.type,"ml-type":e.field.type,"content-locale":"","onUpdate:modelValue":l[0]||(l[0]=o=>a("update:modelValue",o))}),null,16,["inner-type","ml-type"]))}}),Kq=["id"],Wq=["id","aria-labelledby","aria-label","aria-describedby","data-mode"],Gq=["aria-labelledby"],Yq=["id"],Jq={class:"min-w-0 [overflow-wrap:anywhere]"},Zq={key:0,class:"shrink-0 text-[12px] font-semibold text-muted","aria-hidden":"true"},Xq=["data-permission","data-locked","data-locked-by"],Qq={class:"flex min-w-0 flex-col"},eL=["id"],tL=["id"],nL=ae({__name:"PermissionEditorField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=it(vp,null),l=_(()=>{const D=new Map;for(const A of r?.value[n.field.name]??[])D.set(A.code,A);return D}),o=_(()=>n.field.permissionOptions??[]),i=_(()=>n.field.mode==="radio"),u=_(()=>!!n.field.readOnly||!!Sr(n.field).readonly),d=_(()=>g0(n.field,n.modelValue)),c=_(()=>{const D=[],A=[];for(const R of o.value){if(!R.tab){A.push(R);continue}let F=D.find(W=>W.label===R.tab);F||(F={key:`tab:${R.tab}`,label:R.tab,options:[]},D.push(F)),F.options.push(R)}return A.length>0&&D.push({key:"other",label:g("backend::lang.permissioneditor.other"),options:A}),D}),f=[{value:"1",label:"backend::lang.permissioneditor.allow",checked:"data-[state=checked]:bg-ok-bg data-[state=checked]:text-ok-text"},{value:"0",label:"backend::lang.permissioneditor.inherit",checked:"data-[state=checked]:bg-surface data-[state=checked]:text-text data-[state=checked]:shadow-tab"},{value:"-1",label:"backend::lang.permissioneditor.deny",checked:"data-[state=checked]:bg-danger-soft data-[state=checked]:text-danger"}],v=_(()=>`${n.controlId}-label`);function p(D,A){return`${n.controlId}-${D}-${A}`}function h(D){return l.value.get(D.code)}function k(D){return u.value||!!D.locked||h(D)!==void 0}function S(D){return(!!D.locked||h(D)!==void 0)&&!u.value}function x(D){return h(D)?.note||g("backend::lang.permissioneditor.locked")}function E(D){const A=h(D);return A?A.value===1||i.value&&A.value===-1?A.value:0:d.value[D.code]??0}function L(D,A){if(k(D))return;const R={...d.value};A===1||i.value&&A===-1?R[D.code]=A:delete R[D.code],a("update:modelValue",R)}return(D,A)=>o.value.length===0?(m(),y("div",{key:0,id:e.controlId,"data-permission-empty":"",class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 text-muted"},$(s(g)("backend::lang.permissioneditor.empty")),9,Kq)):(m(),y("div",{key:1,id:e.controlId,role:"group","aria-labelledby":e.field.label?v.value:void 0,"aria-label":e.field.label?void 0:e.field.name,"aria-describedby":e.describedBy||void 0,class:ve([e.invalid?"border-danger":"border-border","overflow-hidden rounded-inner border"]),"data-permission-editor":"","data-mode":i.value?"radio":"checkbox"},[(m(!0),y(pe,null,Ie(c.value,(R,F)=>(m(),y("div",{key:R.key,role:"group","aria-labelledby":`${e.controlId}-section-${F}`,"data-permission-section":""},[w("h3",{id:`${e.controlId}-section-${F}`,class:ve([F>0?"border-t border-border":"","flex h-row-head items-center justify-between gap-4 bg-subtle px-4 font-semibold"])},[w("span",Jq,$(R.label),1),i.value?Q("",!0):(m(),y("span",Zq,$(s(g)("backend::lang.permissioneditor.allow")),1))],10,Yq),(m(!0),y(pe,null,Ie(R.options,(W,C)=>(m(),y("div",{key:W.code,"data-permission":W.code,"data-locked":S(W)?"":void 0,"data-locked-by":S(W)&&h(W)?"record":void 0,class:"flex min-h-[56px] items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3 max-sm:flex-col max-sm:items-start"},[w("div",Qq,[(m(),j(zt(i.value?"span":"label"),{id:`${p(F,C)}-label`,for:i.value?void 0:p(F,C),class:"[overflow-wrap:anywhere]"},{default:q(()=>[_e($(W.label||W.code)+" ",1),S(W)?(m(),j(s(tr),{key:0,size:14,class:"ml-1 inline-block align-[-2px] text-muted","aria-hidden":"true"})):Q("",!0)]),_:2},1032,["id","for"])),S(W)?(m(),y("p",{key:0,id:`${p(F,C)}-note`,class:"text-[13px] text-muted [overflow-wrap:anywhere]","data-permission-locked":""},$(x(W)),9,eL)):W.comment?(m(),y("p",{key:1,id:`${p(F,C)}-note`,class:"text-[13px] text-muted [overflow-wrap:anywhere]"},$(W.comment),9,tL)):Q("",!0)]),i.value?(m(),j(s(M1),{key:0,orientation:"horizontal","model-value":String(E(W)),disabled:k(W),"aria-disabled":k(W)?"true":void 0,"aria-labelledby":`${p(F,C)}-label`,"aria-describedby":S(W)||W.comment?`${p(F,C)}-note`:void 0,class:"inline-flex shrink-0 gap-1 rounded-inner border border-border bg-subtle p-1","onUpdate:modelValue":I=>L(W,Number(I))},{default:q(()=>[(m(),y(pe,null,Ie(f,I=>N(s(P1),{key:I.value,value:I.value,"data-segment":I.value,class:ve([I.checked,"inline-flex h-pager items-center rounded-tab px-4 text-[13px] whitespace-nowrap text-muted transition-colors duration-150 ease-out hover:text-text disabled:cursor-not-allowed disabled:hover:text-muted data-[state=checked]:text-[14px] data-[state=checked]:font-semibold"])},{default:q(()=>[_e($(s(g)(I.label)),1)]),_:2},1032,["value","data-segment","class"])),64))]),_:1},8,["model-value","disabled","aria-disabled","aria-labelledby","aria-describedby","onUpdate:modelValue"])):(m(),j(s(WD),{key:1,id:p(F,C),"model-value":E(W)===1,disabled:k(W),"aria-disabled":k(W)?"true":void 0,"aria-labelledby":`${p(F,C)}-label`,"aria-describedby":S(W)||W.comment?`${p(F,C)}-note`:void 0,class:"flex size-[18px] shrink-0 items-center justify-center rounded-checkbox border border-border-strong bg-surface disabled:cursor-not-allowed disabled:opacity-60 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-on-primary","onUpdate:modelValue":I=>L(W,I===!0?1:0)},{default:q(()=>[N(s(YD),null,{default:q(()=>[N(s(jn),{size:14,"aria-hidden":"true"})]),_:1})]),_:1},8,["id","model-value","disabled","aria-disabled","aria-labelledby","aria-describedby","onUpdate:modelValue"]))],8,Xq))),128))],8,Gq))),128))],10,Wq))}}),aL=ae({__name:"FieldRenderer",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=_(()=>B0(n.field));return(l,o)=>(m(),j(zt(r.value),{field:e.field,"model-value":e.modelValue,"control-id":e.controlId,invalid:e.invalid,"described-by":e.describedBy,labels:e.labels,source:e.source,"record-id":e.recordId,"onUpdate:modelValue":o[0]||(o[0]=i=>a("update:modelValue",i))},null,8,["field","model-value","control-id","invalid","described-by","labels","source","record-id"]))}}),rL=["data-field"],lL=["id"],oL={key:0,class:"text-danger","aria-hidden":"true"},sL=["id","for"],iL={key:0,class:"text-danger","aria-hidden":"true"},uL=["id"],cL=["id"],dL=["id"],fL=["id"],pL=ae({__name:"FormField",props:{field:{},modelValue:{},errors:{},notices:{},labels:{},source:{},recordId:{},idPrefix:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=_(()=>`${n.idPrefix??"field"}-${n.field.name}`),l=_(()=>r.value),o=_(()=>`${r.value}-comment`),i=_(()=>`${r.value}-error`),u=_(()=>`${r.value}-notice`),d=_(()=>`${r.value}-trigger`),c=it(Ss,null),f=it(hp,null),v=_(()=>f?.value[c?c.path(n.field.name):n.field.name]??""),p=_(()=>(n.errors?.length??0)>0),h=_(()=>(n.notices?.length??0)>0),k=_(()=>PF(n.field.type)),S=_(()=>IF(n.field.type)||Nu(n.field)),x=_(()=>!k.value&&!!n.field.comment),E=_(()=>[v.value!==""?d.value:"",x.value||k.value&&n.field.comment?o.value:"",p.value?i.value:"",h.value?u.value:""].filter(Boolean).join(" "));return(L,D)=>(m(),y("div",{class:"flex min-w-0 flex-col gap-1.5","data-field":e.field.name},[S.value&&e.field.label?(m(),y("span",{key:0,id:`${l.value}-label`,class:"font-semibold"},[_e($(e.field.label),1),e.field.required?(m(),y("span",oL," *")):Q("",!0)],8,lL)):!k.value&&!S.value?(m(),y("label",{key:1,id:`${l.value}-label`,for:l.value,class:"font-semibold"},[_e($(e.field.label||e.field.name),1),e.field.required?(m(),y("span",iL," *")):Q("",!0)],8,sL)):Q("",!0),v.value!==""?(m(),y("p",{key:2,id:d.value,"data-trigger-note":"",class:"flex items-center gap-2 text-[13px] text-muted"},[N(s(Xl),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(v.value),1)],8,uL)):Q("",!0),N(aL,{field:e.field,"model-value":e.modelValue,"control-id":l.value,invalid:p.value,"described-by":E.value,labels:e.labels,source:e.source,"record-id":e.recordId,"onUpdate:modelValue":D[0]||(D[0]=A=>a("update:modelValue",A))},null,8,["field","model-value","control-id","invalid","described-by","labels","source","record-id"]),x.value?(m(),y("p",{key:3,id:o.value,class:"text-[13px] text-muted"},$(e.field.comment),9,cL)):Q("",!0),h.value?(m(),y("div",{key:4,id:u.value,role:"status","data-field-notice":"",class:"summer-callout summer-callout--warning text-[13px]!"},[(m(!0),y(pe,null,Ie(e.notices,(A,R)=>(m(),y("p",{key:R,class:"summer-callout__text"},$(A),1))),128))],8,dL)):Q("",!0),p.value?(m(),y("div",{key:5,id:i.value,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(m(!0),y(pe,null,Ie(e.errors,(A,R)=>(m(),y("p",{key:R,class:"flex items-center gap-1.5"},[N(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),w("span",null,$(A),1)]))),128))],8,fL)):Q("",!0)],8,rL))}}),mL={class:"grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},lo=ae({__name:"FormGrid",props:{fields:{},values:{},errors:{},notices:{},labels:{},source:{},recordId:{},idPrefix:{},scopePath:{}},emits:["update"],setup(e,{emit:t}){const n=e,a=t;ht(Ss,{fields:_(()=>n.fields),values:_(()=>n.values),path:l=>n.scopePath?`${n.scopePath}.${l}`:l});function r(l){if(l.type===al)return"col-span-full";switch(l.span){case"left":return"min-[600px]:col-start-1";case"right":return"min-[600px]:col-start-2";case"auto":case"row":return"";default:return"col-span-full"}}return(l,o)=>(m(),y("div",mL,[(m(!0),y(pe,null,Ie(e.fields,i=>(m(),j(pL,{key:i.name,class:ve(r(i)),field:i,"model-value":e.values[i.name],errors:e.errors[i.name],notices:e.notices?.[i.name],labels:e.labels?.[i.name],source:e.source,"record-id":e.recordId,"id-prefix":e.idPrefix,"onUpdate:modelValue":u=>a("update",i.name,u)},null,8,["class","field","model-value","errors","notices","labels","source","record-id","id-prefix","onUpdate:modelValue"]))),128))]))}}),vL=["data-preview-field"],hL=["id"],yL={class:"m-0 min-w-0"},gL={key:0,"data-switch":"true",class:"inline-flex h-6 items-center rounded-pill bg-ok-bg px-2.5 text-[12px] font-semibold text-ok-text"},bL={key:1,"data-switch":"false",class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[12px] font-semibold text-muted"},_L={class:"flex size-[22px] shrink-0 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-on-primary","aria-hidden":"true"},xL={class:"font-semibold"},kL={key:0,class:"px-2 text-muted","data-empty":""},wL={key:0},$L={key:1,class:"text-muted","data-empty":""},CL={key:0},SL={key:1,class:"text-muted","data-empty":""},Nc="flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 [overflow-wrap:anywhere]",$0=ae({__name:"PreviewField",props:{field:{},value:{},labels:{},source:{},recordId:{},idPrefix:{}},setup(e){const t=e,n=new Set(["datepicker","fileupload","partial","permissioneditor","richeditor","repeater","money","taglist"]),a=_(()=>`${t.idPrefix??"preview"}-${t.field.name}`),r=_(()=>`${a.value}-label`),l=_(()=>{const p=t.field.type;return n.has(p)||Nu(t.field)?"control":p==="checkbox"||p==="switch"?"toggle":p==="relation"?t.field.multiple?"chips":"relation":p==="textarea"?"textarea":"text"}),o=_(()=>({...t.field,readOnly:!0})),i=_(()=>B0(t.field));function u(p){return p==null||p===""}const d=_(()=>{const p=t.value;if(u(p)||typeof p=="object")return"";if(t.field.type==="dropdown"){const h=(t.field.options??[]).find(k=>String(k.value)===String(p));return h?h.label:String(p)}return String(p)}),c=_(()=>t.labels?.[0]?.label??""),f=_(()=>Array.isArray(t.value)?t.labels??[]:[]);function v(p){return p.trim().split(/\s+/).filter(Boolean).slice(0,2).map(k=>k.charAt(0).toUpperCase()).join("")}return(p,h)=>(m(),y("div",{class:"flex min-w-0 flex-col gap-1.5","data-preview-field":e.field.name},[w("dt",{id:r.value,class:"font-semibold"},$(e.field.label||e.field.name),9,hL),w("dd",yL,[l.value==="control"?(m(),j(zt(i.value),{key:0,field:o.value,"model-value":e.value,"control-id":a.value,labels:e.labels,source:e.source,"record-id":e.recordId},null,8,["field","model-value","control-id","labels","source","record-id"])):l.value==="toggle"?(m(),y(pe,{key:1},[s(Ru)(e.value)?(m(),y("span",gL,$(s(g)("backend::lang.list.column_switch_true")),1)):(m(),y("span",bL,$(s(g)("backend::lang.list.column_switch_false")),1))],64)):l.value==="chips"?(m(),y("div",{key:2,"data-preview-value":"",class:ve([Nc,"flex-wrap gap-1.5 p-1.5"])},[(m(!0),y(pe,null,Ie(f.value,k=>(m(),y("span",{key:String(k.value),"data-chip":"",class:"inline-flex min-h-[30px] items-center gap-1.5 rounded-pill bg-surface pr-3 pl-1"},[w("span",_L,$(v(k.label)),1),w("span",xL,$(k.label),1)]))),128)),f.value.length===0?(m(),y("span",kL,$(s(g)("backend::lang.list.empty_value")),1)):Q("",!0)])):l.value==="relation"?(m(),y("div",{key:3,"data-preview-value":"",class:ve(Nc)},[c.value!==""?(m(),y("span",wL,$(c.value),1)):(m(),y("span",$L,$(e.field.emptyOption||s(g)("backend::lang.list.empty_value")),1))])):(m(),y("div",{key:4,"data-preview-value":"",class:ve([Nc,l.value==="textarea"?"items-start! py-3 whitespace-pre-wrap":""])},[d.value!==""?(m(),y("span",CL,$(d.value),1)):(m(),y("span",SL,$(s(g)("backend::lang.list.empty_value")),1))],2))])],8,vL))}}),C0=new Set(["p","br","strong","b","em","i","u","s","h3","ul","ol","li","blockquote","a","div","span"]);function S0(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function EL(e){if(e==="")return[];const t=new Set;for(const n of Array.from(S0(e).querySelectorAll("*")))t.add(n.localName.toLowerCase());return[...t]}function ch(e){return EL(e).some(t=>!C0.has(t))}const AL=["aria-labelledby","aria-describedby","data-repeater"],TL={key:0,"data-repeater-empty":"",class:"flex flex-col items-center gap-2 rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},DL={class:"font-semibold"},OL={key:0,class:"max-w-[420px] text-[13px] text-muted"},ML={key:0,"data-repeater-slot":"",class:"h-12 rounded-inner border-2 border-dashed border-primary bg-sel"},PL=["data-repeater-row","data-repeater-key","onDragover"],IL=["data-repeater-handle","aria-label","onKeydown","onDragstart"],RL={class:"text-[13px] text-muted tabular-nums"},qL=["title"],LL={key:1,"data-repeater-errors":"",class:"inline-flex h-6 items-center rounded-pill bg-danger-soft px-2.5 text-[13px] font-semibold text-danger"},NL={key:2,class:"flex gap-1"},BL=["aria-label","disabled","onClick"],FL=["aria-label","disabled","onClick"],VL=["aria-label","aria-expanded","aria-controls","onClick"],zL=["aria-label","disabled","onClick"],jL=["id"],UL={key:0,class:"m-0 grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},HL={key:2,class:"flex flex-wrap items-center gap-4"},KL={key:0,"data-repeater-count":"",class:"text-[13px] text-muted tabular-nums"},Co="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",WL=ae({__name:"RepeaterField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,r=it(yp,null),l=_(()=>n.field.form?.fields??[]),o=_(()=>!!n.field.readOnly),i=_(()=>Array.isArray(n.modelValue)?n.modelValue.map(G=>G!==null&&typeof G=="object"&&!Array.isArray(G)?G:{}):[]),u=_(()=>typeof n.field.maxItems=="number"?n.field.maxItems:null),d=_(()=>typeof n.field.minItems=="number"?n.field.minItems:0),c=_(()=>n.field.prompt||g("backend::lang.repeater.add")),f=_(()=>`${n.controlId}-label`);let v=0;const p=M([]),h=M(new Set);let k;function S(){return v+=1,`r${v}`}Ve(()=>n.modelValue,G=>{G===k&&p.value.length===i.value.length||p.value.length!==i.value.length&&(p.value=i.value.map(()=>S()),h.value=new Set)},{immediate:!0});function x(G,X){p.value=X,k=G,a("update:modelValue",G)}function E(G){return G==null||G===""||G===!1||Array.isArray(G)&&G.length===0}function L(){const G={};for(const X of l.value)X.default!==void 0?G[X.name]=X.default:X.type==="checkbox"||X.type==="switch"?G[X.name]=!1:G[X.name]=null;return G}function D(G){return l.value.some(X=>{const te=G[X.name];return E(te)?!1:X.default===void 0||String(X.default)!==String(te)})}function A(G){return(S0(G).textContent??"").replace(/\s+/g," ").trim()}function R(G){const X=i.value[G]??{},te=l.value.find(P=>P.name===n.field.titleFrom),b=te?X[te.name]:void 0;let T="";return te&&!E(b)&&typeof b!="object"&&(te.type==="dropdown"?T=(te.options??[]).find(P=>String(P.value)===String(b))?.label??String(b):te.type==="richeditor"?T=A(String(b)):T=String(b).trim()),T!==""?T:g("backend::lang.repeater.untitled",{n:G+1})}function F(G,X){const te=`${n.field.name}.${X}.`,b={};for(const[T,P]of Object.entries(G??{}))T.startsWith(te)&&T.length>te.length&&(b[T.slice(te.length)]=P);return b}const W=_(()=>i.value.map((G,X)=>F(r?.errors.value,X))),C=_(()=>i.value.map((G,X)=>F(r?.notices.value,X))),I=G=>Object.keys(W.value[G]??{}).length;Ve(W,G=>{const X=G.flatMap((te,b)=>Object.keys(te).length>0?[p.value[b]]:[]);if(X.length>0){const te=new Set(h.value);for(const b of X)te.delete(b);h.value=te}});function z(G){return o.value||!h.value.has(G)}function O(G,X){const te=new Set(h.value);X?te.delete(G):te.add(G),h.value=te}const B=_(()=>p.value.some(G=>!h.value.has(G)));function J(){h.value=B.value?new Set(p.value):new Set}const K=M(null),H=M(null);function le(G){return K.value?.querySelector(`[data-repeater-handle="${G}"]`)??null}function ue(G,X,te){const b=i.value.map((T,P)=>P===G?{...T,[X]:te}:T);x(b,[...p.value]),r?.clearError(`${n.field.name}.${G}.${X}`)}async function we(){if(o.value||u.value!==null&&i.value.length>=u.value)return;const G=S();x([...i.value,L()],[...p.value,G]),await Je(),K.value?.querySelector(`[data-repeater-key="${G}"]`)?.querySelector('[data-repeater-body] input, [data-repeater-body] select, [data-repeater-body] textarea, [data-repeater-body] [contenteditable="true"]')?.focus()}async function Oe(G){const X=i.value[G];if(!X||o.value||i.value.length<=d.value)return;if(D(X)&&r){const P=R(G);if(!await r.confirm({message:g("backend::lang.repeater.remove_confirm",{title:P}),confirmLabel:g("backend::lang.repeater.remove"),danger:!0}))return}const te=p.value.filter((P,re)=>re!==G);x(i.value.filter((P,re)=>re!==G),te),await Je();const b=te[G]??te[G-1],T=b?le(b):null;T?T.focus():H.value?.$el.focus()}async function Ae(G,X){const te=i.value.length;if(o.value||G===X||G<0||X<0||G>=te||X>=te)return;const b=[...i.value],T=[...p.value],[P]=b.splice(G,1),[re]=T.splice(G,1);b.splice(X,0,P),T.splice(X,0,re),x(b,T),await Je(),le(re)?.focus(),r?.announce(g("backend::lang.repeater.moved",{title:R(X),position:X+1,total:te}))}function ie(G,X){(G.key==="ArrowUp"||G.key==="ArrowDown")&&(G.preventDefault(),Ae(X,G.key==="ArrowUp"?X-1:X+1))}const xe=M(null),U=M(null);function ke(G,X){xe.value=X,U.value=null,G.dataTransfer?.setData("text/plain",p.value[X]??""),G.dataTransfer&&(G.dataTransfer.effectAllowed="move")}function me(G,X){if(xe.value===null)return;G.preventDefault();const b=G.currentTarget.getBoundingClientRect();U.value=G.clientY>b.top+b.height/2?X+1:X}function Y(G){if(xe.value===null||U.value===null)return;G.preventDefault();const X=xe.value,te=U.value>X?U.value-1:U.value;fe(),Ae(X,te)}function fe(){xe.value=null,U.value=null}return(G,X)=>(m(),y("div",{ref_key:"root",ref:K,role:"group","aria-labelledby":f.value,"aria-describedby":e.describedBy||void 0,"data-repeater":e.field.name,class:"flex flex-col gap-4"},[i.value.length===0?(m(),y("div",TL,[w("p",DL,$(s(g)("backend::lang.repeater.empty")),1),o.value?Q("",!0):(m(),y("p",OL,$(s(g)("backend::lang.repeater.empty_hint",{prompt:c.value})),1))])):Q("",!0),(m(!0),y(pe,null,Ie(i.value,(te,b)=>(m(),y(pe,{key:p.value[b]},[xe.value!==null&&U.value===b&&U.value!==xe.value&&U.value!==xe.value+1?(m(),y("div",ML)):Q("",!0),w("div",{"data-repeater-row":b,"data-repeater-key":p.value[b],class:ve([[I(b)>0?"border-danger":"border-border",xe.value===b?"opacity-50":""],"rounded-inner border bg-surface"]),onDragover:T=>me(T,b),onDrop:Y},[w("div",{class:ve([z(p.value[b])?"rounded-t-inner border-b border-border":"rounded-inner","flex min-h-12 items-center gap-2 bg-subtle px-2"])},[o.value?Q("",!0):(m(),y("button",{key:0,type:"button",draggable:"true","data-repeater-handle":p.value[b],"aria-label":s(g)("backend::lang.repeater.move",{title:R(b)}),class:ve([Co,"cursor-grab"]),onKeydown:T=>ie(T,b),onDragstart:T=>ke(T,b),onDragend:fe},[N(s(Ti),{size:16,"aria-hidden":"true"})],40,IL)),w("span",RL,$(b+1)+".",1),w("span",{"data-repeater-title":"",class:"min-w-0 flex-1 truncate font-semibold",title:R(b)},$(R(b)),9,qL),I(b)>0?(m(),y("span",LL,$(s(zr)("backend::lang.form.tab_errors",I(b))),1)):Q("",!0),o.value?Q("",!0):(m(),y("div",NL,[w("button",{type:"button","data-action":"repeater-up","aria-label":s(g)("backend::lang.repeater.move_up",{title:R(b)}),disabled:b===0,class:ve(Co),onClick:T=>Ae(b,b-1)},[N(s(Fg),{size:16,"aria-hidden":"true"})],8,BL),w("button",{type:"button","data-action":"repeater-down","aria-label":s(g)("backend::lang.repeater.move_down",{title:R(b)}),disabled:b===i.value.length-1,class:ve(Co),onClick:T=>Ae(b,b+1)},[N(s(ur),{size:16,"aria-hidden":"true"})],8,FL),w("button",{type:"button","data-action":"repeater-toggle","aria-label":s(g)(z(p.value[b])?"backend::lang.repeater.collapse":"backend::lang.repeater.expand",{title:R(b)}),"aria-expanded":z(p.value[b])?"true":"false","aria-controls":`${e.controlId}-${p.value[b]}-body`,class:ve(Co),onClick:T=>O(p.value[b],!z(p.value[b]))},[N(s(ur),{size:16,class:ve([z(p.value[b])?"rotate-180":"","transition-transform duration-150"]),"aria-hidden":"true"},null,8,["class"])],8,VL),w("button",{type:"button","data-action":"repeater-remove","aria-label":s(g)("backend::lang.repeater.remove_named",{title:R(b)}),disabled:i.value.length<=d.value,class:ve([Co,"hover:bg-danger-soft hover:text-danger"]),onClick:T=>Oe(b)},[N(s(xr),{size:16,"aria-hidden":"true"})],8,zL)]))],2),z(p.value[b])?(m(),y("div",{key:0,id:`${e.controlId}-${p.value[b]}-body`,"data-repeater-body":"",class:"p-4"},[o.value?(m(),y("dl",UL,[(m(!0),y(pe,null,Ie(l.value,T=>(m(),j($0,{key:T.name,class:ve(T.span==="left"?"min-[600px]:col-start-1":T.span==="right"?"min-[600px]:col-start-2":"col-span-full"),field:{...T,readOnly:!0},value:te[T.name],source:e.source,"record-id":e.recordId,"id-prefix":`${e.controlId}-${p.value[b]}`},null,8,["class","field","value","source","record-id","id-prefix"]))),128))])):(m(),j(lo,{key:1,fields:l.value,values:te,errors:W.value[b]??{},notices:C.value[b],source:e.source,"record-id":e.recordId,"id-prefix":`${e.controlId}-${p.value[b]}`,"scope-path":e.field.name,onUpdate:(T,P)=>ue(b,T,P)},null,8,["fields","values","errors","notices","source","record-id","id-prefix","scope-path","onUpdate"]))],8,jL)):Q("",!0)],42,PL)],64))),128)),xe.value!==null&&U.value===i.value.length&&U.value!==xe.value+1?(m(),y("div",{key:1,"data-repeater-slot":"",class:"h-12 rounded-inner border-2 border-dashed border-primary bg-sel",onDragover:X[0]||(X[0]=ft(()=>{},["prevent"])),onDrop:Y},null,32)):Q("",!0),o.value?Q("",!0):(m(),y("div",HL,[N(Ke,{ref_key:"addButton",ref:H,variant:"outline",size:"sm",icon:s(xs),"data-action":"repeater-add",disabled:u.value!==null&&i.value.length>=u.value,onClick:we},{default:q(()=>[_e($(c.value),1)]),_:1},8,["icon","disabled"]),u.value!==null?(m(),y("span",KL,$(s(g)("backend::lang.repeater.count",{current:i.value.length,max:u.value})),1)):Q("",!0),i.value.length>1?(m(),j(Ke,{key:1,variant:"ghost",size:"sm",class:"ml-auto","data-action":"repeater-toggle-all",onClick:J},{default:q(()=>[_e($(s(g)(B.value?"backend::lang.repeater.collapse_all":"backend::lang.repeater.expand_all")),1)]),_:1})):Q("",!0)]))],8,AL))}}),GL="modulepreload",YL=function(e,t){return new URL(e,t).href},dh={},JL=function(t,n,a){let r=Promise.resolve();if(n&&n.length>0){let d=function(c){return Promise.all(c.map(f=>Promise.resolve(f).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const o=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),u=i?.nonce||i?.getAttribute("nonce");r=d(n.map(c=>{if(c=YL(c,a),c in dh)return;dh[c]=!0;const f=c.endsWith(".css"),v=f?'[rel="stylesheet"]':"";if(a)for(let h=o.length-1;h>=0;h--){const k=o[h];if(k.href===c&&(!f||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${v}`))return;const p=document.createElement("link");if(p.rel=f?"stylesheet":GL,f||(p.as="script"),p.crossOrigin="",p.href=c,u&&p.setAttribute("nonce",u),document.head.appendChild(p),f)return new Promise((h,k)=>{p.addEventListener("load",h),p.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${c}`)))})}))}function l(o){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o}return r.then(o=>{for(const i of o||[])i.status==="rejected"&&l(i.reason);return t().catch(l)})};function fh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n2?a-2:0),l=2;l1?n-1:0),r=1;r"u"?null:Rt(BigInt.prototype.toString),gh=typeof Symbol>"u"?null:Rt(Symbol.prototype.toString),on=Rt(Object.prototype.hasOwnProperty),Ao=Rt(Object.prototype.toString),Yt=Rt(RegExp.prototype.test),Wa=cN(TypeError);function Rt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:Ro;if(ph&&ph(e,null),!Fl(t))return e;let a=t.length;for(;a--;){let r=t[a];if(typeof r=="string"){const l=n(r);l!==r&&(nN(t)||(t[a]=l),r=l)}e[r]=!0}return e}function dN(e){for(let t=0;t/g),gN=Ht(/\${[\w\W]*/g),bN=Ht(/^data-[\-\w.\u00B7-\uFFFF]+$/),_N=Ht(/^aria-[\-\w]+$/),wh=Ht(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xN=Ht(/^(?:\w+script|data):/i),kN=Ht(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wN=Ht(/^html$/i),$N=Ht(/^[a-z][.\w]*(-[.\w]+)+$/i),$h=Ht(/<[/\w!]/g),Ch=Ht(/<[/\w]/g),CN=Ht(/<\/no(script|embed|frames)/i),SN=Ht(/\/>/i),vn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},T0=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],EN=Bt(ct({},T0)),AN=(function(){const e={};return Rr(T0,t=>{e[t]=Ht(new RegExp("])","i"))}),Bt(e)})(),TN=function(){return typeof window>"u"?null:window},DN=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let a=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(a=n.getAttribute(r));const l="dompurify"+(a?"#"+a:"");try{return t.createPolicy(l,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},Sh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ga=function(t,n,a,r){return on(t,n)&&Fl(t[n])?ct(r.base?hn(r.base):{},t[n],r.transform):a},Uc=function(t,n,a){const r=on(t,n)?t[n]:void 0;return r&&typeof r=="object"?hn(r):a()};function D0(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:TN();const t=Me=>D0(Me);if(t.version="3.4.16",t.removed=[],!e||!e.document||e.document.nodeType!==vn.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const a=n,r=a.currentScript;e.DocumentFragment;const l=e.HTMLTemplateElement,o=e.Node,i=e.Element,u=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,c=e.trustedTypes,f=i.prototype,v=Sn(f,"cloneNode"),p=Sn(f,"remove"),h=Sn(f,"removeAttributeNode"),k=Sn(f,"nextSibling"),S=Sn(f,"childNodes"),x=Sn(f,"parentNode"),E=Sn(f,"shadowRoot"),L=Sn(f,"attributes"),D=o&&o.prototype?Sn(o.prototype,"nodeType"):null,A=o&&o.prototype?Sn(o.prototype,"nodeName"):null,R=o&&o.prototype?Sn(o.prototype,"ownerDocument"):null,F=function(V){return D?D(V):V.nodeType},W=function(V){return A?A(V):V.nodeName};if(typeof l=="function"){const Me=n.createElement("template");Me.content&&Me.content.ownerDocument&&(n=Me.content.ownerDocument)}let C,I="",z,O=!1,B=0;const J=function(){if(B>0)throw Wa('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},K=function(V){J(),B++;try{return C.createHTML(V)}finally{B--}},H=function(V){J(),B++;try{return C.createScriptURL(V)}finally{B--}},le=function(){return O||(z=DN(c,r),O=!0),z},ue=n,we=ue.implementation,Oe=ue.createNodeIterator,Ae=ue.createDocumentFragment,ie=ue.getElementsByTagName,xe=a.importNode;let U=Sh();t.isSupported=typeof E0=="function"&&typeof x=="function"&&we&&we.createHTMLDocument!==void 0;const ke=hN,me=yN,Y=gN,fe=bN,G=_N,X=xN,te=kN,b=$N;let T=wh,P=null;const re=ct({},[...bh,...Fc,...Vc,...zc,..._h]);let ee=null;const ce=ct({},[...xh,...jc,...kh,...Xs]);let Ee=Object.seal($l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,Te=null;const oe=Object.seal($l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let $e=!0,ye=!0,qe=!1,Be=!0,He=!1,Ze=!0,Xe=!1,ot=!1,at=null,Et=null,Tt=!1,qt=!1,Fe=!1,de=!1,be=!0,je=!1;const rt="user-content-";let jt=!0,Lt=!1,Pn={},Gt=null;const so=ct({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let rl=null;const io=ct({},["audio","video","img","source","image","track"]);let ll=null;const uo=ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wn="http://www.w3.org/1998/Math/MathML",Va="http://www.w3.org/2000/svg",en="http://www.w3.org/1999/xhtml";let Kn=en,co=!1,fo=null;const po=ct({},[wn,Va,en],Bc),Z=Bt(["mi","mo","mn","ms","mtext"]);let De=ct({},Z);const ne=Bt(["annotation-xml"]);let Re=ct({},ne);const tt=ct({},["title","style","font","a","script"]);let Dt=null;const Wn=["application/xhtml+xml","text/html"],za="text/html";let Ot=null,ol=null;const Z0=n.createElement("form"),_p=function(V){return V instanceof RegExp||V instanceof Function},Bu=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ol&&ol===V)return;(!V||typeof V!="object")&&(V={}),V=hn(V),Dt=Wn.indexOf(V.PARSER_MEDIA_TYPE)===-1?za:V.PARSER_MEDIA_TYPE,Ot=Dt==="application/xhtml+xml"?Bc:Ro,P=Ga(V,"ALLOWED_TAGS",re,{transform:Ot}),ee=Ga(V,"ALLOWED_ATTR",ce,{transform:Ot}),fo=Ga(V,"ALLOWED_NAMESPACES",po,{transform:Bc}),ll=Ga(V,"ADD_URI_SAFE_ATTR",uo,{transform:Ot,base:uo}),rl=Ga(V,"ADD_DATA_URI_TAGS",io,{transform:Ot,base:io}),Gt=Ga(V,"FORBID_CONTENTS",so,{transform:Ot}),Ce=Ga(V,"FORBID_TAGS",hn({}),{transform:Ot}),Te=Ga(V,"FORBID_ATTR",hn({}),{transform:Ot}),Pn=on(V,"USE_PROFILES")?V.USE_PROFILES&&typeof V.USE_PROFILES=="object"?hn(V.USE_PROFILES):V.USE_PROFILES:!1,$e=V.ALLOW_ARIA_ATTR!==!1,ye=V.ALLOW_DATA_ATTR!==!1,qe=V.ALLOW_UNKNOWN_PROTOCOLS||!1,Be=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,He=V.SAFE_FOR_TEMPLATES||!1,Ze=V.SAFE_FOR_XML!==!1,Xe=V.WHOLE_DOCUMENT||!1,qt=V.RETURN_DOM||!1,Fe=V.RETURN_DOM_FRAGMENT||!1,de=V.RETURN_TRUSTED_TYPE||!1,Tt=V.FORCE_BODY||!1,be=V.SANITIZE_DOM!==!1,je=V.SANITIZE_NAMED_PROPS||!1,jt=V.KEEP_CONTENT!==!1,Lt=V.IN_PLACE||!1,T=pN(V.ALLOWED_URI_REGEXP)?V.ALLOWED_URI_REGEXP:wh,Kn=typeof V.NAMESPACE=="string"?V.NAMESPACE:en,De=Uc(V,"MATHML_TEXT_INTEGRATION_POINTS",()=>ct({},Z)),Re=Uc(V,"HTML_INTEGRATION_POINTS",()=>ct({},ne));const se=Uc(V,"CUSTOM_ELEMENT_HANDLING",()=>$l(null));if(Ee=$l(null),on(se,"tagNameCheck")&&_p(se.tagNameCheck)&&(Ee.tagNameCheck=se.tagNameCheck),on(se,"attributeNameCheck")&&_p(se.attributeNameCheck)&&(Ee.attributeNameCheck=se.attributeNameCheck),on(se,"allowCustomizedBuiltInElements")&&typeof se.allowCustomizedBuiltInElements=="boolean"&&(Ee.allowCustomizedBuiltInElements=se.allowCustomizedBuiltInElements),Ht(Ee),He&&(ye=!1),Fe&&(qt=!0),Pn&&(P=ct({},_h),ee=$l(null),Pn.html===!0&&(ct(P,bh),ct(ee,xh)),Pn.svg===!0&&(ct(P,Fc),ct(ee,jc),ct(ee,Xs)),Pn.svgFilters===!0&&(ct(P,Vc),ct(ee,jc),ct(ee,Xs)),Pn.mathMl===!0&&(ct(P,zc),ct(ee,kh),ct(ee,Xs))),oe.tagCheck=null,oe.attributeCheck=null,on(V,"ADD_TAGS")&&(typeof V.ADD_TAGS=="function"?oe.tagCheck=V.ADD_TAGS:Fl(V.ADD_TAGS)&&(P===re&&(P=hn(P)),ct(P,V.ADD_TAGS,Ot))),on(V,"ADD_ATTR")&&(typeof V.ADD_ATTR=="function"?oe.attributeCheck=V.ADD_ATTR:Fl(V.ADD_ATTR)&&(ee===ce&&(ee=hn(ee)),ct(ee,V.ADD_ATTR,Ot))),on(V,"ADD_FORBID_CONTENTS")&&Fl(V.ADD_FORBID_CONTENTS)&&(Gt===so&&(Gt=hn(Gt)),ct(Gt,V.ADD_FORBID_CONTENTS,Ot)),jt&&(P["#text"]=!0),Xe&&ct(P,["html","head","body"]),P.table&&(ct(P,["tbody"]),delete Ce.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Se=C;C=V.TRUSTED_TYPES_POLICY;try{I=K("")}catch(Pe){throw C=Se,Pe}}else V.TRUSTED_TYPES_POLICY===null?(C=void 0,I=""):(C===void 0&&(C=le()),C&&typeof I=="string"&&(I=K("")));Bt&&Bt(V),ol=V},xp=ct({},[...Fc,...Vc,...mN]),kp=ct({},[...zc,...vN]),X0=function(V,se,Se){return se.namespaceURI===en?V==="svg":se.namespaceURI===wn?V==="svg"&&(Se==="annotation-xml"||De[Se]):!!xp[V]},Q0=function(V,se,Se){return se.namespaceURI===en?V==="math":se.namespaceURI===Va?V==="math"&&Re[Se]:!!kp[V]},e_=function(V,se,Se){return se.namespaceURI===Va&&!Re[Se]||se.namespaceURI===wn&&!De[Se]?!1:!kp[V]&&(tt[V]||!xp[V])},t_=function(V){let se=x(V);(!se||!se.tagName)&&(se={namespaceURI:Kn,tagName:"template"});const Se=Ro(V.tagName),Pe=Ro(se.tagName);return fo[V.namespaceURI]?V.namespaceURI===Va?X0(Se,se,Pe):V.namespaceURI===wn?Q0(Se,se,Pe):V.namespaceURI===en?e_(Se,se,Pe):!!(Dt==="application/xhtml+xml"&&fo[V.namespaceURI]):!1},ja=function(V){So(t.removed,{element:V});try{x(V).removeChild(V)}catch{if(p(V),!x(V))throw Wa("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},wp=function(V,se,Se){try{h(V,se)}catch{try{V.removeAttribute(Se)}catch{}}},As=function(V){Ts(V);const se=S(V);if(se){const Pe=[];Rr(se,Ue=>{So(Pe,Ue)}),Rr(Pe,Ue=>{try{p(Ue)}catch{}})}const Se=L(V);if(Se)for(let Pe=Se.length-1;Pe>=0;--Pe){const Ue=Se[Pe],st=Ue&&Ue.name;typeof st=="string"&&wp(V,Ue,st)}},Er=function(V,se,Se){if(!Se)try{Se=se.getAttributeNode(V)}catch{Se=null}So(t.removed,{attribute:Se||null,from:se});try{Se?h(se,Se):se.removeAttribute(V)}catch{try{se.removeAttribute(V)}catch{}}if(V==="is")if(qt||Fe)try{ja(se)}catch{}else try{se.setAttribute(V,"")}catch{}},n_=function(V){const se=L(V);if(se)for(let Se=se.length-1;Se>=0;--Se){const Pe=se[Se],Ue=Pe&&Pe.name;typeof Ue!="string"||ee[Ot(Ue)]||wp(V,Pe,Ue)}},Ts=function(V){const se=[V];for(;se.length>0;){const Se=se.pop();F(Se)===vn.element&&n_(Se);const Pe=S(Se);if(Pe)for(let Ue=Pe.length-1;Ue>=0;--Ue)se.push(Pe[Ue])}},$p=function(V,se){return Ze?V==="patchsrc"?!0:V==="for"&&se!=="label"&&se!=="output":!1},a_=function(V){if(!Ze)return;const se=[V];for(;se.length>0;){const Se=se.pop(),Pe=F(Se);if(Pe===vn.processingInstruction||Pe===vn.comment&&Yt(Ch,Se.data)){try{p(Se)}catch{}continue}if(Pe===vn.element){const st=Se,ut=Ot(W(Se));try{st.hasAttribute&&st.hasAttribute("patchsrc")&&st.removeAttribute("patchsrc"),st.hasAttribute&&st.hasAttribute("for")&&$p("for",ut)&&st.removeAttribute("for")}catch{}}const Ue=S(Se);if(Ue)for(let st=Ue.length-1;st>=0;--st)se.push(Ue[st])}},Cp=function(V){let se=null,Se=null;if(Tt)V=""+V;else{const st=vh(V,/^[\r\n\t ]+/);Se=st&&st[0]}Dt==="application/xhtml+xml"&&Kn===en&&(V=''+V+"");const Pe=C?K(V):V;if(Kn===en)try{se=new d().parseFromString(Pe,Dt)}catch{}if(!se||!se.documentElement){se=we.createDocument(Kn,"template",null);try{se.documentElement.innerHTML=co?I:Pe}catch{}}const Ue=se.body||se.documentElement;return V&&Se&&Ue.insertBefore(n.createTextNode(Se),Ue.childNodes[0]||null),Kn===en?ie.call(se,Xe?"html":"body")[0]:Xe?se.documentElement:Ue},Sp=function(V){const se=R?R(V):V.ownerDocument;return Oe.call(se||V,V,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ds=function(V){return V=Eo(V,ke," "),V=Eo(V,me," "),V=Eo(V,Y," "),V},Fu=function(V){var se;V.normalize();const Se=R?R(V):V.ownerDocument,Pe=Oe.call(Se||V,V,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let Ue=Pe.nextNode();for(;Ue;)Ue.data=Ds(Ue.data),Ue=Pe.nextNode();const st=(se=V.querySelectorAll)===null||se===void 0?void 0:se.call(V,"template");st&&Rr(st,ut=>{sl(ut.content)&&Fu(ut.content)})},Os=function(V){const se=A?A(V):null;return typeof se!="string"||Ot(se)!=="form"?!1:typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||V.attributes!==L(V)||typeof V.removeAttribute!="function"||typeof V.removeAttributeNode!="function"||typeof V.getAttributeNode!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function"||V.nodeType!==D(V)||V.childNodes!==S(V)},sl=function(V){if(!D||typeof V!="object"||V===null)return!1;try{return D(V)===vn.documentFragment}catch{return!1}},mo=function(V){if(!D||typeof V!="object"||V===null)return!1;try{return typeof D(V)=="number"}catch{return!1}};function Gn(Me,V,se){Me.length!==0&&Rr(Me,Se=>{Se.call(t,V,se,ol)})}const r_=function(V,se){return!!(Ze&&V.hasChildNodes()&&!mo(V.firstElementChild)&&Yt($h,V.textContent)&&Yt($h,V.innerHTML)||Ze&&V.namespaceURI===en&&EN[se]&&(mo(V.firstElementChild)||typeof V.textContent=="string"&&Yt(AN[se],V.textContent))||V.nodeType===vn.processingInstruction||Ze&&V.nodeType===vn.comment&&Yt(Ch,V.data))},Ms=function(V,se){if(V instanceof RegExp)return Yt(V,se);if(V instanceof Function){for(var Se=arguments.length,Pe=new Array(Se>2?Se-2:0),Ue=2;Ue=0;--ut){const At=V===Se?v(Ue[ut],!0):Ue[ut];Pe.insertBefore(At,k(V))}}}return ja(V),!0},Ep=function(V,se,Se,Pe){return V.length===0?se:se===Se||se===Pe?hn(se):se},il=function(V,se){return V===se||x(V)!==null?!1:(Lt&&Ts(V),!0)},Ap=function(V,se){if(Gn(U.beforeSanitizeElements,V,null),il(V,se))return!0;if(Os(V))return ja(V),!0;const Se=Ot(W(V));if(P=Ep(U.uponSanitizeElement,P,re,at),Gn(U.uponSanitizeElement,V,{tagName:Se,allowedTags:P}),il(V,se))return!0;if(r_(V,Se))return ja(V),!0;if(Ce[Se]||!(oe.tagCheck instanceof Function&&oe.tagCheck(Se))&&!P[Se]){const Pe=l_(V,Se,se);return Pe===!1&&(Gn(U.afterSanitizeElements,V,null),il(V,se))?!0:Pe}if(F(V)===vn.element&&!t_(V)||(Se==="noscript"||Se==="noembed"||Se==="noframes")&&Yt(CN,V.innerHTML))return ja(V),!0;if(He&&V.nodeType===vn.text){const Pe=Ds(V.textContent);V.textContent!==Pe&&(So(t.removed,{element:V.cloneNode()}),V.textContent=Pe)}return Gn(U.afterSanitizeElements,V,null),il(V,se)},Tp=function(V,se,Se){if(Te[se]||$p(se,V)||be&&(se==="id"||se==="name")&&(Se in n||Se in Z0))return!1;const Pe=ee[se]||oe.attributeCheck instanceof Function&&oe.attributeCheck(se,V);return ye&&Yt(fe,se)||$e&&Yt(G,se)?!0:Pe?ll[se]||Yt(T,Eo(Se,te,""))||(se==="src"||se==="xlink:href"||se==="href")&&V!=="script"&&hh(Se,"data:")===0&&rl[V]||qe&&!Yt(X,Eo(Se,te,""))?!0:!Se:Dp(V)&&Ms(Ee.tagNameCheck,V)&&Ms(Ee.attributeNameCheck,se,V)||se==="is"&&Ee.allowCustomizedBuiltInElements&&Ms(Ee.tagNameCheck,Se)},o_=ct({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Dp=function(V){return!o_[Ro(V)]&&Yt(b,V)},s_=function(V,se,Se,Pe){if(C&&typeof c=="object"&&typeof c.getAttributeType=="function"&&!Se)switch(c.getAttributeType(V,se)){case"TrustedHTML":return K(Pe);case"TrustedScriptURL":return H(Pe)}return Pe},i_=function(V,se,Se,Pe){try{return Se?V.setAttributeNS(Se,se,Pe):V.setAttribute(se,Pe),Os(V)?(ja(V),!1):!0}catch{return Er(se,V),!1}},Op=function(V,se){if(Gn(U.beforeSanitizeAttributes,V,null),il(V,se))return;const Se=V.attributes;if(!Se||Os(V))return;ee=Ep(U.uponSanitizeAttribute,ee,ce,Et);const Pe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0};let Ue=Se.length;const st=Ot(V.nodeName);for(;Ue--;){const ut=Se[Ue],At=ut.name,$n=ut.namespaceURI,pn=ut.value,ul=Ot(At),zu=pn;let tn=At==="value"?zu:sN(zu),Mp=!1;if(Pe.attrName=ul,Pe.attrValue=tn,Pe.keepAttr=!0,Pe.forceKeepAttr=void 0,Gn(U.uponSanitizeAttribute,V,Pe),tn=Pe.attrValue,je&&(ul==="id"||ul==="name")&&hh(tn,rt)!==0&&(Er(At,V,ut),tn=rt+tn,Mp=!0),Ze&&Yt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,tn)){Er(At,V,ut);continue}if(ul==="attributename"&&vh(tn,"href")){Er(At,V,ut);continue}if(!Pe.forceKeepAttr){if(!Pe.keepAttr){Er(At,V,ut);continue}if(!Be&&Yt(SN,tn)){Er(At,V,ut);continue}if(He&&(tn=Ds(tn)),!Tp(st,ul,tn)){Er(At,V,ut);continue}tn=s_(st,ul,$n,tn),tn!==zu&&i_(V,At,$n,tn)&&Mp&&mh(t.removed)}}Gn(U.afterSanitizeAttributes,V,null),il(V,se)},Ps=function(V){let se=null;const Se=Sp(V);for(Gn(U.beforeSanitizeShadowDOM,V,null);se=Se.nextNode();)if(Gn(U.uponSanitizeShadowNode,se,null),Ap(se,V),Op(se,V),sl(se.content)&&Ps(se.content),F(se)===vn.element){const Pe=E(se);sl(Pe)&&(Vu(Pe),Ps(Pe))}Gn(U.afterSanitizeShadowDOM,V,null)},Vu=function(V){const se=[{node:V,shadow:null}];for(;se.length>0;){const Se=se.pop();if(Se.shadow){Ps(Se.shadow);continue}const Pe=Se.node,Ue=F(Pe)===vn.element,st=S(Pe);if(st)for(let ut=st.length-1;ut>=0;--ut)se.push({node:st[ut],shadow:null});if(Ue){const ut=A?A(Pe):null;if(typeof ut=="string"&&Ot(ut)==="template"){const At=Pe.content;sl(At)&&se.push({node:At,shadow:null})}}if(Ue){const ut=E(Pe);sl(ut)&&se.push({node:null,shadow:ut},{node:ut,shadow:null})}}};return t.sanitize=function(Me){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=null,Se=null,Pe=null,Ue=null;if(co=!Me,co&&(Me=""),typeof Me!="string"&&!mo(Me)&&(Me=fN(Me),typeof Me!="string"))throw Wa("dirty is not a string, aborting");if(!t.isSupported)return Me;ot?(P=at,ee=Et):Bu(V),(U.uponSanitizeElement.length>0||U.uponSanitizeAttribute.length>0)&&(P=hn(P)),U.uponSanitizeAttribute.length>0&&(ee=hn(ee)),t.removed=[];const st=Lt&&typeof Me!="string"&&mo(Me);if(st){a_(Me);const $n=W(Me);if(typeof $n=="string"){const pn=Ot($n);if(!P[pn]||Ce[pn])throw As(Me),Wa("root node is forbidden and cannot be sanitized in-place")}if(Os(Me))throw As(Me),Wa("root node is clobbered and cannot be sanitized in-place");try{Vu(Me)}catch(pn){throw As(Me),pn}}else if(mo(Me))se=Cp(""),Se=se.ownerDocument.importNode(Me,!0),Se.nodeType===vn.element&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?se=Se:se.appendChild(Se),Vu(se);else{if(!qt&&!He&&!Xe&&Me.indexOf("<")===-1)return C&&de?K(Me):Me;if(se=Cp(Me),!se)return qt?null:de?I:""}se&&Tt&&ja(se.firstChild);const ut=st?Me:se;try{const $n=Sp(ut);for(;Pe=$n.nextNode();)Ap(Pe,ut),Op(Pe,ut),sl(Pe.content)&&Ps(Pe.content)}catch($n){throw st&&(As(Me),Rr(t.removed,pn=>{pn.element&&Ts(pn.element)})),$n}if(st){let $n=!1;if(Rr(t.removed,pn=>{pn.element&&(pn.element===Me&&($n=!0),Ts(pn.element))}),$n)throw Wa("a node selected for removal could not be safely returned; refusing to sanitize in place");return He&&Fu(Me),Me}if(qt){if(He&&Fu(se),Fe)for(Ue=Ae.call(se.ownerDocument);se.firstChild;)Ue.appendChild(se.firstChild);else Ue=se;return(ee.shadowroot||ee.shadowrootmode)&&(Ue=xe.call(a,Ue,!0)),Ue}let At=Xe?se.outerHTML:se.innerHTML;return Xe&&P["!doctype"]&&se.ownerDocument&&se.ownerDocument.doctype&&se.ownerDocument.doctype.name&&Yt(wN,se.ownerDocument.doctype.name)&&(At=" -`+At),He&&(At=Ds(At)),C&&de?K(At):At},t.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bu(Me),ot=!0,at=P,Et=ee},t.clearConfig=function(){ol=null,ot=!1,at=null,Et=null,C=z,I=""},t.isValidAttribute=function(Me,V,se){ol||Bu({});const Se=Ot(Me),Pe=Ot(V);return Tp(Se,Pe,se)},t.addHook=function(Me,V){typeof V=="function"&&on(U,Me)&&So(U[Me],V)},t.removeHook=function(Me,V){if(on(U,Me)){if(V!==void 0){const se=lN(U[Me],V);return se===-1?void 0:oN(U[Me],se,1)[0]}return mh(U[Me])}},t.removeHooks=function(Me){on(U,Me)&&(U[Me]=[])},t.removeAllHooks=function(){U=Sh()},t}var ON=D0();const MN=["http","https","mailto","tel"],PN=/[\x00-\x20\x7f]+/g,IN=/^([a-z][a-z0-9+.-]*):/i;function O0(e){if(e==null)return!1;const t=e.replace(PN,"");if(t==="")return!1;const n=IN.exec(t);if(n)return MN.includes(n[1].toLowerCase());try{return new URL(t,"https://admin.invalid/"),!0}catch{return!1}}const RN=["script","style","template","noscript","iframe","frame","frameset","object","embed","applet","svg","math","title","head","meta","link","base"],M0=Object.freeze({ALLOWED_TAGS:[...C0],ALLOWED_ATTR:["href"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1,ADD_FORBID_CONTENTS:[...RN],KEEP_CONTENT:!0,RETURN_TRUSTED_TYPE:!1}),qN='

a - + +