reactjs-tiptap-editor 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,453 @@
1
+ "use strict";const z=require("react"),cS=require("react-dom"),V=require("docx");function Zy(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const F=Zy(z),fS=Zy(cS);function Se(t){this.content=t}Se.prototype={constructor:Se,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new Se(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Se(n)},addToStart:function(t,e){return new Se([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Se(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new Se(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Se.from(t),t.size?new Se(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Se.from(t),t.size?new Se(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Se.from=function(t){if(t instanceof Se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Se(e)};function e0(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=e0(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function t0(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){n-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let c=0,f=Math.min(s.text.length,l.text.length);for(;c<f&&s.text[s.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let c=t0(s.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class E{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let a=this.content[s],c=l+a.nodeSize;if(c>e&&r(a,i+l,o||null,s)!==!1&&a.content.size){let f=l+1;a.nodesBetween(Math.max(0,e-f),Math.min(a.content.size,n-f),r,i+f)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-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&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new E(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],a=s+l.nodeSize;a>e&&((s<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=a}return new E(r,i)}cutByIndex(e,n){return e==n?E.empty:e==0&&n==this.content.length?this:new E(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new E(i,o)}addToStart(e){return new E([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new E(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return e0(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return t0(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ds(0,e);if(e==this.size)return ds(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ds(r+1,s):ds(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return E.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new E(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return E.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new E(n||e,r)}static from(e){if(!e)return E.empty;if(e instanceof E)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new E([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}E.empty=new E([],0);const nc={index:0,offset:0};function ds(t,e){return nc.index=t,nc.offset=e,nc}function dl(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!dl(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!dl(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class Z{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&dl(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Z.none;if(e instanceof Z)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}}Z.none=[];class hl extends Error{}class D{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=r0(this.content,e+this.openStart,n);return r&&new D(r,this.openStart,this.openEnd)}removeBetween(e,n){return new D(n0(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return D.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new D(E.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new D(e,r,i)}}D.empty=new D(E.empty,0,0);function n0(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(n0(o.content,e-i-1,n-i-1)))}function r0(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=r0(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function uS(t,e,n){if(n.openStart>t.depth)throw new hl("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hl("Inconsistent open depths");return i0(t,e,n,0)}function i0(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=i0(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return hr(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=dS(n,t);return hr(o,s0(t,s,l,e,r))}else return hr(o,pl(t,e,r))}function o0(t,e){if(!e.type.compatibleContent(t.type))throw new hl("Cannot join "+e.type.name+" onto "+t.type.name)}function bf(t,e,n){let r=t.node(n);return o0(r,e.node(n)),r}function dr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Zi(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(dr(t.nodeAfter,r),o++));for(let l=o;l<s;l++)dr(i.child(l),r);e&&e.depth==n&&e.textOffset&&dr(e.nodeBefore,r)}function hr(t,e){return t.type.checkContent(e),t.copy(e)}function s0(t,e,n,r,i){let o=t.depth>i&&bf(t,e,i+1),s=r.depth>i&&bf(n,r,i+1),l=[];return Zi(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(o0(o,s),dr(hr(o,s0(t,e,n,r,i+1)),l)):(o&&dr(hr(o,pl(t,e,i+1)),l),Zi(e,n,i,l),s&&dr(hr(s,pl(n,r,i+1)),l)),Zi(r,null,i,l),new E(l)}function pl(t,e,n){let r=[];if(Zi(null,t,n,r),t.depth>n){let i=bf(t,e,n+1);dr(hr(i,pl(t,e,n+1)),r)}return Zi(e,null,n,r),new E(r)}function dS(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(E.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class vo{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Z.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new bo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new vo(n,r,o)}static resolveCached(e,n){let r=kh.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else kh.set(e,r=new hS);let i=r.elts[r.i]=vo.resolve(e,n);return r.i=(r.i+1)%pS,i}}class hS{constructor(){this.elts=[],this.i=0}}const pS=12,kh=new WeakMap;class bo{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const gS=Object.create(null);let jn=class wf{constructor(e,n,r,i=Z.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||E.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&dl(this.attrs,n||e.defaultAttrs||gS)&&Z.sameSet(this.marks,r||Z.none)}copy(e=null){return e==this.content?this:new wf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new wf(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return D.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),c=i.node(s).content.cut(i.pos-l,o.pos-l);return new D(c,i.depth-s,o.depth-s)}replace(e,n,r){return uS(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return vo.resolveCached(this,e)}resolveNoCache(e){return vo.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),l0(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=E.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<o;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Z.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=E.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};jn.prototype.text=void 0;class gl extends jn{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):l0(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new gl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gl(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function l0(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class wr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new mS(e,n);if(r.next==null)return wr.empty;let i=a0(r);r.next&&r.err("Unexpected trailing text");let o=kS(xS(i));return CS(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,l){let a=s.matchFragment(e,r);if(a&&(!n||a.validEnd))return E.from(l.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:f,next:u}=s.next[c];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let d=o(u,l.concat(f));if(d)return d}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:a}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
2
+ `)}}wr.empty=new wr(!0);class mS{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function a0(t){let e=[];do e.push(yS(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function yS(t){let e=[];do e.push(vS(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function vS(t){let e=SS(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=bS(t,e);else break;return e}function Ch(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function bS(t,e){let n=Ch(t),r=n;return t.eat(",")&&(t.next!="}"?r=Ch(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function wS(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function SS(t){if(t.eat("(")){let e=a0(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=wS(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function xS(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=o(s.exprs[a],l);if(a==s.exprs.length-1)return c;i(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let f=n();i(o(s.expr,a),f),a=f}if(s.max==-1)i(o(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let f=n();r(a,f),i(o(s.expr,a),f),a=f}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function c0(t,e){return e-t}function Eh(t,e){let n=[];return r(e),n.sort(c0);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:a}=o[s];!l&&n.indexOf(a)==-1&&r(a)}}}function kS(t){let e=Object.create(null);return n(Eh(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let f=0;f<i.length;f++)i[f][0]==l&&(c=i[f][1]);Eh(t,a).forEach(f=>{c||i.push([l,c=[]]),c.indexOf(f)==-1&&c.push(f)})})});let o=e[r.join(",")]=new wr(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(c0);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function CS(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:a,next:c}=i.next[l];s.push(a.name),o&&!(a.isText||a.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function f0(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function u0(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function d0(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function h0(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new OS(t,r,e[r]);return n}let Oh=class p0{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=h0(e,r.attrs),this.defaultAttrs=f0(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:u0(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new jn(this,this.computeAttrs(e),E.from(n),Z.setFrom(r))}createChecked(e=null,n,r){return n=E.from(n),this.checkContent(n),new jn(this,this.computeAttrs(e),n,Z.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=E.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(E.empty,!0);return o?new jn(this,e,n.append(o),Z.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){d0(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Z.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new p0(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function ES(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class OS{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?ES(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ma{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=h0(e,i.attrs),this.excluded=null;let o=f0(this.attrs);this.instance=o?new Z(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Z(this,u0(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Ma(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){d0(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class AS{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Se.from(e.nodes),n.marks=Se.from(e.marks||{}),this.nodes=Oh.compile(this.spec.nodes,this),this.marks=Ma.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=wr.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?Ah(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Ah(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Oh){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new gl(r,r.defaultAttrs,e,Z.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return jn.fromJSON(this,e)}markFromJSON(e){return Z.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Ah(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let l in t.marks){let a=t.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function TS(t){return t.tag!=null}function MS(t){return t.style!=null}let Ju=class Sf{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(TS(i))this.tags.push(i);else if(MS(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Mh(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Mh(this,n,!0);return r.addAll(e,n.from,n.to),D.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(DS(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Rh(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Rh(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Sf(e,Sf.schemaRules(e)))}};const g0={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},RS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},m0={ol:!0,ul:!0},ml=1,yl=2,eo=4;function Th(t,e,n){return e!=null?(e?ml:0)|(e==="full"?yl:0):t&&t.whitespace=="pre"?ml|yl:n&~eo}class hs{constructor(e,n,r,i,o,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=Z.none,this.stashMarks=[],this.match=s||(l&eo?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(E.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ml)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=E.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(E.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):IS(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!g0.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Mh{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=Th(null,n.preserveWhitespace,0)|(r?eo:0);i?o=new hs(i.type,i.attrs,Z.none,Z.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new hs(null,null,Z.none,Z.none,!0,null,s):o=new hs(e.schema.topNodeType,null,Z.none,Z.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.style;if(!r||!r.length)return n();let i=this.readStyles(e.style);if(!i)return;let[o,s]=i,l=this.top;for(let a=0;a<s.length;a++)this.removePendingMark(s[a],l);for(let a=0;a<o.length;a++)this.addPendingMark(o[a]);n();for(let a=0;a<o.length;a++)this.removePendingMark(o[a],l);for(let a=0;a<s.length;a++)this.addPendingMark(s[a])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&yl||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&ml)r.options&yl?n=n.replace(/\r\n?/g,`
3
+ `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),i;m0.hasOwnProperty(r)&&this.parser.normalizeLists&&NS(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));if(o?o.ignore:RS.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,l=this.top,a=this.needsBlock;if(g0.hasOwnProperty(r))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),s=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
+ `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=Z.none,r=Z.none;if(e.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=e.getPropertyValue(o);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(o,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(c=>{a.clearMark(c)&&(r=c.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)l=a;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let i=0;i<e.marks.length;i++)(!n.type||n.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let i=this.findPlace(e.create(n));return i&&this.enterInner(e,n,!0,r),i}enterInner(e,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=Th(e,i,o.options);o.options&eo&&o.content.length==0&&(s|=eo),this.nodes.push(new hs(e,n,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let f=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!f||f.name!=c&&f.groups.indexOf(c)==-1)return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=PS(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function NS(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&m0.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function DS(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Rh(t){let e={};for(let n in t)e[n]=t[n];return e}function IS(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:f}=l.edge(a);if(c==e||o.indexOf(f)<0&&s(f))return!0}};if(s(i.contentMatch))return!0}}function PS(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class Tr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=rc(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,a=0;for(;l<o.length&&a<s.marks.length;){let c=s.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(o[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<o.length;)i=o.pop()[1];for(;a<s.marks.length;){let c=s.marks[a++],f=this.serializeMark(c,s.isInline,n);f&&(o.push([c,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=js(rc(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&js(rc(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return js(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Tr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Nh(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Nh(e.marks)}}function Nh(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function rc(t){return t.document||window.document}const Dh=new WeakMap;function _S(t){let e=Dh.get(t);return e===void 0&&Dh.set(t,e=LS(t)),e}function LS(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function js(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=_S(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,a=n?t.createElementNS(n,i):t.createElement(i),c=e[1],f=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){f=2;for(let u in c)if(c[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),c[u]):a.setAttribute(u,c[u])}}for(let u=f;u<e.length;u++){let d=e[u];if(d===0){if(u<e.length-1||u>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=js(t,d,n,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const y0=65535,v0=Math.pow(2,16);function $S(t,e){return t+e*v0}function Ih(t){return t&y0}function BS(t){return(t-(t&y0))/v0}const b0=1,w0=2,Vs=4,S0=8;class xf{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&S0)>0}get deletedBefore(){return(this.delInfo&(b0|Vs))>0}get deletedAfter(){return(this.delInfo&(w0|Vs))>0}get deletedAcross(){return(this.delInfo&Vs)>0}}class Je{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Je.empty)return Je.empty}recover(e){let n=0,r=Ih(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+BS(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let c=this.ranges[l+o],f=this.ranges[l+s],u=a+c;if(e<=u){let d=c?e==a?-1:e==u?1:n:n,h=a+i+(d<0?0:f);if(r)return h;let p=e==(n<0?a:u)?null:$S(l/3,e-a),g=e==a?w0:e==u?b0:Vs;return(n<0?e!=a:e!=u)&&(g|=S0),new xf(h,g,p)}i+=f-c}return r?e+i:new xf(e+i,0,null)}touches(e,n){let r=0,i=Ih(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+o],f=a+c;if(e<=f&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),a=s+(this.inverted?0:o),c=this.ranges[i+n],f=this.ranges[i+r];e(l,l+c,a,a+f),o+=f-c}}invert(){return new Je(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Je.empty:new Je(e<0?[0,-e,0]:[0,0,e])}}Je.empty=new Je([]);class Zr{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Zr(this.maps,this.mirror,e,n)}copy(){return new Zr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Zr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],l=s.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new xf(e,i,null)}}const ic=Object.create(null);class Ne{getMap(){return Je.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ic[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in ic)throw new RangeError("Duplicate use of step JSON ID "+e);return ic[e]=n,n.prototype.jsonID=e,n}}class he{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new he(e,null)}static fail(e){return new he(null,e)}static fromReplace(e,n,r,i){try{return he.ok(e.replace(n,r,i))}catch(o){if(o instanceof hl)return he.fail(o.message);throw o}}}function Yu(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Yu(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return E.fromArray(r)}class Ln extends Ne{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new D(Yu(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return he.fromReplace(e,this.from,this.to,o)}invert(){return new Nt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ln(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ln&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ln(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ln(n.from,n.to,e.markFromJSON(n.mark))}}Ne.jsonID("addMark",Ln);class Nt extends Ne{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new D(Yu(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return he.fromReplace(e,this.from,this.to,r)}invert(){return new Ln(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Nt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Nt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Nt(n.from,n.to,e.markFromJSON(n.mark))}}Ne.jsonID("removeMark",Nt);class $n extends Ne{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return he.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return he.fromReplace(e,this.pos,this.pos+1,new D(E.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new $n(this.pos,n.marks[i]);return new $n(this.pos,this.mark)}}return new ai(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new $n(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new $n(n.pos,e.markFromJSON(n.mark))}}Ne.jsonID("addNodeMark",$n);class ai extends Ne{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return he.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return he.fromReplace(e,this.pos,this.pos+1,new D(E.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new $n(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ai(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ai(n.pos,e.markFromJSON(n.mark))}}Ne.jsonID("removeNodeMark",ai);class me extends Ne{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&kf(e,this.from,this.to)?he.fail("Structure replace would overwrite content"):he.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Je([this.from,this.to-this.from,this.slice.size])}invert(e){return new me(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new me(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof me)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?D.empty:new D(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new me(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?D.empty:new D(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new me(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new me(n.from,n.to,D.fromJSON(e,n.slice),!!n.structure)}}Ne.jsonID("replace",me);class ye extends Ne{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(kf(e,this.from,this.gapFrom)||kf(e,this.gapTo,this.to)))return he.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return he.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?he.fromReplace(e,this.from,this.to,r):he.fail("Content does not fit in gap")}getMap(){return new Je([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new ye(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new ye(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ye(n.from,n.to,n.gapFrom,n.gapTo,D.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ne.jsonID("replaceAround",ye);function kf(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function FS(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(a,c,f)=>{if(!a.isInline)return;let u=a.marks;if(!r.isInSet(u)&&f.type.allowsMarkType(r.type)){let d=Math.max(c,e),h=Math.min(c+a.nodeSize,n),p=r.addToSet(u);for(let g=0;g<u.length;g++)u[g].isInSet(p)||(s&&s.to==d&&s.mark.eq(u[g])?s.to=h:i.push(s=new Nt(d,h,u[g])));l&&l.to==d?l.to=h:o.push(l=new Ln(d,h,r))}}),i.forEach(a=>t.step(a)),o.forEach(a=>t.step(a))}function zS(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof Ma){let c=s.marks,f;for(;f=r.isInSet(c);)(a||(a=[])).push(f),c=f.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,n);for(let f=0;f<a.length;f++){let u=a[f],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==o-1&&u.eq(i[h].style)&&(d=p)}d?(d.to=c,d.step=o):i.push({style:u,from:Math.max(l,e),to:c,step:o})}}}),i.forEach(s=>t.step(new Nt(s.from,s.to,s.style)))}function x0(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a<o.childCount;a++){let c=o.child(a),f=l+c.nodeSize,u=r.matchType(c.type);if(!u)s.push(new me(l,f,D.empty));else{r=u;for(let d=0;d<c.marks.length;d++)n.allowsMarkType(c.marks[d].type)||t.step(new Nt(l,f,c.marks[d]));if(i&&c.isText&&n.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(c.text);)p||(p=new D(E.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new me(l+d.index,l+d.index+d[0].length,p))}}l=f}if(!r.validEnd){let a=r.fillBefore(E.empty,!0);t.replace(l,l,new D(a,0,0))}for(let a=s.length-1;a>=0;a--)t.step(s[a])}function jS(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Oi(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!jS(i,o,s))break}return null}function VS(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),a=s,c=l,f=E.empty,u=0;for(let p=o,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,f=E.from(r.node(p).copy(f)),u++):a--;let d=E.empty,h=0;for(let p=o,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,d=E.from(i.node(p).copy(d)),h++):c++;t.step(new ye(a,c,s,l,new D(f.append(d),u,h),f.size-u,!0))}function Xu(t,e,n=null,r=t){let i=HS(t,e),o=i&&WS(r,e);return o?i.map(Ph).concat({type:e,attrs:n}).concat(o.map(Ph)):null}function Ph(t){return{type:t,attrs:null}}function HS(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function WS(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;a&&c<i;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:s}function US(t,e,n){let r=E.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=E.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new ye(i,o,i,o,new D(r,0,0),n.length,!0))}function qS(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&JS(t.doc,t.mapping.slice(o).map(l),r)){let a=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!h?a=!1:!d&&h&&(a=!0)}a===!1&&KS(t,s,l,o),x0(t,t.mapping.slice(o).map(l,1),r,void 0,a===null);let c=t.mapping.slice(o),f=c.map(l,1),u=c.map(l+s.nodeSize,1);return t.step(new ye(f,u,f+1,u-1,new D(E.from(r.create(i,null,s.marks)),0,0),1,!0)),a===!0&&GS(t,s,l,o),!1}})}function GS(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let a=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function KS(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
5
+ `))}})}function JS(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function YS(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new ye(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new D(E.from(s),0,0),1,!0))}function Qu(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,f=n-2;c>o;c--,f--){let u=i.node(c),d=i.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(d,u.childCount),p=r&&r[f+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[f]||u;if(!u.canReplace(d+1,u.childCount)||!g.type.validContent(h))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function XS(t,e,n=1,r){let i=t.doc.resolve(e),o=E.empty,s=E.empty;for(let l=i.depth,a=i.depth-n,c=n-1;l>a;l--,c--){o=E.from(i.node(l).copy(o));let f=r&&r[c];s=E.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new me(e,e,new D(o.append(s),n,n),!0))}function Ai(t,e){let n=t.resolve(e),r=n.index();return k0(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function k0(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Zu(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&k0(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function QS(t,e,n){let r=new me(e-n,e+n,D.empty,!0);t.step(r)}function ZS(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function C0(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),f=!1;if(o==1)f=c.canReplace(a,a,i);else{let u=c.contentMatchAt(a).findWrapping(i.firstChild.type);f=u&&c.canReplaceWith(a,a,u[0])}if(f)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Ra(t,e,n=e,r=D.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return E0(i,o,r)?new me(e,n,r):new ex(i,o,r).fit()}function E0(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class ex{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=E.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=E.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(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new D(o,s,l);return e>-1?new ye(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new me(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=oc(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],f,u=null;if(n==1&&(s?c.matchType(s.type)||(u=c.fillBefore(E.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:u};if(n==2&&s&&(f=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:f};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=oc(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new D(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=oc(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new D(Yi(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new D(Yi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,l=r?r.content:s.content,a=s.openStart-e,c=0,f=[],{match:u,type:d}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)f.push(i.child(g));u=u.matchFragment(i)}let h=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let g=l.child(c),m=u.matchType(g.type);if(!m)break;c++,(c>1||a==0||g.content.size)&&(u=m,f.push(O0(g.mark(d.allowedMarks(g.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=Xi(this.placed,n,E.from(f)),this.frontier[n].match=u,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,m=l;g<h;g++){let v=m.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),m=v.content}this.unplaced=p?e==0?D.empty:new D(Yi(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new D(Yi(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!sc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=sc(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],f=sc(e,l,c,a,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Xi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Xi(this.placed,this.depth,E.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(E.empty,!0);n.childCount&&(this.placed=Xi(this.placed,this.frontier.length,n))}}function Yi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Yi(t.firstChild.content,e-1,n)))}function Xi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Xi(t.lastChild.content,e-1,n)))}function oc(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function O0(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,O0(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(E.empty,!0)))),t.copy(r)}function sc(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!tx(n,o.content,s)?l:null}function tx(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function nx(t){return t.spec.defining||t.spec.definingForContent}function rx(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(E0(i,o,r))return t.step(new me(e,n,r));let s=T0(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let d=i.depth,h=i.pos-1;d>0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?l=d:i.before(d)==h&&s.splice(1,0,-d)}let a=s.indexOf(l),c=[],f=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(c.push(p),h==r.openStart)break;d=p.content}for(let d=f-1;d>=0;d--){let h=c[d],p=nx(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(l)-1)))f=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+f+1)%(r.openStart+1),p=c[h];if(p)for(let g=0;g<s.length;g++){let m=s[(g+a)%s.length],v=!0;m<0&&(v=!1,m=-m);let w=i.node(m-1),S=i.index(m-1);if(w.canReplaceWith(S,S,p.type,p.marks))return t.replace(i.before(m),v?o.after(m):n,new D(A0(r.content,0,r.openStart,h),h,r.openEnd))}}let u=t.steps.length;for(let d=s.length-1;d>=0&&(t.replace(e,n,r),!(t.steps.length>u));d--){let h=s[d];h<0||(e=i.before(h),n=o.after(h))}}function A0(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(A0(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(E.empty,!0))}return t}function ix(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=ZS(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new D(E.from(r),0,0))}function ox(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=T0(r,i);for(let s=0;s<o.length;s++){let l=o[s],a=s==o.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function T0(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class ei extends Ne{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return he.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return he.fromReplace(e,this.pos,this.pos+1,new D(E.from(i),0,n.isLeaf?0:1))}getMap(){return Je.empty}invert(e){return new ei(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ei(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ei(n.pos,n.attr,n.value)}}Ne.jsonID("attr",ei);class wo extends Ne{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return he.ok(r)}getMap(){return Je.empty}invert(e){return new wo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new wo(n.attr,n.value)}}Ne.jsonID("docAttr",wo);let ci=class extends Error{};ci=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};ci.prototype=Object.create(Error.prototype);ci.prototype.constructor=ci;ci.prototype.name="TransformError";class ed{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ci(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=D.empty){let i=Ra(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new D(E.from(r),0,0))}delete(e,n){return this.replace(e,n,D.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return rx(this,e,n,r),this}replaceRangeWith(e,n,r){return ix(this,e,n,r),this}deleteRange(e,n){return ox(this,e,n),this}lift(e,n){return VS(this,e,n),this}join(e,n=1){return QS(this,e,n),this}wrap(e,n){return US(this,e,n),this}setBlockType(e,n=e,r,i=null){return qS(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return YS(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ei(e,n,r)),this}setDocAttribute(e,n){return this.step(new wo(e,n)),this}addNodeMark(e,n){return this.step(new $n(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Z)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new ai(e,n)),this}split(e,n=1,r){return XS(this,e,n,r),this}addMark(e,n,r){return FS(this,e,n,r),this}removeMark(e,n,r){return zS(this,e,n,r),this}clearIncompatible(e,n,r){return x0(this,e,n,r),this}}const lc=Object.create(null);class q{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new td(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=D.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:c}=s[l],f=e.mapping.slice(o);e.replaceRange(f.map(a.pos),f.map(c.pos),l?D.empty:n),l==0&&$h(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],a=e.mapping.slice(r),c=a.map(s.pos),f=a.map(l.pos);o?e.deleteRange(c,f):(e.replaceRangeWith(c,f,n),$h(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new J(e):Ur(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Ur(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Ur(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new st(e.node(0))}static atStart(e){return Ur(e,e,0,0,1)||new st(e)}static atEnd(e){return Ur(e,e,e.content.size,e.childCount,-1)||new st(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=lc[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in lc)throw new RangeError("Duplicate use of selection JSON ID "+e);return lc[e]=n,n.prototype.jsonID=e,n}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}}q.prototype.visible=!0;class td{constructor(e,n){this.$from=e,this.$to=n}}let _h=!1;function Lh(t){!_h&&!t.parent.inlineContent&&(_h=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class J extends q{constructor(e,n=e){Lh(e),Lh(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return q.near(r);let i=e.resolve(n.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(e,n=D.empty){if(super.replace(e,n),n==D.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof J&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Na(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new J(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=q.findFrom(n,r,!0)||q.findFrom(n,-r,!0);if(o)n=o.$head;else return q.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(q.findFrom(e,-r,!0)||q.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new J(e,n)}}q.jsonID("text",J);class Na{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Na(e.map(this.anchor),e.map(this.head))}resolve(e){return J.between(e.resolve(this.anchor),e.resolve(this.head))}}class j extends q{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?q.near(o):new j(o)}content(){return new D(E.from(this.node),0,0)}eq(e){return e instanceof j&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new nd(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new j(e.resolve(n.anchor))}static create(e,n){return new j(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}j.prototype.visible=!1;q.jsonID("node",j);class nd{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Na(r,r):new nd(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&j.isSelectable(r)?new j(n):q.near(n)}}class st extends q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=D.empty){if(n==D.empty){e.delete(0,e.doc.content.size);let r=q.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new st(e)}map(e){return new st(e)}eq(e){return e instanceof st}getBookmark(){return sx}}q.jsonID("all",st);const sx={map(){return this},resolve(t){return new st(t)}};function Ur(t,e,n,r,i,o=!1){if(e.inlineContent)return J.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&j.isSelectable(l))return j.create(t,n-(i<0?l.nodeSize:0))}else{let a=Ur(t,l,n+i,i<0?l.childCount:0,i,o);if(a)return a}n+=l.nodeSize*i}return null}function $h(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof me||i instanceof ye))return;let o=t.mapping.maps[r],s;o.forEach((l,a,c,f)=>{s==null&&(s=f)}),t.setSelection(q.near(t.doc.resolve(s),n))}const Bh=1,ps=2,Fh=4;let lx=class extends ed{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Bh)&~ps,this.storedMarks=null,this}get selectionSet(){return(this.updated&Bh)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ps,this}ensureMarks(e){return Z.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&ps)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ps,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Z.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(q.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Fh,this}get scrolledIntoView(){return(this.updated&Fh)>0}};function zh(t,e){return!e||!t?t:t.bind(e)}class Qi{constructor(e,n,r){this.name=e,this.init=zh(n.init,r),this.apply=zh(n.apply,r)}}const ax=[new Qi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Qi("selection",{init(t,e){return t.selection||q.atStart(e.doc)},apply(t){return t.selection}}),new Qi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Qi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class ac{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ax.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Qi(r.key,r.spec.state,r))})}}class Xr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let a=i?i[s].n:0,c=i?i[s].state:this,f=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(f&&r.filterTransaction(f,s)){if(f.setMeta("appendedTransaction",e),!i){i=[];for(let u=0;u<this.config.plugins.length;u++)i.push(u<s?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Xr(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new lx(this)}static create(e){let n=new ac(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Xr(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new ac(this.schema,e.plugins),r=n.fields,i=new Xr(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new ac(e.schema,e.plugins),o=new Xr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=jn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=q.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=c.fromJSON.call(a,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function M0(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=M0(i,e,{})),n[r]=i}return n}class Mr{constructor(e){this.spec=e,this.props={},e.props&&M0(e.props,this,this.props),this.key=e.key?e.key.key:R0("plugin")}getState(e){return e[this.key]}}const cc=Object.create(null);function R0(t){return t in cc?t+"$"+ ++cc[t]:(cc[t]=0,t+"$")}class pn{constructor(e="key"){this.key=R0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const xe=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},So=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Cf=null;const tn=function(t,e,n){let r=Cf||(Cf=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},cx=function(){Cf=null},Sr=function(t,e,n,r){return n&&(jh(t,e,n,r,-1)||jh(t,e,n,r,1))},fx=/^(img|br|input|textarea|hr)$/i;function jh(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Mt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Go(t)||fx.test(t.nodeName)||t.contentEditable=="false")return!1;e=xe(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Mt(t):0}else return!1}}function Mt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ux(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Mt(t)}else if(t.parentNode&&!Go(t))e=xe(t),t=t.parentNode;else return null}}function dx(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Go(t))e=xe(t)+1,t=t.parentNode;else return null}}function hx(t,e,n){for(let r=e==0,i=e==Mt(t);r||i;){if(t==n)return!0;let o=xe(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Mt(t)}}function Go(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Da=function(t){return t.focusNode&&Sr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ar(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function px(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function gx(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Lt=typeof navigator<"u"?navigator:null,Vh=typeof document<"u"?document:null,Qn=Lt&&Lt.userAgent||"",Ef=/Edge\/(\d+)/.exec(Qn),N0=/MSIE \d/.exec(Qn),Of=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qn),We=!!(N0||Of||Ef),Vn=N0?document.documentMode:Of?+Of[1]:Ef?+Ef[1]:0,vt=!We&&/gecko\/(\d+)/i.test(Qn);vt&&+(/Firefox\/(\d+)/.exec(Qn)||[0,0])[1];const Af=!We&&/Chrome\/(\d+)/.exec(Qn),Te=!!Af,D0=Af?+Af[1]:0,_e=!We&&!!Lt&&/Apple Computer/.test(Lt.vendor),fi=_e&&(/Mobile\/\w+/.test(Qn)||!!Lt&&Lt.maxTouchPoints>2),it=fi||(Lt?/Mac/.test(Lt.platform):!1),mx=Lt?/Win/.test(Lt.platform):!1,gt=/Android \d/.test(Qn),Ko=!!Vh&&"webkitFontSmoothing"in Vh.documentElement.style,yx=Ko?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function vx(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Jt(t,e){return typeof t=="number"?t:t[e]}function bx(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Hh(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=So(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,c=a?vx(o):bx(l),f=0,u=0;if(e.top<c.top+Jt(r,"top")?u=-(c.top-e.top+Jt(i,"top")):e.bottom>c.bottom-Jt(r,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+Jt(i,"top")-c.top:e.bottom-c.bottom+Jt(i,"bottom")),e.left<c.left+Jt(r,"left")?f=-(c.left-e.left+Jt(i,"left")):e.right>c.right-Jt(r,"right")&&(f=e.right-c.right+Jt(i,"right")),f||u)if(a)o.defaultView.scrollBy(f,u);else{let d=l.scrollLeft,h=l.scrollTop;u&&(l.scrollTop+=u),f&&(l.scrollLeft+=f);let p=l.scrollLeft-d,g=l.scrollTop-h;e={left:e.left-p,top:e.top-g,right:e.right-p,bottom:e.bottom-g}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function wx(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(o,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:I0(t.dom)}}function I0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=So(r));return e}function Sx({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;P0(n,r==0?0:r-e)}function P0(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Lr=null;function xx(t){if(t.setActive)return t.setActive();if(Lr)return t.focus(Lr);let e=I0(t);t.focus(Lr==null?{get preventScroll(){return Lr={preventScroll:!0},!0}}:void 0),Lr||(Lr=!1,P0(e,0))}function _0(t,e){let n,r=2e8,i,o=0,s=e.top,l=e.top,a,c;for(let f=t.firstChild,u=0;f;f=f.nextSibling,u++){let d;if(f.nodeType==1)d=f.getClientRects();else if(f.nodeType==3)d=tn(f).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[h];if(p.top<=s&&p.bottom>=l){s=Math.max(p.bottom,s),l=Math.min(p.top,l);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=f,r=g,i=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,f.nodeType==1&&g&&(o=u+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=f,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=u+1)}}return!n&&a&&(n=a,i=c,r=0),n&&n.nodeType==3?kx(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:_0(n,i)}function kx(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=En(r,1);if(o.top!=o.bottom&&rd(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function rd(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Cx(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Ex(t,e,n){let{node:r,offset:i}=_0(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function Ox(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?i=l.posBefore:(!s&&a.right<r.left||a.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText)return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter}o=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function L0(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let l=s.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(rd(e,c))return L0(s,e,c)}}if((o=(o+1)%r)==i)break}return t}function Ax(t,e){let n=t.dom.ownerDocument,r,i=0,o=gx(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!rd(e,c)||(s=L0(t.dom,e,c),!s))return null}if(_e)for(let c=s;r&&c;c=So(c))c.draggable&&(r=void 0);if(s=Cx(s,e),r){if(vt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let f=r.childNodes[i],u;f.nodeName=="IMG"&&(u=f.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++}let c;Ko&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=Ox(t,r,i,e))}l==null&&(l=Ex(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Wh(t){return t.top<t.bottom||t.left<t.right}function En(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Wh(r))return r}return Array.prototype.find.call(n,Wh)||t.getBoundingClientRect()}const Tx=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function $0(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Ko||vt;if(r.nodeType==3)if(s&&(Tx.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=En(tn(r,i,i),n);if(vt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=En(tn(r,i-1,i-1),-1);if(c.top==a.top){let f=En(tn(r,i,i+1),-1);if(f.top!=a.top)return ji(f,f.left<c.left)}}return a}else{let a=i,c=i,f=n<0?1:-1;return n<0&&!i?(c++,f=-1):n>=0&&i==r.nodeValue.length?(a--,f=1):n<0?a--:c++,ji(En(tn(r,a,c),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Mt(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return fc(a.getBoundingClientRect(),!1)}if(o==null&&i<Mt(r)){let a=r.childNodes[i];if(a.nodeType==1)return fc(a.getBoundingClientRect(),!0)}return fc(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Mt(r))){let a=r.childNodes[i-1],c=a.nodeType==3?tn(a,Mt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return ji(En(c,1),!1)}if(o==null&&i<Mt(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?tn(a,0,s?0:1):a.nodeType==1?a:null:null;if(c)return ji(En(c,-1),!0)}return ji(En(r.nodeType==3?tn(r):r,-n),n>=0)}function ji(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function fc(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function B0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function Mx(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return B0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=$0(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=tn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let f=a[c];if(f.bottom>f.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}const Rx=/[\u0590-\u08ac]/;function Nx(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!Rx.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:B0(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:f,anchorOffset:u}=t.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),m=p&&!h.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==g;try{l.collapse(f,u),a&&(a!=f||c!=u)&&l.extend&&l.extend(a,c)}catch{}return d!=null&&(l.caretBidiLevel=d),m}):r.pos==r.start()||r.pos==r.end()}let Uh=null,qh=null,Gh=!1;function Dx(t,e,n){return Uh==e&&qh==n?Gh:(Uh=e,qh=n,Gh=n=="up"||n=="down"?Mx(t,e,n):Nx(t,e,n))}const lt=0,Kh=1,cr=2,$t=3;class Jo{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=lt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>xe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],l=o+s.size;if(l>e||s instanceof z0){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof F0&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?xe(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?xe(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,l=0;;l++){let a=this.children[l],c=s+a.size;if(i==-1&&e<=c){let f=s+a.border;if(e>=f&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,f);e=s;for(let u=l;u>0;u--){let d=this.children[u-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=xe(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||l==this.children.length-1)){n=c;for(let f=l+1;f<this.children.length;f++){let u=this.children[f];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){o=xe(u.dom);break}n+=u.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let d=0,h=0;d<this.children.length;d++){let p=this.children[d],g=h+p.size;if(o>h&&s<g)return p.setSelection(e-h-p.border,n-h-p.border,r,i);h=g}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.getSelection(),f=!1;if((vt||_e)&&e==n){let{node:d,offset:h}=l;if(d.nodeType==3){if(f=!!(h&&d.nodeValue[h-1]==`
6
+ `),f&&h==d.nodeValue.length)for(let p=d,g;p;p=p.parentNode){if(g=p.nextSibling){g.nodeName=="BR"&&(l=a={node:g.parentNode,offset:xe(g)+1});break}let m=p.pmViewDesc;if(m&&m.node&&m.node.isBlock)break}}else{let p=d.childNodes[h-1];f=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(vt&&c.focusNode&&c.focusNode!=a.node&&c.focusNode.nodeType==1){let d=c.focusNode.childNodes[c.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||f&&_e)&&Sr(l.node,l.offset,c.anchorNode,c.anchorOffset)&&Sr(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((c.extend||e==n)&&!f){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),u=!0}catch{}}if(!u){if(e>n){let h=l;l=a,a=h}let d=document.createRange();d.setEnd(a.node,a.offset),d.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+o.border,a=s-o.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?cr:Kh,e==l&&n==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=$t:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?cr:$t}r=s}this.dirty=cr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?cr:Kh;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class F0 extends Jo{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==lt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ix extends Jo{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class xr extends Jo{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Tr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new xr(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&$t||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=$t&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=lt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=lt}}slice(e,n,r){let i=xr.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Rf(o,n,s,r)),e>0&&(o=Rf(o,0,e,r));for(let l=0;l<o.length;l++)o[l].parent=i;return i.children=o,i}}class Hn extends Jo{constructor(e,n,r,i,o,s,l,a,c){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,o,s){let l=o.nodeViews[n.type.name],a,c=l&&l(n,o,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),f=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:u}=Tr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let d=f;return f=H0(f,r,n),c?a=new Px(e,n,r,i,f,u||null,d,c,o,s+1):n.isText?new Ia(e,n,r,i,f,d,o):new Hn(e,n,r,i,f,u||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>E.empty)}return e}matchesNode(e,n,r){return this.dirty==lt&&e.eq(this.node)&&Mf(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new Lx(this,s&&s.node,e);Fx(this.node,this.innerDeco,(c,f,u)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!u&&a.syncToMarks(f==this.node.childCount?Z.none:this.node.child(f).marks,r,e),a.placeWidget(c,e,i)},(c,f,u,d)=>{a.syncToMarks(c.marks,r,e);let h;a.findNodeMatch(c,f,u,d)||l&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(h=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(c,f,u,h,e)||a.updateNextNode(c,f,u,e,d,i)||a.addNode(c,f,u,e,i),i+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==cr)&&(s&&this.protectLocalComposition(e,s),j0(this.contentDOM,this.children,e),fi&&zx(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof J)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=jx(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Ix(this,o,n,i);e.input.compositionNodes.push(s),this.children=Rf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==$t||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=lt}updateOuterDeco(e){if(Mf(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=V0(this.dom,this.nodeDOM,Tf(this.outerDeco,this.node,n),Tf(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Jh(t,e,n,r,i){H0(r,e,t);let o=new Hn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Ia extends Hn{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==$t||this.dirty!=lt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=lt||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=lt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Ia(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=$t)}get domAtom(){return!1}isText(e){return this.node.text==e}}class z0 extends Jo{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==lt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Px extends Hn{constructor(e,n,r,i,o,s,l,a,c,f){super(e,n,r,i,o,s,l,c,f),this.spec=a}update(e,n,r,i){if(this.dirty==$t)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function j0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=Yh(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof xr){let a=r?r.previousSibling:t.lastChild;j0(s.contentDOM,s.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=Yh(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const to=function(t){t&&(this.nodeName=t)};to.prototype=Object.create(null);const fr=[new to];function Tf(t,e,n){if(t.length==0)return fr;let r=n?fr[0]:new to,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new to(s.nodeName));for(let l in s){let a=s[l];a!=null&&(n&&i.length==1&&i.push(r=new to(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return i}function V0(t,e,n,r){if(n==fr&&r==fr)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let a;l&&l.nodeName==s.nodeName&&i!=t&&(a=i.parentNode)&&a.nodeName.toLowerCase()==s.nodeName||(a=document.createElement(s.nodeName),a.pmIsDeco=!0,a.appendChild(i),l=fr[0]),i=a}_x(i,l||fr[0],s)}return i}function _x(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function H0(t,e,n){return V0(t,t,fr,Tf(e,n,t.nodeType!=1))}function Mf(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Yh(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Lx{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=$x(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=lt,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let c=this.top.children[a];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=xr.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==$t&&s.dom==s.contentDOM&&(s.dirty=cr),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof Hn){let c=this.preMatch.matched.get(a);if(c!=null&&c!=o)return!1;let f=a.dom,u,d=this.isLocked(f)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=$t&&Mf(n,a.outerDeco));if(!d&&a.update(e,n,r,i))return this.destroyBetween(this.index,l),a.dom!=f&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(a,e,n,r,i,s)))return this.top.children[this.index]=u,u.contentDOM&&(u.dirty=cr,u.updateChildren(i,s+1),u.dirty=lt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let l=Hn.create(this.top,n,r,i,o,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,i,o){let s=Hn.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new F0(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof xr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ia)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((_e||Te)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new z0(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function $x(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof xr)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function Bx(t,e){return t.type.side-e.type.side}function Fx(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let f=t.child(c);r(f,i,e.forChild(o,f),c),o+=f.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let f,u;for(;s<i.length&&i[s].to==o;){let m=i[s++];m.widget&&(f?(u||(u=[f])).push(m):f=m)}if(f)if(u){u.sort(Bx);for(let m=0;m<u.length;m++)n(u[m],c,!!a)}else n(f,c,!!a);let d,h;if(a)h=-1,d=a,a=null;else if(c<t.childCount)h=c,d=t.child(c++);else break;for(let m=0;m<l.length;m++)l[m].to<=o&&l.splice(m--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let m=p;s<i.length&&i[s].from<m&&(m=i[s].from);for(let v=0;v<l.length;v++)l[v].to<m&&(m=l[v].to);m<p&&(a=d.cut(m-o),d=d.cut(0,m-o),p=m,h=-1)}else for(;s<i.length&&i[s].to<p;)s++;let g=d.isInline&&!d.isLeaf?l.filter(m=>!m.inline):l.slice();r(d,g,e.forChild(o,d),h),o=p}}function zx(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function jx(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;a+=c.text}if(o>=n){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Rf(t,e,n,r,i){let o=[];for(let s=0,l=0;s<t.length;s++){let a=t[s],c=l,f=l+=a.size;c>=n||f<=e?o.push(a):(c<e&&o.push(a.slice(0,e-c,r)),i&&(o.push(i),i=void 0),f>n&&o.push(a.slice(n-c,a.size,r)))}return o}function id(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(Da(n)){for(a=l;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&j.isSelectable(f)&&i.parent&&!(f.isInline&&hx(n.focusNode,n.focusOffset,i.dom))){let u=i.posBefore;c=new j(s==u?l:r.resolve(u))}}else{let f=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;a=r.resolve(f)}if(!c){let f=e=="pointer"||t.state.selection.head<l.pos&&!o?1:-1;c=od(t,a,l,f)}return c}function W0(t){return t.editable?t.hasFocus():q0(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function sn(t,e=!1){let n=t.state.selection;if(U0(t,n),!!W0(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Te){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Sr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Hx(t);else{let{anchor:r,head:i}=n,o,s;Xh&&!(n instanceof J)&&(n.$from.parent.inlineContent||(o=Qh(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Qh(t,n.to))),t.docView.setSelection(r,i,t.root,e),Xh&&(o&&Zh(o),s&&Zh(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Vx(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Xh=_e||Te&&D0<63;function Qh(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(_e&&i&&i.contentEditable=="false")return uc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return uc(i);if(o)return uc(o)}}function uc(t){return t.contentEditable="true",_e&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Zh(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Vx(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!W0(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Hx(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,xe(r)+1):n.setStart(r,0);let o=t.state.selection;if(o.empty)n.collapse(!0);else{let s=t.domAtPos(o.to);n.setEnd(s.node,s.offset)}e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&We&&Vn<=11&&(r.disabled=!0,r.disabled=!1)}function U0(t,e){if(e instanceof j){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(ep(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else ep(t)}function ep(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function od(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||J.between(e,n,r)}function tp(t){return t.editable&&!t.hasFocus()?!1:q0(t)}function q0(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Wx(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Sr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Nf(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&q.findFrom(o,e)}function On(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function np(t,e,n){let r=t.state.selection;if(r instanceof J)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return On(t,new J(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Nf(t.state,e);return i&&i instanceof j?On(t,i):!1}else if(!(it&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?j.isSelectable(o)?On(t,new j(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Ko?On(t,new J(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof j&&r.node.isInline)return On(t,new J(e>0?r.$to:r.$from));{let i=Nf(t.state,e);return i?On(t,i):!1}}}function vl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function no(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function $r(t,e){return e<0?Ux(t):qx(t)}function Ux(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(vt&&n.nodeType==1&&r<vl(n)&&no(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(no(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(G0(n))break;{let l=n.previousSibling;for(;l&&no(l,-1);)i=n.parentNode,o=xe(l),l=l.previousSibling;if(l)n=l,r=vl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Df(t,n,r):i&&Df(t,i,o)}function qx(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=vl(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(no(l,1))o=n,s=++r;else break}else{if(G0(n))break;{let l=n.nextSibling;for(;l&&no(l,1);)o=l.parentNode,s=xe(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=vl(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Df(t,o,s)}function G0(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Gx(t,e){for(;t&&e==t.childNodes.length&&!Go(t);)e=xe(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Kx(t,e){for(;t&&!e&&!Go(t);)e=xe(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Df(t,e,n){if(e.nodeType!=3){let o,s;(s=Gx(e,n))?(e=s,n=0):(o=Kx(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Da(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&sn(t)},50)}function rp(t,e){let n=t.state.doc.resolve(e);if(!(Te||mx)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function ip(t,e,n){let r=t.state.selection;if(r instanceof J&&!r.empty||n.indexOf("s")>-1||it&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Nf(t.state,e);if(s&&s instanceof j)return On(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof st?q.near(s,e):q.findFrom(s,e);return l?On(t,l):!1}return!1}function op(t,e){if(!(t.state.selection instanceof J))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function sp(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Jx(t){if(!_e||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;sp(t,r,"true"),setTimeout(()=>sp(t,r,"false"),20)}return!1}function Yx(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Xx(t,e){let n=e.keyCode,r=Yx(e);if(n==8||it&&n==72&&r=="c")return op(t,-1)||$r(t,-1);if(n==46&&!e.shiftKey||it&&n==68&&r=="c")return op(t,1)||$r(t,1);if(n==13||n==27)return!0;if(n==37||it&&n==66&&r=="c"){let i=n==37?rp(t,t.state.selection.from)=="ltr"?-1:1:-1;return np(t,i,r)||$r(t,i)}else if(n==39||it&&n==70&&r=="c"){let i=n==39?rp(t,t.state.selection.from)=="ltr"?1:-1:1;return np(t,i,r)||$r(t,i)}else{if(n==38||it&&n==80&&r=="c")return ip(t,-1,r)||$r(t,-1);if(n==40||it&&n==78&&r=="c")return Jx(t)||ip(t,1,r)||$r(t,1);if(r==(it?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function K0(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||Tr.fromSchema(t.state.schema),l=ev(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,f,u=0;for(;c&&c.nodeType==1&&(f=Z0[c.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let p=l.createElement(f[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),u++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
7
+
8
+ `);return{dom:a,text:d,slice:e}}function J0(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=e&&(r||o||!n);if(a){if(t.someProp("transformPastedText",d=>{e=d(e,o||r,t)}),o)return e?new D(E.from(t.state.schema.text(e.replace(/\r\n?/g,`
9
+ `))),0,0):D.empty;let u=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(u)l=u;else{let d=i.marks(),{schema:h}=t.state,p=Tr.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=s.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(h.text(g,d)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),s=ek(n),Ko&&tk(s);let c=s&&s.querySelector("[data-pm-slice]"),f=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let u=+f[3];u>0;u--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Ju.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||f),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!Qx.test(d.parentNode.nodeName)?{ignore:!0}:null}})),f)l=nk(lp(l,+f[1],+f[2]),f[4]);else if(l=D.maxOpen(Zx(l.content,i),!0),l.openStart||l.openEnd){let u=0,d=0;for(let h=l.content.firstChild;u<l.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=l.content.lastChild;d<l.openEnd&&!h.type.spec.isolating;d++,h=h.lastChild);l=lp(l,u,d)}return t.someProp("transformPasted",u=>{l=u(l,t)}),l}const Qx=/^(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 Zx(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&o.length&&X0(a,o,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Q0(s[s.length-1],o.length));let f=Y0(l,a);s.push(f),i=i.matchType(f.type),o=a}}),s)return E.from(s)}return t}function Y0(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,E.from(t));return t}function X0(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=X0(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(E.from(Y0(n,t,i+1))))}}function Q0(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Q0(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(E.empty,!0);return t.copy(n.append(r))}function If(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(o=0),i<r-1&&(l=If(l,e,n,r,i+1,o)),i>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(E.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function lp(t,e,n){return e<t.openStart&&(t=new D(If(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new D(If(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Z0={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ap=null;function ev(){return ap||(ap=document.implementation.createHTMLDocument("title"))}function ek(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=ev().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Z0[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=t,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function tk(t){let e=t.querySelectorAll(Te?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function nk(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=E.from(a.create(r[l+1],i)),o++,s++}return new D(i,o,s)}const Le={},$e={},rk={touchstart:!0,touchmove:!0};class ik{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function ok(t){for(let e in Le){let n=Le[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{lk(t,r)&&!sd(t,r)&&(t.editable||!(r.type in $e))&&n(t,r)},rk[e]?{passive:!0}:void 0)}_e&&t.dom.addEventListener("input",()=>null),Pf(t)}function Bn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function sk(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Pf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>sd(t,r))})}function sd(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function lk(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function ak(t,e){!sd(t,e)&&Le[e.type]&&(t.editable||!(e.type in $e))&&Le[e.type](t,e)}$e.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!nv(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(gt&&Te&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),fi&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,ar(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Xx(t,n)?n.preventDefault():Bn(t,"key")};$e.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};$e.keypress=(t,e)=>{let n=e;if(nv(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||it&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof J)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Pa(t){return{left:t.clientX,top:t.clientY}}function ck(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function ld(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ti(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function fk(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&j.isSelectable(r)?(ti(t,new j(n)),!0):!1}function uk(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof j&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(j.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(ti(t,j.create(t.state.doc,i)),!0):!1}function dk(t,e,n,r,i){return ld(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?uk(t,n):fk(t,n))}function hk(t,e,n,r){return ld(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function pk(t,e,n,r){return ld(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||gk(t,n,r)}function gk(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ti(t,J.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)ti(t,J.create(r,l+1,l+1+s.content.size));else if(j.isSelectable(s))ti(t,j.create(r,l));else continue;return!0}}function ad(t){return bl(t)}const tv=it?"metaKey":"ctrlKey";Le.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=ad(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&ck(n,t.input.lastClick)&&!n[tv]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Pa(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new mk(t,s,n,!!r)):(o=="doubleClick"?hk:pk)(t,s.pos,s.inside,n)?n.preventDefault():Bn(t,"pointer"))};class mk{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[tv],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof j&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&vt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Bn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>sn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Pa(e))),this.updateAllowDefault(e),this.allowDefault||!n?Bn(this.view,"pointer"):dk(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||_e&&this.mightDrag&&!this.mightDrag.node.isAtom||Te&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ti(this.view,q.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Bn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Bn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Le.touchstart=t=>{t.input.lastTouch=Date.now(),ad(t),Bn(t,"pointer")};Le.touchmove=t=>{t.input.lastTouch=Date.now(),Bn(t,"pointer")};Le.contextmenu=t=>ad(t);function nv(t,e){return t.composing?!0:_e&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const yk=gt?5e3:-1;$e.compositionstart=$e.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof J&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),bl(t,!0),t.markCursor=null;else if(bl(t),vt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}rv(t,yk)};$e.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,rv(t,20))};function rv(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>bl(t),e))}function iv(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=bk());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function vk(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=ux(e.focusNode,e.focusOffset),r=dx(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function bk(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function bl(t,e=!1){if(!(gt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),iv(t),e||t.docView&&t.docView.dirty){let n=id(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function wk(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const xo=We&&Vn<15||fi&&yx<604;Le.copy=$e.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=xo?null:n.clipboardData,s=r.content(),{dom:l,text:a}=K0(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):wk(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Sk(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function xk(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ko(t,r.value,null,i,e):ko(t,r.textContent,r.innerHTML,i,e)},50)}function ko(t,e,n,r,i){let o=J0(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,i,o||D.empty)))return!0;if(!o)return!1;let s=Sk(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ov(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}$e.paste=(t,e)=>{let n=e;if(t.composing&&!gt)return;let r=xo?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ko(t,ov(r),r.getData("text/html"),i,n)?n.preventDefault():xk(t,n)};class sv{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const lv=it?"altKey":"ctrlKey";Le.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Pa(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof j?i.to-1:i.to))){if(r&&r.mightDrag)s=j.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=t.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(s=j.create(t.state.doc,u.posBefore))}}let l=(s||t.state.selection).content(),{dom:a,text:c,slice:f}=K0(t,l);(!n.dataTransfer.files.length||!Te||D0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(xo?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",xo||n.dataTransfer.setData("text/plain",c),t.dragging=new sv(f,!n[lv],s)};Le.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};$e.dragover=$e.dragenter=(t,e)=>e.preventDefault();$e.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Pa(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=J0(t,ov(n.dataTransfer),xo?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[lv]);if(t.someProp("handleDrop",p=>p(t,n,s||D.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?C0(t.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let c=t.state.tr;if(l){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let f=c.mapping.map(a),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(f,f,s.content.firstChild):c.replaceRange(f,f,s),c.doc.eq(d))return;let h=c.doc.resolve(f);if(u&&j.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new j(h));else{let p=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((g,m,v,w)=>p=w),c.setSelection(od(t,h,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};Le.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&sn(t)},20))};Le.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Le.beforeinput=(t,e)=>{if(Te&&gt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,ar(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in $e)Le[t]=$e[t];function Co(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class wl{constructor(e,n){this.toDOM=e,this.spec=n||pr,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Pe(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof wl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Co(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Wn{constructor(e,n){this.attrs=e,this.spec=n||pr}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Pe(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Wn&&Co(this.attrs,e.attrs)&&Co(this.spec,e.spec)}static is(e){return e.type instanceof Wn}destroy(){}}class cd{constructor(e,n){this.attrs=e,this.spec=n||pr}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Pe(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof cd&&Co(this.attrs,e.attrs)&&Co(this.spec,e.spec)}destroy(){}}class Pe{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Pe(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Pe(e,e,new wl(n,r))}static inline(e,n,r,i){return new Pe(e,n,new Wn(r,i))}static node(e,n,r,i){return new Pe(e,n,new cd(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Wn}get widget(){return this.type instanceof wl}}const qr=[],pr={};class ae{constructor(e,n){this.local=e.length?e:qr,this.children=n.length?n:qr}static create(e,n){return n.length?Sl(n,e,0,pr):Ae}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==Ae||e.maps.length==0?this:this.mapInner(e,n,0,0,r||pr)}mapInner(e,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,i);a&&a.type.valid(n,a)?(s||(s=[])).push(a):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?kk(this.children,s||[],e,n,r,i,o):s?new ae(s.sort(gr),qr):Ae}add(e,n){return n.length?this==Ae?ae.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((l,a)=>{let c=a+r,f;if(f=cv(n,l,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(l,f,c+1):i.splice(o,0,a,a+l.nodeSize,Sl(f,l,c+1,pr)),o+=3}});let s=av(o?fv(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new ae(s.length?this.local.concat(s).sort(gr):this.local,i||this.children)}remove(e){return e.length==0||this==Ae?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,l=r[o]+n,a=r[o+1]+n;for(let f=0,u;f<e.length;f++)(u=e[f])&&u.from>l&&u.to<a&&(e[f]=null,(s||(s=[])).push(u));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,l+1);c!=Ae?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ae(i,r):Ae}forChild(e,n){if(this==Ae)return this;if(n.isLeaf)return ae.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<s&&a.to>o&&a.type instanceof Wn){let c=Math.max(o,a.from)-o,f=Math.min(s,a.to)-o;c<f&&(i||(i=[])).push(a.copy(c,f))}}if(i){let l=new ae(i.sort(gr),qr);return r?new Dn([l,r]):l}return r||Ae}eq(e){if(this==e)return!0;if(!(e instanceof ae)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return fd(this.localsInner(e))}localsInner(e){if(this==Ae)return qr;if(e.inlineContent||!this.local.some(Wn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Wn||n.push(this.local[r]);return n}}ae.empty=new ae([],[]);ae.removeOverlap=fd;const Ae=ae.empty;class Dn{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,pr));return Dn.from(r)}forChild(e,n){if(n.isLeaf)return ae.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=Ae&&(o instanceof Dn?r=r.concat(o.members):r.push(o))}return Dn.from(r)}eq(e){if(!(e instanceof Dn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?fd(r?n:n.sort(gr)):qr}static from(e){switch(e.length){case 0:return Ae;case 1:return e[0];default:return new Dn(e.every(n=>n instanceof ae)?e:e.reduce((n,r)=>n.concat(r instanceof ae?r:r.members),[]))}}}function kk(t,e,n,r,i,o,s){let l=t.slice();for(let c=0,f=o;c<n.maps.length;c++){let u=0;n.maps[c].forEach((d,h,p,g)=>{let m=g-p-(h-d);for(let v=0;v<l.length;v+=3){let w=l[v+1];if(w<0||d>w+f-u)continue;let S=l[v]+f-u;h>=S?l[v+1]=d<=S?-2:-1:d>=f&&m&&(l[v]+=m,l[v+1]+=m)}u+=m}),f=n.maps[c].map(f,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let f=n.map(t[c]+o),u=f-i;if(u<0||u>=r.content.size){a=!0;continue}let d=n.map(t[c+1]+o,-1),h=d-i,{index:p,offset:g}=r.content.findIndex(u),m=r.maybeChild(p);if(m&&g==u&&g+m.nodeSize==h){let v=l[c+2].mapInner(n,m,f+1,t[c]+o+1,s);v!=Ae?(l[c]=u,l[c+1]=h,l[c+2]=v):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Ck(l,t,e,n,i,o,s),f=Sl(c,r,0,s);e=f.local;for(let u=0;u<l.length;u+=3)l[u+1]<0&&(l.splice(u,3),u-=3);for(let u=0,d=0;u<f.children.length;u+=3){let h=f.children[u];for(;d<l.length&&l[d]<h;)d+=3;l.splice(d,0,f.children[u],f.children[u+1],f.children[u+2])}}return new ae(e.sort(gr),l)}function av(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Pe(i.from+e,i.to+e,i.type))}return n}function Ck(t,e,n,r,i,o,s){function l(a,c){for(let f=0;f<a.local.length;f++){let u=a.local[f].map(r,i,c);u?n.push(u):s.onRemove&&s.onRemove(a.local[f].spec)}for(let f=0;f<a.children.length;f+=3)l(a.children[f+2],a.children[f]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+o+1);return n}function cv(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function fv(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Sl(t,e,n,r){let i=[],o=!1;e.forEach((l,a)=>{let c=cv(t,l,a+n);if(c){o=!0;let f=Sl(c,l,n+a+1,r);f!=Ae&&i.push(a,a+l.nodeSize,f)}});let s=av(o?fv(t):t,-n).sort(gr);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new ae(s,i):Ae}function gr(t,e){return t.from-e.from||t.to-e.to}function fd(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),cp(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),cp(e,i,r.copy(o.from,r.to)));break}}}return e}function cp(t,e,n){for(;e<t.length&&gr(n,t[e])>0;)e++;t.splice(e,0,n)}function dc(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ae&&e.push(r)}),t.cursorWrapper&&e.push(ae.create(t.state.doc,[t.cursorWrapper.deco])),Dn.from(e)}const Ek={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ok=We&&Vn<=11;class Ak{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 Tk{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ak,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);We&&Vn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Ok&&(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,Ek)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(tp(this.view)){if(this.suppressingSelectionUpdates)return sn(this.view);if(We&&Vn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Sr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=So(o))n.add(o);for(let o=e.anchorNode;o;o=So(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&tp(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let f=0;f<n.length;f++){let u=this.registerMutation(n[f],a);u&&(o=o<0?u.from:Math.min(u.from,o),s=s<0?u.to:Math.max(u.to,s),u.typeOver&&(l=!0))}if(vt&&a.length){let f=a.filter(u=>u.nodeName=="BR");if(f.length==2){let[u,d]=f;u.parentNode&&u.parentNode.parentNode==d.parentNode?d.remove():u.remove()}else{let{focusNode:u}=this.currentSelection;for(let d of f){let h=d.parentNode;h&&h.nodeName=="LI"&&(!u||Nk(e,u)!=h)&&d.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Da(r)&&(c=id(e))&&c.eq(q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,sn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Mk(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||sn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;f<e.addedNodes.length;f++){let u=e.addedNodes[f];n.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(We&&Vn<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:u,nextSibling:d}=e.addedNodes[f];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==e.target?xe(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),a=o&&o.parentNode==e.target?xe(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let fp=new WeakMap,up=!1;function Mk(t){if(!fp.has(t)&&(fp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=vt,up)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),up=!0}}function dp(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Sr(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Rk(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return dp(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?dp(t,n):null}function Nk(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Dk(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,f=a.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(c=[{node:f,offset:a.anchorOffset}],Da(a)||c.push({node:a.focusNode,offset:a.focusOffset})),Te&&t.input.lastKeyCode===8)for(let m=o;m>i;m--){let v=r.childNodes[m-1],w=v.pmViewDesc;if(v.nodeName=="BR"&&!w){o=m;break}if(!w||w.size)break}let u=t.state.doc,d=t.someProp("domParser")||Ju.fromSchema(t.state.schema),h=u.resolve(s),p=null,g=d.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Ik,context:h});if(c&&c[0].pos!=null){let m=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=m),p={anchor:m+s,head:v+s}}return{doc:g,sel:p,from:s,to:l}}function Ik(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(_e&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||_e&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Pk=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function _k(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let k=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,A=id(t,k);if(A&&!t.state.selection.eq(A)){if(Te&&gt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",M=>M(t,ar(13,"Enter"))))return;let T=t.state.tr.setSelection(A);k=="pointer"?T.setMeta("pointer",!0):k=="key"&&T.scrollIntoView(),o&&T.setMeta("composition",o),t.dispatch(T)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=Dk(t,e,n),f=t.state.doc,u=f.slice(c.from,c.to),d,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(d=t.state.selection.to,h="end"):(d=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=Bk(u.content,c.doc.content,c.from,d,h);if((fi&&t.input.lastIOSEnter>Date.now()-225||gt)&&i.some(k=>k.nodeType==1&&!Pk.test(k.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",k=>k(t,ar(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof J&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let k=hp(t,t.state.doc,c.sel);if(k&&!k.eq(t.state.selection)){let A=t.state.tr.setSelection(k);o&&A.setMeta("composition",o),t.dispatch(A)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof J&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),We&&Vn<=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 g=c.doc.resolveNoCache(p.start-c.from),m=c.doc.resolveNoCache(p.endB-c.from),v=f.resolve(p.start),w=g.sameParent(m)&&g.parent.inlineContent&&v.end()>=p.endA,S;if((fi&&t.input.lastIOSEnter>Date.now()-225&&(!w||i.some(k=>k.nodeName=="DIV"||k.nodeName=="P"))||!w&&g.pos<c.doc.content.size&&!g.sameParent(m)&&(S=q.findFrom(c.doc.resolve(g.pos+1),1,!0))&&S.head==m.pos)&&t.someProp("handleKeyDown",k=>k(t,ar(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&$k(f,p.start,p.endA,g,m)&&t.someProp("handleKeyDown",k=>k(t,ar(8,"Backspace")))){gt&&Te&&t.domObserver.suppressSelectionUpdates();return}Te&&gt&&p.endB==p.start&&(t.input.lastAndroidDelete=Date.now()),gt&&!w&&g.start()!=m.start()&&m.parentOffset==0&&g.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,m=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(k){return k(t,ar(13,"Enter"))})},20));let y=p.start,x=p.endA,b,O,R;if(w){if(g.pos==m.pos)We&&Vn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>sn(t),20)),b=t.state.tr.delete(y,x),O=f.resolve(p.start).marksAcross(f.resolve(p.endA));else if(p.endA==p.endB&&(R=Lk(g.parent.content.cut(g.parentOffset,m.parentOffset),v.parent.content.cut(v.parentOffset,p.endA-v.start()))))b=t.state.tr,R.type=="add"?b.addMark(y,x,R.mark):b.removeMark(y,x,R.mark);else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let k=g.parent.textBetween(g.parentOffset,m.parentOffset);if(t.someProp("handleTextInput",A=>A(t,y,x,k)))return;b=t.state.tr.insertText(k,y,x)}}if(b||(b=t.state.tr.replace(y,x,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let k=hp(t,b.doc,c.sel);k&&!(Te&&gt&&t.composing&&k.empty&&(p.start!=p.endB||t.input.lastAndroidDelete<Date.now()-100)&&(k.head==y||k.head==b.mapping.map(x)-1)||We&&k.empty&&k.head==y)&&b.setSelection(k)}O&&b.ensureMarks(O),o&&b.setMeta("composition",o),t.dispatch(b.scrollIntoView())}function hp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:od(t,e.resolve(n.anchor),e.resolve(n.head))}function Lk(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,a;for(let f=0;f<r.length;f++)i=r[f].removeFromSet(i);for(let f=0;f<n.length;f++)o=n[f].removeFromSet(o);if(i.length==1&&o.length==0)l=i[0],s="add",a=f=>f.mark(l.addToSet(f.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=f=>f.mark(l.removeFromSet(f.marks));else return null;let c=[];for(let f=0;f<e.childCount;f++)c.push(a(e.child(f)));if(E.from(c).eq(t))return{mark:l,type:s}}function $k(t,e,n,r,i){if(n-e<=i.pos-r.pos||hc(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&n==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(hc(o,!0,!0));return!s.parent.isTextblock||s.pos>n||hc(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function hc(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Bk(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s<o&&t.size<e.size){let a=r<=o&&r>=s?o-r:0;o-=a,o&&o<e.size&&pp(e.textBetween(o-1,o+1))&&(o+=a?1:-1),l=o+(l-s),s=o}else if(l<o){let a=r<=o&&r>=l?o-r:0;o-=a,o&&o<t.size&&pp(t.textBetween(o-1,o+1))&&(o+=a?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function pp(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Fk{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ik,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(bp),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=yp(this),mp(this),this.nodeViews=vp(this),this.docView=Jh(this.state.doc,gp(this),dc(this),this.dom,this),this.domObserver=new Tk(this,(r,i,o,s)=>_k(this,r,i,o,s)),this.domObserver.start(),ok(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Pf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(bp),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(iv(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=vp(this);jk(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Pf(this),this.editable=yp(this),mp(this);let a=dc(this),c=gp(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(e.doc,c,a);(u||!e.selection.eq(i.selection))&&(s=!0);let d=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&wx(this);if(s){this.domObserver.stop();let h=u&&(We||Te)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&zk(i.selection,e.selection);if(u){let p=Te?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=vk(this)),(o||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Jh(e.doc,c,a,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Wx(this))?sn(this,h):(U0(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():d&&Sx(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof j){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Hh(this,n.getBoundingClientRect(),e)}else Hh(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new sv(e.slice,e.move,i<0?void 0:j.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(i=n?n(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(We){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&xx(this.dom),sn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Ax(this,e)}coordsAtPos(e,n=1){return $0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return Dx(this,n||this.state,e)}pasteHTML(e,n){return ko(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ko(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(sk(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],dc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,cx())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return ak(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?_e&&this.root.nodeType===11&&px(this.dom.ownerDocument)==this.dom&&Rk(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function gp(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Pe.node(0,t.state.doc.content.size,e)]}function mp(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Pe.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function yp(t){return!t.someProp("editable",e=>e(t.state)===!1)}function zk(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function vp(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function jk(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function bp(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Un={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:"'"},xl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Vk=typeof navigator<"u"&&/Mac/.test(navigator.platform),Hk=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ke=0;ke<10;ke++)Un[48+ke]=Un[96+ke]=String(ke);for(var ke=1;ke<=24;ke++)Un[ke+111]="F"+ke;for(var ke=65;ke<=90;ke++)Un[ke]=String.fromCharCode(ke+32),xl[ke]=String.fromCharCode(ke);for(var pc in Un)xl.hasOwnProperty(pc)||(xl[pc]=Un[pc]);function Wk(t){var e=Vk&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Hk&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?xl:Un)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Uk=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function qk(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))Uk?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Gk(t){let e=Object.create(null);for(let n in t)e[qk(n)]=t[n];return e}function gc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Kk(t){return new Mr({props:{handleKeyDown:ud(t)}})}function ud(t){let e=Gk(t);return function(n,r){let i=Wk(r),o,s=e[gc(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[gc(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Un[r.keyCode])&&o!=i){let l=e[gc(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const Jk=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function uv(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Yk=(t,e,n)=>{let r=uv(t,n);if(!r)return!1;let i=dd(r);if(!i){let s=r.blockRange(),l=s&&Oi(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(gv(t,i,e,-1))return!0;if(r.parent.content.size==0&&(ui(o,"end")||j.isSelectable(o)))for(let s=r.depth;;s--){let l=Ra(t.doc,r.before(s),r.after(s),D.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(ui(o,"end")?q.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):j.create(a.doc,i.pos-o.nodeSize)),e(a.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},Xk=(t,e,n)=>{let r=uv(t,n);if(!r)return!1;let i=dd(r);return i?dv(t,i,e):!1},Qk=(t,e,n)=>{let r=hv(t,n);if(!r)return!1;let i=hd(r);return i?dv(t,i,e):!1};function dv(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=e.nodeAfter,l=s,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let c=Ra(t.doc,o,a,D.empty);if(!c||c.from!=o||c instanceof me&&c.slice.size>=a-o)return!1;if(n){let f=t.tr.step(c);f.setSelection(J.create(f.doc,o)),n(f.scrollIntoView())}return!0}function ui(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Zk=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=dd(r)}let s=o&&o.nodeBefore;return!s||!j.isSelectable(s)?!1:(e&&e(t.tr.setSelection(j.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function dd(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function hv(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const eC=(t,e,n)=>{let r=hv(t,n);if(!r)return!1;let i=hd(r);if(!i)return!1;let o=i.nodeAfter;if(gv(t,i,e,1))return!0;if(r.parent.content.size==0&&(ui(o,"start")||j.isSelectable(o))){let s=Ra(t.doc,r.before(),r.after(),D.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(ui(o,"start")?q.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):j.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},tC=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=hd(r)}let s=o&&o.nodeAfter;return!s||!j.isSelectable(s)?!1:(e&&e(t.tr.setSelection(j.create(t.doc,o.pos)).scrollIntoView()),!0)};function hd(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const nC=(t,e)=>{let n=t.selection,r=n instanceof j,i;if(r){if(n.node.isTextblock||!Ai(t.doc,n.from))return!1;i=n.from}else if(i=Zu(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(j.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},rC=(t,e)=>{let n=t.selection,r;if(n instanceof j){if(n.node.isTextblock||!Ai(t.doc,n.to))return!1;r=n.to}else if(r=Zu(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},iC=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Oi(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},oC=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
10
+ `).scrollIntoView()),!0)};function pv(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const sC=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=pv(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(q.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},lC=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof st||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=pv(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(s,o.createAndFill());l.setSelection(J.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},aC=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Qu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Oi(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},cC=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(j.create(t.doc,i))),!0)};function fC(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Ai(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function gv(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,a=i.type.spec.isolating||o.type.spec.isolating;if(!a&&fC(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let h=e.pos+o.nodeSize,p=E.empty;for(let v=s.length-1;v>=0;v--)p=E.from(s[v].create(null,p));p=E.from(i.copy(p));let g=t.tr.step(new ye(e.pos-1,h,e.pos,h,new D(p,1,0),s.length,!0)),m=h+2*s.length;Ai(g.doc,m)&&g.join(m),n(g.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&a?null:q.findFrom(e,1),u=f&&f.$from.blockRange(f.$to),d=u&&Oi(u);if(d!=null&&d>=e.depth)return n&&n(t.tr.lift(u,d).scrollIntoView()),!0;if(c&&ui(o,"start",!0)&&ui(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=o,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let v=E.empty;for(let S=p.length-1;S>=0;S--)v=E.from(p[S].copy(v));let w=t.tr.step(new ye(e.pos-p.length,e.pos+o.nodeSize,e.pos+m,e.pos+o.nodeSize-m,new D(v,p.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function mv(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(J.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const uC=mv(-1),dC=mv(1);function hC(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Xu(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function pC(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[o];n.doc.nodesBetween(s,l,(a,c)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)i=!0;else{let f=n.doc.resolve(c),u=f.index();i=f.parent.canReplaceWith(u,u+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];o.setBlockType(l,a,t,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function gC(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let f=n.doc.resolve(s.start-2);a=new bo(f,f,s.depth),s.endIndex<s.parent.childCount&&(s=new bo(i,n.doc.resolve(o.end(s.depth)),s.depth)),l=!0}let c=Xu(a,t,e,s);return c?(r&&r(mC(n.tr,s,c,l,t).scrollIntoView()),!0):!1}}function mC(t,e,n,r,i){let o=E.empty;for(let f=n.length-1;f>=0;f--)o=E.from(n[f].type.create(n[f].attrs,o));t.step(new ye(e.start-(r?2:0),e.end,e.start,e.end,new D(o,0,0),n.length,!0));let s=0;for(let f=0;f<n.length;f++)n[f].type==i&&(s=f+1);let l=n.length-s,a=e.start+n.length-(r?2:0),c=e.parent;for(let f=e.startIndex,u=e.endIndex,d=!0;f<u;f++,d=!1)!d&&Qu(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(f).nodeSize;return t}function yC(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?vC(e,n,t,o):bC(e,n,o):!0:!1}}function vC(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new ye(o-1,s,o,s,new D(E.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new bo(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=Oi(r);if(l==null)return!1;i.lift(r,l);let a=i.mapping.map(o,-1)-1;return Ai(i.doc,a)&&i.join(a),e(i.scrollIntoView()),!0}function bC(t,e,n){let r=t.tr,i=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==i.childCount,c=o.node(-1),f=o.index(-1);if(!c.canReplace(f+(l?0:1),f+1,s.content.append(a?E.empty:E.from(i))))return!1;let u=o.pos,d=u+s.nodeSize;return r.step(new ye(u-(l?1:0),d+(a?1:0),u+1,d-1,new D((l?E.empty:E.from(i.copy(E.empty))).append(a?E.empty:E.from(i.copy(E.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function wC(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,f=E.from(c?t.create():null),u=new D(E.from(t.create(null,E.from(l.type.create(null,f)))),c?3:1,0),d=o.start,h=o.end;n(e.tr.step(new ye(d-(c?3:1),h,d,h,u,1,!0)).scrollIntoView())}return!0}}function yv(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=yv(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function SC(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=yv(t))&&(r&&(r+=" "),r+=e);return r}const pd="-",xC=t=>{const e=CC(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{const l=s.split(pd);return l[0]===""&&l.length!==1&&l.shift(),vv(l,e)||kC(s)},getConflictingClassGroupIds:(s,l)=>{const a=n[s]||[];return l&&r[s]?[...a,...r[s]]:a}}},vv=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?vv(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(pd);return(s=e.validators.find(({validator:l})=>l(o)))==null?void 0:s.classGroupId},wp=/^\[(.+)\]$/,kC=t=>{if(wp.test(t)){const e=wp.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},CC=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return OC(Object.entries(t.classGroups),n).forEach(([o,s])=>{_f(s,r,o,e)}),r},_f=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:Sp(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(EC(i)){_f(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{_f(s,Sp(e,o),n,r)})})},Sp=(t,e)=>{let n=t;return e.split(pd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},EC=t=>t.isThemeGetter,OC=(t,e)=>e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,l])=>[e+s,l])):o);return[n,i]}):t,AC=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},bv="!",TC=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],o=e.length,s=l=>{const a=[];let c=0,f=0,u;for(let m=0;m<l.length;m++){let v=l[m];if(c===0){if(v===i&&(r||l.slice(m,m+o)===e)){a.push(l.slice(f,m)),f=m+o;continue}if(v==="/"){u=m;continue}}v==="["?c++:v==="]"&&c--}const d=a.length===0?l:l.substring(f),h=d.startsWith(bv),p=h?d.substring(1):d,g=u&&u>f?u-f:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:s}):s},MC=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},RC=t=>({cache:AC(t.cacheSize),parseClassName:TC(t),...xC(t)}),NC=/\s+/,DC=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=[],s=t.trim().split(NC);let l="";for(let a=s.length-1;a>=0;a-=1){const c=s[a],{modifiers:f,hasImportantModifier:u,baseClassName:d,maybePostfixModifierPosition:h}=n(c);let p=!!h,g=r(p?d.substring(0,h):d);if(!g){if(!p){l=c+(l.length>0?" "+l:l);continue}if(g=r(d),!g){l=c+(l.length>0?" "+l:l);continue}p=!1}const m=MC(f).join(":"),v=u?m+bv:m,w=v+g;if(o.includes(w))continue;o.push(w);const S=i(g,p);for(let y=0;y<S.length;++y){const x=S[y];o.push(v+x)}l=c+(l.length>0?" "+l:l)}return l};function IC(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=wv(e))&&(r&&(r+=" "),r+=n);return r}const wv=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=wv(t[r]))&&(n&&(n+=" "),n+=e);return n};function PC(t,...e){let n,r,i,o=s;function s(a){const c=e.reduce((f,u)=>u(f),t());return n=RC(c),r=n.cache.get,i=n.cache.set,o=l,l(a)}function l(a){const c=r(a);if(c)return c;const f=DC(a,n);return i(a,f),f}return function(){return o(IC.apply(null,arguments))}}const ne=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Sv=/^\[(?:([a-z-]+):)?(.+)\]$/i,_C=/^\d+\/\d+$/,LC=new Set(["px","full","screen"]),$C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,BC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,FC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,zC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yt=t=>ni(t)||LC.has(t)||_C.test(t),xn=t=>Ti(t,"length",JC),ni=t=>!!t&&!Number.isNaN(Number(t)),mc=t=>Ti(t,"number",ni),Vi=t=>!!t&&Number.isInteger(Number(t)),VC=t=>t.endsWith("%")&&ni(t.slice(0,-1)),G=t=>Sv.test(t),kn=t=>$C.test(t),HC=new Set(["length","size","percentage"]),WC=t=>Ti(t,HC,xv),UC=t=>Ti(t,"position",xv),qC=new Set(["image","url"]),GC=t=>Ti(t,qC,XC),KC=t=>Ti(t,"",YC),Hi=()=>!0,Ti=(t,e,n)=>{const r=Sv.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},JC=t=>BC.test(t)&&!FC.test(t),xv=()=>!1,YC=t=>zC.test(t),XC=t=>jC.test(t),QC=()=>{const t=ne("colors"),e=ne("spacing"),n=ne("blur"),r=ne("brightness"),i=ne("borderColor"),o=ne("borderRadius"),s=ne("borderSpacing"),l=ne("borderWidth"),a=ne("contrast"),c=ne("grayscale"),f=ne("hueRotate"),u=ne("invert"),d=ne("gap"),h=ne("gradientColorStops"),p=ne("gradientColorStopPositions"),g=ne("inset"),m=ne("margin"),v=ne("opacity"),w=ne("padding"),S=ne("saturate"),y=ne("scale"),x=ne("sepia"),b=ne("skew"),O=ne("space"),R=ne("translate"),k=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",G,e],M=()=>[G,e],_=()=>["",Yt,xn],L=()=>["auto",ni,G],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",G],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[ni,G];return{cacheSize:500,separator:":",theme:{colors:[Hi],spacing:[Yt,xn],blur:["none","",kn,G],brightness:ue(),borderColor:[t],borderRadius:["none","","full",kn,G],borderSpacing:M(),borderWidth:_(),contrast:ue(),grayscale:Y(),hueRotate:ue(),invert:Y(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[VC,xn],inset:T(),margin:T(),opacity:ue(),padding:M(),saturate:ue(),scale:ue(),sepia:Y(),skew:ue(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",G]}],container:["container"],columns:[{columns:[kn]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),G]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Vi,G]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",G]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",Vi,G]}],"grid-cols":[{"grid-cols":[Hi]}],"col-start-end":[{col:["auto",{span:["full",Vi,G]},G]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Hi]}],"row-start-end":[{row:["auto",{span:[Vi,G]},G]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",G]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",G]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",G,e]}],"min-w":[{"min-w":[G,e,"min","max","fit"]}],"max-w":[{"max-w":[G,e,"none","full","min","max","fit","prose",{screen:[kn]},kn]}],h:[{h:[G,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[G,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[G,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[G,e,"auto","min","max","fit"]}],"font-size":[{text:["base",kn,xn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mc]}],"font-family":[{font:[Hi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",G]}],"line-clamp":[{"line-clamp":["none",ni,mc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yt,G]}],"list-image":[{"list-image":["none",G]}],"list-style-type":[{list:["none","disc","decimal",G]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yt,xn]}],"underline-offset":[{"underline-offset":["auto",Yt,G]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),UC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",WC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},GC]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:B()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Yt,G]}],"outline-w":[{outline:[Yt,xn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Yt,xn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",kn,KC]}],"shadow-color":[{shadow:[Hi]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",kn,G]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[u]}],saturate:[{saturate:[S]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",G]}],duration:[{duration:ue()}],ease:[{ease:["linear","in","out","in-out",G]}],delay:[{delay:ue()}],animate:[{animate:["none","spin","ping","pulse","bounce",G]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Vi,G]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",G]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",G]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",G]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Yt,xn,mc]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ZC=PC(QC);var Ue="top",ct="bottom",ft="right",qe="left",gd="auto",Yo=[Ue,ct,ft,qe],di="start",Eo="end",eE="clippingParents",kv="viewport",Wi="popper",tE="reference",xp=Yo.reduce(function(t,e){return t.concat([e+"-"+di,e+"-"+Eo])},[]),Cv=[].concat(Yo,[gd]).reduce(function(t,e){return t.concat([e,e+"-"+di,e+"-"+Eo])},[]),nE="beforeRead",rE="read",iE="afterRead",oE="beforeMain",sE="main",lE="afterMain",aE="beforeWrite",cE="write",fE="afterWrite",uE=[nE,rE,iE,oE,sE,lE,aE,cE,fE];function Bt(t){return t?(t.nodeName||"").toLowerCase():null}function Ze(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function kr(t){var e=Ze(t).Element;return t instanceof e||t instanceof Element}function at(t){var e=Ze(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function md(t){if(typeof ShadowRoot>"u")return!1;var e=Ze(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function dE(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!at(o)||!Bt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function hE(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(a,c){return a[c]="",a},{});!at(i)||!Bt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}const Ev={name:"applyStyles",enabled:!0,phase:"write",fn:dE,effect:hE,requires:["computeStyles"]};function It(t){return t.split("-")[0]}var mr=Math.max,kl=Math.min,hi=Math.round;function Lf(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ov(){return!/^((?!chrome|android).)*safari/i.test(Lf())}function pi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&at(t)&&(i=t.offsetWidth>0&&hi(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&hi(r.height)/t.offsetHeight||1);var s=kr(t)?Ze(t):window,l=s.visualViewport,a=!Ov()&&n,c=(r.left+(a&&l?l.offsetLeft:0))/i,f=(r.top+(a&&l?l.offsetTop:0))/o,u=r.width/i,d=r.height/o;return{width:u,height:d,top:f,right:c+u,bottom:f+d,left:c,x:c,y:f}}function yd(t){var e=pi(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Av(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&md(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function an(t){return Ze(t).getComputedStyle(t)}function pE(t){return["table","td","th"].indexOf(Bt(t))>=0}function Zn(t){return((kr(t)?t.ownerDocument:t.document)||window.document).documentElement}function _a(t){return Bt(t)==="html"?t:t.assignedSlot||t.parentNode||(md(t)?t.host:null)||Zn(t)}function kp(t){return!at(t)||an(t).position==="fixed"?null:t.offsetParent}function gE(t){var e=/firefox/i.test(Lf()),n=/Trident/i.test(Lf());if(n&&at(t)){var r=an(t);if(r.position==="fixed")return null}var i=_a(t);for(md(i)&&(i=i.host);at(i)&&["html","body"].indexOf(Bt(i))<0;){var o=an(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Xo(t){for(var e=Ze(t),n=kp(t);n&&pE(n)&&an(n).position==="static";)n=kp(n);return n&&(Bt(n)==="html"||Bt(n)==="body"&&an(n).position==="static")?e:n||gE(t)||e}function vd(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ro(t,e,n){return mr(t,kl(e,n))}function mE(t,e,n){var r=ro(t,e,n);return r>n?n:r}function Tv(){return{top:0,right:0,bottom:0,left:0}}function Mv(t){return Object.assign({},Tv(),t)}function Rv(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var yE=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Mv(typeof e!="number"?e:Rv(e,Yo))};function vE(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=It(n.placement),a=vd(l),c=[qe,ft].indexOf(l)>=0,f=c?"height":"width";if(!(!o||!s)){var u=yE(i.padding,n),d=yd(o),h=a==="y"?Ue:qe,p=a==="y"?ct:ft,g=n.rects.reference[f]+n.rects.reference[a]-s[a]-n.rects.popper[f],m=s[a]-n.rects.reference[a],v=Xo(o),w=v?a==="y"?v.clientHeight||0:v.clientWidth||0:0,S=g/2-m/2,y=u[h],x=w-d[f]-u[p],b=w/2-d[f]/2+S,O=ro(y,b,x),R=a;n.modifiersData[r]=(e={},e[R]=O,e.centerOffset=O-b,e)}}function bE(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Av(e.elements.popper,i)&&(e.elements.arrow=i))}const wE={name:"arrow",enabled:!0,phase:"main",fn:vE,effect:bE,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gi(t){return t.split("-")[1]}var SE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xE(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:hi(n*i)/i||0,y:hi(r*i)/i||0}}function Cp(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,a=t.gpuAcceleration,c=t.adaptive,f=t.roundOffsets,u=t.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,g=p===void 0?0:p,m=typeof f=="function"?f({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),S=qe,y=Ue,x=window;if(c){var b=Xo(n),O="clientHeight",R="clientWidth";if(b===Ze(n)&&(b=Zn(n),an(b).position!=="static"&&l==="absolute"&&(O="scrollHeight",R="scrollWidth")),b=b,i===Ue||(i===qe||i===ft)&&o===Eo){y=ct;var k=u&&b===x&&x.visualViewport?x.visualViewport.height:b[O];g-=k-r.height,g*=a?1:-1}if(i===qe||(i===Ue||i===ct)&&o===Eo){S=ft;var A=u&&b===x&&x.visualViewport?x.visualViewport.width:b[R];h-=A-r.width,h*=a?1:-1}}var T=Object.assign({position:l},c&&SE),M=f===!0?xE({x:h,y:g},Ze(n)):{x:h,y:g};if(h=M.x,g=M.y,a){var _;return Object.assign({},T,(_={},_[y]=w?"0":"",_[S]=v?"0":"",_.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",_))}return Object.assign({},T,(e={},e[y]=w?g+"px":"",e[S]=v?h+"px":"",e.transform="",e))}function kE(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,a=l===void 0?!0:l,c={placement:It(e.placement),variation:gi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Cp(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Cp(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const CE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:kE,data:{}};var gs={passive:!0};function EE(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,a=Ze(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(f){f.addEventListener("scroll",n.update,gs)}),l&&a.addEventListener("resize",n.update,gs),function(){o&&c.forEach(function(f){f.removeEventListener("scroll",n.update,gs)}),l&&a.removeEventListener("resize",n.update,gs)}}const OE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:EE,data:{}};var AE={left:"right",right:"left",bottom:"top",top:"bottom"};function Hs(t){return t.replace(/left|right|bottom|top/g,function(e){return AE[e]})}var TE={start:"end",end:"start"};function Ep(t){return t.replace(/start|end/g,function(e){return TE[e]})}function bd(t){var e=Ze(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function wd(t){return pi(Zn(t)).left+bd(t).scrollLeft}function ME(t,e){var n=Ze(t),r=Zn(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;var c=Ov();(c||!c&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l+wd(t),y:a}}function RE(t){var e,n=Zn(t),r=bd(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=mr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=mr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+wd(t),a=-r.scrollTop;return an(i||n).direction==="rtl"&&(l+=mr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:a}}function Sd(t){var e=an(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Nv(t){return["html","body","#document"].indexOf(Bt(t))>=0?t.ownerDocument.body:at(t)&&Sd(t)?t:Nv(_a(t))}function io(t,e){var n;e===void 0&&(e=[]);var r=Nv(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Ze(r),s=i?[o].concat(o.visualViewport||[],Sd(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(io(_a(s)))}function $f(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function NE(t,e){var n=pi(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Op(t,e,n){return e===kv?$f(ME(t,n)):kr(e)?NE(e,n):$f(RE(Zn(t)))}function DE(t){var e=io(_a(t)),n=["absolute","fixed"].indexOf(an(t).position)>=0,r=n&&at(t)?Xo(t):t;return kr(r)?e.filter(function(i){return kr(i)&&Av(i,r)&&Bt(i)!=="body"}):[]}function IE(t,e,n,r){var i=e==="clippingParents"?DE(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(a,c){var f=Op(t,c,r);return a.top=mr(f.top,a.top),a.right=kl(f.right,a.right),a.bottom=kl(f.bottom,a.bottom),a.left=mr(f.left,a.left),a},Op(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Dv(t){var e=t.reference,n=t.element,r=t.placement,i=r?It(r):null,o=r?gi(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,a;switch(i){case Ue:a={x:s,y:e.y-n.height};break;case ct:a={x:s,y:e.y+e.height};break;case ft:a={x:e.x+e.width,y:l};break;case qe:a={x:e.x-n.width,y:l};break;default:a={x:e.x,y:e.y}}var c=i?vd(i):null;if(c!=null){var f=c==="y"?"height":"width";switch(o){case di:a[c]=a[c]-(e[f]/2-n[f]/2);break;case Eo:a[c]=a[c]+(e[f]/2-n[f]/2);break}}return a}function Oo(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,a=l===void 0?eE:l,c=n.rootBoundary,f=c===void 0?kv:c,u=n.elementContext,d=u===void 0?Wi:u,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,m=g===void 0?0:g,v=Mv(typeof m!="number"?m:Rv(m,Yo)),w=d===Wi?tE:Wi,S=t.rects.popper,y=t.elements[p?w:d],x=IE(kr(y)?y:y.contextElement||Zn(t.elements.popper),a,f,s),b=pi(t.elements.reference),O=Dv({reference:b,element:S,strategy:"absolute",placement:i}),R=$f(Object.assign({},S,O)),k=d===Wi?R:b,A={top:x.top-k.top+v.top,bottom:k.bottom-x.bottom+v.bottom,left:x.left-k.left+v.left,right:k.right-x.right+v.right},T=t.modifiersData.offset;if(d===Wi&&T){var M=T[i];Object.keys(A).forEach(function(_){var L=[ft,ct].indexOf(_)>=0?1:-1,W=[Ue,ct].indexOf(_)>=0?"y":"x";A[_]+=M[W]*L})}return A}function PE(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,a=n.allowedAutoPlacements,c=a===void 0?Cv:a,f=gi(r),u=f?l?xp:xp.filter(function(p){return gi(p)===f}):Yo,d=u.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=u);var h=d.reduce(function(p,g){return p[g]=Oo(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[It(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function _E(t){if(It(t)===gd)return[];var e=Hs(t);return[Ep(t),e,Ep(e)]}function LE(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,a=n.fallbackPlacements,c=n.padding,f=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,m=e.options.placement,v=It(m),w=v===m,S=a||(w||!p?[Hs(m)]:_E(m)),y=[m].concat(S).reduce(function(Fe,Oe){return Fe.concat(It(Oe)===gd?PE(e,{placement:Oe,boundary:f,rootBoundary:u,padding:c,flipVariations:p,allowedAutoPlacements:g}):Oe)},[]),x=e.rects.reference,b=e.rects.popper,O=new Map,R=!0,k=y[0],A=0;A<y.length;A++){var T=y[A],M=It(T),_=gi(T)===di,L=[Ue,ct].indexOf(M)>=0,W=L?"width":"height",B=Oo(e,{placement:T,boundary:f,rootBoundary:u,altBoundary:d,padding:c}),I=L?_?ft:qe:_?ct:Ue;x[W]>b[W]&&(I=Hs(I));var U=Hs(I),Y=[];if(o&&Y.push(B[M]<=0),l&&Y.push(B[I]<=0,B[U]<=0),Y.every(function(Fe){return Fe})){k=T,R=!1;break}O.set(T,Y)}if(R)for(var de=p?3:1,ue=function(Oe){var ze=y.find(function(dt){var je=O.get(dt);if(je)return je.slice(0,Oe).every(function(De){return De})});if(ze)return k=ze,"break"},Be=de;Be>0;Be--){var et=ue(Be);if(et==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const $E={name:"flip",enabled:!0,phase:"main",fn:LE,requiresIfExists:["offset"],data:{_skip:!1}};function Ap(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Tp(t){return[Ue,ft,ct,qe].some(function(e){return t[e]>=0})}function BE(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Oo(e,{elementContext:"reference"}),l=Oo(e,{altBoundary:!0}),a=Ap(s,r),c=Ap(l,i,o),f=Tp(a),u=Tp(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":u})}const FE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:BE};function zE(t,e,n){var r=It(t),i=[qe,Ue].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[qe,ft].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function jE(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Cv.reduce(function(f,u){return f[u]=zE(u,e.rects,o),f},{}),l=s[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const VE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jE};function HE(t){var e=t.state,n=t.name;e.modifiersData[n]=Dv({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const WE={name:"popperOffsets",enabled:!0,phase:"read",fn:HE,data:{}};function UE(t){return t==="x"?"y":"x"}function qE(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,a=n.boundary,c=n.rootBoundary,f=n.altBoundary,u=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,g=p===void 0?0:p,m=Oo(e,{boundary:a,rootBoundary:c,padding:u,altBoundary:f}),v=It(e.placement),w=gi(e.placement),S=!w,y=vd(v),x=UE(y),b=e.modifiersData.popperOffsets,O=e.rects.reference,R=e.rects.popper,k=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,A=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(b){if(o){var _,L=y==="y"?Ue:qe,W=y==="y"?ct:ft,B=y==="y"?"height":"width",I=b[y],U=I+m[L],Y=I-m[W],de=h?-R[B]/2:0,ue=w===di?O[B]:R[B],Be=w===di?-R[B]:-O[B],et=e.elements.arrow,Fe=h&&et?yd(et):{width:0,height:0},Oe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Tv(),ze=Oe[L],dt=Oe[W],je=ro(0,O[B],Fe[B]),De=S?O[B]/2-de-je-ze-A.mainAxis:ue-je-ze-A.mainAxis,we=S?-O[B]/2+de+je+dt+A.mainAxis:Be+je+dt+A.mainAxis,ht=e.elements.arrow&&Xo(e.elements.arrow),qt=ht?y==="y"?ht.clientTop||0:ht.clientLeft||0:0,Gt=(_=T==null?void 0:T[y])!=null?_:0,bn=I+De-Gt-qt,ir=I+we-Gt,wn=ro(h?kl(U,bn):U,I,h?mr(Y,ir):Y);b[y]=wn,M[y]=wn-I}if(l){var Bi,rs=y==="x"?Ue:qe,is=y==="x"?ct:ft,Kt=b[x],Sn=x==="y"?"height":"width",Fi=Kt+m[rs],or=Kt-m[is],zi=[Ue,qe].indexOf(v)!==-1,ss=(Bi=T==null?void 0:T[x])!=null?Bi:0,ls=zi?Fi:Kt-O[Sn]-R[Sn]-ss+A.altAxis,as=zi?Kt+O[Sn]+R[Sn]-ss-A.altAxis:or,cs=h&&zi?mE(ls,Kt,as):ro(h?ls:Fi,Kt,h?as:or);b[x]=cs,M[x]=cs-Kt}e.modifiersData[r]=M}}const GE={name:"preventOverflow",enabled:!0,phase:"main",fn:qE,requiresIfExists:["offset"]};function KE(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function JE(t){return t===Ze(t)||!at(t)?bd(t):KE(t)}function YE(t){var e=t.getBoundingClientRect(),n=hi(e.width)/t.offsetWidth||1,r=hi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function XE(t,e,n){n===void 0&&(n=!1);var r=at(e),i=at(e)&&YE(e),o=Zn(e),s=pi(t,i,n),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((Bt(e)!=="body"||Sd(o))&&(l=JE(e)),at(e)?(a=pi(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=wd(o))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function QE(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var a=e.get(l);a&&i(a)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function ZE(t){var e=QE(t);return uE.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function eO(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function tO(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Mp={placement:"bottom",modifiers:[],strategy:"absolute"};function Rp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function nO(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Mp:i;return function(l,a,c){c===void 0&&(c=o);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},Mp,o),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},u=[],d=!1,h={state:f,setOptions:function(v){var w=typeof v=="function"?v(f.options):v;g(),f.options=Object.assign({},o,f.options,w),f.scrollParents={reference:kr(l)?io(l):l.contextElement?io(l.contextElement):[],popper:io(a)};var S=ZE(tO([].concat(r,f.options.modifiers)));return f.orderedModifiers=S.filter(function(y){return y.enabled}),p(),h.update()},forceUpdate:function(){if(!d){var v=f.elements,w=v.reference,S=v.popper;if(Rp(w,S)){f.rects={reference:XE(w,Xo(S),f.options.strategy==="fixed"),popper:yd(S)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(A){return f.modifiersData[A.name]=Object.assign({},A.data)});for(var y=0;y<f.orderedModifiers.length;y++){if(f.reset===!0){f.reset=!1,y=-1;continue}var x=f.orderedModifiers[y],b=x.fn,O=x.options,R=O===void 0?{}:O,k=x.name;typeof b=="function"&&(f=b({state:f,options:R,name:k,instance:h})||f)}}}},update:eO(function(){return new Promise(function(m){h.forceUpdate(),m(f)})}),destroy:function(){g(),d=!0}};if(!Rp(l,a))return h;h.setOptions(c).then(function(m){!d&&c.onFirstUpdate&&c.onFirstUpdate(m)});function p(){f.orderedModifiers.forEach(function(m){var v=m.name,w=m.options,S=w===void 0?{}:w,y=m.effect;if(typeof y=="function"){var x=y({state:f,name:v,instance:h,options:S}),b=function(){};u.push(x||b)}})}function g(){u.forEach(function(m){return m()}),u=[]}return h}}var rO=[OE,WE,CE,Ev,VE,$E,GE,wE,FE],iO=nO({defaultModifiers:rO}),oO="tippy-box",Iv="tippy-content",sO="tippy-backdrop",Pv="tippy-arrow",_v="tippy-svg-arrow",lr={passive:!0,capture:!0},Lv=function(){return document.body};function lO(t,e){return{}.hasOwnProperty.call(t,e)}function yc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function xd(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function $v(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Np(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function aO(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function cO(t){return t.split(/\s+/).filter(Boolean)}function Gr(t){return[].concat(t)}function Dp(t,e){t.indexOf(e)===-1&&t.push(e)}function fO(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function uO(t){return t.split("-")[0]}function Cl(t){return[].slice.call(t)}function Ip(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function oo(){return document.createElement("div")}function Ao(t){return["Element","Fragment"].some(function(e){return xd(t,e)})}function dO(t){return xd(t,"NodeList")}function hO(t){return xd(t,"MouseEvent")}function pO(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function gO(t){return Ao(t)?[t]:dO(t)?Cl(t):Array.isArray(t)?t:Cl(document.querySelectorAll(t))}function vc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Pp(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function mO(t){var e,n=Gr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function yO(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,a=l.interactiveBorder,c=uO(s.placement),f=s.modifiersData.offset;if(!f)return!0;var u=c==="bottom"?f.top.y:0,d=c==="top"?f.bottom.y:0,h=c==="right"?f.left.x:0,p=c==="left"?f.right.x:0,g=o.top-r+u>a,m=r-o.bottom-d>a,v=o.left-n+h>a,w=n-o.right-p>a;return g||m||v||w})}function bc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function _p(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var At={isTouch:!1},Lp=0;function vO(){At.isTouch||(At.isTouch=!0,window.performance&&document.addEventListener("mousemove",Bv))}function Bv(){var t=performance.now();t-Lp<20&&(At.isTouch=!1,document.removeEventListener("mousemove",Bv)),Lp=t}function bO(){var t=document.activeElement;if(pO(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function wO(){document.addEventListener("touchstart",vO,lr),window.addEventListener("blur",bO)}var SO=typeof window<"u"&&typeof document<"u",xO=SO?!!window.msCrypto:!1;function Br(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function $p(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function kO(t){return $p(`
11
+ %ctippy.js
12
+
13
+ %c`+$p(t)+`
14
+
15
+ %c👷‍ This is a development-only message. It will be removed in production.
16
+ `)}function Fv(t){return[kO(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var To;process.env.NODE_ENV!=="production"&&CO();function CO(){To=new Set}function nn(t,e){if(t&&!To.has(e)){var n;To.add(e),(n=console).warn.apply(n,Fv(e))}}function Bf(t,e){if(t&&!To.has(e)){var n;To.add(e),(n=console).error.apply(n,Fv(e))}}function EO(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Bf(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Bf(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var zv={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},OO={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ye=Object.assign({appendTo:Lv,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},zv,OO),AO=Object.keys(Ye),TO=function(e){process.env.NODE_ENV!=="production"&&Vv(e,[]);var n=Object.keys(e);n.forEach(function(r){Ye[r]=e[r]})};function jv(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=Ye[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function MO(t,e){var n=e?Object.keys(jv(Object.assign({},Ye,{plugins:e}))):AO,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Bp(t,e){var n=Object.assign({},e,{content:$v(e.content,[t])},e.ignoreAttributes?{}:MO(t,e.plugins));return n.aria=Object.assign({},Ye.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function Vv(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=aO(Ye,Object.keys(zv)),o=!lO(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),nn(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
17
+
18
+ `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
19
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var RO=function(){return"innerHTML"};function Ff(t,e){t[RO()]=e}function Fp(t){var e=oo();return t===!0?e.className=Pv:(e.className=_v,Ao(t)?e.appendChild(t):Ff(e,t)),e}function zp(t,e){Ao(e.content)?(Ff(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ff(t,e.content):t.textContent=e.content)}function zf(t){var e=t.firstElementChild,n=Cl(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Iv)}),arrow:n.find(function(r){return r.classList.contains(Pv)||r.classList.contains(_v)}),backdrop:n.find(function(r){return r.classList.contains(sO)})}}function Hv(t){var e=oo(),n=oo();n.className=oO,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=oo();r.className=Iv,r.setAttribute("data-state","hidden"),zp(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=zf(e),a=l.box,c=l.content,f=l.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&zp(c,t.props),s.arrow?f?o.arrow!==s.arrow&&(a.removeChild(f),a.appendChild(Fp(s.arrow))):a.appendChild(Fp(s.arrow)):f&&a.removeChild(f)}return{popper:e,onUpdate:i}}Hv.$$tippy=!0;var NO=1,ms=[],wc=[];function DO(t,e){var n=Bp(t,Object.assign({},Ye,jv(Ip(e)))),r,i,o,s=!1,l=!1,a=!1,c=!1,f,u,d,h=[],p=Np(bn,n.interactiveDebounce),g,m=NO++,v=null,w=fO(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:m,reference:t,popper:oo(),popperInstance:v,props:n,state:S,plugins:w,clearDelayTimeouts:ls,setProps:as,setContent:cs,show:rS,hide:iS,hideWithInteractivity:oS,enable:zi,disable:ss,unmount:sS,destroy:lS};if(!n.render)return process.env.NODE_ENV!=="production"&&Bf(!0,"render() function has not been supplied."),y;var x=n.render(y),b=x.popper,O=x.onUpdate;b.setAttribute("data-tippy-root",""),b.id="tippy-"+y.id,y.popper=b,t._tippy=y,b._tippy=y;var R=w.map(function(C){return C.fn(y)}),k=t.hasAttribute("aria-expanded");return ht(),de(),I(),U("onCreate",[y]),n.showOnCreate&&Fi(),b.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),b.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",p)}),y;function A(){var C=y.props.touch;return Array.isArray(C)?C:[C,0]}function T(){return A()[0]==="hold"}function M(){var C;return!!((C=y.props.render)!=null&&C.$$tippy)}function _(){return g||t}function L(){var C=_().parentNode;return C?mO(C):document}function W(){return zf(b)}function B(C){return y.state.isMounted&&!y.state.isVisible||At.isTouch||f&&f.type==="focus"?0:yc(y.props.delay,C?0:1,Ye.delay)}function I(C){C===void 0&&(C=!1),b.style.pointerEvents=y.props.interactive&&!C?"":"none",b.style.zIndex=""+y.props.zIndex}function U(C,$,H){if(H===void 0&&(H=!0),R.forEach(function(Q){Q[C]&&Q[C].apply(Q,$)}),H){var ee;(ee=y.props)[C].apply(ee,$)}}function Y(){var C=y.props.aria;if(C.content){var $="aria-"+C.content,H=b.id,ee=Gr(y.props.triggerTarget||t);ee.forEach(function(Q){var Ie=Q.getAttribute($);if(y.state.isVisible)Q.setAttribute($,Ie?Ie+" "+H:H);else{var tt=Ie&&Ie.replace(H,"").trim();tt?Q.setAttribute($,tt):Q.removeAttribute($)}})}}function de(){if(!(k||!y.props.aria.expanded)){var C=Gr(y.props.triggerTarget||t);C.forEach(function($){y.props.interactive?$.setAttribute("aria-expanded",y.state.isVisible&&$===_()?"true":"false"):$.removeAttribute("aria-expanded")})}}function ue(){L().removeEventListener("mousemove",p),ms=ms.filter(function(C){return C!==p})}function Be(C){if(!(At.isTouch&&(a||C.type==="mousedown"))){var $=C.composedPath&&C.composedPath()[0]||C.target;if(!(y.props.interactive&&_p(b,$))){if(Gr(y.props.triggerTarget||t).some(function(H){return _p(H,$)})){if(At.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else U("onClickOutside",[y,C]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),l=!0,setTimeout(function(){l=!1}),y.state.isMounted||ze())}}}function et(){a=!0}function Fe(){a=!1}function Oe(){var C=L();C.addEventListener("mousedown",Be,!0),C.addEventListener("touchend",Be,lr),C.addEventListener("touchstart",Fe,lr),C.addEventListener("touchmove",et,lr)}function ze(){var C=L();C.removeEventListener("mousedown",Be,!0),C.removeEventListener("touchend",Be,lr),C.removeEventListener("touchstart",Fe,lr),C.removeEventListener("touchmove",et,lr)}function dt(C,$){De(C,function(){!y.state.isVisible&&b.parentNode&&b.parentNode.contains(b)&&$()})}function je(C,$){De(C,$)}function De(C,$){var H=W().box;function ee(Q){Q.target===H&&(bc(H,"remove",ee),$())}if(C===0)return $();bc(H,"remove",u),bc(H,"add",ee),u=ee}function we(C,$,H){H===void 0&&(H=!1);var ee=Gr(y.props.triggerTarget||t);ee.forEach(function(Q){Q.addEventListener(C,$,H),h.push({node:Q,eventType:C,handler:$,options:H})})}function ht(){T()&&(we("touchstart",Gt,{passive:!0}),we("touchend",ir,{passive:!0})),cO(y.props.trigger).forEach(function(C){if(C!=="manual")switch(we(C,Gt),C){case"mouseenter":we("mouseleave",ir);break;case"focus":we(xO?"focusout":"blur",wn);break;case"focusin":we("focusout",wn);break}})}function qt(){h.forEach(function(C){var $=C.node,H=C.eventType,ee=C.handler,Q=C.options;$.removeEventListener(H,ee,Q)}),h=[]}function Gt(C){var $,H=!1;if(!(!y.state.isEnabled||Bi(C)||l)){var ee=(($=f)==null?void 0:$.type)==="focus";f=C,g=C.currentTarget,de(),!y.state.isVisible&&hO(C)&&ms.forEach(function(Q){return Q(C)}),C.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||s)&&y.props.hideOnClick!==!1&&y.state.isVisible?H=!0:Fi(C),C.type==="click"&&(s=!H),H&&!ee&&or(C)}}function bn(C){var $=C.target,H=_().contains($)||b.contains($);if(!(C.type==="mousemove"&&H)){var ee=Sn().concat(b).map(function(Q){var Ie,tt=Q._tippy,Pr=(Ie=tt.popperInstance)==null?void 0:Ie.state;return Pr?{popperRect:Q.getBoundingClientRect(),popperState:Pr,props:n}:null}).filter(Boolean);yO(ee,C)&&(ue(),or(C))}}function ir(C){var $=Bi(C)||y.props.trigger.indexOf("click")>=0&&s;if(!$){if(y.props.interactive){y.hideWithInteractivity(C);return}or(C)}}function wn(C){y.props.trigger.indexOf("focusin")<0&&C.target!==_()||y.props.interactive&&C.relatedTarget&&b.contains(C.relatedTarget)||or(C)}function Bi(C){return At.isTouch?T()!==C.type.indexOf("touch")>=0:!1}function rs(){is();var C=y.props,$=C.popperOptions,H=C.placement,ee=C.offset,Q=C.getReferenceClientRect,Ie=C.moveTransition,tt=M()?zf(b).arrow:null,Pr=Q?{getBoundingClientRect:Q,contextElement:Q.contextElement||_()}:t,xh={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(fs){var _r=fs.state;if(M()){var aS=W(),tc=aS.box;["placement","reference-hidden","escaped"].forEach(function(us){us==="placement"?tc.setAttribute("data-placement",_r.placement):_r.attributes.popper["data-popper-"+us]?tc.setAttribute("data-"+us,""):tc.removeAttribute("data-"+us)}),_r.attributes.popper={}}}},sr=[{name:"offset",options:{offset:ee}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ie}},xh];M()&&tt&&sr.push({name:"arrow",options:{element:tt,padding:3}}),sr.push.apply(sr,($==null?void 0:$.modifiers)||[]),y.popperInstance=iO(Pr,b,Object.assign({},$,{placement:H,onFirstUpdate:d,modifiers:sr}))}function is(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Kt(){var C=y.props.appendTo,$,H=_();y.props.interactive&&C===Lv||C==="parent"?$=H.parentNode:$=$v(C,[H]),$.contains(b)||$.appendChild(b),y.state.isMounted=!0,rs(),process.env.NODE_ENV!=="production"&&nn(y.props.interactive&&C===Ye.appendTo&&H.nextElementSibling!==b,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
20
+
21
+ `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
22
+
23
+ `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
24
+
25
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Sn(){return Cl(b.querySelectorAll("[data-tippy-root]"))}function Fi(C){y.clearDelayTimeouts(),C&&U("onTrigger",[y,C]),Oe();var $=B(!0),H=A(),ee=H[0],Q=H[1];At.isTouch&&ee==="hold"&&Q&&($=Q),$?r=setTimeout(function(){y.show()},$):y.show()}function or(C){if(y.clearDelayTimeouts(),U("onUntrigger",[y,C]),!y.state.isVisible){ze();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(C.type)>=0&&s)){var $=B(!1);$?i=setTimeout(function(){y.state.isVisible&&y.hide()},$):o=requestAnimationFrame(function(){y.hide()})}}function zi(){y.state.isEnabled=!0}function ss(){y.hide(),y.state.isEnabled=!1}function ls(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function as(C){if(process.env.NODE_ENV!=="production"&&nn(y.state.isDestroyed,Br("setProps")),!y.state.isDestroyed){U("onBeforeUpdate",[y,C]),qt();var $=y.props,H=Bp(t,Object.assign({},$,Ip(C),{ignoreAttributes:!0}));y.props=H,ht(),$.interactiveDebounce!==H.interactiveDebounce&&(ue(),p=Np(bn,H.interactiveDebounce)),$.triggerTarget&&!H.triggerTarget?Gr($.triggerTarget).forEach(function(ee){ee.removeAttribute("aria-expanded")}):H.triggerTarget&&t.removeAttribute("aria-expanded"),de(),I(),O&&O($,H),y.popperInstance&&(rs(),Sn().forEach(function(ee){requestAnimationFrame(ee._tippy.popperInstance.forceUpdate)})),U("onAfterUpdate",[y,C])}}function cs(C){y.setProps({content:C})}function rS(){process.env.NODE_ENV!=="production"&&nn(y.state.isDestroyed,Br("show"));var C=y.state.isVisible,$=y.state.isDestroyed,H=!y.state.isEnabled,ee=At.isTouch&&!y.props.touch,Q=yc(y.props.duration,0,Ye.duration);if(!(C||$||H||ee)&&!_().hasAttribute("disabled")&&(U("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,M()&&(b.style.visibility="visible"),I(),Oe(),y.state.isMounted||(b.style.transition="none"),M()){var Ie=W(),tt=Ie.box,Pr=Ie.content;vc([tt,Pr],0)}d=function(){var sr;if(!(!y.state.isVisible||c)){if(c=!0,b.offsetHeight,b.style.transition=y.props.moveTransition,M()&&y.props.animation){var ec=W(),fs=ec.box,_r=ec.content;vc([fs,_r],Q),Pp([fs,_r],"visible")}Y(),de(),Dp(wc,y),(sr=y.popperInstance)==null||sr.forceUpdate(),U("onMount",[y]),y.props.animation&&M()&&je(Q,function(){y.state.isShown=!0,U("onShown",[y])})}},Kt()}}function iS(){process.env.NODE_ENV!=="production"&&nn(y.state.isDestroyed,Br("hide"));var C=!y.state.isVisible,$=y.state.isDestroyed,H=!y.state.isEnabled,ee=yc(y.props.duration,1,Ye.duration);if(!(C||$||H)&&(U("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,c=!1,s=!1,M()&&(b.style.visibility="hidden"),ue(),ze(),I(!0),M()){var Q=W(),Ie=Q.box,tt=Q.content;y.props.animation&&(vc([Ie,tt],ee),Pp([Ie,tt],"hidden"))}Y(),de(),y.props.animation?M()&&dt(ee,y.unmount):y.unmount()}}function oS(C){process.env.NODE_ENV!=="production"&&nn(y.state.isDestroyed,Br("hideWithInteractivity")),L().addEventListener("mousemove",p),Dp(ms,p),p(C)}function sS(){process.env.NODE_ENV!=="production"&&nn(y.state.isDestroyed,Br("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(is(),Sn().forEach(function(C){C._tippy.unmount()}),b.parentNode&&b.parentNode.removeChild(b),wc=wc.filter(function(C){return C!==y}),y.state.isMounted=!1,U("onHidden",[y]))}function lS(){process.env.NODE_ENV!=="production"&&nn(y.state.isDestroyed,Br("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),qt(),delete t._tippy,y.state.isDestroyed=!0,U("onDestroy",[y]))}}function Qo(t,e){e===void 0&&(e={});var n=Ye.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(EO(t),Vv(e,n)),wO();var r=Object.assign({},e,{plugins:n}),i=gO(t);if(process.env.NODE_ENV!=="production"){var o=Ao(r.content),s=i.length>1;nn(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
26
+
27
+ `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
28
+
29
+ `,`1) content: element.innerHTML
30
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(a,c){var f=c&&DO(c,r);return f&&a.push(f),a},[]);return Ao(t)?l[0]:l}Qo.defaultProps=Ye;Qo.setDefaultProps=TO;Qo.currentInput=At;Object.assign({},Ev,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});var IO={name:"sticky",defaultValue:!1,fn:function(e){var n=e.reference,r=e.popper;function i(){return e.popperInstance?e.popperInstance.state.elements.reference:n}function o(c){return e.props.sticky===!0||e.props.sticky===c}var s=null,l=null;function a(){var c=o("reference")?i().getBoundingClientRect():null,f=o("popper")?r.getBoundingClientRect():null;(c&&jp(s,c)||f&&jp(l,f))&&e.popperInstance&&e.popperInstance.update(),s=c,l=f,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function jp(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}Qo.setDefaultProps({render:Hv});/**
31
+ * @license lucide-react v0.427.0 - ISC
32
+ *
33
+ * This source code is licensed under the ISC license.
34
+ * See the LICENSE file in the root directory of this source tree.
35
+ */const PO=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wv=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/**
36
+ * @license lucide-react v0.427.0 - ISC
37
+ *
38
+ * This source code is licensed under the ISC license.
39
+ * See the LICENSE file in the root directory of this source tree.
40
+ */var _O={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
41
+ * @license lucide-react v0.427.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */const LO=z.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},a)=>z.createElement("svg",{ref:a,..._O,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:Wv("lucide",i),...l},[...s.map(([c,f])=>z.createElement(c,f)),...Array.isArray(o)?o:[o]]));/**
46
+ * @license lucide-react v0.427.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */const P=(t,e)=>{const n=z.forwardRef(({className:r,...i},o)=>z.createElement(LO,{ref:o,iconNode:e,className:Wv(`lucide-${PO(t)}`,r),...i}));return n.displayName=`${t}`,n};/**
51
+ * @license lucide-react v0.427.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const $O=P("BetweenHorizontalEnd",[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]]);/**
56
+ * @license lucide-react v0.427.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const BO=P("BetweenHorizontalStart",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]);/**
61
+ * @license lucide-react v0.427.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const FO=P("BetweenVerticalEnd",[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]]);/**
66
+ * @license lucide-react v0.427.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const zO=P("BetweenVerticalStart",[["rect",{width:"7",height:"13",x:"3",y:"8",rx:"1",key:"1fjrkv"}],["path",{d:"m15 2-3 3-3-3",key:"1uh6eb"}],["rect",{width:"7",height:"13",x:"14",y:"8",rx:"1",key:"w3fjg8"}]]);/**
71
+ * @license lucide-react v0.427.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const jO=P("Bold",[["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"}]]);/**
76
+ * @license lucide-react v0.427.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const VO=P("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["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"}]]);/**
81
+ * @license lucide-react v0.427.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const HO=P("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
86
+ * @license lucide-react v0.427.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const WO=P("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
91
+ * @license lucide-react v0.427.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const UO=P("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
96
+ * @license lucide-react v0.427.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const qO=P("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
101
+ * @license lucide-react v0.427.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const GO=P("CircleHelp",[["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"}]]);/**
106
+ * @license lucide-react v0.427.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const KO=P("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
111
+ * @license lucide-react v0.427.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const JO=P("Clipboard",[["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"}]]);/**
116
+ * @license lucide-react v0.427.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const YO=P("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
121
+ * @license lucide-react v0.427.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const XO=P("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
126
+ * @license lucide-react v0.427.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const QO=P("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
131
+ * @license lucide-react v0.427.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const ZO=P("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
136
+ * @license lucide-react v0.427.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const eA=P("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
141
+ * @license lucide-react v0.427.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const tA=P("Columns4",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7.5 3v18",key:"w0wo6v"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M16.5 3v18",key:"10tjh1"}]]);/**
146
+ * @license lucide-react v0.427.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const nA=P("Copy",[["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"}]]);/**
151
+ * @license lucide-react v0.427.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const rA=P("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
156
+ * @license lucide-react v0.427.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const iA=P("Frame",[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]);/**
161
+ * @license lucide-react v0.427.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const oA=P("GripVertical",[["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"}]]);/**
166
+ * @license lucide-react v0.427.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const sA=P("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
171
+ * @license lucide-react v0.427.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const lA=P("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
176
+ * @license lucide-react v0.427.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const aA=P("Heading3",[["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"}]]);/**
181
+ * @license lucide-react v0.427.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const cA=P("Heading4",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v4h4",key:"13sv97"}],["path",{d:"M21 10v8",key:"1kdml4"}]]);/**
186
+ * @license lucide-react v0.427.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const fA=P("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]);/**
191
+ * @license lucide-react v0.427.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const uA=P("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]);/**
196
+ * @license lucide-react v0.427.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const dA=P("ImageUp",[["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"}]]);/**
201
+ * @license lucide-react v0.427.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const hA=P("IndentDecrease",[["polyline",{points:"7 8 3 12 7 16",key:"2j60jr"}],["line",{x1:"21",x2:"11",y1:"12",y2:"12",key:"1fxxak"}],["line",{x1:"21",x2:"11",y1:"6",y2:"6",key:"asgu94"}],["line",{x1:"21",x2:"11",y1:"18",y2:"18",key:"13dsj7"}]]);/**
206
+ * @license lucide-react v0.427.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const pA=P("IndentIncrease",[["polyline",{points:"3 8 7 12 3 16",key:"f3rxhf"}],["line",{x1:"21",x2:"11",y1:"12",y2:"12",key:"1fxxak"}],["line",{x1:"21",x2:"11",y1:"6",y2:"6",key:"asgu94"}],["line",{x1:"21",x2:"11",y1:"18",y2:"18",key:"13dsj7"}]]);/**
211
+ * @license lucide-react v0.427.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const gA=P("Italic",[["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"}]]);/**
216
+ * @license lucide-react v0.427.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const mA=P("Laugh",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z",key:"b2q4dd"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
221
+ * @license lucide-react v0.427.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const yA=P("Link",[["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"}]]);/**
226
+ * @license lucide-react v0.427.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const vA=P("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
231
+ * @license lucide-react v0.427.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const bA=P("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
236
+ * @license lucide-react v0.427.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const wA=P("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
241
+ * @license lucide-react v0.427.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const SA=P("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
246
+ * @license lucide-react v0.427.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const xA=P("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
251
+ * @license lucide-react v0.427.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const kA=P("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
256
+ * @license lucide-react v0.427.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const CA=P("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
261
+ * @license lucide-react v0.427.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const EA=P("PaintRoller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]);/**
266
+ * @license lucide-react v0.427.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const OA=P("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
271
+ * @license lucide-react v0.427.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const AA=P("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
276
+ * @license lucide-react v0.427.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const TA=P("Pencil",[["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"}]]);/**
281
+ * @license lucide-react v0.427.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const MA=P("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
286
+ * @license lucide-react v0.427.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const RA=P("Quote",[["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"}]]);/**
291
+ * @license lucide-react v0.427.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const NA=P("Redo2",[["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"}]]);/**
296
+ * @license lucide-react v0.427.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const DA=P("Replace",[["path",{d:"M14 4a2 2 0 0 1 2-2",key:"1w2hp7"}],["path",{d:"M16 10a2 2 0 0 1-2-2",key:"shjach"}],["path",{d:"M20 2a2 2 0 0 1 2 2",key:"188mtx"}],["path",{d:"M22 8a2 2 0 0 1-2 2",key:"ddf4tu"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a3 3 0 0 1 3-3h1",key:"3y3t5z"}],["rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",key:"4rksxw"}]]);/**
301
+ * @license lucide-react v0.427.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const IA=P("Sigma",[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]);/**
306
+ * @license lucide-react v0.427.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const PA=P("SmilePlus",[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]]);/**
311
+ * @license lucide-react v0.427.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const _A=P("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
316
+ * @license lucide-react v0.427.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const LA=P("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
321
+ * @license lucide-react v0.427.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const $A=P("Subscript",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);/**
326
+ * @license lucide-react v0.427.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const BA=P("Superscript",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);/**
331
+ * @license lucide-react v0.427.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const FA=P("TableCellsMerge",[["path",{d:"M12 21v-6",key:"lihzve"}],["path",{d:"M12 9V3",key:"da5inc"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
336
+ * @license lucide-react v0.427.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const zA=P("TableCellsSplit",[["path",{d:"M12 15V9",key:"8c7uyn"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
341
+ * @license lucide-react v0.427.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const jA=P("Table",[["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"}]]);/**
346
+ * @license lucide-react v0.427.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const VA=P("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
351
+ * @license lucide-react v0.427.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const HA=P("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
356
+ * @license lucide-react v0.427.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const WA=P("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
361
+ * @license lucide-react v0.427.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const UA=P("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
366
+ * @license lucide-react v0.427.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const qA=P("Undo2",[["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"}]]);/**
371
+ * @license lucide-react v0.427.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const GA=P("Unlink",[["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"}]]);/**
376
+ * @license lucide-react v0.427.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const KA=P("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
381
+ * @license lucide-react v0.427.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const JA=P("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var rn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function YA(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Vp=Object.prototype.toString,Uv=function(e){var n=Vp.call(e),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Vp.call(e.callee)==="[object Function]"),r},Sc,Hp;function XA(){if(Hp)return Sc;Hp=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Uv,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(d){var h=d.constructor;return h&&h.prototype===d},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var d in window)try{if(!c["$"+d]&&e.call(window,d)&&window[d]!==null&&typeof window[d]=="object")try{a(window[d])}catch{return!0}}catch{return!0}return!1}(),u=function(d){if(typeof window>"u"||!f)return a(d);try{return a(d)}catch{return!1}};t=function(h){var p=h!==null&&typeof h=="object",g=n.call(h)==="[object Function]",m=r(h),v=p&&n.call(h)==="[object String]",w=[];if(!p&&!g&&!m)throw new TypeError("Object.keys called on a non-object");var S=s&&g;if(v&&h.length>0&&!e.call(h,0))for(var y=0;y<h.length;++y)w.push(String(y));if(m&&h.length>0)for(var x=0;x<h.length;++x)w.push(String(x));else for(var b in h)!(S&&b==="prototype")&&e.call(h,b)&&w.push(String(b));if(o)for(var O=u(h),R=0;R<l.length;++R)!(O&&l[R]==="constructor")&&e.call(h,l[R])&&w.push(l[R]);return w}}return Sc=t,Sc}var QA=Array.prototype.slice,ZA=Uv,Wp=Object.keys,Ws=Wp?function(e){return Wp(e)}:XA(),Up=Object.keys;Ws.shim=function(){if(Object.keys){var e=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);e||(Object.keys=function(r){return ZA(r)?Up(QA.call(r)):Up(r)})}else Object.keys=Ws;return Object.keys||Ws};var Cd=Ws,eT=Error,tT=EvalError,nT=RangeError,rT=ReferenceError,qv=SyntaxError,er=TypeError,iT=URIError,La=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},qp=typeof Symbol<"u"&&Symbol,oT=La,Ed=function(){return typeof qp!="function"||typeof Symbol!="function"||typeof qp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:oT()},xc={__proto__:null,foo:{}},sT=Object,lT=function(){return{__proto__:xc}.foo===xc.foo&&!(xc instanceof sT)},aT="Function.prototype.bind called on incompatible ",cT=Object.prototype.toString,fT=Math.max,uT="[object Function]",Gp=function(e,n){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var o=0;o<n.length;o+=1)r[o+e.length]=n[o];return r},dT=function(e,n){for(var r=[],i=n,o=0;i<e.length;i+=1,o+=1)r[o]=e[i];return r},hT=function(t,e){for(var n="",r=0;r<t.length;r+=1)n+=t[r],r+1<t.length&&(n+=e);return n},pT=function(e){var n=this;if(typeof n!="function"||cT.apply(n)!==uT)throw new TypeError(aT+n);for(var r=dT(arguments,1),i,o=function(){if(this instanceof i){var f=n.apply(this,Gp(r,arguments));return Object(f)===f?f:this}return n.apply(e,Gp(r,arguments))},s=fT(0,n.length-r.length),l=[],a=0;a<s;a++)l[a]="$"+a;if(i=Function("binder","return function ("+hT(l,",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var c=function(){};c.prototype=n.prototype,i.prototype=new c,c.prototype=null}return i},gT=pT,Od=Function.prototype.bind||gT,mT=Function.prototype.call,yT=Object.prototype.hasOwnProperty,vT=Od,Gv=vT.call(mT,yT),X,bT=eT,wT=tT,ST=nT,xT=rT,mi=qv,ri=er,kT=iT,Kv=Function,kc=function(t){try{return Kv('"use strict"; return ('+t+").constructor;")()}catch{}},yr=Object.getOwnPropertyDescriptor;if(yr)try{yr({},"")}catch{yr=null}var Cc=function(){throw new ri},CT=yr?function(){try{return arguments.callee,Cc}catch{try{return yr(arguments,"callee").get}catch{return Cc}}}():Cc,Fr=Ed(),ET=lT(),pe=Object.getPrototypeOf||(ET?function(t){return t.__proto__}:null),Kr={},OT=typeof Uint8Array>"u"||!pe?X:pe(Uint8Array),vr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?X:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?X:ArrayBuffer,"%ArrayIteratorPrototype%":Fr&&pe?pe([][Symbol.iterator]()):X,"%AsyncFromSyncIteratorPrototype%":X,"%AsyncFunction%":Kr,"%AsyncGenerator%":Kr,"%AsyncGeneratorFunction%":Kr,"%AsyncIteratorPrototype%":Kr,"%Atomics%":typeof Atomics>"u"?X:Atomics,"%BigInt%":typeof BigInt>"u"?X:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?X:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?X:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?X:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":bT,"%eval%":eval,"%EvalError%":wT,"%Float32Array%":typeof Float32Array>"u"?X:Float32Array,"%Float64Array%":typeof Float64Array>"u"?X:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?X:FinalizationRegistry,"%Function%":Kv,"%GeneratorFunction%":Kr,"%Int8Array%":typeof Int8Array>"u"?X:Int8Array,"%Int16Array%":typeof Int16Array>"u"?X:Int16Array,"%Int32Array%":typeof Int32Array>"u"?X:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Fr&&pe?pe(pe([][Symbol.iterator]())):X,"%JSON%":typeof JSON=="object"?JSON:X,"%Map%":typeof Map>"u"?X:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Fr||!pe?X:pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?X:Promise,"%Proxy%":typeof Proxy>"u"?X:Proxy,"%RangeError%":ST,"%ReferenceError%":xT,"%Reflect%":typeof Reflect>"u"?X:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?X:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Fr||!pe?X:pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?X:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Fr&&pe?pe(""[Symbol.iterator]()):X,"%Symbol%":Fr?Symbol:X,"%SyntaxError%":mi,"%ThrowTypeError%":CT,"%TypedArray%":OT,"%TypeError%":ri,"%Uint8Array%":typeof Uint8Array>"u"?X:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?X:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?X:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?X:Uint32Array,"%URIError%":kT,"%WeakMap%":typeof WeakMap>"u"?X:WeakMap,"%WeakRef%":typeof WeakRef>"u"?X:WeakRef,"%WeakSet%":typeof WeakSet>"u"?X:WeakSet};if(pe)try{null.error}catch(t){var AT=pe(pe(t));vr["%Error.prototype%"]=AT}var TT=function t(e){var n;if(e==="%AsyncFunction%")n=kc("async function () {}");else if(e==="%GeneratorFunction%")n=kc("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=kc("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&pe&&(n=pe(i.prototype))}return vr[e]=n,n},Kp={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Zo=Od,El=Gv,MT=Zo.call(Function.call,Array.prototype.concat),RT=Zo.call(Function.apply,Array.prototype.splice),Jp=Zo.call(Function.call,String.prototype.replace),Ol=Zo.call(Function.call,String.prototype.slice),NT=Zo.call(Function.call,RegExp.prototype.exec),DT=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,IT=/\\(\\)?/g,PT=function(e){var n=Ol(e,0,1),r=Ol(e,-1);if(n==="%"&&r!=="%")throw new mi("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new mi("invalid intrinsic syntax, expected opening `%`");var i=[];return Jp(e,DT,function(o,s,l,a){i[i.length]=l?Jp(a,IT,"$1"):s||o}),i},_T=function(e,n){var r=e,i;if(El(Kp,r)&&(i=Kp[r],r="%"+i[0]+"%"),El(vr,r)){var o=vr[r];if(o===Kr&&(o=TT(r)),typeof o>"u"&&!n)throw new ri("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new mi("intrinsic "+e+" does not exist!")},Vt=function(e,n){if(typeof e!="string"||e.length===0)throw new ri("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new ri('"allowMissing" argument must be a boolean');if(NT(/^%?[^%]*%?$/,e)===null)throw new mi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=PT(e),i=r.length>0?r[0]:"",o=_T("%"+i+"%",n),s=o.name,l=o.value,a=!1,c=o.alias;c&&(i=c[0],RT(r,MT([0,1],c)));for(var f=1,u=!0;f<r.length;f+=1){var d=r[f],h=Ol(d,0,1),p=Ol(d,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new mi("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(a=!0),i+="."+d,s="%"+i+"%",El(vr,s))l=vr[s];else if(l!=null){if(!(d in l)){if(!n)throw new ri("base intrinsic for "+e+" exists, but the property is not available.");return}if(yr&&f+1>=r.length){var g=yr(l,d);u=!!g,u&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[d]}else u=El(l,d),l=l[d];u&&!a&&(vr[s]=l)}}return l},LT=Vt,Us=LT("%Object.defineProperty%",!0)||!1;if(Us)try{Us({},"a",{value:1})}catch{Us=!1}var Ad=Us,$T=Vt,qs=$T("%Object.getOwnPropertyDescriptor%",!0);if(qs)try{qs([],"length")}catch{qs=null}var Td=qs,Yp=Ad,BT=qv,zr=er,Xp=Td,Md=function(e,n,r){if(!e||typeof e!="object"&&typeof e!="function")throw new zr("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new zr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new zr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new zr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new zr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new zr("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,a=!!Xp&&Xp(e,n);if(Yp)Yp(e,n,{configurable:s===null&&a?a.configurable:!s,enumerable:i===null&&a?a.enumerable:!i,value:r,writable:o===null&&a?a.writable:!o});else if(l||!i&&!o&&!s)e[n]=r;else throw new BT("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},jf=Ad,Jv=function(){return!!jf};Jv.hasArrayLengthDefineBug=function(){if(!jf)return null;try{return jf([],"length",{value:1}).length!==1}catch{return!0}};var Rd=Jv,FT=Cd,zT=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",jT=Object.prototype.toString,VT=Array.prototype.concat,Qp=Md,HT=function(t){return typeof t=="function"&&jT.call(t)==="[object Function]"},Yv=Rd(),WT=function(t,e,n,r){if(e in t){if(r===!0){if(t[e]===n)return}else if(!HT(r)||!r())return}Yv?Qp(t,e,n,!0):Qp(t,e,n)},Xv=function(t,e){var n=arguments.length>2?arguments[2]:{},r=FT(e);zT&&(r=VT.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)WT(t,r[i],e[r[i]],n[r[i]])};Xv.supportsDescriptors=!!Yv;var Rr=Xv,Qv={exports:{}},UT=Vt,Zp=Md,qT=Rd(),eg=Td,tg=er,GT=UT("%Math.floor%"),KT=function(e,n){if(typeof e!="function")throw new tg("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||GT(n)!==n)throw new tg("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&eg){var s=eg(e,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(o=!1)}return(i||o||!r)&&(qT?Zp(e,"length",n,!0,!0):Zp(e,"length",n)),e};(function(t){var e=Od,n=Vt,r=KT,i=er,o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||e.call(s,o),a=Ad,c=n("%Math.max%");t.exports=function(d){if(typeof d!="function")throw new i("a function is required");var h=l(e,s,arguments);return r(h,1+c(0,d.length-(arguments.length-1)),!0)};var f=function(){return l(e,o,arguments)};a?a(t.exports,"apply",{value:f}):t.exports.apply=f})(Qv);var Mi=Qv.exports,Zv=Vt,e1=Mi,JT=e1(Zv("String.prototype.indexOf")),ut=function(e,n){var r=Zv(e,!!n);return typeof r=="function"&&JT(e,".prototype.")>-1?e1(r):r},YT=Cd,t1=La(),n1=ut,ng=Object,XT=n1("Array.prototype.push"),rg=n1("Object.prototype.propertyIsEnumerable"),QT=t1?Object.getOwnPropertySymbols:null,r1=function(e,n){if(e==null)throw new TypeError("target must be an object");var r=ng(e);if(arguments.length===1)return r;for(var i=1;i<arguments.length;++i){var o=ng(arguments[i]),s=YT(o),l=t1&&(Object.getOwnPropertySymbols||QT);if(l)for(var a=l(o),c=0;c<a.length;++c){var f=a[c];rg(o,f)&&XT(s,f)}for(var u=0;u<s.length;++u){var d=s[u];if(rg(o,d)){var h=o[d];r[d]=h}}}return r},Ec=r1,ZT=function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),n={},r=0;r<e.length;++r)n[e[r]]=e[r];var i=Object.assign({},n),o="";for(var s in i)o+=s;return t!==o},e2=function(){if(!Object.assign||!Object.preventExtensions)return!1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch{return t[1]==="y"}return!1},i1=function(){return!Object.assign||ZT()||e2()?Ec:Object.assign},t2=Rr,n2=i1,r2=function(){var e=n2();return t2(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e},i2=Rr,o2=Mi,s2=r1,o1=i1,l2=r2,a2=o2.apply(o1()),s1=function(e,n){return a2(Object,arguments)};i2(s1,{getPolyfill:o1,implementation:s2,shim:l2});var c2=s1,Mo=function(){return typeof(function(){}).name=="string"},so=Object.getOwnPropertyDescriptor;if(so)try{so([],"length")}catch{so=null}Mo.functionsHaveConfigurableNames=function(){if(!Mo()||!so)return!1;var e=so(function(){},"name");return!!e&&!!e.configurable};var f2=Function.prototype.bind;Mo.boundFunctionsHaveNames=function(){return Mo()&&typeof f2=="function"&&(function(){}).bind().name!==""};var u2=Mo,ig=Md,d2=Rd(),h2=u2.functionsHaveConfigurableNames(),p2=er,g2=function(e,n){if(typeof e!="function")throw new p2("`fn` is not a function");var r=arguments.length>2&&!!arguments[2];return(!r||h2)&&(d2?ig(e,"name",n,!0,!0):ig(e,"name",n)),e},m2=g2,y2=er,v2=Object,l1=m2(function(){if(this==null||this!==v2(this))throw new y2("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),b2=l1,w2=Rr.supportsDescriptors,S2=Object.getOwnPropertyDescriptor,a1=function(){if(w2&&/a/mig.flags==="gim"){var e=S2(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var n="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){n+="d"}}),Object.defineProperty(r,"sticky",{get:function(){n+="y"}}),n==="dy")return e.get}}return b2},x2=Rr.supportsDescriptors,k2=a1,C2=Object.getOwnPropertyDescriptor,E2=Object.defineProperty,O2=TypeError,og=Object.getPrototypeOf,A2=/a/,T2=function(){if(!x2||!og)throw new O2("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=k2(),n=og(A2),r=C2(n,"flags");return(!r||r.get!==e)&&E2(n,"flags",{configurable:!0,enumerable:!1,get:e}),e},M2=Rr,R2=Mi,N2=l1,c1=a1,D2=T2,f1=R2(c1());M2(f1,{getPolyfill:c1,implementation:N2,shim:D2});var I2=f1,Gs={exports:{}},P2=La,Nr=function(){return P2()&&!!Symbol.toStringTag},_2=Nr(),L2=ut,Vf=L2("Object.prototype.toString"),$a=function(e){return _2&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Vf(e)==="[object Arguments]"},u1=function(e){return $a(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Vf(e)!=="[object Array]"&&Vf(e.callee)==="[object Function]"},$2=function(){return $a(arguments)}();$a.isLegacyArguments=u1;var d1=$2?$a:u1;const B2={},F2=Object.freeze(Object.defineProperty({__proto__:null,default:B2},Symbol.toStringTag,{value:"Module"})),z2=YA(F2);var Nd=typeof Map=="function"&&Map.prototype,Oc=Object.getOwnPropertyDescriptor&&Nd?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Al=Nd&&Oc&&typeof Oc.get=="function"?Oc.get:null,sg=Nd&&Map.prototype.forEach,Dd=typeof Set=="function"&&Set.prototype,Ac=Object.getOwnPropertyDescriptor&&Dd?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Tl=Dd&&Ac&&typeof Ac.get=="function"?Ac.get:null,lg=Dd&&Set.prototype.forEach,j2=typeof WeakMap=="function"&&WeakMap.prototype,lo=j2?WeakMap.prototype.has:null,V2=typeof WeakSet=="function"&&WeakSet.prototype,ao=V2?WeakSet.prototype.has:null,H2=typeof WeakRef=="function"&&WeakRef.prototype,ag=H2?WeakRef.prototype.deref:null,W2=Boolean.prototype.valueOf,U2=Object.prototype.toString,q2=Function.prototype.toString,G2=String.prototype.match,Id=String.prototype.slice,Fn=String.prototype.replace,K2=String.prototype.toUpperCase,cg=String.prototype.toLowerCase,h1=RegExp.prototype.test,fg=Array.prototype.concat,Tt=Array.prototype.join,J2=Array.prototype.slice,ug=Math.floor,Hf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Tc=Object.getOwnPropertySymbols,Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,yi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Me=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===yi||!0)?Symbol.toStringTag:null,p1=Object.prototype.propertyIsEnumerable,dg=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function hg(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||h1.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-ug(-t):ug(t);if(r!==t){var i=String(r),o=Id.call(e,i.length+1);return Fn.call(i,n,"$&_")+"."+Fn.call(Fn.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Fn.call(e,n,"$&_")}var Uf=z2,pg=Uf.custom,gg=m1(pg)?pg:null,Y2=function t(e,n,r,i){var o=n||{};if(An(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(An(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=An(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(An(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(An(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return v1(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return l?hg(e,a):a}if(typeof e=="bigint"){var c=String(e)+"n";return l?hg(e,c):c}var f=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof e=="object")return qf(e)?"[Array]":"[Object]";var u=pM(o,r);if(typeof i>"u")i=[];else if(y1(i,e)>=0)return"[Circular]";function d(_,L,W){if(L&&(i=J2.call(i),i.push(L)),W){var B={depth:o.depth};return An(o,"quoteStyle")&&(B.quoteStyle=o.quoteStyle),t(_,B,r+1,i)}return t(_,o,r+1,i)}if(typeof e=="function"&&!mg(e)){var h=oM(e),p=ys(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(p.length>0?" { "+Tt.call(p,", ")+" }":"")}if(m1(e)){var g=yi?Fn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Wf.call(e);return typeof e=="object"&&!yi?Ui(g):g}if(uM(e)){for(var m="<"+cg.call(String(e.nodeName)),v=e.attributes||[],w=0;w<v.length;w++)m+=" "+v[w].name+"="+g1(X2(v[w].value),"double",o);return m+=">",e.childNodes&&e.childNodes.length&&(m+="..."),m+="</"+cg.call(String(e.nodeName))+">",m}if(qf(e)){if(e.length===0)return"[]";var S=ys(e,d);return u&&!hM(S)?"["+Gf(S,u)+"]":"[ "+Tt.call(S,", ")+" ]"}if(Z2(e)){var y=ys(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!p1.call(e,"cause")?"{ ["+String(e)+"] "+Tt.call(fg.call("[cause]: "+d(e.cause),y),", ")+" }":y.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Tt.call(y,", ")+" }"}if(typeof e=="object"&&s){if(gg&&typeof e[gg]=="function"&&Uf)return Uf(e,{depth:f-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(sM(e)){var x=[];return sg&&sg.call(e,function(_,L){x.push(d(L,e,!0)+" => "+d(_,e))}),yg("Map",Al.call(e),x,u)}if(cM(e)){var b=[];return lg&&lg.call(e,function(_){b.push(d(_,e))}),yg("Set",Tl.call(e),b,u)}if(lM(e))return Mc("WeakMap");if(fM(e))return Mc("WeakSet");if(aM(e))return Mc("WeakRef");if(tM(e))return Ui(d(Number(e)));if(rM(e))return Ui(d(Hf.call(e)));if(nM(e))return Ui(W2.call(e));if(eM(e))return Ui(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof rn<"u"&&e===rn)return"{ [object globalThis] }";if(!Q2(e)&&!mg(e)){var O=ys(e,d),R=dg?dg(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",A=!R&&Me&&Object(e)===e&&Me in e?Id.call(tr(e),8,-1):k?"Object":"",T=R||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",M=T+(A||k?"["+Tt.call(fg.call([],A||[],k||[]),": ")+"] ":"");return O.length===0?M+"{}":u?M+"{"+Gf(O,u)+"}":M+"{ "+Tt.call(O,", ")+" }"}return String(e)};function g1(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function X2(t){return Fn.call(String(t),/"/g,"&quot;")}function qf(t){return tr(t)==="[object Array]"&&(!Me||!(typeof t=="object"&&Me in t))}function Q2(t){return tr(t)==="[object Date]"&&(!Me||!(typeof t=="object"&&Me in t))}function mg(t){return tr(t)==="[object RegExp]"&&(!Me||!(typeof t=="object"&&Me in t))}function Z2(t){return tr(t)==="[object Error]"&&(!Me||!(typeof t=="object"&&Me in t))}function eM(t){return tr(t)==="[object String]"&&(!Me||!(typeof t=="object"&&Me in t))}function tM(t){return tr(t)==="[object Number]"&&(!Me||!(typeof t=="object"&&Me in t))}function nM(t){return tr(t)==="[object Boolean]"&&(!Me||!(typeof t=="object"&&Me in t))}function m1(t){if(yi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Wf)return!1;try{return Wf.call(t),!0}catch{}return!1}function rM(t){if(!t||typeof t!="object"||!Hf)return!1;try{return Hf.call(t),!0}catch{}return!1}var iM=Object.prototype.hasOwnProperty||function(t){return t in this};function An(t,e){return iM.call(t,e)}function tr(t){return U2.call(t)}function oM(t){if(t.name)return t.name;var e=G2.call(q2.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function y1(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function sM(t){if(!Al||!t||typeof t!="object")return!1;try{Al.call(t);try{Tl.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function lM(t){if(!lo||!t||typeof t!="object")return!1;try{lo.call(t,lo);try{ao.call(t,ao)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function aM(t){if(!ag||!t||typeof t!="object")return!1;try{return ag.call(t),!0}catch{}return!1}function cM(t){if(!Tl||!t||typeof t!="object")return!1;try{Tl.call(t);try{Al.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function fM(t){if(!ao||!t||typeof t!="object")return!1;try{ao.call(t,ao);try{lo.call(t,lo)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function uM(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function v1(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return v1(Id.call(t,0,e.maxStringLength),e)+r}var i=Fn.call(Fn.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,dM);return g1(i,"single",e)}function dM(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+K2.call(e.toString(16))}function Ui(t){return"Object("+t+")"}function Mc(t){return t+" { ? }"}function yg(t,e,n,r){var i=r?Gf(n,r):Tt.call(n,", ");return t+" ("+e+") {"+i+"}"}function hM(t){for(var e=0;e<t.length;e++)if(y1(t[e],`
386
+ `)>=0)return!1;return!0}function pM(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=Tt.call(Array(t.indent+1)," ");else return null;return{base:n,prev:Tt.call(Array(e+1),n)}}function Gf(t,e){if(t.length===0)return"";var n=`
387
+ `+e.prev+e.base;return n+Tt.call(t,","+n)+`
388
+ `+e.prev}function ys(t,e){var n=qf(t),r=[];if(n){r.length=t.length;for(var i=0;i<t.length;i++)r[i]=An(t,i)?e(t[i],t):""}var o=typeof Tc=="function"?Tc(t):[],s;if(yi){s={};for(var l=0;l<o.length;l++)s["$"+o[l]]=o[l]}for(var a in t)An(t,a)&&(n&&String(Number(a))===a&&a<t.length||yi&&s["$"+a]instanceof Symbol||(h1.call(/[^\w$]/,a)?r.push(e(a,t)+": "+e(t[a],t)):r.push(a+": "+e(t[a],t))));if(typeof Tc=="function")for(var c=0;c<o.length;c++)p1.call(t,o[c])&&r.push("["+e(o[c])+"]: "+e(t[o[c]],t));return r}var b1=Vt,Ri=ut,gM=Y2,mM=er,vs=b1("%WeakMap%",!0),bs=b1("%Map%",!0),yM=Ri("WeakMap.prototype.get",!0),vM=Ri("WeakMap.prototype.set",!0),bM=Ri("WeakMap.prototype.has",!0),wM=Ri("Map.prototype.get",!0),SM=Ri("Map.prototype.set",!0),xM=Ri("Map.prototype.has",!0),Pd=function(t,e){for(var n=t,r;(r=n.next)!==null;n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},kM=function(t,e){var n=Pd(t,e);return n&&n.value},CM=function(t,e,n){var r=Pd(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}},EM=function(t,e){return!!Pd(t,e)},w1=function(){var e,n,r,i={assert:function(o){if(!i.has(o))throw new mM("Side channel does not contain "+gM(o))},get:function(o){if(vs&&o&&(typeof o=="object"||typeof o=="function")){if(e)return yM(e,o)}else if(bs){if(n)return wM(n,o)}else if(r)return kM(r,o)},has:function(o){if(vs&&o&&(typeof o=="object"||typeof o=="function")){if(e)return bM(e,o)}else if(bs){if(n)return xM(n,o)}else if(r)return EM(r,o);return!1},set:function(o,s){vs&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new vs),vM(e,o,s)):bs?(n||(n=new bs),SM(n,o,s)):(r||(r={key:{},next:null}),CM(r,o,s))}};return i},OM=Gv,qi=w1(),Xt=er,_d={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Xt("`O` is not an object");if(typeof e!="string")throw new Xt("`slot` must be a string");if(qi.assert(t),!_d.has(t,e))throw new Xt("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Xt("`O` is not an object");if(typeof e!="string")throw new Xt("`slot` must be a string");var n=qi.get(t);return n&&n["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Xt("`O` is not an object");if(typeof e!="string")throw new Xt("`slot` must be a string");var n=qi.get(t);return!!n&&OM(n,"$"+e)},set:function(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Xt("`O` is not an object");if(typeof e!="string")throw new Xt("`slot` must be a string");var r=qi.get(t);r||(r={},qi.set(t,r)),r["$"+e]=n}};Object.freeze&&Object.freeze(_d);var AM=_d,Gi=AM,TM=SyntaxError,vg=typeof StopIteration=="object"?StopIteration:null,MM=function(e){if(!vg)throw new TM("this environment lacks StopIteration");Gi.set(e,"[[Done]]",!1);var n={next:function(){var i=Gi.get(this,"[[Iterator]]"),o=Gi.get(i,"[[Done]]");try{return{done:o,value:o?void 0:i.next()}}catch(s){if(Gi.set(i,"[[Done]]",!0),s!==vg)throw s;return{done:!0,value:void 0}}}};return Gi.set(n,"[[Iterator]]",e),n},RM={}.toString,S1=Array.isArray||function(t){return RM.call(t)=="[object Array]"},NM=String.prototype.valueOf,DM=function(e){try{return NM.call(e),!0}catch{return!1}},IM=Object.prototype.toString,PM="[object String]",_M=Nr(),x1=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:_M?DM(e):IM.call(e)===PM},Ld=typeof Map=="function"&&Map.prototype?Map:null,LM=typeof Set=="function"&&Set.prototype?Set:null,Ml;Ld||(Ml=function(e){return!1});var k1=Ld?Map.prototype.has:null,bg=LM?Set.prototype.has:null;!Ml&&!k1&&(Ml=function(e){return!1});var C1=Ml||function(e){if(!e||typeof e!="object")return!1;try{if(k1.call(e),bg)try{bg.call(e)}catch{return!0}return e instanceof Ld}catch{}return!1},$M=typeof Map=="function"&&Map.prototype?Map:null,$d=typeof Set=="function"&&Set.prototype?Set:null,Rl;$d||(Rl=function(e){return!1});var wg=$M?Map.prototype.has:null,E1=$d?Set.prototype.has:null;!Rl&&!E1&&(Rl=function(e){return!1});var O1=Rl||function(e){if(!e||typeof e!="object")return!1;try{if(E1.call(e),wg)try{wg.call(e)}catch{return!0}return e instanceof $d}catch{}return!1},Sg=d1,xg=MM;if(Ed()||La()){var Rc=Symbol.iterator;Gs.exports=function(e){if(e!=null&&typeof e[Rc]<"u")return e[Rc]();if(Sg(e))return Array.prototype[Rc].call(e)}}else{var BM=S1,FM=x1,kg=Vt,zM=kg("%Map%",!0),jM=kg("%Set%",!0),pt=ut,Cg=pt("Array.prototype.push"),Eg=pt("String.prototype.charCodeAt"),VM=pt("String.prototype.slice"),HM=function(e,n){var r=e.length;if(n+1>=r)return n+1;var i=Eg(e,n);if(i<55296||i>56319)return n+1;var o=Eg(e,n+1);return o<56320||o>57343?n+1:n+2},Nc=function(e){var n=0;return{next:function(){var i=n>=e.length,o;return i||(o=e[n],n+=1),{done:i,value:o}}}},Og=function(e,n){if(BM(e)||Sg(e))return Nc(e);if(FM(e)){var r=0;return{next:function(){var o=HM(e,r),s=VM(e,r,o);return r=o,{done:o>e.length,value:s}}}}if(n&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()};if(!zM&&!jM)Gs.exports=function(e){if(e!=null)return Og(e,!0)};else{var WM=C1,UM=O1,Ag=pt("Map.prototype.forEach",!0),Tg=pt("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var Mg=pt("Map.prototype.iterator",!0),Rg=pt("Set.prototype.iterator",!0);var Ng=pt("Map.prototype.@@iterator",!0)||pt("Map.prototype._es6-shim iterator_",!0),Dg=pt("Set.prototype.@@iterator",!0)||pt("Set.prototype._es6-shim iterator_",!0),qM=function(e){if(WM(e)){if(Mg)return xg(Mg(e));if(Ng)return Ng(e);if(Ag){var n=[];return Ag(e,function(i,o){Cg(n,[o,i])}),Nc(n)}}if(UM(e)){if(Rg)return xg(Rg(e));if(Dg)return Dg(e);if(Tg){var r=[];return Tg(e,function(i){Cg(r,i)}),Nc(r)}}};Gs.exports=function(e){return qM(e)||Og(e)}}}var GM=Gs.exports,Ig=function(t){return t!==t},A1=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||Ig(e)&&Ig(n))},KM=A1,T1=function(){return typeof Object.is=="function"?Object.is:KM},JM=T1,YM=Rr,XM=function(){var e=JM();return YM(Object,{is:e},{is:function(){return Object.is!==e}}),e},QM=Rr,ZM=Mi,eR=A1,M1=T1,tR=XM,R1=ZM(M1(),Object);QM(R1,{getPolyfill:M1,implementation:eR,shim:tR});var nR=R1,rR=Mi,N1=ut,iR=Vt,Kf=iR("%ArrayBuffer%",!0),Ks=N1("ArrayBuffer.prototype.byteLength",!0),oR=N1("Object.prototype.toString"),Pg=!!Kf&&!Ks&&new Kf(0).slice,_g=!!Pg&&rR(Pg),D1=Ks||_g?function(e){if(!e||typeof e!="object")return!1;try{return Ks?Ks(e):_g(e,0),!0}catch{return!1}}:Kf?function(e){return oR(e)==="[object ArrayBuffer]"}:function(e){return!1},sR=Date.prototype.getDay,lR=function(e){try{return sR.call(e),!0}catch{return!1}},aR=Object.prototype.toString,cR="[object Date]",fR=Nr(),uR=function(e){return typeof e!="object"||e===null?!1:fR?lR(e):aR.call(e)===cR},Jf=ut,I1=Nr(),P1,_1,Yf,Xf;if(I1){P1=Jf("Object.prototype.hasOwnProperty"),_1=Jf("RegExp.prototype.exec"),Yf={};var Dc=function(){throw Yf};Xf={toString:Dc,valueOf:Dc},typeof Symbol.toPrimitive=="symbol"&&(Xf[Symbol.toPrimitive]=Dc)}var dR=Jf("Object.prototype.toString"),hR=Object.getOwnPropertyDescriptor,pR="[object RegExp]",gR=I1?function(e){if(!e||typeof e!="object")return!1;var n=hR(e,"lastIndex"),r=n&&P1(n,"value");if(!r)return!1;try{_1(e,Xf)}catch(i){return i===Yf}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:dR(e)===pR},mR=ut,Lg=mR("SharedArrayBuffer.prototype.byteLength",!0),yR=Lg?function(e){if(!e||typeof e!="object")return!1;try{return Lg(e),!0}catch{return!1}}:function(e){return!1},vR=Number.prototype.toString,bR=function(e){try{return vR.call(e),!0}catch{return!1}},wR=Object.prototype.toString,SR="[object Number]",xR=Nr(),kR=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:xR?bR(e):wR.call(e)===SR},L1=ut,CR=L1("Boolean.prototype.toString"),ER=L1("Object.prototype.toString"),OR=function(e){try{return CR(e),!0}catch{return!1}},AR="[object Boolean]",TR=Nr(),MR=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:TR&&Symbol.toStringTag in e?OR(e):ER(e)===AR},Qf={exports:{}},RR=Object.prototype.toString,NR=Ed();if(NR){var DR=Symbol.prototype.toString,IR=/^Symbol\(.*\)$/,PR=function(e){return typeof e.valueOf()!="symbol"?!1:IR.test(DR.call(e))};Qf.exports=function(e){if(typeof e=="symbol")return!0;if(RR.call(e)!=="[object Symbol]")return!1;try{return PR(e)}catch{return!1}}}else Qf.exports=function(e){return!1};var _R=Qf.exports,Zf={exports:{}},$g=typeof BigInt<"u"&&BigInt,LR=function(){return typeof $g=="function"&&typeof BigInt=="function"&&typeof $g(42)=="bigint"&&typeof BigInt(42)=="bigint"},$R=LR();if($R){var BR=BigInt.prototype.valueOf,FR=function(e){try{return BR.call(e),!0}catch{}return!1};Zf.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:FR(e)}}else Zf.exports=function(e){return!1};var zR=Zf.exports,jR=x1,VR=kR,HR=MR,WR=_R,UR=zR,qR=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(jR(e))return"String";if(VR(e))return"Number";if(HR(e))return"Boolean";if(WR(e))return"Symbol";if(UR(e))return"BigInt"},Nl=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Bg=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Dl;Nl||(Dl=function(e){return!1});var eu=Nl?Nl.prototype.has:null,Ic=Bg?Bg.prototype.has:null;!Dl&&!eu&&(Dl=function(e){return!1});var GR=Dl||function(e){if(!e||typeof e!="object")return!1;try{if(eu.call(e,eu),Ic)try{Ic.call(e,Ic)}catch{return!0}return e instanceof Nl}catch{}return!1},tu={exports:{}},KR=Vt,$1=ut,JR=KR("%WeakSet%",!0),Pc=$1("WeakSet.prototype.has",!0);if(Pc){var _c=$1("WeakMap.prototype.has",!0);tu.exports=function(e){if(!e||typeof e!="object")return!1;try{if(Pc(e,Pc),_c)try{_c(e,_c)}catch{return!0}return e instanceof JR}catch{}return!1}}else tu.exports=function(e){return!1};var YR=tu.exports,XR=C1,QR=O1,ZR=GR,eN=YR,tN=function(e){if(e&&typeof e=="object"){if(XR(e))return"Map";if(QR(e))return"Set";if(ZR(e))return"WeakMap";if(eN(e))return"WeakSet"}return!1},B1=Function.prototype.toString,Qr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,nu,Js;if(typeof Qr=="function"&&typeof Object.defineProperty=="function")try{nu=Object.defineProperty({},"length",{get:function(){throw Js}}),Js={},Qr(function(){throw 42},null,nu)}catch(t){t!==Js&&(Qr=null)}else Qr=null;var nN=/^\s*class\b/,ru=function(e){try{var n=B1.call(e);return nN.test(n)}catch{return!1}},Lc=function(e){try{return ru(e)?!1:(B1.call(e),!0)}catch{return!1}},Ys=Object.prototype.toString,rN="[object Object]",iN="[object Function]",oN="[object GeneratorFunction]",sN="[object HTMLAllCollection]",lN="[object HTML document.all class]",aN="[object HTMLCollection]",cN=typeof Symbol=="function"&&!!Symbol.toStringTag,fN=!(0 in[,]),iu=function(){return!1};if(typeof document=="object"){var uN=document.all;Ys.call(uN)===Ys.call(document.all)&&(iu=function(e){if((fN||!e)&&(typeof e>"u"||typeof e=="object"))try{var n=Ys.call(e);return(n===sN||n===lN||n===aN||n===rN)&&e("")==null}catch{}return!1})}var dN=Qr?function(e){if(iu(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Qr(e,null,nu)}catch(n){if(n!==Js)return!1}return!ru(e)&&Lc(e)}:function(e){if(iu(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(cN)return Lc(e);if(ru(e))return!1;var n=Ys.call(e);return n!==iN&&n!==oN&&!/^\[object HTML/.test(n)?!1:Lc(e)},hN=dN,pN=Object.prototype.toString,F1=Object.prototype.hasOwnProperty,gN=function(e,n,r){for(var i=0,o=e.length;i<o;i++)F1.call(e,i)&&(r==null?n(e[i],i,e):n.call(r,e[i],i,e))},mN=function(e,n,r){for(var i=0,o=e.length;i<o;i++)r==null?n(e.charAt(i),i,e):n.call(r,e.charAt(i),i,e)},yN=function(e,n,r){for(var i in e)F1.call(e,i)&&(r==null?n(e[i],i,e):n.call(r,e[i],i,e))},vN=function(e,n,r){if(!hN(n))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=r),pN.call(e)==="[object Array]"?gN(e,n,i):typeof e=="string"?mN(e,n,i):yN(e,n,i)},bN=vN,wN=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],$c=wN,SN=typeof globalThis>"u"?rn:globalThis,xN=function(){for(var e=[],n=0;n<$c.length;n++)typeof SN[$c[n]]=="function"&&(e[e.length]=$c[n]);return e},Il=bN,kN=xN,Fg=Mi,Bd=ut,Xs=Td,CN=Bd("Object.prototype.toString"),z1=Nr(),zg=typeof globalThis>"u"?rn:globalThis,ou=kN(),Fd=Bd("String.prototype.slice"),Bc=Object.getPrototypeOf,EN=Bd("Array.prototype.indexOf",!0)||function(e,n){for(var r=0;r<e.length;r+=1)if(e[r]===n)return r;return-1},Pl={__proto__:null};z1&&Xs&&Bc?Il(ou,function(t){var e=new zg[t];if(Symbol.toStringTag in e){var n=Bc(e),r=Xs(n,Symbol.toStringTag);if(!r){var i=Bc(n);r=Xs(i,Symbol.toStringTag)}Pl["$"+t]=Fg(r.get)}}):Il(ou,function(t){var e=new zg[t],n=e.slice||e.set;n&&(Pl["$"+t]=Fg(n))});var ON=function(e){var n=!1;return Il(Pl,function(r,i){if(!n)try{"$"+r(e)===i&&(n=Fd(i,1))}catch{}}),n},AN=function(e){var n=!1;return Il(Pl,function(r,i){if(!n)try{r(e),n=Fd(i,1)}catch{}}),n},TN=function(e){if(!e||typeof e!="object")return!1;if(!z1){var n=Fd(CN(e),8,-1);return EN(ou,n)>-1?n:n!=="Object"?!1:AN(e)}return Xs?ON(e):null},MN=ut,jg=MN("ArrayBuffer.prototype.byteLength",!0),RN=D1,NN=function(e){return RN(e)?jg?jg(e):e.byteLength:NaN},j1=c2,Ht=ut,Vg=I2,DN=Vt,vi=GM,IN=w1,Hg=nR,Wg=d1,Ug=S1,qg=D1,Gg=uR,Kg=gR,Jg=yR,Yg=Cd,Xg=qR,Qg=tN,Zg=TN,em=NN,tm=Ht("SharedArrayBuffer.prototype.byteLength",!0),nm=Ht("Date.prototype.getTime"),Fc=Object.getPrototypeOf,rm=Ht("Object.prototype.toString"),_l=DN("%Set%",!0),su=Ht("Map.prototype.has",!0),Ll=Ht("Map.prototype.get",!0),im=Ht("Map.prototype.size",!0),$l=Ht("Set.prototype.add",!0),V1=Ht("Set.prototype.delete",!0),Bl=Ht("Set.prototype.has",!0),Qs=Ht("Set.prototype.size",!0);function om(t,e,n,r){for(var i=vi(t),o;(o=i.next())&&!o.done;)if(yt(e,o.value,n,r))return V1(t,o.value),!0;return!1}function H1(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function PN(t,e,n,r,i,o){var s=H1(n);if(s!=null)return s;var l=Ll(e,s),a=j1({},i,{strict:!1});return typeof l>"u"&&!su(e,s)||!yt(r,l,a,o)?!1:!su(t,s)&&yt(r,l,a,o)}function _N(t,e,n){var r=H1(n);return r??(Bl(e,r)&&!Bl(t,r))}function sm(t,e,n,r,i,o){for(var s=vi(t),l,a;(l=s.next())&&!l.done;)if(a=l.value,yt(n,a,i,o)&&yt(r,Ll(e,a),i,o))return V1(t,a),!0;return!1}function yt(t,e,n,r){var i=n||{};if(i.strict?Hg(t,e):t===e)return!0;var o=Xg(t),s=Xg(e);if(o!==s)return!1;if(!t||!e||typeof t!="object"&&typeof e!="object")return i.strict?Hg(t,e):t==e;var l=r.has(t),a=r.has(e),c;if(l&&a){if(r.get(t)===r.get(e))return!0}else c={};return l||r.set(t,c),a||r.set(e,c),BN(t,e,i,r)}function lm(t){return!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function LN(t,e,n,r){if(Qs(t)!==Qs(e))return!1;for(var i=vi(t),o=vi(e),s,l,a;(s=i.next())&&!s.done;)if(s.value&&typeof s.value=="object")a||(a=new _l),$l(a,s.value);else if(!Bl(e,s.value)){if(n.strict||!_N(t,e,s.value))return!1;a||(a=new _l),$l(a,s.value)}if(a){for(;(l=o.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!om(a,l.value,n.strict,r))return!1}else if(!n.strict&&!Bl(t,l.value)&&!om(a,l.value,n.strict,r))return!1;return Qs(a)===0}return!0}function $N(t,e,n,r){if(im(t)!==im(e))return!1;for(var i=vi(t),o=vi(e),s,l,a,c,f,u;(s=i.next())&&!s.done;)if(c=s.value[0],f=s.value[1],c&&typeof c=="object")a||(a=new _l),$l(a,c);else if(u=Ll(e,c),typeof u>"u"&&!su(e,c)||!yt(f,u,n,r)){if(n.strict||!PN(t,e,c,f,n,r))return!1;a||(a=new _l),$l(a,c)}if(a){for(;(l=o.next())&&!l.done;)if(c=l.value[0],u=l.value[1],c&&typeof c=="object"){if(!sm(a,t,c,u,n,r))return!1}else if(!n.strict&&(!t.has(c)||!yt(Ll(t,c),u,n,r))&&!sm(a,t,c,u,j1({},n,{strict:!1}),r))return!1;return Qs(a)===0}return!0}function BN(t,e,n,r){var i,o;if(typeof t!=typeof e||t==null||e==null||rm(t)!==rm(e)||Wg(t)!==Wg(e))return!1;var s=Ug(t),l=Ug(e);if(s!==l)return!1;var a=t instanceof Error,c=e instanceof Error;if(a!==c||(a||c)&&(t.name!==e.name||t.message!==e.message))return!1;var f=Kg(t),u=Kg(e);if(f!==u||(f||u)&&(t.source!==e.source||Vg(t)!==Vg(e)))return!1;var d=Gg(t),h=Gg(e);if(d!==h||(d||h)&&nm(t)!==nm(e)||n.strict&&Fc&&Fc(t)!==Fc(e))return!1;var p=Zg(t),g=Zg(e);if(p!==g)return!1;if(p||g){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var m=lm(t),v=lm(e);if(m!==v)return!1;if(m||v){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var w=qg(t),S=qg(e);if(w!==S)return!1;if(w||S)return em(t)!==em(e)?!1:typeof Uint8Array=="function"&&yt(new Uint8Array(t),new Uint8Array(e),n,r);var y=Jg(t),x=Jg(e);if(y!==x)return!1;if(y||x)return tm(t)!==tm(e)?!1:typeof Uint8Array=="function"&&yt(new Uint8Array(t),new Uint8Array(e),n,r);if(typeof t!=typeof e)return!1;var b=Yg(t),O=Yg(e);if(b.length!==O.length)return!1;for(b.sort(),O.sort(),i=b.length-1;i>=0;i--)if(b[i]!=O[i])return!1;for(i=b.length-1;i>=0;i--)if(o=b[i],!yt(t[o],e[o],n,r))return!1;var R=Qg(t),k=Qg(e);return R!==k?!1:R==="Set"||k==="Set"?LN(t,e,n,r):R==="Map"?$N(t,e,n,r):!0}var FN=function(e,n,r){return yt(e,n,r,IN())};const zN=kd(FN);function W1(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=W1(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function jN(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=W1(t))&&(r&&(r+=" "),r+=e);return r}const am=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,cm=jN,VN=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return cm(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,s=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],u=o==null?void 0:o[c];if(f===null)return null;const d=am(f)||am(u);return i[c][d]}),l=n&&Object.entries(n).reduce((c,f)=>{let[u,d]=f;return d===void 0||(c[u]=d),c},{}),a=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:u,className:d,...h}=f;return Object.entries(h).every(p=>{let[g,m]=p;return Array.isArray(m)?m.includes({...o,...l}[g]):{...o,...l}[g]===m})?[...c,u,d]:c},[]);return cm(t,s,a,n==null?void 0:n.class,n==null?void 0:n.className)},HN=["top","right","bottom","left"],Dt=Math.min,Ke=Math.max,Fl=Math.round,ws=Math.floor,qn=t=>({x:t,y:t}),WN={left:"right",right:"left",bottom:"top",top:"bottom"},UN={start:"end",end:"start"};function lu(t,e,n){return Ke(t,Dt(e,n))}function cn(t,e){return typeof t=="function"?t(e):t}function fn(t){return t.split("-")[0]}function Ni(t){return t.split("-")[1]}function zd(t){return t==="x"?"y":"x"}function jd(t){return t==="y"?"height":"width"}function Gn(t){return["top","bottom"].includes(fn(t))?"y":"x"}function Vd(t){return zd(Gn(t))}function qN(t,e,n){n===void 0&&(n=!1);const r=Ni(t),i=Vd(t),o=jd(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=zl(s)),[s,zl(s)]}function GN(t){const e=zl(t);return[au(t),e,au(e)]}function au(t){return t.replace(/start|end/g,e=>UN[e])}function KN(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function JN(t,e,n,r){const i=Ni(t);let o=KN(fn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(au)))),o}function zl(t){return t.replace(/left|right|bottom|top/g,e=>WN[e])}function YN(t){return{top:0,right:0,bottom:0,left:0,...t}}function U1(t){return typeof t!="number"?YN(t):{top:t,right:t,bottom:t,left:t}}function jl(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function fm(t,e,n){let{reference:r,floating:i}=t;const o=Gn(e),s=Vd(e),l=jd(s),a=fn(e),c=o==="y",f=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,d=r[l]/2-i[l]/2;let h;switch(a){case"top":h={x:f,y:r.y-i.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-i.width,y:u};break;default:h={x:r.x,y:r.y}}switch(Ni(e)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const XN=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=fm(c,r,a),d=r,h={},p=0;for(let g=0;g<l.length;g++){const{name:m,fn:v}=l[g],{x:w,y:S,data:y,reset:x}=await v({x:f,y:u,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});f=w??f,u=S??u,h={...h,[m]:{...h[m],...y}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(d=x.placement),x.rects&&(c=x.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:f,y:u}=fm(c,d,a)),g=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}};async function Ro(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:h=0}=cn(e,t),p=U1(h),m=l[d?u==="floating"?"reference":"floating":u],v=jl(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),w=u==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),y=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},x=jl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:S,strategy:a}):w);return{top:(v.top-x.top+p.top)/y.y,bottom:(x.bottom-v.bottom+p.bottom)/y.y,left:(v.left-x.left+p.left)/y.x,right:(x.right-v.right+p.right)/y.x}}const QN=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:f=0}=cn(t,e)||{};if(c==null)return{};const u=U1(f),d={x:n,y:r},h=Vd(i),p=jd(h),g=await s.getDimensions(c),m=h==="y",v=m?"top":"left",w=m?"bottom":"right",S=m?"clientHeight":"clientWidth",y=o.reference[p]+o.reference[h]-d[h]-o.floating[p],x=d[h]-o.reference[h],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let O=b?b[S]:0;(!O||!await(s.isElement==null?void 0:s.isElement(b)))&&(O=l.floating[S]||o.floating[p]);const R=y/2-x/2,k=O/2-g[p]/2-1,A=Dt(u[v],k),T=Dt(u[w],k),M=A,_=O-g[p]-T,L=O/2-g[p]/2+R,W=lu(M,L,_),B=!a.arrow&&Ni(i)!=null&&L!==W&&o.reference[p]/2-(L<M?A:T)-g[p]/2<0,I=B?L<M?L-M:L-_:0;return{[h]:d[h]+I,data:{[h]:W,centerOffset:L-W-I,...B&&{alignmentOffset:I}},reset:B}}}),ZN=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=cn(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=fn(i),w=Gn(l),S=fn(l)===l,y=await(a.isRTL==null?void 0:a.isRTL(c.floating)),x=d||(S||!g?[zl(l)]:GN(l)),b=p!=="none";!d&&b&&x.push(...JN(l,g,p,y));const O=[l,...x],R=await Ro(e,m),k=[];let A=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&k.push(R[v]),u){const L=qN(i,s,y);k.push(R[L[0]],R[L[1]])}if(A=[...A,{placement:i,overflows:k}],!k.every(L=>L<=0)){var T,M;const L=(((T=o.flip)==null?void 0:T.index)||0)+1,W=O[L];if(W)return{data:{index:L,overflows:A},reset:{placement:W}};let B=(M=A.filter(I=>I.overflows[0]<=0).sort((I,U)=>I.overflows[1]-U.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(h){case"bestFit":{var _;const I=(_=A.filter(U=>{if(b){const Y=Gn(U.placement);return Y===w||Y==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(Y=>Y>0).reduce((Y,de)=>Y+de,0)]).sort((U,Y)=>U[1]-Y[1])[0])==null?void 0:_[0];I&&(B=I);break}case"initialPlacement":B=l;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function um(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function dm(t){return HN.some(e=>t[e]>=0)}const eD=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=cn(t,e);switch(r){case"referenceHidden":{const o=await Ro(e,{...i,elementContext:"reference"}),s=um(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:dm(s)}}}case"escaped":{const o=await Ro(e,{...i,altBoundary:!0}),s=um(o,n.floating);return{data:{escapedOffsets:s,escaped:dm(s)}}}default:return{}}}}};async function tD(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=fn(n),l=Ni(n),a=Gn(n)==="y",c=["left","top"].includes(s)?-1:1,f=o&&a?-1:1,u=cn(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return l&&typeof p=="number"&&(h=l==="end"?p*-1:p),a?{x:h*f,y:d*c}:{x:d*c,y:h*f}}const nD=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,a=await tD(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:s}}}}},rD=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:m=>{let{x:v,y:w}=m;return{x:v,y:w}}},...a}=cn(t,e),c={x:n,y:r},f=await Ro(e,a),u=Gn(fn(i)),d=zd(u);let h=c[d],p=c[u];if(o){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=h+f[m],S=h-f[v];h=lu(w,h,S)}if(s){const m=u==="y"?"top":"left",v=u==="y"?"bottom":"right",w=p+f[m],S=p-f[v];p=lu(w,p,S)}const g=l.fn({...e,[d]:h,[u]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},iD=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=cn(t,e),f={x:n,y:r},u=Gn(i),d=zd(u);let h=f[d],p=f[u];const g=cn(l,e),m=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(a){const S=d==="y"?"height":"width",y=o.reference[d]-o.floating[S]+m.mainAxis,x=o.reference[d]+o.reference[S]-m.mainAxis;h<y?h=y:h>x&&(h=x)}if(c){var v,w;const S=d==="y"?"width":"height",y=["top","left"].includes(fn(i)),x=o.reference[u]-o.floating[S]+(y&&((v=s.offset)==null?void 0:v[u])||0)+(y?0:m.crossAxis),b=o.reference[u]+o.reference[S]+(y?0:((w=s.offset)==null?void 0:w[u])||0)-(y?m.crossAxis:0);p<x?p=x:p>b&&(p=b)}return{[d]:h,[u]:p}}}},oD=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:o}=e,{apply:s=()=>{},...l}=cn(t,e),a=await Ro(e,l),c=fn(n),f=Ni(n),u=Gn(n)==="y",{width:d,height:h}=r.floating;let p,g;c==="top"||c==="bottom"?(p=c,g=f===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,p=f==="end"?"top":"bottom");const m=h-a.top-a.bottom,v=d-a.left-a.right,w=Dt(h-a[p],m),S=Dt(d-a[g],v),y=!e.middlewareData.shift;let x=w,b=S;if(u?b=f||y?Dt(S,v):v:x=f||y?Dt(w,m):m,y&&!f){const R=Ke(a.left,0),k=Ke(a.right,0),A=Ke(a.top,0),T=Ke(a.bottom,0);u?b=d-2*(R!==0||k!==0?R+k:Ke(a.left,a.right)):x=h-2*(A!==0||T!==0?A+T:Ke(a.top,a.bottom))}await s({...e,availableWidth:b,availableHeight:x});const O=await i.getDimensions(o.floating);return d!==O.width||h!==O.height?{reset:{rects:!0}}:{}}}};function Di(t){return q1(t)?(t.nodeName||"").toLowerCase():"#document"}function Qe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function gn(t){var e;return(e=(q1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function q1(t){return t instanceof Node||t instanceof Qe(t).Node}function bt(t){return t instanceof Element||t instanceof Qe(t).Element}function Ft(t){return t instanceof HTMLElement||t instanceof Qe(t).HTMLElement}function hm(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qe(t).ShadowRoot}function es(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=wt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function sD(t){return["table","td","th"].includes(Di(t))}function Ba(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Hd(t){const e=Wd(),n=bt(t)?wt(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function lD(t){let e=Kn(t);for(;Ft(e)&&!bi(e);){if(Hd(e))return e;if(Ba(e))return null;e=Kn(e)}return null}function Wd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bi(t){return["html","body","#document"].includes(Di(t))}function wt(t){return Qe(t).getComputedStyle(t)}function Fa(t){return bt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Kn(t){if(Di(t)==="html")return t;const e=t.assignedSlot||t.parentNode||hm(t)&&t.host||gn(t);return hm(e)?e.host:e}function G1(t){const e=Kn(t);return bi(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ft(e)&&es(e)?e:G1(e)}function No(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=G1(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Qe(i);return o?e.concat(s,s.visualViewport||[],es(i)?i:[],s.frameElement&&n?No(s.frameElement):[]):e.concat(i,No(i,[],n))}function K1(t){const e=wt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Ft(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Fl(n)!==o||Fl(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ud(t){return bt(t)?t:t.contextElement}function ii(t){const e=Ud(t);if(!Ft(e))return qn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=K1(e);let s=(o?Fl(n.width):n.width)/r,l=(o?Fl(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const aD=qn(0);function J1(t){const e=Qe(t);return!Wd()||!e.visualViewport?aD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function cD(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qe(t)?!1:e}function Cr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ud(t);let s=qn(1);e&&(r?bt(r)&&(s=ii(r)):s=ii(t));const l=cD(o,n,r)?J1(o):qn(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,f=i.width/s.x,u=i.height/s.y;if(o){const d=Qe(o),h=r&&bt(r)?Qe(r):r;let p=d,g=p.frameElement;for(;g&&r&&h!==p;){const m=ii(g),v=g.getBoundingClientRect(),w=wt(g),S=v.left+(g.clientLeft+parseFloat(w.paddingLeft))*m.x,y=v.top+(g.clientTop+parseFloat(w.paddingTop))*m.y;a*=m.x,c*=m.y,f*=m.x,u*=m.y,a+=S,c+=y,p=Qe(g),g=p.frameElement}}return jl({width:f,height:u,x:a,y:c})}function fD(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=gn(r),l=e?Ba(e.floating):!1;if(r===s||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=qn(1);const f=qn(0),u=Ft(r);if((u||!u&&!o)&&((Di(r)!=="body"||es(s))&&(a=Fa(r)),Ft(r))){const d=Cr(r);c=ii(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x,y:n.y*c.y-a.scrollTop*c.y+f.y}}function uD(t){return Array.from(t.getClientRects())}function Y1(t){return Cr(gn(t)).left+Fa(t).scrollLeft}function dD(t){const e=gn(t),n=Fa(t),r=t.ownerDocument.body,i=Ke(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ke(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Y1(t);const l=-n.scrollTop;return wt(r).direction==="rtl"&&(s+=Ke(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function hD(t,e){const n=Qe(t),r=gn(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;const c=Wd();(!c||c&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l,y:a}}function pD(t,e){const n=Cr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ft(t)?ii(t):qn(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,a=i*o.x,c=r*o.y;return{width:s,height:l,x:a,y:c}}function pm(t,e,n){let r;if(e==="viewport")r=hD(t,n);else if(e==="document")r=dD(gn(t));else if(bt(e))r=pD(e,n);else{const i=J1(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return jl(r)}function X1(t,e){const n=Kn(t);return n===e||!bt(n)||bi(n)?!1:wt(n).position==="fixed"||X1(n,e)}function gD(t,e){const n=e.get(t);if(n)return n;let r=No(t,[],!1).filter(l=>bt(l)&&Di(l)!=="body"),i=null;const o=wt(t).position==="fixed";let s=o?Kn(t):t;for(;bt(s)&&!bi(s);){const l=wt(s),a=Hd(s);!a&&l.position==="fixed"&&(i=null),(o?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||es(s)&&!a&&X1(t,s))?r=r.filter(f=>f!==s):i=l,s=Kn(s)}return e.set(t,r),r}function mD(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Ba(e)?[]:gD(e,this._c):[].concat(n),r],l=s[0],a=s.reduce((c,f)=>{const u=pm(e,f,i);return c.top=Ke(u.top,c.top),c.right=Dt(u.right,c.right),c.bottom=Dt(u.bottom,c.bottom),c.left=Ke(u.left,c.left),c},pm(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function yD(t){const{width:e,height:n}=K1(t);return{width:e,height:n}}function vD(t,e,n){const r=Ft(e),i=gn(e),o=n==="fixed",s=Cr(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const a=qn(0);if(r||!r&&!o)if((Di(e)!=="body"||es(i))&&(l=Fa(e)),r){const u=Cr(e,!0,o,e);a.x=u.x+e.clientLeft,a.y=u.y+e.clientTop}else i&&(a.x=Y1(i));const c=s.left+l.scrollLeft-a.x,f=s.top+l.scrollTop-a.y;return{x:c,y:f,width:s.width,height:s.height}}function zc(t){return wt(t).position==="static"}function gm(t,e){return!Ft(t)||wt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Q1(t,e){const n=Qe(t);if(Ba(t))return n;if(!Ft(t)){let i=Kn(t);for(;i&&!bi(i);){if(bt(i)&&!zc(i))return i;i=Kn(i)}return n}let r=gm(t,e);for(;r&&sD(r)&&zc(r);)r=gm(r,e);return r&&bi(r)&&zc(r)&&!Hd(r)?n:r||lD(t)||n}const bD=async function(t){const e=this.getOffsetParent||Q1,n=this.getDimensions,r=await n(t.floating);return{reference:vD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wD(t){return wt(t).direction==="rtl"}const SD={convertOffsetParentRelativeRectToViewportRelativeRect:fD,getDocumentElement:gn,getClippingRect:mD,getOffsetParent:Q1,getElementRects:bD,getClientRects:uD,getDimensions:yD,getScale:ii,isElement:bt,isRTL:wD};function xD(t,e){let n=null,r;const i=gn(t);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),o();const{left:c,top:f,width:u,height:d}=t.getBoundingClientRect();if(l||e(),!u||!d)return;const h=ws(f),p=ws(i.clientWidth-(c+u)),g=ws(i.clientHeight-(f+d)),m=ws(c),w={rootMargin:-h+"px "+-p+"px "+-g+"px "+-m+"px",threshold:Ke(0,Dt(1,a))||1};let S=!0;function y(x){const b=x[0].intersectionRatio;if(b!==a){if(!S)return s();b?s(!1,b):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(y,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(y,w)}n.observe(t)}return s(!0),o}function kD(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Ud(t),f=i||o?[...c?No(c):[],...No(e)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const u=c&&l?xD(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(e)})),n()}),c&&!a&&h.observe(c),h.observe(e));let p,g=a?Cr(t):null;a&&m();function m(){const v=Cr(t);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,p=requestAnimationFrame(m)}return n(),()=>{var v;f.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),u==null||u(),(v=h)==null||v.disconnect(),h=null,a&&cancelAnimationFrame(p)}}const CD=nD,ED=rD,OD=ZN,AD=oD,TD=eD,mm=QN,MD=iD,RD=(t,e,n)=>{const r=new Map,i={platform:SD,...n},o={...i.platform,_c:r};return XN(t,e,{...i,platform:o})};var Zs=typeof document<"u"?z.useLayoutEffect:z.useEffect;function Vl(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Vl(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Vl(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Z1(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ym(t,e){const n=Z1(t);return Math.round(e*n)/n}function vm(t){const e=F.useRef(t);return Zs(()=>{e.current=t}),e}function ND(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:a,open:c}=t,[f,u]=F.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=F.useState(r);Vl(d,r)||h(r);const[p,g]=F.useState(null),[m,v]=F.useState(null),w=F.useCallback(I=>{I!==b.current&&(b.current=I,g(I))},[]),S=F.useCallback(I=>{I!==O.current&&(O.current=I,v(I))},[]),y=o||p,x=s||m,b=F.useRef(null),O=F.useRef(null),R=F.useRef(f),k=a!=null,A=vm(a),T=vm(i),M=F.useCallback(()=>{if(!b.current||!O.current)return;const I={placement:e,strategy:n,middleware:d};T.current&&(I.platform=T.current),RD(b.current,O.current,I).then(U=>{const Y={...U,isPositioned:!0};_.current&&!Vl(R.current,Y)&&(R.current=Y,fS.flushSync(()=>{u(Y)}))})},[d,e,n,T]);Zs(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,u(I=>({...I,isPositioned:!1})))},[c]);const _=F.useRef(!1);Zs(()=>(_.current=!0,()=>{_.current=!1}),[]),Zs(()=>{if(y&&(b.current=y),x&&(O.current=x),y&&x){if(A.current)return A.current(y,x,M);M()}},[y,x,M,A,k]);const L=F.useMemo(()=>({reference:b,floating:O,setReference:w,setFloating:S}),[w,S]),W=F.useMemo(()=>({reference:y,floating:x}),[y,x]),B=F.useMemo(()=>{const I={position:n,left:0,top:0};if(!W.floating)return I;const U=ym(W.floating,f.x),Y=ym(W.floating,f.y);return l?{...I,transform:"translate("+U+"px, "+Y+"px)",...Z1(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:Y}},[n,l,W.floating,f.x,f.y]);return F.useMemo(()=>({...f,update:M,refs:L,elements:W,floatingStyles:B}),[f,M,L,W,B])}const DD=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?mm({element:r.current,padding:i}).fn(n):{}:r?mm({element:r,padding:i}).fn(n):{}}}},ID=(t,e)=>({...CD(t),options:[t,e]}),PD=(t,e)=>({...ED(t),options:[t,e]}),_D=(t,e)=>({...MD(t),options:[t,e]}),LD=(t,e)=>({...OD(t),options:[t,e]}),$D=(t,e)=>({...AD(t),options:[t,e]}),BD=(t,e)=>({...TD(t),options:[t,e]}),FD=(t,e)=>({...DD(t),options:[t,e]});var zD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},jr=new WeakMap,Ss=new WeakMap,xs={},jc=0,eb=function(t){return t&&(t.host||eb(t.parentNode))},jD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=eb(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},VD=function(t,e,n,r){var i=jD(e,Array.isArray(t)?t:[t]);xs[n]||(xs[n]=new WeakMap);var o=xs[n],s=[],l=new Set,a=new Set(i),c=function(u){!u||l.has(u)||(l.add(u),c(u.parentNode))};i.forEach(c);var f=function(u){!u||a.has(u)||Array.prototype.forEach.call(u.children,function(d){if(l.has(d))f(d);else try{var h=d.getAttribute(r),p=h!==null&&h!=="false",g=(jr.get(d)||0)+1,m=(o.get(d)||0)+1;jr.set(d,g),o.set(d,m),s.push(d),g===1&&p&&Ss.set(d,!0),m===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",d,v)}})};return f(e),l.clear(),jc++,function(){s.forEach(function(u){var d=jr.get(u)-1,h=o.get(u)-1;jr.set(u,d),o.set(u,h),d||(Ss.has(u)||u.removeAttribute(r),Ss.delete(u)),h||u.removeAttribute(n)}),jc--,jc||(jr=new WeakMap,jr=new WeakMap,Ss=new WeakMap,xs={})}},HD=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=zD(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),VD(r,i,n,"aria-hidden")):function(){return null}},Rt=function(){return Rt=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Rt.apply(this,arguments)};function tb(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function WD(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var el="right-scroll-bar-position",tl="width-before-scroll-bar",UD="with-scroll-bars-hidden",qD="--removed-body-scroll-bar-size";function Vc(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function GD(t,e){var n=z.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var KD=typeof window<"u"?F.useLayoutEffect:F.useEffect,bm=new WeakMap;function JD(t,e){var n=GD(null,function(r){return t.forEach(function(i){return Vc(i,r)})});return KD(function(){var r=bm.get(n);if(r){var i=new Set(r),o=new Set(t),s=n.current;i.forEach(function(l){o.has(l)||Vc(l,null)}),o.forEach(function(l){i.has(l)||Vc(l,s)})}bm.set(n,t)},[t]),n}function YD(t){return t}function XD(t,e){e===void 0&&(e=YD);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var s=e(o,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(o),s=n}var a=function(){var f=s;s=[],f.forEach(o)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(f){s.push(f),c()},filter:function(f){return s=s.filter(f),n}}}};return i}function QD(t){t===void 0&&(t={});var e=XD(null);return e.options=Rt({async:!0,ssr:!1},t),e}var nb=function(t){var e=t.sideCar,n=tb(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return F.createElement(r,Rt({},n))};nb.isSideCarExport=!0;function ZD(t,e){return t.useMedium(e),nb}var rb=QD(),Hc=function(){},za=F.forwardRef(function(t,e){var n=F.useRef(null),r=F.useState({onScrollCapture:Hc,onWheelCapture:Hc,onTouchMoveCapture:Hc}),i=r[0],o=r[1],s=t.forwardProps,l=t.children,a=t.className,c=t.removeScrollBar,f=t.enabled,u=t.shards,d=t.sideCar,h=t.noIsolation,p=t.inert,g=t.allowPinchZoom,m=t.as,v=m===void 0?"div":m,w=t.gapMode,S=tb(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),y=d,x=JD([n,e]),b=Rt(Rt({},S),i);return F.createElement(F.Fragment,null,f&&F.createElement(y,{sideCar:rb,removeScrollBar:c,shards:u,noIsolation:h,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?F.cloneElement(F.Children.only(l),Rt(Rt({},b),{ref:x})):F.createElement(v,Rt({},b,{className:a,ref:x}),l))});za.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};za.classNames={fullWidth:tl,zeroRight:el};var eI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tI(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=eI();return e&&t.setAttribute("nonce",e),t}function nI(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function rI(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var iI=function(){var t=0,e=null;return{add:function(n){t==0&&(e=tI())&&(nI(e,n),rI(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},oI=function(){var t=iI();return function(e,n){F.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},ib=function(){var t=oI(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},sI={left:0,top:0,right:0,gap:0},Wc=function(t){return parseInt(t||"",10)||0},lI=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Wc(n),Wc(r),Wc(i)]},aI=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return sI;var e=lI(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},cI=ib(),oi="data-scroll-locked",fI=function(t,e,n,r){var i=t.left,o=t.top,s=t.right,l=t.gap;return n===void 0&&(n="margin"),`
389
+ .`.concat(UD,` {
390
+ overflow: hidden `).concat(r,`;
391
+ padding-right: `).concat(l,"px ").concat(r,`;
392
+ }
393
+ body[`).concat(oi,`] {
394
+ overflow: hidden `).concat(r,`;
395
+ overscroll-behavior: contain;
396
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
397
+ padding-left: `.concat(i,`px;
398
+ padding-top: `).concat(o,`px;
399
+ padding-right: `).concat(s,`px;
400
+ margin-left:0;
401
+ margin-top:0;
402
+ margin-right: `).concat(l,"px ").concat(r,`;
403
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
404
+ }
405
+
406
+ .`).concat(el,` {
407
+ right: `).concat(l,"px ").concat(r,`;
408
+ }
409
+
410
+ .`).concat(tl,` {
411
+ margin-right: `).concat(l,"px ").concat(r,`;
412
+ }
413
+
414
+ .`).concat(el," .").concat(el,` {
415
+ right: 0 `).concat(r,`;
416
+ }
417
+
418
+ .`).concat(tl," .").concat(tl,` {
419
+ margin-right: 0 `).concat(r,`;
420
+ }
421
+
422
+ body[`).concat(oi,`] {
423
+ `).concat(qD,": ").concat(l,`px;
424
+ }
425
+ `)},wm=function(){var t=parseInt(document.body.getAttribute(oi)||"0",10);return isFinite(t)?t:0},uI=function(){F.useEffect(function(){return document.body.setAttribute(oi,(wm()+1).toString()),function(){var t=wm()-1;t<=0?document.body.removeAttribute(oi):document.body.setAttribute(oi,t.toString())}},[])},dI=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;uI();var o=F.useMemo(function(){return aI(i)},[i]);return F.createElement(cI,{styles:fI(o,!e,i,n?"":"!important")})},cu=!1;if(typeof window<"u")try{var ks=Object.defineProperty({},"passive",{get:function(){return cu=!0,!0}});window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{cu=!1}var Vr=cu?{passive:!1}:!1,hI=function(t){return t.tagName==="TEXTAREA"},ob=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!hI(t)&&n[e]==="visible")},pI=function(t){return ob(t,"overflowY")},gI=function(t){return ob(t,"overflowX")},Sm=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=sb(t,r);if(i){var o=lb(t,r),s=o[1],l=o[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mI=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},yI=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},sb=function(t,e){return t==="v"?pI(e):gI(e)},lb=function(t,e){return t==="v"?mI(e):yI(e)},vI=function(t,e){return t==="h"&&e==="rtl"?-1:1},bI=function(t,e,n,r,i){var o=vI(t,window.getComputedStyle(e).direction),s=o*r,l=n.target,a=e.contains(l),c=!1,f=s>0,u=0,d=0;do{var h=lb(t,l),p=h[0],g=h[1],m=h[2],v=g-m-o*p;(p||v)&&sb(t,l)&&(u+=v,d+=p),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!a&&l!==document.body||a&&(e.contains(l)||e===l));return(f&&(Math.abs(u)<1||!i)||!f&&(Math.abs(d)<1||!i))&&(c=!0),c},Cs=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},xm=function(t){return[t.deltaX,t.deltaY]},km=function(t){return t&&"current"in t?t.current:t},wI=function(t,e){return t[0]===e[0]&&t[1]===e[1]},SI=function(t){return`
426
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
427
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
428
+ `)},xI=0,Hr=[];function kI(t){var e=F.useRef([]),n=F.useRef([0,0]),r=F.useRef(),i=F.useState(xI++)[0],o=F.useState(ib)[0],s=F.useRef(t);F.useEffect(function(){s.current=t},[t]),F.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var g=WD([t.lockRef.current],(t.shards||[]).map(km),!0).filter(Boolean);return g.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=F.useCallback(function(g,m){if("touches"in g&&g.touches.length===2)return!s.current.allowPinchZoom;var v=Cs(g),w=n.current,S="deltaX"in g?g.deltaX:w[0]-v[0],y="deltaY"in g?g.deltaY:w[1]-v[1],x,b=g.target,O=Math.abs(S)>Math.abs(y)?"h":"v";if("touches"in g&&O==="h"&&b.type==="range")return!1;var R=Sm(O,b);if(!R)return!0;if(R?x=O:(x=O==="v"?"h":"v",R=Sm(O,b)),!R)return!1;if(!r.current&&"changedTouches"in g&&(S||y)&&(r.current=x),!x)return!0;var k=r.current||x;return bI(k,m,g,k==="h"?S:y,!0)},[]),a=F.useCallback(function(g){var m=g;if(!(!Hr.length||Hr[Hr.length-1]!==o)){var v="deltaY"in m?xm(m):Cs(m),w=e.current.filter(function(x){return x.name===m.type&&(x.target===m.target||m.target===x.shadowParent)&&wI(x.delta,v)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var S=(s.current.shards||[]).map(km).filter(Boolean).filter(function(x){return x.contains(m.target)}),y=S.length>0?l(m,S[0]):!s.current.noIsolation;y&&m.cancelable&&m.preventDefault()}}},[]),c=F.useCallback(function(g,m,v,w){var S={name:g,delta:m,target:v,should:w,shadowParent:CI(v)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(y){return y!==S})},1)},[]),f=F.useCallback(function(g){n.current=Cs(g),r.current=void 0},[]),u=F.useCallback(function(g){c(g.type,xm(g),g.target,l(g,t.lockRef.current))},[]),d=F.useCallback(function(g){c(g.type,Cs(g),g.target,l(g,t.lockRef.current))},[]);F.useEffect(function(){return Hr.push(o),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",a,Vr),document.addEventListener("touchmove",a,Vr),document.addEventListener("touchstart",f,Vr),function(){Hr=Hr.filter(function(g){return g!==o}),document.removeEventListener("wheel",a,Vr),document.removeEventListener("touchmove",a,Vr),document.removeEventListener("touchstart",f,Vr)}},[]);var h=t.removeScrollBar,p=t.inert;return F.createElement(F.Fragment,null,p?F.createElement(o,{styles:SI(i)}):null,h?F.createElement(dI,{gapMode:t.gapMode}):null)}function CI(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const EI=ZD(rb,kI);var ab=F.forwardRef(function(t,e){return F.createElement(za,Rt({},t,{ref:e,sideCar:EI}))});ab.classNames=za.classNames;function ja(){return(ja=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function cb(t,e){if(t==null)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)e.indexOf(n=o[r])>=0||(i[n]=t[n]);return i}function fu(t){var e=z.useRef(t),n=z.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var Do=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},co=function(t){return"touches"in t},uu=function(t){return t&&t.ownerDocument.defaultView||self},Cm=function(t,e,n){var r=t.getBoundingClientRect(),i=co(e)?function(o,s){for(var l=0;l<o.length;l++)if(o[l].identifier===s)return o[l];return o[0]}(e.touches,n):e;return{left:Do((i.pageX-(r.left+uu(t).pageXOffset))/r.width),top:Do((i.pageY-(r.top+uu(t).pageYOffset))/r.height)}},Em=function(t){!co(t)&&t.preventDefault()},fb=z.memo(function(t){var e=t.onMove,n=t.onKey,r=cb(t,["onMove","onKey"]),i=z.useRef(null),o=fu(e),s=fu(n),l=z.useRef(null),a=z.useRef(!1),c=z.useMemo(function(){var h=function(m){Em(m),(co(m)?m.touches.length>0:m.buttons>0)&&i.current?o(Cm(i.current,m,l.current)):g(!1)},p=function(){return g(!1)};function g(m){var v=a.current,w=uu(i.current),S=m?w.addEventListener:w.removeEventListener;S(v?"touchmove":"mousemove",h),S(v?"touchend":"mouseup",p)}return[function(m){var v=m.nativeEvent,w=i.current;if(w&&(Em(v),!function(y,x){return x&&!co(y)}(v,a.current)&&w)){if(co(v)){a.current=!0;var S=v.changedTouches||[];S.length&&(l.current=S[0].identifier)}w.focus(),o(Cm(w,v,l.current)),g(!0)}},function(m){var v=m.which||m.keyCode;v<37||v>40||(m.preventDefault(),s({left:v===39?.05:v===37?-.05:0,top:v===40?.05:v===38?-.05:0}))},g]},[s,o]),f=c[0],u=c[1],d=c[2];return z.useEffect(function(){return d},[d]),z.createElement("div",ja({},r,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:i,onKeyDown:u,tabIndex:0,role:"slider"}))}),qd=function(t){return t.filter(Boolean).join(" ")},ub=function(t){var e=t.color,n=t.left,r=t.top,i=r===void 0?.5:r,o=qd(["react-colorful__pointer",t.className]);return z.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},z.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Ce=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},OI=function(t){return NI(du(t))},du=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Ce(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Ce(parseInt(t.substring(6,8),16)/255,2):1}},AI=function(t){return RI(MI(t))},TI=function(t){var e=t.s,n=t.v,r=t.a,i=(200-e)*n/100;return{h:Ce(t.h),s:Ce(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Ce(i/2),a:Ce(r,2)}},hu=function(t){var e=TI(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},MI=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var o=Math.floor(e),s=r*(1-n),l=r*(1-(e-o)*n),a=r*(1-(1-e+o)*n),c=o%6;return{r:Ce(255*[r,l,s,s,a,r][c]),g:Ce(255*[a,r,r,l,s,s][c]),b:Ce(255*[s,s,a,r,r,l][c]),a:Ce(i,2)}},Es=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},RI=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,o=i<1?Es(Ce(255*i)):"";return"#"+Es(e)+Es(n)+Es(r)+o},NI=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,o=Math.max(e,n,r),s=o-Math.min(e,n,r),l=s?o===e?(n-r)/s:o===n?2+(r-e)/s:4+(e-n)/s:0;return{h:Ce(60*(l<0?l+6:l)),s:Ce(o?s/o*100:0),v:Ce(o/255*100),a:i}},DI=z.memo(function(t){var e=t.hue,n=t.onChange,r=qd(["react-colorful__hue",t.className]);return z.createElement("div",{className:r},z.createElement(fb,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Do(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Ce(e),"aria-valuemax":"360","aria-valuemin":"0"},z.createElement(ub,{className:"react-colorful__hue-pointer",left:e/360,color:hu({h:e,s:100,v:100,a:1})})))}),II=z.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:hu({h:e.h,s:100,v:100,a:1})};return z.createElement("div",{className:"react-colorful__saturation",style:r},z.createElement(fb,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Do(e.s+100*i.left,0,100),v:Do(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Ce(e.s)+"%, Brightness "+Ce(e.v)+"%"},z.createElement(ub,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:hu(e)})))}),db=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},PI=function(t,e){return t.toLowerCase()===e.toLowerCase()||db(du(t),du(e))};function _I(t,e,n){var r=fu(n),i=z.useState(function(){return t.toHsva(e)}),o=i[0],s=i[1],l=z.useRef({color:e,hsva:o});z.useEffect(function(){if(!t.equal(e,l.current.color)){var c=t.toHsva(e);l.current={hsva:c,color:e},s(c)}},[e,t]),z.useEffect(function(){var c;db(o,l.current.hsva)||t.equal(c=t.fromHsva(o),l.current.color)||(l.current={hsva:o,color:c},r(c))},[o,t,r]);var a=z.useCallback(function(c){s(function(f){return Object.assign({},f,c)})},[]);return[o,a]}var LI=typeof window<"u"?z.useLayoutEffect:z.useEffect,$I=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Om=new Map,BI=function(t){LI(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!Om.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Om.set(e,n);var r=$I();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},FI=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,o=t.onChange,s=cb(t,["className","colorModel","color","onChange"]),l=z.useRef(null);BI(l);var a=_I(n,i,o),c=a[0],f=a[1],u=qd(["react-colorful",e]);return z.createElement("div",ja({},s,{ref:l,className:u}),z.createElement(II,{hsva:c,onChange:f}),z.createElement(DI,{hue:c.h,onChange:f,className:"react-colorful__last-control"}))},zI={defaultColor:"000",toHsva:OI,fromHsva:function(t){return AI({h:t.h,s:t.s,v:t.v,a:1})},equal:PI},jI=function(t){return z.createElement(FI,ja({},t,{colorModel:zI}))};const VI=Symbol(),Gd=Symbol(),Ki="a",fo="w";let HI=(t,e)=>new Proxy(t,e);const pu=Object.getPrototypeOf,gu=new WeakMap,hb=t=>t&&(gu.has(t)?gu.get(t):pu(t)===Object.prototype||pu(t)===Array.prototype),Hl=t=>typeof t=="object"&&t!==null,WI=t=>{if(Array.isArray(t))return Array.from(t);const e=Object.getOwnPropertyDescriptors(t);return Object.values(e).forEach(n=>{n.configurable=!0}),Object.create(pu(t),e)},Kd=t=>t[Gd]||t,pb=(t,e,n,r)=>{if(!hb(t))return t;let i=r&&r.get(t);if(!i){const a=Kd(t);i=(c=>Object.values(Object.getOwnPropertyDescriptors(c)).some(f=>!f.configurable&&!f.writable))(a)?[a,WI(a)]:[a],r==null||r.set(t,i)}const[o,s]=i;let l=n&&n.get(o);return l&&l[1].f===!!s||(l=((a,c)=>{const f={f:c};let u=!1;const d=(p,g)=>{if(!u){let m=f[Ki].get(a);if(m||(m={},f[Ki].set(a,m)),p===fo)m[fo]=!0;else{let v=m[p];v||(v=new Set,m[p]=v),v.add(g)}}},h={get:(p,g)=>g===Gd?a:(d("k",g),pb(Reflect.get(p,g),f[Ki],f.c,f.t)),has:(p,g)=>g===VI?(u=!0,f[Ki].delete(a),!0):(d("h",g),Reflect.has(p,g)),getOwnPropertyDescriptor:(p,g)=>(d("o",g),Reflect.getOwnPropertyDescriptor(p,g)),ownKeys:p=>(d(fo),Reflect.ownKeys(p))};return c&&(h.set=h.deleteProperty=()=>!1),[h,f]})(o,!!s),l[1].p=HI(s||o,l[0]),n&&n.set(o,l)),l[1][Ki]=e,l[1].c=n,l[1].t=r,l[1].p},gb=(t,e,n,r,i=Object.is)=>{if(i(t,e))return!1;if(!Hl(t)||!Hl(e))return!0;const o=n.get(Kd(t));if(!o)return!0;if(r){const l=r.get(t);if(l&&l.n===e)return l.g;r.set(t,{n:e,g:!1})}let s=null;try{for(const l of o.h||[])if(s=Reflect.has(t,l)!==Reflect.has(e,l),s)return s;if(o[fo]===!0){if(s=((l,a)=>{const c=Reflect.ownKeys(l),f=Reflect.ownKeys(a);return c.length!==f.length||c.some((u,d)=>u!==f[d])})(t,e),s)return s}else for(const l of o.o||[])if(s=!!Reflect.getOwnPropertyDescriptor(t,l)!=!!Reflect.getOwnPropertyDescriptor(e,l),s)return s;for(const l of o.k||[])if(s=gb(t[l],e[l],n,r,i),s)return s;return s===null&&(s=!0),s}finally{r&&r.set(t,{n:e,g:s})}},UI=t=>hb(t)&&t[Gd]||null,Am=(t,e=!0)=>{gu.set(t,e)},qI=(t,e,n)=>{const r=[],i=new WeakSet,o=(s,l)=>{if(i.has(s))return;Hl(s)&&i.add(s);const a=Hl(s)&&e.get(Kd(s));if(a){var c,f;if((c=a.h)==null||c.forEach(d=>{const h=`:has(${String(d)})`;r.push(l?[...l,h]:[h])}),a[fo]===!0){const d=":ownKeys";r.push(l?[...l,d]:[d])}else{var u;(u=a.o)==null||u.forEach(d=>{const h=`:hasOwn(${String(d)})`;r.push(l?[...l,h]:[h])})}(f=a.k)==null||f.forEach(d=>{!("value"in(Object.getOwnPropertyDescriptor(s,d)||{}))||o(s[d],l?[...l,d]:[d])})}else l&&r.push(l)};return o(t),r},Wl={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Uc=t=>typeof t=="object"&&t!==null,Tn=new WeakMap,Os=new WeakSet,GI=(t=Object.is,e=(c,f)=>new Proxy(c,f),n=c=>Uc(c)&&!Os.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},i=new WeakMap,o=(c,f,u=r)=>{const d=i.get(c);if((d==null?void 0:d[0])===f)return d[1];const h=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return Am(h,!0),i.set(c,[f,h]),Reflect.ownKeys(c).forEach(p=>{if(Object.getOwnPropertyDescriptor(h,p))return;const g=Reflect.get(c,p),{enumerable:m}=Reflect.getOwnPropertyDescriptor(c,p),v={value:g,enumerable:m,configurable:!0};if(Os.has(g))Am(g,!1);else if(g instanceof Promise)delete v.value,v.get=()=>u(g);else if(Tn.has(g)){const[w,S]=Tn.get(g);v.value=o(w,S(),u)}Object.defineProperty(h,p,v)}),Object.preventExtensions(h)},s=new WeakMap,l=[1,1],a=c=>{if(!Uc(c))throw new Error("object required");const f=s.get(c);if(f)return f;let u=l[0];const d=new Set,h=(k,A=++l[0])=>{u!==A&&(u=A,d.forEach(T=>T(k,A)))};let p=l[1];const g=(k=++l[1])=>(p!==k&&!d.size&&(p=k,v.forEach(([A])=>{const T=A[1](k);T>u&&(u=T)})),u),m=k=>(A,T)=>{const M=[...A];M[1]=[k,...M[1]],h(M,T)},v=new Map,w=(k,A)=>{if((Wl?"production":void 0)!=="production"&&v.has(k))throw new Error("prop listener already exists");if(d.size){const T=A[3](m(k));v.set(k,[A,T])}else v.set(k,[A])},S=k=>{var A;const T=v.get(k);T&&(v.delete(k),(A=T[1])==null||A.call(T))},y=k=>(d.add(k),d.size===1&&v.forEach(([T,M],_)=>{if((Wl?"production":void 0)!=="production"&&M)throw new Error("remove already exists");const L=T[3](m(_));v.set(_,[T,L])}),()=>{d.delete(k),d.size===0&&v.forEach(([T,M],_)=>{M&&(M(),v.set(_,[T]))})}),x=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),O=e(x,{deleteProperty(k,A){const T=Reflect.get(k,A);S(A);const M=Reflect.deleteProperty(k,A);return M&&h(["delete",[A],T]),M},set(k,A,T,M){const _=Reflect.has(k,A),L=Reflect.get(k,A,M);if(_&&(t(L,T)||s.has(T)&&t(L,s.get(T))))return!0;S(A),Uc(T)&&(T=UI(T)||T);let W=T;if(T instanceof Promise)T.then(B=>{T.status="fulfilled",T.value=B,h(["resolve",[A],B])}).catch(B=>{T.status="rejected",T.reason=B,h(["reject",[A],B])});else{!Tn.has(T)&&n(T)&&(W=a(T));const B=!Os.has(W)&&Tn.get(W);B&&w(A,B)}return Reflect.set(k,A,W,M),h(["set",[A],T,L]),!0}});s.set(c,O);const R=[x,g,o,y];return Tn.set(O,R),Reflect.ownKeys(c).forEach(k=>{const A=Object.getOwnPropertyDescriptor(c,k);"value"in A&&(O[k]=c[k],delete A.value,delete A.writable),Object.defineProperty(x,k,A)}),O})=>[a,Tn,Os,t,e,n,r,i,o,s,l],[KI]=GI();function JI(t={}){return KI(t)}function YI(t,e,n){const r=Tn.get(t);(Wl?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let i;const o=[],s=r[3];let l=!1;const c=s(f=>{o.push(f),i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(o.splice(0))}))});return l=!0,()=>{l=!1,c()}}function Tm(t,e){const n=Tn.get(t);(Wl?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");const[r,i,o]=n;return o(r,i(),e)}var mu={exports:{}},qc={};/**
429
+ * @license React
430
+ * use-sync-external-store-shim.production.min.js
431
+ *
432
+ * Copyright (c) Facebook, Inc. and its affiliates.
433
+ *
434
+ * This source code is licensed under the MIT license found in the
435
+ * LICENSE file in the root directory of this source tree.
436
+ */var Mm;function XI(){if(Mm)return qc;Mm=1;var t=z;function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function l(u,d){var h=d(),p=r({inst:{value:h,getSnapshot:d}}),g=p[0].inst,m=p[1];return o(function(){g.value=h,g.getSnapshot=d,a(g)&&m({inst:g})},[u,h,d]),i(function(){return a(g)&&m({inst:g}),u(function(){a(g)&&m({inst:g})})},[u]),s(h),h}function a(u){var d=u.getSnapshot;u=u.value;try{var h=d();return!n(u,h)}catch{return!0}}function c(u,d){return d()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return qc.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,qc}var Gc={};/**
437
+ * @license React
438
+ * use-sync-external-store-shim.development.js
439
+ *
440
+ * Copyright (c) Facebook, Inc. and its affiliates.
441
+ *
442
+ * This source code is licensed under the MIT license found in the
443
+ * LICENSE file in the root directory of this source tree.
444
+ */var Rm;function QI(){return Rm||(Rm=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=z,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var y=arguments.length,x=new Array(y>1?y-1:0),b=1;b<y;b++)x[b-1]=arguments[b];r("error",S,x)}}function r(S,y,x){{var b=e.ReactDebugCurrentFrame,O=b.getStackAddendum();O!==""&&(y+="%s",x=x.concat([O]));var R=x.map(function(k){return String(k)});R.unshift("Warning: "+y),Function.prototype.apply.call(console[S],console,R)}}function i(S,y){return S===y&&(S!==0||1/S===1/y)||S!==S&&y!==y}var o=typeof Object.is=="function"?Object.is:i,s=t.useState,l=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,f=!1,u=!1;function d(S,y,x){f||t.startTransition!==void 0&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=y();if(!u){var O=y();o(b,O)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}var R=s({inst:{value:b,getSnapshot:y}}),k=R[0].inst,A=R[1];return a(function(){k.value=b,k.getSnapshot=y,h(k)&&A({inst:k})},[S,b,y]),l(function(){h(k)&&A({inst:k});var T=function(){h(k)&&A({inst:k})};return S(T)},[S]),c(b),b}function h(S){var y=S.getSnapshot,x=S.value;try{var b=y();return!o(x,b)}catch{return!0}}function p(S,y,x){return y()}var g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",m=!g,v=m?p:d,w=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v;Gc.useSyncExternalStore=w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Gc}process.env.NODE_ENV==="production"?mu.exports=XI():mu.exports=QI();var ZI=mu.exports;const eP=kd(ZI),tP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{use:Nm}=z,{useSyncExternalStore:nP}=eP,rP=(t,e)=>{const n=z.useRef();z.useEffect(()=>{n.current=qI(t,e)}),z.useDebugValue(n.current)},iP=new WeakMap;function oP(t,e){const r=z.useRef(),i=z.useRef();let o=!0;const s=nP(z.useCallback(c=>{const f=YI(t,c);return c(),f},[t,void 0]),()=>{const c=Tm(t,Nm);try{if(!o&&r.current&&i.current&&!gb(r.current,c,i.current,new WeakMap))return r.current}catch{}return c},()=>Tm(t,Nm));o=!1;const l=new WeakMap;z.useEffect(()=>{r.current=s,i.current=l}),(tP?"production":void 0)!=="production"&&rP(s,l);const a=z.useMemo(()=>new WeakMap,[]);return pb(s,l,a,iP)}var mb=typeof global=="object"&&global&&global.Object===Object&&global,sP=typeof self=="object"&&self&&self.Object===Object&&self,Wt=mb||sP||Function("return this")(),zt=Wt.Symbol,yb=Object.prototype,lP=yb.hasOwnProperty,aP=yb.toString,Ji=zt?zt.toStringTag:void 0;function cP(t){var e=lP.call(t,Ji),n=t[Ji];try{t[Ji]=void 0;var r=!0}catch{}var i=aP.call(t);return r&&(e?t[Ji]=n:delete t[Ji]),i}var fP=Object.prototype,uP=fP.toString;function dP(t){return uP.call(t)}var hP="[object Null]",pP="[object Undefined]",Dm=zt?zt.toStringTag:void 0;function nr(t){return t==null?t===void 0?pP:hP:Dm&&Dm in Object(t)?cP(t):dP(t)}function un(t){return t!=null&&typeof t=="object"}var gP="[object Symbol]";function Va(t){return typeof t=="symbol"||un(t)&&nr(t)==gP}function vb(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var jt=Array.isArray,mP=1/0,Im=zt?zt.prototype:void 0,Pm=Im?Im.toString:void 0;function Ul(t){if(typeof t=="string")return t;if(jt(t))return vb(t,Ul)+"";if(Va(t))return Pm?Pm.call(t):"";var e=t+"";return e=="0"&&1/t==-mP?"-0":e}var yP=/\s/;function vP(t){for(var e=t.length;e--&&yP.test(t.charAt(e)););return e}var bP=/^\s+/;function wP(t){return t&&t.slice(0,vP(t)+1).replace(bP,"")}function Jn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var _m=NaN,SP=/^[-+]0x[0-9a-f]+$/i,xP=/^0b[01]+$/i,kP=/^0o[0-7]+$/i,CP=parseInt;function si(t){if(typeof t=="number")return t;if(Va(t))return _m;if(Jn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Jn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=wP(t);var n=xP.test(t);return n||kP.test(t)?CP(t.slice(2),n?2:8):SP.test(t)?_m:+t}var Lm=1/0,EP=17976931348623157e292;function OP(t){if(!t)return t===0?t:0;if(t=si(t),t===Lm||t===-Lm){var e=t<0?-1:1;return e*EP}return t===t?t:0}function AP(t){var e=OP(t),n=e%1;return e===e?n?e-n:e:0}function Jd(t){return t}var TP="[object AsyncFunction]",MP="[object Function]",RP="[object GeneratorFunction]",NP="[object Proxy]";function bb(t){if(!Jn(t))return!1;var e=nr(t);return e==MP||e==RP||e==TP||e==NP}var Kc=Wt["__core-js_shared__"],$m=function(){var t=/[^.]+$/.exec(Kc&&Kc.keys&&Kc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function DP(t){return!!$m&&$m in t}var IP=Function.prototype,PP=IP.toString;function Dr(t){if(t!=null){try{return PP.call(t)}catch{}try{return t+""}catch{}}return""}var _P=/[\\^$.*+?()[\]{}|]/g,LP=/^\[object .+?Constructor\]$/,$P=Function.prototype,BP=Object.prototype,FP=$P.toString,zP=BP.hasOwnProperty,jP=RegExp("^"+FP.call(zP).replace(_P,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function VP(t){if(!Jn(t)||DP(t))return!1;var e=bb(t)?jP:LP;return e.test(Dr(t))}function HP(t,e){return t==null?void 0:t[e]}function Ir(t,e){var n=HP(t,e);return VP(n)?n:void 0}var yu=Ir(Wt,"WeakMap");function WP(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var UP=800,qP=16,GP=Date.now;function KP(t){var e=0,n=0;return function(){var r=GP(),i=qP-(r-n);if(n=r,i>0){if(++e>=UP)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function JP(t){return function(){return t}}var Bm=function(){try{var t=Ir(Object,"defineProperty");return t({},"",{}),t}catch{}}(),YP=Bm?function(t,e){return Bm(t,"toString",{configurable:!0,enumerable:!1,value:JP(e),writable:!0})}:Jd,XP=KP(YP);function QP(t,e,n,r){for(var i=t.length,o=n+-1;++o<i;)if(e(t[o],o,t))return o;return-1}function ZP(t){return t!==t}function e_(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function t_(t,e,n){return e===e?e_(t,e,n):QP(t,ZP,n)}function n_(t,e){var n=t==null?0:t.length;return!!n&&t_(t,e,0)>-1}var r_=9007199254740991,i_=/^(?:0|[1-9]\d*)$/;function wb(t,e){var n=typeof t;return e=e??r_,!!e&&(n=="number"||n!="symbol"&&i_.test(t))&&t>-1&&t%1==0&&t<e}function Sb(t,e){return t===e||t!==t&&e!==e}var Fm=Math.max;function o_(t,e,n){return e=Fm(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Fm(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=r[i];return l[e]=n(s),WP(t,this,l)}}function s_(t,e){return XP(o_(t,e,Jd),t+"")}var l_=9007199254740991;function Yd(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l_}function xb(t){return t!=null&&Yd(t.length)&&!bb(t)}var a_=Object.prototype;function c_(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||a_;return t===n}function f_(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var u_="[object Arguments]";function zm(t){return un(t)&&nr(t)==u_}var kb=Object.prototype,d_=kb.hasOwnProperty,h_=kb.propertyIsEnumerable,Xd=zm(function(){return arguments}())?zm:function(t){return un(t)&&d_.call(t,"callee")&&!h_.call(t,"callee")};function p_(){return!1}var Cb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jm=Cb&&typeof module=="object"&&module&&!module.nodeType&&module,g_=jm&&jm.exports===Cb,Vm=g_?Wt.Buffer:void 0,m_=Vm?Vm.isBuffer:void 0,vu=m_||p_,y_="[object Arguments]",v_="[object Array]",b_="[object Boolean]",w_="[object Date]",S_="[object Error]",x_="[object Function]",k_="[object Map]",C_="[object Number]",E_="[object Object]",O_="[object RegExp]",A_="[object Set]",T_="[object String]",M_="[object WeakMap]",R_="[object ArrayBuffer]",N_="[object DataView]",D_="[object Float32Array]",I_="[object Float64Array]",P_="[object Int8Array]",__="[object Int16Array]",L_="[object Int32Array]",$_="[object Uint8Array]",B_="[object Uint8ClampedArray]",F_="[object Uint16Array]",z_="[object Uint32Array]",re={};re[D_]=re[I_]=re[P_]=re[__]=re[L_]=re[$_]=re[B_]=re[F_]=re[z_]=!0;re[y_]=re[v_]=re[R_]=re[b_]=re[N_]=re[w_]=re[S_]=re[x_]=re[k_]=re[C_]=re[E_]=re[O_]=re[A_]=re[T_]=re[M_]=!1;function j_(t){return un(t)&&Yd(t.length)&&!!re[nr(t)]}function Qd(t){return function(e){return t(e)}}var Eb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,uo=Eb&&typeof module=="object"&&module&&!module.nodeType&&module,V_=uo&&uo.exports===Eb,Jc=V_&&mb.process,ql=function(){try{var t=uo&&uo.require&&uo.require("util").types;return t||Jc&&Jc.binding&&Jc.binding("util")}catch{}}(),Hm=ql&&ql.isTypedArray,Ob=Hm?Qd(Hm):j_,H_=Object.prototype,W_=H_.hasOwnProperty;function U_(t,e){var n=jt(t),r=!n&&Xd(t),i=!n&&!r&&vu(t),o=!n&&!r&&!i&&Ob(t),s=n||r||i||o,l=s?f_(t.length,String):[],a=l.length;for(var c in t)W_.call(t,c)&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wb(c,a)))&&l.push(c);return l}function q_(t,e){return function(n){return t(e(n))}}var G_=q_(Object.keys,Object),K_=Object.prototype,J_=K_.hasOwnProperty;function Y_(t){if(!c_(t))return G_(t);var e=[];for(var n in Object(t))J_.call(t,n)&&n!="constructor"&&e.push(n);return e}function Ab(t){return xb(t)?U_(t):Y_(t)}var X_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q_=/^\w*$/;function Zd(t,e){if(jt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Va(t)?!0:Q_.test(t)||!X_.test(t)||e!=null&&t in Object(e)}var Io=Ir(Object,"create");function Z_(){this.__data__=Io?Io(null):{},this.size=0}function eL(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var tL="__lodash_hash_undefined__",nL=Object.prototype,rL=nL.hasOwnProperty;function iL(t){var e=this.__data__;if(Io){var n=e[t];return n===tL?void 0:n}return rL.call(e,t)?e[t]:void 0}var oL=Object.prototype,sL=oL.hasOwnProperty;function lL(t){var e=this.__data__;return Io?e[t]!==void 0:sL.call(e,t)}var aL="__lodash_hash_undefined__";function cL(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Io&&e===void 0?aL:e,this}function Er(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Er.prototype.clear=Z_;Er.prototype.delete=eL;Er.prototype.get=iL;Er.prototype.has=lL;Er.prototype.set=cL;function fL(){this.__data__=[],this.size=0}function Ha(t,e){for(var n=t.length;n--;)if(Sb(t[n][0],e))return n;return-1}var uL=Array.prototype,dL=uL.splice;function hL(t){var e=this.__data__,n=Ha(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():dL.call(e,n,1),--this.size,!0}function pL(t){var e=this.__data__,n=Ha(e,t);return n<0?void 0:e[n][1]}function gL(t){return Ha(this.__data__,t)>-1}function mL(t,e){var n=this.__data__,r=Ha(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function mn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}mn.prototype.clear=fL;mn.prototype.delete=hL;mn.prototype.get=pL;mn.prototype.has=gL;mn.prototype.set=mL;var Po=Ir(Wt,"Map");function yL(){this.size=0,this.__data__={hash:new Er,map:new(Po||mn),string:new Er}}function vL(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Wa(t,e){var n=t.__data__;return vL(e)?n[typeof e=="string"?"string":"hash"]:n.map}function bL(t){var e=Wa(this,t).delete(t);return this.size-=e?1:0,e}function wL(t){return Wa(this,t).get(t)}function SL(t){return Wa(this,t).has(t)}function xL(t,e){var n=Wa(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function yn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}yn.prototype.clear=yL;yn.prototype.delete=bL;yn.prototype.get=wL;yn.prototype.has=SL;yn.prototype.set=xL;var kL="Expected a function";function eh(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(kL);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(eh.Cache||yn),n}eh.Cache=yn;var CL=500;function EL(t){var e=eh(t,function(r){return n.size===CL&&n.clear(),r}),n=e.cache;return e}var OL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AL=/\\(\\)?/g,TL=EL(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(OL,function(n,r,i,o){e.push(i?o.replace(AL,"$1"):r||n)}),e});function bu(t){return t==null?"":Ul(t)}function Tb(t,e){return jt(t)?t:Zd(t,e)?[t]:TL(bu(t))}var ML=1/0;function Ua(t){if(typeof t=="string"||Va(t))return t;var e=t+"";return e=="0"&&1/t==-ML?"-0":e}function Mb(t,e){e=Tb(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Ua(e[n++])];return n&&n==r?t:void 0}function RL(t,e,n){var r=t==null?void 0:Mb(t,e);return r===void 0?n:r}function Rb(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Wm=zt?zt.isConcatSpreadable:void 0;function NL(t){return jt(t)||Xd(t)||!!(Wm&&t&&t[Wm])}function DL(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=NL),i||(i=[]);++o<s;){var l=t[o];n(l)&&Rb(i,l)}return i}function IL(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}function PL(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:IL(t,e,n)}var _L="\\ud800-\\udfff",LL="\\u0300-\\u036f",$L="\\ufe20-\\ufe2f",BL="\\u20d0-\\u20ff",FL=LL+$L+BL,zL="\\ufe0e\\ufe0f",jL="\\u200d",VL=RegExp("["+jL+_L+FL+zL+"]");function th(t){return VL.test(t)}function HL(t){return t.split("")}var Nb="\\ud800-\\udfff",WL="\\u0300-\\u036f",UL="\\ufe20-\\ufe2f",qL="\\u20d0-\\u20ff",GL=WL+UL+qL,KL="\\ufe0e\\ufe0f",JL="["+Nb+"]",wu="["+GL+"]",Su="\\ud83c[\\udffb-\\udfff]",YL="(?:"+wu+"|"+Su+")",Db="[^"+Nb+"]",Ib="(?:\\ud83c[\\udde6-\\uddff]){2}",Pb="[\\ud800-\\udbff][\\udc00-\\udfff]",XL="\\u200d",_b=YL+"?",Lb="["+KL+"]?",QL="(?:"+XL+"(?:"+[Db,Ib,Pb].join("|")+")"+Lb+_b+")*",ZL=Lb+_b+QL,e$="(?:"+[Db+wu+"?",wu,Ib,Pb,JL].join("|")+")",t$=RegExp(Su+"(?="+Su+")|"+e$+ZL,"g");function n$(t){return t.match(t$)||[]}function r$(t){return th(t)?n$(t):HL(t)}function i$(t,e,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),e!==void 0&&(t=t>=e?t:e)),t}function o$(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=si(n),n=n===n?n:0),e!==void 0&&(e=si(e),e=e===e?e:0),i$(si(t),e,n)}function s$(){this.__data__=new mn,this.size=0}function l$(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function a$(t){return this.__data__.get(t)}function c$(t){return this.__data__.has(t)}var f$=200;function u$(t,e){var n=this.__data__;if(n instanceof mn){var r=n.__data__;if(!Po||r.length<f$-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new yn(r)}return n.set(t,e),this.size=n.size,this}function ln(t){var e=this.__data__=new mn(t);this.size=e.size}ln.prototype.clear=s$;ln.prototype.delete=l$;ln.prototype.get=a$;ln.prototype.has=c$;ln.prototype.set=u$;function d$(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function h$(){return[]}var p$=Object.prototype,g$=p$.propertyIsEnumerable,Um=Object.getOwnPropertySymbols,m$=Um?function(t){return t==null?[]:(t=Object(t),d$(Um(t),function(e){return g$.call(t,e)}))}:h$;function y$(t,e,n){var r=e(t);return jt(t)?r:Rb(r,n(t))}function qm(t){return y$(t,Ab,m$)}var xu=Ir(Wt,"DataView"),ku=Ir(Wt,"Promise"),Cu=Ir(Wt,"Set"),Gm="[object Map]",v$="[object Object]",Km="[object Promise]",Jm="[object Set]",Ym="[object WeakMap]",Xm="[object DataView]",b$=Dr(xu),w$=Dr(Po),S$=Dr(ku),x$=Dr(Cu),k$=Dr(yu),Mn=nr;(xu&&Mn(new xu(new ArrayBuffer(1)))!=Xm||Po&&Mn(new Po)!=Gm||ku&&Mn(ku.resolve())!=Km||Cu&&Mn(new Cu)!=Jm||yu&&Mn(new yu)!=Ym)&&(Mn=function(t){var e=nr(t),n=e==v$?t.constructor:void 0,r=n?Dr(n):"";if(r)switch(r){case b$:return Xm;case w$:return Gm;case S$:return Km;case x$:return Jm;case k$:return Ym}return e});var Qm=Wt.Uint8Array,C$="__lodash_hash_undefined__";function E$(t){return this.__data__.set(t,C$),this}function O$(t){return this.__data__.has(t)}function _o(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new yn;++e<n;)this.add(t[e])}_o.prototype.add=_o.prototype.push=E$;_o.prototype.has=O$;function A$(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function $b(t,e){return t.has(e)}var T$=1,M$=2;function Bb(t,e,n,r,i,o){var s=n&T$,l=t.length,a=e.length;if(l!=a&&!(s&&a>l))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var u=-1,d=!0,h=n&M$?new _o:void 0;for(o.set(t,e),o.set(e,t);++u<l;){var p=t[u],g=e[u];if(r)var m=s?r(g,p,u,e,t,o):r(p,g,u,t,e,o);if(m!==void 0){if(m)continue;d=!1;break}if(h){if(!A$(e,function(v,w){if(!$b(h,w)&&(p===v||i(p,v,n,r,o)))return h.push(w)})){d=!1;break}}else if(!(p===g||i(p,g,n,r,o))){d=!1;break}}return o.delete(t),o.delete(e),d}function R$(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function N$(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var D$=1,I$=2,P$="[object Boolean]",_$="[object Date]",L$="[object Error]",$$="[object Map]",B$="[object Number]",F$="[object RegExp]",z$="[object Set]",j$="[object String]",V$="[object Symbol]",H$="[object ArrayBuffer]",W$="[object DataView]",Zm=zt?zt.prototype:void 0,Yc=Zm?Zm.valueOf:void 0;function U$(t,e,n,r,i,o,s){switch(n){case W$:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case H$:return!(t.byteLength!=e.byteLength||!o(new Qm(t),new Qm(e)));case P$:case _$:case B$:return Sb(+t,+e);case L$:return t.name==e.name&&t.message==e.message;case F$:case j$:return t==e+"";case $$:var l=R$;case z$:var a=r&D$;if(l||(l=N$),t.size!=e.size&&!a)return!1;var c=s.get(t);if(c)return c==e;r|=I$,s.set(t,e);var f=Bb(l(t),l(e),r,i,o,s);return s.delete(t),f;case V$:if(Yc)return Yc.call(t)==Yc.call(e)}return!1}var q$=1,G$=Object.prototype,K$=G$.hasOwnProperty;function J$(t,e,n,r,i,o){var s=n&q$,l=qm(t),a=l.length,c=qm(e),f=c.length;if(a!=f&&!s)return!1;for(var u=a;u--;){var d=l[u];if(!(s?d in e:K$.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var g=!0;o.set(t,e),o.set(e,t);for(var m=s;++u<a;){d=l[u];var v=t[d],w=e[d];if(r)var S=s?r(w,v,d,e,t,o):r(v,w,d,t,e,o);if(!(S===void 0?v===w||i(v,w,n,r,o):S)){g=!1;break}m||(m=d=="constructor")}if(g&&!m){var y=t.constructor,x=e.constructor;y!=x&&"constructor"in t&&"constructor"in e&&!(typeof y=="function"&&y instanceof y&&typeof x=="function"&&x instanceof x)&&(g=!1)}return o.delete(t),o.delete(e),g}var Y$=1,ey="[object Arguments]",ty="[object Array]",As="[object Object]",X$=Object.prototype,ny=X$.hasOwnProperty;function Q$(t,e,n,r,i,o){var s=jt(t),l=jt(e),a=s?ty:Mn(t),c=l?ty:Mn(e);a=a==ey?As:a,c=c==ey?As:c;var f=a==As,u=c==As,d=a==c;if(d&&vu(t)){if(!vu(e))return!1;s=!0,f=!1}if(d&&!f)return o||(o=new ln),s||Ob(t)?Bb(t,e,n,r,i,o):U$(t,e,a,n,r,i,o);if(!(n&Y$)){var h=f&&ny.call(t,"__wrapped__"),p=u&&ny.call(e,"__wrapped__");if(h||p){var g=h?t.value():t,m=p?e.value():e;return o||(o=new ln),i(g,m,n,r,o)}}return d?(o||(o=new ln),J$(t,e,n,r,i,o)):!1}function nh(t,e,n,r,i){return t===e?!0:t==null||e==null||!un(t)&&!un(e)?t!==t&&e!==e:Q$(t,e,n,r,nh,i)}var Z$=1,e3=2;function t3(t,e,n,r){var i=n.length,o=i;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],a=t[l],c=s[1];if(s[2]){if(a===void 0&&!(l in t))return!1}else{var f=new ln,u;if(!(u===void 0?nh(c,a,Z$|e3,r,f):u))return!1}}return!0}function Fb(t){return t===t&&!Jn(t)}function n3(t){for(var e=Ab(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Fb(i)]}return e}function zb(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function r3(t){var e=n3(t);return e.length==1&&e[0][2]?zb(e[0][0],e[0][1]):function(n){return n===t||t3(n,t,e)}}function i3(t,e){return t!=null&&e in Object(t)}function o3(t,e,n){e=Tb(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var s=Ua(e[r]);if(!(o=t!=null&&n(t,s)))break;t=t[s]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&Yd(i)&&wb(s,i)&&(jt(t)||Xd(t)))}function s3(t,e){return t!=null&&o3(t,e,i3)}var l3=1,a3=2;function c3(t,e){return Zd(t)&&Fb(e)?zb(Ua(t),e):function(n){var r=RL(n,t);return r===void 0&&r===e?s3(n,t):nh(e,r,l3|a3)}}function jb(t){return function(e){return e==null?void 0:e[t]}}function f3(t){return function(e){return Mb(e,t)}}function u3(t){return Zd(t)?jb(Ua(t)):f3(t)}function d3(t){return typeof t=="function"?t:t==null?Jd:typeof t=="object"?jt(t)?c3(t[0],t[1]):r3(t):u3(t)}var Xc=function(){return Wt.Date.now()},h3="Expected a function",p3=Math.max,g3=Math.min;function Vb(t,e,n){var r,i,o,s,l,a,c=0,f=!1,u=!1,d=!0;if(typeof t!="function")throw new TypeError(h3);e=si(e)||0,Jn(n)&&(f=!!n.leading,u="maxWait"in n,o=u?p3(si(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d);function h(b){var O=r,R=i;return r=i=void 0,c=b,s=t.apply(R,O),s}function p(b){return c=b,l=setTimeout(v,e),f?h(b):s}function g(b){var O=b-a,R=b-c,k=e-O;return u?g3(k,o-R):k}function m(b){var O=b-a,R=b-c;return a===void 0||O>=e||O<0||u&&R>=o}function v(){var b=Xc();if(m(b))return w(b);l=setTimeout(v,g(b))}function w(b){return l=void 0,d&&r?h(b):(r=i=void 0,s)}function S(){l!==void 0&&clearTimeout(l),c=0,r=a=i=l=void 0}function y(){return l===void 0?s:w(Xc())}function x(){var b=Xc(),O=m(b);if(r=arguments,i=this,a=b,O){if(l===void 0)return p(a);if(u)return clearTimeout(l),l=setTimeout(v,e),h(a)}return l===void 0&&(l=setTimeout(v,e)),s}return x.cancel=S,x.flush=y,x}function Qc(t){return un(t)&&xb(t)}var m3=200;function y3(t,e,n,r){var i=-1,o=n_,s=!0,l=t.length,a=[],c=e.length;if(!l)return a;n&&(e=vb(e,Qd(n))),e.length>=m3&&(o=$b,s=!1,e=new _o(e));e:for(;++i<l;){var f=t[i],u=n==null?f:n(f);if(f=f!==0?f:0,s&&u===u){for(var d=c;d--;)if(e[d]===u)continue e;a.push(f)}else o(e,u,r)||a.push(f)}return a}function v3(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var b3=s_(function(t,e){var n=v3(e);return Qc(n)&&(n=void 0),Qc(t)?y3(t,DL(e,1,Qc),d3(n)):[]}),w3="[object Number]";function S3(t){return typeof t=="number"||un(t)&&nr(t)==w3}var x3="[object RegExp]";function k3(t){return un(t)&&nr(t)==x3}var ry=ql&&ql.isRegExp,C3=ry?Qd(ry):k3,E3=jb("length"),Hb="\\ud800-\\udfff",O3="\\u0300-\\u036f",A3="\\ufe20-\\ufe2f",T3="\\u20d0-\\u20ff",M3=O3+A3+T3,R3="\\ufe0e\\ufe0f",N3="["+Hb+"]",Eu="["+M3+"]",Ou="\\ud83c[\\udffb-\\udfff]",D3="(?:"+Eu+"|"+Ou+")",Wb="[^"+Hb+"]",Ub="(?:\\ud83c[\\udde6-\\uddff]){2}",qb="[\\ud800-\\udbff][\\udc00-\\udfff]",I3="\\u200d",Gb=D3+"?",Kb="["+R3+"]?",P3="(?:"+I3+"(?:"+[Wb,Ub,qb].join("|")+")"+Kb+Gb+")*",_3=Kb+Gb+P3,L3="(?:"+[Wb+Eu+"?",Eu,Ub,qb,N3].join("|")+")",iy=RegExp(Ou+"(?="+Ou+")|"+L3+_3,"g");function $3(t){for(var e=iy.lastIndex=0;iy.test(t);)++e;return e}function B3(t){return th(t)?$3(t):E3(t)}var F3="Expected a function";function z3(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(F3);return Jn(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Vb(t,e,{leading:r,maxWait:e,trailing:i})}var j3=30,V3="...",H3=/\w*$/;function W3(t,e){var n=j3,r=V3;if(Jn(e)){var i="separator"in e?e.separator:i;n="length"in e?AP(e.length):n,r="omission"in e?Ul(e.omission):r}t=bu(t);var o=t.length;if(th(t)){var s=r$(t);o=s.length}if(n>=o)return t;var l=n-B3(r);if(l<1)return r;var a=s?PL(s,0,l).join(""):t.slice(0,l);if(i===void 0)return a+r;if(s&&(l+=a.length-l),C3(i)){if(t.slice(l).search(i)){var c,f=a;for(i.global||(i=RegExp(i.source,bu(H3.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var u=c.index;a=a.slice(0,u===void 0?l:u)}}else if(t.indexOf(Ul(i),l)!=l){var d=a.lastIndexOf(i);d>-1&&(a=a.slice(0,d))}return a+r}const Pt=()=>new Map,Au=t=>{const e=Pt();return t.forEach((n,r)=>{e.set(r,n)}),e},Ii=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},U3=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},q3=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},wi=()=>new Set,Zc=t=>t[t.length-1],Si=Array.from,G3=Array.isArray;class K3{constructor(){this._observers=Pt()}on(e,n){return Ii(this._observers,e,wi).add(n),n}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Si((this._observers.get(e)||Pt()).values()).forEach(r=>r(...n))}destroy(){this._observers=Pt()}}const Or=Math.floor,nl=Math.abs,Jb=(t,e)=>t<e?t:e,Pi=(t,e)=>t>e?t:e,J3=t=>t!==0?t<0:1/t<0,oy=1,sy=2,ef=4,tf=8,Y3=32,Yb=64,Gl=128,X3=31,ly=63,ho=127,Q3=2147483647,Z3=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Or(t)===t),eB=t=>t.toLowerCase(),tB=/^\s*/g,nB=t=>t.replace(tB,""),rB=/([A-Z])/g,ay=(t,e)=>nB(t.replace(rB,n=>`${e}${eB(n)}`)),iB=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e.codePointAt(i);return r},Lo=typeof TextEncoder<"u"?new TextEncoder:null,oB=t=>Lo.encode(t),sB=Lo?oB:iB;let nf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});nf&&nf.decode(new Uint8Array).length===1&&(nf=null);class ts{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const rh=()=>new ts,lB=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},on=t=>{const e=new Uint8Array(lB(t));let n=0;for(let r=0;r<t.bufs.length;r++){const i=t.bufs[r];e.set(i,n),n+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},aB=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(Pi(n,e)*2),t.cpos=0)},ge=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},Tu=ge,te=(t,e)=>{for(;e>ho;)ge(t,Gl|ho&e),e=Or(e/128);ge(t,ho&e)},ih=(t,e)=>{const n=J3(e);for(n&&(e=-e),ge(t,(e>ly?Gl:0)|(n?Yb:0)|ly&e),e=Or(e/64);e>0;)ge(t,(e>ho?Gl:0)|ho&e),e=Or(e/128)},Mu=new Uint8Array(3e4),cB=Mu.length/3,fB=(t,e)=>{if(e.length<cB){const n=Lo.encodeInto(e,Mu).written||0;te(t,n);for(let r=0;r<n;r++)ge(t,Mu[r])}else Ge(t,sB(e))},uB=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;te(t,r);for(let i=0;i<r;i++)ge(t,n.codePointAt(i))},li=Lo&&Lo.encodeInto?fB:uB,oh=(t,e)=>{const n=t.cbuf.length,r=t.cpos,i=Jb(n-r,e.length),o=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,o>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Pi(n*2,o)),t.cbuf.set(e.subarray(i)),t.cpos=o)},Ge=(t,e)=>{te(t,e.byteLength),oh(t,e)},sh=(t,e)=>{aB(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},dB=(t,e)=>sh(t,4).setFloat32(0,e,!1),hB=(t,e)=>sh(t,8).setFloat64(0,e,!1),pB=(t,e)=>sh(t,8).setBigInt64(0,e,!1),cy=new DataView(new ArrayBuffer(4)),gB=t=>(cy.setFloat32(0,t),cy.getFloat32(0)===t),$o=(t,e)=>{switch(typeof e){case"string":ge(t,119),li(t,e);break;case"number":Z3(e)&&nl(e)<=Q3?(ge(t,125),ih(t,e)):gB(e)?(ge(t,124),dB(t,e)):(ge(t,123),hB(t,e));break;case"bigint":ge(t,122),pB(t,e);break;case"object":if(e===null)ge(t,126);else if(G3(e)){ge(t,117),te(t,e.length);for(let n=0;n<e.length;n++)$o(t,e[n])}else if(e instanceof Uint8Array)ge(t,116),Ge(t,e);else{ge(t,118);const n=Object.keys(e);te(t,n.length);for(let r=0;r<n.length;r++){const i=n[r];li(t,i),$o(t,e[i])}}break;case"boolean":ge(t,e?120:121);break;default:ge(t,127)}};class fy extends ts{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&te(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const uy=t=>{t.count>0&&(ih(t.encoder,t.count===1?t.s:-t.s),t.count>1&&te(t.encoder,t.count-2))};class rl{constructor(){this.encoder=new ts,this.s=0,this.count=0}write(e){this.s===e?this.count++:(uy(this),this.count=1,this.s=e)}toUint8Array(){return uy(this),on(this.encoder)}}const dy=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);ih(t.encoder,e),t.count>1&&te(t.encoder,t.count-2)}};class rf{constructor(){this.encoder=new ts,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(dy(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return dy(this),on(this.encoder)}}class mB{constructor(){this.sarr=[],this.s="",this.lensE=new rl}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new ts;return this.sarr.push(this.s),this.s="",li(e,this.sarr.join("")),oh(e,this.lensE.toUint8Array()),on(e)}}const xi=t=>new Error(t),_t=()=>{throw xi("Method unimplemented")},Yn=()=>{throw xi("Unexpected case")},yB=crypto.getRandomValues.bind(crypto),Xb=()=>yB(new Uint32Array(1))[0],vB="10000000-1000-4000-8000"+-1e11,bB=()=>vB.replace(/[018]/g,t=>(t^Xb()&15>>t/4).toString(16)),hy=t=>new Promise(t);Promise.all.bind(Promise);const py=t=>t===void 0?null:t;class wB{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let Qb=new wB,SB=!0;try{typeof localStorage<"u"&&localStorage&&(Qb=localStorage,SB=!1)}catch{}const xB=Qb,kB=Object.assign,CB=Object.keys,EB=(t,e)=>{for(const n in t)e(t[n],n)},gy=t=>CB(t).length,OB=t=>{for(const e in t)return!1;return!0},AB=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},TB=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),MB=(t,e)=>t===e||gy(t)===gy(e)&&AB(t,(n,r)=>(n!==void 0||TB(e,r))&&e[r]===n),lh=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&lh(t,e,n+1)}},RB=(t,e)=>e.includes(t),Bo=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let xt;const NB=()=>{if(xt===void 0)if(Bo){xt=Pt();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&xt.set(e,""),e=r):e!==null&&(xt.set(e,r),e=null)}e!==null&&xt.set(e,"")}else typeof location=="object"?(xt=Pt(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");xt.set(`--${ay(e,"-")}`,n),xt.set(`-${ay(e,"-")}`,n)}})):xt=Pt();return xt},Ru=t=>NB().has(t),Nu=t=>py(Bo?process.env[t.toUpperCase().replaceAll("-","_")]:xB.getItem(t)),Zb=t=>Ru("--"+t)||Nu(t)!==null;Zb("production");const DB=Bo&&RB(process.env.FORCE_COLOR,["true","1","2"]),IB=DB||!Ru("--no-colors")&&!Zb("no-color")&&(!Bo||process.stdout.isTTY)&&(!Bo||Ru("--color")||Nu("COLORTERM")!==null||(Nu("TERM")||"").includes("color"));class PB{constructor(e,n){this.left=e,this.right=n}}const Qt=(t,e)=>new PB(t,e);typeof DOMParser<"u"&&new DOMParser;const _B=t=>U3(t,(e,n)=>`${n}:${e};`).join(""),vn=Symbol,ew=vn(),tw=vn(),LB=vn(),$B=vn(),BB=vn(),nw=vn(),FB=vn(),rw=vn(),zB=vn(),jB=t=>{var i;t.length===1&&((i=t[0])==null?void 0:i.constructor)===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r<t.length;r++){const o=t[r];if(o===void 0)break;if(o.constructor===String||o.constructor===Number)e.push(o);else if(o.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const o=t[r];o instanceof Symbol||n.push(o)}return n},VB={[ew]:Qt("font-weight","bold"),[tw]:Qt("font-weight","normal"),[LB]:Qt("color","blue"),[BB]:Qt("color","green"),[$B]:Qt("color","grey"),[nw]:Qt("color","red"),[FB]:Qt("color","purple"),[rw]:Qt("color","orange"),[zB]:Qt("color","black")},HB=t=>{var s;t.length===1&&((s=t[0])==null?void 0:s.constructor)===Function&&(t=t[0]());const e=[],n=[],r=Pt();let i=[],o=0;for(;o<t.length;o++){const l=t[o],a=VB[l];if(a!==void 0)r.set(a.left,a.right);else{if(l===void 0)break;if(l.constructor===String||l.constructor===Number){const c=_B(r);o>0||c.length>0?(e.push("%c"+l),n.push(c)):e.push(l)}else break}}for(o>0&&(i=n,i.unshift(e.join("")));o<t.length;o++){const l=t[o];l instanceof Symbol||i.push(l)}return i},WB=IB?HB:jB,UB=(...t)=>{console.log(...WB(t)),qB.forEach(e=>e.print(t))},qB=wi(),iw=t=>({[Symbol.iterator](){return this},next:t}),GB=(t,e)=>iw(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),of=(t,e)=>iw(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class KB{constructor(e,n){this.clock=e,this.len=n}}class JB{constructor(){this.clients=new Map}}const ow=(t,e,n)=>e.clients.forEach((r,i)=>{const o=t.doc.store.clients.get(i);for(let s=0;s<r.length;s++){const l=r[s];dw(t,o,l.clock,l.len,n)}}),YB=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const i=Or((n+r)/2),o=t[i],s=o.clock;if(s<=e){if(e<s+o.len)return i;n=i+1}else r=i-1}return null},sw=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&YB(n,e.clock)!==null},lw=t=>{t.clients.forEach(e=>{e.sort((i,o)=>i.clock-o.clock);let n,r;for(n=1,r=1;n<e.length;n++){const i=e[r-1],o=e[n];i.clock+i.len>=o.clock?i.len=Pi(i.len,o.clock+o.len-i.clock):(r<n&&(e[r]=o),r++)}e.length=r})},aw=(t,e,n,r)=>{Ii(t.clients,e,()=>[]).push(new KB(n,r))},XB=(t,e)=>{te(t.restEncoder,e.clients.size),Si(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),te(t.restEncoder,n);const i=r.length;te(t.restEncoder,i);for(let o=0;o<i;o++){const s=r[o];t.writeDsClock(s.clock),t.writeDsLen(s.len)}})},cw=Xb;class ns extends K3{constructor({guid:e=bB(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:o=null,autoLoad:s=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=cw(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new sF,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=s,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=hy(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const a=()=>hy(c=>{const f=u=>{(u===void 0||u===!0)&&(this.off("sync",f),c())};this.on("sync",f)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=a()}load(){const e=this._item;e!==null&&!this.shouldLoad&&ie(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Si(this.subdocs).map(e=>e.guid))}transact(e,n=null){return ie(this,e,n)}get(e,n=Ee){const r=Ii(this.share,e,()=>{const o=new n;return o._integrate(this,null),o}),i=r.constructor;if(n!==Ee&&i!==n)if(i===Ee){const o=new n;o._map=r._map,r._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=o}),o._start=r._start;for(let s=o._start;s!==null;s=s.right)s.parent=o;return o._length=r._length,this.share.set(e,o),o._integrate(this,null),o}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,po)}getText(e=""){return this.get(e,Vo)}getMap(e=""){return this.get(e,Xl)}getXmlElement(e=""){return this.get(e,Ho)}getXmlFragment(e=""){return this.get(e,ki)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){Si(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new ns({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,ie(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class QB{constructor(){this.restEncoder=rh()}toUint8Array(){return on(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){te(this.restEncoder,e)}writeDsLen(e){te(this.restEncoder,e)}}class ZB extends QB{writeLeftID(e){te(this.restEncoder,e.client),te(this.restEncoder,e.clock)}writeRightID(e){te(this.restEncoder,e.client),te(this.restEncoder,e.clock)}writeClient(e){te(this.restEncoder,e)}writeInfo(e){Tu(this.restEncoder,e)}writeString(e){li(this.restEncoder,e)}writeParentInfo(e){te(this.restEncoder,e?1:0)}writeTypeRef(e){te(this.restEncoder,e)}writeLen(e){te(this.restEncoder,e)}writeAny(e){$o(this.restEncoder,e)}writeBuf(e){Ge(this.restEncoder,e)}writeJSON(e){li(this.restEncoder,JSON.stringify(e))}writeKey(e){li(this.restEncoder,e)}}class eF{constructor(){this.restEncoder=rh(),this.dsCurrVal=0}toUint8Array(){return on(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,te(this.restEncoder,n)}writeDsLen(e){e===0&&Yn(),te(this.restEncoder,e-1),this.dsCurrVal+=e}}class tF extends eF{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new rf,this.clientEncoder=new rl,this.leftClockEncoder=new rf,this.rightClockEncoder=new rf,this.infoEncoder=new fy(Tu),this.stringEncoder=new mB,this.parentInfoEncoder=new fy(Tu),this.typeRefEncoder=new rl,this.lenEncoder=new rl}toUint8Array(){const e=rh();return te(e,0),Ge(e,this.keyClockEncoder.toUint8Array()),Ge(e,this.clientEncoder.toUint8Array()),Ge(e,this.leftClockEncoder.toUint8Array()),Ge(e,this.rightClockEncoder.toUint8Array()),Ge(e,on(this.infoEncoder)),Ge(e,this.stringEncoder.toUint8Array()),Ge(e,on(this.parentInfoEncoder)),Ge(e,this.typeRefEncoder.toUint8Array()),Ge(e,this.lenEncoder.toUint8Array()),oh(e,on(this.restEncoder)),on(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){$o(this.restEncoder,e)}writeBuf(e){Ge(this.restEncoder,e)}writeJSON(e){$o(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const nF=(t,e,n,r)=>{r=Pi(r,e[0].id.clock);const i=dn(e,r);te(t.restEncoder,e.length-i),t.writeClient(n),te(t.restEncoder,r);const o=e[i];o.write(t,r-o.id.clock);for(let s=i+1;s<e.length;s++)e[s].write(t,0)},rF=(t,e,n)=>{const r=new Map;n.forEach((i,o)=>{He(e,o)>i&&r.set(o,i)}),ah(e).forEach((i,o)=>{n.has(o)||r.set(o,0)}),te(t.restEncoder,r.size),Si(r.entries()).sort((i,o)=>o[0]-i[0]).forEach(([i,o])=>{nF(t,e.clients.get(i),i,o)})},iF=(t,e)=>rF(t,e.doc.store,e.beforeState);class oF{constructor(){this.l=[]}}const my=()=>new oF,yy=(t,e)=>t.l.push(e),vy=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},fw=(t,e,n)=>lh(t.l,[e,n]);class il{constructor(e,n){this.client=e,this.clock=n}}const Ts=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,oe=(t,e)=>new il(t,e),Fo=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw Yn()};class Kl{constructor(e,n,r,i=0){this.type=e,this.tname=n,this.item=r,this.assoc=i}}const Ms=(t,e,n)=>{let r=null,i=null;return t._item===null?i=Fo(t):r=oe(t._item.id.client,t._item.id.clock),new Kl(r,i,e,n)},sf=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return Ms(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return Ms(t,oe(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return Ms(t,r.lastId,n);r=r.right}return Ms(t,null,n)},Jr=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!sw(e.ds,t.id),Du=(t,e)=>{const n=Ii(t.meta,Du,wi),r=t.doc.store;n.has(e)||(e.sv.forEach((i,o)=>{i<He(r,o)&&Xn(t,oe(o,i))}),ow(t,e.ds,i=>{}),n.add(e))};class sF{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const ah=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},He=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},uw=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw Yn()}n.push(e)},dn=(t,e)=>{let n=0,r=t.length-1,i=t[r],o=i.id.clock;if(o===e)return r;let s=Or(e/(o+i.length-1)*r);for(;n<=r;){if(i=t[s],o=i.id.clock,o<=e){if(e<o+i.length)return s;n=s+1}else r=s-1;s=Or((n+r)/2)}throw Yn()},lF=(t,e)=>{const n=t.clients.get(e.client);return n[dn(n,e.clock)]},lf=lF,Iu=(t,e,n)=>{const r=dn(e,n),i=e[r];return i.id.clock<n&&i instanceof Xe?(e.splice(r+1,0,Rw(t,i,n-i.id.clock)),r+1):r},Xn=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Iu(t,n,e.clock)]},by=(t,e,n)=>{const r=e.clients.get(n.client),i=dn(r,n.clock),o=r[i];return n.clock!==o.id.clock+o.length-1&&o.constructor!==In&&r.splice(i+1,0,Rw(t,o,n.clock-o.id.clock+1)),o},aF=(t,e,n)=>{const r=t.clients.get(e.id.client);r[dn(r,e.id.clock)]=n},dw=(t,e,n,r,i)=>{if(r===0)return;const o=n+r;let s=Iu(t,e,n),l;do l=e[s++],o<l.id.clock+l.length&&Iu(t,e,o),i(l);while(s<e.length&&e[s].id.clock<o)};class cF{constructor(e,n,r){this.doc=e,this.deleteSet=new JB,this.beforeState=ah(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const wy=(t,e)=>e.deleteSet.clients.size===0&&!q3(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(lw(e.deleteSet),iF(t,e),XB(t,e.deleteSet),!0),Sy=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&Ii(t.changed,e,wi).add(n)},ol=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof Xe&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const o=e-i;return o&&t.splice(e+1-o,o),o},fF=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const o=e.clients.get(r);for(let s=i.length-1;s>=0;s--){const l=i[s],a=l.clock+l.len;for(let c=dn(o,l.clock),f=o[c];c<o.length&&f.id.clock<a;f=o[++c]){const u=o[c];if(l.clock+l.len<=u.id.clock)break;u instanceof Xe&&u.deleted&&!u.keep&&n(u)&&u.gc(e,!1)}}}},uF=(t,e)=>{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let o=n.length-1;o>=0;o--){const s=n[o],l=Jb(i.length-1,1+dn(i,s.clock+s.len-1));for(let a=l,c=i[a];a>0&&c.id.clock>=s.clock;c=i[a])a-=1+ol(i,a)}})},hw=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,i=r.store,o=n.deleteSet,s=n._mergeStructs;try{lw(o),n.afterState=ah(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const l=[];n.changed.forEach((a,c)=>l.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,a)})),l.push(()=>{n.changedParentTypes.forEach((a,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(a=a.filter(f=>f.target._item===null||!f.target._item.deleted),a.forEach(f=>{f.currentTarget=c,f._path=null}),a.sort((f,u)=>f.path.length-u.path.length),fw(c._dEH,a,n))})}),l.push(()=>r.emit("afterTransaction",[n,r])),lh(l,[]),n._needFormattingCleanup&&kF(n)}finally{r.gc&&fF(o,i,r.gcFilter),uF(o,i),n.afterState.forEach((f,u)=>{const d=n.beforeState.get(u)||0;if(d!==f){const h=i.clients.get(u),p=Pi(dn(h,d),1);for(let g=h.length-1;g>=p;)g-=1+ol(h,g)}});for(let f=s.length-1;f>=0;f--){const{client:u,clock:d}=s[f].id,h=i.clients.get(u),p=dn(h,d);p+1<h.length&&ol(h,p+1)>1||p>0&&ol(h,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(UB(rw,ew,"[yjs] ",tw,nw,"Changed the client-id because another client seems to be using it."),r.clientID=cw()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const f=new ZB;wy(f,n)&&r.emit("update",[f.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const f=new tF;wy(f,n)&&r.emit("updateV2",[f.toUint8Array(),n.origin,r,n])}const{subdocsAdded:l,subdocsLoaded:a,subdocsRemoved:c}=n;(l.size>0||c.size>0||a.size>0)&&(l.forEach(f=>{f.clientID=r.clientID,f.collectionid==null&&(f.collectionid=r.collectionid),r.subdocs.add(f)}),c.forEach(f=>r.subdocs.delete(f)),r.emit("subdocs",[{loaded:a,added:l,removed:c},r,n]),c.forEach(f=>f.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):hw(t,e+1)}}},ie=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let o=!1,s=null;t._transaction===null&&(o=!0,t._transaction=new cF(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(o){const l=t._transaction===i[0];t._transaction=null,l&&hw(i,0)}}return s},xy="You must not compute changes after the event-handler fired.";class qa{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=dF(this.currentTarget,this.target))}deletes(e){return sw(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw xi(xy);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const o=n._map.get(i);let s,l;if(this.adds(o)){let a=o.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(o))if(a!==null&&this.deletes(a))s="delete",l=Zc(a.content.getContent());else return;else a!==null&&this.deletes(a)?(s="update",l=Zc(a.content.getContent())):(s="add",l=void 0)}else if(this.deletes(o))s="delete",l=Zc(o.content.getContent());else return;e.set(i,{action:s,oldValue:l})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw xi(xy);const n=this.target,r=wi(),i=wi(),o=[];if(e={added:r,deleted:i,delta:o,keys:this.keys},this.transaction.changed.get(n).has(null)){let l=null;const a=()=>{l&&o.push(l)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((l===null||l.delete===void 0)&&(a(),l={delete:0}),l.delete+=c.length,i.add(c)):this.adds(c)?((l===null||l.insert===void 0)&&(a(),l={insert:[]}),l.insert=l.insert.concat(c.content.getContent()),r.add(c)):((l===null||l.retain===void 0)&&(a(),l={retain:0}),l.retain+=c.length);l!==null&&l.retain===void 0&&a()}this._changes=e}return e}}const dF=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;n.unshift(r)}e=e._item.parent}return n},pw=80;let ch=0;class hF{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=ch++}}const pF=t=>{t.timestamp=ch++},gw=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=ch++},gF=(t,e,n)=>{if(t.length>=pw){const r=t.reduce((i,o)=>i.timestamp<o.timestamp?i:o);return gw(r,e,n),r}else{const r=new hF(e,n);return t.push(r),r}},Ga=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((o,s)=>nl(e-o.index)<nl(e-s.index)?o:s);let r=t._start,i=0;for(n!==null&&(r=n.p,i=n.index,pF(n));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&nl(n.index-i)<r.parent.length/pw?(gw(n,r,i),n):gF(t._searchMarker,r,i)},zo=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let o=i.p;for(o.marker=!1;o&&(o.deleted||!o.countable);)o=o.left,o&&!o.deleted&&o.countable&&(i.index-=o.length);if(o===null||o.marker===!0){t.splice(r,1);continue}i.p=o,o.marker=!0}(e<i.index||n>0&&e===i.index)&&(i.index=Pi(e,i.index+n))}},Ka=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;Ii(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;fw(r._eH,n,e)};class Ee{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=my(),this._dEH=my(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw _t()}clone(){throw _t()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){yy(this._eH,e)}observeDeep(e){yy(this._dEH,e)}unobserve(e){vy(this._eH,e)}unobserveDeep(e){vy(this._dEH,e)}toJSON(){}}const mw=(t,e,n)=>{e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let o=t._start;for(;o!==null&&r>0;){if(o.countable&&!o.deleted){const s=o.content.getContent();if(s.length<=e)e-=s.length;else{for(let l=e;l<s.length&&r>0;l++)i.push(s[l]),r--;e=0}}o=o.right}return i},yw=t=>{const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}n=n.right}return e},jo=(t,e)=>{let n=0,r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let o=0;o<i.length;o++)e(i[o],n++,t)}r=r.right}},vw=(t,e)=>{const n=[];return jo(t,(r,i)=>{n.push(e(r,i,t))}),n},mF=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},bw=(t,e)=>{const n=Ga(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Jl=(t,e,n,r)=>{let i=n;const o=t.doc,s=o.clientID,l=o.store,a=n===null?e._start:n.right;let c=[];const f=()=>{c.length>0&&(i=new Xe(oe(s,He(l,s)),i,i&&i.lastId,a,a&&a.id,e,null,new Ci(c)),i.integrate(t,0),c=[])};r.forEach(u=>{if(u===null)c.push(u);else switch(u.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(u);break;default:switch(f(),u.constructor){case Uint8Array:case ArrayBuffer:i=new Xe(oe(s,He(l,s)),i,i&&i.lastId,a,a&&a.id,e,null,new Ja(new Uint8Array(u))),i.integrate(t,0);break;case ns:i=new Xe(oe(s,He(l,s)),i,i&&i.lastId,a,a&&a.id,e,null,new Ya(u)),i.integrate(t,0);break;default:if(u instanceof Ee)i=new Xe(oe(s,He(l,s)),i,i&&i.lastId,a,a&&a.id,e,null,new rr(u)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),f()},ww=()=>xi("Length exceeded!"),Sw=(t,e,n,r)=>{if(n>e._length)throw ww();if(n===0)return e._searchMarker&&zo(e._searchMarker,n,r.length),Jl(t,e,null,r);const i=n,o=Ga(e,n);let s=e._start;for(o!==null&&(s=o.p,n-=o.index,n===0&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&Xn(t,oe(s.id.client,s.id.clock+n));break}n-=s.length}return e._searchMarker&&zo(e._searchMarker,i,r.length),Jl(t,e,s,r)},yF=(t,e,n)=>{let i=(e._searchMarker||[]).reduce((o,s)=>s.index>o.index?s:o,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Jl(t,e,i,n)},xw=(t,e,n,r)=>{if(r===0)return;const i=n,o=r,s=Ga(e,n);let l=e._start;for(s!==null&&(l=s.p,n-=s.index);l!==null&&n>0;l=l.right)!l.deleted&&l.countable&&(n<l.length&&Xn(t,oe(l.id.client,l.id.clock+n)),n-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&Xn(t,oe(l.id.client,l.id.clock+r)),l.delete(t),r-=l.length),l=l.right;if(r>0)throw ww();e._searchMarker&&zo(e._searchMarker,i,-o+r)},Yl=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},fh=(t,e,n,r)=>{const i=e._map.get(n)||null,o=t.doc,s=o.clientID;let l;if(r==null)l=new Ci([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:l=new Ci([r]);break;case Uint8Array:l=new Ja(r);break;case ns:l=new Ya(r);break;default:if(r instanceof Ee)l=new rr(r);else throw new Error("Unexpected content type")}new Xe(oe(s,He(o.store,s)),i,i&&i.lastId,null,null,e,n,l).integrate(t,0)},uh=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},kw=t=>{const e={};return t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},Cw=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted},vF=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let o=r;for(;o!==null&&(!e.sv.has(o.id.client)||o.id.clock>=(e.sv.get(o.id.client)||0));)o=o.left;o!==null&&Jr(o,e)&&(n[i]=o.content.getContent()[o.length-1])}),n},Rs=t=>GB(t.entries(),e=>!e[1].deleted);class bF extends qa{}class po extends Ee{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new po;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new po}clone(){const e=new po;return e.insert(0,this.toArray().map(n=>n instanceof Ee?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,n){super._callObserver(e,n),Ka(this,e,new bF(this,e))}insert(e,n){this.doc!==null?ie(this.doc,r=>{Sw(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?ie(this.doc,n=>{yF(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?ie(this.doc,r=>{xw(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return bw(this,e)}toArray(){return yw(this)}slice(e=0,n=this.length){return mw(this,e,n)}toJSON(){return this.map(e=>e instanceof Ee?e.toJSON():e)}map(e){return vw(this,e)}forEach(e){jo(this,e)}[Symbol.iterator](){return mF(this)}_write(e){e.writeTypeRef(TF)}}class wF extends qa{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Xl extends Ee{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Xl}clone(){const e=new Xl;return this.forEach((n,r)=>{e.set(r,n instanceof Ee?n.clone():n)}),e}_callObserver(e,n){Ka(this,e,new wF(this,e,n))}toJSON(){const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof Ee?i.toJSON():i}}),e}get size(){return[...Rs(this._map)].length}keys(){return of(Rs(this._map),e=>e[0])}values(){return of(Rs(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return of(Rs(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?ie(this.doc,n=>{Yl(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?ie(this.doc,r=>{fh(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return uh(this,e)}has(e){return Cw(this,e)}clear(){this.doc!==null?ie(this.doc,e=>{this.forEach(function(n,r,i){Yl(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(MF)}}const zn=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&MB(t,e);class Pu{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&Yn(),this.right.content.constructor){case be:this.right.deleted||_i(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const ky=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case be:e.right.deleted||_i(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&Xn(t,oe(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},Ns=(t,e,n,r)=>{const i=new Map,o=r?Ga(e,n):null;if(o){const s=new Pu(o.p.left,o.p,o.index,i);return ky(t,s,n-o.index)}else{const s=new Pu(null,e._start,0,i);return ky(t,s,n)}},Ew=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===be&&zn(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,o=i.clientID;r.forEach((s,l)=>{const a=n.left,c=n.right,f=new Xe(oe(o,He(i.store,o)),a,a&&a.lastId,c,c&&c.id,e,null,new be(l,s));f.integrate(t,0),n.right=f,n.forward()})},_i=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},Ow=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===be&&zn(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},Aw=(t,e,n,r)=>{const i=t.doc,o=i.clientID,s=new Map;for(const l in r){const a=r[l],c=n.currentAttributes.get(l)??null;if(!zn(c,a)){s.set(l,c);const{left:f,right:u}=n;n.right=new Xe(oe(o,He(i.store,o)),f,f&&f.lastId,u,u&&u.id,e,null,new be(l,a)),n.right.integrate(t,0),n.forward()}}return s},af=(t,e,n,r,i)=>{n.currentAttributes.forEach((d,h)=>{i[h]===void 0&&(i[h]=null)});const o=t.doc,s=o.clientID;Ow(n,i);const l=Aw(t,e,n,i),a=r.constructor===String?new hn(r):r instanceof Ee?new rr(r):new Li(r);let{left:c,right:f,index:u}=n;e._searchMarker&&zo(e._searchMarker,n.index,a.getLength()),f=new Xe(oe(s,He(o.store,s)),c,c&&c.lastId,f,f&&f.id,e,null,a),f.integrate(t,0),n.right=f,n.index=u,n.forward(),Ew(t,e,n,l)},Cy=(t,e,n,r,i)=>{const o=t.doc,s=o.clientID;Ow(n,i);const l=Aw(t,e,n,i);e:for(;n.right!==null&&(r>0||l.size>0&&(n.right.deleted||n.right.content.constructor===be));){if(!n.right.deleted)switch(n.right.content.constructor){case be:{const{key:a,value:c}=n.right.content,f=i[a];if(f!==void 0){if(zn(f,c))l.delete(a);else{if(r===0)break e;l.set(a,c)}n.right.delete(t)}else n.currentAttributes.set(a,c);break}default:r<n.right.length&&Xn(t,oe(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let a="";for(;r>0;r--)a+=`
445
+ `;n.right=new Xe(oe(s,He(o.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new hn(a)),n.right.integrate(t,0),n.forward()}Ew(t,e,n,l)},Tw=(t,e,n,r,i)=>{let o=e;const s=Pt();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===be){const c=o.content;s.set(c.key,c)}o=o.right}let l=0,a=!1;for(;e!==o;){if(n===e&&(a=!0),!e.deleted){const c=e.content;switch(c.constructor){case be:{const{key:f,value:u}=c,d=r.get(f)??null;(s.get(f)!==c||d===u)&&(e.delete(t),l++,!a&&(i.get(f)??null)===u&&d!==u&&(d===null?i.delete(f):i.set(f,d))),!a&&!e.deleted&&_i(i,c);break}}}e=e.right}return l},SF=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===be){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},xF=t=>{let e=0;return ie(t.doc,n=>{let r=t._start,i=t._start,o=Pt();const s=Au(o);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case be:_i(s,i.content);break;default:e+=Tw(n,r,i,o,s),o=Au(s),r=i;break}i=i.right}}),e},kF=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const o=t.beforeState.get(r)||0;i!==o&&dw(t,n.store.clients.get(r),o,i,s=>{!s.deleted&&s.content.constructor===be&&s.constructor!==In&&e.add(s.parent)})}ie(n,r=>{ow(t,t.deleteSet,i=>{if(i instanceof In||!i.parent._hasFormatting||e.has(i.parent))return;const o=i.parent;i.content.constructor===be?e.add(o):SF(r,i)});for(const i of e)xF(i)})},Ey=(t,e,n)=>{const r=n,i=Au(e.currentAttributes),o=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case rr:case Li:case hn:n<e.right.length&&Xn(t,oe(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}o&&Tw(t,o,e.right,i,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&zo(s._searchMarker,e.index,-r+n),e};class CF extends qa{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];ie(e,r=>{const i=new Map,o=new Map;let s=this.target._start,l=null;const a={};let c="",f=0,u=0;const d=()=>{if(l!==null){let h=null;switch(l){case"delete":u>0&&(h={delete:u}),u=0;break;case"insert":(typeof c=="object"||c.length>0)&&(h={insert:c},i.size>0&&(h.attributes={},i.forEach((p,g)=>{p!==null&&(h.attributes[g]=p)}))),c="";break;case"retain":f>0&&(h={retain:f},OB(a)||(h.attributes=kB({},a))),f=0;break}h&&n.push(h),l=null}};for(;s!==null;){switch(s.content.constructor){case rr:case Li:this.adds(s)?this.deletes(s)||(d(),l="insert",c=s.content.getContent()[0],d()):this.deletes(s)?(l!=="delete"&&(d(),l="delete"),u+=1):s.deleted||(l!=="retain"&&(d(),l="retain"),f+=1);break;case hn:this.adds(s)?this.deletes(s)||(l!=="insert"&&(d(),l="insert"),c+=s.content.str):this.deletes(s)?(l!=="delete"&&(d(),l="delete"),u+=s.length):s.deleted||(l!=="retain"&&(d(),l="retain"),f+=s.length);break;case be:{const{key:h,value:p}=s.content;if(this.adds(s)){if(!this.deletes(s)){const g=i.get(h)??null;zn(g,p)?p!==null&&s.delete(r):(l==="retain"&&d(),zn(p,o.get(h)??null)?delete a[h]:a[h]=p)}}else if(this.deletes(s)){o.set(h,p);const g=i.get(h)??null;zn(g,p)||(l==="retain"&&d(),a[h]=g)}else if(!s.deleted){o.set(h,p);const g=a[h];g!==void 0&&(zn(g,p)?g!==null&&s.delete(r):(l==="retain"&&d(),p===null?delete a[h]:a[h]=p))}s.deleted||(l==="insert"&&d(),_i(i,s.content));break}}s=s.right}for(d();n.length>0;){const h=n[n.length-1];if(h.retain!==void 0&&h.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class Vo extends Ee{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new Vo}clone(){const e=new Vo;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new CF(this,e,n);Ka(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===hn&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?ie(this.doc,r=>{const i=new Pu(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const s=e[o];if(s.insert!==void 0){const l=!n&&typeof s.insert=="string"&&o===e.length-1&&i.right===null&&s.insert.slice(-1)===`
446
+ `?s.insert.slice(0,-1):s.insert;(typeof l!="string"||l.length>0)&&af(r,this,i,l,s.attributes||{})}else s.retain!==void 0?Cy(r,this,i,s.retain,s.attributes||{}):s.delete!==void 0&&Ey(r,i,s.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){const i=[],o=new Map,s=this.doc;let l="",a=this._start;function c(){if(l.length>0){const u={};let d=!1;o.forEach((p,g)=>{d=!0,u[g]=p});const h={insert:l};d&&(h.attributes=u),i.push(h),l=""}}const f=()=>{for(;a!==null;){if(Jr(a,e)||n!==void 0&&Jr(a,n))switch(a.content.constructor){case hn:{const u=o.get("ychange");e!==void 0&&!Jr(a,e)?(u===void 0||u.user!==a.id.client||u.type!=="removed")&&(c(),o.set("ychange",r?r("removed",a.id):{type:"removed"})):n!==void 0&&!Jr(a,n)?(u===void 0||u.user!==a.id.client||u.type!=="added")&&(c(),o.set("ychange",r?r("added",a.id):{type:"added"})):u!==void 0&&(c(),o.delete("ychange")),l+=a.content.str;break}case rr:case Li:{c();const u={insert:a.content.getContent()[0]};if(o.size>0){const d={};u.attributes=d,o.forEach((h,p)=>{d[p]=h})}i.push(u);break}case be:Jr(a,e)&&(c(),_i(o,a.content));break}a=a.right}c()};return e||n?ie(s,u=>{e&&Du(u,e),n&&Du(u,n),f()},"cleanup"):f(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?ie(i,o=>{const s=Ns(o,this,e,!r);r||(r={},s.currentAttributes.forEach((l,a)=>{r[a]=l})),af(o,this,s,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?ie(i,o=>{const s=Ns(o,this,e,!r);af(o,this,s,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?ie(r,i=>{Ey(i,Ns(i,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const i=this.doc;i!==null?ie(i,o=>{const s=Ns(o,this,e,!1);s.right!==null&&Cy(o,this,s,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?ie(this.doc,n=>{Yl(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?ie(this.doc,r=>{fh(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return uh(this,e)}getAttributes(){return kw(this)}_write(e){e.writeTypeRef(RF)}}class cf{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===Ho||n.constructor===ki)&&n._start!==null)e=n._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class ki extends Ee{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new ki}clone(){const e=new ki;return e.insert(0,this.toArray().map(n=>n instanceof Ee?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new cf(this,e)}querySelector(e){e=e.toUpperCase();const r=new cf(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Si(new cf(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Ka(this,e,new EF(this,n,e))}toString(){return vw(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),jo(this,o=>{i.insertBefore(o.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?ie(this.doc,r=>{Sw(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)ie(this.doc,r=>{const i=e&&e instanceof Ee?e._item:e;Jl(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(o=>o===e)+1;if(i===0&&e!==null)throw xi("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?ie(this.doc,r=>{xw(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return yw(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return bw(this,e)}slice(e=0,n=this.length){return mw(this,e,n)}forEach(e){jo(this,e)}_write(e){e.writeTypeRef(DF)}}class Ho extends ki{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new Ho(this.nodeName)}clone(){const e=new Ho(this.nodeName),n=this.getAttributes();return EB(n,(r,i)=>{typeof r=="string"&&e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof Ee?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const l in e)r.push(l);r.sort();const i=r.length;for(let l=0;l<i;l++){const a=r[l];n.push(a+'="'+e[a]+'"')}const o=this.nodeName.toLocaleLowerCase(),s=n.length>0?" "+n.join(" "):"";return`<${o}${s}>${super.toString()}</${o}>`}removeAttribute(e){this.doc!==null?ie(this.doc,n=>{Yl(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?ie(this.doc,r=>{fh(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return uh(this,e)}hasAttribute(e){return Cw(this,e)}getAttributes(e){return e?vF(this,e):kw(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),o=this.getAttributes();for(const s in o){const l=o[s];typeof l=="string"&&i.setAttribute(s,l)}return jo(this,s=>{i.appendChild(s.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(NF),e.writeKey(this.nodeName)}}class EF extends qa{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class Wo extends Vo{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Wo}clone(){const e=new Wo;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const n=[];for(const i in e.attributes){const o=[];for(const s in e.attributes[i])o.push({key:s,value:e.attributes[i][s]});o.sort((s,l)=>s.key<l.key?-1:1),n.push({nodeName:i,attrs:o})}n.sort((i,o)=>i.nodeName<o.nodeName?-1:1);let r="";for(let i=0;i<n.length;i++){const o=n[i];r+=`<${o.nodeName}`;for(let s=0;s<o.attrs.length;s++){const l=o.attrs[s];r+=` ${l.key}="${l.value}"`}r+=">"}r+=e.insert;for(let i=n.length-1;i>=0;i--)r+=`</${n[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(IF)}}class Mw{constructor(e,n){this.id=e,this.length=n}get deleted(){throw _t()}mergeWith(e){return!1}write(e,n,r){throw _t()}integrate(e,n){throw _t()}}const OF=0;class In extends Mw{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),uw(e.doc.store,this)}write(e,n){e.writeInfo(OF),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Ja{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Ja(this.content)}splice(e){throw _t()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}class Ql{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Ql(this.len)}splice(e){const n=new Ql(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){aw(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const AF=(t,e)=>new ns({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Ya{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ya(AF(this.doc.guid,this.opts))}splice(e){throw _t()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class Li{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Li(this.embed)}splice(e){throw _t()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}class be{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new be(this.key,this.value)}splice(e){throw _t()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Ci{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Ci(this.arr)}splice(e){const n=new Ci(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const o=this.arr[i];e.writeAny(o)}}getRef(){return 8}}class hn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new hn(this.str)}splice(e){const n=new hn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const TF=0,MF=1,RF=2,NF=3,DF=4,IF=6;class rr{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new rr(this.type._copy())}splice(e){throw _t()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const Rw=(t,e,n)=>{const{client:r,clock:i}=e.id,o=new Xe(oe(r,i+n),e,oe(r,i+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&o.markDeleted(),e.keep&&(o.keep=!0),e.redone!==null&&(o.redone=oe(e.redone.client,e.redone.clock+n)),e.right=o,o.right!==null&&(o.right.left=o),t._mergeStructs.push(o),o.parentSub!==null&&o.right===null&&o.parent._map.set(o.parentSub,o),e.length=n,o};let Xe=class _u extends Mw{constructor(e,n,r,i,o,s,l,a){super(e,a.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=o,this.parent=s,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?sy:0}set marker(e){(this.info&tf)>0!==e&&(this.info^=tf)}get marker(){return(this.info&tf)>0}get keep(){return(this.info&oy)>0}set keep(e){this.keep!==e&&(this.info^=oy)}get countable(){return(this.info&sy)>0}get deleted(){return(this.info&ef)>0}set deleted(e){this.deleted!==e&&(this.info^=ef)}markDeleted(){this.info|=ef}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=He(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=He(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===il&&this.id.client!==this.parent.client&&this.parent.clock>=He(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=by(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Xn(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===In||this.right&&this.right.constructor===In)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===_u&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===_u&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===il){const r=lf(n,this.parent);r.constructor===In?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=by(e,e.doc.store,oe(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const o=new Set,s=new Set;for(;i!==null&&i!==this.right;){if(s.add(i),o.add(i),Ts(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,o.clear();else if(Ts(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&s.has(lf(e.doc.store,i.origin)))o.has(lf(e.doc.store,i.origin))||(r=i,o.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),uw(e.doc.store,this),this.content.integrate(e,this),Sy(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new In(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:oe(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Ts(e.origin,this.lastId)&&this.right===e&&Ts(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),aw(e.deleteSet,this.id.client,this.id.clock,this.length),Sy(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw Yn();this.content.gc(e),n?aF(e,this,new In(this.id,this.length)):this.content=new Ql(this.length)}write(e,n){const r=n>0?oe(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,o=this.parentSub,s=this.content.getRef()&X3|(r===null?0:Gl)|(i===null?0:Yb)|(o===null?0:Y3);if(e.writeInfo(s),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const c=Fo(l);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===il?(e.writeParentInfo(!1),e.writeLeftID(l)):Yn();o!==null&&e.writeString(o)}this.content.write(e,n)}};const Nw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},Dw="__ $YJS$ __";Nw[Dw]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Nw[Dw]=!0;const PF=new pn("y-sync");new pn("y-undo");new pn("yjs-cursor");const _F=(t,e,n)=>{if(t===0)return sf(e,0,-1);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof Wo){if(r._length>=t)return sf(r,t,-1);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<i)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&i>1)return new Kl(r._item===null?null:r._item.id,r._item===null?Fo(r):null,null);if(t-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new Kl(r._item===null?null:r._item.id,r._item===null?Fo(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw Yn();if(t===0&&r.constructor!==Wo&&r!==e)return LF(r._item.parent,r._item)}return sf(e,e._length,-1)},LF=(t,e)=>{let n=null,r=null;return t._item===null?r=Fo(t):n=oe(t._item.id.client,t._item.id.clock),new Kl(n,r,e.id)},$F="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",BF="ελ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",Ei=(t,e)=>{for(const n in e)t[n]=e[n];return t},Lu="numeric",$u="ascii",Bu="alpha",sl="asciinumeric",Ds="alphanumeric",Fu="domain",Iw="emoji",FF="scheme",zF="slashscheme",Oy="whitespace";function jF(t,e){return t in e||(e[t]=[]),e[t]}function ur(t,e,n){e[Lu]&&(e[sl]=!0,e[Ds]=!0),e[$u]&&(e[sl]=!0,e[Bu]=!0),e[sl]&&(e[Ds]=!0),e[Bu]&&(e[Ds]=!0),e[Ds]&&(e[Fu]=!0),e[Iw]&&(e[Fu]=!0);for(const r in e){const i=jF(r,n);i.indexOf(t)<0&&i.push(t)}}function VF(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Ve(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Ve.groups={};Ve.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(t))return o}return e.jd},has(t,e){return e===void 0&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||Ve.groups;let i;return e&&e.j?i=e:(i=new Ve(e),n&&r&&ur(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||Ve.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,l=i.go(t);if(l?(s=new Ve,Ei(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new Ve,o){if(r)if(s.t&&typeof s.t=="string"){const a=Ei(VF(s.t,r),n);ur(o,a,r)}else n&&ur(o,n,r);s.t=o}return i.j[t]=s,s}};const K=(t,e,n,r,i)=>t.ta(e,n,r,i),nt=(t,e,n,r,i)=>t.tr(e,n,r,i),Ay=(t,e,n,r,i)=>t.ts(e,n,r,i),N=(t,e,n,r,i)=>t.tt(e,n,r,i),Zt="WORD",zu="UWORD",Uo="LOCALHOST",ju="TLD",Vu="UTLD",ll="SCHEME",Yr="SLASH_SCHEME",dh="NUM",Pw="WS",hh="NL",go="OPENBRACE",mo="CLOSEBRACE",Zl="OPENBRACKET",ea="CLOSEBRACKET",ta="OPENPAREN",na="CLOSEPAREN",ra="OPENANGLEBRACKET",ia="CLOSEANGLEBRACKET",oa="FULLWIDTHLEFTPAREN",sa="FULLWIDTHRIGHTPAREN",la="LEFTCORNERBRACKET",aa="RIGHTCORNERBRACKET",ca="LEFTWHITECORNERBRACKET",fa="RIGHTWHITECORNERBRACKET",ua="FULLWIDTHLESSTHAN",da="FULLWIDTHGREATERTHAN",ha="AMPERSAND",pa="APOSTROPHE",ga="ASTERISK",Rn="AT",ma="BACKSLASH",ya="BACKTICK",va="CARET",Pn="COLON",ph="COMMA",ba="DOLLAR",kt="DOT",wa="EQUALS",gh="EXCLAMATION",Ct="HYPHEN",Sa="PERCENT",xa="PIPE",ka="PLUS",Ca="POUND",Ea="QUERY",mh="QUOTE",yh="SEMI",Et="SLASH",yo="TILDE",Oa="UNDERSCORE",_w="EMOJI",Aa="SYM";var Lw=Object.freeze({__proto__:null,WORD:Zt,UWORD:zu,LOCALHOST:Uo,TLD:ju,UTLD:Vu,SCHEME:ll,SLASH_SCHEME:Yr,NUM:dh,WS:Pw,NL:hh,OPENBRACE:go,CLOSEBRACE:mo,OPENBRACKET:Zl,CLOSEBRACKET:ea,OPENPAREN:ta,CLOSEPAREN:na,OPENANGLEBRACKET:ra,CLOSEANGLEBRACKET:ia,FULLWIDTHLEFTPAREN:oa,FULLWIDTHRIGHTPAREN:sa,LEFTCORNERBRACKET:la,RIGHTCORNERBRACKET:aa,LEFTWHITECORNERBRACKET:ca,RIGHTWHITECORNERBRACKET:fa,FULLWIDTHLESSTHAN:ua,FULLWIDTHGREATERTHAN:da,AMPERSAND:ha,APOSTROPHE:pa,ASTERISK:ga,AT:Rn,BACKSLASH:ma,BACKTICK:ya,CARET:va,COLON:Pn,COMMA:ph,DOLLAR:ba,DOT:kt,EQUALS:wa,EXCLAMATION:gh,HYPHEN:Ct,PERCENT:Sa,PIPE:xa,PLUS:ka,POUND:Ca,QUERY:Ea,QUOTE:mh,SEMI:yh,SLASH:Et,TILDE:yo,UNDERSCORE:Oa,EMOJI:_w,SYM:Aa});const Wr=/[a-z]/,ff=new RegExp("\\p{L}","u"),uf=new RegExp("\\p{Emoji}","u"),df=/\d/,Ty=/\s/,My=`
447
+ `,HF="️",WF="‍";let Is=null,Ps=null;function UF(t){t===void 0&&(t=[]);const e={};Ve.groups=e;const n=new Ve;Is==null&&(Is=Ry($F)),Ps==null&&(Ps=Ry(BF)),N(n,"'",pa),N(n,"{",go),N(n,"}",mo),N(n,"[",Zl),N(n,"]",ea),N(n,"(",ta),N(n,")",na),N(n,"<",ra),N(n,">",ia),N(n,"(",oa),N(n,")",sa),N(n,"「",la),N(n,"」",aa),N(n,"『",ca),N(n,"』",fa),N(n,"<",ua),N(n,">",da),N(n,"&",ha),N(n,"*",ga),N(n,"@",Rn),N(n,"`",ya),N(n,"^",va),N(n,":",Pn),N(n,",",ph),N(n,"$",ba),N(n,".",kt),N(n,"=",wa),N(n,"!",gh),N(n,"-",Ct),N(n,"%",Sa),N(n,"|",xa),N(n,"+",ka),N(n,"#",Ca),N(n,"?",Ea),N(n,'"',mh),N(n,"/",Et),N(n,";",yh),N(n,"~",yo),N(n,"_",Oa),N(n,"\\",ma);const r=nt(n,df,dh,{[Lu]:!0});nt(r,df,r);const i=nt(n,Wr,Zt,{[$u]:!0});nt(i,Wr,i);const o=nt(n,ff,zu,{[Bu]:!0});nt(o,Wr),nt(o,ff,o);const s=nt(n,Ty,Pw,{[Oy]:!0});N(n,My,hh,{[Oy]:!0}),N(s,My),nt(s,Ty,s);const l=nt(n,uf,_w,{[Iw]:!0});nt(l,uf,l),N(l,HF,l);const a=N(l,WF);nt(a,uf,l);const c=[[Wr,i]],f=[[Wr,null],[ff,o]];for(let u=0;u<Is.length;u++)Cn(n,Is[u],ju,Zt,c);for(let u=0;u<Ps.length;u++)Cn(n,Ps[u],Vu,zu,f);ur(ju,{tld:!0,ascii:!0},e),ur(Vu,{utld:!0,alpha:!0},e),Cn(n,"file",ll,Zt,c),Cn(n,"mailto",ll,Zt,c),Cn(n,"http",Yr,Zt,c),Cn(n,"https",Yr,Zt,c),Cn(n,"ftp",Yr,Zt,c),Cn(n,"ftps",Yr,Zt,c),ur(ll,{scheme:!0,ascii:!0},e),ur(Yr,{slashscheme:!0,ascii:!0},e),t=t.sort((u,d)=>u[0]>d[0]?1:-1);for(let u=0;u<t.length;u++){const d=t[u][0],p=t[u][1]?{[FF]:!0}:{[zF]:!0};d.indexOf("-")>=0?p[Fu]=!0:Wr.test(d)?df.test(d)?p[sl]=!0:p[$u]=!0:p[Lu]=!0,Ay(n,d,d,p)}return Ay(n,"localhost",Uo,{ascii:!0}),n.jd=new Ve(Aa),{start:n,tokens:Ei({groups:e},Lw)}}function qF(t,e){const n=GF(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let l=t,a=null,c=0,f=null,u=-1,d=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(u=0,d=0,f=l):u>=0&&(u+=n[s].length,d++),c+=n[s].length,o+=n[s].length,s++;o-=u,s-=d,c-=u,i.push({t:f.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function GF(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Cn(t,e,n,r,i){let o;const s=e.length;for(let l=0;l<s-1;l++){const a=e[l];t.j[a]?o=t.j[a]:(o=new Ve(r),o.jr=i.slice(),t.j[a]=o),t=o}return o=new Ve(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function Ry(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let o=0;for(;i.indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}const qo={defaultProtocol:"http",events:null,format:Ny,formatHref:Ny,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function vh(t,e){e===void 0&&(e=null);let n=Ei({},qo);t&&(n=Ei(n,t instanceof vh?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}vh.prototype={o:qo,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:qo[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Ny(t){return t}function $w(t,e){this.t="token",this.v=t,this.tk=e}$w.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=qo.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),f=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),f&&Ei(s,f),{tagName:i,attributes:s,content:o,eventListeners:u}}};function Xa(t,e){class n extends $w{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Dy=Xa("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Iy=Xa("text"),KF=Xa("nl"),_s=Xa("url",{isLink:!0,toHref(t){return t===void 0&&(t=qo.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Uo&&t[1].t===Pn}}),rt=t=>new Ve(t);function JF(t){let{groups:e}=t;const n=e.domain.concat([ha,ga,Rn,ma,ya,va,ba,wa,Ct,dh,Sa,xa,ka,Ca,Et,Aa,yo,Oa]),r=[pa,Pn,ph,kt,gh,Ea,mh,yh,ra,ia,go,mo,ea,Zl,ta,na,oa,sa,la,aa,ca,fa,ua,da],i=[ha,pa,ga,ma,ya,va,ba,wa,Ct,go,mo,Sa,xa,ka,Ca,Ea,Et,Aa,yo,Oa],o=rt(),s=N(o,yo);K(s,i,s),K(s,e.domain,s);const l=rt(),a=rt(),c=rt();K(o,e.domain,l),K(o,e.scheme,a),K(o,e.slashscheme,c),K(l,i,s),K(l,e.domain,l);const f=N(l,Rn);N(s,Rn,f),N(a,Rn,f),N(c,Rn,f);const u=N(s,kt);K(u,i,s),K(u,e.domain,s);const d=rt();K(f,e.domain,d),K(d,e.domain,d);const h=N(d,kt);K(h,e.domain,d);const p=rt(Dy);K(h,e.tld,p),K(h,e.utld,p),N(f,Uo,p);const g=N(d,Ct);K(g,e.domain,d),K(p,e.domain,d),N(p,kt,h),N(p,Ct,g);const m=N(p,Pn);K(m,e.numeric,Dy);const v=N(l,Ct),w=N(l,kt);K(v,e.domain,l),K(w,i,s),K(w,e.domain,l);const S=rt(_s);K(w,e.tld,S),K(w,e.utld,S),K(S,e.domain,l),K(S,i,s),N(S,kt,w),N(S,Ct,v),N(S,Rn,f);const y=N(S,Pn),x=rt(_s);K(y,e.numeric,x);const b=rt(_s),O=rt();K(b,n,b),K(b,r,O),K(O,n,b),K(O,r,O),N(S,Et,b),N(x,Et,b);const R=N(a,Pn),k=N(c,Pn),A=N(k,Et),T=N(A,Et);K(a,e.domain,l),N(a,kt,w),N(a,Ct,v),K(c,e.domain,l),N(c,kt,w),N(c,Ct,v),K(R,e.domain,b),N(R,Et,b),K(T,e.domain,b),K(T,n,b),N(T,Et,b);const M=[[go,mo],[Zl,ea],[ta,na],[ra,ia],[oa,sa],[la,aa],[ca,fa],[ua,da]];for(let _=0;_<M.length;_++){const[L,W]=M[_],B=N(b,L);N(O,L,B),N(B,W,b);const I=rt(_s);K(B,n,I);const U=rt();K(B,r),K(I,n,I),K(I,r,U),K(U,n,I),K(U,r,U),N(I,W,b),N(U,W,b)}return N(o,Uo,S),N(o,hh,KF),{start:o,tokens:Lw}}function YF(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=t,a=null,c=null,f=0,u=null,d=-1;for(;i<r&&!(a=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=a||l.go(n[i].t));)a=null,l=c,l.accepts()?(d=0,u=l):d>=0&&d++,i++,f++;if(d<0)i-=f,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(hf(Iy,e,s)),s=[]),i-=d,f-=d;const h=u.t,p=n.slice(i-f,i);o.push(hf(h,e,p))}}return s.length>0&&o.push(hf(Iy,e,s)),o}function hf(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const XF=typeof console<"u"&&console&&console.warn||(()=>{}),QF="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",le={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ZF(){Ve.groups={},le.scanner=null,le.parser=null,le.tokenQueue=[],le.pluginQueue=[],le.customSchemes=[],le.initialized=!1}function ez(t,e){if(e===void 0&&(e=!1),le.initialized&&XF(`linkifyjs: already initialized - will not register custom scheme "${t}" ${QF}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
448
+ 1. Must only contain digits, lowercase ASCII letters or "-"
449
+ 2. Cannot start or end with "-"
450
+ 3. "-" cannot repeat`);le.customSchemes.push([t,e])}function tz(){le.scanner=UF(le.customSchemes);for(let t=0;t<le.tokenQueue.length;t++)le.tokenQueue[t][1]({scanner:le.scanner});le.parser=JF(le.scanner.tokens);for(let t=0;t<le.pluginQueue.length;t++)le.pluginQueue[t][1]({scanner:le.scanner,parser:le.parser});le.initialized=!0}function Bw(t){return le.initialized||tz(),YF(le.parser.start,t,qF(le.scanner.start,t))}function nz(t,e,n){if(e===void 0&&(e=null),n===void 0&&(n=null),e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new vh(n),i=Bw(t),o=[];for(let s=0;s<i.length;s++){const l=i[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&o.push(l.toFormattedObject(r))}return o}var Ta=200,ve=function(){};ve.prototype.append=function(e){return e.length?(e=ve.from(e),!this.length&&e||e.length<Ta&&this.leafAppend(e)||this.length<Ta&&e.leafPrepend(this)||this.appendInner(e)):this};ve.prototype.prepend=function(e){return e.length?ve.from(e).append(this):this};ve.prototype.appendInner=function(e){return new rz(this,e)};ve.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?ve.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};ve.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ve.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};ve.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};ve.from=function(e){return e instanceof ve?e:e&&e.length?new Fw(e):ve.empty};var Fw=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a<s;a++)if(i(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var a=o-1;a>=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ta)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ta)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(ve);ve.empty=new Fw([]);var rz=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(ve);const iz=500;class mt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,c=[],f=[];return this.items.forEach((u,d)=>{if(!u.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,f.push(u);return}if(i){f.push(new Ot(u.map));let h=u.step.map(i.slice(o)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new Ot(p,void 0,void 0,c.length+f.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(u.step);if(u.selection)return l=i?u.selection.map(i.slice(o)):u.selection,a=new mt(this.items.slice(0,r).append(f.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let u=e.steps[f].invert(e.docs[f]),d=new Ot(e.mapping.maps[f],u,n),h;(h=a&&a.merge(d))&&(d=h,f?o.pop():l=l.slice(0,l.length-1)),o.push(d),n&&(s++,n=void 0),i||(a=d)}let c=s-r.depth;return c>sz&&(l=oz(l,c),s-=c),new mt(l.append(o),s)}remapping(e,n){let r=new Zr;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new mt(this.items.append(e.map(n=>new Ot(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(d=>{d.selection&&l--},i);let a=n;this.items.forEach(d=>{let h=o.getMirror(--a);if(h==null)return;s=Math.min(s,h);let p=o.maps[h];if(d.step){let g=e.steps[h].invert(e.docs[h]),m=d.selection&&d.selection.map(o.slice(a+1,h));m&&l++,r.push(new Ot(p,g,m))}else r.push(new Ot(p))},i);let c=[];for(let d=n;d<s;d++)c.push(new Ot(o.maps[d]));let f=this.items.slice(0,i).append(c).append(r),u=new mt(f,l);return u.emptyItemCount()>iz&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let u=new Ot(c.invert(),a,f),d,h=i.length-1;(d=i.length&&i[h].merge(u))?i[h]=d:i.push(u)}}else s.map&&r--},this.items.length,0),new mt(ve.from(i.reverse()),o)}}mt.empty=new mt(ve.empty,0);function oz(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Ot{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Ot(n.getMap().invert(),n,this.selection)}}}class Nn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const sz=20;function lz(t,e,n,r){let i=n.getMeta(br),o;if(i)return i.historyState;n.getMeta(fz)&&(t=new Nn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(br))return s.getMeta(br).redo?new Nn(t.done.addTransform(n,void 0,r,al(e)),t.undone,Py(n.mapping.maps),t.prevTime,t.prevComposition):new Nn(t.done,t.undone.addTransform(n,void 0,r,al(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!az(n,t.prevRanges)),c=s?pf(t.prevRanges,n.mapping):Py(n.mapping.maps);return new Nn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,al(e)),mt.empty,c,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Nn(t.done.rebased(n,o),t.undone.rebased(n,o),pf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Nn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),pf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function az(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Py(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function pf(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function cz(t,e,n){let r=al(e),i=br.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),a=new Nn(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(br,{redo:n,historyState:a})}let gf=!1,_y=null;function al(t){let e=t.plugins;if(_y!=e){gf=!1,_y=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){gf=!0;break}}return gf}const br=new pn("history"),fz=new pn("closeHistory");function uz(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Mr({key:br,state:{init(){return new Nn(mt.empty,mt.empty,null,0,-1)},apply(e,n,r){return lz(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?jw:r=="historyRedo"?Vw:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function zw(t,e){return(n,r)=>{let i=br.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=cz(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const jw=zw(!1,!0),Vw=zw(!0,!0);function dz(t={}){return new Mr({view(e){return new hz(e,t)}})}class hz{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let f=c.getBoundingClientRect(),u=l?f.bottom:f.top;l&&a&&(u=(u+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:u-this.width/2,bottom:u+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=C0(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}class ce extends q{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ce.valid(r)?new ce(r):q.near(r)}content(){return D.empty}eq(e){return e instanceof ce&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ce(e.resolve(n.pos))}getBookmark(){return new bh(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!pz(e)||!gz(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&ce.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)<l.childCount:e.index(s)>0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let a=e.doc.resolve(i);if(ce.valid(a))return a}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!j.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(ce.valid(l))return l}return null}}}ce.prototype.visible=!1;ce.findFrom=ce.findGapCursorFrom;q.jsonID("gapcursor",ce);class bh{constructor(e){this.pos=e}map(e){return new bh(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ce.valid(n)?new ce(n):q.near(n)}}function pz(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function gz(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function mz(){return new Mr({props:{decorations:wz,createSelectionBetween(t,e,n){return e.pos==n.pos&&ce.valid(n)?new ce(n):null},handleClick:vz,handleKeyDown:yz,handleDOMEvents:{beforeinput:bz}}})}const yz=ud({ArrowLeft:Ls("horiz",-1),ArrowRight:Ls("horiz",1),ArrowUp:Ls("vert",-1),ArrowDown:Ls("vert",1)});function Ls(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof J){if(!o.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=ce.findGapCursorFrom(l,e,a);return c?(i&&i(r.tr.setSelection(new ce(c))),!0):!1}}function vz(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ce.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&j.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ce(r))),!0)}function bz(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ce))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=E.empty;for(let s=r.length-1;s>=0;s--)i=E.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new D(i,0,0));return o.setSelection(J.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function wz(t){if(!(t.selection instanceof ce))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ae.create(t.doc,[Pe.widget(t.selection.head,e,{key:"gapcursor"})])}var Hu,Wu;if(typeof WeakMap<"u"){let t=new WeakMap;Hu=e=>t.get(e),Wu=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Hu=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Wu=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var fe=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let o=r+1,s=i+1;for(let l=1;o<this.width&&this.map[e+l]==n;l++)o++;for(let l=1;s<this.height&&this.map[e+this.width*l]==n;l++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:l,top:a,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(i,a),right:Math.max(r,l),bottom:Math.max(o,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==t){let s=e+t*this.width;const l=(t+1)*this.width;for(;s<l&&this.map[s]<i;)s++;return s==l?o-1:this.map[s]}i=o}}static get(t){return Hu(t)||Wu(t,Sz(t))}};function Sz(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=xz(t),n=t.childCount,r=[];let i=0,o=null;const s=[];for(let c=0,f=e*n;c<f;c++)r[c]=0;for(let c=0,f=0;c<n;c++){const u=t.child(c);f++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==u.childCount)break;const g=u.child(p),{colspan:m,rowspan:v,colwidth:w}=g.attrs;for(let S=0;S<v;S++){if(S+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:v-S});break}const y=i+S*e;for(let x=0;x<m;x++){r[y+x]==0?r[y+x]=f:(o||(o=[])).push({type:"collision",row:c,pos:f,n:m-x});const b=w&&w[x];if(b){const O=(y+x)%e*2,R=s[O];R==null||R!=b&&s[O+1]==1?(s[O]=b,s[O+1]=1):R==b&&s[O+1]++}}}i+=m,f+=g.nodeSize}const d=(c+1)*e;let h=0;for(;i<d;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:c,n:h}),f++}const l=new fe(e,n,r,o);let a=!1;for(let c=0;!a&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(a=!0);return a&&kz(l,s,t),l}function xz(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let o=0;if(n)for(let s=0;s<r;s++){const l=t.child(s);for(let a=0;a<l.childCount;a++){const c=l.child(a);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const l=i.child(s);o+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function kz(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const o=t.map[i];if(r[o])continue;r[o]=!0;const s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let l=null;const a=s.attrs;for(let c=0;c<a.colspan;c++){const f=(i+c)%t.width,u=e[f*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((l||(l=Cz(a)))[c]=u)}l&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:l})}}function Cz(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Re(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var _n=new pn("selectingCells");function $i(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Ez(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function St(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Qa(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=$i(e.$head)||Oz(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Oz(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Uu(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Az(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function wh(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Hw(t,e,n){const r=t.node(-1),i=fe.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function Ar(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Ww(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function Tz(t,e,n){const r=Re(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var se=class en extends q{constructor(e,n=e){const r=e.node(-1),i=fe.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),l=e.node(0),a=i.cellsInRect(s).filter(f=>f!=n.pos-o);a.unshift(n.pos-o);const c=a.map(f=>{const u=r.nodeAt(f);if(!u)throw RangeError(`No cell with offset ${f} found`);const d=o+f+1;return new td(l.resolve(d),l.resolve(d+u.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Uu(r)&&Uu(i)&&wh(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?en.rowSelection(r,i):o&&this.isColSelection()?en.colSelection(r,i):new en(r,i)}return J.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=fe.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let f=a*n.width+i.left,u=i.left;u<i.right;u++,f++){const d=n.map[f];if(o[d])continue;o[d]=!0;const h=n.findCell(d);let p=e.nodeAt(d);if(!p)throw RangeError(`No cell with offset ${d} found`);const g=i.left-h.left,m=h.right-i.right;if(g>0||m>0){let v=p.attrs;if(g>0&&(v=Ar(v,0,g)),m>0&&(v=Ar(v,v.colspan-m,m)),h.left<i.left){if(p=p.type.createAndFill(v),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(v)}`)}else p=p.type.create(v,p.content)}if(h.top<i.top||h.bottom>i.bottom){const v={...p.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?p=p.type.createAndFill(v):p=p.type.create(v,p.content)}c.push(p)}s.push(e.child(a).copy(E.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:s;return new D(E.from(l),1,1)}replace(e,n=D.empty){const r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:l,$to:a}=i[s],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(a.pos),s?D.empty:n)}const o=q.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new D(E.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=fe.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(n.nodeAt(o[s]),i+o[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=fe.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),a=e.node(0);return s.top<=l.top?(s.top>0&&(e=a.resolve(o+i.map[s.left])),l.bottom<i.height&&(n=a.resolve(o+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(o+i.map[l.left])),s.bottom<i.height&&(e=a.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new en(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=fe.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof en&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=fe.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),a=e.node(0);return s.left<=l.left?(s.left>0&&(e=a.resolve(o+i.map[s.top*i.width])),l.right<i.width&&(n=a.resolve(o+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(o+i.map[l.top*i.width])),s.right<i.width&&(e=a.resolve(o+i.map[i.width*(s.top+1)-1]))),new en(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new en(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new en(e.resolve(n),e.resolve(r))}getBookmark(){return new Mz(this.$anchorCell.pos,this.$headCell.pos)}};se.prototype.visible=!1;q.jsonID("cell",se);var Mz=class Uw{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Uw(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&wh(n,r)?new se(n,r):q.near(r,1)}};function Rz(t){if(!(t.selection instanceof se))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Pe.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ae.create(t.doc,e)}function Nz({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function Dz({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function Iz(t,e,n){const r=(e||t).selection,i=(e||t).doc;let o,s;if(r instanceof j&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=se.create(i,r.from);else if(s=="row"){const l=i.resolve(r.from+1);o=se.rowSelection(l,l)}else if(!n){const l=fe.get(r.node),a=r.from+1,c=a+l.map[l.width*l.height-1];o=se.create(i,a+1,c)}}else r instanceof J&&Nz(r)?o=J.create(i,r.from):r instanceof J&&Dz(r)&&(o=J.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var Pz=new pn("fix-tables");function qw(t,e,n,r){const i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s<o;s++){const a=e.child(s);for(let c=l,f=Math.min(i,s+3);c<f;c++)if(t.child(c)==a){l=c+1,n+=a.nodeSize;continue e}r(a,n),l<i&&t.child(l).sameMarkup(a)?qw(t.child(l),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Gw(t,e){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=_z(t,i,o,n))};return e?e.doc!=t.doc&&qw(e.doc,t.doc,0,r):t.doc.descendants(r),n}function _z(t,e,n,r){const i=fe.get(e);if(!i.problems)return r;r||(r=t.tr);const o=[];for(let a=0;a<i.height;a++)o.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const f=e.nodeAt(c.pos);if(!f)continue;const u=f.attrs;for(let d=0;d<u.rowspan;d++)o[c.row+d]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Ar(u,u.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,colwidth:c.colwidth})}}let s,l;for(let a=0;a<o.length;a++)o[a]&&(s==null&&(s=a),l=a);for(let a=0,c=n+1;a<i.height;a++){const f=e.child(a),u=c+f.nodeSize,d=o[a];if(d>0){let h="cell";f.firstChild&&(h=f.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<d;m++){const v=Re(t.schema)[h].createAndFill();v&&p.push(v)}const g=(a==0||s==a-1)&&l==a?c+1:u-1;r.insert(r.mapping.map(g),p)}c=u}return r.setMeta(Pz,{fixTables:!0})}function Lz(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let a=0;a<e.childCount;a++){let c=e.child(a).content;const f=a?0:Math.max(0,n-1),u=a<e.childCount-1?0:Math.max(0,r-1);(f||u)&&(c=qu(Re(s).row,new D(c,f,u)).content),l.push(c)}else if(o=="cell"||o=="header_cell")l.push(n||r?qu(Re(s).row,new D(e,n,r)).content:e);else return null;return $z(s,l)}function $z(t,e){const n=[];for(let i=0;i<e.length;i++){const o=e[i];for(let s=o.childCount-1;s>=0;s--){const{rowspan:l,colspan:a}=o.child(s).attrs;for(let c=i;c<i+l;c++)n[c]=(n[c]||0)+a}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(E.empty),n[i]<r){const o=Re(t).cell.createAndFill(),s=[];for(let l=n[i];l<r;l++)s.push(o);e[i]=e[i].append(E.from(s))}return{height:e.length,width:r,rows:e}}function qu(t,e){const n=t.createAndFill();return new ed(n).replace(0,n.content.size,e).doc}function Bz({width:t,height:e,rows:n},r,i){if(t!=r){const o=[],s=[];for(let l=0;l<n.length;l++){const a=n[l],c=[];for(let f=o[l]||0,u=0;f<r;u++){let d=a.child(u%a.childCount);f+d.attrs.colspan>r&&(d=d.type.createChecked(Ar(d.attrs,d.attrs.colspan,f+d.attrs.colspan-r),d.content)),c.push(d),f+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)o[l+h]=(o[l+h]||0)+d.attrs.colspan}s.push(E.from(c))}n=s,t=r}if(e!=i){const o=[];for(let s=0,l=0;s<i;s++,l++){const a=[],c=n[l%e];for(let f=0;f<c.childCount;f++){let u=c.child(f);s+u.attrs.rowspan>i&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,i-u.attrs.rowspan)},u.content)),a.push(u)}o.push(E.from(a))}n=o,e=i}return{width:t,height:e,rows:n}}function Fz(t,e,n,r,i,o,s){const l=t.doc.type.schema,a=Re(l);let c,f;if(i>e.width)for(let u=0,d=0;u<e.height;u++){const h=n.child(u);d+=h.nodeSize;const p=[];let g;h.lastChild==null||h.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=f||(f=a.header_cell.createAndFill());for(let m=e.width;m<i;m++)p.push(g);t.insert(t.mapping.slice(s).map(d-1+r),p)}if(o>e.height){const u=[];for(let p=0,g=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const m=p>=e.width?!1:n.nodeAt(e.map[g+p]).type==a.header_cell;u.push(m?f||(f=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const d=a.row.create(null,E.from(u)),h=[];for(let p=e.height;p<o;p++)h.push(d);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),h)}return!!(c||f)}function Ly(t,e,n,r,i,o,s,l){if(s==0||s==e.height)return!1;let a=!1;for(let c=i;c<o;c++){const f=s*e.width+c,u=e.map[f];if(e.map[f-e.width]==u){a=!0;const d=n.nodeAt(u),{top:h,left:p}=e.findCell(u);t.setNodeMarkup(t.mapping.slice(l).map(u+r),null,{...d.attrs,rowspan:s-h}),t.insert(t.mapping.slice(l).map(e.positionAt(s,p,n)),d.type.createAndFill({...d.attrs,rowspan:h+d.attrs.rowspan-s})),c+=d.attrs.colspan-1}}return a}function $y(t,e,n,r,i,o,s,l){if(s==0||s==e.width)return!1;let a=!1;for(let c=i;c<o;c++){const f=c*e.width+s,u=e.map[f];if(e.map[f-1]==u){a=!0;const d=n.nodeAt(u),h=e.colCount(u),p=t.mapping.slice(l).map(u+r);t.setNodeMarkup(p,null,Ar(d.attrs,s-h,d.attrs.colspan-(s-h))),t.insert(p+d.nodeSize,d.type.createAndFill(Ar(d.attrs,0,s-h))),c+=d.attrs.rowspan-1}}return a}function By(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc;if(!o)throw new Error("No table found");let s=fe.get(o);const{top:l,left:a}=r,c=a+i.width,f=l+i.height,u=t.tr;let d=0;function h(){if(o=n?u.doc.nodeAt(n-1):u.doc,!o)throw new Error("No table found");s=fe.get(o),d=u.mapping.maps.length}Fz(u,s,o,n,c,f,d)&&h(),Ly(u,s,o,n,a,c,l,d)&&h(),Ly(u,s,o,n,a,c,f,d)&&h(),$y(u,s,o,n,l,f,a,d)&&h(),$y(u,s,o,n,l,f,c,d)&&h();for(let p=l;p<f;p++){const g=s.positionAt(p,a,o),m=s.positionAt(p,c,o);u.replace(u.mapping.slice(d).map(g+n),u.mapping.slice(d).map(m+n),new D(i.rows[p-l],0,0))}h(),u.setSelection(new se(u.doc.resolve(n+s.positionAt(l,a,o)),u.doc.resolve(n+s.positionAt(f-1,c-1,o)))),e(u)}var zz=ud({ArrowLeft:$s("horiz",-1),ArrowRight:$s("horiz",1),ArrowUp:$s("vert",-1),ArrowDown:$s("vert",1),"Shift-ArrowLeft":Bs("horiz",-1),"Shift-ArrowRight":Bs("horiz",1),"Shift-ArrowUp":Bs("vert",-1),"Shift-ArrowDown":Bs("vert",1),Backspace:Fs,"Mod-Backspace":Fs,Delete:Fs,"Mod-Delete":Fs});function cl(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function $s(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof se)return cl(n,r,q.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=Kw(i,t,e);if(s==null)return!1;if(t=="horiz")return cl(n,r,q.near(n.doc.resolve(o.head+e),e));{const l=n.doc.resolve(s),a=Hw(l,t,e);let c;return a?c=q.near(a,1):e<0?c=q.near(n.doc.resolve(l.before(-1)),-1):c=q.near(n.doc.resolve(l.after(-1)),1),cl(n,r,c)}}}function Bs(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof se)s=o;else{const a=Kw(i,t,e);if(a==null)return!1;s=new se(n.doc.resolve(a))}const l=Hw(s.$headCell,t,e);return l?cl(n,r,new se(s.$anchorCell,l)):!1}}function Fs(t,e){const n=t.selection;if(!(n instanceof se))return!1;if(e){const r=t.tr,i=Re(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new D(i,0,0))}),r.docChanged&&e(r)}return!0}function jz(t,e){const n=t.state.doc,r=$i(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new se(r))),!0):!1}function Vz(t,e,n){if(!St(t.state))return!1;let r=Lz(n);const i=t.state.selection;if(i instanceof se){r||(r={width:1,height:1,rows:[E.from(qu(Re(t.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=fe.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=Bz(r,l.right-l.left,l.bottom-l.top),By(t.state,t.dispatch,s,l,r),!0}else if(r){const o=Qa(t.state),s=o.start(-1);return By(t.state,t.dispatch,s,fe.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function Hz(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=Fy(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof se)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=$i(t.state.selection.$anchor))!=null&&((n=mf(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(a,c){let f=mf(t,c);const u=_n.getState(t.state)==null;if(!f||!wh(a,f))if(u)f=a;else return;const d=new se(a,f);if(u||!t.state.selection.eq(d)){const h=t.state.tr.setSelection(d);u&&h.setMeta(_n,a.pos),t.dispatch(h)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),_n.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(_n,-1))}function l(a){const c=a,f=_n.getState(t.state);let u;if(f!=null)u=t.state.doc.resolve(f);else if(Fy(t,c.target)!=r&&(u=mf(t,e),!u))return s();u&&o(u,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function Kw(t,e,n){if(!(t.state.selection instanceof J))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const l=r.before(i),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?l:null}}return null}function Fy(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function mf(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?$i(t.state.doc.resolve(n.pos)):null}var Wz=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Gu(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Gu(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Gu(t,e,n,r,i,o){var s;let l=0,a=!0,c=e.firstChild;const f=t.firstChild;if(f){for(let u=0,d=0;u<f.childCount;u++){const{colspan:h,colwidth:p}=f.child(u).attrs;for(let g=0;g<h;g++,d++){const m=i==d?o:p&&p[g],v=m?m+"px":"";l+=m||r,m||(a=!1),c?(c.style.width!=v&&(c.style.width=v),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=v}}for(;c;){const u=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=u}a?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var ot=new pn("tableColumnResizing");function Uz({handleWidth:t=5,cellMinWidth:e=25,View:n=Wz,lastColumnResizable:r=!0}={}){const i=new Mr({key:ot,state:{init(o,s){var l,a;const c=(a=(l=i.spec)==null?void 0:l.props)==null?void 0:a.nodeViews,f=Re(s.schema).table.name;return n&&c&&(c[f]=(u,d)=>new n(u,e,d)),new qz(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=ot.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{Gz(o,s,t,e,r)},mouseleave:o=>{Kz(o)},mousedown:(o,s)=>{Jz(o,s,e)}},decorations:o=>{const s=ot.getState(o);if(s&&s.activeHandle>-1)return t5(o,s.activeHandle)},nodeViews:{}}});return i}var qz=class fl{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(ot);if(r&&r.setHandle!=null)return new fl(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new fl(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Uu(e.doc.resolve(i))||(i=-1),new fl(i,n.dragging)}return n}};function Gz(t,e,n,r,i){const o=ot.getState(t.state);if(o&&!o.dragging){const s=Xz(e.target);let l=-1;if(s){const{left:a,right:c}=s.getBoundingClientRect();e.clientX-a<=n?l=zy(t,e,"left",n):c-e.clientX<=n&&(l=zy(t,e,"right",n))}if(l!=o.activeHandle){if(!i&&l!==-1){const a=t.state.doc.resolve(l),c=a.node(-1),f=fe.get(c),u=a.start(-1);if(f.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==f.width-1)return}Jw(t,l)}}}function Kz(t){const e=ot.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Jw(t,-1)}function Jz(t,e,n){var r;const i=(r=t.dom.ownerDocument.defaultView)!=null?r:window,o=ot.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const s=t.state.doc.nodeAt(o.activeHandle),l=Yz(t,o.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(ot,{setDragging:{startX:e.clientX,startWidth:l}}));function a(f){i.removeEventListener("mouseup",a),i.removeEventListener("mousemove",c);const u=ot.getState(t.state);u!=null&&u.dragging&&(Qz(t,u.activeHandle,jy(u.dragging,f,n)),t.dispatch(t.state.tr.setMeta(ot,{setDragging:null})))}function c(f){if(!f.which)return a(f);const u=ot.getState(t.state);if(u&&u.dragging){const d=jy(u.dragging,f,n);Zz(t,u.activeHandle,d,n)}}return i.addEventListener("mouseup",a),i.addEventListener("mousemove",c),e.preventDefault(),!0}function Yz(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=t.domAtPos(e);let l=o.node.childNodes[o.offset].offsetWidth,a=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],a--);return l/a}function Xz(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function zy(t,e,n,r){const i=n=="right"?-r:r,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;const{pos:s}=o,l=$i(t.state.doc.resolve(s));if(!l)return-1;if(n=="right")return l.pos;const a=fe.get(l.node(-1)),c=l.start(-1),f=a.map.indexOf(l.pos-c);return f%a.width==0?-1:c+a.map[f-1]}function jy(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Jw(t,e){t.dispatch(t.state.tr.setMeta(ot,{setHandle:e}))}function Qz(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),o=fe.get(i),s=r.start(-1),l=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,a=t.state.tr;for(let c=0;c<o.height;c++){const f=c*o.width+l;if(c&&o.map[f]==o.map[f-o.width])continue;const u=o.map[f],d=i.nodeAt(u).attrs,h=d.colspan==1?0:l-o.colCount(u);if(d.colwidth&&d.colwidth[h]==n)continue;const p=d.colwidth?d.colwidth.slice():e5(d.colspan);p[h]=n,a.setNodeMarkup(s+u,null,{...d,colwidth:p})}a.docChanged&&t.dispatch(a)}function Zz(t,e,n,r){const i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),l=fe.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let a=t.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&Gu(o,a.firstChild,a,r,l,n)}function e5(t){return Array(t).fill(0)}function t5(t,e){const n=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return ae.empty;const o=fe.get(i),s=r.start(-1),l=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let a=0;a<o.height;a++){const c=l+a*o.width;if((l==o.width-1||o.map[c]!=o.map[c+1])&&(a==0||o.map[c]!=o.map[c-o.width])){const f=o.map[c],u=s+f+i.nodeAt(f).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",n.push(Pe.widget(u,d))}}return ae.create(t.doc,n)}function Ut(t){const e=t.selection,n=Qa(t),r=n.node(-1),i=n.start(-1),o=fe.get(r);return{...e instanceof se?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function Yw(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;Tz(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){const l=s*e.width+i;if(i>0&&i<e.width&&e.map[l-1]==e.map[l]){const a=e.map[l],c=r.nodeAt(a);t.setNodeMarkup(t.mapping.map(n+a),null,Ww(c.attrs,i-e.colCount(a))),s+=c.attrs.rowspan-1}else{const a=o==null?Re(r.type.schema).cell:r.nodeAt(e.map[l+o]).type,c=e.positionAt(s,i,r);t.insert(t.mapping.map(n+c),a.createAndFill())}}return t}function n5(t,e){if(!St(t))return!1;if(e){const n=Ut(t);e(Yw(t.tr,n,n.left))}return!0}function r5(t,e){if(!St(t))return!1;if(e){const n=Ut(t);e(Yw(t.tr,n,n.right))}return!0}function i5(t,{map:e,table:n,tableStart:r},i){const o=t.mapping.maps.length;for(let s=0;s<e.height;){const l=s*e.width+i,a=e.map[l],c=n.nodeAt(a),f=c.attrs;if(i>0&&e.map[l-1]==a||i<e.width-1&&e.map[l+1]==a)t.setNodeMarkup(t.mapping.slice(o).map(r+a),null,Ar(f,i-e.colCount(a)));else{const u=t.mapping.slice(o).map(r+a);t.delete(u,u+c.nodeSize)}s+=f.rowspan}}function o5(t,e){if(!St(t))return!1;if(e){const n=Ut(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;i5(r,n,i),i!=n.left;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=fe.get(o)}e(r)}return!0}function s5(t,e,n){var r;const i=Re(e.type.schema).header_cell;for(let o=0;o<t.width;o++)if(((r=e.nodeAt(t.map[o+n*t.width]))==null?void 0:r.type)!=i)return!1;return!0}function Xw(t,{map:e,tableStart:n,table:r},i){var o;let s=n;for(let c=0;c<i;c++)s+=r.child(c).nodeSize;const l=[];let a=i>0?-1:0;s5(e,r,i+a)&&(a=i==0||i==e.height?null:0);for(let c=0,f=e.width*i;c<e.width;c++,f++)if(i>0&&i<e.height&&e.map[f]==e.map[f-e.width]){const u=e.map[f],d=r.nodeAt(u).attrs;t.setNodeMarkup(n+u,null,{...d,rowspan:d.rowspan+1}),c+=d.colspan-1}else{const u=a==null?Re(r.type.schema).cell:(o=r.nodeAt(e.map[f+a*e.width]))==null?void 0:o.type,d=u==null?void 0:u.createAndFill();d&&l.push(d)}return t.insert(s,Re(r.type.schema).row.create(null,l)),t}function l5(t,e){if(!St(t))return!1;if(e){const n=Ut(t);e(Xw(t.tr,n,n.top))}return!0}function a5(t,e){if(!St(t))return!1;if(e){const n=Ut(t);e(Xw(t.tr,n,n.bottom))}return!0}function c5(t,{map:e,table:n,tableStart:r},i){let o=0;for(let c=0;c<i;c++)o+=n.child(c).nodeSize;const s=o+n.child(i).nodeSize,l=t.mapping.maps.length;t.delete(o+r,s+r);const a=new Set;for(let c=0,f=i*e.width;c<e.width;c++,f++){const u=e.map[f];if(!a.has(u)){if(a.add(u),i>0&&u==e.map[f-e.width]){const d=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(l).map(u+r),null,{...d,rowspan:d.rowspan-1}),c+=d.colspan-1}else if(i<e.height&&u==e.map[f+e.width]){const d=n.nodeAt(u),h=d.attrs,p=d.type.create({...h,rowspan:d.attrs.rowspan-1},d.content),g=e.positionAt(i+1,c,n);t.insert(t.mapping.slice(l).map(r+g),p),c+=h.colspan-1}}}}function f5(t,e){if(!St(t))return!1;if(e){const n=Ut(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;c5(r,n,i),i!=n.top;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=fe.get(n.table)}e(r)}return!0}function Vy(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function u5({width:t,height:e,map:n},r){let i=r.top*t+r.left,o=i,s=(r.bottom-1)*t+r.left,l=i+(r.right-r.left-1);for(let a=r.top;a<r.bottom;a++){if(r.left>0&&n[o]==n[o-1]||r.right<t&&n[l]==n[l+1])return!0;o+=t,l+=t}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[s]==n[s+t])return!0;i++,s++}return!1}function d5(t,e){const n=t.selection;if(!(n instanceof se)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ut(t),{map:i}=r;if(u5(i,r))return!1;if(e){const o=t.tr,s={};let l=E.empty,a,c;for(let f=r.top;f<r.bottom;f++)for(let u=r.left;u<r.right;u++){const d=i.map[f*i.width+u],h=r.table.nodeAt(d);if(!(s[d]||!h))if(s[d]=!0,a==null)a=d,c=h;else{Vy(h)||(l=l.append(h.content));const p=o.mapping.map(d+r.tableStart);o.delete(p,p+h.nodeSize)}}if(a==null||c==null)return!0;if(o.setNodeMarkup(a+r.tableStart,null,{...Ww(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const f=a+1+c.content.size,u=Vy(c)?a+1:f;o.replaceWith(u+r.tableStart,f+r.tableStart,l)}o.setSelection(new se(o.doc.resolve(a+r.tableStart))),e(o)}return!0}function h5(t,e){const n=Re(t.schema);return p5(({node:r})=>n[r.type.spec.tableRole])(t,e)}function p5(t){return(e,n)=>{var r;const i=e.selection;let o,s;if(i instanceof se){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=Ez(i.$from),!o)return!1;s=(r=$i(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs;const a=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=Ut(e),u=e.tr;for(let h=0;h<f.right-f.left;h++)a.push(c?{...l,colwidth:c&&c[h]?[c[h]]:null}:l);let d;for(let h=f.top;h<f.bottom;h++){let p=f.map.positionAt(h,f.left,f.table);h==f.top&&(p+=o.nodeSize);for(let g=f.left,m=0;g<f.right;g++,m++)g==f.left&&h==f.top||u.insert(d=u.mapping.map(p+f.tableStart,1),t({node:o,row:h,col:g}).createAndFill(a[m]))}u.setNodeMarkup(s,t({node:o,row:f.top,col:f.left}),a[0]),i instanceof se&&u.setSelection(new se(u.doc.resolve(i.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function g5(t,e){return function(n,r){if(!St(n))return!1;const i=Qa(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const o=n.tr;n.selection instanceof se?n.selection.forEachCell((s,l)=>{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function m5(t){return function(e,n){if(!St(e))return!1;if(n){const r=Re(e.schema),i=Ut(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(a=>i.table.nodeAt(a));for(let a=0;a<s.length;a++)l[a].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[a],r.cell,l[a].attrs);if(o.steps.length==0)for(let a=0;a<s.length;a++)o.setNodeMarkup(i.tableStart+s[a],r.header_cell,l[a].attrs);n(o)}return!0}}function Hy(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Za(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?m5(t):function(n,r){if(!St(n))return!1;if(r){const i=Re(n.schema),o=Ut(n),s=n.tr,l=Hy("row",o,i),a=Hy("column",o,i),f=(t==="column"?l:t==="row"?a:!1)?1:0,u=t=="column"?{left:0,top:f,right:1,bottom:o.map.height}:t=="row"?{left:f,top:0,right:o.map.width,bottom:1}:o,d=t=="column"?a?i.cell:i.header_cell:t=="row"?l?i.cell:i.header_cell:i.cell;o.map.cellsInRect(u).forEach(h=>{const p=h+o.tableStart,g=s.doc.nodeAt(p);g&&s.setNodeMarkup(p,d,g.attrs)}),r(s)}return!0}}Za("row",{useDeprecatedLogic:!0});Za("column",{useDeprecatedLogic:!0});var y5=Za("cell",{useDeprecatedLogic:!0});function v5(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function b5(t){return function(e,n){if(!St(e))return!1;const r=v5(Qa(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(J.between(i,Az(i))).scrollIntoView())}return!0}}function w5(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function S5({allowTableNodeSelection:t=!1}={}){return new Mr({key:_n,state:{init(){return null},apply(e,n){const r=e.getMeta(_n);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:Rz,handleDOMEvents:{mousedown:Hz},createSelectionBetween(e){return _n.getState(e.state)!=null?e.state.selection:null},handleTripleClick:jz,handleKeyDown:zz,handlePaste:Vz},appendTransaction(e,n,r){return Iz(r,Gw(r,n),t)}})}const Wy=t=>typeof t=="object"&&t!=null&&t.nodeType===1,Uy=(t,e)=>(!e||t!=="hidden")&&t!=="visible"&&t!=="clip",yf=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const n=getComputedStyle(t,null);return Uy(n.overflowY,e)||Uy(n.overflowX,e)||(r=>{const i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(t)}return!1},zs=(t,e,n,r,i,o,s,l)=>o<t&&s>e||o>t&&s<e?0:o<=t&&l<=n||s>=e&&l>=n?o-t-r:s>e&&l<n||o<t&&l>n?s-e+i:0,x5=t=>{const e=t.parentElement;return e??(t.getRootNode().host||null)},qy=(t,e)=>{var n,r,i,o;if(typeof document>"u")return[];const{scrollMode:s,block:l,inline:a,boundary:c,skipOverflowHiddenElements:f}=e,u=typeof c=="function"?c:B=>B!==c;if(!Wy(t))throw new TypeError("Invalid target");const d=document.scrollingElement||document.documentElement,h=[];let p=t;for(;Wy(p)&&u(p);){if(p=x5(p),p===d){h.push(p);break}p!=null&&p===document.body&&yf(p)&&!yf(document.documentElement)||p!=null&&yf(p,f)&&h.push(p)}const g=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,m=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:v,scrollY:w}=window,{height:S,width:y,top:x,right:b,bottom:O,left:R}=t.getBoundingClientRect(),{top:k,right:A,bottom:T,left:M}=(B=>{const I=window.getComputedStyle(B);return{top:parseFloat(I.scrollMarginTop)||0,right:parseFloat(I.scrollMarginRight)||0,bottom:parseFloat(I.scrollMarginBottom)||0,left:parseFloat(I.scrollMarginLeft)||0}})(t);let _=l==="start"||l==="nearest"?x-k:l==="end"?O+T:x+S/2-k+T,L=a==="center"?R+y/2-M+A:a==="end"?b+A:R-M;const W=[];for(let B=0;B<h.length;B++){const I=h[B],{height:U,width:Y,top:de,right:ue,bottom:Be,left:et}=I.getBoundingClientRect();if(s==="if-needed"&&x>=0&&R>=0&&O<=m&&b<=g&&x>=de&&O<=Be&&R>=et&&b<=ue)return W;const Fe=getComputedStyle(I),Oe=parseInt(Fe.borderLeftWidth,10),ze=parseInt(Fe.borderTopWidth,10),dt=parseInt(Fe.borderRightWidth,10),je=parseInt(Fe.borderBottomWidth,10);let De=0,we=0;const ht="offsetWidth"in I?I.offsetWidth-I.clientWidth-Oe-dt:0,qt="offsetHeight"in I?I.offsetHeight-I.clientHeight-ze-je:0,Gt="offsetWidth"in I?I.offsetWidth===0?0:Y/I.offsetWidth:0,bn="offsetHeight"in I?I.offsetHeight===0?0:U/I.offsetHeight:0;if(d===I)De=l==="start"?_:l==="end"?_-m:l==="nearest"?zs(w,w+m,m,ze,je,w+_,w+_+S,S):_-m/2,we=a==="start"?L:a==="center"?L-g/2:a==="end"?L-g:zs(v,v+g,g,Oe,dt,v+L,v+L+y,y),De=Math.max(0,De+w),we=Math.max(0,we+v);else{De=l==="start"?_-de-ze:l==="end"?_-Be+je+qt:l==="nearest"?zs(de,Be,U,ze,je+qt,_,_+S,S):_-(de+U/2)+qt/2,we=a==="start"?L-et-Oe:a==="center"?L-(et+Y/2)+ht/2:a==="end"?L-ue+dt+ht:zs(et,ue,Y,Oe,dt+ht,L,L+y,y);const{scrollLeft:ir,scrollTop:wn}=I;De=bn===0?0:Math.max(0,Math.min(wn+De/bn,I.scrollHeight-U/bn+qt)),we=Gt===0?0:Math.max(0,Math.min(ir+we/Gt,I.scrollWidth-Y/Gt+ht)),_+=wn-De,L+=ir-we}W.push({el:I,top:De,left:we})}return W},k5=t=>t===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(t)?t:{block:"start",inline:"nearest"};function C5(t,e){if(!t.isConnected||!(i=>{let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1})(t))return;const n=(i=>{const o=window.getComputedStyle(i);return{top:parseFloat(o.scrollMarginTop)||0,right:parseFloat(o.scrollMarginRight)||0,bottom:parseFloat(o.scrollMarginBottom)||0,left:parseFloat(o.scrollMarginLeft)||0}})(t);if((i=>typeof i=="object"&&typeof i.behavior=="function")(e))return e.behavior(qy(t,e));const r=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:i,top:o,left:s}of qy(t,k5(e))){const l=o-n.top+n.bottom,a=s-n.left+n.right;i.scroll({top:l,left:a,behavior:r})}}var Qw={exports:{}};(function(t,e){(function(n,r){r()})(rn,function(){function n(c,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,f,u){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){a(d.response,f,u)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var f=new XMLHttpRequest;f.open("HEAD",c,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(f)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof rn=="object"&&rn.global===rn?rn:void 0,l=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(c,f,u){var d=s.URL||s.webkitURL,h=document.createElement("a");f=f||c.name||"download",h.download=f,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?r(c,f,u):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,f,u){if(f=f||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,u),f);else if(i(c))r(c,f,u);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,f,u,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return r(c,f,u);var h=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent);if((g||h&&p||l)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var S=m.result;S=g?S:S.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=S:location=S,d=null},m.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,w=v.createObjectURL(c);d?d.location=w:location.href=w,d=null,setTimeout(function(){v.revokeObjectURL(w)},4e4)}});s.saveAs=a.saveAs=a,t.exports=a})})(Qw);var E5=Qw.exports,Sh={exports:{}};function O5(t){return t.toString("ascii",0,2)==="BM"}function A5(t){return{width:t.readUInt32LE(18),height:Math.abs(t.readInt32LE(22))}}var T5={detect:O5,calculate:A5},M5=1,R5=6,N5=16;function D5(t){var e;return t.readUInt16LE(0)!==0?!1:(e=t.readUInt16LE(2),e===M5)}function Gy(t,e){var n=t.readUInt8(e);return n===0?256:n}function Ky(t,e){var n=R5+e*N5;return{width:Gy(t,n),height:Gy(t,n+1)}}function I5(t){var e=t.readUInt16LE(4),n=Ky(t,0),r;if(e===1)return n;for(n.images=[{width:n.width,height:n.height}],r=1;r<e;r+=1)n.images.push(Ky(t,r));return n}var Zw={detect:D5,calculate:I5},P5=2;function _5(t){var e;return t.readUInt16LE(0)!==0?!1:(e=t.readUInt16LE(2),e===P5)}var L5={detect:_5,calculate:Zw.calculate};function $5(t){return t.readUInt32LE(0)===542327876}function B5(t){return{height:t.readUInt32LE(12),width:t.readUInt32LE(16)}}var F5={detect:$5,calculate:B5},z5=/^GIF8[79]a/;function j5(t){var e=t.toString("ascii",0,6);return z5.test(e)}function V5(t){return{width:t.readUInt16LE(6),height:t.readUInt16LE(8)}}var H5={detect:j5,calculate:V5};function W5(t){var e=t.toString("hex",0,2);return e==="ffd8"}function U5(t,e){return{height:t.readUInt16BE(e),width:t.readUInt16BE(e+2)}}function q5(t,e){if(e>t.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(t[e]!==255)throw new TypeError("Invalid JPG, marker table corrupted")}function G5(t){t=t.slice(4);for(var e,n;t.length;){if(e=t.readUInt16BE(0),q5(t,e),n=t[e+1],n===192||n===193||n===194)return U5(t,e+5);t=t.slice(e+2)}throw new TypeError("Invalid JPG, no size found")}var K5={detect:W5,calculate:G5},J5=`PNG\r
451
+ 
452
+ `,Y5="IHDR",eS="CgBI";function X5(t){if(J5===t.toString("ascii",1,8)){var e=t.toString("ascii",12,16);if(e===eS&&(e=t.toString("ascii",28,32)),e!==Y5)throw new TypeError("invalid png");return!0}}function Q5(t){return t.toString("ascii",12,16)===eS?{width:t.readUInt32BE(32),height:t.readUInt32BE(36)}:{width:t.readUInt32BE(16),height:t.readUInt32BE(20)}}var Z5={detect:X5,calculate:Q5};function ej(t){return t.toString("ascii",0,4)==="8BPS"}function tj(t){return{width:t.readUInt32BE(18),height:t.readUInt32BE(14)}}var nj={detect:ej,calculate:tj},rj=/<svg[^>]+[^>]*>/;function ij(t){return rj.test(t)}var ul={root:/<svg\s[^>]+>/,width:/\bwidth=(['"])([^%]+?)\1/,height:/\bheight=(['"])([^%]+?)\1/,viewbox:/\bviewBox=(['"])(.+?)\1/};function oj(t){var e=t.split(" ");return{width:parseInt(e[2],10),height:parseInt(e[3],10)}}function sj(t){var e=t.match(ul.width),n=t.match(ul.height),r=t.match(ul.viewbox);return{width:e&&parseInt(e[2],10),height:n&&parseInt(n[2],10),viewbox:r&&oj(r[2])}}function lj(t){return{width:t.width,height:t.height}}function aj(t){var e=t.viewbox.width/t.viewbox.height;return t.width?{width:t.width,height:Math.floor(t.width/e)}:t.height?{width:Math.floor(t.height*e),height:t.height}:{width:t.viewbox.width,height:t.viewbox.height}}function cj(t){var e=t.toString("utf8").match(ul.root);if(e){var n=sj(e[0]);if(n.width&&n.height)return lj(n);if(n.viewbox)return aj(n)}throw new TypeError("invalid svg")}var fj={detect:ij,calculate:cj};function uj(t){var e=t.toString("ascii",0,4)==="RIFF",n=t.toString("ascii",8,12)==="WEBP",r=t.toString("ascii",12,15)==="VP8";return e&&n&&r}function dj(t){var e=t.toString("ascii",12,16);if(t=t.slice(20,30),e==="VP8X"){var n=t[0],r=(n&192)===0,i=(n&1)===0;return r&&i?hj(t):!1}if(e==="VP8 "&&t[0]!==47)return gj(t);var o=t.toString("hex",3,6);return e==="VP8L"&&o!=="9d012a"?pj(t):!1}function hj(t){return{width:1+t.readUIntLE(4,3),height:1+t.readUIntLE(7,3)}}function pj(t){return{width:1+((t[2]&63)<<8|t[1]),height:1+((t[4]&15)<<10|t[3]<<2|(t[2]&192)>>6)}}function gj(t){return{width:t.readInt16LE(6)&16383,height:t.readInt16LE(8)&16383}}var mj={detect:uj,calculate:dj},yj={bmp:T5,cur:L5,dds:F5,gif:H5,ico:Zw,jpg:K5,png:Z5,psd:nj,svg:fj,webp:mj},tS=yj,Jy=tS,vj=function(t){var e,n;for(e in Jy)if(n=Jy[e].detect(t),n)return e},Ku=tS,bj=vj;function wj(t){var e=bj(t);if(e in Ku){var n=Ku[e].calculate(t);if(n!==!1)return n.type=e,n}throw new TypeError("unsupported file type: "+e)}Sh.exports=function(t){if(Buffer.isBuffer(t))return wj(t);throw new TypeError("expecting only a buffer as input")};Sh.exports.types=Object.keys(Ku);var Sj=Sh.exports;const xj=kd(Sj);function nS(t){return{alignment:V.AlignmentType.START,style:{paragraph:{indent:{left:V.convertInchesToTwip(t),hanging:V.convertInchesToTwip(.18)}}}}}const kj=Array(3).fill([V.LevelFormat.DECIMAL,V.LevelFormat.LOWER_LETTER,V.LevelFormat.LOWER_ROMAN]).flat().map((t,e)=>Object.assign({level:e,format:t,text:`%${e+1}.`},nS((e+1)/2))),Cj=Array(3).fill(["●","○","■"]).flat().map((t,e)=>Object.assign({level:e,format:V.LevelFormat.BULLET,text:t},nS((e+1)/2))),Ej={numbered:kj,bullets:Cj};function Oj(t,e){return{reference:t,levels:Ej[e]}}function Yy(){return Math.random().toString(36).substr(2,9)}function Aj(t){return new V.Document({footnotes:t.footnotes,numbering:{config:t.numbering},sections:[{properties:{type:V.SectionType.CONTINUOUS},children:t.children}]})}function Xy(t){let e="";return t.forEach(n=>{n.isText&&(e+=n.text)}),e}const vf=600;function Qy(t,e,n,r){const i=n?[new V.TextRun(n)]:[],o=[];return new V.Bookmark({id:t,children:[...i,new V.SequentialIdentifier(e),...o]})}class Tj{constructor(e,n,r){this.footnotes={},this.current=[],this.maxImageWidth=vf,this.$footnoteCounter=0,this.nodes=e,this.marks=n,this.options=r??{},this.children=[],this.numbering=[]}renderContent(e,n){e.forEach((r,i,o)=>{n&&this.addParagraphOptions(n),this.render(r,e,o)})}render(e,n,r){if(typeof n=="number")throw new Error("!");if(!this.nodes[e.type.name])throw new Error(`Token type \`${e.type.name}\` not supported by Word renderer`);this.nodes[e.type.name](this,e,n,r)}renderMarks(e,n){return n.map(r=>{var i,o;return(o=(i=this.marks)[r.type.name])===null||o===void 0?void 0:o.call(i,this,e,r)}).reduce((r,i)=>Object.assign(Object.assign({},r),i),{})}renderInline(e){let n;const r=()=>{if(!n)return;const s=new V.ExternalHyperlink({link:n.link,children:this.current});this.current=[...n.stack,s],n=void 0},i=s=>{const l=s===(n==null?void 0:n.link);this.addRunOptions({style:"Hyperlink"});{if(n&&l)return;n&&!l&&r()}n={link:s,stack:this.current},this.current=[]},o=(s,l,a)=>{const c=s.marks.filter(u=>u.type.name==="link"),f=c.length>0;f?i(c[0].attrs.href):!f&&n&&r(),s.isText?this.text(s.text,this.renderMarks(s,[...s.marks])):this.render(s,e,a)};e.forEach(o),r()}renderList(e,n){if(this.currentNumbering){const{reference:r,level:i}=this.currentNumbering;this.currentNumbering={reference:r,level:i+1}}else{const r=Yy();this.numbering.push(Oj(r,n)),this.currentNumbering={reference:r,level:0}}if(this.renderContent(e),this.currentNumbering.level===0)delete this.currentNumbering;else{const{reference:r,level:i}=this.currentNumbering;this.currentNumbering={reference:r,level:i-1}}}renderListItem(e){if(!this.currentNumbering)throw new Error("Trying to create a list item without a list?");this.addParagraphOptions({numbering:this.currentNumbering}),this.renderContent(e)}addParagraphOptions(e){this.nextParentParagraphOpts=Object.assign(Object.assign({},this.nextParentParagraphOpts),e)}addRunOptions(e){this.nextRunOpts=Object.assign(Object.assign({},this.nextRunOpts),e)}text(e,n){e&&(this.current.push(new V.TextRun(Object.assign(Object.assign({text:e},this.nextRunOpts),n))),delete this.nextRunOpts)}math(e,n={inline:!0}){var r;if(n.inline||!n.numbered){this.current.push(new V.Math({children:[new V.MathRun(e)]}));return}const i=(r=n.id)!==null&&r!==void 0?r:Yy();this.current=[new V.TextRun(" "),new V.Math({children:[new V.MathRun(e)]}),new V.TextRun(" ("),Qy(i,"Equation"),new V.TextRun(")")],this.addParagraphOptions({tabStops:[{type:V.TabStopType.CENTER,position:V.TabStopPosition.MAX/2},{type:V.TabStopType.RIGHT,position:V.TabStopPosition.MAX}]})}image(e,n=70,r="center",i){const o=this.options.getImageBuffer(e),s=xj(o),l=s.height/s.width,a=this.maxImageWidth*(n/100);this.current.push(new V.ImageRun(Object.assign(Object.assign({},i),{data:o,transformation:Object.assign(Object.assign({},(i==null?void 0:i.transformation)||{}),{width:a,height:a*l})})));let c;switch(r){case"right":c=V.AlignmentType.RIGHT;break;case"left":c=V.AlignmentType.LEFT;break;default:c=V.AlignmentType.CENTER}this.addParagraphOptions({alignment:c})}table(e,n={}){const{getCellOptions:r,getRowOptions:i,tableOptions:o}=n,s=this.children,l=[];e.content.forEach(c=>{const f=[];let u=!0;c.content.forEach(d=>{d.type.name!=="table_header"&&(u=!1)}),this.maxImageWidth=vf/c.content.childCount,c.content.forEach(d=>{var h,p;this.children=[],this.renderContent(d);const g={children:this.children},m=(h=d.attrs.colspan)!==null&&h!==void 0?h:1,v=(p=d.attrs.rowspan)!==null&&p!==void 0?p:1;m>1&&(g.columnSpan=m),v>1&&(g.rowSpan=v),f.push(new V.TableCell(Object.assign(Object.assign({},g),(r==null?void 0:r(d))||{})))}),l.push(new V.TableRow(Object.assign(Object.assign({},(i==null?void 0:i(c))||{}),{children:f,tableHeader:u})))}),this.maxImageWidth=vf;const a=new V.Table(Object.assign(Object.assign({},o),{rows:l}));s.push(a),s.push(new V.Paragraph("")),this.children=s}captionLabel(e,n,{suffix:r}={suffix:": "}){this.current.push(Qy(e,n,`${n} `),new V.TextRun(r))}footnote(e){const{current:n,nextRunOpts:r}=this;this.current=[],delete this.nextRunOpts,this.$footnoteCounter+=1,this.renderInline(e),this.footnotes[this.$footnoteCounter]={children:[new V.Paragraph({children:this.current})]},this.current=n,this.nextRunOpts=r,this.current.push(new V.FootnoteReferenceRun(this.$footnoteCounter))}closeBlock(e,n){const r=new V.Paragraph(Object.assign(Object.assign({children:this.current},this.nextParentParagraphOpts),n));this.current=[],delete this.nextParentParagraphOpts,this.children.push(r)}createReference(e,n,r){const i=[];n&&i.push(new V.TextRun(n)),i.push(new V.SimpleField(`REF ${e} \\h`)),r&&i.push(new V.TextRun(r));const o=new V.InternalHyperlink({anchor:e,children:i});this.current.push(o)}}class Mj{constructor(e,n){this.nodes=e,this.marks=n}serialize(e,n){const r=new Tj(this.nodes,this.marks,n);return r.renderContent(e),Aj(r)}}const Rj={text(t,e){var n;t.text((n=e.text)!==null&&n!==void 0?n:"")},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},heading(t,e){t.renderInline(e);const n=[V.HeadingLevel.HEADING_1,V.HeadingLevel.HEADING_2,V.HeadingLevel.HEADING_3,V.HeadingLevel.HEADING_4,V.HeadingLevel.HEADING_5,V.HeadingLevel.HEADING_6][e.attrs.level-1];t.closeBlock(e,{heading:n})},blockquote(t,e){t.renderContent(e,{style:"IntenseQuote"})},code_block(t,e){t.renderContent(e),t.closeBlock(e)},horizontal_rule(t,e){t.closeBlock(e,{thematicBreak:!0}),t.closeBlock(e)},hard_break(t){t.addRunOptions({break:1})},ordered_list(t,e){t.renderList(e,"numbered")},bullet_list(t,e){t.renderList(e,"bullets")},list_item(t,e){t.renderListItem(e)},image(t,e){const{src:n}=e.attrs;t.image(n),t.closeBlock(e)},math(t,e){t.math(Xy(e),{inline:!0})},equation(t,e){const{id:n,numbered:r}=e.attrs;t.math(Xy(e),{inline:!1,numbered:r,id:n}),t.closeBlock(e)},table(t,e){t.table(e)}},Nj={em(){return{italics:!0}},strong(){return{bold:!0}},italic(){return{italics:!0}},bold(){return{bold:!0}},link(){return{}},code(){return{font:{name:"Monospace"},color:"000000",shading:{type:V.ShadingType.SOLID,color:"D2D3D2",fill:"D2D3D2"}}},abbr(){return{}},subscript(){return{subScript:!0}},superscript(){return{superScript:!0}},strikethrough(){return{strike:!0}},underline(){return{underline:{}}},smallcaps(){return{smallCaps:!0}},allcaps(){return{allCaps:!0}}};exports.AllSelection=st;exports.BetweenHorizontalEnd=$O;exports.BetweenHorizontalStart=BO;exports.BetweenVerticalEnd=FO;exports.BetweenVerticalStart=zO;exports.Bold=jO;exports.BookMarked=VO;exports.CellSelection=se;exports.Check=HO;exports.ChevronDown=WO;exports.ChevronRight=UO;exports.ChevronsUpDown=qO;exports.Circle=KO;exports.CircleHelp=GO;exports.Clipboard=JO;exports.Clock3=YO;exports.Code=QO;exports.CodeXml=XO;exports.Columns2=ZO;exports.Columns3=eA;exports.Columns4=tA;exports.Copy=nA;exports.DOMParser=Ju;exports.DOMSerializer=Tr;exports.Decoration=Pe;exports.DecorationSet=ae;exports.DocxSerializer=Mj;exports.EditorState=Xr;exports.EditorView=Fk;exports.Eraser=rA;exports.FileSaver_minExports=E5;exports.Fragment=E;exports.Frame=iA;exports.GripVertical=oA;exports.Heading1=sA;exports.Heading2=lA;exports.Heading3=aA;exports.Heading4=cA;exports.Heading5=fA;exports.Heading6=uA;exports.ImageUp=dA;exports.IndentDecrease=hA;exports.IndentIncrease=pA;exports.Italic=gA;exports.Laugh=mA;exports.Link=yA;exports.List=wA;exports.ListOrdered=vA;exports.ListTodo=bA;exports.LoaderCircle=SA;exports.Maximize=xA;exports.Minimize=kA;exports.Minus=CA;exports.Node=jn;exports.NodeRange=bo;exports.NodeSelection=j;exports.PaintRoller=EA;exports.PanelLeft=OA;exports.PanelRight=AA;exports.Pencil=TA;exports.Plugin=Mr;exports.PluginKey=pn;exports.Plus=MA;exports.Quote=RA;exports.ReactRemoveScroll=ab;exports.Redo2=NA;exports.Replace=DA;exports.ReplaceAroundStep=ye;exports.ReplaceStep=me;exports.Schema=AS;exports.Selection=q;exports.SelectionRange=td;exports.Sigma=IA;exports.Slice=D;exports.SmilePlus=PA;exports.Sparkles=_A;exports.Strikethrough=LA;exports.Subscript=$A;exports.Superscript=BA;exports.Table=jA;exports.TableCellsMerge=FA;exports.TableCellsSplit=zA;exports.TextSelection=J;exports.Transform=ed;exports.Trash=HA;exports.Trash2=VA;exports.Type=WA;exports.Underline=UA;exports.Undo2=qA;exports.Unlink=GA;exports.Video=KA;exports.X=JA;exports.Z=jI;exports.absolutePositionToRelativePosition=_F;exports.addColumnAfter=r5;exports.addColumnBefore=n5;exports.addRowAfter=a5;exports.addRowBefore=l5;exports.arrow=FD;exports.autoUpdate=kD;exports.canJoin=Ai;exports.canSplit=Qu;exports.clamp=o$;exports.clsx=SC;exports.columnResizing=Uz;exports.createParagraphNear=lC;exports.cva=VN;exports.debounce=Vb;exports.deepEqual=zN;exports.defaultMarks=Nj;exports.defaultNodes=Rj;exports.deleteColumn=o5;exports.deleteRow=f5;exports.deleteSelection=Jk;exports.deleteTable=w5;exports.differenceBy=b3;exports.dropCursor=dz;exports.e=C5;exports.exitCode=sC;exports.find=nz;exports.findWrapping=Xu;exports.fixTables=Gw;exports.flip=LD;exports.gapCursor=mz;exports.goToNextCell=b5;exports.hide=BD;exports.hideOthers=HD;exports.history=uz;exports.isNumber=S3;exports.joinBackward=Yk;exports.joinDown=rC;exports.joinForward=eC;exports.joinPoint=Zu;exports.joinTextblockBackward=Xk;exports.joinTextblockForward=Qk;exports.joinUp=nC;exports.keymap=Kk;exports.lift=iC;exports.liftEmptyBlock=aC;exports.liftListItem=yC;exports.liftTarget=Oi;exports.limitShift=_D;exports.mergeCells=d5;exports.newlineInCode=oC;exports.offset=ID;exports.proxy=JI;exports.redo=Vw;exports.registerCustomProtocol=ez;exports.reset=ZF;exports.selectNodeBackward=Zk;exports.selectNodeForward=tC;exports.selectParentNode=cC;exports.selectTextblockEnd=dC;exports.selectTextblockStart=uC;exports.setBlockType=pC;exports.setCellAttr=g5;exports.shift=PD;exports.sinkListItem=wC;exports.size=$D;exports.splitCell=h5;exports.sticky=IO;exports.tableEditing=S5;exports.throttle=z3;exports.tippy=Qo;exports.toggleHeader=Za;exports.toggleHeaderCell=y5;exports.tokenize=Bw;exports.truncate=W3;exports.twMerge=ZC;exports.undo=jw;exports.useFloating=ND;exports.useSnapshot=oP;exports.wrapIn=hC;exports.wrapInList=gC;exports.ySyncPluginKey=PF;
453
+ //# sourceMappingURL=vendor-Btqs8WA3.cjs.map