mailery 0.3.2 → 0.5.1
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.
- package/dist/admin/spa/index-Dmsla2eL.js +41 -0
- package/dist/admin/spa/index-Dmsla2eL.js.map +1 -0
- package/dist/admin/spa/index.html +1 -1
- package/dist/admin/spa/template-editor-Bn28OPMU.js +502 -0
- package/dist/admin/spa/{template-editor-dMzrGcva.js.map → template-editor-Bn28OPMU.js.map} +1 -1
- package/dist/cli.cjs +231 -56
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +231 -56
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +2733 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +2729 -222
- package/dist/index.js.map +1 -1
- package/dist/{null-CGaNDDlQ.d.cts → null-BYB6v4Iv.d.cts} +324 -2
- package/dist/{null-CGaNDDlQ.d.ts → null-BYB6v4Iv.d.ts} +324 -2
- package/dist/testing.cjs +894 -94
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +891 -94
- package/dist/testing.js.map +1 -1
- package/package.json +8 -1
- package/dist/admin/spa/index-B1Mp8lSz.js +0 -41
- package/dist/admin/spa/index-B1Mp8lSz.js.map +0 -1
- package/dist/admin/spa/template-editor-dMzrGcva.js +0 -502
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
var ak=Object.defineProperty;var lk=(t,e,n)=>e in t?ak(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var oa=(t,e,n)=>lk(t,typeof e!="symbol"?e+"":e,n);import{r as x,R as Q,a as Mf,b as tb,g as nb,j as p,c as Of,u as rb,L as ck,d as Vn,P as dk,I as Va}from"./index-Dmsla2eL.js";function dt(t){this.content=t}dt.prototype={constructor:dt,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),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new dt(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new dt(n)},addToStart:function(t,e){return new dt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new dt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new dt(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=dt.from(t),t.size?new dt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=dt.from(t),t.size?new dt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=dt.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}};dt.from=function(t){if(t instanceof dt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new dt(e)};function ib(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),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=ib(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function sb(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let c=0,d=Math.min(o.text.length,a.text.length);for(;c<d&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let c=sb(o.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class L{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,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new L(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 s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new L(r,i)}cutByIndex(e,n){return e==n?L.empty:e==0&&n==this.content.length?this:new L(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new L(i,s)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(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 ib(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return sb(this,e,n,r)}findIndex(e){if(e==0)return aa(0,e);if(e==this.size)return aa(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?aa(n+1,s):aa(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return L.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new L(n||e,r)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const fd={index:0,offset:0};function aa(t,e){return fd.index=t,fd.offset=e,fd}function al(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(!al(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!al(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Pe=class ku{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}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&&al(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 ku.none;if(e instanceof ku)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Pe.none=[];class ll extends Error{}class J{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=ab(this.content,e+this.openStart,n);return r&&new J(r,this.openStart,this.openEnd)}removeBetween(e,n){return new J(ob(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 J.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 J(L.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new J(e,r,i)}}J.empty=new J(L.empty,0,0);function ob(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(ob(s.content,e-i-1,n-i-1)))}function ab(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=ab(o.content,e-s-1,n,o);return a&&t.replaceChild(i,o.copy(a))}function uk(t,e,n){if(n.openStart>t.depth)throw new ll("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ll("Inconsistent open depths");return lb(t,e,n,0)}function lb(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=lb(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return Qr(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=fk(n,t);return Qr(s,db(t,o,a,e,r))}else return Qr(s,cl(t,e,r))}function cb(t,e){if(!e.type.compatibleContent(t.type))throw new ll("Cannot join "+e.type.name+" onto "+t.type.name)}function Su(t,e,n){let r=t.node(n);return cb(r,e.node(n)),r}function Zr(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 Us(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Zr(t.nodeAfter,r),s++));for(let a=s;a<o;a++)Zr(i.child(a),r);e&&e.depth==n&&e.textOffset&&Zr(e.nodeBefore,r)}function Qr(t,e){return t.type.checkContent(e),t.copy(e)}function db(t,e,n,r,i){let s=t.depth>i&&Su(t,e,i+1),o=r.depth>i&&Su(n,r,i+1),a=[];return Us(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(cb(s,o),Zr(Qr(s,db(t,e,n,r,i+1)),a)):(s&&Zr(Qr(s,cl(t,e,i+1)),a),Us(e,n,i,a),o&&Zr(Qr(o,cl(n,r,i+1)),a)),Us(r,null,i,a),new L(a)}function cl(t,e,n){let r=[];if(Us(null,t,n,r),t.depth>n){let i=Su(t,e,n+1);Zr(Qr(i,cl(t,e,n+1)),r)}return Us(e,null,n,r),new L(r)}function fk(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(L.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class oo{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 s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Pe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let 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 ao(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,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new oo(n,r,s)}static resolveCached(e,n){let r=wp.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else wp.set(e,r=new hk);let i=r.elts[r.i]=oo.resolve(e,n);return r.i=(r.i+1)%pk,i}}class hk{constructor(){this.elts=[],this.i=0}}const pk=12,wp=new WeakMap;class ao{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 mk=Object.create(null);let kr=class Cu{constructor(e,n,r,i=Pe.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||L.empty}get children(){return this.content.content}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&&al(this.attrs,n||e.defaultAttrs||mk)&&Pe.sameSet(this.marks,r||Pe.none)}copy(e=null){return e==this.content?this:new Cu(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Cu(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 J.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new J(c,i.depth-o,s.depth-o)}replace(e,n,r){return uk(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 oo.resolveCached(this,e)}resolveNoCache(e){return oo.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ub(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=L.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Pe.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(!Pe.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=L.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};kr.prototype.text=void 0;class dl extends kr{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):ub(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 dl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new dl(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 ub(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ai{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new gk(e,n);if(r.next==null)return ai.empty;let i=fb(r);r.next&&r.err("Unexpected trailing text");let s=kk(Ek(i));return Sk(s,r),s}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 s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type: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 s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return L.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:d,next:u}=o.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let f=s(u,a.concat(d));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let 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(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function 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 s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
2
|
+
`)}}ai.empty=new ai(!0);class gk{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 fb(t){let e=[];do e.push(yk(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function yk(t){let e=[];do e.push(bk(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function bk(t){let e=wk(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=vk(t,e);else break;return e}function Ep(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function vk(t,e){let n=Ep(t),r=n;return t.eat(",")&&(t.next!="}"?r=Ep(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function xk(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function wk(t){if(t.eat("(")){let e=fb(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=xk(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 Ek(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let d=n();i(s(o.expr,l),d),l=d}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let d=n();r(l,d),i(s(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function hb(t,e){return e-t}function kp(t,e){let n=[];return r(e),n.sort(hb);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function kk(t){let e=Object.create(null);return n(kp(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<i.length;d++)i[d][0]==a&&(c=i[d][1]);kp(t,l).forEach(d=>{c||i.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let s=e[r.join(",")]=new ai(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(hb);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function Sk(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function pb(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 mb(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function gb(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 s=t[i];s.validate&&s.validate(e[i])}}function yb(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new _k(t,r,e[r]);return n}let Sp=class bb{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=yb(e,r.attrs),this.defaultAttrs=pb(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==ai.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:mb(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new kr(this,this.computeAttrs(e),L.from(n),Pe.setFrom(r))}createChecked(e=null,n,r){return n=L.from(n),this.checkContent(n),new kr(this,this.computeAttrs(e),n,Pe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=L.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(L.empty,!0);return s?new kr(this,e,n.append(s),Pe.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){gb(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:Pe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new bb(s,n,o));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 s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ck(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class _k{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ck(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class yc{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=yb(e,i.attrs),this.excluded=null;let s=pb(this.attrs);this.instance=s?new Pe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Pe(this,mb(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new yc(s,i++,n,o)),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){gb(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let vb=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=dt.from(e.nodes),n.marks=dt.from(e.marks||{}),this.nodes=Sp.compile(this.spec.nodes,this),this.marks=yc.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=ai.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Cp(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Cp(this,o.split(" "))}this.nodeFromJSON=i=>kr.fromJSON(this,i),this.markFromJSON=i=>Pe.fromJSON(this,i),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 Sp){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 dl(r,r.defaultAttrs,e,Pe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function Cp(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Nk(t){return t.tag!=null}function Tk(t){return t.style!=null}let Vs=class _u{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Nk(i))this.tags.push(i);else if(Tk(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Np(this,n,!1);return r.addAll(e,Pe.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Np(this,n,!0);return r.addAll(e,Pe.none,n.from,n.to),J.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Ok(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Tp(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Tp(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _u(e,_u.schemaRules(e)))}};const xb={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},Ak={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wb={ol:!0,ul:!0},lo=1,Nu=2,Ks=4;function _p(t,e,n){return e!=null?(e?lo:0)|(e==="full"?Nu:0):t&&t.whitespace=="pre"?lo|Nu:n&~Ks}class la{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=Pe.none,this.match=s||(o&Ks?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(L.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&lo)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=L.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!xb.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Np{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=_p(null,n.preserveWhitespace,0)|(r?Ks:0);i?s=new la(i.type,i.attrs,Pe.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new la(null,null,Pe.none,!0,null,o):s=new la(e.schema.topNodeType,null,Pe.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&Nu?"full":this.localPreserveWS||(i.options&lo)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
|
|
3
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;wb.hasOwnProperty(o)&&this.parser.normalizeLists&&Mk(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Ak.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(xb.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let u=l&&l.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),c&&this.sync(s),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Pe.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):Ap(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=_p(e,s,o.options);o.options&Ks&&o.content.length==0&&(a|=Ks);let l=Pe.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):Ap(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new la(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=lo)}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),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Mk(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&wb.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Ok(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Tp(t){let e={};for(let n in t)e[n]=t[n];return e}function Ap(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||s.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class pi{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=hd(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],d=this.serializeMark(c,o.isInline,n);d&&(s.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Ka(hd(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 s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Ka(hd(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Ka(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new pi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Mp(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Mp(e.marks)}}function Mp(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function hd(t){return t.document||window.document}const Op=new WeakMap;function Rk(t){let e=Op.get(t);return e===void 0&&Op.set(t,e=Ik(t)),e}function Ik(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 Ka(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],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Rk(r))&&s.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 o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(" ");f>0?l.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):u=="style"&&l.style?l.style.cssText=c[u]:l.setAttribute(u,c[u])}}for(let u=d;u<e.length;u++){let f=e[u];if(f===0){if(u<e.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:m}=Ka(t,f,n,r);if(l.appendChild(h),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const Eb=65535,kb=Math.pow(2,16);function Dk(t,e){return t+e*kb}function Rp(t){return t&Eb}function Lk(t){return(t-(t&Eb))/kb}const Sb=1,Cb=2,Wa=4,_b=8;class Tu{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&_b)>0}get deletedBefore(){return(this.delInfo&(Sb|Wa))>0}get deletedAfter(){return(this.delInfo&(Cb|Wa))>0}get deletedAcross(){return(this.delInfo&Wa)>0}}class jt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&jt.empty)return jt.empty}recover(e){let n=0,r=Rp(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+Lk(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,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],d=this.ranges[a+o],u=l+c;if(e<=u){let f=c?e==l?-1:e==u?1:n:n,h=l+i+(f<0?0:d);if(r)return h;let m=e==(n<0?l:u)?null:Dk(a/3,e-l),g=e==l?Cb:e==u?Sb:Wa;return(n<0?e!=l:e!=u)&&(g|=_b),new Tu(h,g,m)}i+=d-c}return r?e+i:new Tu(e+i,0,null)}touches(e,n){let r=0,i=Rp(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],d=l+c;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+n],d=this.ranges[i+r];e(a,a+c,l,l+d),s+=d-c}}invert(){return new jt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?jt.empty:new jt(e<0?[0,-e,0]:[0,0,e])}}jt.empty=new jt([]);class co{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new co(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),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 co;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 s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Tu(e,i,null)}}const pd=Object.create(null);class wt{getMap(){return jt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=pd[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 pd)throw new RangeError("Duplicate use of step JSON ID "+e);return pd[e]=n,n.prototype.jsonID=e,n}}class Ze{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ze(e,null)}static fail(e){return new Ze(null,e)}static fromReplace(e,n,r,i){try{return Ze.ok(e.replace(n,r,i))}catch(s){if(s instanceof ll)return Ze.fail(s.message);throw s}}}function Rf(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Rf(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return L.fromArray(r)}class yr extends wt{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)),s=new J(Rf(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Ze.fromReplace(e,this.from,this.to,s)}invert(){return new kn(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 yr(n.pos,r.pos,this.mark)}merge(e){return e instanceof yr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yr(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 yr(n.from,n.to,e.markFromJSON(n.mark))}}wt.jsonID("addMark",yr);class kn extends wt{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 J(Rf(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ze.fromReplace(e,this.from,this.to,r)}invert(){return new yr(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 kn(n.pos,r.pos,this.mark)}merge(e){return e instanceof kn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kn(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 kn(n.from,n.to,e.markFromJSON(n.mark))}}wt.jsonID("removeMark",kn);class br extends wt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ze.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ze.fromReplace(e,this.pos,this.pos+1,new J(L.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 br(this.pos,n.marks[i]);return new br(this.pos,this.mark)}}return new li(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new br(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 br(n.pos,e.markFromJSON(n.mark))}}wt.jsonID("addNodeMark",br);class li extends wt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ze.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ze.fromReplace(e,this.pos,this.pos+1,new J(L.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new br(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new li(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 li(n.pos,e.markFromJSON(n.mark))}}wt.jsonID("removeNodeMark",li);class Xe extends wt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Au(e,this.from,this.to)?Ze.fail("Structure replace would overwrite content"):Ze.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new jt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Xe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Xe.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Xe(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Xe)||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?J.empty:new J(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Xe(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?J.empty:new J(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Xe(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 Xe(n.from,n.to,J.fromJSON(e,n.slice),!!n.structure)}}Xe.MAP_BIAS=1;wt.jsonID("replace",Xe);class rt extends wt{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Au(e,this.from,this.gapFrom)||Au(e,this.gapTo,this.to)))return Ze.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ze.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ze.fromReplace(e,this.from,this.to,r):Ze.fail("Content does not fit in gap")}getMap(){return new jt([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 rt(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),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new rt(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,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 rt(n.from,n.to,n.gapFrom,n.gapTo,J.fromJSON(e,n.slice),n.insert,!!n.structure)}}wt.jsonID("replaceAround",rt);function Au(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Pk(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,c,d)=>{if(!l.isInline)return;let u=l.marks;if(!r.isInSet(u)&&d.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,n),m=r.addToSet(u);for(let g=0;g<u.length;g++)u[g].isInSet(m)||(o&&o.to==f&&o.mark.eq(u[g])?o.to=h:i.push(o=new kn(f,h,u[g])));a&&a.to==f?a.to=h:s.push(a=new yr(f,h,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function Bk(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof yc){let c=o.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,n);for(let d=0;d<l.length;d++){let u=l[d],f;for(let h=0;h<i.length;h++){let m=i[h];m.step==s-1&&u.eq(i[h].style)&&(f=m)}f?(f.to=c,f.step=s):i.push({style:u,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>t.step(new kn(o.from,o.to,o.style)))}function If(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),d=a+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Xe(a,d,J.empty));else{r=u;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new kn(a,d,c.marks[f]));if(i&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(c.text);)m||(m=new J(L.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new Xe(a+f.index,a+f.index+f[0].length,m))}}a=d}if(!r.validEnd){let l=r.fillBefore(L.empty,!0);t.replace(a,a,new J(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function $k(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function xs(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!$k(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function jk(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,c=a,d=L.empty,u=0;for(let m=s,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,d=L.from(r.node(m).copy(d)),u++):l--;let f=L.empty,h=0;for(let m=s,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,f=L.from(i.node(m).copy(f)),h++):c++;t.step(new rt(l,c,o,a,new J(d.append(f),u,h),d.size-u,!0))}function Df(t,e,n=null,r=t){let i=Fk(t,e),s=i&&Hk(r,e);return s?i.map(Ip).concat({type:e,attrs:n}).concat(s.map(Ip)):null}function Ip(t){return{type:t,attrs:null}}function Fk(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function Hk(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:o}function zk(t,e,n){let r=L.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=L.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new rt(i,s,i,s,new J(r,0,0),n.length,!0))}function Uk(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&Vk(t.doc,t.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&Tb(t,o,a,s),If(t,t.mapping.slice(s).map(a,1),r,void 0,c===null);let d=t.mapping.slice(s),u=d.map(a,1),f=d.map(a+o.nodeSize,1);return t.step(new rt(u,f,u+1,f-1,new J(L.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&Nb(t,o,a,s),!1}})}function Nb(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Tb(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
5
|
+
`))}})}function Vk(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Kk(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new rt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new J(L.from(o),0,0),1,!0))}function qn(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=n-2;c>s;c--,d--){let u=i.node(c),f=i.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),m=r&&r[d+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[d]||u;if(!u.canReplace(f+1,u.childCount)||!g.type.validContent(h))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function Wk(t,e,n=1,r){let i=t.doc.resolve(e),s=L.empty,o=L.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){s=L.from(i.node(a).copy(s));let d=r&&r[c];o=L.from(d?d.type.create(d.attrs,o):i.node(a).copy(o))}t.step(new Xe(e,e,new J(s.append(o),n,n),!0))}function Ir(t,e){let n=t.resolve(e),r=n.index();return Ab(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Gk(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function Ab(t,e){return!!(t&&e&&!t.isLeaf&&Gk(t,e))}function bc(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&Ab(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function qk(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let d=o.whitespace=="pre",u=!!o.contentMatch.matchType(i);d&&!u?r=!1:!d&&u&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Tb(t,d.node(),d.before(),a)}o.inlineContent&&If(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Xe(c,l.map(e+n,-1),J.empty,!0)),r===!0){let d=t.doc.resolve(c);Nb(t,d.node(),d.before(),t.steps.length)}return t}function Yk(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 s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function Mb(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),c=r.node(o),d=!1;if(s==1)d=c.canReplace(l,l,i);else{let u=c.contentMatchAt(l).findWrapping(i.firstChild.type);d=u&&c.canReplaceWith(l,l,u[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function vc(t,e,n=e,r=J.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return Ob(i,s,r)?new Xe(e,n,r):new Jk(i,s,r).fit()}function Ob(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Jk{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=L.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=L.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 s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new J(s,o,a);return e>-1?new rt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Xe(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=md(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,u=null;if(n==1&&(o?c.matchType(o.type)||(u=c.fillBefore(L.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:u};if(n==2&&o&&(d=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:d};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=md(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new J(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=md(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new J($s(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new J($s(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,c=0,d=[],{match:u,type:f}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)d.push(i.child(g));u=u.matchFragment(i)}let h=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let g=a.child(c),y=u.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(u=y,d.push(Rb(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let m=c==a.childCount;m||(h=-1),this.placed=js(this.placed,n,L.from(d)),this.frontier[n].match=u,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<h;g++){let b=y.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),y=b.content}this.unplaced=m?e==0?J.empty:new J($s(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new J($s(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!gd(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],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=gd(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=gd(e,a,c,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:s?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=js(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=js(this.placed,this.depth,L.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(L.empty,!0);n.childCount&&(this.placed=js(this.placed,this.frontier.length,n))}}function $s(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy($s(t.firstChild.content,e-1,n)))}function js(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(js(t.lastChild.content,e-1,n)))}function md(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Rb(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Rb(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(L.empty,!0)))),t.copy(r)}function gd(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!Xk(n,s.content,o)?a:null}function Xk(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Zk(t){return t.spec.defining||t.spec.definingForContent}function Qk(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(Ob(i,s,r))return t.step(new Xe(e,n,r));let o=Db(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let f=i.depth,h=i.pos-1;f>0;f--,h--){let m=i.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(f)>-1?a=f:i.before(f)==h&&o.splice(1,0,-f)}let l=o.indexOf(a),c=[],d=r.openStart;for(let f=r.content,h=0;;h++){let m=f.firstChild;if(c.push(m),h==r.openStart)break;f=m.content}for(let f=d-1;f>=0;f--){let h=c[f],m=Zk(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(a)-1)))d=f;else if(m||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+d+1)%(r.openStart+1),m=c[h];if(m)for(let g=0;g<o.length;g++){let y=o[(g+l)%o.length],b=!0;y<0&&(b=!1,y=-y);let w=i.node(y-1),E=i.index(y-1);if(w.canReplaceWith(E,E,m.type,m.marks))return t.replace(i.before(y),b?s.after(y):n,new J(Ib(r.content,0,r.openStart,h),h,r.openEnd))}}let u=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>u));f--){let h=o[f];h<0||(e=i.before(h),n=s.after(h))}}function Ib(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Ib(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(L.empty,!0))}return t}function eS(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Yk(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new J(L.from(r),0,0))}function tS(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>o;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=t.doc.resolve(e),i=t.doc.resolve(n)}}let s=Db(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function Db(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<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;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class zi extends wt{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 Ze.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ze.fromReplace(e,this.pos,this.pos+1,new J(L.from(i),0,n.isLeaf?0:1))}getMap(){return jt.empty}invert(e){return new zi(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 zi(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 zi(n.pos,n.attr,n.value)}}wt.jsonID("attr",zi);class uo extends wt{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 Ze.ok(r)}getMap(){return jt.empty}invert(e){return new uo(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 uo(n.attr,n.value)}}wt.jsonID("docAttr",uo);let Ji=class extends Error{};Ji=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ji.prototype=Object.create(Error.prototype);Ji.prototype.constructor=Ji;Ji.prototype.name="TransformError";class Lb{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new co}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ji(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}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}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=J.empty){let i=vc(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new J(L.from(r),0,0))}delete(e,n){return this.replace(e,n,J.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Qk(this,e,n,r),this}replaceRangeWith(e,n,r){return eS(this,e,n,r),this}deleteRange(e,n){return tS(this,e,n),this}lift(e,n){return jk(this,e,n),this}join(e,n=1){return qk(this,e,n),this}wrap(e,n){return zk(this,e,n),this}setBlockType(e,n=e,r,i=null){return Uk(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Kk(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new zi(e,n,r)),this}setDocAttribute(e,n){return this.step(new uo(e,n)),this}addNodeMark(e,n){return this.step(new br(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof Pe)n.isInSet(r.marks)&&this.step(new li(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new li(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return Wk(this,e,n,r),this}addMark(e,n,r){return Pk(this,e,n,r),this}removeMark(e,n,r){return Bk(this,e,n,r),this}clearIncompatible(e,n,r){return If(this,e,n,r),this}}const yd=Object.create(null);class ge{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Pb(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=J.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],d=e.mapping.slice(s);e.replaceRange(d.map(l.pos),d.map(c.pos),a?J.empty:n),a==0&&Pp(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),c=l.map(o.pos),d=l.map(a.pos);s?e.deleteRange(c,d):(e.replaceRangeWith(c,d,n),Pp(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ue(e):Ii(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?Ii(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Ii(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ht(e.node(0))}static atStart(e){return Ii(e,e,0,0,1)||new Ht(e)}static atEnd(e){return Ii(e,e,e.content.size,e.childCount,-1)||new Ht(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yd[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 yd)throw new RangeError("Duplicate use of selection JSON ID "+e);return yd[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ue.between(this.$anchor,this.$head).getBookmark()}}ge.prototype.visible=!0;class Pb{constructor(e,n){this.$from=e,this.$to=n}}let Dp=!1;function Lp(t){!Dp&&!t.parent.inlineContent&&(Dp=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ue extends ge{constructor(e,n=e){Lp(e),Lp(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 ge.near(r);let i=e.resolve(n.map(this.anchor));return new ue(i.parent.inlineContent?i:r,r)}replace(e,n=J.empty){if(super.replace(e,n),n==J.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ue&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new xc(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 ue(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 s=ge.findFrom(n,r,!0)||ge.findFrom(n,-r,!0);if(s)n=s.$head;else return ge.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ge.findFrom(e,-r,!0)||ge.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ue(e,n)}}ge.jsonID("text",ue);class xc{constructor(e,n){this.anchor=e,this.head=n}map(e){return new xc(e.map(this.anchor),e.map(this.head))}resolve(e){return ue.between(e.resolve(this.anchor),e.resolve(this.head))}}class ce extends ge{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),s=e.resolve(i);return r?ge.near(s):new ce(s)}content(){return new J(L.from(this.node),0,0)}eq(e){return e instanceof ce&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Lf(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ce(e.resolve(n.anchor))}static create(e,n){return new ce(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ce.prototype.visible=!1;ge.jsonID("node",ce);class Lf{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new xc(r,r):new Lf(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ce.isSelectable(r)?new ce(n):ge.near(n)}}class Ht extends ge{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=J.empty){if(n==J.empty){e.delete(0,e.doc.content.size);let r=ge.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ht(e)}map(e){return new Ht(e)}eq(e){return e instanceof Ht}getBookmark(){return nS}}ge.jsonID("all",Ht);const nS={map(){return this},resolve(t){return new Ht(t)}};function Ii(t,e,n,r,i,s=!1){if(e.inlineContent)return ue.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ce.isSelectable(a))return ce.create(t,n-(i<0?a.nodeSize:0))}else{let l=Ii(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function Pp(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Xe||i instanceof rt))return;let s=t.mapping.maps[r],o;s.forEach((a,l,c,d)=>{o==null&&(o=d)}),t.setSelection(ge.near(t.doc.resolve(o),n))}const Bp=1,ca=2,$p=4;let rS=class extends Lb{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|Bp)&~ca,this.storedMarks=null,this}get selectionSet(){return(this.updated&Bp)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ca,this}ensureMarks(e){return Pe.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&ca)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ca,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)||Pe.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),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ge.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|=$p,this}get scrolledIntoView(){return(this.updated&$p)>0}};function jp(t,e){return!e||!t?t:t.bind(e)}class Fs{constructor(e,n,r){this.name=e,this.init=jp(n.init,r),this.apply=jp(n.apply,r)}}const iS=[new Fs("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Fs("selection",{init(t,e){return t.selection||ge.atStart(e.doc)},apply(t){return t.selection}}),new Fs("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Fs("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class bd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=iS.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 Fs(r.key,r.spec.state,r))})}}class Fi{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 s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,c=i?i[o].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let u=0;u<this.config.plugins.length;u++)i.push(u<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Fi(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new rS(this)}static create(e){let n=new bd(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Fi(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 bd(this.schema,e.plugins),r=n.fields,i=new Fi(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let 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],s=i.spec.state;s&&s.toJSON&&(n[r]=s.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 bd(e.schema,e.plugins),s=new Fi(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=kr.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=ge.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=c.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function Bb(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Bb(i,e,{})),n[r]=i}return n}class $e{constructor(e){this.spec=e,this.props={},e.props&&Bb(e.props,this,this.props),this.key=e.key?e.key.key:$b("plugin")}getState(e){return e[this.key]}}const vd=Object.create(null);function $b(t){return t in vd?t+"$"+ ++vd[t]:(vd[t]=0,t+"$")}class Be{constructor(e="key"){this.key=$b(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ut=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Xi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Mu=null;const Un=function(t,e,n){let r=Mu||(Mu=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},sS=function(){Mu=null},ci=function(t,e,n,r){return n&&(Fp(t,e,n,r,-1)||Fp(t,e,n,r,1))},oS=/^(img|br|input|textarea|hr)$/i;function Fp(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Xt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Vo(t)||oS.test(t.nodeName)||t.contentEditable=="false")return!1;e=ut(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?Xt(t):0}else return!1}}function Xt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aS(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=Xt(t)}else if(t.parentNode&&!Vo(t))e=ut(t),t=t.parentNode;else return null}}function lS(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&&!Vo(t))e=ut(t)+1,t=t.parentNode;else return null}}function cS(t,e,n){for(let r=e==0,i=e==Xt(t);r||i;){if(t==n)return!0;let s=ut(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Xt(t)}}function Vo(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 wc=function(t){return t.focusNode&&ci(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Gr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function dS(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function uS(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Xt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Xt(r.startContainer),r.startOffset)}}}const An=typeof navigator<"u"?navigator:null,Hp=typeof document<"u"?document:null,Dr=An&&An.userAgent||"",Ou=/Edge\/(\d+)/.exec(Dr),jb=/MSIE \d/.exec(Dr),Ru=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Dr),It=!!(jb||Ru||Ou),Sr=jb?document.documentMode:Ru?+Ru[1]:Ou?+Ou[1]:0,Zt=!It&&/gecko\/(\d+)/i.test(Dr);Zt&&+(/Firefox\/(\d+)/.exec(Dr)||[0,0])[1];const Iu=!It&&/Chrome\/(\d+)/.exec(Dr),ht=!!Iu,Fb=Iu?+Iu[1]:0,vt=!It&&!!An&&/Apple Computer/.test(An.vendor),Zi=vt&&(/Mobile\/\w+/.test(Dr)||!!An&&An.maxTouchPoints>2),Jt=Zi||(An?/Mac/.test(An.platform):!1),Hb=An?/Win/.test(An.platform):!1,Kn=/Android \d/.test(Dr),Ko=!!Hp&&"webkitFontSmoothing"in Hp.documentElement.style,fS=Ko?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function hS(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 Bn(t,e){return typeof t=="number"?t:t[e]}function pS(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 zp(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=Xi(o);continue}let a=o,l=a==s.body,c=l?hS(s):pS(a),d=0,u=0;if(e.top<c.top+Bn(r,"top")?u=-(c.top-e.top+Bn(i,"top")):e.bottom>c.bottom-Bn(r,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+Bn(i,"top")-c.top:e.bottom-c.bottom+Bn(i,"bottom")),e.left<c.left+Bn(r,"left")?d=-(c.left-e.left+Bn(i,"left")):e.right>c.right-Bn(r,"right")&&(d=e.right-c.right+Bn(i,"right")),d||u)if(l)s.defaultView.scrollBy(d,u);else{let h=a.scrollLeft,m=a.scrollTop;u&&(a.scrollTop+=u),d&&(a.scrollLeft+=d);let g=a.scrollLeft-h,y=a.scrollTop-m;e={left:e.left-g,top:e.top-y,right:e.right-g,bottom:e.bottom-y}}let f=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:Xi(o)}}function mS(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:zb(t.dom)}}function zb(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Xi(r));return e}function gS({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Ub(n,r==0?0:r-e)}function Ub(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Si=null;function yS(t){if(t.setActive)return t.setActive();if(Si)return t.focus(Si);let e=zb(t);t.focus(Si==null?{get preventScroll(){return Si={preventScroll:!0},!0}}:void 0),Si||(Si=!1,Ub(e,0))}function Vb(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,c;for(let d=t.firstChild,u=0;d;d=d.nextSibling,u++){let f;if(d.nodeType==1)f=d.getClientRects();else if(d.nodeType==3)f=Un(d).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=o&&m.bottom>=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=d,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,d.nodeType==1&&g&&(s=u+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=d,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(s=u+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?bS(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:Vb(n,i)}function bS(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let o=lr(r,1);if(o.top!=o.bottom&&Pf(e,o)){i={node:t,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function Pf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function vS(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function xS(t,e,n){let{node:r,offset:i}=Vb(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function wS(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Kb(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)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Pf(e,c))return Kb(o,e,c)}}if((s=(s+1)%r)==i)break}return t}function ES(t,e){let n=t.dom.ownerDocument,r,i=0,s=uS(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!Pf(e,c)||(o=Kb(t.dom,e,c),!o))return null}if(vt)for(let c=o;r&&c;c=Xi(c))c.draggable&&(r=void 0);if(o=vS(o,e),r){if(Zt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],u;d.nodeName=="IMG"&&(u=d.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?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=wS(t,r,i,e))}a==null&&(a=xS(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Up(t){return t.top<t.bottom||t.left<t.right}function lr(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Up(r))return r}return Array.prototype.find.call(n,Up)||t.getBoundingClientRect()}const kS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Wb(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Ko||Zt;if(r.nodeType==3)if(o&&(kS.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=lr(Un(r,i,i),n);if(Zt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=lr(Un(r,i-1,i-1),-1);if(c.top==l.top){let d=lr(Un(r,i,i+1),-1);if(d.top!=l.top)return Is(d,d.left<c.left)}}return l}else{let l=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:c++,Is(lr(Un(r,l,c),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Xt(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return xd(l.getBoundingClientRect(),!1)}if(s==null&&i<Xt(r)){let l=r.childNodes[i];if(l.nodeType==1)return xd(l.getBoundingClientRect(),!0)}return xd(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Xt(r))){let l=r.childNodes[i-1],c=l.nodeType==3?Un(l,Xt(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Is(lr(c,1),!1)}if(s==null&&i<Xt(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Un(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return Is(lr(c,-1),!0)}return Is(lr(r.nodeType==3?Un(r):r,-n),n>=0)}function Is(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 xd(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 Gb(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 SS(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Gb(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=Wb(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Un(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const CS=/[\u0590-\u08ac]/;function _S(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!CS.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:Gb(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:u}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!h.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{a.collapse(d,u),l&&(l!=d||c!=u)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let Vp=null,Kp=null,Wp=!1;function NS(t,e,n){return Vp==e&&Kp==n?Wp:(Vp=e,Kp=n,Wp=n=="up"||n=="down"?SS(t,e,n):_S(t,e,n))}const Qt=0,Gp=1,Yr=2,Mn=3;class Wo{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Qt,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 s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>ut(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 s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let 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 s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof Yb){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof qb&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?ut(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?ut(s.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,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],c=o+l.size;if(i==-1&&e<=c){let d=o+l.border;if(e>=d&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let u=a;u>0;u--){let f=this.children[u-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=ut(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let d=a+1;d<this.children.length;d++){let u=this.children[d];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){s=ut(u.dom);break}n+=u.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}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 s=Math.min(e,n),o=Math.max(e,n);for(let h=0,m=0;h<this.children.length;h++){let g=this.children[h],y=m+g.size;if(s>m&&o<y)return g.setSelection(e-m-g.border,n-m-g.border,r,i);m=y}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),u=!1;if((Zt||vt)&&e==n){let{node:h,offset:m}=a;if(h.nodeType==3){if(u=!!(m&&h.nodeValue[m-1]==`
|
|
6
|
+
`),u&&m==h.nodeValue.length)for(let g=h,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:ut(y)+1});break}let b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=h.childNodes[m-1];u=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Zt&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||u&&vt)&&ci(a.node,a.offset,d.anchorNode,d.anchorOffset)&&ci(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(u&&Zt)){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let m=a;a=l,l=m}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Yr:Gp,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Mn:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Yr:Mn}r=o}this.dirty=Yr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Yr:Gp;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class qb extends Wo{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Qt&&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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class TS extends Wo{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 di extends Wo{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=pi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new di(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Mn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Mn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Qt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Qt}}slice(e,n,r){let i=di.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=Lu(s,n,o,r)),e>0&&(s=Lu(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Cr extends Wo{constructor(e,n,r,i,s,o,a,l,c){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,c=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=pi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=Zb(d,r,n),c?l=new AS(e,n,r,i,d,u||null,f,c,s,o+1):n.isText?new Ec(e,n,r,i,d,f,s):new Cr(e,n,r,i,d,u||null,f,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let 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=()=>L.empty)}return e}matchesNode(e,n,r){return this.dirty==Qt&&e.eq(this.node)&&ul(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,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new OS(this,o&&o.node,e);DS(this.node,this.innerDeco,(c,d,u)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e,d):c.type.side>=0&&!u&&l.syncToMarks(d==this.node.childCount?Pe.none:this.node.child(d).marks,r,e,d),l.placeWidget(c,e,i)},(c,d,u,f)=>{l.syncToMarks(c.marks,r,e,f);let h;l.findNodeMatch(c,d,u,f)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(h=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,d,u,h,e)||l.updateNextNode(c,d,u,e,f,i)||l.addNode(c,d,u,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Yr)&&(o&&this.protectLocalComposition(e,o),Jb(this.contentDOM,this.children,e),Zi&&LS(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ue)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=PS(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new TS(this,s,n,i);e.input.compositionNodes.push(o),this.children=Lu(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==Mn||!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=Qt}updateOuterDeco(e){if(ul(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Xb(this.dom,this.nodeDOM,Du(this.outerDeco,this.node,n),Du(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.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function qp(t,e,n,r,i){Zb(r,e,t);let s=new Cr(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Ec extends Cr{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Mn||this.dirty!=Qt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Qt||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=Qt,!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),s=document.createTextNode(i.text);return new Ec(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Mn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Yb extends Wo{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Qt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class AS extends Cr{constructor(e,n,r,i,s,o,a,l,c,d){super(e,n,r,i,s,o,a,c,d),this.spec=l}update(e,n,r,i){if(this.dirty==Mn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}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.root):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 Jb(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=Yp(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof di){let l=r?r.previousSibling:t.lastChild;Jb(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Yp(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Ws=function(t){t&&(this.nodeName=t)};Ws.prototype=Object.create(null);const Jr=[new Ws];function Du(t,e,n){if(t.length==0)return Jr;let r=n?Jr[0]:new Ws,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Ws(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Ws(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function Xb(t,e,n,r){if(n==Jr&&r==Jr)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Jr[0]),i=l}MS(i,a||Jr[0],o)}return i}function MS(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 s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);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 Zb(t,e,n){return Xb(t,t,Jr,Du(e,n,t.nodeType!=1))}function ul(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 Yp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class OS{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=RS(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,i){let s=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=Qt,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,c=this.top.children.length;i<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let d=this.index;d<c;d++){let u=this.top.children[d];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){l=d;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=di.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==Mn&&o.dom==o.contentDOM&&(o.dirty=Yr),o.update(e,n,r,s)?(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,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Cr){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let d=l.dom,u,f=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Mn&&ul(n,l.outerDeco));if(!f&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!f&&(u=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Yr,u.updateChildren(i,o+1),u.dirty=Qt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!ul(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Cr.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=Cr.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),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 s=new qb(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof di;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ec)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((vt||ht)&&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 Yb(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 RS(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof di)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function IS(t,e){return t.type.side-e.type.side}function DS(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,i,e.forChild(s,d),c),s+=d.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let d,u;for(;o<i.length&&i[o].to==s;){let y=i[o++];y.widget&&(d?(u||(u=[d])).push(y):d=y)}if(d)if(u){u.sort(IS);for(let y=0;y<u.length;y++)n(u[y],c,!!l)}else n(d,c,!!l);let f,h;if(l)h=-1,f=l,l=null;else if(c<t.childCount)h=c,f=t.child(c++);else break;for(let y=0;y<a.length;y++)a[y].to<=s&&a.splice(y--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let m=s+f.nodeSize;if(f.isText){let y=m;o<i.length&&i[o].from<y&&(y=i[o].from);for(let b=0;b<a.length;b++)a[b].to<y&&(y=a[b].to);y<m&&(l=f.cut(y-s),f=f.cut(0,y-s),m=y,h=-1)}else for(;o<i.length&&i[o].to<m;)o++;let g=f.isInline&&!f.isLeaf?a.filter(y=>!y.inline):a.slice();r(f,g,e.forChild(s,f),h),s=m}}function LS(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 PS(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let c=t.child(i++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Lu(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],c=a,d=a+=l.size;c>=n||d<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,r)),i&&(s.push(i),i=void 0),d>n&&s.push(l.slice(n-c,l.size,r)))}return s}function Bf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(wc(n)){for(l=o;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&ce.isSelectable(u)&&i.parent&&!(u.isInline&&cS(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new ce(o==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let u=o,f=o;for(let h=0;h<n.rangeCount;h++){let m=n.getRangeAt(h);u=Math.min(u,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(u<0)return null;[l,o]=f==t.state.selection.anchor?[f,u]:[u,f],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;c=$f(t,d,a,u)}return c}function Qb(t){return t.editable?t.hasFocus():t0(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Yn(t,e=!1){let n=t.state.selection;if(e0(t,n),!!Qb(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ht){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ci(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)$S(t);else{let{anchor:r,head:i}=n,s,o;Jp&&!(n instanceof ue)&&(n.$from.parent.inlineContent||(s=Xp(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Xp(t,n.to))),t.docView.setSelection(r,i,t,e),Jp&&(s&&Zp(s),o&&Zp(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&BS(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Jp=vt||ht&&Fb<63;function Xp(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(vt&&i&&i.contentEditable=="false")return wd(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return wd(i);if(s)return wd(s)}}function wd(t){return t.contentEditable="true",vt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Zp(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function BS(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(()=>{(!Qb(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function $S(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,ut(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&It&&Sr<=11&&(n.disabled=!0,n.disabled=!1)}function e0(t,e){if(e instanceof ce){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Qp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Qp(t)}function Qp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function $f(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ue.between(e,n,r)}function em(t){return t.editable&&!t.hasFocus()?!1:t0(t)}function t0(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 jS(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ci(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Pu(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ge.findFrom(s,e)}function ur(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function tm(t,e,n){let r=t.state.selection;if(r instanceof ue)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return ur(t,new ue(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Pu(t.state,e);return i&&i instanceof ce?ur(t,i):!1}else if(!(Jt&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?ce.isSelectable(s)?ur(t,new ce(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Ko?ur(t,new ue(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ce&&r.node.isInline)return ur(t,new ue(e>0?r.$to:r.$from));{let i=Pu(t.state,e);return i?ur(t,i):!1}}}function fl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Gs(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ci(t,e){return e<0?FS(t):HS(t)}function FS(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(Zt&&n.nodeType==1&&r<fl(n)&&Gs(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Gs(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(n0(n))break;{let a=n.previousSibling;for(;a&&Gs(a,-1);)i=n.parentNode,s=ut(a),a=a.previousSibling;if(a)n=a,r=fl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Bu(t,n,r):i&&Bu(t,i,s)}function HS(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=fl(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Gs(a,1))s=n,o=++r;else break}else{if(n0(n))break;{let a=n.nextSibling;for(;a&&Gs(a,1);)s=a.parentNode,o=ut(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=fl(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&Bu(t,s,o)}function n0(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function zS(t,e){for(;t&&e==t.childNodes.length&&!Vo(t);)e=ut(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 US(t,e){for(;t&&!e&&!Vo(t);)e=ut(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 Bu(t,e,n){if(e.nodeType!=3){let s,o;(o=zS(e,n))?(e=o,n=0):(s=US(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(wc(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Yn(t)},50)}function nm(t,e){let n=t.state.doc.resolve(e);if(!(ht||Hb)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function rm(t,e,n){let r=t.state.selection;if(r instanceof ue&&!r.empty||n.indexOf("s")>-1||Jt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Pu(t.state,e);if(o&&o instanceof ce)return ur(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Ht?ge.near(o,e):ge.findFrom(o,e);return a?ur(t,a):!1}return!1}function im(t,e){if(!(t.state.selection instanceof ue))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 s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function sm(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function VS(t){if(!vt||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;sm(t,r,"true"),setTimeout(()=>sm(t,r,"false"),20)}return!1}function KS(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function WS(t,e){let n=e.keyCode,r=KS(e);if(n==8||Jt&&n==72&&r=="c")return im(t,-1)||Ci(t,-1);if(n==46&&!e.shiftKey||Jt&&n==68&&r=="c")return im(t,1)||Ci(t,1);if(n==13||n==27)return!0;if(n==37||Jt&&n==66&&r=="c"){let i=n==37?nm(t,t.state.selection.from)=="ltr"?-1:1:-1;return tm(t,i,r)||Ci(t,i)}else if(n==39||Jt&&n==70&&r=="c"){let i=n==39?nm(t,t.state.selection.from)=="ltr"?1:-1:1;return tm(t,i,r)||Ci(t,i)}else{if(n==38||Jt&&n==80&&r=="c")return rm(t,-1,r)||Ci(t,-1);if(n==40||Jt&&n==78&&r=="c")return VS(t)||rm(t,1,r)||Ci(t,1);if(r==(Jt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function jf(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=t.someProp("clipboardSerializer")||pi.fromSchema(t.state.schema),a=l0(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,d,u=0;for(;c&&c.nodeType==1&&(d=a0[c.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let m=a.createElement(d[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),u++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${u?` -${u}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
|
|
7
|
+
|
|
8
|
+
`);return{dom:l,text:f,slice:e}}function r0(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,s||r,t)}),s)return a=new J(L.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
9
|
+
`))),0,0),t.someProp("transformPasted",f=>{a=f(a,t,!0)}),a;let u=t.someProp("clipboardTextParser",f=>f(e,i,r,t));if(u)a=u;else{let f=i.marks(),{schema:h}=t.state,m=pi.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=o.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(h.text(g,f)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),o=JS(n),Ko&&XS(o);let c=o&&o.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Vs.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!GS.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)a=ZS(om(a,+d[1],+d[2]),d[4]);else if(a=J.maxOpen(qS(a.content,i),!0),a.openStart||a.openEnd){let u=0,f=0;for(let h=a.content.firstChild;u<a.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=om(a,u,f)}return t.someProp("transformPasted",u=>{a=u(a,t,l)}),a}const GS=/^(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 qS(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)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&s.length&&s0(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=o0(o[o.length-1],s.length));let d=i0(a,l);o.push(d),i=i.matchType(d.type),s=l}}),o)return L.from(o)}return t}function i0(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,L.from(t));return t}function s0(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=s0(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(L.from(i0(n,t,i+1))))}}function o0(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,o0(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(L.empty,!0);return t.copy(n.append(r))}function $u(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=$u(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(L.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function om(t,e,n){return e<t.openStart&&(t=new J($u(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new J($u(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const a0={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 am=null;function l0(){return am||(am=document.implementation.createHTMLDocument("title"))}let Ed=null;function YS(t){let e=window.trustedTypes;return e?(Ed||(Ed=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Ed.createHTML(t)):t}function JS(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=l0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&a0[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=YS(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function XS(t){let e=t.querySelectorAll(ht?"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 ZS(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:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=L.from(l.create(r[a+1],i)),s++,o++}return new J(i,s,o)}const Ct={},_t={},QS={touchstart:!0,touchmove:!0};class eC{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function tC(t){for(let e in Ct){let n=Ct[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{rC(t,r)&&!Ff(t,r)&&(t.editable||!(r.type in _t))&&n(t,r)},QS[e]?{passive:!0}:void 0)}vt&&t.dom.addEventListener("input",()=>null),ju(t)}function vr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function nC(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 ju(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ff(t,r))})}function Ff(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function rC(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 iC(t,e){!Ff(t,e)&&Ct[e.type]&&(t.editable||!(e.type in _t))&&Ct[e.type](t,e)}_t.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!d0(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Kn&&ht&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Zi&&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,Gr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||WS(t,n)?n.preventDefault():vr(t,"key")};_t.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};_t.keypress=(t,e)=>{let n=e;if(d0(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Jt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ue)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function kc(t){return{left:t.clientX,top:t.clientY}}function sC(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Hf(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function Ui(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 oC(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ce.isSelectable(r)?(Ui(t,new ce(n)),!0):!1}function aC(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ce&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ce.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(Ui(t,ce.create(t.state.doc,i)),!0):!1}function lC(t,e,n,r,i){return Hf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?aC(t,n):oC(t,n))}function cC(t,e,n,r){return Hf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function dC(t,e,n,r){return Hf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||uC(t,n,r)}function uC(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ui(t,ue.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)Ui(t,ue.create(r,a+1,a+1+o.content.size));else if(ce.isSelectable(o))Ui(t,ce.create(r,a));else continue;return!0}}function zf(t){return hl(t)}const c0=Jt?"metaKey":"ctrlKey";Ct.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=zf(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&sC(n,t.input.lastClick)&&!n[c0]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let o=t.posAtCoords(kc(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new fC(t,o,n,!!r)):(s=="doubleClick"?cC:dC)(t,o.pos,o.inside,n)?n.preventDefault():vr(t,"pointer"))};class fC{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[c0],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);s=d.parent,o=d.depth?d.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof ce&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Zt&&!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)),vr(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(()=>Yn(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(kc(e))),this.updateAllowDefault(e),this.allowDefault||!n?vr(this.view,"pointer"):lC(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||vt&&this.mightDrag&&!this.mightDrag.node.isAtom||ht&&!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)?(Ui(this.view,ge.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):vr(this.view,"pointer")}move(e){this.updateAllowDefault(e),vr(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)}}Ct.touchstart=t=>{t.input.lastTouch=Date.now(),zf(t),vr(t,"pointer")};Ct.touchmove=t=>{t.input.lastTouch=Date.now(),vr(t,"pointer")};Ct.contextmenu=t=>zf(t);function d0(t,e){return t.composing?!0:vt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const hC=Kn?5e3:-1;_t.compositionstart=_t.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ue&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||ht&&Hb&&pC(t)))t.markCursor=t.state.storedMarks||n.marks(),hl(t,!0),t.markCursor=null;else if(hl(t,!e.selection.empty),Zt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}u0(t,hC)};function pC(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}_t.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.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,u0(t,20))};function u0(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>hl(t),e))}function f0(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=gC());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function mC(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=aS(e.focusNode,e.focusOffset),r=lS(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function gC(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function hl(t,e=!1){if(!(Kn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),f0(t),e||t.docView&&t.docView.dirty){let n=Bf(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function yC(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 fo=It&&Sr<15||Zi&&fS<604;Ct.copy=_t.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=fo?null:n.clipboardData,o=r.content(),{dom:a,text:l}=jf(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):yC(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function bC(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function vC(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?ho(t,r.value,null,i,e):ho(t,r.textContent,r.innerHTML,i,e)},50)}function ho(t,e,n,r,i){let s=r0(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||J.empty)))return!0;if(!s)return!1;let o=bC(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function h0(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," "):""}_t.paste=(t,e)=>{let n=e;if(t.composing&&!Kn)return;let r=fo?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ho(t,h0(r),r.getData("text/html"),i,n)?n.preventDefault():vC(t,n)};class p0{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const xC=Jt?"altKey":"ctrlKey";function m0(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[xC]}Ct.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(kc(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ce?i.to-1:i.to))){if(r&&r.mightDrag)o=ce.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&&(o=ce.create(t.state.doc,u.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:d}=jf(t,a);(!n.dataTransfer.files.length||!ht||Fb>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(fo?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",fo||n.dataTransfer.setData("text/plain",c),t.dragging=new p0(d,m0(t,n),o)};Ct.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};_t.dragover=_t.dragenter=(t,e)=>e.preventDefault();_t.drop=(t,e)=>{try{wC(t,e,t.dragging)}finally{t.dragging=null}};function wC(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(kc(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",h=>{s=h(s,t,!1)}):s=r0(t,h0(e.dataTransfer),fo?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&m0(t,e));if(t.someProp("handleDrop",h=>h(t,e,s||J.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?Mb(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=t.state.tr;if(o){let{node:h}=n;h?h.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,u=l.doc;if(d?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(u))return;let f=l.doc.resolve(c);if(d&&ce.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new ce(f));else{let h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,g,y,b)=>h=b),l.setSelection($f(t,f,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}Ct.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())&&Yn(t)},20))};Ct.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)};Ct.beforeinput=(t,e)=>{if(ht&&Kn&&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",s=>s(t,Gr(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 _t)Ct[t]=_t[t];function po(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 pl{constructor(e,n){this.toDOM=e,this.spec=n||ei,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new pt(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof pl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&po(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class _r{constructor(e,n){this.attrs=e,this.spec=n||ei}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new pt(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof _r&&po(this.attrs,e.attrs)&&po(this.spec,e.spec)}static is(e){return e.type instanceof _r}destroy(){}}class Uf{constructor(e,n){this.attrs=e,this.spec=n||ei}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new pt(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof Uf&&po(this.attrs,e.attrs)&&po(this.spec,e.spec)}destroy(){}}class pt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new pt(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 pt(e,e,new pl(n,r))}static inline(e,n,r,i){return new pt(e,n,new _r(r,i))}static node(e,n,r,i){return new pt(e,n,new Uf(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof _r}get widget(){return this.type instanceof pl}}const Di=[],ei={};class ze{constructor(e,n){this.local=e.length?e:Di,this.children=n.length?n:Di}static create(e,n){return n.length?ml(n,e,0,ei):yt}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==yt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ei)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?EC(this.children,o||[],e,n,r,i,s):o?new ze(o.sort(ti),Di):yt}add(e,n){return n.length?this==yt?ze.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let c=l+r,d;if(d=y0(n,a,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,d,c+1):i.splice(s,0,l,l+a.nodeSize,ml(d,a,c+1,ei)),s+=3}});let o=g0(s?b0(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new ze(o.length?this.local.concat(o).sort(ti):this.local,i||this.children)}remove(e){return e.length==0||this==yt?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let d=0,u;d<e.length;d++)(u=e[d])&&u.from>a&&u.to<l&&(e[d]=null,(o||(o=[])).push(u));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(o,a+1);c!=yt?r[s+2]=c:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ze(i,r):yt}forChild(e,n){if(this==yt)return this;if(n.isLeaf)return ze.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof _r){let c=Math.max(s,l.from)-s,d=Math.min(o,l.to)-s;c<d&&(i||(i=[])).push(l.copy(c,d))}}if(i){let a=new ze(i.sort(ti),Di);return r?new pr([a,r]):a}return r||yt}eq(e){if(this==e)return!0;if(!(e instanceof ze)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Vf(this.localsInner(e))}localsInner(e){if(this==yt)return Di;if(e.inlineContent||!this.local.some(_r.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof _r||n.push(this.local[r]);return n}forEachSet(e){e(this)}}ze.empty=new ze([],[]);ze.removeOverlap=Vf;const yt=ze.empty;class pr{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,ei));return pr.from(r)}forChild(e,n){if(n.isLeaf)return ze.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=yt&&(s instanceof pr?r=r.concat(s.members):r.push(s))}return pr.from(r)}eq(e){if(!(e instanceof pr)||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 s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?Vf(r?n:n.sort(ti)):Di}static from(e){switch(e.length){case 0:return yt;case 1:return e[0];default:return new pr(e.every(n=>n instanceof ze)?e:e.reduce((n,r)=>n.concat(r instanceof ze?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function EC(t,e,n,r,i,s,o){let a=t.slice();for(let c=0,d=s;c<n.maps.length;c++){let u=0;n.maps[c].forEach((f,h,m,g)=>{let y=g-m-(h-f);for(let b=0;b<a.length;b+=3){let w=a[b+1];if(w<0||f>w+d-u)continue;let E=a[b]+d-u;h>=E?a[b+1]=f<=E?-2:-1:f>=d&&y&&(a[b]+=y,a[b+1]+=y)}u+=y}),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=n.map(t[c]+s),u=d-i;if(u<0||u>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+s,-1),h=f-i,{index:m,offset:g}=r.content.findIndex(u),y=r.maybeChild(m);if(y&&g==u&&g+y.nodeSize==h){let b=a[c+2].mapInner(n,y,d+1,t[c]+s+1,o);b!=yt?(a[c]=u,a[c+1]=h,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=kC(a,t,e,n,i,s,o),d=ml(c,r,0,o);e=d.local;for(let u=0;u<a.length;u+=3)a[u+1]<0&&(a.splice(u,3),u-=3);for(let u=0,f=0;u<d.children.length;u+=3){let h=d.children[u];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,d.children[u],d.children[u+1],d.children[u+2])}}return new ze(e.sort(ti),a)}function g0(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 pt(i.from+e,i.to+e,i.type))}return n}function kC(t,e,n,r,i,s,o){function a(l,c){for(let d=0;d<l.local.length;d++){let u=l.local[d].map(r,i,c);u?n.push(u):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function y0(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function b0(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ml(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let c=y0(t,a,l+n);if(c){s=!0;let d=ml(c,a,n+l+1,r);d!=yt&&i.push(l,l+a.nodeSize,d)}});let o=g0(s?b0(t):t,-n).sort(ti);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new ze(o,i):yt}function ti(t,e){return t.from-e.from||t.to-e.to}function Vf(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),lm(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),lm(e,i,r.copy(s.from,r.to)));break}}}return e}function lm(t,e,n){for(;e<t.length&&ti(n,t[e])>0;)e++;t.splice(e,0,n)}function kd(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=yt&&e.push(r)}),t.cursorWrapper&&e.push(ze.create(t.state.doc,[t.cursorWrapper.deco])),pr.from(e)}const SC={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},CC=It&&Sr<=11;class _C{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 NC{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new _C,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]);It&&Sr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():vt&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),CC&&(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,SC)),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(em(this.view)){if(this.suppressingSelectionUpdates)return Yn(this.view);if(It&&Sr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ci(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 s=e.focusNode;s;s=Xi(s))n.add(s);for(let s=e.anchorNode;s;s=Xi(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}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)&&em(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let u=this.registerMutation(n[d],l);u&&(s=s<0?u.from:Math.min(u.from,s),o=o<0?u.to:Math.max(u.to,o),u.typeOver&&(a=!0))}if(l.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let u=d.nextSibling;for(;u&&u.nodeType==1;){if(u.contentEditable=="false"){d.parentNode.removeChild(d);break}u=u.firstChild}}}else if(Zt&&l.length){let d=l.filter(u=>u.nodeName=="BR");if(d.length==2){let[u,f]=d;u.parentNode&&u.parentNode.parentNode==f.parentNode?f.remove():u.remove()}else{let{focusNode:u}=this.currentSelection;for(let f of d){let h=f.parentNode;h&&h.nodeName=="LI"&&(!u||MC(e,u)!=h)&&f.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&wc(r)&&(c=Bf(e))&&c.eq(ge.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Yn(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),TC(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,OC(e,l)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Yn(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 d=0;d<e.addedNodes.length;d++){let u=e.addedNodes[d];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,s=e.nextSibling;if(It&&Sr<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:u,nextSibling:f}=e.addedNodes[d];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let o=i&&i.parentNode==e.target?ut(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?ut(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,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 cm=new WeakMap,dm=!1;function TC(t){if(!cm.has(t)&&(cm.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Zt,dm)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."),dm=!0}}function um(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return ci(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function AC(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return um(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?um(t,n):null}function MC(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 OC(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function RC(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],wc(l)||c.push({node:l.focusNode,offset:l.focusOffset})),ht&&t.input.lastKeyCode===8)for(let y=s;y>i;y--){let b=r.childNodes[y-1],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){s=y;break}if(!w||w.size)break}let u=t.state.doc,f=t.someProp("domParser")||Vs.fromSchema(t.state.schema),h=u.resolve(o),m=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:IC,context:h});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),m={anchor:y+o,head:b+o}}return{doc:g,sel:m,from:o,to:a}}function IC(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(vt&&/^(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||vt&&/^(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 DC=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function LC(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,T=Bf(t,C);if(T&&!t.state.selection.eq(T)){if(ht&&Kn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",D=>D(t,Gr(13,"Enter"))))return;let M=t.state.tr.setSelection(T);C=="pointer"?M.setMeta("pointer",!0):C=="key"&&M.scrollIntoView(),s&&M.setMeta("composition",s),t.dispatch(M)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=RC(t,e,n),d=t.state.doc,u=d.slice(c.from,c.to),f,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,h="end"):(f=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let m=$C(u.content,c.doc.content,c.from,f,h);if(m&&t.input.domChangeCount++,(Zi&&t.input.lastIOSEnter>Date.now()-225||Kn)&&i.some(C=>C.nodeType==1&&!DC.test(C.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",C=>C(t,Gr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof ue&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=fm(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let T=t.state.tr.setSelection(C);s&&T.setMeta("composition",s),t.dispatch(T)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ue&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),It&&Sr<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),y=c.doc.resolveNoCache(m.endB-c.from),b=d.resolve(m.start),w=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA;if((Zi&&t.input.lastIOSEnter>Date.now()-225&&(!w||i.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!w&&g.pos<c.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(c.doc.textBetween(g.pos,y.pos,"","")))&&t.someProp("handleKeyDown",C=>C(t,Gr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&BC(d,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",C=>C(t,Gr(8,"Backspace")))){Kn&&ht&&t.domObserver.suppressSelectionUpdates();return}ht&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),Kn&&!w&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,y=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,Gr(13,"Enter"))})},20));let E=m.start,v=m.endA,S=C=>{let T=C||t.state.tr.replace(E,v,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let M=fm(t,T.doc,c.sel);M&&!(ht&&t.composing&&M.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(M.head==E||M.head==T.mapping.map(v)-1)||It&&M.empty&&M.head==E)&&T.setSelection(M)}return s&&T.setMeta("composition",s),T.scrollIntoView()},k;if(w)if(g.pos==y.pos){It&&Sr<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Yn(t),20));let C=S(t.state.tr.delete(E,v)),T=d.resolve(m.start).marksAcross(d.resolve(m.endA));T&&C.ensureMarks(T),t.dispatch(C)}else if(m.endA==m.endB&&(k=PC(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let C=S(t.state.tr);k.type=="add"?C.addMark(E,v,k.mark):C.removeMark(E,v,k.mark),t.dispatch(C)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let C=g.parent.textBetween(g.parentOffset,y.parentOffset),T=()=>S(t.state.tr.insertText(C,E,v));t.someProp("handleTextInput",M=>M(t,E,v,C,T))||t.dispatch(T())}else t.dispatch(S());else t.dispatch(S())}function fm(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:$f(t,e.resolve(n.anchor),e.resolve(n.head))}function PC(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(L.from(c).eq(t))return{mark:a,type:o}}function BC(t,e,n,r,i){if(n-e<=i.pos-r.pos||Sd(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(Sd(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Sd(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Sd(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 s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function $C(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&hm(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&hm(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function hm(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 v0{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 eC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(bm),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=gm(this),mm(this),this.nodeViews=ym(this),this.docView=qp(this.state.doc,pm(this),kd(this),this.dom,this),this.domObserver=new NC(this,(r,i,s,o)=>LC(this,r,i,s,o)),this.domObserver.start(),tC(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&&ju(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(bm),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,s=!1,o=!1;e.storedMarks&&this.composing&&(f0(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=ym(this);FC(h,this.nodeViews)&&(this.nodeViews=h,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&ju(this),this.editable=gm(this),mm(this);let l=kd(this),c=pm(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",u=s||!this.docView.matchesNode(e.doc,c,l);(u||!e.selection.eq(i.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&mS(this);if(o){this.domObserver.stop();let h=u&&(It||ht)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&jC(i.selection,e.selection);if(u){let m=ht?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=mC(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=qp(e.doc,c,l,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&jS(this))?Yn(this,h):(e0(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),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&gS(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ce){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&zp(this,n.getBoundingClientRect(),e)}else zp(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(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new p0(e.slice,e.move,i<0?void 0:ce.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 o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(It){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&&yS(this.dom),Yn(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 ES(this,e)}coordsAtPos(e,n=1){return Wb(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 NS(this,n||this.state,e)}pasteHTML(e,n){return ho(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ho(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return jf(this,e)}destroy(){this.docView&&(nC(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],kd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,sS())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return iC(this,e)}domSelectionRange(){let e=this.domSelection();return e?vt&&this.root.nodeType===11&&dS(this.dom.ownerDocument)==this.dom&&AC(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}v0.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function pm(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"),[pt.node(0,t.state.doc.content.size,e)]}function mm(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:pt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function gm(t){return!t.someProp("editable",e=>e(t.state)===!1)}function jC(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 ym(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 FC(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 bm(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 Nr={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:"'"},gl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},HC=typeof navigator<"u"&&/Mac/.test(navigator.platform),zC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ft=0;ft<10;ft++)Nr[48+ft]=Nr[96+ft]=String(ft);for(var ft=1;ft<=24;ft++)Nr[ft+111]="F"+ft;for(var ft=65;ft<=90;ft++)Nr[ft]=String.fromCharCode(ft+32),gl[ft]=String.fromCharCode(ft);for(var Cd in Nr)gl.hasOwnProperty(Cd)||(gl[Cd]=Nr[Cd]);function UC(t){var e=HC&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||zC&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?gl:Nr)[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 VC=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),KC=typeof navigator<"u"&&/Win/.test(navigator.platform);function WC(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))VC?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function GC(t){let e=Object.create(null);for(let n in t)e[WC(n)]=t[n];return e}function _d(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 qC(t){return new $e({props:{handleKeyDown:x0(t)}})}function x0(t){let e=GC(t);return function(n,r){let i=UC(r),s,o=e[_d(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[_d(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(KC&&r.ctrlKey&&r.altKey)&&(s=Nr[r.keyCode])&&s!=i){let a=e[_d(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Kf=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function w0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const E0=(t,e,n)=>{let r=w0(t,n);if(!r)return!1;let i=Wf(r);if(!i){let o=r.blockRange(),a=o&&xs(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(O0(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Qi(s,"end")||ce.isSelectable(s)))for(let o=r.depth;;o--){let a=vc(t.doc,r.before(o),r.after(o),J.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Qi(s,"end")?ge.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ce.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},YC=(t,e,n)=>{let r=w0(t,n);if(!r)return!1;let i=Wf(r);return i?k0(t,i,e):!1},JC=(t,e,n)=>{let r=C0(t,n);if(!r)return!1;let i=Gf(r);return i?k0(t,i,e):!1};function k0(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=vc(t.doc,s,l,J.empty);if(!c||c.from!=s||c instanceof Xe&&c.slice.size>=l-s)return!1;if(n){let d=t.tr.step(c);d.setSelection(ue.create(d.doc,s)),n(d.scrollIntoView())}return!0}function Qi(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 S0=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=Wf(r)}let o=s&&s.nodeBefore;return!o||!ce.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ce.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function Wf(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 C0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const _0=(t,e,n)=>{let r=C0(t,n);if(!r)return!1;let i=Gf(r);if(!i)return!1;let s=i.nodeAfter;if(O0(t,i,e,1))return!0;if(r.parent.content.size==0&&(Qi(s,"start")||ce.isSelectable(s))){let o=vc(t.doc,r.before(),r.after(),J.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Qi(s,"start")?ge.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ce.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},N0=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Gf(r)}let o=s&&s.nodeAfter;return!o||!ce.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ce.create(t.doc,s.pos)).scrollIntoView()),!0)};function Gf(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 XC=(t,e)=>{let n=t.selection,r=n instanceof ce,i;if(r){if(n.node.isTextblock||!Ir(t.doc,n.from))return!1;i=n.from}else if(i=bc(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(ce.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},ZC=(t,e)=>{let n=t.selection,r;if(n instanceof ce){if(n.node.isTextblock||!Ir(t.doc,n.to))return!1;r=n.to}else if(r=bc(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},QC=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&xs(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},T0=(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 qf(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 e_=(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),s=n.indexAfter(-1),o=qf(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(ge.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},A0=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Ht||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=qf(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(ue.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},M0=(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 s=n.before();if(qn(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&xs(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function t_(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ce&&e.selection.node.isBlock)return!r.parentOffset||!qn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),a=qf(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),s.unshift(l&&a?{type:a}:null),o=h;break}else{if(h==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof ue||e.selection instanceof Ht)&&d.deleteSelection();let u=d.mapping.map(r.pos),f=qn(d.doc,u,s.length,s);if(f||(s[0]=a?{type:a}:null,f=qn(d.doc,u,s.length,s)),!f)return!1;if(d.split(u,s.length,s),!l&&c&&r.node(o).type!=a){let h=d.mapping.map(r.before(o)),m=d.doc.resolve(h);a&&r.node(o-1).canReplaceWith(m.index(),m.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(o)),a)}return n&&n(d.scrollIntoView()),!0}}const n_=t_(),r_=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(ce.create(t.doc,i))),!0)};function i_(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Ir(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function O0(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&i_(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let h=e.pos+s.nodeSize,m=L.empty;for(let b=o.length-1;b>=0;b--)m=L.from(o[b].create(null,m));m=L.from(i.copy(m));let g=t.tr.step(new rt(e.pos-1,h,e.pos,h,new J(m,1,0),o.length,!0)),y=g.doc.resolve(h+2*o.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Ir(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:ge.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),f=u&&xs(u);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(u,f).scrollIntoView()),!0;if(c&&Qi(s,"start",!0)&&Qi(i,"end")){let h=i,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let g=s,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let b=L.empty;for(let E=m.length-1;E>=0;E--)b=L.from(m[E].copy(b));let w=t.tr.step(new rt(e.pos-m.length,e.pos+s.nodeSize,e.pos+y,e.pos+s.nodeSize-y,new J(b,m.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function R0(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(ue.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const s_=R0(-1),o_=R0(1);function a_(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&Df(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function vm(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(c),u=d.index();i=d.parent.canReplaceWith(u,u+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function Yf(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Yf(Kf,E0,S0);Yf(Kf,_0,N0);Yf(T0,A0,M0,n_);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function l_(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let a=r?n.tr:null;return c_(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function c_(t,e,n,r=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new ao(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new ao(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=Df(s,n,r,e);return a?(t&&d_(t,e,a,i,n),!0):!1}function d_(t,e,n,r,i){let s=L.empty;for(let d=n.length-1;d>=0;d--)s=L.from(n[d].type.create(n[d].attrs,s));t.step(new rt(e.start-(r?2:0),e.end,e.start,e.end,new J(s,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==i&&(o=d+1);let a=n.length-o,l=e.start+n.length-(r?2:0),c=e.parent;for(let d=e.startIndex,u=e.endIndex,f=!0;d<u;d++,f=!1)!f&&qn(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function u_(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?f_(e,n,t,s):h_(e,n,s):!0:!1}}function f_(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new rt(s-1,o,s,o,new J(L.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ao(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=xs(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return Ir(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function h_(t,e,n){let r=t.tr,i=n.parent;for(let h=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)h-=i.child(m).nodeSize,r.delete(h-1,h+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=s.node(-1),d=s.index(-1);if(!c.canReplace(d+(a?0:1),d+1,o.content.append(l?L.empty:L.from(i))))return!1;let u=s.pos,f=u+o.nodeSize;return r.step(new rt(u-(a?1:0),f+(l?1:0),u+1,f-1,new J((a?L.empty:L.from(i.copy(L.empty))).append(l?L.empty:L.from(i.copy(L.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function p_(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,d=L.from(c?t.create():null),u=new J(L.from(t.create(null,L.from(a.type.create(null,d)))),c?3:1,0),f=s.start,h=s.end;n(e.tr.step(new rt(f-(c?3:1),h,f,h,u,1,!0)).scrollIntoView())}return!0}}function Sc(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}class Cc{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...d)=>{const u=l(...d)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,c=e||s.tr,d=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),a.every(f=>f===!0)),u={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...g)=>{const y=this.buildProps(c,n),b=h(...g)(y);return a.push(b),u}])),run:d};return u}createCan(e){const{rawCommands:n,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:e,editor:i,view:o,state:Sc({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...d)=>c(...d)(a)]))}};return a}}class m_{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function re(t,e,n){return t.config[e]===void 0&&t.parent?re(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?re(t.parent,e,n):null}):t.config[e]}function _c(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function I0(t){const e=[],{nodeExtensions:n,markExtensions:r}=_c(t),i=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:i},l=re(o,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(u=>{Object.entries(d.attributes).forEach(([f,h])=>{e.push({type:u,name:f,attribute:{...s,...h}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=re(o,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([d,u])=>{const f={...s,...u};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:o.name,name:d,attribute:f})})}),e}function st(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ae(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(d=>!l.includes(d));r[i]=[...l,...c].join(" ")}else if(i==="style"){const a=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[u,f]=d.split(":").map(h=>h.trim());c.set(u,f)}),a.forEach(d=>{const[u,f]=d.split(":").map(h=>h.trim());c.set(u,f)}),r[i]=Array.from(c.entries()).map(([d,u])=>`${d}: ${u}`).join("; ")}else r[i]=s}),r},{})}function yl(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Ae(n,r),{})}function D0(t){return typeof t=="function"}function we(t,e=void 0,...n){return D0(t)?e?t.bind(e)(...n):t(...n):t}function g_(t={}){return Object.keys(t).length===0&&t.constructor===Object}function y_(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function xm(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):y_(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function wm(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&g_(n)?!1:n!=null))}function b_(t,e){var n;const r=I0(t),{nodeExtensions:i,markExtensions:s}=_c(t),o=(n=i.find(c=>re(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{const d=r.filter(b=>b.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((b,w)=>{const E=re(w,"extendNodeSchema",u);return{...b,...E?E(c):{}}},{}),h=wm({...f,content:we(re(c,"content",u)),marks:we(re(c,"marks",u)),group:we(re(c,"group",u)),inline:we(re(c,"inline",u)),atom:we(re(c,"atom",u)),selectable:we(re(c,"selectable",u)),draggable:we(re(c,"draggable",u)),code:we(re(c,"code",u)),whitespace:we(re(c,"whitespace",u)),linebreakReplacement:we(re(c,"linebreakReplacement",u)),defining:we(re(c,"defining",u)),isolating:we(re(c,"isolating",u)),attrs:Object.fromEntries(d.map(b=>{var w;return[b.name,{default:(w=b==null?void 0:b.attribute)===null||w===void 0?void 0:w.default}]}))}),m=we(re(c,"parseHTML",u));m&&(h.parseDOM=m.map(b=>xm(b,d)));const g=re(c,"renderHTML",u);g&&(h.toDOM=b=>g({node:b,HTMLAttributes:yl(b,d)}));const y=re(c,"renderText",u);return y&&(h.toText=y),[c.name,h]})),l=Object.fromEntries(s.map(c=>{const d=r.filter(y=>y.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,b)=>{const w=re(b,"extendMarkSchema",u);return{...y,...w?w(c):{}}},{}),h=wm({...f,inclusive:we(re(c,"inclusive",u)),excludes:we(re(c,"excludes",u)),group:we(re(c,"group",u)),spanning:we(re(c,"spanning",u)),code:we(re(c,"code",u)),attrs:Object.fromEntries(d.map(y=>{var b;return[y.name,{default:(b=y==null?void 0:y.attribute)===null||b===void 0?void 0:b.default}]}))}),m=we(re(c,"parseHTML",u));m&&(h.parseDOM=m.map(y=>xm(y,d)));const g=re(c,"renderHTML",u);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:yl(y,d)})),[c.name,h]}));return new vb({topNode:o,nodes:a,marks:l})}function Nd(t,e){return e.nodes[t]||e.marks[t]||null}function Em(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Jf(t,e){const n=pi.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const v_=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,c;const d=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),n};function Xf(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Go{constructor(e){this.find=e.find,this.handler=e.handler}}const x_=(t,e)=>{if(Xf(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function da(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1;const u=v_(c)+s;return o.forEach(f=>{if(d)return;const h=x_(u,f.find);if(!h)return;const m=l.state.tr,g=Sc({state:l.state,transaction:m}),y={from:r-(h[0].length-s.length),to:i},{commands:b,chain:w,can:E}=new Cc({editor:n,state:g});f.handler({state:g,range:y,match:h,commands:b,chain:w,can:E})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:s}),l.dispatch(m),d=!0)}),d}function w_(t){const{editor:e,rules:n}=t,r=new $e({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=Jf(L.from(d),o.schema);const{from:u}=l,f=u+d.length;da({editor:e,from:u,to:f,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return da({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&da({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?da({editor:e,from:o.pos,to:o.pos,text:`
|
|
11
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function E_(t){return Object.prototype.toString.call(t).slice(8,-1)}function ua(t){return E_(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Nc(t,e){const n={...t};return ua(t)&&ua(e)&&Object.keys(e).forEach(r=>{ua(e[r])&&ua(t[r])?n[r]=Nc(t[r],e[r]):n[r]=e[r]}),n}class un{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=we(re(this,"addOptions",{name:this.name}))),this.storage=we(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new un(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new un(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=we(re(n,"addOptions",{name:n.name})),n.storage=we(re(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=o.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function k_(t){return typeof t=="number"}class S_{constructor(e){this.find=e.find,this.handler=e.handler}}const C_=(t,e,n)=>{if(Xf(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function __(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:c,can:d}=new Cc({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,i,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,m),y=Math.min(i,m+h.content.size),b=h.textBetween(g-m,y-m,void 0,"");C_(b,s.find,o).forEach(E=>{if(E.index===void 0)return;const v=g+E.index+1,S=v+E[0].length,k={from:n.tr.mapping.map(v),to:n.tr.mapping.map(S)},C=s.handler({state:n,range:k,match:E,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});u.push(C)})}),u.every(h=>h!==null)}let fa=null;const N_=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function T_(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:u,to:f,rule:h,pasteEvt:m})=>{const g=d.tr,y=Sc({state:d,transaction:g});if(!(!__({editor:e,state:y,from:Math.max(u-1,0),to:f.b-1,rule:h,pasteEvent:m,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(d=>new $e({view(u){const f=m=>{var g;r=!((g=u.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?u.dom.parentElement:null,r&&(fa=e)},h=()=>{fa&&(fa=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(u,f)=>{if(s=r===u.dom.parentElement,a=f,!s){const h=fa;h!=null&&h.isEditable&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(u,f)=>{var h;const m=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return o=f,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(u,f,h)=>{const m=u[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!s,b=m.getMeta("applyPasteRules"),w=!!b;if(!g&&!y&&!w)return;if(w){let{text:S}=b;typeof S=="string"?S=S:S=Jf(L.from(S),h.schema);const{from:k}=b,C=k+S.length,T=N_(S);return l({rule:d,state:h,from:k,to:{b:C},pasteEvt:T})}const E=f.doc.content.findDiffStart(h.doc.content),v=f.doc.content.findDiffEnd(h.doc.content);if(!(!k_(E)||!v||E===v.b))return l({rule:d,state:h,from:E,to:v,pasteEvt:o})}}))}function A_(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Hi{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Hi.resolve(e),this.schema=b_(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Hi.sort(Hi.flatten(e)),r=A_(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=re(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=re(r,"priority")||100,o=re(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Nd(n.name,this.schema)},i=re(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Hi.sort([...this.extensions].reverse()),r=[],i=[],s=n.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:Nd(o.name,this.schema)},l=[],c=re(o,"addKeyboardShortcuts",a);let d={};if(o.type==="mark"&&re(o,"exitable",a)&&(d.ArrowRight=()=>un.handleExit({editor:e,mark:o})),c){const g=Object.fromEntries(Object.entries(c()).map(([y,b])=>[y,()=>b({editor:e})]));d={...d,...g}}const u=qC(d);l.push(u);const f=re(o,"addInputRules",a);Em(o,e.options.enableInputRules)&&f&&r.push(...f());const h=re(o,"addPasteRules",a);Em(o,e.options.enablePasteRules)&&h&&i.push(...h());const m=re(o,"addProseMirrorPlugins",a);if(m){const g=m();l.push(...g)}return l}).flat();return[w_({editor:e,rules:r}),...T_({editor:e,rules:i}),...s]}get attributes(){return I0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=_c(this.extensions);return Object.fromEntries(n.filter(r=>!!re(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:st(r.name,this.schema)},o=re(r,"addNodeView",s);if(!o)return[];const a=(l,c,d,u,f)=>{const h=yl(l,i);return o()({node:l,view:c,getPos:d,decorations:u,innerDecorations:f,editor:e,extension:r,HTMLAttributes:h})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Nd(e.name,this.schema)};e.type==="mark"&&(!((n=we(re(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=re(e,"onBeforeCreate",r),s=re(e,"onCreate",r),o=re(e,"onUpdate",r),a=re(e,"onSelectionUpdate",r),l=re(e,"onTransaction",r),c=re(e,"onFocus",r),d=re(e,"onBlur",r),u=re(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u)})}}class We{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=we(re(this,"addOptions",{name:this.name}))),this.storage=we(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new We(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new We({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=we(re(n,"addOptions",{name:n.name})),n.storage=we(re(n,"addStorage",{name:n.name,options:n.options})),n}}function L0(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
|
|
12
|
+
|
|
13
|
+
`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,c,d,u)=>{var f;l.isBlock&&c>r&&(a+=s);const h=o==null?void 0:o[l.type.name];if(h)return d&&(a+=h({node:l,pos:c,parent:d,index:u,range:e})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)===null||f===void 0?void 0:f.slice(Math.max(r,c)-c,i-c))}),a}function P0(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const M_=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new $e({key:new Be("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(d=>d.$from.pos)),a=Math.max(...s.map(d=>d.$to.pos)),l=P0(n);return L0(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),O_=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),R_=(t=!1)=>({commands:e})=>e.setContent("",t),I_=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:d}=e,u=c.resolve(d.map(l)),f=c.resolve(d.map(l+a.nodeSize)),h=u.blockRange(f);if(!h)return;const m=xs(h);if(a.type.isTextblock){const{defaultType:g}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(h.start,g)}(m||m===0)&&e.lift(h,m)})}),!0},D_=t=>e=>t(e),L_=()=>({state:t,dispatch:e})=>A0(t,e),P_=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new ue(r.doc.resolve(Math.max(o-1,0)))),!0},B_=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},$_=t=>({tr:e,state:n,dispatch:r})=>{const i=st(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),c=s.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},j_=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},F_=()=>({state:t,dispatch:e})=>Kf(t,e),H_=()=>({commands:t})=>t.keyboardShortcut("Enter"),z_=()=>({state:t,dispatch:e})=>e_(t,e);function bl(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Xf(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function B0(t,e,n={}){return t.find(r=>r.type===e&&bl(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function km(t,e,n={}){return!!B0(t,e,n)}function Zf(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!B0([...i.node.marks],e,n)))return;let o=i.index,a=t.start()+i.offset,l=o+1,c=a+i.node.nodeSize;for(;o>0&&km([...t.parent.child(o-1).marks],e,n);)o-=1,a-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&km([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Lr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const U_=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=Lr(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){const u=Zf(l,s,e);if(u&&u.from<=c&&u.to>=d){const f=ue.create(o,u.from,u.to);n.setSelection(f)}}return!0},V_=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Tc(t){return t instanceof ue}function Wn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function $0(t,e=null){if(!e)return null;const n=ge.atStart(t),r=ge.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?ue.create(t,Wn(0,i,s),Wn(t.content.size,i,s)):ue.create(t,Wn(e,i,s),Wn(e,i,s))}function Fu(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function mo(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function K_(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const W_=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(mo()||Fu())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),K_()&&!mo()&&!Fu()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!Tc(n.state.selection))return o(),!0;const a=$0(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},G_=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),q_=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),j0=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&j0(r)}return t};function ha(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return j0(n)}function go(t,e,n){if(t instanceof kr||t instanceof L)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return L.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),go("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new vb({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Vs.fromSchema(l).parseSlice(ha(t),n.parseOptions):Vs.fromSchema(l).parse(ha(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Vs.fromSchema(e);return n.slice?s.parseSlice(ha(t),n.parseOptions).content:s.parse(ha(t),n.parseOptions)}return go("",e,n)}function Y_(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Xe||i instanceof rt))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,c,d)=>{o===0&&(o=d)}),t.setSelection(ge.near(t.doc.resolve(o),n))}const J_=t=>!("type"in t),X_=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=y=>{s.emit("contentError",{editor:s,error:y,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{go(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=go(e,s.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(y){return l(y),!1}let{from:d,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((J_(a)?a:[a]).forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),d===u&&h){const{parent:y}=r.doc.resolve(d);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(d-=1,u+=1)}let g;if(f){if(Array.isArray(e))g=e.map(y=>y.text||"").join("");else if(e instanceof L){let y="";e.forEach(b=>{b.text&&(y+=b.text)}),g=y}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,d,u)}else g=a,r.replaceWith(d,u,g);n.updateSelection&&Y_(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:g})}return!0},Z_=()=>({state:t,dispatch:e})=>XC(t,e),Q_=()=>({state:t,dispatch:e})=>ZC(t,e),eN=()=>({state:t,dispatch:e})=>E0(t,e),tN=()=>({state:t,dispatch:e})=>_0(t,e),nN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=bc(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},rN=()=>({state:t,dispatch:e,tr:n})=>{try{const r=bc(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},iN=()=>({state:t,dispatch:e})=>YC(t,e),sN=()=>({state:t,dispatch:e})=>JC(t,e);function F0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function oN(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))mo()||F0()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const aN=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=oN(t).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const d=c.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function yo(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?st(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(u,f)=>{if(u.isText)return;const h=Math.max(r,f),m=Math.min(i,f+u.nodeSize);a.push({node:u,from:h,to:m})});const l=i-r,c=a.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>bl(u.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((u,f)=>u+f.to-f.from,0)>=l}const lN=(t,e={})=>({state:n,dispatch:r})=>{const i=st(t,n.schema);return yo(n,i,e)?QC(n,r):!1},cN=()=>({state:t,dispatch:e})=>M0(t,e),dN=t=>({state:e,dispatch:n})=>{const r=st(t,e.schema);return u_(r)(e,n)},uN=()=>({state:t,dispatch:e})=>T0(t,e);function Ac(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Sm(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const fN=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Ac(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=st(t,r.schema)),a==="mark"&&(o=Lr(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{s&&s===c.type&&n.setNodeMarkup(d,void 0,Sm(c.attrs,e)),o&&c.marks.length&&c.marks.forEach(u=>{o===u.type&&n.addMark(d,d+c.nodeSize,o.create(Sm(u.attrs,e)))})})}),!0):!1},hN=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),pN=()=>({tr:t,dispatch:e})=>{if(e){const n=new Ht(t.doc);t.setSelection(n)}return!0},mN=()=>({state:t,dispatch:e})=>S0(t,e),gN=()=>({state:t,dispatch:e})=>N0(t,e),yN=()=>({state:t,dispatch:e})=>r_(t,e),bN=()=>({state:t,dispatch:e})=>o_(t,e),vN=()=>({state:t,dispatch:e})=>s_(t,e);function Hu(t,e,n={},r={}){return go(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const xN=(t,e=!1,n={},r={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{var l,c;const{doc:d}=s;if(n.preserveWhitespace!=="full"){const u=Hu(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return o&&s.replaceWith(0,d.content.size,u).setMeta("preventUpdate",!e),!0}return o&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:d.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function H0(t,e){const n=Lr(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function wN(t,e){const n=new Lb(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function EN(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function es(t,e){const n=[];return t.descendants((r,i)=>{e(r)&&n.push({node:r,pos:i})}),n}function kN(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function SN(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function qo(t){return e=>SN(e.$from,t)}function CN(t,e){const n={from:0,to:t.content.size};return L0(t,n,e)}function _N(t,e){const n=st(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function z0(t,e){const n=Ac(typeof e=="string"?e:e.name,t.schema);return n==="node"?_N(t,e):n==="mark"?H0(t,e):{}}function NN(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function TN(t){const e=NN(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function AN(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const c=e.slice(s).map(a,-1),d=e.slice(s).map(l),u=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:u,to:f},newRange:{from:c,to:d}})})}),TN(r)}function Qf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=Zf(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function Ga(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function zu(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Lr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>bl(u.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:u,$to:f})=>{const h=u.pos,m=f.pos;t.doc.nodesBetween(h,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const b=Math.max(h,y),w=Math.min(m,y+g.nodeSize),E=w-b;o+=E,a.push(...g.marks.map(v=>({mark:v,from:b,to:w})))})}),o===0)return!1;const l=a.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>bl(u.mark.attrs,n,{strict:!1})).reduce((u,f)=>u+f.to-f.from,0),c=a.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,f)=>u+f.to-f.from,0);return(l>0?l+c:l)>=o}function MN(t,e,n={}){if(!e)return yo(t,null,n)||zu(t,null,n);const r=Ac(e,t.schema);return r==="node"?yo(t,e,n):r==="mark"?zu(t,e,n):!1}function Cm(t,e){const{nodeExtensions:n}=_c(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=we(re(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Mc(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Mc(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function U0(t){return t instanceof ce}function ON(t,e,n){const i=t.state.doc.content.size,s=Wn(e,0,i),o=Wn(n,0,i),a=t.coordsAtPos(s),l=t.coordsAtPos(o,-1),c=Math.min(a.top,l.top),d=Math.max(a.bottom,l.bottom),u=Math.min(a.left,l.left),f=Math.max(a.right,l.right),h=f-u,m=d-c,b={top:c,bottom:d,left:u,right:f,width:h,height:m,x:u,y:c};return{...b,toJSON:()=>b}}function RN(t,e,n){var r;const{selection:i}=e;let s=null;if(Tc(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,u,f)=>{if(c)return!1;if(d.isInline){const h=!f||f.type.allowsMarkType(n),m=!!n.isInSet(d.marks)||!d.marks.some(g=>g.type.excludes(n));c=h&&m}return!c}),c})}const IN=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Lr(t,r.schema);if(i)if(o){const c=H0(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(f,h)=>{const m=Math.max(h,d),g=Math.min(h+f.nodeSize,u);f.marks.find(b=>b.type===l)?f.marks.forEach(b=>{l===b.type&&n.addMark(m,g,l.create({...b.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return RN(r,n,l)},DN=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),LN=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=st(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>vm(s,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>vm(s,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},PN=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Wn(t,0,r.content.size),s=ce.create(r,i);e.setSelection(s)}return!0},BN=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=ue.atStart(r).from,a=ue.atEnd(r).to,l=Wn(i,o,a),c=Wn(s,o,a),d=ue.create(r,l,c);e.setSelection(d)}return!0},$N=t=>({state:e,dispatch:n})=>{const r=st(t,e.schema);return p_(r)(e,n)};function _m(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const jN=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,c=i.extensionManager.attributes,d=Ga(c,a.node().type.name,a.node().attrs);if(s instanceof ce&&s.node.isBlock)return!a.parentOffset||!qn(o,a.pos)?!1:(r&&(t&&_m(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const u=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:EN(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=u&&f?[{type:f,attrs:d}]:void 0,m=qn(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!m&&qn(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:d}]:void 0),r){if(m&&(s instanceof ue&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,h),f&&!u&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&_m(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},FN=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=st(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;const f=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let b=L.empty;const w=l.index(-1)?1:l.index(-2)?2:3;for(let T=l.depth-w;T>=l.depth-3;T-=1)b=L.from(l.node(T).copy(b));const E=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,v={...Ga(f,l.node().type.name,l.node().attrs),...e},S=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(v))||void 0;b=b.append(L.from(a.createAndFill(null,S)||void 0));const k=l.before(l.depth-(w-1));n.replace(k,l.after(-E),new J(b,4-w,0));let C=-1;n.doc.nodesBetween(k,n.doc.content.size,(T,M)=>{if(C>-1)return!1;T.isTextblock&&T.content.size===0&&(C=M+1)}),C>-1&&n.setSelection(ue.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const h=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,m={...Ga(f,u.type.name,u.attrs),...e},g={...Ga(f,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const y=h?[{type:a,attrs:m},{type:h,attrs:g}]:[{type:a,attrs:m}];if(!qn(n.doc,l.pos,2))return!1;if(i){const{selection:b,storedMarks:w}=r,{splittableMarks:E}=s.extensionManager,v=w||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!v||!i)return!0;const S=v.filter(k=>E.includes(k.type.name));n.ensureMarks(S)}return!0},Td=(t,e)=>{const n=qo(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Ir(t.doc,n.pos)&&t.join(n.pos),!0},Ad=(t,e)=>{const n=qo(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Ir(t.doc,r)&&t.join(r),!0},HN=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:f}=i.extensionManager,h=st(t,o.schema),m=st(e,o.schema),{selection:g,storedMarks:y}=o,{$from:b,$to:w}=g,E=b.blockRange(w),v=y||g.$to.parentOffset&&g.$from.marks();if(!E)return!1;const S=qo(k=>Cm(k.type.name,u))(g);if(E.depth>=1&&S&&E.depth-S.depth<=1){if(S.node.type===h)return c.liftListItem(m);if(Cm(S.node.type.name,u)&&h.validContent(S.node.content)&&a)return l().command(()=>(s.setNodeMarkup(S.pos,h),!0)).command(()=>Td(s,h)).command(()=>Ad(s,h)).run()}return!n||!v||!a?l().command(()=>d().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>Td(s,h)).command(()=>Ad(s,h)).run():l().command(()=>{const k=d().wrapInList(h,r),C=v.filter(T=>f.includes(T.type.name));return s.ensureMarks(C),k?!0:c.clearNodes()}).wrapInList(h,r).command(()=>Td(s,h)).command(()=>Ad(s,h)).run()},zN=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Lr(t,r.schema);return zu(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},UN=(t,e,n={})=>({state:r,commands:i})=>{const s=st(t,r.schema),o=st(e,r.schema),a=yo(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},VN=(t,e={})=>({state:n,commands:r})=>{const i=st(t,n.schema);return yo(n,i,e)?r.lift(i):r.wrapIn(i,e)},KN=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},WN=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},GN=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Lr(t,r.schema),{$from:c,empty:d,ranges:u}=a;if(!i)return!0;if(d&&o){let{from:f,to:h}=a;const m=(s=c.marks().find(y=>y.type===l))===null||s===void 0?void 0:s.attrs,g=Zf(c,l,m);g&&(f=g.from,h=g.to),n.removeMark(f,h,l)}else u.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},qN=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Ac(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=st(t,r.schema)),a==="mark"&&(o=Lr(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;let u,f,h,m;n.selection.empty?r.doc.nodesBetween(c,d,(g,y)=>{s&&s===g.type&&(h=Math.max(y,c),m=Math.min(y+g.nodeSize,d),u=y,f=g)}):r.doc.nodesBetween(c,d,(g,y)=>{y<c&&s&&s===g.type&&(h=Math.max(y,c),m=Math.min(y+g.nodeSize,d),u=y,f=g),y>=c&&y<=d&&(s&&s===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...e}),o&&g.marks.length&&g.marks.forEach(b=>{if(o===b.type){const w=Math.max(y,c),E=Math.min(y+g.nodeSize,d);n.addMark(w,E,o.create({...b.attrs,...e}))}}))}),f&&(u!==void 0&&n.setNodeMarkup(u,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(g=>{o===g.type&&n.addMark(h,m,o.create({...g.attrs,...e}))}))}),!0):!1},YN=(t,e={})=>({state:n,dispatch:r})=>{const i=st(t,n.schema);return a_(i,e)(n,r)},JN=(t,e={})=>({state:n,dispatch:r})=>{const i=st(t,n.schema);return l_(i,e)(n,r)};var XN=Object.freeze({__proto__:null,blur:O_,clearContent:R_,clearNodes:I_,command:D_,createParagraphNear:L_,cut:P_,deleteCurrentNode:B_,deleteNode:$_,deleteRange:j_,deleteSelection:F_,enter:H_,exitCode:z_,extendMarkRange:U_,first:V_,focus:W_,forEach:G_,insertContent:q_,insertContentAt:X_,joinBackward:eN,joinDown:Q_,joinForward:tN,joinItemBackward:nN,joinItemForward:rN,joinTextblockBackward:iN,joinTextblockForward:sN,joinUp:Z_,keyboardShortcut:aN,lift:lN,liftEmptyBlock:cN,liftListItem:dN,newlineInCode:uN,resetAttributes:fN,scrollIntoView:hN,selectAll:pN,selectNodeBackward:mN,selectNodeForward:gN,selectParentNode:yN,selectTextblockEnd:bN,selectTextblockStart:vN,setContent:xN,setMark:IN,setMeta:DN,setNode:LN,setNodeSelection:PN,setTextSelection:BN,sinkListItem:$N,splitBlock:jN,splitListItem:FN,toggleList:HN,toggleMark:zN,toggleNode:UN,toggleWrap:VN,undoInputRule:KN,unsetAllMarks:WN,unsetMark:GN,updateAttributes:qN,wrapIn:YN,wrapInList:JN});const ZN=We.create({name:"commands",addCommands(){return{...XN}}}),QN=We.create({name:"drop",addProseMirrorPlugins(){return[new $e({key:new Be("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),eT=We.create({name:"editable",addProseMirrorPlugins(){return[new $e({key:new Be("editable"),props:{editable:()=>this.editor.options.editable}})]}}),tT=new Be("focusEvents"),nT=We.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new $e({key:tT,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),rT=We.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:u}=l,{pos:f,parent:h}=u,m=u.parent.isTextblock&&f>0?a.doc.resolve(f-1):u,g=m.parent.type.spec.isolating,y=u.pos-u.parentOffset,b=g&&m.parent.childCount===1?y===u.pos:ge.atStart(c).from===f;return!d||!h.type.isTextblock||h.textContent.length||!b||b&&u.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return mo()||F0()?s:i},addProseMirrorPlugins(){return[new $e({key:new Be("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=ge.atStart(e.doc).from,c=ge.atEnd(e.doc).to;if(s||!(o===l&&a===c)||!Mc(n.doc))return;const f=n.tr,h=Sc({state:n,transaction:f}),{commands:m}=new Cc({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),iT=We.create({name:"paste",addProseMirrorPlugins(){return[new $e({key:new Be("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),sT=We.create({name:"tabindex",addProseMirrorPlugins(){return[new $e({key:new Be("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class qr{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new qr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new qr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new qr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new qr(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new qr(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const oT=`.ProseMirror {
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ProseMirror {
|
|
18
|
+
word-wrap: break-word;
|
|
19
|
+
white-space: pre-wrap;
|
|
20
|
+
white-space: break-spaces;
|
|
21
|
+
-webkit-font-variant-ligatures: none;
|
|
22
|
+
font-variant-ligatures: none;
|
|
23
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ProseMirror [contenteditable="false"] {
|
|
27
|
+
white-space: normal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
31
|
+
white-space: pre-wrap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ProseMirror pre {
|
|
35
|
+
white-space: pre-wrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
img.ProseMirror-separator {
|
|
39
|
+
display: inline !important;
|
|
40
|
+
border: none !important;
|
|
41
|
+
margin: 0 !important;
|
|
42
|
+
width: 0 !important;
|
|
43
|
+
height: 0 !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ProseMirror-gapcursor {
|
|
47
|
+
display: none;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
position: absolute;
|
|
50
|
+
margin: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ProseMirror-gapcursor:after {
|
|
54
|
+
content: "";
|
|
55
|
+
display: block;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: -2px;
|
|
58
|
+
width: 20px;
|
|
59
|
+
border-top: 1px solid black;
|
|
60
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes ProseMirror-cursor-blink {
|
|
64
|
+
to {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ProseMirror-hideselection *::selection {
|
|
70
|
+
background: transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
74
|
+
background: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ProseMirror-hideselection * {
|
|
78
|
+
caret-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
82
|
+
display: block;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
86
|
+
opacity: 0
|
|
87
|
+
}`;function aT(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class lT extends m_{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=aT(oT,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=D0(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;r=r.filter(a=>!a.key.startsWith(o))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[eT,M_.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),ZN,nT,rT,sT,QN,iT].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new Hi(i,this)}createCommandManager(){this.commandManager=new Cc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Hu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=Hu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=$0(n,this.options.autofocus);this.view=new v0(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Fi.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const s=this.view.dom;s.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(o)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return z0(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return MN(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Jf(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
88
|
+
|
|
89
|
+
`,textSerializers:r={}}=e||{};return CN(this.state.doc,{blockSeparator:n,textSerializers:{...P0(this.schema),...r}})}get isEmpty(){return Mc(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new qr(n,this)}get $doc(){return this.$pos(0)}}function ts(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{const i=we(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),c=n.from+a.indexOf(o),d=c+o.length;if(Qf(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;d<n.to&&s.delete(d,n.to),c>n.from&&s.delete(n.from+l,c);const f=n.from+l+o.length;s.addMark(n.from+l,f,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function V0(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{const i=we(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=o+c;d>a?d=a:a=d+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,o+r[0].length-1),s.replaceWith(d,a,l)}else if(r[0]){const c=t.type.isInline?o:o-1;s.insert(c,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()}})}function Uu(t){return new Go({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=we(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function bo(t){return new Go({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=we(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),c=l&&Df(l,t.type,s);if(!c)return null;if(o.wrap(l,c),t.keepMarks&&t.editor){const{selection:u,storedMarks:f}=e,{splittableMarks:h}=t.editor.extensionManager,m=f||u.$to.parentOffset&&u.$from.marks();if(m){const g=m.filter(y=>h.includes(y.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Ir(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)}})}let Je=class Vu{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=we(re(this,"addOptions",{name:this.name}))),this.storage=we(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Vu(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Vu(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=we(re(n,"addOptions",{name:n.name})),n.storage=we(re(n,"addStorage",{name:n.name,options:n.options})),n}};class cT{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,s,o,a,l;const{view:c}=this.editor,d=e.target,u=d.nodeType===3?(n=d.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(d)||!u)return;let f=0,h=0;if(this.dom!==u){const w=this.dom.getBoundingClientRect(),E=u.getBoundingClientRect(),v=(i=e.offsetX)!==null&&i!==void 0?i:(s=e.nativeEvent)===null||s===void 0?void 0:s.offsetX,S=(o=e.offsetY)!==null&&o!==void 0?o:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;f=E.x-w.x+v,h=E.y-w.y+S}const m=this.dom.cloneNode(!0);(l=e.dataTransfer)===null||l===void 0||l.setDragImage(m,f,h);const g=this.getPos();if(typeof g!="number")return;const y=ce.create(c.state.doc,g),b=c.state.tr.setSelection(y);c.dispatch(b)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const s=e.type.startsWith("drag"),o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!s)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,d=!!this.node.type.spec.draggable,u=ce.isSelectable(this.node),f=e.type==="copy",h=e.type==="paste",m=e.type==="cut",g=e.type==="mousedown";if(!d&&u&&s&&e.target===this.dom&&e.preventDefault(),d&&s&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(d&&l&&!c&&g){const y=r.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||o||f||h||m||g&&u)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(mo()||Fu())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function ui(t){return new S_({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=we(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const d=l.search(/\S/),u=n.from+l.indexOf(a),f=u+a.length;if(Qf(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>u).length)return null;f<n.to&&o.delete(f,n.to),u>n.from&&o.delete(n.from+d,u),c=n.from+d+a.length,o.addMark(n.from+d,c,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}function dT(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof ce){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function uT(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Dt="top",tn="bottom",nn="right",Lt="left",eh="auto",Yo=[Dt,tn,nn,Lt],ns="start",vo="end",fT="clippingParents",K0="viewport",Ds="popper",hT="reference",Nm=Yo.reduce(function(t,e){return t.concat([e+"-"+ns,e+"-"+vo])},[]),W0=[].concat(Yo,[eh]).reduce(function(t,e){return t.concat([e,e+"-"+ns,e+"-"+vo])},[]),pT="beforeRead",mT="read",gT="afterRead",yT="beforeMain",bT="main",vT="afterMain",xT="beforeWrite",wT="write",ET="afterWrite",kT=[pT,mT,gT,yT,bT,vT,xT,wT,ET];function On(t){return t?(t.nodeName||"").toLowerCase():null}function Ut(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function fi(t){var e=Ut(t).Element;return t instanceof e||t instanceof Element}function en(t){var e=Ut(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function th(t){if(typeof ShadowRoot>"u")return!1;var e=Ut(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function ST(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!en(s)||!On(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(o){var a=i[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function CT(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],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!en(i)||!On(i)||(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const G0={name:"applyStyles",enabled:!0,phase:"write",fn:ST,effect:CT,requires:["computeStyles"]};function _n(t){return t.split("-")[0]}var ni=Math.max,vl=Math.min,rs=Math.round;function Ku(){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 q0(){return!/^((?!chrome|android).)*safari/i.test(Ku())}function is(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,s=1;e&&en(t)&&(i=t.offsetWidth>0&&rs(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&rs(r.height)/t.offsetHeight||1);var o=fi(t)?Ut(t):window,a=o.visualViewport,l=!q0()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,d=(r.top+(l&&a?a.offsetTop:0))/s,u=r.width/i,f=r.height/s;return{width:u,height:f,top:d,right:c+u,bottom:d+f,left:c,x:c,y:d}}function nh(t){var e=is(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 Y0(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&th(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Jn(t){return Ut(t).getComputedStyle(t)}function _T(t){return["table","td","th"].indexOf(On(t))>=0}function Pr(t){return((fi(t)?t.ownerDocument:t.document)||window.document).documentElement}function Oc(t){return On(t)==="html"?t:t.assignedSlot||t.parentNode||(th(t)?t.host:null)||Pr(t)}function Tm(t){return!en(t)||Jn(t).position==="fixed"?null:t.offsetParent}function NT(t){var e=/firefox/i.test(Ku()),n=/Trident/i.test(Ku());if(n&&en(t)){var r=Jn(t);if(r.position==="fixed")return null}var i=Oc(t);for(th(i)&&(i=i.host);en(i)&&["html","body"].indexOf(On(i))<0;){var s=Jn(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function Jo(t){for(var e=Ut(t),n=Tm(t);n&&_T(n)&&Jn(n).position==="static";)n=Tm(n);return n&&(On(n)==="html"||On(n)==="body"&&Jn(n).position==="static")?e:n||NT(t)||e}function rh(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function qs(t,e,n){return ni(t,vl(e,n))}function TT(t,e,n){var r=qs(t,e,n);return r>n?n:r}function J0(){return{top:0,right:0,bottom:0,left:0}}function X0(t){return Object.assign({},J0(),t)}function Z0(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var AT=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,X0(typeof e!="number"?e:Z0(e,Yo))};function MT(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=_n(n.placement),l=rh(a),c=[Lt,nn].indexOf(a)>=0,d=c?"height":"width";if(!(!s||!o)){var u=AT(i.padding,n),f=nh(s),h=l==="y"?Dt:Lt,m=l==="y"?tn:nn,g=n.rects.reference[d]+n.rects.reference[l]-o[l]-n.rects.popper[d],y=o[l]-n.rects.reference[l],b=Jo(s),w=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,E=g/2-y/2,v=u[h],S=w-f[d]-u[m],k=w/2-f[d]/2+E,C=qs(v,k,S),T=l;n.modifiersData[r]=(e={},e[T]=C,e.centerOffset=C-k,e)}}function OT(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)||Y0(e.elements.popper,i)&&(e.elements.arrow=i))}const RT={name:"arrow",enabled:!0,phase:"main",fn:MT,effect:OT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ss(t){return t.split("-")[1]}var IT={top:"auto",right:"auto",bottom:"auto",left:"auto"};function DT(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:rs(n*i)/i||0,y:rs(r*i)/i||0}}function Am(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,f=o.x,h=f===void 0?0:f,m=o.y,g=m===void 0?0:m,y=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),E=Lt,v=Dt,S=window;if(c){var k=Jo(n),C="clientHeight",T="clientWidth";if(k===Ut(n)&&(k=Pr(n),Jn(k).position!=="static"&&a==="absolute"&&(C="scrollHeight",T="scrollWidth")),k=k,i===Dt||(i===Lt||i===nn)&&s===vo){v=tn;var M=u&&k===S&&S.visualViewport?S.visualViewport.height:k[C];g-=M-r.height,g*=l?1:-1}if(i===Lt||(i===Dt||i===tn)&&s===vo){E=nn;var D=u&&k===S&&S.visualViewport?S.visualViewport.width:k[T];h-=D-r.width,h*=l?1:-1}}var F=Object.assign({position:a},c&&IT),B=d===!0?DT({x:h,y:g},Ut(n)):{x:h,y:g};if(h=B.x,g=B.y,l){var z;return Object.assign({},F,(z={},z[v]=w?"0":"",z[E]=b?"0":"",z.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",z))}return Object.assign({},F,(e={},e[v]=w?g+"px":"",e[E]=b?h+"px":"",e.transform="",e))}function LT(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:_n(e.placement),variation:ss(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,Am(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Am(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const PT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:LT,data:{}};var pa={passive:!0};function BT(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,o=r.resize,a=o===void 0?!0:o,l=Ut(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",n.update,pa)}),a&&l.addEventListener("resize",n.update,pa),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",n.update,pa)}),a&&l.removeEventListener("resize",n.update,pa)}}const $T={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:BT,data:{}};var jT={left:"right",right:"left",bottom:"top",top:"bottom"};function qa(t){return t.replace(/left|right|bottom|top/g,function(e){return jT[e]})}var FT={start:"end",end:"start"};function Mm(t){return t.replace(/start|end/g,function(e){return FT[e]})}function ih(t){var e=Ut(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function sh(t){return is(Pr(t)).left+ih(t).scrollLeft}function HT(t,e){var n=Ut(t),r=Pr(t),i=n.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;var c=q0();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a+sh(t),y:l}}function zT(t){var e,n=Pr(t),r=ih(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=ni(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=ni(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+sh(t),l=-r.scrollTop;return Jn(i||n).direction==="rtl"&&(a+=ni(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function oh(t){var e=Jn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Q0(t){return["html","body","#document"].indexOf(On(t))>=0?t.ownerDocument.body:en(t)&&oh(t)?t:Q0(Oc(t))}function Ys(t,e){var n;e===void 0&&(e=[]);var r=Q0(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=Ut(r),o=i?[s].concat(s.visualViewport||[],oh(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(Ys(Oc(o)))}function Wu(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function UT(t,e){var n=is(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 Om(t,e,n){return e===K0?Wu(HT(t,n)):fi(e)?UT(e,n):Wu(zT(Pr(t)))}function VT(t){var e=Ys(Oc(t)),n=["absolute","fixed"].indexOf(Jn(t).position)>=0,r=n&&en(t)?Jo(t):t;return fi(r)?e.filter(function(i){return fi(i)&&Y0(i,r)&&On(i)!=="body"}):[]}function KT(t,e,n,r){var i=e==="clippingParents"?VT(t):[].concat(e),s=[].concat(i,[n]),o=s[0],a=s.reduce(function(l,c){var d=Om(t,c,r);return l.top=ni(d.top,l.top),l.right=vl(d.right,l.right),l.bottom=vl(d.bottom,l.bottom),l.left=ni(d.left,l.left),l},Om(t,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ev(t){var e=t.reference,n=t.element,r=t.placement,i=r?_n(r):null,s=r?ss(r):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case Dt:l={x:o,y:e.y-n.height};break;case tn:l={x:o,y:e.y+e.height};break;case nn:l={x:e.x+e.width,y:a};break;case Lt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?rh(i):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case ns:l[c]=l[c]-(e[d]/2-n[d]/2);break;case vo:l[c]=l[c]+(e[d]/2-n[d]/2);break}}return l}function xo(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.strategy,o=s===void 0?t.strategy:s,a=n.boundary,l=a===void 0?fT:a,c=n.rootBoundary,d=c===void 0?K0:c,u=n.elementContext,f=u===void 0?Ds:u,h=n.altBoundary,m=h===void 0?!1:h,g=n.padding,y=g===void 0?0:g,b=X0(typeof y!="number"?y:Z0(y,Yo)),w=f===Ds?hT:Ds,E=t.rects.popper,v=t.elements[m?w:f],S=KT(fi(v)?v:v.contextElement||Pr(t.elements.popper),l,d,o),k=is(t.elements.reference),C=ev({reference:k,element:E,placement:i}),T=Wu(Object.assign({},E,C)),M=f===Ds?T:k,D={top:S.top-M.top+b.top,bottom:M.bottom-S.bottom+b.bottom,left:S.left-M.left+b.left,right:M.right-S.right+b.right},F=t.modifiersData.offset;if(f===Ds&&F){var B=F[i];Object.keys(D).forEach(function(z){var W=[nn,tn].indexOf(z)>=0?1:-1,G=[Dt,tn].indexOf(z)>=0?"y":"x";D[z]+=B[G]*W})}return D}function WT(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?W0:l,d=ss(r),u=d?a?Nm:Nm.filter(function(m){return ss(m)===d}):Yo,f=u.filter(function(m){return c.indexOf(m)>=0});f.length===0&&(f=u);var h=f.reduce(function(m,g){return m[g]=xo(t,{placement:g,boundary:i,rootBoundary:s,padding:o})[_n(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function GT(t){if(_n(t)===eh)return[];var e=qa(t);return[Mm(t),e,Mm(e)]}function qT(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,g=n.allowedAutoPlacements,y=e.options.placement,b=_n(y),w=b===y,E=l||(w||!m?[qa(y)]:GT(y)),v=[y].concat(E).reduce(function(K,X){return K.concat(_n(X)===eh?WT(e,{placement:X,boundary:d,rootBoundary:u,padding:c,flipVariations:m,allowedAutoPlacements:g}):X)},[]),S=e.rects.reference,k=e.rects.popper,C=new Map,T=!0,M=v[0],D=0;D<v.length;D++){var F=v[D],B=_n(F),z=ss(F)===ns,W=[Dt,tn].indexOf(B)>=0,G=W?"width":"height",A=xo(e,{placement:F,boundary:d,rootBoundary:u,altBoundary:f,padding:c}),N=W?z?nn:Lt:z?tn:Dt;S[G]>k[G]&&(N=qa(N));var _=qa(N),I=[];if(s&&I.push(A[B]<=0),a&&I.push(A[N]<=0,A[_]<=0),I.every(function(K){return K})){M=F,T=!1;break}C.set(F,I)}if(T)for(var $=m?3:1,q=function(X){var me=v.find(function(he){var Se=C.get(he);if(Se)return Se.slice(0,X).every(function(Ee){return Ee})});if(me)return M=me,"break"},se=$;se>0;se--){var ae=q(se);if(ae==="break")break}e.placement!==M&&(e.modifiersData[r]._skip=!0,e.placement=M,e.reset=!0)}}const YT={name:"flip",enabled:!0,phase:"main",fn:qT,requiresIfExists:["offset"],data:{_skip:!1}};function Rm(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 Im(t){return[Dt,nn,tn,Lt].some(function(e){return t[e]>=0})}function JT(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=xo(e,{elementContext:"reference"}),a=xo(e,{altBoundary:!0}),l=Rm(o,r),c=Rm(a,i,s),d=Im(l),u=Im(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const XT={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:JT};function ZT(t,e,n){var r=_n(t),i=[Lt,Dt].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[Lt,nn].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function QT(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,o=W0.reduce(function(d,u){return d[u]=ZT(u,e.rects,s),d},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const eA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:QT};function tA(t){var e=t.state,n=t.name;e.modifiersData[n]=ev({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const nA={name:"popperOffsets",enabled:!0,phase:"read",fn:tA,data:{}};function rA(t){return t==="x"?"y":"x"}function iA(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,f=n.tether,h=f===void 0?!0:f,m=n.tetherOffset,g=m===void 0?0:m,y=xo(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),b=_n(e.placement),w=ss(e.placement),E=!w,v=rh(b),S=rA(v),k=e.modifiersData.popperOffsets,C=e.rects.reference,T=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,D=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(k){if(s){var z,W=v==="y"?Dt:Lt,G=v==="y"?tn:nn,A=v==="y"?"height":"width",N=k[v],_=N+y[W],I=N-y[G],$=h?-T[A]/2:0,q=w===ns?C[A]:T[A],se=w===ns?-T[A]:-C[A],ae=e.elements.arrow,K=h&&ae?nh(ae):{width:0,height:0},X=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:J0(),me=X[W],he=X[G],Se=qs(0,C[A],K[A]),Ee=E?C[A]/2-$-Se-me-D.mainAxis:q-Se-me-D.mainAxis,Ne=E?-C[A]/2+$+Se+he+D.mainAxis:se+Se+he+D.mainAxis,Me=e.elements.arrow&&Jo(e.elements.arrow),Te=Me?v==="y"?Me.clientTop||0:Me.clientLeft||0:0,ke=(z=F==null?void 0:F[v])!=null?z:0,je=N+Ee-ke-Te,Oe=N+Ne-ke,de=qs(h?vl(_,je):_,N,h?ni(I,Oe):I);k[v]=de,B[v]=de-N}if(a){var Ke,Z=v==="x"?Dt:Lt,ne=v==="x"?tn:nn,Ce=k[S],H=S==="y"?"height":"width",ve=Ce+y[Z],Ge=Ce-y[ne],lt=[Dt,Lt].indexOf(b)!==-1,Wt=(Ke=F==null?void 0:F[S])!=null?Ke:0,V=lt?ve:Ce-C[H]-T[H]-Wt+D.altAxis,O=lt?Ce+C[H]+T[H]-Wt-D.altAxis:Ge,P=h&<?TT(V,Ce,O):qs(h?V:ve,Ce,h?O:Ge);k[S]=P,B[S]=P-Ce}e.modifiersData[r]=B}}const sA={name:"preventOverflow",enabled:!0,phase:"main",fn:iA,requiresIfExists:["offset"]};function oA(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function aA(t){return t===Ut(t)||!en(t)?ih(t):oA(t)}function lA(t){var e=t.getBoundingClientRect(),n=rs(e.width)/t.offsetWidth||1,r=rs(e.height)/t.offsetHeight||1;return n!==1||r!==1}function cA(t,e,n){n===void 0&&(n=!1);var r=en(e),i=en(e)&&lA(e),s=Pr(e),o=is(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((On(e)!=="body"||oh(s))&&(a=aA(e)),en(e)?(l=is(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=sh(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function dA(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function uA(t){var e=dA(t);return kT.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function fA(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function hA(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 Dm={placement:"bottom",modifiers:[],strategy:"absolute"};function Lm(){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 pA(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?Dm:i;return function(a,l,c){c===void 0&&(c=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Dm,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},u=[],f=!1,h={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;g(),d.options=Object.assign({},s,d.options,w),d.scrollParents={reference:fi(a)?Ys(a):a.contextElement?Ys(a.contextElement):[],popper:Ys(l)};var E=uA(hA([].concat(r,d.options.modifiers)));return d.orderedModifiers=E.filter(function(v){return v.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var b=d.elements,w=b.reference,E=b.popper;if(Lm(w,E)){d.rects={reference:cA(w,Jo(E),d.options.strategy==="fixed"),popper:nh(E)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(D){return d.modifiersData[D.name]=Object.assign({},D.data)});for(var v=0;v<d.orderedModifiers.length;v++){if(d.reset===!0){d.reset=!1,v=-1;continue}var S=d.orderedModifiers[v],k=S.fn,C=S.options,T=C===void 0?{}:C,M=S.name;typeof k=="function"&&(d=k({state:d,options:T,name:M,instance:h})||d)}}}},update:fA(function(){return new Promise(function(y){h.forceUpdate(),y(d)})}),destroy:function(){g(),f=!0}};if(!Lm(a,l))return h;h.setOptions(c).then(function(y){!f&&c.onFirstUpdate&&c.onFirstUpdate(y)});function m(){d.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,E=w===void 0?{}:w,v=y.effect;if(typeof v=="function"){var S=v({state:d,name:b,instance:h,options:E}),k=function(){};u.push(S||k)}})}function g(){u.forEach(function(y){return y()}),u=[]}return h}}var mA=[$T,nA,PT,G0,eA,YT,sA,RT,XT],gA=pA({defaultModifiers:mA}),yA="tippy-box",tv="tippy-content",bA="tippy-backdrop",nv="tippy-arrow",rv="tippy-svg-arrow",Kr={passive:!0,capture:!0},iv=function(){return document.body};function Md(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function ah(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function sv(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Pm(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function vA(t){return t.split(/\s+/).filter(Boolean)}function Li(t){return[].concat(t)}function Bm(t,e){t.indexOf(e)===-1&&t.push(e)}function xA(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function wA(t){return t.split("-")[0]}function xl(t){return[].slice.call(t)}function $m(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Js(){return document.createElement("div")}function Rc(t){return["Element","Fragment"].some(function(e){return ah(t,e)})}function EA(t){return ah(t,"NodeList")}function kA(t){return ah(t,"MouseEvent")}function SA(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function CA(t){return Rc(t)?[t]:EA(t)?xl(t):Array.isArray(t)?t:xl(document.querySelectorAll(t))}function Od(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function jm(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function _A(t){var e,n=Li(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function NA(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var s=i.popperRect,o=i.popperState,a=i.props,l=a.interactiveBorder,c=wA(o.placement),d=o.modifiersData.offset;if(!d)return!0;var u=c==="bottom"?d.top.y:0,f=c==="top"?d.bottom.y:0,h=c==="right"?d.left.x:0,m=c==="left"?d.right.x:0,g=s.top-r+u>l,y=r-s.bottom-f>l,b=s.left-n+h>l,w=n-s.right-m>l;return g||y||b||w})}function Rd(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Fm(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 xn={isTouch:!1},Hm=0;function TA(){xn.isTouch||(xn.isTouch=!0,window.performance&&document.addEventListener("mousemove",ov))}function ov(){var t=performance.now();t-Hm<20&&(xn.isTouch=!1,document.removeEventListener("mousemove",ov)),Hm=t}function AA(){var t=document.activeElement;if(SA(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function MA(){document.addEventListener("touchstart",TA,Kr),window.addEventListener("blur",AA)}var OA=typeof window<"u"&&typeof document<"u",RA=OA?!!window.msCrypto:!1,IA={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},DA={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},an=Object.assign({appendTo:iv,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},IA,DA),LA=Object.keys(an),PA=function(e){var n=Object.keys(e);n.forEach(function(r){an[r]=e[r]})};function av(t){var e=t.plugins||[],n=e.reduce(function(r,i){var s=i.name,o=i.defaultValue;if(s){var a;r[s]=t[s]!==void 0?t[s]:(a=an[s])!=null?a:o}return r},{});return Object.assign({},t,n)}function BA(t,e){var n=e?Object.keys(av(Object.assign({},an,{plugins:e}))):LA,r=n.reduce(function(i,s){var o=(t.getAttribute("data-tippy-"+s)||"").trim();if(!o)return i;if(s==="content")i[s]=o;else try{i[s]=JSON.parse(o)}catch{i[s]=o}return i},{});return r}function zm(t,e){var n=Object.assign({},e,{content:sv(e.content,[t])},e.ignoreAttributes?{}:BA(t,e.plugins));return n.aria=Object.assign({},an.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var $A=function(){return"innerHTML"};function Gu(t,e){t[$A()]=e}function Um(t){var e=Js();return t===!0?e.className=nv:(e.className=rv,Rc(t)?e.appendChild(t):Gu(e,t)),e}function Vm(t,e){Rc(e.content)?(Gu(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Gu(t,e.content):t.textContent=e.content)}function qu(t){var e=t.firstElementChild,n=xl(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(tv)}),arrow:n.find(function(r){return r.classList.contains(nv)||r.classList.contains(rv)}),backdrop:n.find(function(r){return r.classList.contains(bA)})}}function lv(t){var e=Js(),n=Js();n.className=yA,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Js();r.className=tv,r.setAttribute("data-state","hidden"),Vm(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(s,o){var a=qu(e),l=a.box,c=a.content,d=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&Vm(c,t.props),o.arrow?d?s.arrow!==o.arrow&&(l.removeChild(d),l.appendChild(Um(o.arrow))):l.appendChild(Um(o.arrow)):d&&l.removeChild(d)}return{popper:e,onUpdate:i}}lv.$$tippy=!0;var jA=1,ma=[],Id=[];function FA(t,e){var n=zm(t,Object.assign({},an,av($m(e)))),r,i,s,o=!1,a=!1,l=!1,c=!1,d,u,f,h=[],m=Pm(je,n.interactiveDebounce),g,y=jA++,b=null,w=xA(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:y,reference:t,popper:Js(),popperInstance:b,props:n,state:E,plugins:w,clearDelayTimeouts:V,setProps:O,setContent:P,show:Y,hide:fe,hideWithInteractivity:Ie,enable:lt,disable:Wt,unmount:Pt,destroy:Rs};if(!n.render)return v;var S=n.render(v),k=S.popper,C=S.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+v.id,v.popper=k,t._tippy=v,k._tippy=v;var T=w.map(function(R){return R.fn(v)}),M=t.hasAttribute("aria-expanded");return Me(),$(),N(),_("onCreate",[v]),n.showOnCreate&&ve(),k.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&W().addEventListener("mousemove",m)}),v;function D(){var R=v.props.touch;return Array.isArray(R)?R:[R,0]}function F(){return D()[0]==="hold"}function B(){var R;return!!((R=v.props.render)!=null&&R.$$tippy)}function z(){return g||t}function W(){var R=z().parentNode;return R?_A(R):document}function G(){return qu(k)}function A(R){return v.state.isMounted&&!v.state.isVisible||xn.isTouch||d&&d.type==="focus"?0:Md(v.props.delay,R?0:1,an.delay)}function N(R){R===void 0&&(R=!1),k.style.pointerEvents=v.props.interactive&&!R?"":"none",k.style.zIndex=""+v.props.zIndex}function _(R,oe,pe){if(pe===void 0&&(pe=!0),T.forEach(function(_e){_e[R]&&_e[R].apply(_e,oe)}),pe){var Re;(Re=v.props)[R].apply(Re,oe)}}function I(){var R=v.props.aria;if(R.content){var oe="aria-"+R.content,pe=k.id,Re=Li(v.props.triggerTarget||t);Re.forEach(function(_e){var kt=_e.getAttribute(oe);if(v.state.isVisible)_e.setAttribute(oe,kt?kt+" "+pe:pe);else{var Gt=kt&&kt.replace(pe,"").trim();Gt?_e.setAttribute(oe,Gt):_e.removeAttribute(oe)}})}}function $(){if(!(M||!v.props.aria.expanded)){var R=Li(v.props.triggerTarget||t);R.forEach(function(oe){v.props.interactive?oe.setAttribute("aria-expanded",v.state.isVisible&&oe===z()?"true":"false"):oe.removeAttribute("aria-expanded")})}}function q(){W().removeEventListener("mousemove",m),ma=ma.filter(function(R){return R!==m})}function se(R){if(!(xn.isTouch&&(l||R.type==="mousedown"))){var oe=R.composedPath&&R.composedPath()[0]||R.target;if(!(v.props.interactive&&Fm(k,oe))){if(Li(v.props.triggerTarget||t).some(function(pe){return Fm(pe,oe)})){if(xn.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else _("onClickOutside",[v,R]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||me())}}}function ae(){l=!0}function K(){l=!1}function X(){var R=W();R.addEventListener("mousedown",se,!0),R.addEventListener("touchend",se,Kr),R.addEventListener("touchstart",K,Kr),R.addEventListener("touchmove",ae,Kr)}function me(){var R=W();R.removeEventListener("mousedown",se,!0),R.removeEventListener("touchend",se,Kr),R.removeEventListener("touchstart",K,Kr),R.removeEventListener("touchmove",ae,Kr)}function he(R,oe){Ee(R,function(){!v.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&oe()})}function Se(R,oe){Ee(R,oe)}function Ee(R,oe){var pe=G().box;function Re(_e){_e.target===pe&&(Rd(pe,"remove",Re),oe())}if(R===0)return oe();Rd(pe,"remove",u),Rd(pe,"add",Re),u=Re}function Ne(R,oe,pe){pe===void 0&&(pe=!1);var Re=Li(v.props.triggerTarget||t);Re.forEach(function(_e){_e.addEventListener(R,oe,pe),h.push({node:_e,eventType:R,handler:oe,options:pe})})}function Me(){F()&&(Ne("touchstart",ke,{passive:!0}),Ne("touchend",Oe,{passive:!0})),vA(v.props.trigger).forEach(function(R){if(R!=="manual")switch(Ne(R,ke),R){case"mouseenter":Ne("mouseleave",Oe);break;case"focus":Ne(RA?"focusout":"blur",de);break;case"focusin":Ne("focusout",de);break}})}function Te(){h.forEach(function(R){var oe=R.node,pe=R.eventType,Re=R.handler,_e=R.options;oe.removeEventListener(pe,Re,_e)}),h=[]}function ke(R){var oe,pe=!1;if(!(!v.state.isEnabled||Ke(R)||a)){var Re=((oe=d)==null?void 0:oe.type)==="focus";d=R,g=R.currentTarget,$(),!v.state.isVisible&&kA(R)&&ma.forEach(function(_e){return _e(R)}),R.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||o)&&v.props.hideOnClick!==!1&&v.state.isVisible?pe=!0:ve(R),R.type==="click"&&(o=!pe),pe&&!Re&&Ge(R)}}function je(R){var oe=R.target,pe=z().contains(oe)||k.contains(oe);if(!(R.type==="mousemove"&&pe)){var Re=H().concat(k).map(function(_e){var kt,Gt=_e._tippy,Ei=(kt=Gt.popperInstance)==null?void 0:kt.state;return Ei?{popperRect:_e.getBoundingClientRect(),popperState:Ei,props:n}:null}).filter(Boolean);NA(Re,R)&&(q(),Ge(R))}}function Oe(R){var oe=Ke(R)||v.props.trigger.indexOf("click")>=0&&o;if(!oe){if(v.props.interactive){v.hideWithInteractivity(R);return}Ge(R)}}function de(R){v.props.trigger.indexOf("focusin")<0&&R.target!==z()||v.props.interactive&&R.relatedTarget&&k.contains(R.relatedTarget)||Ge(R)}function Ke(R){return xn.isTouch?F()!==R.type.indexOf("touch")>=0:!1}function Z(){ne();var R=v.props,oe=R.popperOptions,pe=R.placement,Re=R.offset,_e=R.getReferenceClientRect,kt=R.moveTransition,Gt=B()?qu(k).arrow:null,Ei=_e?{getBoundingClientRect:_e,contextElement:_e.contextElement||z()}:t,xp={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ia){var ki=ia.state;if(B()){var ok=G(),ud=ok.box;["placement","reference-hidden","escaped"].forEach(function(sa){sa==="placement"?ud.setAttribute("data-placement",ki.placement):ki.attributes.popper["data-popper-"+sa]?ud.setAttribute("data-"+sa,""):ud.removeAttribute("data-"+sa)}),ki.attributes.popper={}}}},Hr=[{name:"offset",options:{offset:Re}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!kt}},xp];B()&&Gt&&Hr.push({name:"arrow",options:{element:Gt,padding:3}}),Hr.push.apply(Hr,(oe==null?void 0:oe.modifiers)||[]),v.popperInstance=gA(Ei,k,Object.assign({},oe,{placement:pe,onFirstUpdate:f,modifiers:Hr}))}function ne(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Ce(){var R=v.props.appendTo,oe,pe=z();v.props.interactive&&R===iv||R==="parent"?oe=pe.parentNode:oe=sv(R,[pe]),oe.contains(k)||oe.appendChild(k),v.state.isMounted=!0,Z()}function H(){return xl(k.querySelectorAll("[data-tippy-root]"))}function ve(R){v.clearDelayTimeouts(),R&&_("onTrigger",[v,R]),X();var oe=A(!0),pe=D(),Re=pe[0],_e=pe[1];xn.isTouch&&Re==="hold"&&_e&&(oe=_e),oe?r=setTimeout(function(){v.show()},oe):v.show()}function Ge(R){if(v.clearDelayTimeouts(),_("onUntrigger",[v,R]),!v.state.isVisible){me();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(R.type)>=0&&o)){var oe=A(!1);oe?i=setTimeout(function(){v.state.isVisible&&v.hide()},oe):s=requestAnimationFrame(function(){v.hide()})}}function lt(){v.state.isEnabled=!0}function Wt(){v.hide(),v.state.isEnabled=!1}function V(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(s)}function O(R){if(!v.state.isDestroyed){_("onBeforeUpdate",[v,R]),Te();var oe=v.props,pe=zm(t,Object.assign({},oe,$m(R),{ignoreAttributes:!0}));v.props=pe,Me(),oe.interactiveDebounce!==pe.interactiveDebounce&&(q(),m=Pm(je,pe.interactiveDebounce)),oe.triggerTarget&&!pe.triggerTarget?Li(oe.triggerTarget).forEach(function(Re){Re.removeAttribute("aria-expanded")}):pe.triggerTarget&&t.removeAttribute("aria-expanded"),$(),N(),C&&C(oe,pe),v.popperInstance&&(Z(),H().forEach(function(Re){requestAnimationFrame(Re._tippy.popperInstance.forceUpdate)})),_("onAfterUpdate",[v,R])}}function P(R){v.setProps({content:R})}function Y(){var R=v.state.isVisible,oe=v.state.isDestroyed,pe=!v.state.isEnabled,Re=xn.isTouch&&!v.props.touch,_e=Md(v.props.duration,0,an.duration);if(!(R||oe||pe||Re)&&!z().hasAttribute("disabled")&&(_("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,B()&&(k.style.visibility="visible"),N(),X(),v.state.isMounted||(k.style.transition="none"),B()){var kt=G(),Gt=kt.box,Ei=kt.content;Od([Gt,Ei],0)}f=function(){var Hr;if(!(!v.state.isVisible||c)){if(c=!0,k.offsetHeight,k.style.transition=v.props.moveTransition,B()&&v.props.animation){var dd=G(),ia=dd.box,ki=dd.content;Od([ia,ki],_e),jm([ia,ki],"visible")}I(),$(),Bm(Id,v),(Hr=v.popperInstance)==null||Hr.forceUpdate(),_("onMount",[v]),v.props.animation&&B()&&Se(_e,function(){v.state.isShown=!0,_("onShown",[v])})}},Ce()}}function fe(){var R=!v.state.isVisible,oe=v.state.isDestroyed,pe=!v.state.isEnabled,Re=Md(v.props.duration,1,an.duration);if(!(R||oe||pe)&&(_("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,c=!1,o=!1,B()&&(k.style.visibility="hidden"),q(),me(),N(!0),B()){var _e=G(),kt=_e.box,Gt=_e.content;v.props.animation&&(Od([kt,Gt],Re),jm([kt,Gt],"hidden"))}I(),$(),v.props.animation?B()&&he(Re,v.unmount):v.unmount()}}function Ie(R){W().addEventListener("mousemove",m),Bm(ma,m),m(R)}function Pt(){v.state.isVisible&&v.hide(),v.state.isMounted&&(ne(),H().forEach(function(R){R._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Id=Id.filter(function(R){return R!==v}),v.state.isMounted=!1,_("onHidden",[v]))}function Rs(){v.state.isDestroyed||(v.clearDelayTimeouts(),v.unmount(),Te(),delete t._tippy,v.state.isDestroyed=!0,_("onDestroy",[v]))}}function Br(t,e){e===void 0&&(e={});var n=an.plugins.concat(e.plugins||[]);MA();var r=Object.assign({},e,{plugins:n}),i=CA(t),s=i.reduce(function(o,a){var l=a&&FA(a,r);return l&&o.push(l),o},[]);return Rc(t)?s[0]:s}Br.defaultProps=an;Br.setDefaultProps=PA;Br.currentInput=xn;Object.assign({},G0,{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 mi={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 s(c){return e.props.sticky===!0||e.props.sticky===c}var o=null,a=null;function l(){var c=s("reference")?i().getBoundingClientRect():null,d=s("popper")?r.getBoundingClientRect():null;(c&&Km(o,c)||d&&Km(a,d))&&e.popperInstance&&e.popperInstance.update(),o=c,a=d,e.state.isMounted&&requestAnimationFrame(l)}return{onMount:function(){e.props.sticky&&l()}}}};function Km(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}Br.setDefaultProps({render:lv});class HA{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:s=250,shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:d})=>{const{doc:u,selection:f}=l,{empty:h}=f,m=!u.textBetween(c,d).length&&Tc(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||h||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),d=!(l!=null&&l.doc.eq(a.state.doc));!c&&!d||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,d,l)},this.updateDelay))},this.updateHandler=(a,l,c,d)=>{var u,f,h;const{state:m,composing:g}=a,{selection:y}=m;if(g||!l&&!c)return;this.createTooltip();const{ranges:w}=y,E=Math.min(...w.map(k=>k.$from.pos)),v=Math.max(...w.map(k=>k.$to.pos));if(!((u=this.shouldShow)===null||u===void 0?void 0:u.call(this,{editor:this.editor,element:this.element,view:a,state:m,oldState:d,from:E,to:v}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(U0(m.selection)){let k=a.nodeDOM(E);if(k){const C=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(C&&(k=C.firstChild),k)return k.getBoundingClientRect()}}return ON(a,E,v)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.element.tabIndex=0,!(this.tippy||!n)&&(this.tippy=Br(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const s=!(n!=null&&n.selection.eq(e.state.selection)),o=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,s,o,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const cv=t=>new $e({key:typeof t.pluginKey=="string"?new Be(t.pluginKey):t.pluginKey,view:e=>new HA({view:e,...t})});We.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[cv({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});function zA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var dv={exports:{}},Dd={};/**
|
|
90
|
+
* @license React
|
|
91
|
+
* use-sync-external-store-shim.production.min.js
|
|
92
|
+
*
|
|
93
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the MIT license found in the
|
|
96
|
+
* LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/var Wm;function UA(){if(Wm)return Dd;Wm=1;var t=Q;function e(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(u,f){var h=f(),m=r({inst:{value:h,getSnapshot:f}}),g=m[0].inst,y=m[1];return s(function(){g.value=h,g.getSnapshot=f,l(g)&&y({inst:g})},[u,h,f]),i(function(){return l(g)&&y({inst:g}),u(function(){l(g)&&y({inst:g})})},[u]),o(h),h}function l(u){var f=u.getSnapshot;u=u.value;try{var h=f();return!n(u,h)}catch{return!0}}function c(u,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Dd.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Dd}dv.exports=UA();var lh=dv.exports;const VA=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},KA=({contentComponent:t})=>{const e=lh.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return Q.createElement(Q.Fragment,null,Object.values(e))};function WA(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:tb.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class GA extends Q.Component{constructor(e){var n;super(e),this.editorContentRef=Q.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=WA(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return Q.createElement(Q.Fragment,null,Q.createElement("div",{ref:VA(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&Q.createElement(KA,{contentComponent:e.contentComponent}))}}const qA=x.forwardRef((t,e)=>{const n=Q.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Q.createElement(GA,{key:n,innerRef:e,...t})}),YA=Q.memo(qA);var JA=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n},XA=zA(JA),uv={exports:{}},Ld={};/**
|
|
98
|
+
* @license React
|
|
99
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
100
|
+
*
|
|
101
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the MIT license found in the
|
|
104
|
+
* LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/var Gm;function ZA(){if(Gm)return Ld;Gm=1;var t=Q,e=lh;function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Ld.useSyncExternalStoreWithSelector=function(c,d,u,f,h){var m=s(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function b(k){if(!w){if(w=!0,E=k,k=f(k),h!==void 0&&g.hasValue){var C=g.value;if(h(C,k))return v=C}return v=k}if(C=v,r(E,k))return C;var T=f(k);return h!==void 0&&h(C,T)?C:(E=k,v=T)}var w=!1,E,v,S=u===void 0?null:u;return[function(){return b(d())},S===null?void 0:function(){return b(S())}]},[d,u,f,h]);var y=i(c,m[0],m[1]);return o(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},Ld}uv.exports=ZA();var QA=uv.exports;const eM=typeof window<"u"?x.useLayoutEffect:x.useEffect;class tM{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function In(t){var e;const[n]=x.useState(()=>new tM(t.editor)),r=QA.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:XA);return eM(()=>n.watch(t.editor),[t.editor,n]),x.useDebugValue(r),r}const nM=!1,Yu=typeof window>"u",rM=Yu||!!(typeof window<"u"&&window.next);class ch{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?Yu||rM?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...r)}};return new lT(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=n.extensions)===null||o===void 0?void 0:o[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?ch.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function iM(t={},e=[]){const n=x.useRef(t);n.current=t;const[r]=x.useState(()=>new ch(n)),i=lh.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return x.useDebugValue(i),x.useEffect(r.onRender(e)),In({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const fv=x.createContext({editor:null});fv.Consumer;const sM=()=>x.useContext(fv),rr=t=>{const[e,n]=x.useState(null),{editor:r}=sM();return x.useEffect(()=>{var i;if(!e||!((i=t.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:s="bubbleMenu",editor:o,tippyOptions:a={},updateDelay:l,shouldShow:c=null}=t,d=o||r;if(!d){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const u=cv({updateDelay:l,editor:d,element:e,pluginKey:s,shouldShow:c,tippyOptions:a});return d.registerPlugin(u),()=>{d.unregisterPlugin(s)}},[t.editor,r,e]),Q.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},hv=x.createContext({onDragStart:void 0}),pv=()=>x.useContext(hv),mv=t=>{const e=t.as||"div",{nodeViewContentRef:n}=pv();return Q.createElement(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style}})},gi=Q.forwardRef((t,e)=>{const{onDragStart:n}=pv(),r=t.as||"div";return Q.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function qm(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function Ym(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function oM(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function aM(t){if(qm(t)||Ym(t))return!0;if(oM(t)){const e=t.type;if(e)return qm(e)||Ym(e)}return!1}function lM(){try{if(x.version)return parseInt(x.version.split(".")[0],10)>=19}catch{}return!1}class dh{constructor(e,{editor:n,props:r={},as:i="div",className:s=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isInitialized?Mf.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var e;const n=this.component,r=this.props,i=this.editor,s=lM(),o=aM(n),a={...r};a.ref&&!(s||o)&&delete a.ref,!a.ref&&(s||o)&&(a.ref=l=>{this.ref=l}),this.reactElement=Q.createElement(n,{...a}),(e=i==null?void 0:i.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n==null?void 0:n.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(n=>{this.element.setAttribute(n,e[n])})}}class cM extends cT{constructor(e,n,r){if(super(e,n,r),!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const i=this.dom.querySelector("[data-node-view-content]");if(!i)return;i.appendChild(this.contentDOMElement)}}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode(),ref:x.createRef()};if(!this.component.displayName){const c=d=>d.charAt(0).toUpperCase()+d.substring(1);this.component.displayName=c(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&(c.hasAttribute("data-node-view-wrapper")&&c.removeAttribute("data-node-view-wrapper"),c.appendChild(this.contentDOMElement))}},s=this.component,o=x.memo(c=>Q.createElement(hv.Provider,{value:i},x.createElement(s,c)));o.displayName="ReactNodeView";let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new dh(o,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const i=s=>{this.renderer.updateProps(s),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const s=this.node,o=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:s,oldDecorations:o,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>i({node:e,decorations:n,innerDecorations:r})})}return e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,i({node:e,decorations:n,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=yl(this.node,n);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function yi(t,e){return n=>n.editor.contentComponent?new cM(t,n,e):{}}const ct=[];for(let t=0;t<256;++t)ct.push((t+256).toString(16).slice(1));function dM(t,e=0){return(ct[t[e+0]]+ct[t[e+1]]+ct[t[e+2]]+ct[t[e+3]]+"-"+ct[t[e+4]]+ct[t[e+5]]+"-"+ct[t[e+6]]+ct[t[e+7]]+"-"+ct[t[e+8]]+ct[t[e+9]]+"-"+ct[t[e+10]]+ct[t[e+11]]+ct[t[e+12]]+ct[t[e+13]]+ct[t[e+14]]+ct[t[e+15]]).toLowerCase()}let Pd;const uM=new Uint8Array(16);function fM(){if(!Pd){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Pd=crypto.getRandomValues.bind(crypto)}return Pd(uM)}const hM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jm={randomUUID:hM};function wo(t,e,n){var i;if(Jm.randomUUID&&!t)return Jm.randomUUID();t=t||{};const r=t.random??((i=t.rng)==null?void 0:i.call(t))??fM();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,dM(r)}var pM=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n};const $r=nb(pM);function gv(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=gv(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function mM(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=gv(t))&&(r&&(r+=" "),r+=e);return r}function At(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Xm(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function uh(...t){return e=>{let n=!1;const r=t.map(i=>{const s=Xm(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Xm(t[i],null)}}}}function Dn(...t){return x.useCallback(uh(...t),t)}function fh(t,e=[]){let n=[];function r(s,o){const a=x.createContext(o),l=n.length;n=[...n,o];const c=u=>{var b;const{scope:f,children:h,...m}=u,g=((b=f==null?void 0:f[t])==null?void 0:b[l])||a,y=x.useMemo(()=>m,Object.values(m));return p.jsx(g.Provider,{value:y,children:h})};c.displayName=s+"Provider";function d(u,f){var g;const h=((g=f==null?void 0:f[t])==null?void 0:g[l])||a,m=x.useContext(h);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[c,d]}const i=()=>{const s=n.map(o=>x.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return x.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,gM(i,...e)]}function gM(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...a,...u}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function yv(t){const e=yM(t),n=x.forwardRef((r,i)=>{const{children:s,...o}=r,a=x.Children.toArray(s),l=a.find(vM);if(l){const c=l.props.children,d=a.map(u=>u===l?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:u);return p.jsx(e,{...o,ref:i,children:x.isValidElement(c)?x.cloneElement(c,void 0,d):null})}return p.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function yM(t){const e=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const o=wM(i),a=xM(s,i.props);return i.type!==x.Fragment&&(a.ref=r?uh(r,o):o),x.cloneElement(i,a)}return x.Children.count(i)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var bv=Symbol("radix.slottable");function bM(t){const e=({children:n})=>p.jsx(p.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=bv,e}function vM(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===bv}function xM(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function wM(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var EM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=EM.reduce((t,e)=>{const n=yv(`Primitive.${e}`),r=x.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function kM(t,e){t&&Mf.flushSync(()=>t.dispatchEvent(e))}function as(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function SM(t,e=globalThis==null?void 0:globalThis.document){const n=as(t);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var CM="DismissableLayer",Ju="dismissableLayer.update",_M="dismissableLayer.pointerDownOutside",NM="dismissableLayer.focusOutside",Zm,vv=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hh=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,c=x.useContext(vv),[d,u]=x.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=x.useState({}),m=Dn(e,C=>u(C)),g=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(y),w=d?g.indexOf(d):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,v=w>=b,S=MM(C=>{const T=C.target,M=[...c.branches].some(D=>D.contains(T));!v||M||(i==null||i(C),o==null||o(C),C.defaultPrevented||a==null||a())},f),k=OM(C=>{const T=C.target;[...c.branches].some(D=>D.contains(T))||(s==null||s(C),o==null||o(C),C.defaultPrevented||a==null||a())},f);return SM(C=>{w===c.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),x.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Zm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Qm(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Zm)}},[d,f,n,c]),x.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Qm())},[d,c]),x.useEffect(()=>{const C=()=>h({});return document.addEventListener(Ju,C),()=>document.removeEventListener(Ju,C)},[]),p.jsx(pn.div,{...l,ref:m,style:{pointerEvents:E?v?"auto":"none":void 0,...t.style},onFocusCapture:At(t.onFocusCapture,k.onFocusCapture),onBlurCapture:At(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:At(t.onPointerDownCapture,S.onPointerDownCapture)})});hh.displayName=CM;var TM="DismissableLayerBranch",AM=x.forwardRef((t,e)=>{const n=x.useContext(vv),r=x.useRef(null),i=Dn(e,r);return x.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(pn.div,{...t,ref:i})});AM.displayName=TM;function MM(t,e=globalThis==null?void 0:globalThis.document){const n=as(t),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){xv(_M,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function OM(t,e=globalThis==null?void 0:globalThis.document){const n=as(t),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&xv(NM,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qm(){const t=new CustomEvent(Ju);document.dispatchEvent(t)}function xv(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?kM(i,s):i.dispatchEvent(s)}var Tr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},RM=Of[" useId ".trim().toString()]||(()=>{}),IM=0;function wv(t){const[e,n]=x.useState(RM());return Tr(()=>{n(r=>r??String(IM++))},[t]),t||(e?`radix-${e}`:"")}const DM=["top","right","bottom","left"],Ar=Math.min,$t=Math.max,wl=Math.round,ga=Math.floor,Nn=t=>({x:t,y:t}),LM={left:"right",right:"left",bottom:"top",top:"bottom"};function Xu(t,e,n){return $t(t,Ar(e,n))}function Xn(t,e){return typeof t=="function"?t(e):t}function Zn(t){return t.split("-")[0]}function ws(t){return t.split("-")[1]}function ph(t){return t==="x"?"y":"x"}function mh(t){return t==="y"?"height":"width"}function Sn(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function gh(t){return ph(Sn(t))}function PM(t,e,n){n===void 0&&(n=!1);const r=ws(t),i=gh(t),s=mh(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=El(o)),[o,El(o)]}function BM(t){const e=El(t);return[Zu(t),e,Zu(e)]}function Zu(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const eg=["left","right"],tg=["right","left"],$M=["top","bottom"],jM=["bottom","top"];function FM(t,e,n){switch(t){case"top":case"bottom":return n?e?tg:eg:e?eg:tg;case"left":case"right":return e?$M:jM;default:return[]}}function HM(t,e,n,r){const i=ws(t);let s=FM(Zn(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Zu)))),s}function El(t){const e=Zn(t);return LM[e]+t.slice(e.length)}function zM(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ev(t){return typeof t!="number"?zM(t):{top:t,right:t,bottom:t,left:t}}function kl(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 ng(t,e,n){let{reference:r,floating:i}=t;const s=Sn(e),o=gh(e),a=mh(o),l=Zn(e),c=s==="y",d=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:d,y:r.y-i.height};break;case"bottom":h={x:d,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(ws(e)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}async function UM(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:h=0}=Xn(e,t),m=Ev(h),y=a[f?u==="floating"?"reference":"floating":u],b=kl(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),w=u==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),v=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},S=kl(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:E,strategy:l}):w);return{top:(b.top-S.top+m.top)/v.y,bottom:(S.bottom-b.bottom+m.bottom)/v.y,left:(b.left-S.left+m.left)/v.x,right:(S.right-b.right+m.right)/v.x}}const VM=50,KM=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:UM},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=ng(c,r,l),f=r,h=0;const m={};for(let g=0;g<s.length;g++){const y=s[g];if(!y)continue;const{name:b,fn:w}=y,{x:E,y:v,data:S,reset:k}=await w({x:d,y:u,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:t,floating:e}});d=E??d,u=v??u,m[b]={...m[b],...S},k&&h<VM&&(h++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(c=k.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:d,y:u}=ng(c,f,l)),g=-1)}return{x:d,y:u,placement:f,strategy:i,middlewareData:m}},WM=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=Xn(t,e)||{};if(c==null)return{};const u=Ev(d),f={x:n,y:r},h=gh(i),m=mh(h),g=await o.getDimensions(c),y=h==="y",b=y?"top":"left",w=y?"bottom":"right",E=y?"clientHeight":"clientWidth",v=s.reference[m]+s.reference[h]-f[h]-s.floating[m],S=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let C=k?k[E]:0;(!C||!await(o.isElement==null?void 0:o.isElement(k)))&&(C=a.floating[E]||s.floating[m]);const T=v/2-S/2,M=C/2-g[m]/2-1,D=Ar(u[b],M),F=Ar(u[w],M),B=D,z=C-g[m]-F,W=C/2-g[m]/2+T,G=Xu(B,W,z),A=!l.arrow&&ws(i)!=null&&W!==G&&s.reference[m]/2-(W<B?D:F)-g[m]/2<0,N=A?W<B?W-B:W-z:0;return{[h]:f[h]+N,data:{[h]:G,centerOffset:W-G-N,...A&&{alignmentOffset:N}},reset:A}}}),GM=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Xn(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Zn(i),w=Sn(a),E=Zn(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(E||!g?[El(a)]:BM(a)),k=m!=="none";!f&&k&&S.push(...HM(a,g,m,v));const C=[a,...S],T=await l.detectOverflow(e,y),M=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&M.push(T[b]),u){const W=PM(i,o,v);M.push(T[W[0]],T[W[1]])}if(D=[...D,{placement:i,overflows:M}],!M.every(W=>W<=0)){var F,B;const W=(((F=s.flip)==null?void 0:F.index)||0)+1,G=C[W];if(G&&(!(u==="alignment"?w!==Sn(G):!1)||D.every(_=>Sn(_.placement)===w?_.overflows[0]>0:!0)))return{data:{index:W,overflows:D},reset:{placement:G}};let A=(B=D.filter(N=>N.overflows[0]<=0).sort((N,_)=>N.overflows[1]-_.overflows[1])[0])==null?void 0:B.placement;if(!A)switch(h){case"bestFit":{var z;const N=(z=D.filter(_=>{if(k){const I=Sn(_.placement);return I===w||I==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(I=>I>0).reduce((I,$)=>I+$,0)]).sort((_,I)=>_[1]-I[1])[0])==null?void 0:z[0];N&&(A=N);break}case"initialPlacement":A=a;break}if(i!==A)return{reset:{placement:A}}}return{}}}};function rg(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ig(t){return DM.some(e=>t[e]>=0)}const qM=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=Xn(t,e);switch(i){case"referenceHidden":{const o=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=rg(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ig(a)}}}case"escaped":{const o=await r.detectOverflow(e,{...s,altBoundary:!0}),a=rg(o,n.floating);return{data:{escapedOffsets:a,escaped:ig(a)}}}default:return{}}}}},kv=new Set(["left","top"]);async function YM(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Zn(n),a=ws(n),l=Sn(n)==="y",c=kv.has(o)?-1:1,d=s&&l?-1:1,u=Xn(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*d,y:f*c}:{x:f*c,y:h*d}}const JM=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await YM(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},XM=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:w,y:E}=b;return{x:w,y:E}}},...c}=Xn(t,e),d={x:n,y:r},u=await s.detectOverflow(e,c),f=Sn(Zn(i)),h=ph(f);let m=d[h],g=d[f];if(o){const b=h==="y"?"top":"left",w=h==="y"?"bottom":"right",E=m+u[b],v=m-u[w];m=Xu(E,m,v)}if(a){const b=f==="y"?"top":"left",w=f==="y"?"bottom":"right",E=g+u[b],v=g-u[w];g=Xu(E,g,v)}const y=l.fn({...e,[h]:m,[f]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:o,[f]:a}}}}}},ZM=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Xn(t,e),d={x:n,y:r},u=Sn(i),f=ph(u);let h=d[f],m=d[u];const g=Xn(a,e),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const E=f==="y"?"height":"width",v=s.reference[f]-s.floating[E]+y.mainAxis,S=s.reference[f]+s.reference[E]-y.mainAxis;h<v?h=v:h>S&&(h=S)}if(c){var b,w;const E=f==="y"?"width":"height",v=kv.has(Zn(i)),S=s.reference[u]-s.floating[E]+(v&&((b=o.offset)==null?void 0:b[u])||0)+(v?0:y.crossAxis),k=s.reference[u]+s.reference[E]+(v?0:((w=o.offset)==null?void 0:w[u])||0)-(v?y.crossAxis:0);m<S?m=S:m>k&&(m=k)}return{[f]:h,[u]:m}}}},QM=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=Xn(t,e),d=await o.detectOverflow(e,c),u=Zn(i),f=ws(i),h=Sn(i)==="y",{width:m,height:g}=s.floating;let y,b;u==="top"||u==="bottom"?(y=u,b=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,y=f==="end"?"top":"bottom");const w=g-d.top-d.bottom,E=m-d.left-d.right,v=Ar(g-d[y],w),S=Ar(m-d[b],E),k=!e.middlewareData.shift;let C=v,T=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(T=E),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(C=w),k&&!f){const D=$t(d.left,0),F=$t(d.right,0),B=$t(d.top,0),z=$t(d.bottom,0);h?T=m-2*(D!==0||F!==0?D+F:$t(d.left,d.right)):C=g-2*(B!==0||z!==0?B+z:$t(d.top,d.bottom))}await l({...e,availableWidth:T,availableHeight:C});const M=await o.getDimensions(a.floating);return m!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Ic(){return typeof window<"u"}function Es(t){return Sv(t)?(t.nodeName||"").toLowerCase():"#document"}function zt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ln(t){var e;return(e=(Sv(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Sv(t){return Ic()?t instanceof Node||t instanceof zt(t).Node:!1}function fn(t){return Ic()?t instanceof Element||t instanceof zt(t).Element:!1}function ir(t){return Ic()?t instanceof HTMLElement||t instanceof zt(t).HTMLElement:!1}function sg(t){return!Ic()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof zt(t).ShadowRoot}function Xo(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=hn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function eO(t){return/^(table|td|th)$/.test(Es(t))}function Dc(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const tO=/transform|translate|scale|rotate|perspective|filter/,nO=/paint|layout|strict|content/,zr=t=>!!t&&t!=="none";let Bd;function yh(t){const e=fn(t)?hn(t):t;return zr(e.transform)||zr(e.translate)||zr(e.scale)||zr(e.rotate)||zr(e.perspective)||!bh()&&(zr(e.backdropFilter)||zr(e.filter))||tO.test(e.willChange||"")||nO.test(e.contain||"")}function rO(t){let e=Mr(t);for(;ir(e)&&!ls(e);){if(yh(e))return e;if(Dc(e))return null;e=Mr(e)}return null}function bh(){return Bd==null&&(Bd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Bd}function ls(t){return/^(html|body|#document)$/.test(Es(t))}function hn(t){return zt(t).getComputedStyle(t)}function Lc(t){return fn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Mr(t){if(Es(t)==="html")return t;const e=t.assignedSlot||t.parentNode||sg(t)&&t.host||Ln(t);return sg(e)?e.host:e}function Cv(t){const e=Mr(t);return ls(e)?t.ownerDocument?t.ownerDocument.body:t.body:ir(e)&&Xo(e)?e:Cv(e)}function Eo(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Cv(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=zt(i);if(s){const a=Qu(o);return e.concat(o,o.visualViewport||[],Xo(i)?i:[],a&&n?Eo(a):[])}else return e.concat(i,Eo(i,[],n))}function Qu(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function _v(t){const e=hn(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ir(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=wl(n)!==s||wl(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function vh(t){return fn(t)?t:t.contextElement}function Vi(t){const e=vh(t);if(!ir(e))return Nn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=_v(e);let o=(s?wl(n.width):n.width)/r,a=(s?wl(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const iO=Nn(0);function Nv(t){const e=zt(t);return!bh()||!e.visualViewport?iO:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function sO(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==zt(t)?!1:e}function hi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=vh(t);let o=Nn(1);e&&(r?fn(r)&&(o=Vi(r)):o=Vi(t));const a=sO(s,n,r)?Nv(s):Nn(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,d=i.width/o.x,u=i.height/o.y;if(s){const f=zt(s),h=r&&fn(r)?zt(r):r;let m=f,g=Qu(m);for(;g&&r&&h!==m;){const y=Vi(g),b=g.getBoundingClientRect(),w=hn(g),E=b.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,v=b.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,c*=y.y,d*=y.x,u*=y.y,l+=E,c+=v,m=zt(g),g=Qu(m)}}return kl({width:d,height:u,x:l,y:c})}function Pc(t,e){const n=Lc(t).scrollLeft;return e?e.left+n:hi(Ln(t)).left+n}function Tv(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Pc(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function oO(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Ln(r),a=e?Dc(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Nn(1);const d=Nn(0),u=ir(r);if((u||!u&&!s)&&((Es(r)!=="body"||Xo(o))&&(l=Lc(r)),u)){const h=hi(r);c=Vi(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const f=o&&!u&&!s?Tv(o,l):Nn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}}function aO(t){return Array.from(t.getClientRects())}function lO(t){const e=Ln(t),n=Lc(t),r=t.ownerDocument.body,i=$t(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=$t(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Pc(t);const a=-n.scrollTop;return hn(r).direction==="rtl"&&(o+=$t(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const og=25;function cO(t,e){const n=zt(t),r=Ln(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const d=bh();(!d||d&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=Pc(r);if(c<=0){const d=r.ownerDocument,u=d.body,f=getComputedStyle(u),h=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-h);m<=og&&(s-=m)}else c<=og&&(s+=c);return{width:s,height:o,x:a,y:l}}function dO(t,e){const n=hi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=ir(t)?Vi(t):Nn(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function ag(t,e,n){let r;if(e==="viewport")r=cO(t,n);else if(e==="document")r=lO(Ln(t));else if(fn(e))r=dO(e,n);else{const i=Nv(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return kl(r)}function Av(t,e){const n=Mr(t);return n===e||!fn(n)||ls(n)?!1:hn(n).position==="fixed"||Av(n,e)}function uO(t,e){const n=e.get(t);if(n)return n;let r=Eo(t,[],!1).filter(a=>fn(a)&&Es(a)!=="body"),i=null;const s=hn(t).position==="fixed";let o=s?Mr(t):t;for(;fn(o)&&!ls(o);){const a=hn(o),l=yh(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Xo(o)&&!l&&Av(t,o))?r=r.filter(d=>d!==o):i=a,o=Mr(o)}return e.set(t,r),r}function fO(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?Dc(e)?[]:uO(e,this._c):[].concat(n),r],a=ag(e,o[0],i);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let f=1;f<o.length;f++){const h=ag(e,o[f],i);l=$t(h.top,l),c=Ar(h.right,c),d=Ar(h.bottom,d),u=$t(h.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function hO(t){const{width:e,height:n}=_v(t);return{width:e,height:n}}function pO(t,e,n){const r=ir(e),i=Ln(e),s=n==="fixed",o=hi(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Nn(0);function c(){l.x=Pc(i)}if(r||!r&&!s)if((Es(e)!=="body"||Xo(i))&&(a=Lc(e)),r){const h=hi(e,!0,s,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&c();s&&!r&&i&&c();const d=i&&!r&&!s?Tv(i,a):Nn(0),u=o.left+a.scrollLeft-l.x-d.x,f=o.top+a.scrollTop-l.y-d.y;return{x:u,y:f,width:o.width,height:o.height}}function $d(t){return hn(t).position==="static"}function lg(t,e){if(!ir(t)||hn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ln(t)===n&&(n=n.ownerDocument.body),n}function Mv(t,e){const n=zt(t);if(Dc(t))return n;if(!ir(t)){let i=Mr(t);for(;i&&!ls(i);){if(fn(i)&&!$d(i))return i;i=Mr(i)}return n}let r=lg(t,e);for(;r&&eO(r)&&$d(r);)r=lg(r,e);return r&&ls(r)&&$d(r)&&!yh(r)?n:r||rO(t)||n}const mO=async function(t){const e=this.getOffsetParent||Mv,n=this.getDimensions,r=await n(t.floating);return{reference:pO(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gO(t){return hn(t).direction==="rtl"}const yO={convertOffsetParentRelativeRectToViewportRelativeRect:oO,getDocumentElement:Ln,getClippingRect:fO,getOffsetParent:Mv,getElementRects:mO,getClientRects:aO,getDimensions:hO,getScale:Vi,isElement:fn,isRTL:gO};function Ov(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function bO(t,e){let n=null,r;const i=Ln(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=t.getBoundingClientRect(),{left:d,top:u,width:f,height:h}=c;if(a||e(),!f||!h)return;const m=ga(u),g=ga(i.clientWidth-(d+f)),y=ga(i.clientHeight-(u+h)),b=ga(d),E={rootMargin:-m+"px "+-g+"px "+-y+"px "+-b+"px",threshold:$t(0,Ar(1,l))||1};let v=!0;function S(k){const C=k[0].intersectionRatio;if(C!==l){if(!v)return o();C?o(!1,C):r=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!Ov(c,t.getBoundingClientRect())&&o(),v=!1}try{n=new IntersectionObserver(S,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,E)}n.observe(t)}return o(!0),s}function vO(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=vh(t),d=i||s?[...c?Eo(c):[],...e?Eo(e):[]]:[];d.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const u=c&&a?bO(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(b=>{let[w]=b;w&&w.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var E;(E=h)==null||E.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let m,g=l?hi(t):null;l&&y();function y(){const b=hi(t);g&&!Ov(g,b)&&n(),g=b,m=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(w=>{i&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),u==null||u(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const xO=JM,wO=XM,EO=GM,kO=QM,SO=qM,cg=WM,CO=ZM,_O=(t,e,n)=>{const r=new Map,i={platform:yO,...n},s={...i.platform,_c:r};return KM(t,e,{...i,platform:s})};var NO=typeof document<"u",TO=function(){},Ya=NO?x.useLayoutEffect:TO;function Sl(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(!Sl(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 s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Sl(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function Rv(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function dg(t,e){const n=Rv(t);return Math.round(e*n)/n}function jd(t){const e=x.useRef(t);return Ya(()=>{e.current=t}),e}function AO(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,u]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=x.useState(r);Sl(f,r)||h(r);const[m,g]=x.useState(null),[y,b]=x.useState(null),w=x.useCallback(_=>{_!==k.current&&(k.current=_,g(_))},[]),E=x.useCallback(_=>{_!==C.current&&(C.current=_,b(_))},[]),v=s||m,S=o||y,k=x.useRef(null),C=x.useRef(null),T=x.useRef(d),M=l!=null,D=jd(l),F=jd(i),B=jd(c),z=x.useCallback(()=>{if(!k.current||!C.current)return;const _={placement:e,strategy:n,middleware:f};F.current&&(_.platform=F.current),_O(k.current,C.current,_).then(I=>{const $={...I,isPositioned:B.current!==!1};W.current&&!Sl(T.current,$)&&(T.current=$,Mf.flushSync(()=>{u($)}))})},[f,e,n,F,B]);Ya(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,u(_=>({..._,isPositioned:!1})))},[c]);const W=x.useRef(!1);Ya(()=>(W.current=!0,()=>{W.current=!1}),[]),Ya(()=>{if(v&&(k.current=v),S&&(C.current=S),v&&S){if(D.current)return D.current(v,S,z);z()}},[v,S,z,D,M]);const G=x.useMemo(()=>({reference:k,floating:C,setReference:w,setFloating:E}),[w,E]),A=x.useMemo(()=>({reference:v,floating:S}),[v,S]),N=x.useMemo(()=>{const _={position:n,left:0,top:0};if(!A.floating)return _;const I=dg(A.floating,d.x),$=dg(A.floating,d.y);return a?{..._,transform:"translate("+I+"px, "+$+"px)",...Rv(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:$}},[n,a,A.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:z,refs:G,elements:A,floatingStyles:N}),[d,z,G,A,N])}const MO=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?cg({element:r.current,padding:i}).fn(n):{}:r?cg({element:r,padding:i}).fn(n):{}}}},OO=(t,e)=>{const n=xO(t);return{name:n.name,fn:n.fn,options:[t,e]}},RO=(t,e)=>{const n=wO(t);return{name:n.name,fn:n.fn,options:[t,e]}},IO=(t,e)=>({fn:CO(t).fn,options:[t,e]}),DO=(t,e)=>{const n=EO(t);return{name:n.name,fn:n.fn,options:[t,e]}},LO=(t,e)=>{const n=kO(t);return{name:n.name,fn:n.fn,options:[t,e]}},PO=(t,e)=>{const n=SO(t);return{name:n.name,fn:n.fn,options:[t,e]}},BO=(t,e)=>{const n=MO(t);return{name:n.name,fn:n.fn,options:[t,e]}};var $O="Arrow",Iv=x.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return p.jsx(pn.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Iv.displayName=$O;var jO=Iv;function FO(t){const[e,n]=x.useState(void 0);return Tr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var xh="Popper",[Dv,Bc]=fh(xh),[HO,Lv]=Dv(xh),Pv=t=>{const{__scopePopper:e,children:n}=t,[r,i]=x.useState(null);return p.jsx(HO,{scope:e,anchor:r,onAnchorChange:i,children:n})};Pv.displayName=xh;var Bv="PopperAnchor",$v=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=Lv(Bv,n),o=x.useRef(null),a=Dn(e,o),l=x.useRef(null);return x.useEffect(()=>{const c=l.current;l.current=(r==null?void 0:r.current)||o.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:p.jsx(pn.div,{...i,ref:a})});$v.displayName=Bv;var wh="PopperContent",[zO,UO]=Dv(wh),jv=x.forwardRef((t,e)=>{var he,Se,Ee,Ne,Me,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:m,...g}=t,y=Lv(wh,n),[b,w]=x.useState(null),E=Dn(e,ke=>w(ke)),[v,S]=x.useState(null),k=FO(v),C=(k==null?void 0:k.width)??0,T=(k==null?void 0:k.height)??0,M=r+(s!=="center"?"-"+s:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(c)?c:[c],B=F.length>0,z={padding:D,boundary:F.filter(KO),altBoundary:B},{refs:W,floatingStyles:G,placement:A,isPositioned:N,middlewareData:_}=AO({strategy:"fixed",placement:M,whileElementsMounted:(...ke)=>vO(...ke,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[OO({mainAxis:i+T,alignmentAxis:o}),l&&RO({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?IO():void 0,...z}),l&&DO({...z}),LO({...z,apply:({elements:ke,rects:je,availableWidth:Oe,availableHeight:de})=>{const{width:Ke,height:Z}=je.reference,ne=ke.floating.style;ne.setProperty("--radix-popper-available-width",`${Oe}px`),ne.setProperty("--radix-popper-available-height",`${de}px`),ne.setProperty("--radix-popper-anchor-width",`${Ke}px`),ne.setProperty("--radix-popper-anchor-height",`${Z}px`)}}),v&&BO({element:v,padding:a}),WO({arrowWidth:C,arrowHeight:T}),f&&PO({strategy:"referenceHidden",...z})]}),[I,$]=zv(A),q=as(m);Tr(()=>{N&&(q==null||q())},[N,q]);const se=(he=_.arrow)==null?void 0:he.x,ae=(Se=_.arrow)==null?void 0:Se.y,K=((Ee=_.arrow)==null?void 0:Ee.centerOffset)!==0,[X,me]=x.useState();return Tr(()=>{b&&me(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:N?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(Ne=_.transformOrigin)==null?void 0:Ne.x,(Me=_.transformOrigin)==null?void 0:Me.y].join(" "),...((Te=_.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:p.jsx(zO,{scope:n,placedSide:I,onArrowChange:S,arrowX:se,arrowY:ae,shouldHideArrow:K,children:p.jsx(pn.div,{"data-side":I,"data-align":$,...g,ref:E,style:{...g.style,animation:N?void 0:"none"}})})})});jv.displayName=wh;var Fv="PopperArrow",VO={top:"bottom",right:"left",bottom:"top",left:"right"},Hv=x.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=UO(Fv,r),o=VO[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(jO,{...i,ref:n,style:{...i.style,display:"block"}})})});Hv.displayName=Fv;function KO(t){return t!==null}var WO=t=>({name:"transformOrigin",options:t,fn(e){var y,b,w;const{placement:n,rects:r,middlewareData:i}=e,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,d]=zv(n),u={start:"0%",center:"50%",end:"100%"}[d],f=(((b=i.arrow)==null?void 0:b.x)??0)+a/2,h=(((w=i.arrow)==null?void 0:w.y)??0)+l/2;let m="",g="";return c==="bottom"?(m=o?u:`${f}px`,g=`${-l}px`):c==="top"?(m=o?u:`${f}px`,g=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,g=o?u:`${h}px`):c==="left"&&(m=`${r.floating.width+l}px`,g=o?u:`${h}px`),{data:{x:m,y:g}}}});function zv(t){const[e,n="center"]=t.split("-");return[e,n]}var Uv=Pv,Eh=$v,Vv=jv,Kv=Hv,GO="Portal",Wv=x.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=x.useState(!1);Tr(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?tb.createPortal(p.jsx(pn.div,{...r,ref:e}),o):null});Wv.displayName=GO;function qO(t,e){return x.useReducer((n,r)=>e[n][r]??n,t)}var $c=t=>{const{present:e,children:n}=t,r=YO(e),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=Dn(r.ref,JO(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};$c.displayName="Presence";function YO(t){const[e,n]=x.useState(),r=x.useRef(null),i=x.useRef(t),s=x.useRef("none"),o=t?"mounted":"unmounted",[a,l]=qO(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=ya(r.current);s.current=a==="mounted"?c:"none"},[a]),Tr(()=>{const c=r.current,d=i.current;if(d!==t){const f=s.current,h=ya(c);t?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&f!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Tr(()=>{if(e){let c;const d=e.ownerDocument.defaultView??window,u=h=>{const g=ya(r.current).includes(CSS.escape(h.animationName));if(h.target===e&&g&&(l("ANIMATION_END"),!i.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",c=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=h=>{h.target===e&&(s.current=ya(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{d.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function ya(t){return(t==null?void 0:t.animationName)||"none"}function JO(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var XO=Of[" useInsertionEffect ".trim().toString()]||Tr;function Gv({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,o]=ZO({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:i;{const d=x.useRef(t!==void 0);x.useEffect(()=>{const u=d.current;u!==a&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=x.useCallback(d=>{var u;if(a){const f=QO(d)?d(t):d;f!==t&&((u=o.current)==null||u.call(o,f))}else s(d)},[a,t,s,o]);return[l,c]}function ZO({defaultProp:t,onChange:e}){const[n,r]=x.useState(t),i=x.useRef(n),s=x.useRef(e);return XO(()=>{s.current=e},[e]),x.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function QO(t){return typeof t=="function"}var eR=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),tR="VisuallyHidden",qv=x.forwardRef((t,e)=>p.jsx(pn.span,{...t,ref:e,style:{...eR,...t.style}}));qv.displayName=tR;var nR=qv,[jc]=fh("Tooltip",[Bc]),Fc=Bc(),Yv="TooltipProvider",rR=700,ef="tooltip.open",[iR,kh]=jc(Yv),Jv=t=>{const{__scopeTooltip:e,delayDuration:n=rR,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,o=x.useRef(!0),a=x.useRef(!1),l=x.useRef(0);return x.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),p.jsx(iR,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:x.useCallback(c=>{a.current=c},[]),disableHoverableContent:i,children:s})};Jv.displayName=Yv;var ko="Tooltip",[sR,Hc]=jc(ko),Xv=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,l=kh(ko,t.__scopeTooltip),c=Fc(e),[d,u]=x.useState(null),f=wv(),h=x.useRef(0),m=o??l.disableHoverableContent,g=a??l.delayDuration,y=x.useRef(!1),[b,w]=Gv({prop:r,defaultProp:i??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(ef))):l.onClose(),s==null||s(C)},caller:ko}),E=x.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),v=x.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,w(!0)},[w]),S=x.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),k=x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,w(!0),h.current=0},g)},[g,w]);return x.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),p.jsx(Uv,{...c,children:p.jsx(sR,{scope:e,contentId:f,open:b,stateAttribute:E,trigger:d,onTriggerChange:u,onTriggerEnter:x.useCallback(()=>{l.isOpenDelayedRef.current?k():v()},[l.isOpenDelayedRef,k,v]),onTriggerLeave:x.useCallback(()=>{m?S():(window.clearTimeout(h.current),h.current=0)},[S,m]),onOpen:v,onClose:S,disableHoverableContent:m,children:n})})};Xv.displayName=ko;var tf="TooltipTrigger",Zv=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Hc(tf,n),s=kh(tf,n),o=Fc(n),a=x.useRef(null),l=Dn(e,a,i.onTriggerChange),c=x.useRef(!1),d=x.useRef(!1),u=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),p.jsx(Eh,{asChild:!0,...o,children:p.jsx(pn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:At(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:At(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:At(t.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:At(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:At(t.onBlur,i.onClose),onClick:At(t.onClick,i.onClose)})})});Zv.displayName=tf;var oR="TooltipPortal",[IH,aR]=jc(oR,{forceMount:void 0}),cs="TooltipContent",Qv=x.forwardRef((t,e)=>{const n=aR(cs,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=Hc(cs,t.__scopeTooltip);return p.jsx($c,{present:r||o.open,children:o.disableHoverableContent?p.jsx(ex,{side:i,...s,ref:e}):p.jsx(lR,{side:i,...s,ref:e})})}),lR=x.forwardRef((t,e)=>{const n=Hc(cs,t.__scopeTooltip),r=kh(cs,t.__scopeTooltip),i=x.useRef(null),s=Dn(e,i),[o,a]=x.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:u}=r,f=x.useCallback(()=>{a(null),u(!1)},[u]),h=x.useCallback((m,g)=>{const y=m.currentTarget,b={x:m.clientX,y:m.clientY},w=hR(b,y.getBoundingClientRect()),E=pR(b,w),v=mR(g.getBoundingClientRect()),S=yR([...E,...v]);a(S),u(!0)},[u]);return x.useEffect(()=>()=>f(),[f]),x.useEffect(()=>{if(l&&d){const m=y=>h(y,d),g=y=>h(y,l);return l.addEventListener("pointerleave",m),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",g)}}},[l,d,h,f]),x.useEffect(()=>{if(o){const m=g=>{const y=g.target,b={x:g.clientX,y:g.clientY},w=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),E=!gR(b,o);w?f():E&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,d,o,c,f]),p.jsx(ex,{...t,ref:s})}),[cR,dR]=jc(ko,{isInside:!1}),uR=bM("TooltipContent"),ex=x.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,l=Hc(cs,n),c=Fc(n),{onClose:d}=l;return x.useEffect(()=>(document.addEventListener(ef,d),()=>document.removeEventListener(ef,d)),[d]),x.useEffect(()=>{if(l.trigger){const u=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),p.jsx(hh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:p.jsxs(Vv,{"data-state":l.stateAttribute,...c,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(uR,{children:r}),p.jsx(cR,{scope:n,isInside:!0,children:p.jsx(nR,{id:l.contentId,role:"tooltip",children:i||r})})]})})});Qv.displayName=cs;var tx="TooltipArrow",fR=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Fc(n);return dR(tx,n).isInside?null:p.jsx(Kv,{...i,...r,ref:e})});fR.displayName=tx;function hR(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function pR(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function mR(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function gR(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],l=e[o],c=a.x,d=a.y,u=l.x,f=l.y;d>r!=f>r&&n<(u-c)*(r-d)/(f-d)+c&&(i=!i)}return i}function yR(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),bR(e)}function bR(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var vR=Jv,xR=Xv,wR=Zv,nx=Qv;/**
|
|
106
|
+
* @license lucide-react v0.483.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 ER=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rx=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
111
|
+
* @license lucide-react v0.483.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
|
+
*/var kR={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"};/**
|
|
116
|
+
* @license lucide-react v0.483.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 SR=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>x.createElement("svg",{ref:l,...kR,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:rx("lucide",i),...a},[...o.map(([c,d])=>x.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
|
|
121
|
+
* @license lucide-react v0.483.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 ie=(t,e)=>{const n=x.forwardRef(({className:r,...i},s)=>x.createElement(SR,{ref:s,iconNode:e,className:rx(`lucide-${ER(t)}`,r),...i}));return n.displayName=`${t}`,n};/**
|
|
126
|
+
* @license lucide-react v0.483.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 CR=[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],ix=ie("AlignCenter",CR);/**
|
|
131
|
+
* @license lucide-react v0.483.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 _R=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],sx=ie("AlignLeft",_R);/**
|
|
136
|
+
* @license lucide-react v0.483.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 NR=[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],ox=ie("AlignRight",NR);/**
|
|
141
|
+
* @license lucide-react v0.483.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 TR=[["path",{d:"M22 17h-3",key:"1lwga1"}],["path",{d:"M22 7h-5",key:"o2endc"}],["path",{d:"M5 17H2",key:"1gx9xc"}],["path",{d:"M7 7H2",key:"6bq26l"}],["rect",{x:"5",y:"14",width:"14",height:"6",rx:"2",key:"1qrzuf"}],["rect",{x:"7",y:"4",width:"10",height:"6",rx:"2",key:"we8e9z"}]],AR=ie("AlignVerticalDistributeCenter",TR);/**
|
|
146
|
+
* @license lucide-react v0.483.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 MR=[["rect",{width:"14",height:"6",x:"5",y:"14",rx:"2",key:"jmoj9s"}],["rect",{width:"10",height:"6",x:"7",y:"4",rx:"2",key:"aza5on"}],["path",{d:"M2 20h20",key:"owomy5"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],OR=ie("AlignVerticalDistributeEnd",MR);/**
|
|
151
|
+
* @license lucide-react v0.483.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 RR=[["rect",{width:"14",height:"6",x:"5",y:"14",rx:"2",key:"jmoj9s"}],["rect",{width:"10",height:"6",x:"7",y:"4",rx:"2",key:"aza5on"}],["path",{d:"M2 14h20",key:"myj16y"}],["path",{d:"M2 4h20",key:"mda7wb"}]],IR=ie("AlignVerticalDistributeStart",RR);/**
|
|
156
|
+
* @license lucide-react v0.483.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 DR=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],LR=ie("ArrowDown",DR);/**
|
|
161
|
+
* @license lucide-react v0.483.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 PR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],BR=ie("ArrowUp",PR);/**
|
|
166
|
+
* @license lucide-react v0.483.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 $R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],jR=ie("Ban",$R);/**
|
|
171
|
+
* @license lucide-react v0.483.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 FR=[["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"}]],ax=ie("Bold",FR);/**
|
|
176
|
+
* @license lucide-react v0.483.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 HR=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Ki=ie("Braces",HR);/**
|
|
181
|
+
* @license lucide-react v0.483.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 zR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],lx=ie("ChevronDown",zR);/**
|
|
186
|
+
* @license lucide-react v0.483.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 UR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],VR=ie("ChevronRight",UR);/**
|
|
191
|
+
* @license lucide-react v0.483.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 KR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],WR=ie("ChevronUp",KR);/**
|
|
196
|
+
* @license lucide-react v0.483.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 GR=[["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"}]],cx=ie("CodeXml",GR);/**
|
|
201
|
+
* @license lucide-react v0.483.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 qR=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],YR=ie("Code",qR);/**
|
|
206
|
+
* @license lucide-react v0.483.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 JR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],dx=ie("Columns2",JR);/**
|
|
211
|
+
* @license lucide-react v0.483.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 XR=[["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"}]],ZR=ie("Columns3",XR);/**
|
|
216
|
+
* @license lucide-react v0.483.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 QR=[["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"}]],e2=ie("Copy",QR);/**
|
|
221
|
+
* @license lucide-react v0.483.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 t2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M14.83 14.83a4 4 0 1 1 0-5.66",key:"1i56pz"}]],n2=ie("Copyright",t2);/**
|
|
226
|
+
* @license lucide-react v0.483.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 r2=[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]],ux=ie("CornerDownLeft",r2);/**
|
|
231
|
+
* @license lucide-react v0.483.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 i2=[["circle",{cx:"12",cy:"6",r:"1",key:"1bh7o1"}],["line",{x1:"5",x2:"19",y1:"12",y2:"12",key:"13b5wn"}],["circle",{cx:"12",cy:"18",r:"1",key:"lqb9t5"}]],s2=ie("Divide",i2);/**
|
|
236
|
+
* @license lucide-react v0.483.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 o2=[["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"}]],fx=ie("Eraser",o2);/**
|
|
241
|
+
* @license lucide-react v0.483.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 a2=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],l2=ie("Eye",a2);/**
|
|
246
|
+
* @license lucide-react v0.483.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 c2=[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]],Sh=ie("Footprints",c2);/**
|
|
251
|
+
* @license lucide-react v0.483.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 d2=[["path",{d:"M18 11.5V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1.4",key:"edstyy"}],["path",{d:"M14 10V8a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"19wdwo"}],["path",{d:"M10 9.9V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v5",key:"1lugqo"}],["path",{d:"M6 14a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1hbeus"}],["path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-4a8 8 0 0 1-8-8 2 2 0 1 1 4 0",key:"1etffm"}]],u2=ie("Grab",d2);/**
|
|
256
|
+
* @license lucide-react v0.483.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 f2=[["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"}]],h2=ie("GripVertical",f2);/**
|
|
261
|
+
* @license lucide-react v0.483.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 p2=[["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"}]],Ch=ie("Heading1",p2);/**
|
|
266
|
+
* @license lucide-react v0.483.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 m2=[["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"}]],hx=ie("Heading2",m2);/**
|
|
271
|
+
* @license lucide-react v0.483.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 g2=[["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"}]],px=ie("Heading3",g2);/**
|
|
276
|
+
* @license lucide-react v0.483.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 y2=[["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 3 3v-5.5",key:"9ldu5r"}],["path",{d:"m17 22 3-3",key:"1nkfve"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],mx=ie("ImageDown",y2);/**
|
|
281
|
+
* @license lucide-react v0.483.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 b2=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],v2=ie("ImageOff",b2);/**
|
|
286
|
+
* @license lucide-react v0.483.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 x2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],_h=ie("Image",x2);/**
|
|
291
|
+
* @license lucide-react v0.483.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 w2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],gx=ie("Info",w2);/**
|
|
296
|
+
* @license lucide-react v0.483.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 E2=[["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"}]],yx=ie("Italic",E2);/**
|
|
301
|
+
* @license lucide-react v0.483.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 k2=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],S2=ie("LayoutTemplate",k2);/**
|
|
306
|
+
* @license lucide-react v0.483.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 C2=[["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"}]],nf=ie("Link",C2);/**
|
|
311
|
+
* @license lucide-react v0.483.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 _2=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],Nh=ie("ListOrdered",_2);/**
|
|
316
|
+
* @license lucide-react v0.483.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 N2=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Th=ie("List",N2);/**
|
|
321
|
+
* @license lucide-react v0.483.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 T2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],A2=ie("LoaderCircle",T2);/**
|
|
326
|
+
* @license lucide-react v0.483.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 M2=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],O2=ie("LockOpen",M2);/**
|
|
331
|
+
* @license lucide-react v0.483.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 R2=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],I2=ie("Lock",R2);/**
|
|
336
|
+
* @license lucide-react v0.483.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 D2=[["path",{d:"M5 12h14",key:"1ays0h"}]],L2=ie("Minus",D2);/**
|
|
341
|
+
* @license lucide-react v0.483.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 P2=[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]],B2=ie("MousePointer",P2);/**
|
|
346
|
+
* @license lucide-react v0.483.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 $2=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]],j2=ie("MoveVertical",$2);/**
|
|
351
|
+
* @license lucide-react v0.483.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 F2=[["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"}]],H2=ie("Pencil",F2);/**
|
|
356
|
+
* @license lucide-react v0.483.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 z2=[["path",{d:"M13 4v16",key:"8vvj80"}],["path",{d:"M17 4v16",key:"7dpous"}],["path",{d:"M19 4H9.5a4.5 4.5 0 0 0 0 9H13",key:"sh4n9v"}]],bx=ie("Pilcrow",z2);/**
|
|
361
|
+
* @license lucide-react v0.483.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 U2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],V2=ie("Plus",U2);/**
|
|
366
|
+
* @license lucide-react v0.483.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 K2=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],vx=ie("RectangleHorizontal",K2);/**
|
|
371
|
+
* @license lucide-react v0.483.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 W2=[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]],xx=ie("Repeat2",W2);/**
|
|
376
|
+
* @license lucide-react v0.483.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 G2=[["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["polyline",{points:"8 8 12 4 16 8",key:"zo8t4w"}],["polyline",{points:"16 16 12 20 8 16",key:"1oyrid"}]],q2=ie("SeparatorHorizontal",G2);/**
|
|
381
|
+
* @license lucide-react v0.483.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 Y2=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],J2=ie("SlidersVertical",Y2);/**
|
|
386
|
+
* @license lucide-react v0.483.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const X2=[["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]],Z2=ie("Space",X2);/**
|
|
391
|
+
* @license lucide-react v0.483.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const Q2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 8h8v8",key:"b65dnt"}],["path",{d:"m8 16 8-8",key:"13b9ih"}]],eI=ie("SquareArrowUpRight",Q2);/**
|
|
396
|
+
* @license lucide-react v0.483.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const tI=[["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"}]],wx=ie("Strikethrough",tI);/**
|
|
401
|
+
* @license lucide-react v0.483.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const nI=[["path",{d:"M17 6H3",key:"16j9eg"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 18H8",key:"1wfozv"}],["path",{d:"M3 12v6",key:"fv4c87"}]],rI=ie("TextQuote",nI);/**
|
|
406
|
+
* @license lucide-react v0.483.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const iI=[["path",{d:"M17 6.1H3",key:"wptmhv"}],["path",{d:"M21 12.1H3",key:"1j38uz"}],["path",{d:"M15.1 18H3",key:"1nb16a"}]],sI=ie("Text",iI);/**
|
|
411
|
+
* @license lucide-react v0.483.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const oI=[["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"}]],aI=ie("Trash2",oI);/**
|
|
416
|
+
* @license lucide-react v0.483.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const lI=[["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"}]],Ex=ie("Trash",lI);/**
|
|
421
|
+
* @license lucide-react v0.483.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const cI=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],dI=ie("TriangleAlert",cI);/**
|
|
426
|
+
* @license lucide-react v0.483.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const uI=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],kx=ie("Underline",uI);/**
|
|
431
|
+
* @license lucide-react v0.483.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const fI=[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]],hI=ie("View",fI);var pI=Symbol.for("react.lazy"),Cl=Of[" use ".trim().toString()];function mI(t){return typeof t=="object"&&t!==null&&"then"in t}function Sx(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===pI&&"_payload"in t&&mI(t._payload)}function gI(t){const e=bI(t),n=x.forwardRef((r,i)=>{let{children:s,...o}=r;Sx(s)&&typeof Cl=="function"&&(s=Cl(s._payload));const a=x.Children.toArray(s),l=a.find(xI);if(l){const c=l.props.children,d=a.map(u=>u===l?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:u);return p.jsx(e,{...o,ref:i,children:x.isValidElement(c)?x.cloneElement(c,void 0,d):null})}return p.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var yI=gI("Slot");function bI(t){const e=x.forwardRef((n,r)=>{let{children:i,...s}=n;if(Sx(i)&&typeof Cl=="function"&&(i=Cl(i._payload)),x.isValidElement(i)){const o=EI(i),a=wI(s,i.props);return i.type!==x.Fragment&&(a.ref=r?uh(r,o):o),x.cloneElement(i,a)}return x.Children.count(i)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var vI=Symbol("radix.slottable");function xI(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===vI}function wI(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function EI(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Fd=0;function kI(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??ug()),document.body.insertAdjacentElement("beforeend",t[1]??ug()),Fd++,()=>{Fd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Fd--}},[])}function ug(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Hd="focusScope.autoFocusOnMount",zd="focusScope.autoFocusOnUnmount",fg={bubbles:!1,cancelable:!0},SI="FocusScope",Cx=x.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=x.useState(null),c=as(i),d=as(s),u=x.useRef(null),f=Dn(e,g=>l(g)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let g=function(E){if(h.paused||!a)return;const v=E.target;a.contains(v)?u.current=v:cr(u.current,{select:!0})},y=function(E){if(h.paused||!a)return;const v=E.relatedTarget;v!==null&&(a.contains(v)||cr(u.current,{select:!0}))},b=function(E){if(document.activeElement===document.body)for(const S of E)S.removedNodes.length>0&&cr(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(b);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[r,a,h.paused]),x.useEffect(()=>{if(a){pg.add(h);const g=document.activeElement;if(!a.contains(g)){const b=new CustomEvent(Hd,fg);a.addEventListener(Hd,c),a.dispatchEvent(b),b.defaultPrevented||(CI(MI(_x(a)),{select:!0}),document.activeElement===g&&cr(a))}return()=>{a.removeEventListener(Hd,c),setTimeout(()=>{const b=new CustomEvent(zd,fg);a.addEventListener(zd,d),a.dispatchEvent(b),b.defaultPrevented||cr(g??document.body,{select:!0}),a.removeEventListener(zd,d),pg.remove(h)},0)}}},[a,c,d,h]);const m=x.useCallback(g=>{if(!n&&!r||h.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(y&&b){const w=g.currentTarget,[E,v]=_I(w);E&&v?!g.shiftKey&&b===v?(g.preventDefault(),n&&cr(E,{select:!0})):g.shiftKey&&b===E&&(g.preventDefault(),n&&cr(v,{select:!0})):b===w&&g.preventDefault()}},[n,r,h.paused]);return p.jsx(pn.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Cx.displayName=SI;function CI(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(cr(r,{select:e}),document.activeElement!==n)return}function _I(t){const e=_x(t),n=hg(e,t),r=hg(e.reverse(),t);return[n,r]}function _x(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function hg(t,e){for(const n of t)if(!NI(n,{upTo:e}))return n}function NI(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function TI(t){return t instanceof HTMLInputElement&&"select"in t}function cr(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&TI(t)&&e&&t.select()}}var pg=AI();function AI(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=mg(t,e),t.unshift(e)},remove(e){var n;t=mg(t,e),(n=t[0])==null||n.resume()}}}function mg(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function MI(t){return t.filter(e=>e.tagName!=="A")}var OI=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_i=new WeakMap,ba=new WeakMap,va={},Ud=0,Nx=function(t){return t&&(t.host||Nx(t.parentNode))},RI=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Nx(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})},II=function(t,e,n,r){var i=RI(e,Array.isArray(t)?t:[t]);va[n]||(va[n]=new WeakMap);var s=va[n],o=[],a=new Set,l=new Set(i),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};i.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(f){if(a.has(f))d(f);else try{var h=f.getAttribute(r),m=h!==null&&h!=="false",g=(_i.get(f)||0)+1,y=(s.get(f)||0)+1;_i.set(f,g),s.set(f,y),o.push(f),g===1&&m&&ba.set(f,!0),y===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(e),a.clear(),Ud++,function(){o.forEach(function(u){var f=_i.get(u)-1,h=s.get(u)-1;_i.set(u,f),s.set(u,h),f||(ba.has(u)||u.removeAttribute(r),ba.delete(u)),h||u.removeAttribute(n)}),Ud--,Ud||(_i=new WeakMap,_i=new WeakMap,ba=new WeakMap,va={})}},DI=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=OI(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),II(r,i,n,"aria-hidden")):function(){return null}},wn=function(){return wn=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},wn.apply(this,arguments)};function Tx(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 LI(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Ja="right-scroll-bar-position",Xa="width-before-scroll-bar",PI="with-scroll-bars-hidden",BI="--removed-body-scroll-bar-size";function Vd(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function $I(t,e){var n=x.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 jI=typeof window<"u"?x.useLayoutEffect:x.useEffect,gg=new WeakMap;function FI(t,e){var n=$I(null,function(r){return t.forEach(function(i){return Vd(i,r)})});return jI(function(){var r=gg.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(a){s.has(a)||Vd(a,null)}),s.forEach(function(a){i.has(a)||Vd(a,o)})}gg.set(n,t)},[t]),n}function HI(t){return t}function zI(t,e){e===void 0&&(e=HI);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(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var d=o;o=[],d.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){o.push(d),c()},filter:function(d){return o=o.filter(d),n}}}};return i}function UI(t){t===void 0&&(t={});var e=zI(null);return e.options=wn({async:!0,ssr:!1},t),e}var Ax=function(t){var e=t.sideCar,n=Tx(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 x.createElement(r,wn({},n))};Ax.isSideCarExport=!0;function VI(t,e){return t.useMedium(e),Ax}var Mx=UI(),Kd=function(){},zc=x.forwardRef(function(t,e){var n=x.useRef(null),r=x.useState({onScrollCapture:Kd,onWheelCapture:Kd,onTouchMoveCapture:Kd}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,u=t.shards,f=t.sideCar,h=t.noRelative,m=t.noIsolation,g=t.inert,y=t.allowPinchZoom,b=t.as,w=b===void 0?"div":b,E=t.gapMode,v=Tx(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,k=FI([n,e]),C=wn(wn({},v),i);return x.createElement(x.Fragment,null,d&&x.createElement(S,{sideCar:Mx,removeScrollBar:c,shards:u,noRelative:h,noIsolation:m,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:E}),o?x.cloneElement(x.Children.only(a),wn(wn({},C),{ref:k})):x.createElement(w,wn({},C,{className:l,ref:k}),a))});zc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zc.classNames={fullWidth:Xa,zeroRight:Ja};var KI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WI(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=KI();return e&&t.setAttribute("nonce",e),t}function GI(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function qI(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var YI=function(){var t=0,e=null;return{add:function(n){t==0&&(e=WI())&&(GI(e,n),qI(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},JI=function(){var t=YI();return function(e,n){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Ox=function(){var t=JI(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},XI={left:0,top:0,right:0,gap:0},Wd=function(t){return parseInt(t||"",10)||0},ZI=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[Wd(n),Wd(r),Wd(i)]},QI=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return XI;var e=ZI(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])}},eD=Ox(),Wi="data-scroll-locked",tD=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
436
|
+
.`.concat(PI,` {
|
|
437
|
+
overflow: hidden `).concat(r,`;
|
|
438
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
439
|
+
}
|
|
440
|
+
body[`).concat(Wi,`] {
|
|
441
|
+
overflow: hidden `).concat(r,`;
|
|
442
|
+
overscroll-behavior: contain;
|
|
443
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
444
|
+
padding-left: `.concat(i,`px;
|
|
445
|
+
padding-top: `).concat(s,`px;
|
|
446
|
+
padding-right: `).concat(o,`px;
|
|
447
|
+
margin-left:0;
|
|
448
|
+
margin-top:0;
|
|
449
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
450
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.`).concat(Ja,` {
|
|
454
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.`).concat(Xa,` {
|
|
458
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.`).concat(Ja," .").concat(Ja,` {
|
|
462
|
+
right: 0 `).concat(r,`;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.`).concat(Xa," .").concat(Xa,` {
|
|
466
|
+
margin-right: 0 `).concat(r,`;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
body[`).concat(Wi,`] {
|
|
470
|
+
`).concat(BI,": ").concat(a,`px;
|
|
471
|
+
}
|
|
472
|
+
`)},yg=function(){var t=parseInt(document.body.getAttribute(Wi)||"0",10);return isFinite(t)?t:0},nD=function(){x.useEffect(function(){return document.body.setAttribute(Wi,(yg()+1).toString()),function(){var t=yg()-1;t<=0?document.body.removeAttribute(Wi):document.body.setAttribute(Wi,t.toString())}},[])},rD=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;nD();var s=x.useMemo(function(){return QI(i)},[i]);return x.createElement(eD,{styles:tD(s,!e,i,n?"":"!important")})},rf=!1;if(typeof window<"u")try{var xa=Object.defineProperty({},"passive",{get:function(){return rf=!0,!0}});window.addEventListener("test",xa,xa),window.removeEventListener("test",xa,xa)}catch{rf=!1}var Ni=rf?{passive:!1}:!1,iD=function(t){return t.tagName==="TEXTAREA"},Rx=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!iD(t)&&n[e]==="visible")},sD=function(t){return Rx(t,"overflowY")},oD=function(t){return Rx(t,"overflowX")},bg=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Ix(t,r);if(i){var s=Dx(t,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aD=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},lD=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Ix=function(t,e){return t==="v"?sD(e):oD(e)},Dx=function(t,e){return t==="v"?aD(e):lD(e)},cD=function(t,e){return t==="h"&&e==="rtl"?-1:1},dD=function(t,e,n,r,i){var s=cD(t,window.getComputedStyle(e).direction),o=s*r,a=n.target,l=e.contains(a),c=!1,d=o>0,u=0,f=0;do{if(!a)break;var h=Dx(t,a),m=h[0],g=h[1],y=h[2],b=g-y-s*m;(m||b)&&Ix(t,a)&&(u+=b,f+=m);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&Math.abs(u)<1||!d&&Math.abs(f)<1)&&(c=!0),c},wa=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},vg=function(t){return[t.deltaX,t.deltaY]},xg=function(t){return t&&"current"in t?t.current:t},uD=function(t,e){return t[0]===e[0]&&t[1]===e[1]},fD=function(t){return`
|
|
473
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
474
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
475
|
+
`)},hD=0,Ti=[];function pD(t){var e=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(hD++)[0],s=x.useState(Ox)[0],o=x.useRef(t);x.useEffect(function(){o.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var g=LI([t.lockRef.current],(t.shards||[]).map(xg),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=x.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var b=wa(g),w=n.current,E="deltaX"in g?g.deltaX:w[0]-b[0],v="deltaY"in g?g.deltaY:w[1]-b[1],S,k=g.target,C=Math.abs(E)>Math.abs(v)?"h":"v";if("touches"in g&&C==="h"&&k.type==="range")return!1;var T=window.getSelection(),M=T&&T.anchorNode,D=M?M===k||M.contains(k):!1;if(D)return!1;var F=bg(C,k);if(!F)return!0;if(F?S=C:(S=C==="v"?"h":"v",F=bg(C,k)),!F)return!1;if(!r.current&&"changedTouches"in g&&(E||v)&&(r.current=S),!S)return!0;var B=r.current||S;return dD(B,y,g,B==="h"?E:v)},[]),l=x.useCallback(function(g){var y=g;if(!(!Ti.length||Ti[Ti.length-1]!==s)){var b="deltaY"in y?vg(y):wa(y),w=e.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&uD(S.delta,b)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var E=(o.current.shards||[]).map(xg).filter(Boolean).filter(function(S){return S.contains(y.target)}),v=E.length>0?a(y,E[0]):!o.current.noIsolation;v&&y.cancelable&&y.preventDefault()}}},[]),c=x.useCallback(function(g,y,b,w){var E={name:g,delta:y,target:b,should:w,shadowParent:mD(b)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(v){return v!==E})},1)},[]),d=x.useCallback(function(g){n.current=wa(g),r.current=void 0},[]),u=x.useCallback(function(g){c(g.type,vg(g),g.target,a(g,t.lockRef.current))},[]),f=x.useCallback(function(g){c(g.type,wa(g),g.target,a(g,t.lockRef.current))},[]);x.useEffect(function(){return Ti.push(s),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Ni),document.addEventListener("touchmove",l,Ni),document.addEventListener("touchstart",d,Ni),function(){Ti=Ti.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,Ni),document.removeEventListener("touchmove",l,Ni),document.removeEventListener("touchstart",d,Ni)}},[]);var h=t.removeScrollBar,m=t.inert;return x.createElement(x.Fragment,null,m?x.createElement(s,{styles:fD(i)}):null,h?x.createElement(rD,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function mD(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const gD=VI(Mx,pD);var Lx=x.forwardRef(function(t,e){return x.createElement(zc,wn({},t,{ref:e,sideCar:gD}))});Lx.classNames=zc.classNames;var Uc="Popover",[Px]=fh(Uc,[Bc]),Zo=Bc(),[yD,jr]=Px(Uc),Bx=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=Zo(e),l=x.useRef(null),[c,d]=x.useState(!1),[u,f]=Gv({prop:r,defaultProp:i??!1,onChange:s,caller:Uc});return p.jsx(Uv,{...a,children:p.jsx(yD,{scope:e,contentId:wv(),triggerRef:l,open:u,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:x.useCallback(()=>d(!0),[]),onCustomAnchorRemove:x.useCallback(()=>d(!1),[]),modal:o,children:n})})};Bx.displayName=Uc;var $x="PopoverAnchor",bD=x.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=jr($x,n),s=Zo(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return x.useEffect(()=>(o(),()=>a()),[o,a]),p.jsx(Eh,{...s,...r,ref:e})});bD.displayName=$x;var jx="PopoverTrigger",Fx=x.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=jr(jx,n),s=Zo(n),o=Dn(e,i.triggerRef),a=p.jsx(pn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Kx(i.open),...r,ref:o,onClick:At(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:p.jsx(Eh,{asChild:!0,...s,children:a})});Fx.displayName=jx;var Ah="PopoverPortal",[vD,xD]=Px(Ah,{forceMount:void 0}),Hx=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=jr(Ah,e);return p.jsx(vD,{scope:e,forceMount:n,children:p.jsx($c,{present:n||s.open,children:p.jsx(Wv,{asChild:!0,container:i,children:r})})})};Hx.displayName=Ah;var ds="PopoverContent",zx=x.forwardRef((t,e)=>{const n=xD(ds,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=jr(ds,t.__scopePopover);return p.jsx($c,{present:r||s.open,children:s.modal?p.jsx(ED,{...i,ref:e}):p.jsx(kD,{...i,ref:e})})});zx.displayName=ds;var wD=yv("PopoverContent.RemoveScroll"),ED=x.forwardRef((t,e)=>{const n=jr(ds,t.__scopePopover),r=x.useRef(null),i=Dn(e,r),s=x.useRef(!1);return x.useEffect(()=>{const o=r.current;if(o)return DI(o)},[]),p.jsx(Lx,{as:wD,allowPinchZoom:!0,children:p.jsx(Ux,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:At(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:At(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:At(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),kD=x.forwardRef((t,e)=>{const n=jr(ds,t.__scopePopover),r=x.useRef(!1),i=x.useRef(!1);return p.jsx(Ux,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),Ux=x.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=t,f=jr(ds,n),h=Zo(n);return kI(),p.jsx(Cx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:p.jsx(hh,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:p.jsx(Vv,{"data-state":Kx(f.open),role:"dialog",id:f.contentId,...h,...u,ref:e,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Vx="PopoverClose",SD=x.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=jr(Vx,n);return p.jsx(pn.button,{type:"button",...r,ref:e,onClick:At(t.onClick,()=>i.onOpenChange(!1))})});SD.displayName=Vx;var CD="PopoverArrow",_D=x.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Zo(n);return p.jsx(Kv,{...i,...r,ref:e})});_D.displayName=CD;function Kx(t){return t?"open":"closed"}var ND=Bx,TD=Fx,AD=Hx,Wx=zx;const Tn=()=>new Map,sf=t=>{const e=Tn();return t.forEach((n,r)=>{e.set(r,n)}),e},ks=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},MD=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},OD=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},us=()=>new Set,Gd=t=>t[t.length-1],fs=Array.from,Mh=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},Gx=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},RD=(t,e)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e(r,n);return n},Vc=Array.isArray;class ID{constructor(){this._observers=Tn()}on(e,n){return ks(this._observers,e,us).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 fs((this._observers.get(e)||Tn()).values()).forEach(r=>r(...n))}destroy(){this._observers=Tn()}}const Qn=Math.floor,Za=Math.abs,qx=(t,e)=>t<e?t:e,Ss=(t,e)=>t>e?t:e,DD=t=>t!==0?t<0:1/t<0,wg=1,Eg=2,qd=4,Yd=8,LD=32,Yx=64,_l=128,PD=31,kg=63,Xs=127,BD=2147483647,Sg=Number.MAX_SAFE_INTEGER,Cg=Number.MIN_SAFE_INTEGER,$D=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Qn(t)===t),jD=String.fromCharCode,FD=t=>t.toLowerCase(),HD=/^\s*/g,zD=t=>t.replace(HD,""),UD=/([A-Z])/g,_g=(t,e)=>zD(t.replace(UD,n=>`${e}${FD(n)}`)),VD=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},So=typeof TextEncoder<"u"?new TextEncoder:null,KD=t=>So.encode(t),WD=So?KD:VD;let Jd=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Jd&&Jd.decode(new Uint8Array).length===1&&(Jd=null);const GD=(t,e)=>RD(e,()=>t).join("");class Qo{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Oh=()=>new Qo,qD=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},Gn=t=>{const e=new Uint8Array(qD(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},YD=(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(Ss(n,e)*2),t.cpos=0)},nt=(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},of=nt,Le=(t,e)=>{for(;e>Xs;)nt(t,_l|Xs&e),e=Qn(e/128);nt(t,Xs&e)},Rh=(t,e)=>{const n=DD(e);for(n&&(e=-e),nt(t,(e>kg?_l:0)|(n?Yx:0)|kg&e),e=Qn(e/64);e>0;)nt(t,(e>Xs?_l:0)|Xs&e),e=Qn(e/128)},af=new Uint8Array(3e4),JD=af.length/3,XD=(t,e)=>{if(e.length<JD){const n=So.encodeInto(e,af).written||0;Le(t,n);for(let r=0;r<n;r++)nt(t,af[r])}else Bt(t,WD(e))},ZD=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;Le(t,r);for(let i=0;i<r;i++)nt(t,n.codePointAt(i))},Gi=So&&So.encodeInto?XD:ZD,Ih=(t,e)=>{const n=t.cbuf.length,r=t.cpos,i=qx(n-r,e.length),s=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Ss(n*2,s)),t.cbuf.set(e.subarray(i)),t.cpos=s)},Bt=(t,e)=>{Le(t,e.byteLength),Ih(t,e)},Dh=(t,e)=>{YD(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},QD=(t,e)=>Dh(t,4).setFloat32(0,e,!1),eL=(t,e)=>Dh(t,8).setFloat64(0,e,!1),tL=(t,e)=>Dh(t,8).setBigInt64(0,e,!1),Ng=new DataView(new ArrayBuffer(4)),nL=t=>(Ng.setFloat32(0,t),Ng.getFloat32(0)===t),Co=(t,e)=>{switch(typeof e){case"string":nt(t,119),Gi(t,e);break;case"number":$D(e)&&Za(e)<=BD?(nt(t,125),Rh(t,e)):nL(e)?(nt(t,124),QD(t,e)):(nt(t,123),eL(t,e));break;case"bigint":nt(t,122),tL(t,e);break;case"object":if(e===null)nt(t,126);else if(Vc(e)){nt(t,117),Le(t,e.length);for(let n=0;n<e.length;n++)Co(t,e[n])}else if(e instanceof Uint8Array)nt(t,116),Bt(t,e);else{nt(t,118);const n=Object.keys(e);Le(t,n.length);for(let r=0;r<n.length;r++){const i=n[r];Gi(t,i),Co(t,e[i])}}break;case"boolean":nt(t,e?120:121);break;default:nt(t,127)}};class Tg extends Qo{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Le(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const Ag=t=>{t.count>0&&(Rh(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Le(t.encoder,t.count-2))};class Qa{constructor(){this.encoder=new Qo,this.s=0,this.count=0}write(e){this.s===e?this.count++:(Ag(this),this.count=1,this.s=e)}toUint8Array(){return Ag(this),Gn(this.encoder)}}const Mg=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);Rh(t.encoder,e),t.count>1&&Le(t.encoder,t.count-2)}};class Xd{constructor(){this.encoder=new Qo,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Mg(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Mg(this),Gn(this.encoder)}}class rL{constructor(){this.sarr=[],this.s="",this.lensE=new Qa}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 Qo;return this.sarr.push(this.s),this.s="",Gi(e,this.sarr.join("")),Ih(e,this.lensE.toUint8Array()),Gn(e)}}const Or=t=>new Error(t),ln=()=>{throw Or("Method unimplemented")},Rn=()=>{throw Or("Unexpected case")},iL=crypto.getRandomValues.bind(crypto),Jx=()=>iL(new Uint32Array(1))[0],sL="10000000-1000-4000-8000"+-1e11,oL=()=>sL.replace(/[018]/g,t=>(t^Jx()&15>>t/4).toString(16)),Og=t=>new Promise(t);Promise.all.bind(Promise);const Rg=t=>t===void 0?null:t;class aL{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let Xx=new aL,lL=!0;try{typeof localStorage<"u"&&localStorage&&(Xx=localStorage,lL=!1)}catch{}const cL=Xx,_o=Symbol("Equality"),Zx=(t,e)=>{var n;return t===e||!!((n=t==null?void 0:t[_o])!=null&&n.call(t,e))||!1},dL=t=>typeof t=="object",uL=Object.assign,fL=Object.keys,hL=(t,e)=>{for(const n in t)e(t[n],n)},Nl=t=>fL(t).length,pL=t=>{for(const e in t)return!1;return!0},ea=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},Lh=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),mL=(t,e)=>t===e||Nl(t)===Nl(e)&&ea(t,(n,r)=>(n!==void 0||Lh(e,r))&&Zx(e[r],n)),gL=Object.freeze,Qx=t=>{for(const e in t){const n=t[e];(typeof n=="object"||typeof n=="function")&&Qx(t[e])}return gL(t)},Ph=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&Ph(t,e,n+1)}},el=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[_o]!=null)return t[_o](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!el(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(Nl(t)!==Nl(e))return!1;for(const n in t)if(!Lh(t,n)||!el(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!el(t[n],e[n]))return!1;break;default:return!1}return!0},yL=(t,e)=>e.includes(t);var ew={};const No=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let mn;const bL=()=>{if(mn===void 0)if(No){mn=Tn();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&mn.set(e,""),e=r):e!==null&&(mn.set(e,r),e=null)}e!==null&&mn.set(e,"")}else typeof location=="object"?(mn=Tn(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");mn.set(`--${_g(e,"-")}`,n),mn.set(`-${_g(e,"-")}`,n)}})):mn=Tn();return mn},lf=t=>bL().has(t),Tl=t=>Rg(No?ew[t.toUpperCase().replaceAll("-","_")]:cL.getItem(t)),tw=t=>lf("--"+t)||Tl(t)!==null,vL=tw("production"),xL=No&&yL(ew.FORCE_COLOR,["true","1","2"]),wL=xL||!lf("--no-colors")&&!tw("no-color")&&(!No||process.stdout.isTTY)&&(!No||lf("--color")||Tl("COLORTERM")!==null||(Tl("TERM")||"").includes("color"));class EL{constructor(e,n){this.left=e,this.right=n}}const $n=(t,e)=>new EL(t,e),Ig=t=>t.next()>=.5,Zd=(t,e,n)=>Qn(t.next()*(n+1-e)+e),nw=(t,e,n)=>Qn(t.next()*(n+1-e)+e),Bh=(t,e,n)=>nw(t,e,n),kL=t=>jD(Bh(t,97,122)),SL=(t,e=0,n=20)=>{const r=Bh(t,e,n);let i="";for(let s=0;s<r;s++)i+=kL(t);return i},Qd=(t,e)=>e[Bh(t,0,e.length-1)],CL=Symbol("0schema");class _L{constructor(){this._rerrs=[]}extend(e,n,r,i=null){this._rerrs.push({path:e,expected:n,has:r,message:i})}toString(){const e=[];for(let n=this._rerrs.length-1;n>0;n--){const r=this._rerrs[n];e.push(GD(" ",(this._rerrs.length-n)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(`
|
|
476
|
+
`)}}const cf=(t,e)=>t===e?!0:t==null||e==null||t.constructor!==e.constructor?!1:t[_o]?Zx(t,e):Vc(t)?Mh(t,n=>Gx(e,r=>cf(n,r))):dL(t)?ea(t,(n,r)=>cf(n,e[r])):!1;class Et{extends(e){let[n,r]=[this.shape,e.shape];return this.constructor._dilutes&&([r,n]=[n,r]),cf(n,r)}equals(e){return this.constructor===e.constructor&&el(this.shape,e.shape)}[CL](){return!0}[_o](e){return this.equals(e)}validate(e){return this.check(e)}check(e,n){ln()}get nullable(){return Cs(this,Yc)}get optional(){return new sw(this)}cast(e){return Dg(e,this),e}expect(e){return Dg(e,this),e}}oa(Et,"_dilutes",!1);class $h extends Et{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n=void 0){const r=(e==null?void 0:e.constructor)===this.shape&&(this._c==null||this._c(e));return!r&&(n==null||n.extend(null,this.shape.name,e==null?void 0:e.constructor.name,(e==null?void 0:e.constructor)!==this.shape?"Constructor match failed":"Check failed")),r}}const et=(t,e=null)=>new $h(t,e);et($h);class jh extends Et{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape(e);return!r&&(n==null||n.extend(null,"custom prop",e==null?void 0:e.constructor.name,"failed to check custom prop")),r}}const at=t=>new jh(t);et(jh);class Kc extends Et{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape.some(i=>i===e);return!r&&(n==null||n.extend(null,this.shape.join(" | "),e.toString())),r}}const Wc=(...t)=>new Kc(t),rw=et(Kc),NL=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),iw=t=>{if(hs.check(t))return[NL(t)];if(rw.check(t))return t.shape.map(e=>e+"");if(pw.check(t))return["[+-]?\\d+.?\\d*"];if(mw.check(t))return[".*"];if(Ml.check(t))return t.shape.map(iw).flat(1);Rn()};class TL extends Et{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(iw).map(n=>`(${n.join("|")})`).join("")+"$")}check(e,n){const r=this._r.exec(e)!=null;return!r&&(n==null||n.extend(null,this._r.toString(),e.toString(),"String doesn't match string template.")),r}}et(TL);const AL=Symbol("optional");class sw extends Et{constructor(e){super(),this.shape=e}check(e,n){const r=e===void 0||this.shape.check(e);return!r&&(n==null||n.extend(null,"undefined (optional)","()")),r}get[AL](){return!0}}const ML=et(sw);class OL extends Et{check(e,n){return n==null||n.extend(null,"never",typeof e),!1}}et(OL);const gc=class gc extends Et{constructor(e,n=!1){super(),this.shape=e,this._isPartial=n}get partial(){return new gc(this.shape,!0)}check(e,n){return e==null?(n==null||n.extend(null,"object","null"),!1):ea(this.shape,(r,i)=>{const s=this._isPartial&&!Lh(e,i)||r.check(e[i],n);return!s&&(n==null||n.extend(i.toString(),r.toString(),typeof e[i],"Object property does not match")),s})}};oa(gc,"_dilutes",!0);let Al=gc;const RL=t=>new Al(t),IL=et(Al),DL=at(t=>t!=null&&(t.constructor===Object||t.constructor==null));class ow extends Et{constructor(e,n){super(),this.shape={keys:e,values:n}}check(e,n){return e!=null&&ea(e,(r,i)=>{const s=this.shape.keys.check(i,n);return!s&&(n==null||n.extend(i+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value")),s&&this.shape.values.check(r,n)})}}const aw=(t,e)=>new ow(t,e),LL=et(ow);class lw extends Et{constructor(e){super(),this.shape=e}check(e,n){return e!=null&&ea(this.shape,(r,i)=>{const s=r.check(e[i],n);return!s&&(n==null||n.extend(i.toString(),"Tuple",typeof r)),s})}}const PL=(...t)=>new lw(t);et(lw);class cw extends Et{constructor(e){super(),this.shape=e.length===1?e[0]:new Gc(e)}check(e,n){const r=Vc(e)&&Mh(e,i=>this.shape.check(i));return!r&&(n==null||n.extend(null,"Array","")),r}}const dw=(...t)=>new cw(t),BL=et(cw),$L=at(t=>Vc(t));class uw extends Et{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n){const r=e instanceof this.shape&&(this._c==null||this._c(e));return!r&&(n==null||n.extend(null,this.shape.name,e==null?void 0:e.constructor.name)),r}}const jL=(t,e=null)=>new uw(t,e);et(uw);const FL=jL(Et);class HL extends Et{constructor(e){super(),this.len=e.length-1,this.args=PL(...e.slice(-1)),this.res=e[this.len]}check(e,n){const r=e.constructor===Function&&e.length<=this.len;return!r&&(n==null||n.extend(null,"function",typeof e)),r}}const zL=et(HL),UL=at(t=>typeof t=="function");class VL extends Et{constructor(e){super(),this.shape=e}check(e,n){const r=Mh(this.shape,i=>i.check(e,n));return!r&&(n==null||n.extend(null,"Intersectinon",typeof e)),r}}et(VL,t=>t.shape.length>0);class Gc extends Et{constructor(e){super(),this.shape=e}check(e,n){const r=Gx(this.shape,i=>i.check(e,n));return n==null||n.extend(null,"Union",typeof e),r}}oa(Gc,"_dilutes",!0);const Cs=(...t)=>t.findIndex(e=>Ml.check(e))>=0?Cs(...t.map(e=>To(e)).map(e=>Ml.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new Gc(t),Ml=et(Gc),fw=()=>!0,Ol=at(fw),KL=et(jh,t=>t.shape===fw),Fh=at(t=>typeof t=="bigint"),WL=at(t=>t===Fh),hw=at(t=>typeof t=="symbol");at(t=>t===hw);const qi=at(t=>typeof t=="number"),pw=at(t=>t===qi),hs=at(t=>typeof t=="string"),mw=at(t=>t===hs),qc=at(t=>typeof t=="boolean"),GL=at(t=>t===qc),gw=Wc(void 0);et(Kc,t=>t.shape.length===1&&t.shape[0]===void 0);Wc(void 0);const Yc=Wc(null),qL=et(Kc,t=>t.shape.length===1&&t.shape[0]===null);et(Uint8Array);et($h,t=>t.shape===Uint8Array);const YL=Cs(qi,hs,Yc,gw,Fh,qc,hw);(()=>{const t=dw(Ol),e=aw(hs,Ol),n=Cs(qi,hs,Yc,qc,t,e);return t.shape=n,e.shape.values=n,n})();const To=t=>{if(FL.check(t))return t;if(DL.check(t)){const e={};for(const n in t)e[n]=To(t[n]);return RL(e)}else{if($L.check(t))return Cs(...t.map(To));if(YL.check(t))return Wc(t);if(UL.check(t))return et(t)}Rn()},Dg=vL?()=>{}:(t,e)=>{const n=new _L;if(!e.check(t,n))throw Or(`Expected value to be of type ${e.constructor.name}.
|
|
477
|
+
${n.toString()}`)};class JL{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:To(e),h:n}),this}else(e){return this.if(Ol,e)}done(){return(e,n)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,n)}throw Or("Unhandled pattern")}}}const XL=t=>new JL(t),yw=XL(Ol).if(pw,(t,e)=>Zd(e,Cg,Sg)).if(mw,(t,e)=>SL(e)).if(GL,(t,e)=>Ig(e)).if(WL,(t,e)=>BigInt(Zd(e,Cg,Sg))).if(Ml,(t,e)=>Ai(e,Qd(e,t.shape))).if(IL,(t,e)=>{const n={};for(const r in t.shape){let i=t.shape[r];if(ML.check(i)){if(Ig(e))continue;i=i.shape}n[r]=yw(i,e)}return n}).if(BL,(t,e)=>{const n=[],r=nw(e,0,42);for(let i=0;i<r;i++)n.push(Ai(e,t.shape));return n}).if(rw,(t,e)=>Qd(e,t.shape)).if(qL,(t,e)=>null).if(zL,(t,e)=>{const n=Ai(e,t.res);return()=>n}).if(KL,(t,e)=>Ai(e,Qd(e,[qi,hs,Yc,gw,Fh,qc,dw(qi),aw(Cs("a","b","c"),qi)]))).if(LL,(t,e)=>{const n={},r=Zd(e,0,3);for(let i=0;i<r;i++){const s=Ai(e,t.shape.keys),o=Ai(e,t.shape.values);n[s]=o}return n}).done(),Ai=(t,e)=>yw(To(e),t),Jc=typeof document<"u"?document:{};at(t=>t.nodeType===nP);typeof DOMParser<"u"&&new DOMParser;at(t=>t.nodeType===QL);at(t=>t.nodeType===eP);const ZL=t=>MD(t,(e,n)=>`${n}:${e};`).join(""),QL=Jc.ELEMENT_NODE,eP=Jc.TEXT_NODE,tP=Jc.DOCUMENT_NODE,nP=Jc.DOCUMENT_FRAGMENT_NODE;at(t=>t.nodeType===tP);const sr=Symbol,bw=sr(),vw=sr(),rP=sr(),iP=sr(),sP=sr(),xw=sr(),oP=sr(),Hh=sr(),aP=sr(),lP=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 s=t[r];if(s===void 0)break;if(s.constructor===String||s.constructor===Number)e.push(s);else if(s.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const s=t[r];s instanceof Symbol||n.push(s)}return n},cP={[bw]:$n("font-weight","bold"),[vw]:$n("font-weight","normal"),[rP]:$n("color","blue"),[sP]:$n("color","green"),[iP]:$n("color","grey"),[xw]:$n("color","red"),[oP]:$n("color","purple"),[Hh]:$n("color","orange"),[aP]:$n("color","black")},dP=t=>{var o;t.length===1&&((o=t[0])==null?void 0:o.constructor)===Function&&(t=t[0]());const e=[],n=[],r=Tn();let i=[],s=0;for(;s<t.length;s++){const a=t[s],l=cP[a];if(l!==void 0)r.set(l.left,l.right);else{if(a===void 0)break;if(a.constructor===String||a.constructor===Number){const c=ZL(r);s>0||c.length>0?(e.push("%c"+a),n.push(c)):e.push(a)}else break}}for(s>0&&(i=n,i.unshift(e.join("")));s<t.length;s++){const a=t[s];a instanceof Symbol||i.push(a)}return i},ww=wL?dP:lP,uP=(...t)=>{console.log(...ww(t)),Ew.forEach(e=>e.print(t))},fP=(...t)=>{console.warn(...ww(t)),t.unshift(Hh),Ew.forEach(e=>e.print(t))},Ew=us(),kw=t=>({[Symbol.iterator](){return this},next:t}),hP=(t,e)=>kw(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),eu=(t,e)=>kw(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class Sw{constructor(e,n){this.clock=e,this.len=n}}class pP{constructor(){this.clients=new Map}}const Cw=(t,e,n)=>e.clients.forEach((r,i)=>{const s=t.doc.store.clients.get(i);if(s!=null){const o=s[s.length-1],a=o.id.clock+o.length;for(let l=0,c=r[l];l<r.length&&c.clock<a;c=r[++l])Rw(t,s,c.clock,c.len,n)}}),mP=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const i=Qn((n+r)/2),s=t[i],o=s.clock;if(o<=e){if(e<o+s.len)return i;n=i+1}else r=i-1}return null},_w=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&mP(n,e.clock)!==null},Nw=t=>{t.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let n,r;for(n=1,r=1;n<e.length;n++){const i=e[r-1],s=e[n];i.clock+i.len>=s.clock?e[r-1]=new Sw(i.clock,Ss(i.len,s.clock+s.len-i.clock)):(r<n&&(e[r]=s),r++)}e.length=r})},Tw=(t,e,n,r)=>{ks(t.clients,e,()=>[]).push(new Sw(n,r))},gP=(t,e)=>{Le(t.restEncoder,e.clients.size),fs(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),Le(t.restEncoder,n);const i=r.length;Le(t.restEncoder,i);for(let s=0;s<i;s++){const o=r[s];t.writeDsClock(o.clock),t.writeDsLen(o.len)}})},Aw=Jx;class ta extends ID{constructor({guid:e=oL(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=Aw(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new CP,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Og(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>Og(c=>{const d=u=>{(u===void 0||u===!0)&&(this.off("sync",d),c())};this.on("sync",d)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&He(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(fs(this.subdocs).map(e=>e.guid))}transact(e,n=null){return He(this,e,n)}get(e,n=gt){const r=ks(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),i=r.constructor;if(n!==gt&&i!==n)if(i===gt){const s=new n;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}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,Zs)}getText(e=""){return this.get(e,Ro)}getMap(e=""){return this.get(e,Ll)}getXmlElement(e=""){return this.get(e,Io)}getXmlFragment(e=""){return this.get(e,ps)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,fs(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new ta({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,He(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 yP{constructor(){this.restEncoder=Oh()}toUint8Array(){return Gn(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Le(this.restEncoder,e)}writeDsLen(e){Le(this.restEncoder,e)}}class bP extends yP{writeLeftID(e){Le(this.restEncoder,e.client),Le(this.restEncoder,e.clock)}writeRightID(e){Le(this.restEncoder,e.client),Le(this.restEncoder,e.clock)}writeClient(e){Le(this.restEncoder,e)}writeInfo(e){of(this.restEncoder,e)}writeString(e){Gi(this.restEncoder,e)}writeParentInfo(e){Le(this.restEncoder,e?1:0)}writeTypeRef(e){Le(this.restEncoder,e)}writeLen(e){Le(this.restEncoder,e)}writeAny(e){Co(this.restEncoder,e)}writeBuf(e){Bt(this.restEncoder,e)}writeJSON(e){Gi(this.restEncoder,JSON.stringify(e))}writeKey(e){Gi(this.restEncoder,e)}}class vP{constructor(){this.restEncoder=Oh(),this.dsCurrVal=0}toUint8Array(){return Gn(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,Le(this.restEncoder,n)}writeDsLen(e){e===0&&Rn(),Le(this.restEncoder,e-1),this.dsCurrVal+=e}}class xP extends vP{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Xd,this.clientEncoder=new Qa,this.leftClockEncoder=new Xd,this.rightClockEncoder=new Xd,this.infoEncoder=new Tg(of),this.stringEncoder=new rL,this.parentInfoEncoder=new Tg(of),this.typeRefEncoder=new Qa,this.lenEncoder=new Qa}toUint8Array(){const e=Oh();return Le(e,0),Bt(e,this.keyClockEncoder.toUint8Array()),Bt(e,this.clientEncoder.toUint8Array()),Bt(e,this.leftClockEncoder.toUint8Array()),Bt(e,this.rightClockEncoder.toUint8Array()),Bt(e,Gn(this.infoEncoder)),Bt(e,this.stringEncoder.toUint8Array()),Bt(e,Gn(this.parentInfoEncoder)),Bt(e,this.typeRefEncoder.toUint8Array()),Bt(e,this.lenEncoder.toUint8Array()),Ih(e,Gn(this.restEncoder)),Gn(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){Co(this.restEncoder,e)}writeBuf(e){Bt(this.restEncoder,e)}writeJSON(e){Co(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 wP=(t,e,n,r)=>{r=Ss(r,e[0].id.clock);const i=er(e,r);Le(t.restEncoder,e.length-i),t.writeClient(n),Le(t.restEncoder,r);const s=e[i];s.write(t,r-s.id.clock);for(let o=i+1;o<e.length;o++)e[o].write(t,0)},EP=(t,e,n)=>{const r=new Map;n.forEach((i,s)=>{Ot(e,s)>i&&r.set(s,i)}),zh(e).forEach((i,s)=>{n.has(s)||r.set(s,0)}),Le(t.restEncoder,r.size),fs(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{wP(t,e.clients.get(i),i,s)})},kP=(t,e)=>EP(t,e.doc.store,e.beforeState);class SP{constructor(){this.l=[]}}const Lg=()=>new SP,Pg=(t,e)=>t.l.push(e),Bg=(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.")},Mw=(t,e,n)=>Ph(t.l,[e,n]);class tl{constructor(e,n){this.client=e,this.clock=n}}const Ea=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ve=(t,e)=>new tl(t,e),Ao=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw Rn()};class Rl{constructor(e,n,r,i=0){this.type=e,this.tname=n,this.item=r,this.assoc=i}}const ka=(t,e,n)=>{let r=null,i=null;return t._item===null?i=Ao(t):r=Ve(t._item.id.client,t._item.id.clock),new Rl(r,i,e,n)},tu=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return ka(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return ka(t,Ve(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return ka(t,r.lastId,n);r=r.right}return ka(t,null,n)},Pi=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!_w(e.ds,t.id),df=(t,e)=>{const n=ks(t.meta,df,us),r=t.doc.store;n.has(e)||(e.sv.forEach((i,s)=>{i<Ot(r,s)&&Rr(t,Ve(s,i))}),Cw(t,e.ds,i=>{}),n.add(e))};class CP{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const zh=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},Ot=(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},Ow=(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 Rn()}n.push(e)},er=(t,e)=>{let n=0,r=t.length-1,i=t[r],s=i.id.clock;if(s===e)return r;let o=Qn(e/(s+i.length-1)*r);for(;n<=r;){if(i=t[o],s=i.id.clock,s<=e){if(e<s+i.length)return o;n=o+1}else r=o-1;o=Qn((n+r)/2)}throw Rn()},_P=(t,e)=>{const n=t.clients.get(e.client);return n[er(n,e.clock)]},nu=_P,uf=(t,e,n)=>{const r=er(e,n),i=e[r];return i.id.clock<n&&i instanceof Ft?(e.splice(r+1,0,Jw(t,i,n-i.id.clock)),r+1):r},Rr=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[uf(t,n,e.clock)]},$g=(t,e,n)=>{const r=e.clients.get(n.client),i=er(r,n.clock),s=r[i];return n.clock!==s.id.clock+s.length-1&&s.constructor!==mr&&r.splice(i+1,0,Jw(t,s,n.clock-s.id.clock+1)),s},NP=(t,e,n)=>{const r=t.clients.get(e.id.client);r[er(r,e.id.clock)]=n},Rw=(t,e,n,r,i)=>{if(r===0)return;const s=n+r;let o=uf(t,e,n),a;do a=e[o++],s<a.id.clock+a.length&&uf(t,e,s),i(a);while(o<e.length&&e[o].id.clock<s)};class TP{constructor(e,n,r){this.doc=e,this.deleteSet=new pP,this.beforeState=zh(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 jg=(t,e)=>e.deleteSet.clients.size===0&&!OD(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(Nw(e.deleteSet),kP(t,e),gP(t,e.deleteSet),!0),Fg=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&ks(t.changed,e,us).add(n)},nl=(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 Ft&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const s=e-i;return s&&t.splice(e+1-s,s),s},AP=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const a=i[o],l=a.clock+a.len;for(let c=er(s,a.clock),d=s[c];c<s.length&&d.id.clock<l;d=s[++c]){const u=s[c];if(a.clock+a.len<=u.id.clock)break;u instanceof Ft&&u.deleted&&!u.keep&&n(u)&&u.gc(e,!1)}}}},MP=(t,e)=>{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let s=n.length-1;s>=0;s--){const o=n[s],a=qx(i.length-1,1+er(i,o.clock+o.len-1));for(let l=a,c=i[l];l>0&&c.id.clock>=o.clock;c=i[l])l-=1+nl(i,l)}})},Iw=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,i=r.store,s=n.deleteSet,o=n._mergeStructs;try{Nw(s),n.afterState=zh(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const a=[];n.changed.forEach((l,c)=>a.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(d=>d.target._item===null||!d.target._item.deleted),l.forEach(d=>{d.currentTarget=c,d._path=null}),l.sort((d,u)=>d.path.length-u.path.length),a.push(()=>{Mw(c._dEH,l,n)}))}),a.push(()=>r.emit("afterTransaction",[n,r])),a.push(()=>{n._needFormattingCleanup&&zP(n)})}),Ph(a,[])}finally{r.gc&&AP(s,i,r.gcFilter),MP(s,i),n.afterState.forEach((d,u)=>{const f=n.beforeState.get(u)||0;if(f!==d){const h=i.clients.get(u),m=Ss(er(h,f),1);for(let g=h.length-1;g>=m;)g-=1+nl(h,g)}});for(let d=o.length-1;d>=0;d--){const{client:u,clock:f}=o[d].id,h=i.clients.get(u),m=er(h,f);m+1<h.length&&nl(h,m+1)>1||m>0&&nl(h,m)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(uP(Hh,bw,"[yjs] ",vw,xw,"Changed the client-id because another client seems to be using it."),r.clientID=Aw()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const d=new bP;jg(d,n)&&r.emit("update",[d.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const d=new xP;jg(d,n)&&r.emit("updateV2",[d.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(d=>{d.clientID=r.clientID,d.collectionid==null&&(d.collectionid=r.collectionid),r.subdocs.add(d)}),c.forEach(d=>r.subdocs.delete(d)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(d=>d.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):Iw(t,e+1)}}},He=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new TP(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const a=t._transaction===i[0];t._transaction=null,a&&Iw(i,0)}}return o},Hg="You must not compute changes after the event-handler fired.";class Xc{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=OP(this.currentTarget,this.target))}deletes(e){return _w(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Or(Hg);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const s=n._map.get(i);let o,a;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))o="delete",a=Gd(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",a=Gd(l.content.getContent())):(o="add",a=void 0)}else if(this.deletes(s))o="delete",a=Gd(s.content.getContent());else return;e.set(i,{action:o,oldValue:a})}}),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 Or(Hg);const n=this.target,r=us(),i=us(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&s.push(a)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,i.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),r.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const OP=(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},bt=()=>{fP("Invalid access: Add Yjs type to a document before reading data.")},Dw=80;let Uh=0;class RP{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=Uh++}}const IP=t=>{t.timestamp=Uh++},Lw=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Uh++},DP=(t,e,n)=>{if(t.length>=Dw){const r=t.reduce((i,s)=>i.timestamp<s.timestamp?i:s);return Lw(r,e,n),r}else{const r=new RP(e,n);return t.push(r),r}},Zc=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>Za(e-s.index)<Za(e-o.index)?s:o);let r=t._start,i=0;for(n!==null&&(r=n.p,i=n.index,IP(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&&Za(n.index-i)<r.parent.length/Dw?(Lw(n,r,i),n):DP(t._searchMarker,r,i)},Mo=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){t.splice(r,1);continue}i.p=s,s.marker=!0}(e<i.index||n>0&&e===i.index)&&(i.index=Ss(e,i.index+n))}},Qc=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;ks(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;Mw(r._eH,n,e)};class gt{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Lg(),this._dEH=Lg(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw ln()}clone(){throw ln()}_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){Pg(this._eH,e)}observeDeep(e){Pg(this._dEH,e)}unobserve(e){Bg(this._eH,e)}unobserveDeep(e){Bg(this._dEH,e)}toJSON(){}}const Pw=(t,e,n)=>{t.doc??bt(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let s=t._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let a=e;a<o.length&&r>0;a++)i.push(o[a]),r--;e=0}}s=s.right}return i},Bw=t=>{t.doc??bt();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},Oo=(t,e)=>{let n=0,r=t._start;for(t.doc??bt();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s<i.length;s++)e(i[s],n++,t)}r=r.right}},$w=(t,e)=>{const n=[];return Oo(t,(r,i)=>{n.push(e(r,i,t))}),n},LP=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}}}},jw=(t,e)=>{t.doc??bt();const n=Zc(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}},Il=(t,e,n,r)=>{let i=n;const s=t.doc,o=s.clientID,a=s.store,l=n===null?e._start:n.right;let c=[];const d=()=>{c.length>0&&(i=new Ft(Ve(o,Ot(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new ms(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(d(),u.constructor){case Uint8Array:case ArrayBuffer:i=new Ft(Ve(o,Ot(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new ed(new Uint8Array(u))),i.integrate(t,0);break;case ta:i=new Ft(Ve(o,Ot(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new td(u)),i.integrate(t,0);break;default:if(u instanceof gt)i=new Ft(Ve(o,Ot(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Fr(u)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},Fw=()=>Or("Length exceeded!"),Hw=(t,e,n,r)=>{if(n>e._length)throw Fw();if(n===0)return e._searchMarker&&Mo(e._searchMarker,n,r.length),Il(t,e,null,r);const i=n,s=Zc(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&Rr(t,Ve(o.id.client,o.id.clock+n));break}n-=o.length}return e._searchMarker&&Mo(e._searchMarker,i,r.length),Il(t,e,o,r)},PP=(t,e,n)=>{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Il(t,e,i,n)},zw=(t,e,n,r)=>{if(r===0)return;const i=n,s=r,o=Zc(e,n);let a=e._start;for(o!==null&&(a=o.p,n-=o.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&Rr(t,Ve(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&a!==null;)a.deleted||(r<a.length&&Rr(t,Ve(a.id.client,a.id.clock+r)),a.delete(t),r-=a.length),a=a.right;if(r>0)throw Fw();e._searchMarker&&Mo(e._searchMarker,i,-s+r)},Dl=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},Vh=(t,e,n,r)=>{const i=e._map.get(n)||null,s=t.doc,o=s.clientID;let a;if(r==null)a=new ms([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new ms([r]);break;case Uint8Array:a=new ed(r);break;case ta:a=new td(r);break;default:if(r instanceof gt)a=new Fr(r);else throw new Error("Unexpected content type")}new Ft(Ve(o,Ot(s.store,o)),i,i&&i.lastId,null,null,e,n,a).integrate(t,0)},Kh=(t,e)=>{t.doc??bt();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},Uw=t=>{const e={};return t.doc??bt(),t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},Vw=(t,e)=>{t.doc??bt();const n=t._map.get(e);return n!==void 0&&!n.deleted},BP=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&Pi(s,e)&&(n[i]=s.content.getContent()[s.length-1])}),n},Sa=t=>(t.doc??bt(),hP(t._map.entries(),e=>!e[1].deleted));class $P extends Xc{}class Zs extends gt{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Zs;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Zs}clone(){const e=new Zs;return e.insert(0,this.toArray().map(n=>n instanceof gt?n.clone():n)),e}get length(){return this.doc??bt(),this._length}_callObserver(e,n){super._callObserver(e,n),Qc(this,e,new $P(this,e))}insert(e,n){this.doc!==null?He(this.doc,r=>{Hw(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?He(this.doc,n=>{PP(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?He(this.doc,r=>{zw(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return jw(this,e)}toArray(){return Bw(this)}slice(e=0,n=this.length){return Pw(this,e,n)}toJSON(){return this.map(e=>e instanceof gt?e.toJSON():e)}map(e){return $w(this,e)}forEach(e){Oo(this,e)}[Symbol.iterator](){return LP(this)}_write(e){e.writeTypeRef(qP)}}class jP extends Xc{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Ll extends gt{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 Ll}clone(){const e=new Ll;return this.forEach((n,r)=>{e.set(r,n instanceof gt?n.clone():n)}),e}_callObserver(e,n){Qc(this,e,new jP(this,e,n))}toJSON(){this.doc??bt();const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof gt?i.toJSON():i}}),e}get size(){return[...Sa(this)].length}keys(){return eu(Sa(this),e=>e[0])}values(){return eu(Sa(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return eu(Sa(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??bt(),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?He(this.doc,n=>{Dl(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?He(this.doc,r=>{Vh(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return Kh(this,e)}has(e){return Vw(this,e)}clear(){this.doc!==null?He(this.doc,e=>{this.forEach(function(n,r,i){Dl(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(YP)}}const xr=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&mL(t,e);class ff{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&Rn(),this.right.content.constructor){case ot:this.right.deleted||_s(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 zg=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case ot:e.right.deleted||_s(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&Rr(t,Ve(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},Ca=(t,e,n,r)=>{const i=new Map,s=r?Zc(e,n):null;if(s){const o=new ff(s.p.left,s.p,s.index,i);return zg(t,o,n-s.index)}else{const o=new ff(null,e._start,0,i);return zg(t,o,n)}},Kw=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===ot&&xr(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,s=i.clientID;r.forEach((o,a)=>{const l=n.left,c=n.right,d=new Ft(Ve(s,Ot(i.store,s)),l,l&&l.lastId,c,c&&c.id,e,null,new ot(a,o));d.integrate(t,0),n.right=d,n.forward()})},_s=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},Ww=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===ot&&xr(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},Gw=(t,e,n,r)=>{const i=t.doc,s=i.clientID,o=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!xr(c,l)){o.set(a,c);const{left:d,right:u}=n;n.right=new Ft(Ve(s,Ot(i.store,s)),d,d&&d.lastId,u,u&&u.id,e,null,new ot(a,l)),n.right.integrate(t,0),n.forward()}}return o},ru=(t,e,n,r,i)=>{n.currentAttributes.forEach((f,h)=>{i[h]===void 0&&(i[h]=null)});const s=t.doc,o=s.clientID;Ww(n,i);const a=Gw(t,e,n,i),l=r.constructor===String?new tr(r):r instanceof gt?new Fr(r):new Ns(r);let{left:c,right:d,index:u}=n;e._searchMarker&&Mo(e._searchMarker,n.index,l.getLength()),d=new Ft(Ve(o,Ot(s.store,o)),c,c&&c.lastId,d,d&&d.id,e,null,l),d.integrate(t,0),n.right=d,n.index=u,n.forward(),Kw(t,e,n,a)},Ug=(t,e,n,r,i)=>{const s=t.doc,o=s.clientID;Ww(n,i);const a=Gw(t,e,n,i);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===ot));){if(!n.right.deleted)switch(n.right.content.constructor){case ot:{const{key:l,value:c}=n.right.content,d=i[l];if(d!==void 0){if(xr(d,c))a.delete(l);else{if(r===0)break e;a.set(l,c)}n.right.delete(t)}else n.currentAttributes.set(l,c);break}default:r<n.right.length&&Rr(t,Ve(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let l="";for(;r>0;r--)l+=`
|
|
478
|
+
`;n.right=new Ft(Ve(o,Ot(s.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new tr(l)),n.right.integrate(t,0),n.forward()}Kw(t,e,n,a)},qw=(t,e,n,r,i)=>{let s=e;const o=Tn();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===ot){const c=s.content;o.set(c.key,c)}s=s.right}let a=0,l=!1;for(;e!==s;){if(n===e&&(l=!0),!e.deleted){const c=e.content;switch(c.constructor){case ot:{const{key:d,value:u}=c,f=r.get(d)??null;(o.get(d)!==c||f===u)&&(e.delete(t),a++,!l&&(i.get(d)??null)===u&&f!==u&&(f===null?i.delete(d):i.set(d,f))),!l&&!e.deleted&&_s(i,c);break}}}e=e.right}return a},FP=(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===ot){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},HP=t=>{let e=0;return He(t.doc,n=>{let r=t._start,i=t._start,s=Tn();const o=sf(s);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case ot:_s(o,i.content);break;default:e+=qw(n,r,i,s,o),s=sf(o),r=i;break}i=i.right}}),e},zP=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const s=t.beforeState.get(r)||0;i!==s&&Rw(t,n.store.clients.get(r),s,i,o=>{!o.deleted&&o.content.constructor===ot&&o.constructor!==mr&&e.add(o.parent)})}He(n,r=>{Cw(t,t.deleteSet,i=>{if(i instanceof mr||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===ot?e.add(s):FP(r,i)});for(const i of e)HP(i)})},Vg=(t,e,n)=>{const r=n,i=sf(e.currentAttributes),s=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Fr:case Ns:case tr:n<e.right.length&&Rr(t,Ve(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}s&&qw(t,s,e.right,i,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&Mo(o._searchMarker,e.index,-r+n),e};class UP extends Xc{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=[];He(e,r=>{const i=new Map,s=new Map;let o=this.target._start,a=null;const l={};let c="",d=0,u=0;const f=()=>{if(a!==null){let h=null;switch(a){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((m,g)=>{m!==null&&(h.attributes[g]=m)}))),c="";break;case"retain":d>0&&(h={retain:d},pL(l)||(h.attributes=uL({},l))),d=0;break}h&&n.push(h),a=null}};for(;o!==null;){switch(o.content.constructor){case Fr:case Ns:this.adds(o)?this.deletes(o)||(f(),a="insert",c=o.content.getContent()[0],f()):this.deletes(o)?(a!=="delete"&&(f(),a="delete"),u+=1):o.deleted||(a!=="retain"&&(f(),a="retain"),d+=1);break;case tr:this.adds(o)?this.deletes(o)||(a!=="insert"&&(f(),a="insert"),c+=o.content.str):this.deletes(o)?(a!=="delete"&&(f(),a="delete"),u+=o.length):o.deleted||(a!=="retain"&&(f(),a="retain"),d+=o.length);break;case ot:{const{key:h,value:m}=o.content;if(this.adds(o)){if(!this.deletes(o)){const g=i.get(h)??null;xr(g,m)?m!==null&&o.delete(r):(a==="retain"&&f(),xr(m,s.get(h)??null)?delete l[h]:l[h]=m)}}else if(this.deletes(o)){s.set(h,m);const g=i.get(h)??null;xr(g,m)||(a==="retain"&&f(),l[h]=g)}else if(!o.deleted){s.set(h,m);const g=l[h];g!==void 0&&(xr(g,m)?g!==null&&o.delete(r):(a==="retain"&&f(),m===null?delete l[h]:l[h]=m))}o.deleted||(a==="insert"&&f(),_s(i,o.content));break}}o=o.right}for(f();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 Ro extends gt{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??bt(),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 Ro}clone(){const e=new Ro;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new UP(this,e,n);Qc(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??bt();let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===tr&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?He(this.doc,r=>{const i=new ff(null,this._start,0,new Map);for(let s=0;s<e.length;s++){const o=e[s];if(o.insert!==void 0){const a=!n&&typeof o.insert=="string"&&s===e.length-1&&i.right===null&&o.insert.slice(-1)===`
|
|
479
|
+
`?o.insert.slice(0,-1):o.insert;(typeof a!="string"||a.length>0)&&ru(r,this,i,a,o.attributes||{})}else o.retain!==void 0?Ug(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&Vg(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){this.doc??bt();const i=[],s=new Map,o=this.doc;let a="",l=this._start;function c(){if(a.length>0){const u={};let f=!1;s.forEach((m,g)=>{f=!0,u[g]=m});const h={insert:a};f&&(h.attributes=u),i.push(h),a=""}}const d=()=>{for(;l!==null;){if(Pi(l,e)||n!==void 0&&Pi(l,n))switch(l.content.constructor){case tr:{const u=s.get("ychange");e!==void 0&&!Pi(l,e)?(u===void 0||u.user!==l.id.client||u.type!=="removed")&&(c(),s.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!Pi(l,n)?(u===void 0||u.user!==l.id.client||u.type!=="added")&&(c(),s.set("ychange",r?r("added",l.id):{type:"added"})):u!==void 0&&(c(),s.delete("ychange")),a+=l.content.str;break}case Fr:case Ns:{c();const u={insert:l.content.getContent()[0]};if(s.size>0){const f={};u.attributes=f,s.forEach((h,m)=>{f[m]=h})}i.push(u);break}case ot:Pi(l,e)&&(c(),_s(s,l.content));break}l=l.right}c()};return e||n?He(o,u=>{e&&df(u,e),n&&df(u,n),d()},"cleanup"):d(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?He(i,s=>{const o=Ca(s,this,e,!r);r||(r={},o.currentAttributes.forEach((a,l)=>{r[l]=a})),ru(s,this,o,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?He(i,s=>{const o=Ca(s,this,e,!r);ru(s,this,o,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?He(r,i=>{Vg(i,Ca(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?He(i,s=>{const o=Ca(s,this,e,!1);o.right!==null&&Ug(s,this,o,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?He(this.doc,n=>{Dl(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?He(this.doc,r=>{Vh(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return Kh(this,e)}getAttributes(){return Uw(this)}_write(e){e.writeTypeRef(JP)}}class iu{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??bt()}[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===Io||n.constructor===ps)&&n._start!==null)e=n._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;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 ps extends gt{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 ps}clone(){const e=new ps;return e.insert(0,this.toArray().map(n=>n instanceof gt?n.clone():n)),e}get length(){return this.doc??bt(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new iu(this,e)}querySelector(e){e=e.toUpperCase();const r=new iu(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),fs(new iu(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Qc(this,e,new VP(this,n,e))}toString(){return $w(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),Oo(this,s=>{i.insertBefore(s.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?He(this.doc,r=>{Hw(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)He(this.doc,r=>{const i=e&&e instanceof gt?e._item:e;Il(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw Or("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?He(this.doc,r=>{zw(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return Bw(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return jw(this,e)}slice(e=0,n=this.length){return Pw(this,e,n)}forEach(e){Oo(this,e)}_write(e){e.writeTypeRef(ZP)}}class Io extends ps{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 Io(this.nodeName)}clone(){const e=new Io(this.nodeName),n=this.getAttributes();return hL(n,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof gt?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const a in e)r.push(a);r.sort();const i=r.length;for(let a=0;a<i;a++){const l=r[a];n.push(l+'="'+e[l]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?He(this.doc,n=>{Dl(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?He(this.doc,r=>{Vh(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return Kh(this,e)}hasAttribute(e){return Vw(this,e)}getAttributes(e){return e?BP(this,e):Uw(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const a=s[o];typeof a=="string"&&i.setAttribute(o,a)}return Oo(this,o=>{i.appendChild(o.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(XP),e.writeKey(this.nodeName)}}class VP extends Xc{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 Do extends Ro{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 Do}clone(){const e=new Do;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 s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,a)=>o.key<a.key?-1:1),n.push({nodeName:i,attrs:s})}n.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<n.length;i++){const s=n[i];r+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const a=s.attrs[o];r+=` ${a.key}="${a.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(QP)}}class Yw{constructor(e,n){this.id=e,this.length=n}get deleted(){throw ln()}mergeWith(e){return!1}write(e,n,r){throw ln()}integrate(e,n){throw ln()}}const KP=0;class mr extends Yw{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),Ow(e.doc.store,this)}write(e,n){e.writeInfo(KP),e.writeLen(this.length-n)}getMissing(e,n){return null}}class ed{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new ed(this.content)}splice(e){throw ln()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}class Pl{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Pl(this.len)}splice(e){const n=new Pl(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){Tw(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 WP=(t,e)=>new ta({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class td{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 td(WP(this.doc.guid,this.opts))}splice(e){throw ln()}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 Ns{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Ns(this.embed)}splice(e){throw ln()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}class ot{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new ot(this.key,this.value)}splice(e){throw ln()}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}}const GP=Tl("node_env")==="development";class ms{constructor(e){this.arr=e,GP&&Qx(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new ms(this.arr)}splice(e){const n=new ms(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 s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}class tr{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new tr(this.str)}splice(e){const n=new tr(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 qP=0,YP=1,JP=2,XP=3,ZP=4,QP=6;class Fr{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Fr(this.type._copy())}splice(e){throw ln()}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 Jw=(t,e,n)=>{const{client:r,clock:i}=e.id,s=new Ft(Ve(r,i+n),e,Ve(r,i+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=Ve(e.redone.client,e.redone.clock+n)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=n,s};let Ft=class hf extends Yw{constructor(e,n,r,i,s,o,a,l){super(e,l.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?Eg:0}set marker(e){(this.info&Yd)>0!==e&&(this.info^=Yd)}get marker(){return(this.info&Yd)>0}get keep(){return(this.info&wg)>0}set keep(e){this.keep!==e&&(this.info^=wg)}get countable(){return(this.info&Eg)>0}get deleted(){return(this.info&qd)>0}set deleted(e){this.deleted!==e&&(this.info^=qd)}markDeleted(){this.info|=qd}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Ot(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Ot(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===tl&&this.id.client!==this.parent.client&&this.parent.clock>=Ot(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=$g(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Rr(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===mr||this.right&&this.right.constructor===mr)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===hf?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===hf&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===tl){const r=nu(n,this.parent);r.constructor===mr?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=$g(e,e.doc.store,Ve(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 s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),Ea(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,s.clear();else if(Ea(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&o.has(nu(e.doc.store,i.origin)))s.has(nu(e.doc.store,i.origin))||(r=i,s.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),Ow(e.doc.store,this),this.content.integrate(e,this),Fg(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new mr(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:Ve(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Ea(e.origin,this.lastId)&&this.right===e&&Ea(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(),Tw(e.deleteSet,this.id.client,this.id.clock,this.length),Fg(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw Rn();this.content.gc(e),n?NP(e,this,new mr(this.id,this.length)):this.content=new Pl(this.length)}write(e,n){const r=n>0?Ve(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&PD|(r===null?0:_l)|(i===null?0:Yx)|(s===null?0:LD);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=Ao(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===tl?(e.writeParentInfo(!1),e.writeLeftID(a)):Rn();s!==null&&e.writeString(s)}this.content.write(e,n)}};const Xw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},Zw="__ $YJS$ __";Xw[Zw]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Xw[Zw]=!0;const eB=new Be("y-sync");new Be("y-undo");new Be("yjs-cursor");const tB=(t,e,n)=>{if(t===0)return tu(e,0,e.length===0?-1:0);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof Do){if(r._length>=t)return tu(r,t,e.length===0?-1:0);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 Rl(r._item===null?null:r._item.id,r._item===null?Ao(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 Rl(r._item===null?null:r._item.id,r._item===null?Ao(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 Rn();if(t===0&&r.constructor!==Do&&r!==e)return nB(r._item.parent,r._item)}return tu(e,e._length,e.length===0?-1:0)},nB=(t,e)=>{let n=null,r=null;return t._item===null?r=Ao(t):n=Ve(t._item.id.client,t._item.id.clock),new Rl(n,r,e.id)},rB=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Wh=Je.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Ae(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[V0({find:rB,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});function iB(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:o,$position:a}=t,l=r&&!i,c=uT(n),d=new RegExp(`\\s${c}$`),u=o?"^":"",f=i?"":c,h=l?new RegExp(`${u}${c}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${f}]*`,"gm"),m=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!m)return null;const g=a.pos-m.length,y=Array.from(m.matchAll(h)).pop();if(!y||y.input===void 0||y.index===void 0)return null;const b=y.input.slice(Math.max(0,y.index-1),y.index),w=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(b);if(s!==null&&!w)return null;const E=g+y.index;let v=E+y[0].length;return l&&d.test(m.slice(v-1,v+1))&&(y[0]+=" ",v+=1),E<a.pos&&v>=a.pos?{range:{from:E,to:v},query:y[0].slice(n.length),text:y[0]}:null}const sB=new Be("suggestion");function Qw({pluginKey:t=sB,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:s=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:d="is-empty",command:u=()=>null,items:f=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=iB}){let y;const b=h==null?void 0:h(),w=new $e({key:t,view(){return{update:async(E,v)=>{var S,k,C,T,M,D,F;const B=(S=this.key)===null||S===void 0?void 0:S.getState(v),z=(k=this.key)===null||k===void 0?void 0:k.getState(E.state),W=B.active&&z.active&&B.range.from!==z.range.from,G=!B.active&&z.active,A=B.active&&!z.active,N=!G&&!A&&B.query!==z.query,_=G||W&&N,I=N||W,$=A||W&&N;if(!_&&!I&&!$)return;const q=$&&!_?B:z,se=E.dom.querySelector(`[data-decoration-id="${q.decorationId}"]`);y={editor:e,range:q.range,query:q.query,text:q.text,items:[],command:ae=>u({editor:e,range:q.range,props:ae}),decorationNode:se,clientRect:se?()=>{var ae;const{decorationId:K}=(ae=this.key)===null||ae===void 0?void 0:ae.getState(e.state),X=E.dom.querySelector(`[data-decoration-id="${K}"]`);return(X==null?void 0:X.getBoundingClientRect())||null}:null},_&&((C=b==null?void 0:b.onBeforeStart)===null||C===void 0||C.call(b,y)),I&&((T=b==null?void 0:b.onBeforeUpdate)===null||T===void 0||T.call(b,y)),(I||_)&&(y.items=await f({editor:e,query:q.query})),$&&((M=b==null?void 0:b.onExit)===null||M===void 0||M.call(b,y)),I&&((D=b==null?void 0:b.onUpdate)===null||D===void 0||D.call(b,y)),_&&((F=b==null?void 0:b.onStart)===null||F===void 0||F.call(b,y))},destroy:()=>{var E;y&&((E=b==null?void 0:b.onExit)===null||E===void 0||E.call(b,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(E,v,S,k){const{isEditable:C}=e,{composing:T}=e.view,{selection:M}=E,{empty:D,from:F}=M,B={...v};if(B.composing=T,C&&(D||e.view.composing)){(F<v.range.from||F>v.range.to)&&!T&&!v.composing&&(B.active=!1);const z=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:o,$position:M.$from}),W=`id_${Math.floor(Math.random()*4294967295)}`;z&&m({editor:e,state:k,range:z.range,isActive:v.active})?(B.active=!0,B.decorationId=v.decorationId?v.decorationId:W,B.range=z.range,B.query=z.query,B.text=z.text):B.active=!1}else B.active=!1;return B.active||(B.decorationId=null,B.range={from:0,to:0},B.query=null,B.text=null),B}},props:{handleKeyDown(E,v){var S;const{active:k,range:C}=w.getState(E.state);return k&&((S=b==null?void 0:b.onKeyDown)===null||S===void 0?void 0:S.call(b,{view:E,event:v,range:C}))||!1},decorations(E){const{active:v,range:S,decorationId:k,query:C}=w.getState(E);if(!v)return null;const T=!(C!=null&&C.length),M=[l];return T&&M.push(d),ze.create(E.doc,[pt.inline(S.from,S.to,{nodeName:a,class:M.join(" "),"data-decoration-id":k,"data-decoration-content":c})])}}});return w}function Ts(){return(Ts=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 nd(t,e){if(t==null)return{};var n,r,i={},s=Object.keys(t);for(r=0;r<s.length;r++)e.indexOf(n=s[r])>=0||(i[n]=t[n]);return i}function ri(t){var e=x.useRef(t),n=x.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var Lo=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},Qs=function(t){return"touches"in t},pf=function(t){return t&&t.ownerDocument.defaultView||self},Kg=function(t,e,n){var r=t.getBoundingClientRect(),i=Qs(e)?function(s,o){for(var a=0;a<s.length;a++)if(s[a].identifier===o)return s[a];return s[0]}(e.touches,n):e;return{left:Lo((i.pageX-(r.left+pf(t).pageXOffset))/r.width),top:Lo((i.pageY-(r.top+pf(t).pageYOffset))/r.height)}},Wg=function(t){!Qs(t)&&t.preventDefault()},e1=Q.memo(function(t){var e=t.onMove,n=t.onKey,r=t.onEnd,i=nd(t,["onMove","onKey","onEnd"]),s=x.useRef(null),o=ri(e),a=ri(n),l=ri(r),c=x.useRef(null),d=x.useRef(!1),u=x.useMemo(function(){var y=function(E){Wg(E),(Qs(E)?E.touches.length>0:E.buttons>0)&&s.current?o(Kg(s.current,E,c.current)):(w(!1),l())},b=function(){w(!1),l()};function w(E){var v=d.current,S=pf(s.current),k=E?S.addEventListener:S.removeEventListener;k(v?"touchmove":"mousemove",y),k(v?"touchend":"mouseup",b)}return[function(E){var v=E.nativeEvent,S=s.current;if(S&&(Wg(v),!function(C,T){return T&&!Qs(C)}(v,d.current)&&S)){if(Qs(v)){d.current=!0;var k=v.changedTouches||[];k.length&&(c.current=k[0].identifier)}S.focus(),o(Kg(S,v,c.current)),w(!0)}},function(E){var v=E.which||E.keyCode;v<37||v>40||(E.preventDefault(),a({left:v===39?.05:v===37?-.05:0,top:v===40?.05:v===38?-.05:0}))},function(E){var v=E.which||E.keyCode;v>=37&&v<=40&&l()},w]},[a,o,l]),f=u[0],h=u[1],m=u[2],g=u[3];return x.useEffect(function(){return g},[g]),Q.createElement("div",Ts({},i,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:s,onKeyDown:h,onKeyUp:m,tabIndex:0,role:"slider"}))}),Gh=function(t){return t.filter(Boolean).join(" ")},t1=function(t){var e=t.color,n=t.left,r=t.top,i=r===void 0?.5:r,s=Gh(["react-colorful__pointer",t.className]);return Q.createElement("div",{className:s,style:{top:100*i+"%",left:100*n+"%"}},Q.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},mt=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},oB=function(t){return uB(mf(t))},mf=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?mt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?mt(parseInt(t.substring(6,8),16)/255,2):1}},aB=function(t){return dB(cB(t))},lB=function(t){var e=t.s,n=t.v,r=t.a,i=(200-e)*n/100;return{h:mt(t.h),s:mt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:mt(i/2),a:mt(r,2)}},gf=function(t){var e=lB(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},cB=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var s=Math.floor(e),o=r*(1-n),a=r*(1-(e-s)*n),l=r*(1-(1-e+s)*n),c=s%6;return{r:mt(255*[r,a,o,o,l,r][c]),g:mt(255*[l,r,r,a,o,o][c]),b:mt(255*[o,o,l,r,r,a][c]),a:mt(i,2)}},_a=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},dB=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,s=i<1?_a(mt(255*i)):"";return"#"+_a(e)+_a(n)+_a(r)+s},uB=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,s=Math.max(e,n,r),o=s-Math.min(e,n,r),a=o?s===e?(n-r)/o:s===n?2+(r-e)/o:4+(e-n)/o:0;return{h:mt(60*(a<0?a+6:a)),s:mt(s?o/s*100:0),v:mt(s/255*100),a:i}},fB=Q.memo(function(t){var e=t.hue,n=t.onChange,r=t.onChangeEnd,i=Gh(["react-colorful__hue",t.className]);return Q.createElement("div",{className:i},Q.createElement(e1,{onMove:function(s){n({h:360*s.left})},onKey:function(s){n({h:Lo(e+360*s.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":mt(e),"aria-valuemax":"360","aria-valuemin":"0"},Q.createElement(t1,{className:"react-colorful__hue-pointer",left:e/360,color:gf({h:e,s:100,v:100,a:1})})))}),hB=Q.memo(function(t){var e=t.hsva,n=t.onChange,r=t.onChangeEnd,i={backgroundColor:gf({h:e.h,s:100,v:100,a:1})};return Q.createElement("div",{className:"react-colorful__saturation",style:i},Q.createElement(e1,{onMove:function(s){n({s:100*s.left,v:100-100*s.top})},onKey:function(s){n({s:Lo(e.s+100*s.left,0,100),v:Lo(e.v-100*s.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+mt(e.s)+"%, Brightness "+mt(e.v)+"%"},Q.createElement(t1,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:gf(e)})))}),n1=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},pB=function(t,e){return t.toLowerCase()===e.toLowerCase()||n1(mf(t),mf(e))};function mB(t,e,n,r){var i=ri(n),s=ri(r),o=x.useState(function(){return t.toHsva(e)}),a=o[0],l=o[1],c=x.useRef({color:e,hsva:a}),d=x.useRef(!1);x.useEffect(function(){if(!t.equal(e,c.current.color)){var h=t.toHsva(e);c.current={hsva:h,color:e},l(h),d.current=!1}},[e,t]),x.useEffect(function(){var h;n1(a,c.current.hsva)||t.equal(h=t.fromHsva(a),c.current.color)||(c.current={hsva:a,color:h},i(h),d.current=!0)},[a,t,i]);var u=x.useCallback(function(h){l(function(m){return Object.assign({},m,h)})},[]),f=x.useCallback(function(){d.current&&(d.current=!1,s(c.current.color))},[s]);return[a,u,f]}var gB=typeof window<"u"?x.useLayoutEffect:x.useEffect,yB=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Gg=new Map,bB=function(t){gB(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!Gg.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}`,Gg.set(e,n);var r=yB();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},vB=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,s=t.onChange,o=t.onChangeEnd,a=nd(t,["className","colorModel","color","onChange","onChangeEnd"]),l=x.useRef(null);bB(l);var c=mB(n,i,s,o),d=c[0],u=c[1],f=c[2],h=Gh(["react-colorful",e]);return Q.createElement("div",Ts({},a,{ref:l,className:h}),Q.createElement(hB,{hsva:d,onChange:u,onChangeEnd:f}),Q.createElement(fB,{hue:d.h,onChange:u,onChangeEnd:f,className:"react-colorful__last-control"}))},xB={defaultColor:"000",toHsva:oB,fromHsva:function(t){return aB({h:t.h,s:t.s,v:t.v,a:1})},equal:pB},wB=function(t){return Q.createElement(vB,Ts({},t,{colorModel:xB}))},EB=/^#?([0-9A-F]{3,8})$/i,kB=function(t){var e=t.color,n=e===void 0?"":e,r=t.onChange,i=t.onBlur,s=t.escape,o=t.validate,a=t.format,l=t.process,c=nd(t,["color","onChange","onBlur","escape","validate","format","process"]),d=x.useState(function(){return s(n)}),u=d[0],f=d[1],h=ri(r),m=ri(i),g=x.useCallback(function(b){var w=s(b.target.value);f(w),o(w)&&h(l?l(w):w)},[s,l,o,h]),y=x.useCallback(function(b){o(b.target.value)||f(s(n)),m(b)},[n,s,o,m]);return x.useEffect(function(){f(s(n))},[n,s]),Q.createElement("input",Ts({},c,{value:a?a(u):u,spellCheck:"false",onChange:g,onBlur:y}))},qg=function(t){return"#"+t},SB=function(t){var e=t.prefixed,n=t.alpha,r=nd(t,["prefixed","alpha"]),i=x.useCallback(function(o){return o.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),s=x.useCallback(function(o){return function(a,l){var c=EB.exec(a),d=c?c[1].length:0;return d===3||d===6||!!l&&d===4||!!l&&d===8}(o,n)},[n]);return Q.createElement(kB,Ts({},r,{escape:i,format:e?qg:void 0,process:qg,validate:s}))};const r1=Je.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Ae(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!dT(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):U0(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:a})=>{var l;if(a){const{$to:c}=o.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(ue.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(ce.create(o.doc,c.pos)):o.setSelection(ue.create(o.doc,c.pos));else{const u=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();u&&(o.insert(d,u),o.setSelection(ue.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[V0({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),CB=/^```([a-z]+)?[\s\n]$/,_B=/^~~~([a-z]+)?[\s\n]$/,i1=Je.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Ae(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
480
|
+
|
|
481
|
+
`);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(ge.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Uu({find:CB,type:this.type,getAttributes:t=>({language:t[1]})}),Uu({find:_B,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new $e({key:new Be("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
|
|
482
|
+
`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(ue.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}});function NB(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function s1(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&s1(n)}),t}let Yg=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function o1(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function wr(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const TB="</span>",Jg=t=>!!t.scope,AB=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`};let MB=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=o1(e)}openNode(e){if(!Jg(e))return;const n=AB(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){Jg(e)&&(this.buffer+=TB)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}};const Xg=(t={})=>{const e={children:[]};return Object.assign(e,t),e};let OB=class a1{constructor(){this.rootNode=Xg(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=Xg({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{a1._collapse(n)}))}},RB=class extends OB{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new MB(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Po(t){return t?typeof t=="string"?t:t.source:null}function l1(t){return bi("(?=",t,")")}function IB(t){return bi("(?:",t,")*")}function DB(t){return bi("(?:",t,")?")}function bi(...t){return t.map(n=>Po(n)).join("")}function LB(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function qh(...t){return"("+(LB(t).capture?"":"?:")+t.map(r=>Po(r)).join("|")+")"}function c1(t){return new RegExp(t.toString()+"|").exec("").length-1}function PB(t,e){const n=t&&t.exec(e);return n&&n.index===0}const BB=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Yh(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const i=n;let s=Po(r),o="";for(;s.length>0;){const a=BB.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(e)}const $B=/\b\B/,d1="[a-zA-Z]\\w*",Jh="[a-zA-Z_]\\w*",u1="\\b\\d+(\\.\\d+)?",f1="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",h1="\\b(0b[01]+)",jB="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",FB=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=bi(e,/.*\b/,t.binary,/\b.*/)),wr({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Bo={begin:"\\\\[\\s\\S]",relevance:0},HB={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Bo]},zB={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Bo]},UB={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},rd=function(t,e,n={}){const r=wr({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=qh("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:bi(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},VB=rd("//","$"),KB=rd("/\\*","\\*/"),WB=rd("#","$"),GB={scope:"number",begin:u1,relevance:0},qB={scope:"number",begin:f1,relevance:0},YB={scope:"number",begin:h1,relevance:0},JB={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Bo,{begin:/\[/,end:/\]/,relevance:0,contains:[Bo]}]},XB={scope:"title",begin:d1,relevance:0},ZB={scope:"title",begin:Jh,relevance:0},QB={begin:"\\.\\s*"+Jh,relevance:0},e3=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})};var Na=Object.freeze({__proto__:null,APOS_STRING_MODE:HB,BACKSLASH_ESCAPE:Bo,BINARY_NUMBER_MODE:YB,BINARY_NUMBER_RE:h1,COMMENT:rd,C_BLOCK_COMMENT_MODE:KB,C_LINE_COMMENT_MODE:VB,C_NUMBER_MODE:qB,C_NUMBER_RE:f1,END_SAME_AS_BEGIN:e3,HASH_COMMENT_MODE:WB,IDENT_RE:d1,MATCH_NOTHING_RE:$B,METHOD_GUARD:QB,NUMBER_MODE:GB,NUMBER_RE:u1,PHRASAL_WORDS_MODE:UB,QUOTE_STRING_MODE:zB,REGEXP_MODE:JB,RE_STARTERS_RE:jB,SHEBANG:FB,TITLE_MODE:XB,UNDERSCORE_IDENT_RE:Jh,UNDERSCORE_TITLE_MODE:ZB});function t3(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function n3(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function r3(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=t3,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function i3(t,e){Array.isArray(t.illegal)&&(t.illegal=qh(...t.illegal))}function s3(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function o3(t,e){t.relevance===void 0&&(t.relevance=1)}const a3=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=bi(n.beforeMatch,l1(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},l3=["of","and","for","in","not","or","if","then","parent","list","value"],c3="keyword";function p1(t,e,n=c3){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,p1(t[s],e,s))}),r;function i(s,o){e&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){const l=a.split("|");r[l[0]]=[s,d3(l[0],l[1])]})}}function d3(t,e){return e?Number(e):u3(t)?0:1}function u3(t){return l3.includes(t.toLowerCase())}const Zg={},ii=t=>{console.error(t)},Qg=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Mi=(t,e)=>{Zg[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),Zg[`${t}/${e}`]=!0)},Bl=new Error;function m1(t,e,{key:n}){let r=0;const i=t[n],s={},o={};for(let a=1;a<=e.length;a++)o[a+r]=i[a],s[a+r]=!0,r+=c1(e[a-1]);t[n]=o,t[n]._emit=s,t[n]._multi=!0}function f3(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw ii("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Bl;if(typeof t.beginScope!="object"||t.beginScope===null)throw ii("beginScope must be object"),Bl;m1(t,t.begin,{key:"beginScope"}),t.begin=Yh(t.begin,{joinWith:""})}}function h3(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw ii("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Bl;if(typeof t.endScope!="object"||t.endScope===null)throw ii("endScope must be object"),Bl;m1(t,t.end,{key:"endScope"}),t.end=Yh(t.end,{joinWith:""})}}function p3(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function m3(t){p3(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),f3(t),h3(t)}function g3(t){function e(o,a){return new RegExp(Po(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=c1(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=e(Yh(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const c=l.findIndex((u,f)=>f>0&&u!==void 0),d=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new n;return this.rules.slice(a).forEach(([c,d])=>l.addRule(c,d)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,c=d.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(o){const a=new r;return o.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function s(o,a){const l=o;if(o.isCompiled)return l;[n3,s3,m3,a3].forEach(d=>d(o,a)),t.compilerExtensions.forEach(d=>d(o,a)),o.__beforeBegin=null,[r3,i3,o3].forEach(d=>d(o,a)),o.isCompiled=!0;let c=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),c=o.keywords.$pattern,delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=p1(o.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=Po(l.end)||"",o.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return y3(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,l)}),o.starts&&s(o.starts,a),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=wr(t.classNameAliases||{}),s(t)}function g1(t){return t?t.endsWithParent||g1(t.starts):!1}function y3(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return wr(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:g1(t)?wr(t,{starts:t.starts?wr(t.starts):null}):Object.isFrozen(t)?wr(t):t}var b3="11.10.0";let v3=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}};const su=o1,ey=wr,ty=Symbol("nomatch"),x3=7,y1=function(t){const e=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:RB};function l(N){return a.noHighlightRe.test(N)}function c(N){let _=N.className+" ";_+=N.parentNode?N.parentNode.className:"";const I=a.languageDetectRe.exec(_);if(I){const $=M(I[1]);return $||(Qg(s.replace("{}",I[1])),Qg("Falling back to no-highlight mode for this block.",N)),$?I[1]:"no-highlight"}return _.split(/\s+/).find($=>l($)||M($))}function d(N,_,I){let $="",q="";typeof _=="object"?($=N,I=_.ignoreIllegals,q=_.language):(Mi("10.7.0","highlight(lang, code, ...args) has been deprecated."),Mi("10.7.0",`Please use highlight(code, options) instead.
|
|
483
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),q=N,$=_),I===void 0&&(I=!0);const se={code:$,language:q};G("before:highlight",se);const ae=se.result?se.result:u(se.language,se.code,I);return ae.code=se.code,G("after:highlight",ae),ae}function u(N,_,I,$){const q=Object.create(null);function se(O,P){return O.keywords[P]}function ae(){if(!ne.keywords){H.addText(ve);return}let O=0;ne.keywordPatternRe.lastIndex=0;let P=ne.keywordPatternRe.exec(ve),Y="";for(;P;){Y+=ve.substring(O,P.index);const fe=de.case_insensitive?P[0].toLowerCase():P[0],Ie=se(ne,fe);if(Ie){const[Pt,Rs]=Ie;if(H.addText(Y),Y="",q[fe]=(q[fe]||0)+1,q[fe]<=x3&&(Ge+=Rs),Pt.startsWith("_"))Y+=P[0];else{const R=de.classNameAliases[Pt]||Pt;me(P[0],R)}}else Y+=P[0];O=ne.keywordPatternRe.lastIndex,P=ne.keywordPatternRe.exec(ve)}Y+=ve.substring(O),H.addText(Y)}function K(){if(ve==="")return;let O=null;if(typeof ne.subLanguage=="string"){if(!e[ne.subLanguage]){H.addText(ve);return}O=u(ne.subLanguage,ve,!0,Ce[ne.subLanguage]),Ce[ne.subLanguage]=O._top}else O=h(ve,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(Ge+=O.relevance),H.__addSublanguage(O._emitter,O.language)}function X(){ne.subLanguage!=null?K():ae(),ve=""}function me(O,P){O!==""&&(H.startScope(P),H.addText(O),H.endScope())}function he(O,P){let Y=1;const fe=P.length-1;for(;Y<=fe;){if(!O._emit[Y]){Y++;continue}const Ie=de.classNameAliases[O[Y]]||O[Y],Pt=P[Y];Ie?me(Pt,Ie):(ve=Pt,ae(),ve=""),Y++}}function Se(O,P){return O.scope&&typeof O.scope=="string"&&H.openNode(de.classNameAliases[O.scope]||O.scope),O.beginScope&&(O.beginScope._wrap?(me(ve,de.classNameAliases[O.beginScope._wrap]||O.beginScope._wrap),ve=""):O.beginScope._multi&&(he(O.beginScope,P),ve="")),ne=Object.create(O,{parent:{value:ne}}),ne}function Ee(O,P,Y){let fe=PB(O.endRe,Y);if(fe){if(O["on:end"]){const Ie=new Yg(O);O["on:end"](P,Ie),Ie.isMatchIgnored&&(fe=!1)}if(fe){for(;O.endsParent&&O.parent;)O=O.parent;return O}}if(O.endsWithParent)return Ee(O.parent,P,Y)}function Ne(O){return ne.matcher.regexIndex===0?(ve+=O[0],1):(V=!0,0)}function Me(O){const P=O[0],Y=O.rule,fe=new Yg(Y),Ie=[Y.__beforeBegin,Y["on:begin"]];for(const Pt of Ie)if(Pt&&(Pt(O,fe),fe.isMatchIgnored))return Ne(P);return Y.skip?ve+=P:(Y.excludeBegin&&(ve+=P),X(),!Y.returnBegin&&!Y.excludeBegin&&(ve=P)),Se(Y,O),Y.returnBegin?0:P.length}function Te(O){const P=O[0],Y=_.substring(O.index),fe=Ee(ne,O,Y);if(!fe)return ty;const Ie=ne;ne.endScope&&ne.endScope._wrap?(X(),me(P,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(X(),he(ne.endScope,O)):Ie.skip?ve+=P:(Ie.returnEnd||Ie.excludeEnd||(ve+=P),X(),Ie.excludeEnd&&(ve=P));do ne.scope&&H.closeNode(),!ne.skip&&!ne.subLanguage&&(Ge+=ne.relevance),ne=ne.parent;while(ne!==fe.parent);return fe.starts&&Se(fe.starts,O),Ie.returnEnd?0:P.length}function ke(){const O=[];for(let P=ne;P!==de;P=P.parent)P.scope&&O.unshift(P.scope);O.forEach(P=>H.openNode(P))}let je={};function Oe(O,P){const Y=P&&P[0];if(ve+=O,Y==null)return X(),0;if(je.type==="begin"&&P.type==="end"&&je.index===P.index&&Y===""){if(ve+=_.slice(P.index,P.index+1),!i){const fe=new Error(`0 width match regex (${N})`);throw fe.languageName=N,fe.badRule=je.rule,fe}return 1}if(je=P,P.type==="begin")return Me(P);if(P.type==="illegal"&&!I){const fe=new Error('Illegal lexeme "'+Y+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw fe.mode=ne,fe}else if(P.type==="end"){const fe=Te(P);if(fe!==ty)return fe}if(P.type==="illegal"&&Y==="")return 1;if(Wt>1e5&&Wt>P.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ve+=Y,Y.length}const de=M(N);if(!de)throw ii(s.replace("{}",N)),new Error('Unknown language: "'+N+'"');const Ke=g3(de);let Z="",ne=$||Ke;const Ce={},H=new a.__emitter(a);ke();let ve="",Ge=0,lt=0,Wt=0,V=!1;try{if(de.__emitTokens)de.__emitTokens(_,H);else{for(ne.matcher.considerAll();;){Wt++,V?V=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=lt;const O=ne.matcher.exec(_);if(!O)break;const P=_.substring(lt,O.index),Y=Oe(P,O);lt=O.index+Y}Oe(_.substring(lt))}return H.finalize(),Z=H.toHTML(),{language:N,value:Z,relevance:Ge,illegal:!1,_emitter:H,_top:ne}}catch(O){if(O.message&&O.message.includes("Illegal"))return{language:N,value:su(_),illegal:!0,relevance:0,_illegalBy:{message:O.message,index:lt,context:_.slice(lt-100,lt+100),mode:O.mode,resultSoFar:Z},_emitter:H};if(i)return{language:N,value:su(_),illegal:!1,relevance:0,errorRaised:O,_emitter:H,_top:ne};throw O}}function f(N){const _={value:su(N),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return _._emitter.addText(N),_}function h(N,_){_=_||a.languages||Object.keys(e);const I=f(N),$=_.filter(M).filter(F).map(X=>u(X,N,!1));$.unshift(I);const q=$.sort((X,me)=>{if(X.relevance!==me.relevance)return me.relevance-X.relevance;if(X.language&&me.language){if(M(X.language).supersetOf===me.language)return 1;if(M(me.language).supersetOf===X.language)return-1}return 0}),[se,ae]=q,K=se;return K.secondBest=ae,K}function m(N,_,I){const $=_&&n[_]||I;N.classList.add("hljs"),N.classList.add(`language-${$}`)}function g(N){let _=null;const I=c(N);if(l(I))return;if(G("before:highlightElement",{el:N,language:I}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new v3("One of your code blocks includes unescaped HTML.",N.innerHTML);_=N;const $=_.textContent,q=I?d($,{language:I,ignoreIllegals:!0}):h($);N.innerHTML=q.value,N.dataset.highlighted="yes",m(N,I,q.language),N.result={language:q.language,re:q.relevance,relevance:q.relevance},q.secondBest&&(N.secondBest={language:q.secondBest.language,relevance:q.secondBest.relevance}),G("after:highlightElement",{el:N,result:q,text:$})}function y(N){a=ey(a,N)}const b=()=>{v(),Mi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){v(),Mi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function v(){if(document.readyState==="loading"){E=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function S(){E&&v()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",S,!1);function k(N,_){let I=null;try{I=_(t)}catch($){if(ii("Language definition for '{}' could not be registered.".replace("{}",N)),i)ii($);else throw $;I=o}I.name||(I.name=N),e[N]=I,I.rawDefinition=_.bind(null,t),I.aliases&&D(I.aliases,{languageName:N})}function C(N){delete e[N];for(const _ of Object.keys(n))n[_]===N&&delete n[_]}function T(){return Object.keys(e)}function M(N){return N=(N||"").toLowerCase(),e[N]||e[n[N]]}function D(N,{languageName:_}){typeof N=="string"&&(N=[N]),N.forEach(I=>{n[I.toLowerCase()]=_})}function F(N){const _=M(N);return _&&!_.disableAutodetect}function B(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=_=>{N["before:highlightBlock"](Object.assign({block:_.el},_))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=_=>{N["after:highlightBlock"](Object.assign({block:_.el},_))})}function z(N){B(N),r.push(N)}function W(N){const _=r.indexOf(N);_!==-1&&r.splice(_,1)}function G(N,_){const I=N;r.forEach(function($){$[I]&&$[I](_)})}function A(N){return Mi("10.7.0","highlightBlock will be removed entirely in v12.0"),Mi("10.7.0","Please use highlightElement now."),g(N)}Object.assign(t,{highlight:d,highlightAuto:h,highlightAll:v,highlightElement:g,highlightBlock:A,configure:y,initHighlighting:b,initHighlightingOnLoad:w,registerLanguage:k,unregisterLanguage:C,listLanguages:T,getLanguage:M,registerAliases:D,autoDetection:F,inherit:ey,addPlugin:z,removePlugin:W}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=b3,t.regex={concat:bi,lookahead:l1,either:qh,optional:DB,anyNumberOfTimes:IB};for(const N in Na)typeof Na[N]=="object"&&s1(Na[N]);return Object.assign(t,Na),t},gs=y1({});gs.newInstance=()=>y1({});var w3=gs;gs.HighlightJS=gs;gs.default=gs;var E3=NB(w3);function b1(t,e=[]){return t.map(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?b1(n.children,r):{text:n.value,classes:r}}).flat()}function ny(t){return t.value||t.children||[]}function k3(t){return!!E3.getLanguage(t)}function ry({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return es(t,s=>s.type.name===e).forEach(s=>{var o;let a=s.pos+1;const l=s.node.attrs.language||r,c=n.listLanguages(),d=l&&(c.includes(l)||k3(l)||!((o=n.registered)===null||o===void 0)&&o.call(n,l))?ny(n.highlight(l,s.node.textContent)):ny(n.highlightAuto(s.node.textContent));b1(d).forEach(u=>{const f=a+u.text.length;if(u.classes.length){const h=pt.inline(a,f,{class:u.classes.join(" ")});i.push(h)}a=f})}),ze.create(t,i)}function S3(t){return typeof t=="function"}function C3({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>S3(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new $e({key:new Be("lowlight"),state:{init:(i,{doc:s})=>ry({doc:s,name:t,lowlight:e,defaultLanguage:n}),apply:(i,s,o,a)=>{const l=o.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,d=es(o.doc,f=>f.type.name===t),u=es(a.doc,f=>f.type.name===t);return i.docChanged&&([l,c].includes(t)||u.length!==d.length||i.steps.some(f=>f.from!==void 0&&f.to!==void 0&&d.some(h=>h.pos>=f.from&&h.pos+h.node.nodeSize<=f.to)))?ry({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):s.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}const _3=i1.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],C3({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});function v1(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(s,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,l,a]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function N3(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},h=e.optional(i)+t.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},k=[S,u,a,n,t.C_BLOCK_COMMENT_MODE,d,c],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:k.concat([{begin:/\(/,end:/\)/,keywords:v,contains:k.concat(["self"]),relevance:0}]),relevance:0},T={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(C,T,S,k,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:v,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function T3(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=N3(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function A3(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(a);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},d={match:/\\'/},u={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],b={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],E=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],v=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:y,built_in:[...w,...E,"set","shopt",...v,...S]},contains:[h,t.SHEBANG(),m,u,s,o,b,a,l,c,d,n]}}function M3(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},h=e.optional(i)+t.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},b=[u,a,n,t.C_BLOCK_COMMENT_MODE,d,c],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:b.concat([{begin:/\(/,end:/\)/,keywords:y,contains:b.concat(["self"]),relevance:0}]),relevance:0},E={begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:h,returnBegin:!0,contains:[t.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,u]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"</",contains:[].concat(w,E,b,[u,{begin:t.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:u,strings:c,keywords:y}}}function O3(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},h=e.optional(i)+t.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},k=[S,u,a,n,t.C_BLOCK_COMMENT_MODE,d,c],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:k.concat([{begin:/\(/,end:/\)/,keywords:v,contains:k.concat(["self"]),relevance:0}]),relevance:0},T={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(C,T,S,k,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:v,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function R3(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(s),built_in:e,literal:r},a=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=t.inherit(d,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:o},h=t.inherit(f,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,h]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},y=t.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});f.contains=[g,m,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],h.contains=[y,m,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const b={variants:[c,g,m,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},E=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",v={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},b,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,w,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,w,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[b,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},v]}}const I3=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),D3=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],L3=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],P3=[...D3,...L3],B3=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),$3=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),j3=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),F3=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function H3(t){const e=t.regex,n=I3(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+$3.join("|")+")"},{begin:":(:)?("+j3.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+F3.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:B3.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+P3.join("|")+")\\b"}]}}function z3(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function U3(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function V3(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function K3(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,s,i,o,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,d=/'[^']*'/,u=e.either(l,c,d),f=e.concat(u,"(\\s*\\.\\s*",u,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[r,a,s,i,o,n]}}]}}var Bi="[0-9](_*[0-9])*",Ta=`\\.(${Bi})`,Aa="[0-9a-fA-F](_*[0-9a-fA-F])*",iy={className:"number",variants:[{begin:`(\\b(${Bi})((${Ta})|\\.)?|(${Ta}))[eE][+-]?(${Bi})[fFdD]?\\b`},{begin:`\\b(${Bi})((${Ta})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ta})[fFdD]?\\b`},{begin:`\\b(${Bi})[fFdD]\\b`},{begin:`\\b0[xX]((${Aa})\\.?|(${Aa})?\\.(${Aa}))[pP][+-]?(${Bi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Aa})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function x1(t,e,n){return n===-1?"":t.replace(e,r=>x1(t,e,n-1))}function W3(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+x1("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,iy,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},iy,c]}}const sy="[A-Za-z$_][0-9A-Za-z$_]*",G3=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],q3=["true","false","null","undefined","NaN","Infinity"],w1=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],E1=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],k1=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Y3=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],J3=[].concat(k1,w1,E1);function X3(t){const e=t.regex,n=(_,{after:I})=>{const $="</"+_[0].slice(1);return _.input.indexOf($,I)!==-1},r=sy,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(_,I)=>{const $=_[0].length+_.index,q=_.input[$];if(q==="<"||q===","){I.ignoreMatch();return}q===">"&&(n(_,{after:$})||I.ignoreMatch());let se;const ae=_.input.substring($);if(se=ae.match(/^\s*=/)){I.ignoreMatch();return}if((se=ae.match(/^\s+extends\s+/))&&se.index===0){I.ignoreMatch();return}}},a={$pattern:sy,keyword:G3,literal:q3,built_in:J3,"variable.language":Y3},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},w={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},E=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,m,g,y,{match:/\$\d+/},u];f.contains=E.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(E)});const v=[].concat(w,f.contains),S=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(v)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S},C={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...w1,...E1]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(_){return e.concat("(?!",_.join("|"),")")}const z={match:e.concat(/\b/,B([...k1,"super","import"].map(_=>`${_}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},W={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,m,g,y,w,{match:/\$\d+/},u,T,{scope:"attr",match:r+e.lookahead(":"),relevance:0},N,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},W,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},z,F,C,G,{match:/\$[(.]/}]}}function Z3(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var $i="[0-9](_*[0-9])*",Ma=`\\.(${$i})`,Oa="[0-9a-fA-F](_*[0-9a-fA-F])*",Q3={className:"number",variants:[{begin:`(\\b(${$i})((${Ma})|\\.)?|(${Ma}))[eE][+-]?(${$i})[fFdD]?\\b`},{begin:`\\b(${$i})((${Ma})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ma})[fFdD]?\\b`},{begin:`\\b(${$i})[fFdD]\\b`},{begin:`\\b0[xX]((${Oa})\\.?|(${Oa})?\\.(${Oa}))[pP][+-]?(${$i})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Oa})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function e4(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(o,{className:"string"}),"self"]}]},c=Q3,d=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=u;return f.variants[1].contains=[u],u.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,d,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,t.C_LINE_COMMENT_MODE,d],relevance:0},t.C_LINE_COMMENT_MODE,d,a,l,o,t.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
484
|
+
`},c]}}const t4=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),n4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],i4=[...n4,...r4],s4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),S1=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),C1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),o4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),a4=S1.concat(C1).sort().reverse();function l4(t){const e=t4(t),n=a4,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],a=[],l=function(E){return{className:"string",begin:"~?"+E+".*?"+E}},c=function(E,v,S){return{className:E,begin:v,relevance:S}},d={$pattern:/[a-z-]+/,keyword:r,attribute:s4.join(" ")},u={begin:"\\(",end:"\\)",contains:a,keywords:d,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,u,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const f=a.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},m={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+o4.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:a,relevance:0}},y={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,h,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+i4.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+S1.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+C1.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},w={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[b]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,y,w,m,b,h,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function c4(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function d4(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,s,o]}}function u4(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=t.inherit(c,{contains:[]}),f=t.inherit(d,{contains:[]});c.contains.push(f),d.contains.push(u);let h=[n,l];return[c,d,u,f].forEach(b=>{b.contains=b.contains.concat(h)}),h=h.concat(c,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,s,c,d,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},i,r,l,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function f4(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function h4(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[t.BACKSLASH_ESCAPE,s,l],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(g,y,b="\\1")=>{const w=b==="\\1"?b:e.concat(b,y);return e.concat(e.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,b,r)},h=(g,y,b)=>e.concat(e.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,b,r),m=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...u,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...u,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=m,o.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function p4(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=e.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(W,G)=>{G.data._beginMatch=W[1]||W[2]},"on:end":(W,G)=>{G.data._beginMatch!==W[1]&&G.ignoreMatch()}},f=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
|
|
485
|
+
]`,m={scope:"string",variants:[d,c,u,f]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:b,literal:(W=>{const G=[];return W.forEach(A=>{G.push(A),A.toLowerCase()===A?G.push(A.toUpperCase()):G.push(A.toLowerCase())}),G})(y),built_in:w},S=W=>W.map(G=>G.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",S(w).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},C=e.concat(r,"\\b(?!\\()"),T={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},M={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[M,o,T,t.C_BLOCK_COMMENT_MODE,m,g,k]},F={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",S(b).join("\\b|"),"|",S(w).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push(F);const B=[M,T,t.C_BLOCK_COMMENT_MODE,m,g,k],z={begin:e.concat(/#\[\s*\\?/,e.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:v,contains:[z,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},o,F,T,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},k,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",z,o,T,t.C_BLOCK_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},m,g]}}function m4(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function g4(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function y4(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},d={begin:/\{\{/,relevance:0},u={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,d,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",h=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${f})[jJ](?=${m})`}]},y={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,u,t.HASH_COMMENT_MODE]}]};return c.contains=[u,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},u,y,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,b,u]}]}}function b4(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function v4(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function x4(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u={className:"string",contains:[t.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,d]})]}]},f="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},k=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);d.contains=k,g.contains=k;const D=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:k}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(D).concat(c).concat(k)}}function w4(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:d,keyword:a,literal:l,built_in:c},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:d}},{className:"punctuation",begin:"->"},s]}}const E4=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),k4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],S4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],C4=[...k4,...S4],_4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),N4=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),T4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),A4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function M4(t){const e=E4(t),n=T4,r=N4,i="@[a-z-]+",s="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+C4.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+A4.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:_4.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function O4(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function R4(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],u=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=d,m=[...c,...l].filter(S=>!d.includes(S)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:e.concat(/\b/,e.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function w(S){return e.concat(/\b/,e.either(...S.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const E={scope:"keyword",match:w(f),relevance:0};function v(S,{exceptions:k,when:C}={}){const T=C;return k=k||[],S.map(M=>M.match(/\|\d+$/)||k.includes(M)?M:T(M)?`${M}|0`:M)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:v(m,{when:S=>S.length<3}),literal:s,type:a,built_in:u},contains:[{scope:"type",match:w(o)},E,b,g,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,y]}}function _1(t){return t?typeof t=="string"?t:t.source:null}function Ls(t){return De("(?=",t,")")}function De(...t){return t.map(n=>_1(n)).join("")}function I4(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function St(...t){return"("+(I4(t).capture?"":"?:")+t.map(r=>_1(r)).join("|")+")"}const Xh=t=>De(/\b/,t,/\w$/.test(t)?/\b/:/\B/),D4=["Protocol","Type"].map(Xh),oy=["init","self"].map(Xh),L4=["Any","Self"],ou=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],ay=["false","nil","true"],P4=["assignment","associativity","higherThan","left","lowerThan","none","right"],B4=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ly=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],N1=St(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),T1=St(N1,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),au=De(N1,T1,"*"),A1=St(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),$l=St(A1,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),gn=De(A1,$l,"*"),Ra=De(/[A-Z]/,$l,"*"),$4=["attached","autoclosure",De(/convention\(/,St("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",De(/objc\(/,gn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],j4=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function F4(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,St(...D4,...oy)],className:{2:"keyword"}},s={match:De(/\./,St(...ou)),relevance:0},o=ou.filter(de=>typeof de=="string").concat(["_|0"]),a=ou.filter(de=>typeof de!="string").concat(L4).map(Xh),l={variants:[{className:"keyword",match:St(...a,...oy)}]},c={$pattern:St(/\b\w+/,/#\w+/),keyword:o.concat(B4),literal:ay},d=[i,s,l],u={match:De(/\./,St(...ly)),relevance:0},f={className:"built_in",match:De(/\b/,St(...ly),/(?=\()/)},h=[u,f],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:au},{match:`\\.(\\.|${T1})+`}]},y=[m,g],b="([0-9]_*)+",w="([0-9a-fA-F]_*)+",E={className:"number",relevance:0,variants:[{match:`\\b(${b})(\\.(${b}))?([eE][+-]?(${b}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${b}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},v=(de="")=>({className:"subst",variants:[{match:De(/\\/,de,/[0\\tnr"']/)},{match:De(/\\/,de,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(de="")=>({className:"subst",match:De(/\\/,de,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(de="")=>({className:"subst",label:"interpol",begin:De(/\\/,de,/\(/),end:/\)/}),C=(de="")=>({begin:De(de,/"""/),end:De(/"""/,de),contains:[v(de),S(de),k(de)]}),T=(de="")=>({begin:De(de,/"/),end:De(/"/,de),contains:[v(de),k(de)]}),M={className:"string",variants:[C(),C("#"),C("##"),C("###"),T(),T("#"),T("##"),T("###")]},D=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],F={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:D},B=de=>{const Ke=De(de,/\//),Z=De(/\//,de);return{begin:Ke,end:Z,contains:[...D,{scope:"comment",begin:`#(?!.*${Z})`,end:/$/}]}},z={scope:"regexp",variants:[B("###"),B("##"),B("#"),F]},W={match:De(/`/,gn,/`/)},G={className:"variable",match:/\$\d+/},A={className:"variable",match:`\\$${$l}+`},N=[W,G,A],_={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:j4,contains:[...y,E,M]}]}},I={scope:"keyword",match:De(/@/,St(...$4),Ls(St(/\(/,/\s+/)))},$={scope:"meta",match:De(/@/,gn)},q=[_,I,$],se={match:Ls(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:De(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,$l,"+")},{className:"type",match:Ra,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:De(/\s+&\s+/,Ls(Ra)),relevance:0}]},ae={begin:/</,end:/>/,keywords:c,contains:[...r,...d,...q,m,se]};se.contains.push(ae);const K={match:De(gn,/\s*:/),keywords:"_|0",relevance:0},X={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",K,...r,z,...d,...h,...y,E,M,...N,...q,se]},me={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,se]},he={begin:St(Ls(De(gn,/\s*:/)),Ls(De(gn,/\s+/,gn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:gn}]},Se={begin:/\(/,end:/\)/,keywords:c,contains:[he,...r,...d,...y,E,M,...q,se,X],endsParent:!0,illegal:/["']/},Ee={match:[/(func|macro)/,/\s+/,St(W.match,gn,au)],className:{1:"keyword",3:"title.function"},contains:[me,Se,e],illegal:[/\[/,/%/]},Ne={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[me,Se,e],illegal:/\[|%/},Me={match:[/operator/,/\s+/,au],className:{1:"keyword",3:"title"}},Te={begin:[/precedencegroup/,/\s+/,Ra],className:{1:"keyword",3:"title"},contains:[se],keywords:[...P4,...ay],end:/}/},ke={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},je={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Oe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,gn,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[me,...d,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Ra},...d],relevance:0}]};for(const de of M.variants){const Ke=de.contains.find(ne=>ne.label==="interpol");Ke.keywords=c;const Z=[...d,...h,...y,E,M,...N];Ke.contains=[...Z,{begin:/\(/,end:/\)/,contains:["self",...Z]}]}return{name:"Swift",keywords:c,contains:[...r,Ee,Ne,ke,je,Oe,Me,Te,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},z,...d,...h,...y,E,M,...N,...q,se,X]}}const jl="[A-Za-z$_][0-9A-Za-z$_]*",M1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],O1=["true","false","null","undefined","NaN","Infinity"],R1=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],I1=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],D1=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],L1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],P1=[].concat(D1,R1,I1);function H4(t){const e=t.regex,n=(_,{after:I})=>{const $="</"+_[0].slice(1);return _.input.indexOf($,I)!==-1},r=jl,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(_,I)=>{const $=_[0].length+_.index,q=_.input[$];if(q==="<"||q===","){I.ignoreMatch();return}q===">"&&(n(_,{after:$})||I.ignoreMatch());let se;const ae=_.input.substring($);if(se=ae.match(/^\s*=/)){I.ignoreMatch();return}if((se=ae.match(/^\s+extends\s+/))&&se.index===0){I.ignoreMatch();return}}},a={$pattern:jl,keyword:M1,literal:O1,built_in:P1,"variable.language":L1},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},w={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},E=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,m,g,y,{match:/\$\d+/},u];f.contains=E.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(E)});const v=[].concat(w,f.contains),S=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(v)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S},C={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...R1,...I1]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(_){return e.concat("(?!",_.join("|"),")")}const z={match:e.concat(/\b/,B([...D1,"super","import"].map(_=>`${_}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},W={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,m,g,y,w,{match:/\$\d+/},u,T,{scope:"attr",match:r+e.lookahead(":"),relevance:0},N,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},W,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},z,F,C,G,{match:/\$[(.]/}]}}function z4(t){const e=t.regex,n=H4(t),r=jl,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:jl,keyword:M1.concat(l),literal:O1,built_in:P1.concat(i),"variable.language":L1},d={className:"meta",begin:"@"+r},u=(g,y,b)=>{const w=g.contains.findIndex(E=>E.label===y);if(w===-1)throw new Error("can not find mode to replace");g.contains.splice(w,1,b)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(d);const f=n.contains.find(g=>g.scope==="attr"),h=Object.assign({},f,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,f,h]),n.contains=n.contains.concat([d,s,o,h]),u(n,"shebang",t.SHEBANG()),u(n,"use_strict",a);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function U4(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,i),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,e.either(s,i),/ +/,e.either(o,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},u=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,d,u,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function V4(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,t.QUOTE_STRING_MODE,l,c,a]}}function K4(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},a=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},f,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},m,g,s,o],b=[...y];return b.pop(),b.push(a),h.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const W4={arduino:T3,bash:A3,c:M3,cpp:O3,csharp:R3,css:H3,diff:z3,go:U3,graphql:V3,ini:K3,java:W3,javascript:X3,json:Z3,kotlin:e4,less:l4,lua:c4,makefile:d4,markdown:u4,objectivec:f4,perl:h4,php:p4,"php-template":m4,plaintext:g4,python:y4,"python-repl":b4,r:v4,ruby:x4,rust:w4,scss:M4,shell:O4,sql:R4,swift:F4,typescript:z4,vbnet:U4,wasm:V4,xml:v1,yaml:K4};function B1(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&B1(n)}),t}class cy{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function $1(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Er(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const G4="</span>",dy=t=>!!t.scope,q4=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`};class Y4{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=$1(e)}openNode(e){if(!dy(e))return;const n=q4(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){dy(e)&&(this.buffer+=G4)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const uy=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class Zh{constructor(){this.rootNode=uy(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=uy({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{Zh._collapse(n)}))}}class J4 extends Zh{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Y4(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function $o(t){return t?typeof t=="string"?t:t.source:null}function j1(t){return vi("(?=",t,")")}function X4(t){return vi("(?:",t,")*")}function Z4(t){return vi("(?:",t,")?")}function vi(...t){return t.map(n=>$o(n)).join("")}function Q4(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Qh(...t){return"("+(Q4(t).capture?"":"?:")+t.map(r=>$o(r)).join("|")+")"}function F1(t){return new RegExp(t.toString()+"|").exec("").length-1}function e5(t,e){const n=t&&t.exec(e);return n&&n.index===0}const t5=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ep(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const i=n;let s=$o(r),o="";for(;s.length>0;){const a=t5.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(e)}const n5=/\b\B/,H1="[a-zA-Z]\\w*",tp="[a-zA-Z_]\\w*",z1="\\b\\d+(\\.\\d+)?",U1="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",V1="\\b(0b[01]+)",r5="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",i5=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=vi(e,/.*\b/,t.binary,/\b.*/)),Er({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},jo={begin:"\\\\[\\s\\S]",relevance:0},s5={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[jo]},o5={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[jo]},a5={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},id=function(t,e,n={}){const r=Er({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Qh("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:vi(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},l5=id("//","$"),c5=id("/\\*","\\*/"),d5=id("#","$"),u5={scope:"number",begin:z1,relevance:0},f5={scope:"number",begin:U1,relevance:0},h5={scope:"number",begin:V1,relevance:0},p5={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[jo,{begin:/\[/,end:/\]/,relevance:0,contains:[jo]}]},m5={scope:"title",begin:H1,relevance:0},g5={scope:"title",begin:tp,relevance:0},y5={begin:"\\.\\s*"+tp,relevance:0},b5=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})};var Ia=Object.freeze({__proto__:null,APOS_STRING_MODE:s5,BACKSLASH_ESCAPE:jo,BINARY_NUMBER_MODE:h5,BINARY_NUMBER_RE:V1,COMMENT:id,C_BLOCK_COMMENT_MODE:c5,C_LINE_COMMENT_MODE:l5,C_NUMBER_MODE:f5,C_NUMBER_RE:U1,END_SAME_AS_BEGIN:b5,HASH_COMMENT_MODE:d5,IDENT_RE:H1,MATCH_NOTHING_RE:n5,METHOD_GUARD:y5,NUMBER_MODE:u5,NUMBER_RE:z1,PHRASAL_WORDS_MODE:a5,QUOTE_STRING_MODE:o5,REGEXP_MODE:p5,RE_STARTERS_RE:r5,SHEBANG:i5,TITLE_MODE:m5,UNDERSCORE_IDENT_RE:tp,UNDERSCORE_TITLE_MODE:g5});function v5(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function x5(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function w5(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=v5,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function E5(t,e){Array.isArray(t.illegal)&&(t.illegal=Qh(...t.illegal))}function k5(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function S5(t,e){t.relevance===void 0&&(t.relevance=1)}const C5=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=vi(n.beforeMatch,j1(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},_5=["of","and","for","in","not","or","if","then","parent","list","value"],N5="keyword";function K1(t,e,n=N5){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,K1(t[s],e,s))}),r;function i(s,o){e&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){const l=a.split("|");r[l[0]]=[s,T5(l[0],l[1])]})}}function T5(t,e){return e?Number(e):A5(t)?0:1}function A5(t){return _5.includes(t.toLowerCase())}const fy={},si=t=>{console.error(t)},hy=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Oi=(t,e)=>{fy[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),fy[`${t}/${e}`]=!0)},Fl=new Error;function W1(t,e,{key:n}){let r=0;const i=t[n],s={},o={};for(let a=1;a<=e.length;a++)o[a+r]=i[a],s[a+r]=!0,r+=F1(e[a-1]);t[n]=o,t[n]._emit=s,t[n]._multi=!0}function M5(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw si("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fl;if(typeof t.beginScope!="object"||t.beginScope===null)throw si("beginScope must be object"),Fl;W1(t,t.begin,{key:"beginScope"}),t.begin=ep(t.begin,{joinWith:""})}}function O5(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw si("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fl;if(typeof t.endScope!="object"||t.endScope===null)throw si("endScope must be object"),Fl;W1(t,t.end,{key:"endScope"}),t.end=ep(t.end,{joinWith:""})}}function R5(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function I5(t){R5(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),M5(t),O5(t)}function D5(t){function e(o,a){return new RegExp($o(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=F1(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=e(ep(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const c=l.findIndex((u,f)=>f>0&&u!==void 0),d=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new n;return this.rules.slice(a).forEach(([c,d])=>l.addRule(c,d)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,c=d.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(o){const a=new r;return o.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function s(o,a){const l=o;if(o.isCompiled)return l;[x5,k5,I5,C5].forEach(d=>d(o,a)),t.compilerExtensions.forEach(d=>d(o,a)),o.__beforeBegin=null,[w5,E5,S5].forEach(d=>d(o,a)),o.isCompiled=!0;let c=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),c=o.keywords.$pattern,delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=K1(o.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=$o(l.end)||"",o.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return L5(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,l)}),o.starts&&s(o.starts,a),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Er(t.classNameAliases||{}),s(t)}function G1(t){return t?t.endsWithParent||G1(t.starts):!1}function L5(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Er(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:G1(t)?Er(t,{starts:t.starts?Er(t.starts):null}):Object.isFrozen(t)?Er(t):t}var P5="11.11.1";class B5 extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const lu=$1,py=Er,my=Symbol("nomatch"),$5=7,q1=function(t){const e=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:J4};function l(A){return a.noHighlightRe.test(A)}function c(A){let N=A.className+" ";N+=A.parentNode?A.parentNode.className:"";const _=a.languageDetectRe.exec(N);if(_){const I=T(_[1]);return I||(hy(s.replace("{}",_[1])),hy("Falling back to no-highlight mode for this block.",A)),I?_[1]:"no-highlight"}return N.split(/\s+/).find(I=>l(I)||T(I))}function d(A,N,_){let I="",$="";typeof N=="object"?(I=A,_=N.ignoreIllegals,$=N.language):(Oi("10.7.0","highlight(lang, code, ...args) has been deprecated."),Oi("10.7.0",`Please use highlight(code, options) instead.
|
|
486
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),$=A,I=N),_===void 0&&(_=!0);const q={code:I,language:$};W("before:highlight",q);const se=q.result?q.result:u(q.language,q.code,_);return se.code=q.code,W("after:highlight",se),se}function u(A,N,_,I){const $=Object.create(null);function q(V,O){return V.keywords[O]}function se(){if(!Z.keywords){Ce.addText(H);return}let V=0;Z.keywordPatternRe.lastIndex=0;let O=Z.keywordPatternRe.exec(H),P="";for(;O;){P+=H.substring(V,O.index);const Y=Oe.case_insensitive?O[0].toLowerCase():O[0],fe=q(Z,Y);if(fe){const[Ie,Pt]=fe;if(Ce.addText(P),P="",$[Y]=($[Y]||0)+1,$[Y]<=$5&&(ve+=Pt),Ie.startsWith("_"))P+=O[0];else{const Rs=Oe.classNameAliases[Ie]||Ie;X(O[0],Rs)}}else P+=O[0];V=Z.keywordPatternRe.lastIndex,O=Z.keywordPatternRe.exec(H)}P+=H.substring(V),Ce.addText(P)}function ae(){if(H==="")return;let V=null;if(typeof Z.subLanguage=="string"){if(!e[Z.subLanguage]){Ce.addText(H);return}V=u(Z.subLanguage,H,!0,ne[Z.subLanguage]),ne[Z.subLanguage]=V._top}else V=h(H,Z.subLanguage.length?Z.subLanguage:null);Z.relevance>0&&(ve+=V.relevance),Ce.__addSublanguage(V._emitter,V.language)}function K(){Z.subLanguage!=null?ae():se(),H=""}function X(V,O){V!==""&&(Ce.startScope(O),Ce.addText(V),Ce.endScope())}function me(V,O){let P=1;const Y=O.length-1;for(;P<=Y;){if(!V._emit[P]){P++;continue}const fe=Oe.classNameAliases[V[P]]||V[P],Ie=O[P];fe?X(Ie,fe):(H=Ie,se(),H=""),P++}}function he(V,O){return V.scope&&typeof V.scope=="string"&&Ce.openNode(Oe.classNameAliases[V.scope]||V.scope),V.beginScope&&(V.beginScope._wrap?(X(H,Oe.classNameAliases[V.beginScope._wrap]||V.beginScope._wrap),H=""):V.beginScope._multi&&(me(V.beginScope,O),H="")),Z=Object.create(V,{parent:{value:Z}}),Z}function Se(V,O,P){let Y=e5(V.endRe,P);if(Y){if(V["on:end"]){const fe=new cy(V);V["on:end"](O,fe),fe.isMatchIgnored&&(Y=!1)}if(Y){for(;V.endsParent&&V.parent;)V=V.parent;return V}}if(V.endsWithParent)return Se(V.parent,O,P)}function Ee(V){return Z.matcher.regexIndex===0?(H+=V[0],1):(Wt=!0,0)}function Ne(V){const O=V[0],P=V.rule,Y=new cy(P),fe=[P.__beforeBegin,P["on:begin"]];for(const Ie of fe)if(Ie&&(Ie(V,Y),Y.isMatchIgnored))return Ee(O);return P.skip?H+=O:(P.excludeBegin&&(H+=O),K(),!P.returnBegin&&!P.excludeBegin&&(H=O)),he(P,V),P.returnBegin?0:O.length}function Me(V){const O=V[0],P=N.substring(V.index),Y=Se(Z,V,P);if(!Y)return my;const fe=Z;Z.endScope&&Z.endScope._wrap?(K(),X(O,Z.endScope._wrap)):Z.endScope&&Z.endScope._multi?(K(),me(Z.endScope,V)):fe.skip?H+=O:(fe.returnEnd||fe.excludeEnd||(H+=O),K(),fe.excludeEnd&&(H=O));do Z.scope&&Ce.closeNode(),!Z.skip&&!Z.subLanguage&&(ve+=Z.relevance),Z=Z.parent;while(Z!==Y.parent);return Y.starts&&he(Y.starts,V),fe.returnEnd?0:O.length}function Te(){const V=[];for(let O=Z;O!==Oe;O=O.parent)O.scope&&V.unshift(O.scope);V.forEach(O=>Ce.openNode(O))}let ke={};function je(V,O){const P=O&&O[0];if(H+=V,P==null)return K(),0;if(ke.type==="begin"&&O.type==="end"&&ke.index===O.index&&P===""){if(H+=N.slice(O.index,O.index+1),!i){const Y=new Error(`0 width match regex (${A})`);throw Y.languageName=A,Y.badRule=ke.rule,Y}return 1}if(ke=O,O.type==="begin")return Ne(O);if(O.type==="illegal"&&!_){const Y=new Error('Illegal lexeme "'+P+'" for mode "'+(Z.scope||"<unnamed>")+'"');throw Y.mode=Z,Y}else if(O.type==="end"){const Y=Me(O);if(Y!==my)return Y}if(O.type==="illegal"&&P==="")return H+=`
|
|
487
|
+
`,1;if(lt>1e5&<>O.index*3)throw new Error("potential infinite loop, way more iterations than matches");return H+=P,P.length}const Oe=T(A);if(!Oe)throw si(s.replace("{}",A)),new Error('Unknown language: "'+A+'"');const de=D5(Oe);let Ke="",Z=I||de;const ne={},Ce=new a.__emitter(a);Te();let H="",ve=0,Ge=0,lt=0,Wt=!1;try{if(Oe.__emitTokens)Oe.__emitTokens(N,Ce);else{for(Z.matcher.considerAll();;){lt++,Wt?Wt=!1:Z.matcher.considerAll(),Z.matcher.lastIndex=Ge;const V=Z.matcher.exec(N);if(!V)break;const O=N.substring(Ge,V.index),P=je(O,V);Ge=V.index+P}je(N.substring(Ge))}return Ce.finalize(),Ke=Ce.toHTML(),{language:A,value:Ke,relevance:ve,illegal:!1,_emitter:Ce,_top:Z}}catch(V){if(V.message&&V.message.includes("Illegal"))return{language:A,value:lu(N),illegal:!0,relevance:0,_illegalBy:{message:V.message,index:Ge,context:N.slice(Ge-100,Ge+100),mode:V.mode,resultSoFar:Ke},_emitter:Ce};if(i)return{language:A,value:lu(N),illegal:!1,relevance:0,errorRaised:V,_emitter:Ce,_top:Z};throw V}}function f(A){const N={value:lu(A),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return N._emitter.addText(A),N}function h(A,N){N=N||a.languages||Object.keys(e);const _=f(A),I=N.filter(T).filter(D).map(K=>u(K,A,!1));I.unshift(_);const $=I.sort((K,X)=>{if(K.relevance!==X.relevance)return X.relevance-K.relevance;if(K.language&&X.language){if(T(K.language).supersetOf===X.language)return 1;if(T(X.language).supersetOf===K.language)return-1}return 0}),[q,se]=$,ae=q;return ae.secondBest=se,ae}function m(A,N,_){const I=N&&n[N]||_;A.classList.add("hljs"),A.classList.add(`language-${I}`)}function g(A){let N=null;const _=c(A);if(l(_))return;if(W("before:highlightElement",{el:A,language:_}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),a.throwUnescapedHTML))throw new B5("One of your code blocks includes unescaped HTML.",A.innerHTML);N=A;const I=N.textContent,$=_?d(I,{language:_,ignoreIllegals:!0}):h(I);A.innerHTML=$.value,A.dataset.highlighted="yes",m(A,_,$.language),A.result={language:$.language,re:$.relevance,relevance:$.relevance},$.secondBest&&(A.secondBest={language:$.secondBest.language,relevance:$.secondBest.relevance}),W("after:highlightElement",{el:A,result:$,text:I})}function y(A){a=py(a,A)}const b=()=>{v(),Oi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){v(),Oi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function v(){function A(){v()}if(document.readyState==="loading"){E||window.addEventListener("DOMContentLoaded",A,!1),E=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function S(A,N){let _=null;try{_=N(t)}catch(I){if(si("Language definition for '{}' could not be registered.".replace("{}",A)),i)si(I);else throw I;_=o}_.name||(_.name=A),e[A]=_,_.rawDefinition=N.bind(null,t),_.aliases&&M(_.aliases,{languageName:A})}function k(A){delete e[A];for(const N of Object.keys(n))n[N]===A&&delete n[N]}function C(){return Object.keys(e)}function T(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function M(A,{languageName:N}){typeof A=="string"&&(A=[A]),A.forEach(_=>{n[_.toLowerCase()]=N})}function D(A){const N=T(A);return N&&!N.disableAutodetect}function F(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=N=>{A["before:highlightBlock"](Object.assign({block:N.el},N))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=N=>{A["after:highlightBlock"](Object.assign({block:N.el},N))})}function B(A){F(A),r.push(A)}function z(A){const N=r.indexOf(A);N!==-1&&r.splice(N,1)}function W(A,N){const _=A;r.forEach(function(I){I[_]&&I[_](N)})}function G(A){return Oi("10.7.0","highlightBlock will be removed entirely in v12.0"),Oi("10.7.0","Please use highlightElement now."),g(A)}Object.assign(t,{highlight:d,highlightAuto:h,highlightAll:v,highlightElement:g,highlightBlock:G,configure:y,initHighlighting:b,initHighlightingOnLoad:w,registerLanguage:S,unregisterLanguage:k,listLanguages:C,getLanguage:T,registerAliases:M,autoDetection:D,inherit:py,addPlugin:B,removePlugin:z}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=P5,t.regex={concat:vi,lookahead:j1,either:Qh,optional:Z4,anyNumberOfTimes:X4};for(const A in Ia)typeof Ia[A]=="object"&&B1(Ia[A]);return Object.assign(t,Ia),t},ys=q1({});ys.newInstance=()=>q1({});var j5=ys;ys.HighlightJS=ys;ys.default=ys;const F5=nb(j5),gy={},H5="hljs-";function z5(t){const e=F5.newInstance();return t&&s(t),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:a};function n(l,c,d){const u=d||gy,f=typeof u.prefix=="string"?u.prefix:H5;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:U5,classPrefix:f});const h=e.highlight(c,{ignoreIllegals:!0,language:l});if(h.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:h.errorRaised});const m=h._emitter.root,g=m.data;return g.language=h.language,g.relevance=h.relevance,m}function r(l,c){const u=(c||gy).subset||i();let f=-1,h=0,m;for(;++f<u.length;){const g=u[f];if(!e.getLanguage(g))continue;const y=n(g,l,c);y.data&&y.data.relevance!==void 0&&y.data.relevance>h&&(h=y.data.relevance,m=y)}return m||{type:"root",children:[],data:{language:void 0,relevance:h}}}function i(){return e.listLanguages()}function s(l,c){if(typeof l=="string")e.registerLanguage(l,c);else{let d;for(d in l)Object.hasOwn(l,d)&&e.registerLanguage(d,l[d])}}function o(l,c){if(typeof l=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let d;for(d in l)if(Object.hasOwn(l,d)){const u=l[d];e.registerAliases(typeof u=="string"?u:[...u],{languageName:d})}}}function a(l){return!!e.getLanguage(l)}}class U5{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(o,a){return a?o+"_".repeat(a):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const V5=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const s=n.getAttribute("style"),o=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${o};${s}`)})},yy=un.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&V5(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),K5=We.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),W5=/^\s*>\s$/,G5=Je.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[bo({find:W5,type:this.type})]}}),q5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Y5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,J5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,X5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Z5=un.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ts({find:q5,type:this.type}),ts({find:J5,type:this.type})]},addPasteRules(){return[ui({find:Y5,type:this.type}),ui({find:X5,type:this.type})]}}),Q5="listItem",by="textStyle",vy=/^\s*([-+*])\s$/,e$=Je.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Q5,this.editor.getAttributes(by)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=bo({find:vy,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=bo({find:vy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(by),editor:this.editor})),[t]}}),t$=/(^|[^`])`([^`]+)`(?!`)/,n$=/(^|[^`])`([^`]+)`(?!`)/g,r$=un.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ts({find:t$,type:this.type})]},addPasteRules(){return[ui({find:n$,type:this.type})]}}),Y1=Je.create({name:"doc",topNode:!0,content:"block+"});function i$(t={}){return new $e({view(e){return new s$(e,t)}})}class s${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 s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}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,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(n){let u=e.nodeBefore,f=e.nodeAfter;if(u||f){let h=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(h){let m=h.getBoundingClientRect(),g=u?m.bottom:m.top;u&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:m.left,right:m.right,top:g-y,bottom:g+y}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:u.left-f,right:u.left+f,top:u.top,bottom:u.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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 c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let u=l.getBoundingClientRect(),f=u.width/l.offsetWidth,h=u.height/l.offsetHeight;c=u.left-l.scrollLeft*f,d=u.top-l.scrollTop*h}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"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,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Mb(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const J1=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[i$(this.options)]}});class Ye extends ge{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ye.valid(r)?new Ye(r):ge.near(r)}content(){return J.empty}eq(e){return e instanceof Ye&&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 Ye(e.resolve(n.pos))}getBookmark(){return new np(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!o$(e)||!a$(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&&Ye.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(Ye.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ce.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(Ye.valid(a))return a}return null}}}Ye.prototype.visible=!1;Ye.findFrom=Ye.findGapCursorFrom;ge.jsonID("gapcursor",Ye);class np{constructor(e){this.pos=e}map(e){return new np(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ye.valid(n)?new Ye(n):ge.near(n)}}function X1(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function o$(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||X1(i.type))return!0;if(i.inlineContent)return!1}}return!0}function a$(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||X1(i.type))return!0;if(i.inlineContent)return!1}}return!0}function l$(){return new $e({props:{decorations:f$,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ye.valid(n)?new Ye(n):null},handleClick:d$,handleKeyDown:c$,handleDOMEvents:{beforeinput:u$}}})}const c$=x0({ArrowLeft:Da("horiz",-1),ArrowRight:Da("horiz",1),ArrowUp:Da("vert",-1),ArrowDown:Da("vert",1)});function Da(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof ue){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Ye.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new Ye(c))),!0):!1}}function d$(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ye.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ce.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ye(r))),!0)}function u$(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ye))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=L.empty;for(let o=r.length-1;o>=0;o--)i=L.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new J(i,0,0));return s.setSelection(ue.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function f$(t){if(!(t.selection instanceof Ye))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ze.create(t.doc,[pt.widget(t.selection.head,e,{key:"gapcursor"})])}const h$=We.create({name:"gapCursor",addProseMirrorPlugins(){return[l$()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=we(re(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),p$=Je.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ae(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
488
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&o){const u=l.filter(f=>a.includes(f.type.name));c.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),rp=Je.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ae(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Uu({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Hl=200,it=function(){};it.prototype.append=function(e){return e.length?(e=it.from(e),!this.length&&e||e.length<Hl&&this.leafAppend(e)||this.length<Hl&&e.leafPrepend(this)||this.appendInner(e)):this};it.prototype.prepend=function(e){return e.length?it.from(e).append(this):this};it.prototype.appendInner=function(e){return new m$(this,e)};it.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?it.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};it.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};it.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)};it.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i};it.from=function(e){return e instanceof it?e:e&&e.length?new Z1(e):it.empty};var Z1=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,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Hl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Hl)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}(it);it.empty=new Z1([]);var m$=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,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(it);const g$=500;class on{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,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],d=[];return this.items.forEach((u,f)=>{if(!u.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,d.push(u);return}if(i){d.push(new yn(u.map));let h=u.step.map(i.slice(s)),m;h&&o.maybeStep(h).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new yn(m,void 0,void 0,c.length+d.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(u.step);if(u.selection)return a=i?u.selection.map(i.slice(s)):u.selection,l=new on(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),f=new yn(e.mapping.maps[d],u,n),h;(h=l&&l.merge(f))&&(f=h,d?s.pop():a=a.slice(0,a.length-1)),s.push(f),n&&(o++,n=void 0),i||(l=f)}let c=o-r.depth;return c>b$&&(a=y$(a,c),o-=c),new on(a.append(s),o)}remapping(e,n){let r=new co;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new on(this.items.append(e.map(n=>new yn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=n;this.items.forEach(f=>{let h=s.getMirror(--l);if(h==null)return;o=Math.min(o,h);let m=s.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),y=f.selection&&f.selection.map(s.slice(l+1,h));y&&a++,r.push(new yn(m,g,y))}else r.push(new yn(m))},i);let c=[];for(let f=n;f<o;f++)c.push(new yn(s.maps[f]));let d=this.items.slice(0,i).append(c).append(r),u=new on(d,a);return u.emptyItemCount()>g$&&(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=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&s++;let u=new yn(c.invert(),l,d),f,h=i.length-1;(f=i.length&&i[h].merge(u))?i[h]=f:i.push(u)}}else o.map&&r--},this.items.length,0),new on(it.from(i.reverse()),s)}}on.empty=new on(it.empty,0);function y$(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class yn{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 yn(n.getMap().invert(),n,this.selection)}}}class fr{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const b$=20;function v$(t,e,n,r){let i=n.getMeta(oi),s;if(i)return i.historyState;n.getMeta(E$)&&(t=new fr(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(oi))return o.getMeta(oi).redo?new fr(t.done.addTransform(n,void 0,r,rl(e)),t.undone,xy(n.mapping.maps),t.prevTime,t.prevComposition):new fr(t.done,t.undone.addTransform(n,void 0,r,rl(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!x$(n,t.prevRanges)),c=o?cu(t.prevRanges,n.mapping):xy(n.mapping.maps);return new fr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,rl(e)),on.empty,c,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new fr(t.done.rebased(n,s),t.undone.rebased(n,s),cu(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new fr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),cu(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function x$(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function xy(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function cu(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function w$(t,e,n){let r=rl(e),i=oi.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new fr(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(oi,{redo:n,historyState:l})}let du=!1,wy=null;function rl(t){let e=t.plugins;if(wy!=e){du=!1,wy=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){du=!0;break}}return du}const oi=new Be("history"),E$=new Be("closeHistory");function k$(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new $e({key:oi,state:{init(){return new fr(on.empty,on.empty,null,0,-1)},apply(e,n,r){return v$(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?eE:r=="historyRedo"?tE:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function Q1(t,e){return(n,r)=>{let i=oi.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=w$(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const eE=Q1(!1,!0),tE=Q1(!0,!0),S$=We.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>eE(t,e),redo:()=>({state:t,dispatch:e})=>tE(t,e)}},addProseMirrorPlugins(){return[k$(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),C$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,N$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,T$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,A$=un.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ts({find:C$,type:this.type}),ts({find:N$,type:this.type})]},addPasteRules(){return[ui({find:_$,type:this.type}),ui({find:T$,type:this.type})]}}),nE=Je.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ae(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),M$="listItem",Ey="textStyle",ky=/^(\d+)\.\s$/,O$=Je.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Ae(this.options.HTMLAttributes,n),0]:["ol",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(M$,this.editor.getAttributes(Ey)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=bo({find:ky,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=bo({find:ky,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Ey)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),ip=Je.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),R$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,I$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,D$=un.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ts({find:R$,type:this.type})]},addPasteRules(){return[ui({find:I$,type:this.type})]}}),L$=Je.create({name:"text",group:"inline"}),P$=We.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(Z5.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(G5.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(e$.configure(this.options.bulletList)),this.options.code!==!1&&t.push(r$.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(i1.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(Y1.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(J1.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(h$.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(p$.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(rp.configure(this.options.heading)),this.options.history!==!1&&t.push(S$.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(r1.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(A$.configure(this.options.italic)),this.options.listItem!==!1&&t.push(nE.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(O$.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(ip.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(D$.configure(this.options.strike)),this.options.text!==!1&&t.push(L$.configure(this.options.text)),t}}),B$=We.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),$$=un.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),j$=We.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new $e({key:new Be("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return ze.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1});let a=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(pt.node(c,c+l.nodeSize,{class:this.options.className}))}),ze.create(t,s)}}})]}}),F$="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",H$="ελ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",yf="numeric",bf="ascii",vf="alpha",eo="asciinumeric",Hs="alphanumeric",xf="domain",rE="emoji",z$="scheme",U$="slashscheme",uu="whitespace";function V$(t,e){return t in e||(e[t]=[]),e[t]}function Xr(t,e,n){e[yf]&&(e[eo]=!0,e[Hs]=!0),e[bf]&&(e[eo]=!0,e[vf]=!0),e[eo]&&(e[Hs]=!0),e[vf]&&(e[Hs]=!0),e[Hs]&&(e[xf]=!0),e[rE]&&(e[xf]=!0);for(const r in e){const i=V$(r,n);i.indexOf(t)<0&&i.push(t)}}function K$(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Mt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Mt.groups={};Mt.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],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return 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||Mt.groups;let i;return e&&e.j?i=e:(i=new Mt(e),n&&r&&Xr(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(t[o]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||Mt.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let o,a=i.go(t);if(a?(o=new Mt,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new Mt,s){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(K$(o.t,r),n);Xr(s,l,r)}else n&&Xr(s,n,r);o.t=s}return i.j[t]=o,o}};const be=(t,e,n,r,i)=>t.ta(e,n,r,i),qe=(t,e,n,r,i)=>t.tr(e,n,r,i),Sy=(t,e,n,r,i)=>t.ts(e,n,r,i),j=(t,e,n,r,i)=>t.tt(e,n,r,i),zn="WORD",wf="UWORD",iE="ASCIINUMERICAL",sE="ALPHANUMERICAL",Fo="LOCALHOST",Ef="TLD",kf="UTLD",il="SCHEME",ji="SLASH_SCHEME",sp="NUM",Sf="WS",op="NL",to="OPENBRACE",no="CLOSEBRACE",zl="OPENBRACKET",Ul="CLOSEBRACKET",Vl="OPENPAREN",Kl="CLOSEPAREN",Wl="OPENANGLEBRACKET",Gl="CLOSEANGLEBRACKET",ql="FULLWIDTHLEFTPAREN",Yl="FULLWIDTHRIGHTPAREN",Jl="LEFTCORNERBRACKET",Xl="RIGHTCORNERBRACKET",Zl="LEFTWHITECORNERBRACKET",Ql="RIGHTWHITECORNERBRACKET",ec="FULLWIDTHLESSTHAN",tc="FULLWIDTHGREATERTHAN",nc="AMPERSAND",rc="APOSTROPHE",ic="ASTERISK",hr="AT",sc="BACKSLASH",oc="BACKTICK",ac="CARET",gr="COLON",ap="COMMA",lc="DOLLAR",bn="DOT",cc="EQUALS",lp="EXCLAMATION",Yt="HYPHEN",ro="PERCENT",dc="PIPE",uc="PLUS",fc="POUND",io="QUERY",cp="QUOTE",oE="FULLWIDTHMIDDLEDOT",dp="SEMI",vn="SLASH",so="TILDE",hc="UNDERSCORE",aE="EMOJI",pc="SYM";var lE=Object.freeze({__proto__:null,ALPHANUMERICAL:sE,AMPERSAND:nc,APOSTROPHE:rc,ASCIINUMERICAL:iE,ASTERISK:ic,AT:hr,BACKSLASH:sc,BACKTICK:oc,CARET:ac,CLOSEANGLEBRACKET:Gl,CLOSEBRACE:no,CLOSEBRACKET:Ul,CLOSEPAREN:Kl,COLON:gr,COMMA:ap,DOLLAR:lc,DOT:bn,EMOJI:aE,EQUALS:cc,EXCLAMATION:lp,FULLWIDTHGREATERTHAN:tc,FULLWIDTHLEFTPAREN:ql,FULLWIDTHLESSTHAN:ec,FULLWIDTHMIDDLEDOT:oE,FULLWIDTHRIGHTPAREN:Yl,HYPHEN:Yt,LEFTCORNERBRACKET:Jl,LEFTWHITECORNERBRACKET:Zl,LOCALHOST:Fo,NL:op,NUM:sp,OPENANGLEBRACKET:Wl,OPENBRACE:to,OPENBRACKET:zl,OPENPAREN:Vl,PERCENT:ro,PIPE:dc,PLUS:uc,POUND:fc,QUERY:io,QUOTE:cp,RIGHTCORNERBRACKET:Xl,RIGHTWHITECORNERBRACKET:Ql,SCHEME:il,SEMI:dp,SLASH:vn,SLASH_SCHEME:ji,SYM:pc,TILDE:so,TLD:Ef,UNDERSCORE:hc,UTLD:kf,UWORD:wf,WORD:zn,WS:Sf});const jn=/[a-z]/,Ps=new RegExp("\\p{L}","u"),fu=new RegExp("\\p{Emoji}","u"),Fn=/\d/,hu=/\s/,Cy="\r",pu=`
|
|
489
|
+
`,W$="️",G$="",mu="";let La=null,Pa=null;function q$(t=[]){const e={};Mt.groups=e;const n=new Mt;La==null&&(La=_y(F$)),Pa==null&&(Pa=_y(H$)),j(n,"'",rc),j(n,"{",to),j(n,"}",no),j(n,"[",zl),j(n,"]",Ul),j(n,"(",Vl),j(n,")",Kl),j(n,"<",Wl),j(n,">",Gl),j(n,"(",ql),j(n,")",Yl),j(n,"「",Jl),j(n,"」",Xl),j(n,"『",Zl),j(n,"』",Ql),j(n,"<",ec),j(n,">",tc),j(n,"&",nc),j(n,"*",ic),j(n,"@",hr),j(n,"`",oc),j(n,"^",ac),j(n,":",gr),j(n,",",ap),j(n,"$",lc),j(n,".",bn),j(n,"=",cc),j(n,"!",lp),j(n,"-",Yt),j(n,"%",ro),j(n,"|",dc),j(n,"+",uc),j(n,"#",fc),j(n,"?",io),j(n,'"',cp),j(n,"/",vn),j(n,";",dp),j(n,"~",so),j(n,"_",hc),j(n,"\\",sc),j(n,"・",oE);const r=qe(n,Fn,sp,{[yf]:!0});qe(r,Fn,r);const i=qe(r,jn,iE,{[eo]:!0}),s=qe(r,Ps,sE,{[Hs]:!0}),o=qe(n,jn,zn,{[bf]:!0});qe(o,Fn,i),qe(o,jn,o),qe(i,Fn,i),qe(i,jn,i);const a=qe(n,Ps,wf,{[vf]:!0});qe(a,jn),qe(a,Fn,s),qe(a,Ps,a),qe(s,Fn,s),qe(s,jn),qe(s,Ps,s);const l=j(n,pu,op,{[uu]:!0}),c=j(n,Cy,Sf,{[uu]:!0}),d=qe(n,hu,Sf,{[uu]:!0});j(n,mu,d),j(c,pu,l),j(c,mu,d),qe(c,hu,d),j(d,Cy),j(d,pu),qe(d,hu,d),j(d,mu,d);const u=qe(n,fu,aE,{[rE]:!0});j(u,"#"),qe(u,fu,u),j(u,W$,u);const f=j(u,G$);j(f,"#"),qe(f,fu,u);const h=[[jn,o],[Fn,i]],m=[[jn,null],[Ps,a],[Fn,s]];for(let g=0;g<La.length;g++)or(n,La[g],Ef,zn,h);for(let g=0;g<Pa.length;g++)or(n,Pa[g],kf,wf,m);Xr(Ef,{tld:!0,ascii:!0},e),Xr(kf,{utld:!0,alpha:!0},e),or(n,"file",il,zn,h),or(n,"mailto",il,zn,h),or(n,"http",ji,zn,h),or(n,"https",ji,zn,h),or(n,"ftp",ji,zn,h),or(n,"ftps",ji,zn,h),Xr(il,{scheme:!0,ascii:!0},e),Xr(ji,{slashscheme:!0,ascii:!0},e),t=t.sort((g,y)=>g[0]>y[0]?1:-1);for(let g=0;g<t.length;g++){const y=t[g][0],w=t[g][1]?{[z$]:!0}:{[U$]:!0};y.indexOf("-")>=0?w[xf]=!0:jn.test(y)?Fn.test(y)?w[eo]=!0:w[bf]=!0:w[yf]=!0,Sy(n,y,y,w)}return Sy(n,"localhost",Fo,{ascii:!0}),n.jd=new Mt(pc),{start:n,tokens:Object.assign({groups:e},lE)}}function cE(t,e){const n=Y$(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let a=t,l=null,c=0,d=null,u=-1,f=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(u=0,f=0,d=a):u>=0&&(u+=n[o].length,f++),c+=n[o].length,s+=n[o].length,o++;s-=u,o-=f,c-=u,i.push({t:d.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function Y$(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function or(t,e,n,r,i){let s;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];t.j[l]?s=t.j[l]:(s=new Mt(r),s.jr=i.slice(),t.j[l]=s),t=s}return s=new Mt(n),s.jr=i.slice(),t.j[e[o-1]]=s,s}function _y(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Ho={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 up(t,e=null){let n=Object.assign({},Ho);t&&(n=Object.assign(n,t instanceof up?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}up.prototype={o:Ho,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]:Ho[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 dE(t,e){this.t="token",this.v=t,this.tk=e}dE.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=Ho.defaultProtocol){return{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),s=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),d&&Object.assign(o,d),{tagName:i,attributes:o,content:s,eventListeners:u}}};function sd(t,e){class n extends dE{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Ty=sd("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ay=sd("text"),J$=sd("nl"),Ba=sd("url",{isLink:!0,toHref(t=Ho.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Fo&&t[1].t===gr}}),qt=t=>new Mt(t);function X$({groups:t}){const e=t.domain.concat([nc,ic,hr,sc,oc,ac,lc,cc,Yt,sp,ro,dc,uc,fc,vn,pc,so,hc]),n=[rc,gr,ap,bn,lp,ro,io,cp,dp,Wl,Gl,to,no,Ul,zl,Vl,Kl,ql,Yl,Jl,Xl,Zl,Ql,ec,tc],r=[nc,rc,ic,sc,oc,ac,lc,cc,Yt,to,no,ro,dc,uc,fc,io,vn,pc,so,hc],i=qt(),s=j(i,so);be(s,r,s),be(s,t.domain,s);const o=qt(),a=qt(),l=qt();be(i,t.domain,o),be(i,t.scheme,a),be(i,t.slashscheme,l),be(o,r,s),be(o,t.domain,o);const c=j(o,hr);j(s,hr,c),j(a,hr,c),j(l,hr,c);const d=j(s,bn);be(d,r,s),be(d,t.domain,s);const u=qt();be(c,t.domain,u),be(u,t.domain,u);const f=j(u,bn);be(f,t.domain,u);const h=qt(Ty);be(f,t.tld,h),be(f,t.utld,h),j(c,Fo,h);const m=j(u,Yt);j(m,Yt,m),be(m,t.domain,u),be(h,t.domain,u),j(h,bn,f),j(h,Yt,m);const g=j(h,gr);be(g,t.numeric,Ty);const y=j(o,Yt),b=j(o,bn);j(y,Yt,y),be(y,t.domain,o),be(b,r,s),be(b,t.domain,o);const w=qt(Ba);be(b,t.tld,w),be(b,t.utld,w),be(w,t.domain,o),be(w,r,s),j(w,bn,b),j(w,Yt,y),j(w,hr,c);const E=j(w,gr),v=qt(Ba);be(E,t.numeric,v);const S=qt(Ba),k=qt();be(S,e,S),be(S,n,k),be(k,e,S),be(k,n,k),j(w,vn,S),j(v,vn,S);const C=j(a,gr),T=j(l,gr),M=j(T,vn),D=j(M,vn);be(a,t.domain,o),j(a,bn,b),j(a,Yt,y),be(l,t.domain,o),j(l,bn,b),j(l,Yt,y),be(C,t.domain,S),j(C,vn,S),j(C,io,S),be(D,t.domain,S),be(D,e,S),j(D,vn,S);const F=[[to,no],[zl,Ul],[Vl,Kl],[Wl,Gl],[ql,Yl],[Jl,Xl],[Zl,Ql],[ec,tc]];for(let B=0;B<F.length;B++){const[z,W]=F[B],G=j(S,z);j(k,z,G),j(G,W,S);const A=qt(Ba);be(G,e,A);const N=qt();be(G,n),be(A,e,A),be(A,n,N),be(N,e,A),be(N,n,N),j(A,W,S),j(N,W,S)}return j(i,Fo,w),j(i,op,J$),{start:i,tokens:lE}}function Z$(t,e,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let a=t,l=null,c=null,d=0,u=null,f=-1;for(;i<r&&!(l=a.go(n[i].t));)o.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(f=0,u=a):f>=0&&f++,i++,d++;if(f<0)i-=d,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(gu(Ay,e,o)),o=[]),i-=f,d-=f;const h=u.t,m=n.slice(i-d,i);s.push(gu(h,e,m))}}return o.length>0&&s.push(gu(Ay,e,o)),s}function gu(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const Q$=typeof console<"u"&&console&&console.warn||(()=>{}),ej="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Fe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function tj(){return Mt.groups={},Fe.scanner=null,Fe.parser=null,Fe.tokenQueue=[],Fe.pluginQueue=[],Fe.customSchemes=[],Fe.initialized=!1,Fe}function My(t,e=!1){if(Fe.initialized&&Q$(`linkifyjs: already initialized - will not register custom scheme "${t}" ${ej}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
490
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
491
|
+
2. Cannot start or end with "-"
|
|
492
|
+
3. "-" cannot repeat`);Fe.customSchemes.push([t,e])}function nj(){Fe.scanner=q$(Fe.customSchemes);for(let t=0;t<Fe.tokenQueue.length;t++)Fe.tokenQueue[t][1]({scanner:Fe.scanner});Fe.parser=X$(Fe.scanner.tokens);for(let t=0;t<Fe.pluginQueue.length;t++)Fe.pluginQueue[t][1]({scanner:Fe.scanner,parser:Fe.parser});return Fe.initialized=!0,Fe}function fp(t){return Fe.initialized||nj(),Z$(Fe.parser.start,t,cE(Fe.scanner.start,t))}fp.scan=cE;function uE(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new up(n),i=fp(t),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}const hp="[\0- -\u2029 ]",rj=new RegExp(hp),ij=new RegExp(`${hp}$`),sj=new RegExp(hp,"g");function oj(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function aj(t){return new $e({key:new Be("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=wN(n.doc,[...e]);if(AN(a).forEach(({newRange:c})=>{const d=kN(r.doc,c,h=>h.isTextblock);let u,f;if(d.length>1)u=d[0],f=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!ij.test(h))return;u=d[0],f=r.doc.textBetween(u.pos,c.to,void 0," ")}if(u&&f){const h=f.split(rj).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],g=u.pos+f.lastIndexOf(m);if(!m)return!1;const y=fp(m).map(b=>b.toObject(t.defaultProtocol));if(!oj(y))return!1;y.filter(b=>b.isLink).map(b=>({...b,from:g+b.start+1,to:g+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{Qf(b.from,b.to,r.doc).some(w=>w.mark.type===t.type)||o.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function lj(t){return new $e({key:new Be("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let o=r.target;const a=[];for(;o.nodeName!=="DIV";)a.push(o),o=o.parentNode;if(!a.find(f=>f.nodeName==="A"))return!1;const l=z0(e.state,t.type.name),c=r.target,d=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:l.href,u=(s=c==null?void 0:c.target)!==null&&s!==void 0?s:l.target;return c&&d?(window.open(d,u),!0):!1}}})}function cj(t){return new $e({key:new Be("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=uE(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function Ur(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(sj,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const dj=un.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){My(t);return}My(t.scheme,t.optionalSlashes)})},onDestroy(){tj()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Ur(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Ur(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Ur(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ae(this.options.HTMLAttributes,t),0]:["a",Ae(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ur(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ur(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ui({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=uE(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Ur(o,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(aj({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Ur(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(lj({type:this.type})),this.options.linkOnPaste&&t.push(cj({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),uj=We.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new $e({key:new Be("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((o,a)=>{const l=r>=a&&r<=a+o.nodeSize,c=!o.isLeaf&&Mc(o);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];s&&d.push(this.options.emptyEditorClass);const u=pt.node(a,a+o.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(u)}return this.options.includeChildren}),ze.create(t,i)}}})]}});var fj=Object.defineProperty,hj=Object.defineProperties,pj=Object.getOwnPropertyDescriptors,mc=Object.getOwnPropertySymbols,fE=Object.prototype.hasOwnProperty,hE=Object.prototype.propertyIsEnumerable,Oy=(t,e,n)=>e in t?fj(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,U=(t,e)=>{for(var n in e||(e={}))fE.call(e,n)&&Oy(t,n,e[n]);if(mc)for(var n of mc(e))hE.call(e,n)&&Oy(t,n,e[n]);return t},le=(t,e)=>hj(t,pj(e)),Pn=(t,e)=>{var n={};for(var r in t)fE.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&mc)for(var r of mc(t))e.indexOf(r)<0&&hE.call(t,r)&&(n[r]=t[r]);return n},Yi=(t,e,n)=>new Promise((r,i)=>{var s=l=>{try{a(n.next(l))}catch(c){i(c)}},o=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,o);a((n=n.apply(t,e)).next())});function od(t,e){const{view:n,state:{selection:{from:r}}}=t,i=document.querySelectorAll(".has-focus"),s=i.length,a=i[s-1];if(a&&a.getAttribute("data-type")&&a.getAttribute("data-type")===e||a&&a.classList&&(a.classList.contains(e)||a.classList.contains(`node-${e}`)))return a;const l=n.domAtPos(r).node;let c=l;for(c.tagName||(c=l.parentElement);c&&!(c.getAttribute("data-type")&&c.getAttribute("data-type")===e)&&!c.classList.contains(e);)c=c.parentElement;return c}function ad(t){const{state:{doc:e,selection:n,selection:{empty:r,from:i,to:s}}}=t,o=!e.textBetween(i,s).length&&Tc(n);return!(r||o||!t.isEditable)}function As(t,e){return({commands:n})=>n.command(({tr:r,state:i,dispatch:s})=>{if(s){let o=null;if(r.selection.ranges.forEach(a=>{i.doc.nodesBetween(a.$from.pos,a.$to.pos,(l,c)=>{l.type.name===t&&(o=c)})}),o!==null){const a=i.doc.nodeAt(o);if(a)r.setNodeMarkup(o,null,U(U({},a.attrs),e));else for(const[l,c]of Object.entries(e))r.setNodeAttribute(o,l,c)}t==="button"&&r.setSelection(r.selection)}return!0})}var sl="auto",Ry="top",pE=Je.create({name:"column",content:"block+",isolating:!0,addAttributes(){return{columnId:{default:null,parseHTML:t=>t.getAttribute("data-column-id")||wo(),renderHTML:t=>t.columnId?{"data-column-id":t.columnId}:{"data-column-id":wo()}},width:{default:sl,parseHTML:t=>t.style.width.replace(/['"]+/g,"")||sl,renderHTML:t=>!t.width||t.width===sl?{}:{style:`width: ${t.width}%;max-width:${t.width}%`}},verticalAlign:{default:Ry,parseHTML:t=>{var e;return((e=t==null?void 0:t.style)==null?void 0:e.verticalAlign)||"top"},renderHTML:t=>{const{verticalAlign:e}=t;if(!e||e===Ry)return{};if(e==="middle")return{style:"display: flex;flex-direction: column;justify-content: center;"};if(e==="bottom")return{style:"display: flex;flex-direction: column;justify-content: flex-end;"}}}}},addCommands(){return{updateColumn:t=>As(this.name,t)}},renderHTML({HTMLAttributes:t}){return["div",Ae(t,{"data-type":"column",class:"hide-scrollbars"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});function mj(t){var e,n;return((n=(e=nr(t,"columns"))==null?void 0:e.node)==null?void 0:n.childCount)||0}function nr(t,e){const{state:n}=t.view;return qo(r=>r.type.name===e)(n.selection)}function Iy(t,e){const n=nr(t,"columns"),r=nr(t,"column");if(!n||!r)return!1;const{state:i,dispatch:s}=t.view,o=n.node;let a=0;o.content.forEach((f,h,m)=>{var g,y,b;f.eq(r.node)&&((g=f==null?void 0:f.attrs)==null?void 0:g.columnId)===((b=(y=r.node)==null?void 0:y.attrs)==null?void 0:b.columnId)&&(a=m)});const l=e==="next"?a+1:a-1;if(l<0||l>=o.childCount)return!1;let c=n.pos;o.content.forEach((f,h,m)=>{m<l&&(c+=f.nodeSize)});const d=i.tr.setTime(Date.now()),u=ue.near(d.doc.resolve(c));return d.setSelection(u),s(d),!0}function gj(t,e,n="auto"){const{node:r,pos:i=0}=nr(t,"columns")||{};if(!r)return!1;const{state:s,dispatch:o}=t.view,{tr:a}=s,{selection:l}=s,c=i+r.nodeSize,d={from:l.from-i,to:l.to-i},u=[];r.content.forEach((g,y,b)=>{var w;u.push(g.type.create(le(U({},g==null?void 0:g.attrs),{width:b===e?n:(w=g==null?void 0:g.attrs)==null?void 0:w.width}),g.content))});const f=r.copy(L.from(u)),h=a.replaceWith(i,c,f),m=ue.create(h.doc,i+d.from,i+d.to);return o(h.setSelection(m)),!0}function yj(t,e=-1){const{node:n,pos:r=0}=nr(t,"columns")||{};if(!n)return!1;const i=e<0?n.childCount:e,{state:s}=t.view,o=s.schema.nodes.column.create({width:sl,columnId:wo()},s.schema.nodes.paragraph.create(null)),a=[];n.content.forEach((f,h,m)=>{a.push(f),m===i&&a.push(o)}),e===-1&&a.push(o);const l=n.copy(L.from(a)),c=s.tr.replaceWith(r,r+n.nodeSize,l),d=r+a.slice(0,i).reduce((f,h)=>f+h.nodeSize,0),u=ue.near(c.doc.resolve(d));return c.setSelection(u),t.view.dispatch(c),!0}function bj(t,e=-1){const{node:n,pos:r=0}=nr(t,"columns")||{};if(!n)return!1;const{state:i,dispatch:s}=t.view,{tr:o}=i,a=[];n.content.forEach((h,m,g)=>{g!==e&&a.push(h)}),e===-1&&a.pop();const l=n.copy(L.from(a)),c=o.replaceWith(r,r+n.nodeSize,l),d=e===n.childCount-1?e-1:e,u=r+a.slice(0,d).reduce((h,m)=>h+m.nodeSize,0),f=ue.near(c.doc.resolve(u));return c.setSelection(f),s(c),!0}function vj(t){const{node:e,pos:n=0}=nr(t,"columns")||{};if(!e)return[];const r=[];return e.content.forEach(i=>{const{columnId:s,width:o}=i.attrs;r.push({id:s,width:o})}),r}var xj=t=>In({editor:t,selector:n=>{var r,i,s;return{isSectionActive:n.editor.isActive("section"),isColumnActive:n.editor.isActive("column"),currentVerticalAlignment:((r=n.editor.getAttributes("column"))==null?void 0:r.verticalAlign)||"top",currentShowIfKey:((i=n.editor.getAttributes("columns"))==null?void 0:i.showIfKey)||"",columnsCount:mj(n.editor),columnWidths:vj(n.editor).map(o=>o.width),currentColumnsGap:((s=n.editor.getAttributes("columns"))==null?void 0:s.gap)||0}},equalityFn:$r}),pp="-",wj=t=>{const e=kj(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(pp);return a[0]===""&&a.length!==1&&a.shift(),mE(a,e)||Ej(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},mE=(t,e)=>{var n;if(t.length===0)return e.classGroupId;const r=t[0],i=e.nextPart.get(r),s=i?mE(t.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;const o=t.join(pp);return(n=e.validators.find(({validator:a})=>a(o)))==null?void 0:n.classGroupId},Dy=/^\[(.+)\]$/,Ej=t=>{if(Dy.test(t)){const e=Dy.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},kj=t=>{const{theme:e,classGroups:n}=t,r={nextPart:new Map,validators:[]};for(const i in n)Cf(n[i],r,i,e);return r},Cf=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:Ly(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(Sj(i)){Cf(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Cf(o,Ly(e,s),n,r)})})},Ly=(t,e)=>{let n=t;return e.split(pp).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Sj=t=>t.isThemeGetter,Cj=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},_f="!",Nf=":",_j=Nf.length,Nj=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const s=[];let o=0,a=0,l=0,c;for(let m=0;m<i.length;m++){let g=i[m];if(o===0&&a===0){if(g===Nf){s.push(i.slice(l,m)),l=m+_j;continue}if(g==="/"){c=m;continue}}g==="["?o++:g==="]"?o--:g==="("?a++:g===")"&&a--}const d=s.length===0?i:i.substring(l),u=Tj(d),f=u!==d,h=c&&c>l?c-l:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:u,maybePostfixModifierPosition:h}};if(e){const i=e+Nf,s=r;r=o=>o.startsWith(i)?s(o.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},Tj=t=>t.endsWith(_f)?t.substring(0,t.length-1):t.startsWith(_f)?t.substring(1):t,Aj=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let s=[];return r.forEach(o=>{o[0]==="["||e[o]?(i.push(...s.sort(),o),s=[]):s.push(o)}),i.push(...s.sort()),i}},Mj=t=>U({cache:Cj(t.cacheSize),parseClassName:Nj(t),sortModifiers:Aj(t)},wj(t)),Oj=/\s+/,Rj=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=e,o=[],a=t.trim().split(Oj);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:f,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(u){l=d+(l.length>0?" "+l:l);continue}let y=!!g,b=r(y?m.substring(0,g):m);if(!b){if(!y){l=d+(l.length>0?" "+l:l);continue}if(b=r(m),!b){l=d+(l.length>0?" "+l:l);continue}y=!1}const w=s(f).join(":"),E=h?w+_f:w,v=E+b;if(o.includes(v))continue;o.push(v);const S=i(b,y);for(let k=0;k<S.length;++k){const C=S[k];o.push(E+C)}l=d+(l.length>0?" "+l:l)}return l};function Ij(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=gE(e))&&(r&&(r+=" "),r+=n);return r}var gE=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=gE(t[r]))&&(n&&(n+=" "),n+=e);return n};function Py(t,...e){let n,r,i,s=o;function o(l){const c=e.reduce((d,u)=>u(d),t());return n=Mj(c),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=Rj(l,n);return i(l,d),d}return function(){return s(Ij.apply(null,arguments))}}var tt=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},yE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dj=/^\d+\/\d+$/,Lj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Pj=/\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$/,Bj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$j=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ri=t=>Dj.test(t),xe=t=>!!t&&!Number.isNaN(Number(t)),ar=t=>!!t&&Number.isInteger(Number(t)),yu=t=>t.endsWith("%")&&xe(t.slice(0,-1)),Hn=t=>Lj.test(t),Fj=()=>!0,Hj=t=>Pj.test(t)&&!Bj.test(t),vE=()=>!1,zj=t=>$j.test(t),Uj=t=>jj.test(t),Vj=t=>!ee(t)&&!te(t),Kj=t=>Ms(t,EE,vE),ee=t=>yE.test(t),Vr=t=>Ms(t,kE,Hj),bu=t=>Ms(t,Jj,xe),By=t=>Ms(t,xE,vE),Wj=t=>Ms(t,wE,Uj),$a=t=>Ms(t,SE,zj),te=t=>bE.test(t),Bs=t=>Os(t,kE),Gj=t=>Os(t,Xj),$y=t=>Os(t,xE),qj=t=>Os(t,EE),Yj=t=>Os(t,wE),ja=t=>Os(t,SE,!0),Ms=(t,e,n)=>{const r=yE.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Os=(t,e,n=!1)=>{const r=bE.exec(t);return r?r[1]?e(r[1]):n:!1},xE=t=>t==="position"||t==="percentage",wE=t=>t==="image"||t==="url",EE=t=>t==="length"||t==="size"||t==="bg-size",kE=t=>t==="length",Jj=t=>t==="number",Xj=t=>t==="family-name",SE=t=>t==="shadow",jy=()=>{const t=tt("color"),e=tt("font"),n=tt("text"),r=tt("font-weight"),i=tt("tracking"),s=tt("leading"),o=tt("breakpoint"),a=tt("container"),l=tt("spacing"),c=tt("radius"),d=tt("shadow"),u=tt("inset-shadow"),f=tt("text-shadow"),h=tt("drop-shadow"),m=tt("blur"),g=tt("perspective"),y=tt("aspect"),b=tt("ease"),w=tt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...v(),te,ee],k=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],T=()=>[te,ee,l],M=()=>[Ri,"full","auto",...T()],D=()=>[ar,"none","subgrid",te,ee],F=()=>["auto",{span:["full",ar,te,ee]},ar,te,ee],B=()=>[ar,"auto",te,ee],z=()=>["auto","min","max","fr",te,ee],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...T()],N=()=>[Ri,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],_=()=>[t,te,ee],I=()=>[...v(),$y,By,{position:[te,ee]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",qj,Kj,{size:[te,ee]}],se=()=>[yu,Bs,Vr],ae=()=>["","none","full",c,te,ee],K=()=>["",xe,Bs,Vr],X=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[xe,yu,$y,By],Se=()=>["","none",m,te,ee],Ee=()=>["none",xe,te,ee],Ne=()=>["none",xe,te,ee],Me=()=>[xe,te,ee],Te=()=>[Ri,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hn],breakpoint:[Hn],color:[Fj],container:[Hn],"drop-shadow":[Hn],ease:["in","out","in-out"],font:[Vj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hn],shadow:[Hn],spacing:["px",xe],text:[Hn],"text-shadow":[Hn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ri,ee,te,y]}],container:["container"],columns:[{columns:[xe,ee,te,a]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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"],sr:["sr-only","not-sr-only"],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:S()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[ar,"auto",te,ee]}],basis:[{basis:[Ri,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xe,Ri,"auto","initial","none",ee]}],grow:[{grow:["",xe,te,ee]}],shrink:[{shrink:["",xe,te,ee]}],order:[{order:[ar,"first","last","none",te,ee]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[a,"screen",...N()]}],"min-w":[{"min-w":[a,"screen","none",...N()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",n,Bs,Vr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,te,bu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yu,ee]}],"font-family":[{font:[Gj,ee,e]}],"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-fractions"],tracking:[{tracking:[i,te,ee]}],"line-clamp":[{"line-clamp":[xe,"none",te,bu]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",te,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[xe,"from-font","auto",te,Vr]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[xe,"auto",te,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ar,te,ee],radial:["",te,ee],conic:[ar,te,ee]},Yj,Wj]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xe,te,ee]}],"outline-w":[{outline:["",xe,Bs,Vr]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",d,ja,$a]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",u,ja,$a]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[xe,Vr]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",f,ja,$a]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[xe,te,ee]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[te,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,ee]}],filter:[{filter:["","none",te,ee]}],blur:[{blur:Se()}],brightness:[{brightness:[xe,te,ee]}],contrast:[{contrast:[xe,te,ee]}],"drop-shadow":[{"drop-shadow":["","none",h,ja,$a]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",xe,te,ee]}],"hue-rotate":[{"hue-rotate":[xe,te,ee]}],invert:[{invert:["",xe,te,ee]}],saturate:[{saturate:[xe,te,ee]}],sepia:[{sepia:["",xe,te,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",te,ee]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[xe,te,ee]}],"backdrop-contrast":[{"backdrop-contrast":[xe,te,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xe,te,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xe,te,ee]}],"backdrop-invert":[{"backdrop-invert":["",xe,te,ee]}],"backdrop-opacity":[{"backdrop-opacity":[xe,te,ee]}],"backdrop-saturate":[{"backdrop-saturate":[xe,te,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",xe,te,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xe,"initial",te,ee]}],ease:[{ease:["linear","initial",b,te,ee]}],delay:[{delay:[xe,te,ee]}],animate:[{animate:["none",w,te,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,te,ee]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[te,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",te,ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",te,ee]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[xe,Bs,Vr,bu]}],stroke:[{stroke:["none",..._()]}],"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-x","border-w-y","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-x","border-color-y","border-color-s","border-color-e","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Zj=(t,{cacheSize:e,prefix:n,experimentalParseClassName:r,extend:i={},override:s={}})=>(zs(t,"cacheSize",e),zs(t,"prefix",n),zs(t,"experimentalParseClassName",r),Fa(t.theme,s.theme),Fa(t.classGroups,s.classGroups),Fa(t.conflictingClassGroups,s.conflictingClassGroups),Fa(t.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),zs(t,"orderSensitiveModifiers",s.orderSensitiveModifiers),Ha(t.theme,i.theme),Ha(t.classGroups,i.classGroups),Ha(t.conflictingClassGroups,i.conflictingClassGroups),Ha(t.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),CE(t,i,"orderSensitiveModifiers"),t),zs=(t,e,n)=>{n!==void 0&&(t[e]=n)},Fa=(t,e)=>{if(e)for(const n in e)zs(t,n,e[n])},Ha=(t,e)=>{if(e)for(const n in e)CE(t,e,n)},CE=(t,e,n)=>{const r=e[n];r!==void 0&&(t[n]=t[n]?t[n].concat(r):r)},Qj=(t,...e)=>typeof t=="function"?Py(jy,t,...e):Py(()=>Zj(jy(),t),...e),e9=Qj({prefix:"mly"});function ye(...t){return e9(mM(t))}function Ue(t){const{type:e="vertical",className:n}=t;return p.jsx("div",{className:ye("mly:shrink-0 mly:bg-gray-200",e==="vertical"?"mly:mx-0.5 mly:w-px":"mly:my-0.5 mly:h-px",n)})}var Vt=vR,Nt=xR,Tt=wR,xt=x.forwardRef((t,e)=>{var n=t,{className:r,sideOffset:i=4}=n,s=Pn(n,["className","sideOffset"]);return p.jsx(nx,U({ref:e,sideOffset:i,className:ye("mly:z-50 mly:overflow-hidden mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:px-2 mly:py-1 mly:text-xs mly:animate-in mly:fade-in-0 mly:zoom-in-95",r)},s))});xt.displayName=nx.displayName;var Rt=x.forwardRef((t,e)=>{var n=t,{className:r,variant:i="default",size:s="default",asChild:o=!1}=n,a=Pn(n,["className","variant","size","asChild"]);const l=o?yI:"button",c="mly:inline-flex mly:items-center mly:justify-center mly:rounded-md mly:text-sm mly:font-medium mly:ring-offset-white mly:transition-colors mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2 mly:focus-visible:relative mly:focus-visible:z-10 mly:disabled:opacity-50 ",d={default:"mly:bg-gray-900 mly:text-gray-50 mly:hover:bg-soft-gray",destructive:"mly:bg-red-500 mly:text-gray-50 mly:hover:bg-red-500/90",outline:"mly:border mly:border-gray-200 mly:bg-white mly:hover:bg-gray-100 mly:hover:text-gray-900",secondary:"mly:bg-gray-100 mly:text-gray-900 mly:hover:bg-gray-100/80",ghost:"mly:hover:bg-soft-gray bg-transparent mly:hover:text-gray-900 mly:data-[state=true]:bg-soft-gray mly:data-[state=true]:text-gray-900",link:"mly:text-gray-900 mly:underline-offset-4 mly:hover:underline"},u={default:"mly:h-10 mly:px-4 mly:py-2",sm:"mly:h-9 mly:rounded-md mly:px-3",lg:"mly:h-11 mly:rounded-md mly:px-8",icon:"mly:h-10 mly:w-10"},f=ye("mly-editor",c,d[i],u[s],r);return p.jsx(l,U({className:f,ref:e},a))});Rt.displayName="BaseButton";function cn(t){var e;const{tooltip:n}=t,r=p.jsx(Rt,le(U({variant:"ghost",size:"sm"},t.command?{onClick:t.command}:{}),{"data-state":(e=t==null?void 0:t.isActive)==null?void 0:e.call(t),className:ye("mly:size-7! mly:px-2.5 mly:disabled:cursor-not-allowed",t==null?void 0:t.className),type:"button",disabled:t.disbabled,children:t.icon?p.jsx(t.icon,{className:ye("mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]",t==null?void 0:t.iconClassName)}):p.jsx("span",{className:ye("mly:text-sm mly:font-medium mly:text-slate-600",t==null?void 0:t.nameClassName),children:t.name})}));return n?p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:r}),p.jsx(xt,{sideOffset:8,children:n})]}):r}function t9(t){const{alignment:e="top",onAlignmentChange:n}=t,r={top:{icon:IR,tooltip:"Align Top",onClick:()=>{n("middle")}},middle:{icon:AR,tooltip:"Align Center",onClick:()=>{n("bottom")}},bottom:{icon:OR,tooltip:"Align Bottom",onClick:()=>{n("top")}}}[e];return p.jsx(cn,{icon:r.icon,tooltip:r.tooltip,command:r.onClick})}function _E(t,e){const n=t.extensionManager.extensions.find(r=>r.name===e);if(!n)throw new Error(`Node ${e} not found`);return n.options}function NE(t){return _E(t,"variable")}function xi(t){return x.useMemo(()=>NE(t),[t])}function na(t,e){const{query:n}=e,r=n.toLowerCase();let i=[];if(Array.isArray(t))return i=t.filter(s=>s.name.toLowerCase().startsWith(r)),n.length>0&&!i.some(s=>s.name===n)&&i.push({name:n,required:!0}),i;if(typeof t=="function")return t(e);throw new Error(`Invalid variables type. Expected 'Array' or 'Function', but received '${typeof t}'.
|
|
493
|
+
|
|
494
|
+
You can check out the documentation for more information: https://github.com/arikchakma/maily.to/blob/main/packages/core/readme.md`)}var rn=ND,sn=TD,Kt=x.forwardRef((t,e)=>{var n=t,{className:r,align:i="center",sideOffset:s=4,portal:o=!1}=n,a=Pn(n,["className","align","sideOffset","portal"]);const l=p.jsx(Wx,U({ref:e,align:i,sideOffset:s,className:ye("mly:z-9999 mly:w-72 mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:p-4 mly:text-gray-950 mly:shadow-md mly:outline-hidden","mly-editor",r)},a));return o?p.jsx(AD,{children:l}):l});Kt.displayName=Wx.displayName;var bs=Object.freeze({autoComplete:"off","data-1p-ignore":!0,"data-form-type":"other"});function n9(t,e){const n=x.useCallback(r=>{t.current&&!t.current.contains(r.target)&&e()},[t,e]);x.useEffect(()=>(document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}),[n])}var ra=x.forwardRef((t,e)=>{var n;const r=t,{value:i="",onValueChange:s,className:o,onOutsideClick:a,onSelectOption:l,autoCompleteOptions:c=[],triggerChar:d="",editor:u}=r,f=Pn(r,["value","onValueChange","className","onOutsideClick","onSelectOption","autoCompleteOptions","triggerChar","editor"]),h=x.useRef(null),m=x.useRef(null),g=(n=xi(u))==null?void 0:n.variableSuggestionsPopover;n9(h,()=>{a==null||a()});const y=i.startsWith(d);return p.jsxs("div",{className:ye("mly:relative"),ref:h,children:[p.jsxs("label",{className:"mly:relative",children:[p.jsx("input",le(U(le(U({},bs),{placeholder:"e.g. items",type:"text"}),f),{ref:e,value:i,onChange:b=>{s(b.target.value)},className:ye("mly:h-7 mly:w-40 mly:rounded-md mly:bg-white mly:px-2 mly:pr-6 mly:text-sm mly:text-midnight-gray mly:hover:bg-soft-gray mly:focus:bg-soft-gray mly:focus:outline-hidden",o),onKeyDown:b=>{if(!m.current||!y)return;const{moveUp:w,moveDown:E,select:v}=m.current;b.key==="ArrowDown"?(b.preventDefault(),E()):b.key==="ArrowUp"?(b.preventDefault(),w()):b.key==="Enter"&&(b.preventDefault(),v())},spellCheck:!1})),p.jsx("div",{className:"mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center",children:p.jsx(ux,{className:"mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray"})})]}),y&&p.jsx("div",{className:"mly:absolute mly:left-0 mly:top-8",children:p.jsx(g,{items:c.map(b=>({name:b})),onSelectItem:b=>{l==null||l(b.name)},ref:m})})]})});ra.displayName="InputAutocomplete";function r9(t){const{showIfKey:e="",onShowIfKeyValueChange:n,editor:r}=t,i=xi(r),s=i==null?void 0:i.variables,o=i==null?void 0:i.renderVariable,[a,l]=x.useState(!1),c=x.useRef(null),d=x.useMemo(()=>na(s,{query:e||"",from:"bubble-variable",editor:r}).map(f=>f.name),[s,e,r]),u=e||d.includes(e);return p.jsxs(rn,{onOpenChange:f=>{f||l(!1)},children:[p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:p.jsx(sn,{className:ye("mly:flex mly:size-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2",e&&"mly:bg-rose-100 mly:text-rose-800 mly:data-[state=open]:bg-rose-100 mly:hover:bg-rose-100"),children:p.jsx(l2,{className:"mly:h-3 mly:w-3 mly:stroke-[2.5]"})})}),p.jsx(xt,{sideOffset:8,children:"Show block conditionally"})]}),p.jsxs(Kt,{className:"mly:flex mly:w-max mly:rounded-lg mly:p-0.5!",side:"top",sideOffset:8,align:"end",onOpenAutoFocus:f=>{f.preventDefault()},onCloseAutoFocus:f=>{f.preventDefault()},children:[p.jsxs("div",{className:"mly:flex mly:items-center mly:gap-1.5 mly:px-1.5 mly:text-sm mly:leading-none",children:["Show if",p.jsxs(Nt,{children:[p.jsx(Tt,{children:p.jsx(gx,{className:ye("mly:size-3 mly:stroke-[2.5] mly:text-gray-500")})}),p.jsx(xt,{sideOffset:14,className:"mly:max-w-[285px]",align:"start",children:"Show the block if the selected variable is true."})]})]}),!a&&p.jsx("button",{onClick:()=>{l(!0),setTimeout(()=>{var f;(f=c.current)==null||f.focus()},0)},children:o({variable:{name:e,valid:!!u},fallback:"",from:"bubble-variable",editor:r})}),a&&p.jsx("form",{onSubmit:f=>{f.preventDefault(),l(!1)},onKeyDown:f=>{f.key==="Escape"&&l(!1)},children:p.jsx(ra,{editor:r,value:e||"",onValueChange:f=>{n==null||n(f)},onOutsideClick:()=>{l(!1)},onSelectOption:f=>{n==null||n(f),l(!1)},autoCompleteOptions:d,ref:c})})]})]})}var wi=x.memo(r9);function i9(t){const{columnsCount:e=2,onColumnsCountChange:n,columnWidths:r,onColumnWidthChange:i}=t;return p.jsxs(rn,{children:[p.jsx(sn,{className:"mly:flex mly:size-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray",children:p.jsx(J2,{className:"mly:h-3 mly:w-3 mly:stroke-[2.5]"})}),p.jsxs(Kt,{className:"mly:w-[300px] mly:rounded-lg mly:p-0.5!",side:"top",sideOffset:8,align:"center",onOpenAutoFocus:s=>{s.preventDefault()},onCloseAutoFocus:s=>{s.preventDefault()},children:[p.jsxs("div",{className:"mly:grid mly:grid-cols-2 mly:gap-1",children:[p.jsxs(Fy,{onClick:()=>n(2),isActive:e===2,children:[p.jsx(dx,{className:"mly:h-4 mly:w-4 mly:stroke-[2.5]"}),p.jsx("span",{children:"2 Columns"})]}),p.jsxs(Fy,{onClick:()=>n(3),isActive:e===3,children:[p.jsx(ZR,{className:"mly:h-4 mly:w-4 mly:stroke-[2.5]"}),p.jsx("span",{children:"3 Columns"})]})]}),p.jsx("hr",{className:"mly:my-0.5 mly:border-gray-200"}),p.jsx("div",{className:"mly:grid mly:gap-1 mly:p-1",style:{gridTemplateColumns:`repeat(${e}, 1fr)`},children:Array.from({length:e}).map((s,o)=>{const a=r[o]==="auto"?"":r[o],l=e===2?o===0?"Left":"Right":o===0?"Left":o===1?"Middle":"Right";return p.jsxs("div",{className:"mly:flex mly:flex-col mly:gap-1",children:[p.jsx("span",{className:"mly:text-xs mly:text-gray-400",children:l}),p.jsxs("label",{className:"mly:relative",children:[p.jsx("input",le(U({},bs),{placeholder:"auto",min:1,max:90,type:"number",className:"hide-number-controls mly:w-full mly:appearance-none mly:rounded-md mly:bg-soft-gray mly:px-1.5 mly:py-1 mly:pr-6 mly:text-sm mly:tabular-nums mly:outline-hidden mly:focus:bg-soft-gray mly:focus:outline-hidden mly:focus:ring-1 mly:focus:ring-midnight-gray/50",value:a,onChange:c=>{const d=c.target.value;i==null||i(o,d)}})),p.jsx("span",{className:"mly:absolute mly:inset-y-0 mly:right-0 mly:flex mly:aspect-square mly:items-center mly:justify-center mly:text-xs mly:tabular-nums mly:text-gray-500",children:"%"})]})]},o)})})]})]})}function Fy(t){const{onClick:e,isActive:n=!1,children:r}=t;return p.jsx("button",{className:ye("mly:flex mly:h-7 mly:items-center mly:gap-1 mly:rounded-md mly:px-2 mly:text-sm mly:text-gray-500 mly:hover:bg-soft-gray mly:hover:text-midnight-gray",n&&"mly:bg-soft-gray mly:text-midnight-gray"),onClick:e,children:r})}function Cn(t){const{label:e,options:n,value:r,onValueChange:i,tooltip:s,className:o,icon:a,iconClassName:l,placeholder:c}=t,d=`mly${x.useId()}`,u=p.jsxs("div",{className:"mly:relative",children:[p.jsx("label",{htmlFor:d,className:"mly:sr-only",children:e}),a&&p.jsx("div",{className:"mly:pointer-events-none mly:absolute mly:inset-y-0 mly:left-2 mly:z-20 mly:flex mly:items-center",children:p.jsx(a,{className:ye("mly:size-3",l)})}),p.jsxs("select",{id:d,className:ye("mly:flex mly:min-h-7 mly:max-w-max mly:appearance-none mly:items-center mly:rounded-md mly:bg-white mly:px-1.5 mly:py-0.5 mly:pr-7 mly:text-sm mly:text-midnight-gray mly:ring-offset-white mly:transition-colors mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2 mly:active:bg-soft-gray",!!a&&"mly:pl-7",o),value:r||"",onChange:f=>i(f.target.value),children:[c&&p.jsx("option",{value:"",disabled:!0,hidden:!0,children:c}),n.map(f=>p.jsx("option",{value:f.value,children:f.label},f.value))]}),p.jsx("span",{className:"mly:pointer-events-none mly:absolute mly:inset-y-0 mly:right-0 mly:z-10 mly:flex mly:h-full mly:w-7 mly:items-center mly:justify-center mly:text-gray-600 mly:peer-disabled:opacity-50",children:p.jsx(lx,{size:16,strokeWidth:2,"aria-hidden":"true",role:"img"})})]});return s?p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:u}),p.jsx(xt,{sideOffset:8,children:s})]}):u}function TE(t,e){const{state:n}=t.view,r=qo(l=>l.type.name===e)(n.selection);if(!r)return;const i=r.pos,s=i+r.node.nodeSize,{tr:o}=n,a=o.delete(i,s);t.view.dispatch(a)}var zo=[{name:"Extra Small",short:"xs",value:4},{name:"Small",short:"sm",value:8},{name:"Medium",short:"md",value:16},{name:"Large",short:"lg",value:32},{name:"Extra Large",short:"xl",value:64}];function AE(t){const{editor:e}=t;if(!e)return null;const n=xj(e),r=n.columnsCount;return p.jsx(Vt,{children:p.jsxs("div",{className:"mly:flex mly:items-stretch",children:[n.isColumnActive&&p.jsxs(p.Fragment,{children:[p.jsx(i9,{columnsCount:r,columnWidths:n.columnWidths,onColumnsCountChange:i=>{i>r?yj(e):bj(e)},onColumnWidthChange:(i,s)=>{gj(e,i,s)}}),p.jsx(Ue,{})]}),p.jsx(t9,{alignment:n.currentVerticalAlignment,onAlignmentChange:i=>{e.commands.updateColumn({verticalAlign:i})}}),p.jsx(Ue,{}),p.jsx(Cn,{icon:Z2,label:"Columns Gap",value:n.currentColumnsGap,options:[{value:"0",label:"None"},...zo.map(i=>({label:i.name,value:String(i.value)}))],onValueChange:i=>{e.commands.updateColumns({gap:+i})},tooltip:"Columns Gap"}),p.jsx(Ue,{}),p.jsx(cn,{icon:Ex,tooltip:"Delete Columns",command:()=>{TE(e,"columns")}}),p.jsx(Ue,{}),p.jsx(wi,{showIfKey:n.currentShowIfKey,onShowIfKeyValueChange:i=>{e.commands.updateColumns({showIfKey:i})},editor:e})]})})}function s9(t){const{appendTo:e,editor:n}=t;if(!n)return null;const r=x.useCallback(()=>{const s=od(n,"columns");return(s==null?void 0:s.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},[n]),i=le(U(U({},t),e?{appendTo:e.current}:{}),{shouldShow:({editor:s})=>ad(s)||s.isActive("section")||s.isActive("repeat")||!s.isEditable?!1:s.isActive("columns"),tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,appendTo:()=>e==null?void 0:e.current,plugins:[mi],sticky:"popper",maxWidth:"auto"},pluginKey:"columnsBubbleMenu"});return p.jsx(rr,le(U({},i),{className:"mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsx(AE,{editor:n})}))}function mp(t,e,n){const r=[],i=t.node(0);n=typeof n=="number"&&n>=0?n:t.sameParent(e)?Math.max(0,t.sharedDepth(e.pos)-1):t.sharedDepth(e.pos);const s=new ao(t,e,n),o=s.depth===0?0:i.resolve(s.start).posAtIndex(0);return s.parent.forEach((a,l)=>{const c=o+l,d=c+a.nodeSize;if(c<s.start||c>=s.end)return;const u=new Pb(i.resolve(c),i.resolve(d));r.push(u)}),r}var o9=class ME{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ME(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return new OE(n,r)}},OE=class dr extends ge{constructor(e,n,r,i=1){const{doc:s}=e,o=e===n,a=e.pos===s.content.size&&n.pos===s.content.size,l=o&&!a?s.resolve(n.pos+(i>0?1:-1)):n,c=o&&a?s.resolve(e.pos-(i>0?1:-1)):e,d=mp(c.min(l),c.max(l),r);super(l.pos>=e.pos?d[0].$from:d[d.length-1].$to,l.pos>=e.pos?d[d.length-1].$to:d[0].$from,d),this.depth=r}get $to(){return this.ranges[this.ranges.length-1].$to}eq(e){return e instanceof dr&&e.$from.pos===this.$from.pos&&e.$to.pos===this.$to.pos}map(e,n){const r=e.resolve(n.map(this.anchor)),i=e.resolve(n.map(this.head));return new dr(r,i)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:e}=this.$from;if(this.isForwards&&this.ranges.length>1){const i=this.ranges.slice(0,-1),s=i[0].$from,o=i[i.length-1].$to;return new dr(s,o,this.depth)}const n=this.ranges[0],r=e.resolve(Math.max(0,n.$from.pos-1));return new dr(this.$anchor,r,this.depth)}extendForwards(){const{doc:e}=this.$from;if(this.isBackwards&&this.ranges.length>1){const i=this.ranges.slice(1),s=i[0].$from,o=i[i.length-1].$to;return new dr(o,s,this.depth)}const n=this.ranges[this.ranges.length-1],r=e.resolve(Math.min(e.content.size,n.$to.pos+1));return new dr(this.$anchor,r,this.depth)}static fromJSON(e,n){return new dr(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r,i,s=1){return new this(e.resolve(n),e.resolve(r),i,s)}getBookmark(){return new o9(this.anchor,this.head)}};function a9(t){const e=t.cloneNode(!0),n=[t,...Array.from(t.getElementsByTagName("*"))],r=[e,...Array.from(e.getElementsByTagName("*"))];return n.forEach((i,s)=>{const o=r[s];o instanceof HTMLElement&&i instanceof HTMLElement&&(o.style.cssText=function(a){let l="";const c=getComputedStyle(a);for(let d=0;d<c.length;d+=1)l+=`${c[d]}:${c.getPropertyValue(c[d])};`;return l}(i))}),e}function za(t,e){return window.getComputedStyle(t)[e]}function l9(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Hy(t){t.parentNode!==null&&t.parentNode!==void 0&&t.parentNode.removeChild(t)}var RE=t=>{const{x:e,y:n,direction:r,editor:i}=t;let s=null,o=null,a=null,l=e;for(;o===null&&l<window.innerWidth&&l>0;){const c=document.elementsFromPoint(l,n),d=c.findIndex(f=>f.classList.contains("ProseMirror")),u=c.slice(0,d);if(u.length>0){const f=u[0];if(s=f,a=i.view.posAtDOM(f,0),a>=0){o=i.state.doc.nodeAt(Math.max(a-1,0)),(o===null||o.isText)&&(o=i.state.doc.nodeAt(Math.max(a-1,0))),o||(o=i.state.doc.nodeAt(Math.max(a,0)));break}}r==="left"?l-=1:l+=1}return{resultElement:s,resultNode:o,pos:a!==null?a:null}};function c9(t,e){const{doc:n}=e.view.state,r=RE({editor:e,x:t.clientX,y:t.clientY,direction:"right"});if(!r.resultNode||r.pos===null)return[];const i=t.clientX,s=function(d,u,f){const h=parseInt(za(d.dom,"paddingLeft"),10),m=parseInt(za(d.dom,"paddingRight"),10),g=parseInt(za(d.dom,"borderLeftWidth"),10),y=parseInt(za(d.dom,"borderLeftWidth"),10),b=d.dom.getBoundingClientRect();return{left:l9(u,b.left+h+g,b.right-m-y),top:f}}(e.view,i,t.clientY),o=e.view.posAtCoords(s);if(!o)return[];const{pos:a}=o;if(!n.resolve(a).parent)return[];const l=n.resolve(r.pos),c=n.resolve(r.pos+1);return mp(l,c,0)}var zy=(t,e)=>{const n=t.resolve(e),{depth:r}=n;return r===0?e:n.pos-n.parentOffset-1},Uy=(t,e)=>{const n=t.nodeAt(e),r=t.resolve(e);let{depth:i}=r,s=n;for(;i>0;){const o=r.node(i);i-=1,i===0&&(s=o)}return s},vu=(t,e)=>{const n=eB.getState(t);return n?tB(e,n.type,n.binding.mapping):null},Vy=(t,e)=>{let n=e;for(;n&&n.parentNode&&n.parentNode!==t.dom;)n=n.parentNode;return n},IE=new Be("dragHandle");function d9(t){const{pluginKey:e=IE,element:n,editor:r,tippyOptions:i,onNodeChange:s}=t,o=document.createElement("div");let a=null,l=!1,c=null,d=-1;return n.addEventListener("dragstart",u=>{const{view:f}=r;if(!u.dataTransfer)return;const{empty:h,$from:m,$to:g}=f.state.selection,y=c9(u,r),b=mp(m,g,0),w=b.some(D=>y.find(F=>F.$from===D.$from&&F.$to===D.$to)),E=h||!w?y:b;if(!E.length)return;const{tr:v}=f.state,S=document.createElement("div"),k=E[0].$from.pos,C=E[E.length-1].$to.pos,T=OE.create(f.state.doc,k,C),M=T.content();E.forEach(D=>{const F=a9(f==null?void 0:f.nodeDOM(D.$from.pos));S.append(F)}),S.style.position="absolute",S.style.top="-10000px",document.body.append(S),u.dataTransfer.clearData(),u.dataTransfer.setDragImage(S,0,0),f.dragging={slice:M,move:!0},v.setSelection(T),f.dispatch(v),document.addEventListener("drop",()=>Hy(S),{once:!0}),setTimeout(()=>{n&&(n.style.pointerEvents="none")},0)}),n.addEventListener("dragend",()=>{n&&(n.style.pointerEvents="auto")}),new $e({key:typeof e=="string"?new Be(e):e,state:{init:()=>({locked:!1}),apply(u,f,h,m){const g=u.getMeta("lockDragHandle"),y=u.getMeta("hideDragHandle");if(g!==void 0&&(l=g),y&&a)return a==null||a.hide(),l=!1,c=null,d=-1,s==null||s({editor:r,node:null,pos:-1}),f;if(u.docChanged&&d!==-1&&n&&a){const b=u.mapping.map(d);b!==d&&(d=b,vu(m,d))}return f}},view:u=>{var f;return n.draggable=!0,n.style.pointerEvents="auto",(f=r.view.dom.parentElement)===null||f===void 0||f.appendChild(o),o.appendChild(n),o.style.pointerEvents="none",o.style.position="absolute",o.style.top="0",o.style.left="0",a=Br(u.dom,le(U({getReferenceClientRect:null,interactive:!0,trigger:"manual",placement:"left-start",hideOnClick:!1,duration:100,zIndex:10,popperOptions:{modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",options:{rootBoundary:"document",mainAxis:!1}}]}},i),{appendTo:o,content:n})),{update(h,m){if(!n||!a||(n.draggable=!l,u.state.doc.eq(m.doc)||d===-1))return;let g=u.nodeDOM(d);if(g=Vy(u,g),g===u.dom||(g==null?void 0:g.nodeType)!==1)return;const y=u.posAtDOM(g,0),b=Uy(r.state.doc,y);if(b!==c){const w=zy(r.state.doc,y);c=b,d=w,vu(u.state,d),s==null||s({editor:r,node:c,pos:d}),a.setProps({getReferenceClientRect:()=>g==null?void 0:g.getBoundingClientRect()}),a.show()}},destroy(){a==null||a.destroy(),n&&Hy(o)}}},props:{handleDOMEvents:{mouseleave:(u,f)=>(l||f.target&&!o.contains(f==null?void 0:f.relatedTarget)&&(a==null||a.hide(),c=null,d=-1,s==null||s({editor:r,node:null,pos:-1})),!1),mousemove(u,f){if(!n||!a||l)return!1;const h=RE({x:f.clientX,y:f.clientY,direction:"right",editor:r});if(!h.resultElement)return!1;let m=h.resultElement;if(m=Vy(u,m),m===u.dom||(m==null?void 0:m.nodeType)!==1)return!1;const g=u.posAtDOM(m,0),y=Uy(r.state.doc,g);if(y!==c){const b=zy(r.state.doc,g);c=y,d=b,vu(u.state,d),s==null||s({editor:r,node:c,pos:d}),a.setProps({getReferenceClientRect:()=>m.getBoundingClientRect()}),a.show()}return!1}}}})}function u9(t){const{className:e="drag-handle",children:n,editor:r,pluginKey:i=IE,onNodeChange:s,tippyOptions:o={}}=t,[a,l]=x.useState(null),c=x.useRef(null);return x.useEffect(()=>a?r.isDestroyed?()=>{c.current=null}:(c.current||(c.current=d9({editor:r,element:a,pluginKey:i,tippyOptions:o,onNodeChange:s}),r.registerPlugin(c.current)),()=>{r.unregisterPlugin(i),c.current=null}):()=>{c.current=null},[a,r,s,i]),p.jsx("div",{className:e,ref:l,children:n})}function f9(t){const{editor:e}=t,[n,r]=x.useState(!1),[i,s]=x.useState(null),[o,a]=x.useState(-1),l=x.useCallback(f=>{f.node&&s(f.node),a(f.pos)},[a,s]);function c(){e.commands.setNodeSelection(o);const{$anchor:f}=e.state.selection,h=f.node(1)||e.state.selection.node;e.chain().setMeta("hideDragHandle",!0).insertContentAt(o+((i==null?void 0:i.nodeSize)||0),h.toJSON()).run(),r(!1)}function d(){e.chain().setMeta("hideDragHandle",!0).setNodeSelection(o).deleteSelection().run(),r(!1)}function u(){var f;if(o!==-1){const h=(i==null?void 0:i.nodeSize)||0,m=o+h,g=(i==null?void 0:i.type.name)==="paragraph"&&((f=i==null?void 0:i.content)==null?void 0:f.size)===0,y=g?o+2:m+2;e.chain().command(({dispatch:b,tr:w,state:E})=>b?(g?w.insertText("/",o,o+1):w.insert(m,E.schema.nodes.paragraph.create(null,[E.schema.text("/")])),b(w)):!0).focus(y).run()}}return x.useEffect(()=>(n?e.commands.setMeta("lockDragHandle",!0):e.commands.setMeta("lockDragHandle",!1),()=>{e.commands.setMeta("lockDragHandle",!1)}),[e,n]),p.jsx(u9,{pluginKey:"ContentMenu",editor:e,tippyOptions:{offset:[2,0],zIndex:99},onNodeChange:l,className:ye(e.isEditable?"mly:visible":"mly:hidden"),children:p.jsx(Vt,{children:p.jsxs("div",{className:"mly:flex mly:items-center mly:pr-1.5",children:[p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:p.jsx(Rt,{variant:"ghost",size:"icon",className:"mly:size-5! mly:cursor-grab mly:text-gray-500 mly:hover:text-black",onClick:u,type:"button",children:p.jsx(V2,{className:"mly:size-3.5 mly:shrink-0"})})}),p.jsx(xt,{sideOffset:8,children:"Add new node"})]}),p.jsxs(rn,{open:n,onOpenChange:r,children:[p.jsxs("div",{className:"mly:relative mly:flex mly:flex-col",children:[p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:p.jsx(Rt,{variant:"ghost",size:"icon",className:"mly:relative mly:z-1 mly:size-5! mly:cursor-grab mly:text-gray-500 mly:hover:text-black",onClick:f=>{f.preventDefault(),r(!0),e.commands.setNodeSelection(o)},type:"button",children:p.jsx(h2,{className:"mly:size-3.5 mly:shrink-0"})})}),p.jsx(xt,{sideOffset:8,children:"Node actions"})]}),p.jsx(sn,{className:"mly:absolute mly:left-0 mly:top-0 mly:z-0 mly:h-5 mly:w-5"})]}),p.jsxs(Kt,{align:"start",side:"bottom",sideOffset:8,className:"mly:flex mly:w-max mly:flex-col mly:rounded-md mly:p-1",children:[p.jsxs(Rt,{variant:"ghost",onClick:c,className:"mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:px-2 mly:py-1 mly:text-sm mly:font-normal",children:[p.jsx(e2,{className:"mly:size-[15px] mly:shrink-0"}),"Duplicate"]}),p.jsx(Ue,{type:"horizontal"}),p.jsxs(Rt,{onClick:d,className:"mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:bg-red-100 mly:px-2 mly:py-1 mly:text-sm mly:font-normal mly:text-red-600 mly:hover:bg-red-200 mly:focus:bg-red-200",children:[p.jsx(aI,{className:"mly:size-[15px] mly:shrink-0"}),"Delete"]})]})]})]})})})}var h9=t=>{const{editor:e,config:n}=t,r=x.useMemo(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:ax},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:yx},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:kx},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:wx},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:fx},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:q2},{name:"link",command:()=>{const s=e.getAttributes("link").href,o=window.prompt("URL",s);if(o!==null){if(o===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:o}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:nf},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:sx},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:ix},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:ox}],[e]),i=x.useMemo(()=>r.reduce((s,o)=>(s.includes(o.group)||s.push(o.group),s),[]),[r]);return e?p.jsx("div",{className:`mly:flex mly:items-center mly:gap-3 ${n==null?void 0:n.toolbarClassName}`,children:i.map((s,o)=>p.jsx("div",{className:"mly:flex mly:items-center mly:gap-1 mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:p-1",children:r.filter(a=>a.group===s).map((a,l)=>p.jsx(cn,U({},a),l))},o))}):null},p9=t=>In({editor:t,selector:n=>{var r,i;return{activeTab:((r=n.editor.getAttributes("htmlCodeBlock"))==null?void 0:r.activeTab)||"code",currentShowIfKey:((i=n.editor.getAttributes("htmlCodeBlock"))==null?void 0:i.showIfKey)||""}},equalityFn:$r});function m9(t){const{appendTo:e,editor:n}=t;if(!n)return null;const r=p9(n),i=x.useCallback(()=>{const a=od(n,"htmlCodeBlock");return(a==null?void 0:a.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},[n]),s=le(U(U({},t),e?{appendTo:e.current}:{}),{shouldShow:({editor:a})=>a.isActive("htmlCodeBlock"),tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:i,appendTo:()=>e==null?void 0:e.current,plugins:[mi],sticky:"popper",maxWidth:"auto"},pluginKey:"htmlCodeBlockBubbleMenu"}),{activeTab:o="code"}=r;return p.jsx(rr,le(U({},s),{className:"mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsxs(Vt,{children:[p.jsxs("div",{className:"mly:flex mly:items-center mly:h-7 mly:rounded-md mly:bg-soft-gray mly:px-0.5",children:[p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:p.jsx("button",{className:ye("mly:flex mly:size-6 mly:shrink-0 mly:items-center mly:justify-center mly:rounded mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2",o==="code"&&"mly:bg-white"),disabled:o==="code",onClick:()=>{var a;(a=n==null?void 0:n.commands)==null||a.updateHtmlCodeBlock({activeTab:"code"})},children:p.jsx(cx,{className:"mly:size-3 mly:shrink-0 mly:stroke-[2.5]"})})}),p.jsx(xt,{sideOffset:8,children:"HTML Code"})]}),p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:p.jsx("button",{className:ye("mly:flex mly:size-6 mly:shrink-0 mly:items-center mly:justify-center mly:rounded mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2",o==="preview"&&"mly:bg-white"),disabled:o==="preview",onClick:()=>{var a;(a=n==null?void 0:n.commands)==null||a.updateHtmlCodeBlock({activeTab:"preview"})},children:p.jsx(hI,{className:"mly:size-3 mly:shrink-0 mly:stroke-[2.5]"})})}),p.jsx(xt,{sideOffset:8,children:"Preview"})]})]}),p.jsx(Ue,{}),p.jsx(wi,{showIfKey:r.currentShowIfKey,onShowIfKeyValueChange:a=>{n.commands.updateHtmlCodeBlock({showIfKey:a})},editor:n})]})}))}var DE="#f7f7f7",Ky="left",g9=2,LE="#e2e2e2",y9=0,b9=0,v9=0,x9=0,w9=0,E9=0,k9=0,S9=0,Qe=null,PE=Je.create({name:"section",group:"block",content:"(block|columns)+",defining:!0,isolating:!0,addAttributes(){return{borderRadius:{default:0,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.borderRadius)==null?void 0:n.replace(/['"]+/g,""))},renderHTML:t=>t.borderRadius?{style:`border-radius: ${t.borderRadius}px`}:{}},backgroundColor:{default:DE,parseHTML:t=>t.style.backgroundColor,renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor};--bg-color: ${t.backgroundColor}`}:{}},align:{default:Ky,parseHTML:t=>t.getAttribute("align")||Ky,renderHTML(t){return t.align?{align:t.align}:{}}},borderWidth:{default:g9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.borderWidth)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.borderWidth?{style:`border-width: ${t.borderWidth}px`}:{}},borderColor:{default:LE,parseHTML:t=>t.style.borderColor,renderHTML:t=>t.borderColor?{style:`border-color: ${t.borderColor}`}:{}},paddingTop:{default:w9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.paddingTop)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.paddingTop?{style:`padding-top: ${t.paddingTop}px`}:{}},paddingRight:{default:E9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.paddingRight)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.paddingRight?{style:`padding-right: ${t.paddingRight}px`}:{}},paddingBottom:{default:k9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.paddingBottom)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.paddingBottom?{style:`padding-bottom: ${t.paddingBottom}px`}:{}},paddingLeft:{default:S9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.paddingLeft)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.paddingLeft?{style:`padding-left: ${t.paddingLeft}px`}:{}},marginTop:{default:y9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.marginTop)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.marginTop?{marginTop:t.marginTop}:{}},marginRight:{default:b9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.marginRight)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.marginRight?{marginRight:t.marginRight}:{}},marginBottom:{default:v9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.marginBottom)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.marginBottom?{marginBottom:t.marginBottom}:{}},marginLeft:{default:x9,parseHTML:t=>{var e,n;return Number((n=(e=t==null?void 0:t.style)==null?void 0:e.marginLeft)==null?void 0:n.replace(/['"]+/g,""))||0},renderHTML:t=>t.marginLeft?{marginLeft:t.marginLeft}:{}},showIfKey:{default:Qe,parseHTML:t=>t.getAttribute("data-show-if-key")||Qe,renderHTML(t){return t.showIfKey?{"data-show-if-key":t.showIfKey}:{}}}}},addCommands(){return{setSection:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{type:this.name},content:[{type:"paragraph"}]}),updateSection:t=>As(this.name,t)}},renderHTML({HTMLAttributes:t}){const{marginTop:e=0,marginRight:n=0,marginBottom:r=0,marginLeft:i=0}=t;return["table",{"data-type":this.name,border:0,cellpadding:0,cellspacing:0,class:"mly:w-full mly:border-separate mly:relative mly:table-fixed",style:`margin-top: ${e}px; margin-right: ${n}px; margin-bottom: ${r}px; margin-left: ${i}px;`},["tbody",{class:"mly:w-full"},["tr",{class:"mly:w-full"},["td",Ae(t,{"data-type":"section-cell",style:"border-style: solid",class:"mly:w-full mly:[text-align:revert-layer]"}),0]]]]},parseHTML(){return[{tag:'table[data-type="section"]'}]}});function C9(t){const{editor:e,onImageUpload:n,allowedMimeTypes:r}=t;function i(s,o,a){var l,c,d;const u=URL.createObjectURL(o),{tr:f,schema:h}=s.state,m=h.nodes.image.create({src:u,isSrcVariable:!1,alt:o.name,externalLink:"",isExternalLinkVariable:!1});(d=(c=(l=e==null?void 0:e.extensionStorage)==null?void 0:l.imageUpload)==null?void 0:c.placeholderImages)==null||d.add(u);const g=a!==void 0?s.state.doc.resolve(a):s.state.selection.$head,y=f.insert(g.pos,m);s.dispatch(y),n==null||n(o).then(b=>{const w=s.state.tr,E=v=>v.type.name==="image"&&v.attrs.src===u;s.state.doc.descendants((v,S)=>{if(E(v))return w.setNodeMarkup(S,void 0,le(U({},v.attrs),{src:b})),!1}),s.dispatch(w)}).catch(b=>{console.error("Image upload failed",b)}).finally(()=>{e.extensionStorage.imageUpload.placeholderImages.delete(u),URL.revokeObjectURL(u)})}return new $e({key:new Be("imageUpload"),props:{handleDrop:(s,o)=>{var a,l;if(!n||!((l=(a=o.dataTransfer)==null?void 0:a.files)!=null&&l.length))return!1;const c=Array.from(o.dataTransfer.files).filter(u=>r==null?void 0:r.includes(u.type));if(c.length===0)return!1;const d=s.posAtCoords({left:o.clientX,top:o.clientY});return d?(o.preventDefault(),o.stopPropagation(),c.forEach(u=>i(s,u,d.pos)),!0):!1},handlePaste:(s,o)=>{var a,l;if(!n||!((l=(a=o.clipboardData)==null?void 0:a.files)!=null&&l.length))return!1;const c=Array.from(o.clipboardData.files).filter(d=>r==null?void 0:r.includes(d.type));return c.length===0?!1:(o.preventDefault(),o.stopPropagation(),c.forEach(d=>i(s,d)),!0)}}})}We.create({name:"imageUpload",addOptions(){return{allowedMimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml"],onImageUpload:void 0}},addStorage(){return{placeholderImages:new Set}},addProseMirrorPlugins(){const{onImageUpload:t}=this.options;return t?[C9({editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onImageUpload:this.options.onImageUpload})]:[]}});function BE(t){return x.useMemo(()=>{const e=t.extensionManager.extensions.find(n=>n.name==="imageUpload");return(e==null?void 0:e.options)||{}},[t])}var _9=t=>{const e=x.useRef(null);return x.useLayoutEffect(()=>{e.current=t},[t]),x.useCallback((...n)=>{if(e.current===null)throw new Error("Handler is not assigned");return e.current(...n)},[])};function Wy(t,e){return t/e}function Tf(t,e){return t<=0||e<=0?0:t/e}function N9(t,e){return t*e}var Gy=20,$E=600,qy=400;function T9(t){const{node:e,updateAttributes:n,selected:r,editor:i}=t,[s,o]=x.useState("idle"),[a,l]=x.useState(!1),{onImageUpload:c,allowedMimeTypes:d=[]}=BE(i),u=x.useRef(null),f=x.useRef(null),[h,m]=x.useState(),[g,y]=x.useState(!1),b=_9(K=>{const X=document.querySelector(".ProseMirror-selectednode");if(!f.current||!X||!r)return;const me=Math.max(X.offsetWidth,$E);K.preventDefault();const he=K.currentTarget.dataset.direction||"--",Se=K.clientX,Ee=K.clientY,Ne=f.current.width,Me=f.current.height;let Te=Ne,ke=Me;const je=he[1]==="w"?-1:1,Oe=he[0]==="n"?-1:1,de=()=>{window.removeEventListener("mousemove",Ke),window.removeEventListener("mouseup",de);const Z=Wy(Te,ke);n({width:Te,height:ke,aspectRatio:Z}),m(void 0)},Ke=Z=>{if(Te=Math.max(Ne+je*(Z.clientX-Se),Gy),ke=Math.max(Me+Oe*(Z.clientY-Ee),Gy),Te>me&&(Te=me),ke>qy&&(ke=qy),e.attrs.lockAspectRatio){const ne=e.attrs.aspectRatio&&isFinite(e.attrs.aspectRatio)&&e.attrs.aspectRatio>0?e.attrs.aspectRatio:Ne/Me;ke=Tf(Te,ne)}if(m({width:Te,height:ke}),!Z.buttons)return de()};window.addEventListener("mousemove",Ke),window.addEventListener("mouseup",de)}),w=x.useCallback(K=>a?null:p.jsx("div",{role:"button",tabIndex:0,onMouseDown:b,"data-direction":K,className:"mly:bg-rose-500",style:le(U(U({position:"absolute",height:"10px",width:"10px"},{n:{top:0},s:{bottom:0}}[K[0]]),{w:{left:0},e:{right:0}}[K[1]]),{cursor:`${K}-resize`})}),[b,a]);let{alignment:E="center",width:v,height:S,src:k,borderRadius:C}=e.attrs||{};const T=e.attrs||{},{externalLink:M,isExternalLinkVariable:D,isSrcVariable:F,showIfKey:B,aspectRatio:z,borderRadius:W,lockAspectRatio:G}=T,A=Pn(T,["externalLink","isExternalLinkVariable","isSrcVariable","showIfKey","aspectRatio","borderRadius","lockAspectRatio"]),N=!!A.src,_=!!c&&i.isEditable&&!N&&!F&&s==="idle",I=K=>Yi(this,null,function*(){if(!_||!K.target.files||K.target.files.length===0)return;const X=K.target.files[0];yield $(X)}),$=x.useCallback(K=>Yi(this,null,function*(){if(_)try{o("loading");const X=yield c(K);n({src:X}),l(!1),o("loaded")}catch(X){console.error("Error uploading image:",X),o("error")}}),[c,n]);x.useEffect(()=>{var K,X,me,he;if(!k||F)return;o("loading");const Se=(he=(me=(X=(K=i==null?void 0:i.extensionStorage)==null?void 0:K.imageUpload)==null?void 0:X.placeholderImages)==null?void 0:me.has(k))!=null?he:!1;l(Se);const Ee=new Image;return Ee.src=k,Ee.onload=()=>{o("loaded");const{naturalWidth:Ne,naturalHeight:Me}=Ee,Te=u==null?void 0:u.current;if(!Te||v!=="auto"||!Ne)return;const ke=Te.offsetWidth,je=Wy(Ne,Me),Oe=Math.min(Tf(ke,je),Me);n({width:Math.min(ke,Ne),height:Math.min(Oe,Me),aspectRatio:je})},Ee.onerror=()=>{o("error")},()=>{Ee.src="",Ee.onload=null,Ee.onerror=null}},[k]);const q=x.useCallback(K=>{_&&(K.preventDefault(),K.stopPropagation(),y(!0))},[c]),se=x.useCallback(K=>{_&&(K.preventDefault(),K.stopPropagation(),y(!1))},[c]),ae=x.useCallback(K=>Yi(this,null,function*(){var X;if(!_)return;K.preventDefault(),K.stopPropagation(),y(!1);const me=(X=K.dataTransfer)==null?void 0:X.files;if(!me||(me==null?void 0:me.length)===0)return;const he=me[0];d.includes(he.type)&&(yield $(he))}),[$]);return p.jsxs(gi,le(U({as:"div",draggable:i.isEditable,"data-drag-handle":i.isEditable,className:ye("mly-image-drop-zone",g&&"mly-drag-over"),style:U(le(U({},N&&s==="loaded"?U({width:v&&v!=="auto"?`${v}px`:void 0,height:S&&S!=="auto"?`${S}px`:void 0},h):{}),{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block",maxWidth:"100%"}),{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[E]||{}),ref:u},_?{onDragOver:q,onDragLeave:se,onDrop:ae}:{}),{children:[!N&&s==="idle"&&p.jsx(En,{status:"idle",minHeight:S,isDropZone:_}),!N&&s==="loading"&&!F&&p.jsx(En,{status:"loading",minHeight:S}),N&&F&&p.jsx(En,{status:"variable",minHeight:S}),N&&s==="loading"&&!F&&p.jsx(En,{status:"loading",minHeight:S}),N&&s==="error"&&!F&&p.jsx(En,{status:"error",minHeight:S}),_&&p.jsx("input",{type:"file",accept:"image/*",onChange:I,className:"mly:absolute mly:inset-0 mly:opacity-0",multiple:!1}),N&&s==="loaded"&&!F&&p.jsxs(p.Fragment,{children:[p.jsx("img",le(U({},A),{ref:f,style:le(U({},h),{cursor:"default",objectFit:"fill",marginBottom:0,borderRadius:C,width:h!=null&&h.width?`${h.width}px`:v&&v!=="auto"?`${v}px`:"auto",height:h!=null&&h.height?`${h.height}px`:S&&S!=="auto"?`${S}px`:"auto"}),draggable:i.isEditable,className:ye(a&&"mly:animate-pulse mly:opacity-40")})),r&&i.isEditable&&!a&&p.jsxs(p.Fragment,{children:[[{left:0,top:0,height:"100%",width:"1px"},{right:0,top:0,height:"100%",width:"1px"},{top:0,left:0,width:"100%",height:"1px"},{bottom:0,left:0,width:"100%",height:"1px"}].map((K,X)=>p.jsx("div",{className:"mly:bg-rose-500",style:U({position:"absolute"},K)},X)),w("nw"),w("ne"),w("sw"),w("se")]})]})]}))}function En(t){const e=t,{status:n,minHeight:r,className:i,style:s,isDropZone:o}=e,a=Pn(e,["status","minHeight","className","style","isDropZone"]);return p.jsxs("div",le(U({},a),{className:ye("mly:flex mly:items-center mly:justify-center mly:gap-2 mly:rounded-lg mly:bg-soft-gray mly:px-4 mly:py-2 mly:text-sm mly:font-medium",{"mly:text-gray-500 mly:hover:bg-soft-gray/60":n==="loading","mly:text-red-500 mly:hover:bg-soft-gray/60":n==="error"},i),style:U(U({},r?{minHeight:r}:{}),s),children:[n==="idle"&&!o&&p.jsxs(p.Fragment,{children:[p.jsx(v2,{className:"mly:size-4 mly:stroke-[2.5]"}),p.jsx("span",{children:"No image selected"})]}),n==="idle"&&o&&p.jsxs(p.Fragment,{children:[p.jsx(u2,{className:"mly:size-4 mly:stroke-[2.5]"}),p.jsx("span",{children:"Click or Drop image here"})]}),n==="loading"&&p.jsxs(p.Fragment,{children:[p.jsx(A2,{className:"mly:size-4 mly:animate-spin mly:stroke-[2.5]"}),p.jsx("span",{children:"Loading image..."})]}),n==="error"&&p.jsxs(p.Fragment,{children:[p.jsx(jR,{className:"mly:size-4 mly:stroke-[2.5]"}),p.jsx("span",{children:"Error loading image"})]}),n==="variable"&&p.jsxs(p.Fragment,{children:[p.jsx(Ki,{className:"mly:size-4 mly:stroke-[2.5]"}),p.jsx("span",{children:"Variable Image URL"})]})]}))}function A9(t){const{node:e,editor:n,updateAttributes:r}=t,[i,s]=x.useState("idle"),[o,a]=x.useState(!1),[l,c]=x.useState(!1),{onImageUpload:d,allowedMimeTypes:u=[]}=BE(n);let{alignment:f="center",src:h,isSrcVariable:m,size:g="sm"}=e.attrs||{};const y=!!h,b=!!d&&n.isEditable&&!m&&i==="idle",w=T=>Yi(this,null,function*(){if(!b||!T.target.files||T.target.files.length===0)return;const M=T.target.files[0];yield E(M)}),E=x.useCallback(T=>Yi(this,null,function*(){if(b)try{s("loading");const M=yield d(T);r({src:M}),a(!1),s("loaded")}catch(M){console.error("Error uploading image:",M),s("error")}}),[d,r]),v=x.useCallback(T=>{b&&(T.preventDefault(),T.stopPropagation(),c(!0))},[d]),S=x.useCallback(T=>{b&&(T.preventDefault(),T.stopPropagation(),c(!1))},[d]),k=x.useCallback(T=>Yi(this,null,function*(){var M;if(!b)return;T.preventDefault(),T.stopPropagation(),c(!1);const D=(M=T.dataTransfer)==null?void 0:M.files;if(!D||(D==null?void 0:D.length)===0)return;const F=D[0];u.includes(F.type)&&(yield E(F))}),[E]);x.useEffect(()=>{var T,M,D,F;if(!h)return;s("loading");const B=(F=(D=(M=(T=n==null?void 0:n.extensionStorage)==null?void 0:T.imageUpload)==null?void 0:M.placeholderImages)==null?void 0:D.has(h))!=null?F:!1;a(B);const z=new Image;return z.src=h,z.onload=()=>{s("loaded")},z.onerror=()=>{s("error")},()=>{z.src="",z.onload=null,z.onerror=null}},[h]);const C=I9[g];return p.jsxs(gi,le(U({as:"div",draggable:n.isEditable,"data-drag-handle":n.isEditable,style:{overflow:"hidden",position:"relative",lineHeight:"0px",display:"block"},className:ye("mly-image-drop-zone",l&&"mly-drag-over")},b?{onDragOver:v,onDragLeave:S,onDrop:k}:{}),{children:[!y&&i==="idle"&&p.jsx(En,{status:"idle",minHeight:C,isDropZone:b}),!y&&i==="loading"&&!m&&p.jsx(En,{status:"loading",minHeight:C}),y&&m&&p.jsx(En,{status:"variable",minHeight:C}),y&&i==="loading"&&!m&&p.jsx(En,{status:"loading",minHeight:C}),y&&i==="error"&&!m&&p.jsx(En,{status:"error",minHeight:C}),b&&p.jsx("input",{type:"file",accept:"image/*",onChange:w,className:"mly:absolute mly:inset-0 mly:opacity-0",multiple:!1}),y&&i==="loaded"&&!m&&p.jsx("img",{src:h,alt:"Logo",style:U({height:C,width:C,cursor:"default",marginBottom:0},{center:{marginLeft:"auto",marginRight:"auto"},left:{marginRight:"auto"},right:{marginLeft:"auto"}}[f]||{}),draggable:n.isEditable})]}))}var M9=["sm","md","lg"],O9=["left","center","right"],R9="left",jE="sm",I9={sm:"40px",md:"48px",lg:"64px"},FE=Wh.extend({name:"logo",priority:1e3,addAttributes(){var t;return le(U({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:jE,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:R9,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})},showIfKey:{default:Qe,parseHTML:e=>e.getAttribute("data-show-if-key")||Qe,renderHTML(e){return e.showIfKey?{"data-show-if-key":e.showIfKey}:{}}},isSrcVariable:{default:!1,parseHTML:e=>e.getAttribute("data-is-src-variable")==="true",renderHTML:e=>e.isSrcVariable?{"data-is-src-variable":"true"}:{}}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]},addNodeView(){return yi(A9,{className:"mly:relative"})}}),D9=[{name:"Sharp",value:0},{name:"Smooth",value:8},{name:"Smoother",value:16},{name:"Rounded",value:24},{name:"Circle",value:9999}];function ld(t){const{alignment:e,onAlignmentChange:n}=t,r=O9.includes(e)?e:"left",i={left:{icon:sx,tooltip:"Align Left",onClick:()=>{n("left")}},center:{icon:ix,tooltip:"Align Center",onClick:()=>{n("center")}},right:{icon:ox,tooltip:"Align Right",onClick:()=>{n("right")}}},s=i[r];return p.jsxs(rn,{children:[p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:p.jsx(sn,{className:ye("mly:flex mly:size-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2"),children:p.jsx(s.icon,{className:"mly:h-3 mly:w-3 mly:stroke-[2.5]"})})}),p.jsx(xt,{sideOffset:8,children:"Alignment"})]}),p.jsx(Kt,{className:"mly:flex mly:w-max mly:gap-0.5 mly:rounded-lg mly:p-0.5!",side:"top",sideOffset:8,align:"center",onOpenAutoFocus:o=>{o.preventDefault()},onCloseAutoFocus:o=>{o.preventDefault()},children:Object.entries(i).map(([o,a])=>p.jsx(cn,{icon:a.icon,tooltip:a.tooltip,command:a.onClick,isActive:()=>o===r},o))})]})}var L9={title:"Button",description:"Add a call to action button to email.",searchTerms:["link","button","cta"],icon:p.jsx(B2,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setButton().run()}},P9={title:"Link Card",description:"Add a link card to email.",searchTerms:["link","button","image"],icon:p.jsx(eI,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setLinkCard().run()},render:t=>t.extensionManager.extensions.findIndex(e=>e.name==="linkCard")===-1?null:!0},B9={title:"Custom HTML",description:"Insert a custom HTML block",searchTerms:["html","code","custom"],icon:p.jsx(cx,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHtmlCodeBlock({language:"html"}).run()}},$9={title:"Image",description:"Full width image",searchTerms:["image"],icon:p.jsx(_h,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setImage({src:""}).run()}},j9={title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:p.jsx(_h,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setLogoImage({src:""}).run()}},F9={title:"Inline Image",description:"Inline image",searchTerms:["image","inline"],icon:p.jsx(_h,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setInlineImage({src:"https://maily.to/brand/logo.png"}).command(n=>{const{tr:r,state:i,view:s,editor:o}=n,{from:a}=e,l=i.doc.nodeAt(a);if(!l)return!1;const c=ue.create(r.doc,a,a+l.nodeSize);return r.setSelection(c),!0}).run()}},H9={title:"Columns",description:"Add columns to email.",searchTerms:["layout","columns"],icon:p.jsx(dx,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setColumns().focus(t.state.selection.head-2).run()}},z9={title:"Section",description:"Add a section to email.",searchTerms:["layout","section"],icon:p.jsx(vx,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setSection().run()}},U9={title:"Repeat",description:"Loop over an array of items.",searchTerms:["repeat","for","loop"],icon:p.jsx(xx,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setRepeat().run()}},V9={title:"Spacer",description:"Add space between blocks.",searchTerms:["space","gap","divider"],icon:p.jsx(j2,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setSpacer({height:"sm"}).run()}},K9={title:"Divider",description:"Add a horizontal divider.",searchTerms:["divider","line"],icon:p.jsx(L2,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHorizontalRule().run()}},W9={title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:p.jsx(Th,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},G9={title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:p.jsx(Nh,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},q9={title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:p.jsx(sI,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},Y9={title:"Heading 1",description:"Big heading.",searchTerms:["h1","title","big","large"],icon:p.jsx(Ch,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},J9={title:"Heading 2",description:"Medium heading.",searchTerms:["h2","subtitle","medium"],icon:p.jsx(hx,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},X9={title:"Heading 3",description:"Small heading.",searchTerms:["h3","subtitle","small"],icon:p.jsx(px,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},Z9={title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:p.jsx(s2,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHardBreak().run()}},Q9={title:"Blockquote",description:"Add blockquote.",searchTerms:["quote","blockquote"],icon:p.jsx(rI,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},eF={title:"Footer",description:"Add a footer text to email.",searchTerms:["footer","text"],icon:p.jsx(Sh,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setFooter().run()}},tF={title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:p.jsx(fx,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().selectParentNode().deleteSelection().run()}};function nF(t){return p.jsxs("svg",le(U({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),{children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.97634 1.4502H9.02405C9.70389 1.4502 10.2476 1.45019 10.687 1.48609C11.1379 1.52293 11.527 1.6003 11.8849 1.78263C12.4588 2.07504 12.9254 2.54164 13.2178 3.11553C13.4001 3.47338 13.4775 3.86253 13.5143 4.31342C13.5502 4.75277 13.5502 5.29652 13.5502 5.97637V8.02403C13.5502 8.70388 13.5502 9.24763 13.5143 9.68698C13.4775 10.1379 13.4001 10.527 13.2178 10.8849C12.9254 11.4588 12.4588 11.9254 11.8849 12.2178C11.527 12.4001 11.1379 12.4775 10.687 12.5143C10.2476 12.5502 9.70387 12.5502 9.02402 12.5502H4.97636C4.29651 12.5502 3.75276 12.5502 3.31341 12.5143C2.86252 12.4775 2.47337 12.4001 2.11552 12.2178C1.54163 11.9254 1.07504 11.4588 0.782626 10.8849C0.600293 10.527 0.522922 10.1379 0.486083 9.68698C0.450187 9.24764 0.45019 8.70389 0.450195 8.02405V5.97635C0.45019 5.29651 0.450187 4.75276 0.486083 4.31342C0.522922 3.86253 0.600293 3.47338 0.782626 3.11553C1.07504 2.54164 1.54163 2.07504 2.11552 1.78263C2.47337 1.6003 2.86252 1.52293 3.31341 1.48609C3.75276 1.45019 4.2965 1.4502 4.97634 1.4502ZM3.40298 2.58243C3.02012 2.61372 2.79184 2.67259 2.61491 2.76274C2.248 2.94969 1.94968 3.248 1.76273 3.61492C1.67258 3.79185 1.61371 4.02013 1.58243 4.40299C1.55062 4.79228 1.55019 5.29106 1.55019 6.0002V8.0002C1.55019 8.70934 1.55062 9.20812 1.58243 9.59741C1.61371 9.98028 1.67258 10.2086 1.76273 10.3855C1.94968 10.7524 2.248 11.0507 2.61491 11.2377C2.79184 11.3278 3.02012 11.3867 3.40298 11.418C3.79227 11.4498 4.29105 11.4502 5.00019 11.4502H9.00019C9.70933 11.4502 10.2081 11.4498 10.5974 11.418C10.9803 11.3867 11.2086 11.3278 11.3855 11.2377C11.7524 11.0507 12.0507 10.7524 12.2377 10.3855C12.3278 10.2086 12.3867 9.98028 12.418 9.59741C12.4498 9.20812 12.4502 8.70934 12.4502 8.0002V6.0002C12.4502 5.29106 12.4498 4.79228 12.418 4.40299C12.3867 4.02013 12.3278 3.79185 12.2377 3.61492C12.0507 3.248 11.7524 2.94969 11.3855 2.76274C11.2086 2.67259 10.9803 2.61372 10.5974 2.58243C10.2081 2.55063 9.70933 2.5502 9.00019 2.5502H5.00019C4.29105 2.5502 3.79227 2.55063 3.40298 2.58243Z",fill:"currentColor"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.1999 0.450195C4.50366 0.450195 4.7499 0.696438 4.7499 1.00019V2.75019C4.7499 3.05395 4.50366 3.30019 4.1999 3.30019C3.89614 3.30019 3.6499 3.05395 3.6499 2.75019V1.00019C3.6499 0.696438 3.89614 0.450195 4.1999 0.450195Z",fill:"currentColor"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.8 0.450195C10.1037 0.450195 10.35 0.696438 10.35 1.00019V2.75019C10.35 3.05395 10.1037 3.30019 9.8 3.30019C9.49625 3.30019 9.25 3.05395 9.25 2.75019V1.00019C9.25 0.696438 9.49625 0.450195 9.8 0.450195Z",fill:"currentColor"}),p.jsx("mask",{id:"path-4-inside-1_1046_19527",fill:"white",children:p.jsx("rect",{x:"3",y:"4",width:"8",height:"3",rx:"0.5"})}),p.jsx("rect",{x:"3",y:"4",width:"8",height:"3",rx:"0.5",stroke:"black",strokeWidth:"2",mask:"url(#path-4-inside-1_1046_19527)"}),p.jsx("rect",{x:"6.25",y:"8.25",width:"4.5",height:"0.5",rx:"0.25",stroke:"black",strokeWidth:"0.5"}),p.jsx("rect",{x:"3",y:"8",width:"2",height:"1",rx:"0.5",fill:"currentColor"})]}))}function rF(t){return p.jsxs("svg",le(U({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),{children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.97634 1.4502H9.02405C9.70389 1.4502 10.2476 1.45019 10.687 1.48609C11.1379 1.52293 11.527 1.6003 11.8849 1.78263C12.4588 2.07504 12.9254 2.54164 13.2178 3.11553C13.4001 3.47338 13.4775 3.86253 13.5143 4.31342C13.5502 4.75277 13.5502 5.29652 13.5502 5.97637V8.02403C13.5502 8.70388 13.5502 9.24763 13.5143 9.68698C13.4775 10.1379 13.4001 10.527 13.2178 10.8849C12.9254 11.4588 12.4588 11.9254 11.8849 12.2178C11.527 12.4001 11.1379 12.4775 10.687 12.5143C10.2476 12.5502 9.70387 12.5502 9.02402 12.5502H4.97636C4.29651 12.5502 3.75276 12.5502 3.31341 12.5143C2.86252 12.4775 2.47337 12.4001 2.11552 12.2178C1.54163 11.9254 1.07504 11.4588 0.782626 10.8849C0.600293 10.527 0.522922 10.1379 0.486083 9.68698C0.450187 9.24764 0.45019 8.70389 0.450195 8.02405V5.97635C0.45019 5.29651 0.450187 4.75276 0.486083 4.31342C0.522922 3.86253 0.600293 3.47338 0.782626 3.11553C1.07504 2.54164 1.54163 2.07504 2.11552 1.78263C2.47337 1.6003 2.86252 1.52293 3.31341 1.48609C3.75276 1.45019 4.2965 1.4502 4.97634 1.4502ZM3.40298 2.58243C3.02012 2.61372 2.79184 2.67259 2.61491 2.76274C2.248 2.94969 1.94968 3.248 1.76273 3.61492C1.67258 3.79185 1.61371 4.02013 1.58243 4.40299C1.55062 4.79228 1.55019 5.29106 1.55019 6.0002V8.0002C1.55019 8.70934 1.55062 9.20812 1.58243 9.59741C1.61371 9.98028 1.67258 10.2086 1.76273 10.3855C1.94968 10.7524 2.248 11.0507 2.61491 11.2377C2.79184 11.3278 3.02012 11.3867 3.40298 11.418C3.79227 11.4498 4.29105 11.4502 5.00019 11.4502H9.00019C9.70933 11.4502 10.2081 11.4498 10.5974 11.418C10.9803 11.3867 11.2086 11.3278 11.3855 11.2377C11.7524 11.0507 12.0507 10.7524 12.2377 10.3855C12.3278 10.2086 12.3867 9.98028 12.418 9.59741C12.4498 9.20812 12.4502 8.70934 12.4502 8.0002V6.0002C12.4502 5.29106 12.4498 4.79228 12.418 4.40299C12.3867 4.02013 12.3278 3.79185 12.2377 3.61492C12.0507 3.248 11.7524 2.94969 11.3855 2.76274C11.2086 2.67259 10.9803 2.61372 10.5974 2.58243C10.2081 2.55063 9.70933 2.5502 9.00019 2.5502H5.00019C4.29105 2.5502 3.79227 2.55063 3.40298 2.58243Z",fill:"currentColor"}),p.jsx("rect",{x:"6.25",y:"6.75",width:"4.5",height:"0.5",rx:"0.25",stroke:"black",strokeWidth:"0.5"}),p.jsx("rect",{x:"3",y:"6.5",width:"2",height:"1",rx:"0.5",fill:"currentColor"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.1999 0.450195C4.50366 0.450195 4.7499 0.696438 4.7499 1.00019V2.75019C4.7499 3.05395 4.50366 3.30019 4.1999 3.30019C3.89614 3.30019 3.6499 3.05395 3.6499 2.75019V1.00019C3.6499 0.696438 3.89614 0.450195 4.1999 0.450195Z",fill:"currentColor"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.8 0.450195C10.1037 0.450195 10.35 0.696438 10.35 1.00019V2.75019C10.35 3.05395 10.1037 3.30019 9.8 3.30019C9.49625 3.30019 9.25 3.05395 9.25 2.75019V1.00019C9.25 0.696438 9.49625 0.450195 9.8 0.450195Z",fill:"currentColor"})]}))}function iF(t){return p.jsxs("svg",le(U({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),{children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.97634 1.4502H9.02405C9.70389 1.4502 10.2476 1.45019 10.687 1.48609C11.1379 1.52293 11.527 1.6003 11.8849 1.78263C12.4588 2.07504 12.9254 2.54164 13.2178 3.11553C13.4001 3.47338 13.4775 3.86253 13.5143 4.31342C13.5502 4.75277 13.5502 5.29652 13.5502 5.97637V8.02403C13.5502 8.70388 13.5502 9.24763 13.5143 9.68698C13.4775 10.1379 13.4001 10.527 13.2178 10.8849C12.9254 11.4588 12.4588 11.9254 11.8849 12.2178C11.527 12.4001 11.1379 12.4775 10.687 12.5143C10.2476 12.5502 9.70387 12.5502 9.02402 12.5502H4.97636C4.29651 12.5502 3.75276 12.5502 3.31341 12.5143C2.86252 12.4775 2.47337 12.4001 2.11552 12.2178C1.54163 11.9254 1.07504 11.4588 0.782626 10.8849C0.600293 10.527 0.522922 10.1379 0.486083 9.68698C0.450187 9.24764 0.45019 8.70389 0.450195 8.02405V5.97635C0.45019 5.29651 0.450187 4.75276 0.486083 4.31342C0.522922 3.86253 0.600293 3.47338 0.782626 3.11553C1.07504 2.54164 1.54163 2.07504 2.11552 1.78263C2.47337 1.6003 2.86252 1.52293 3.31341 1.48609C3.75276 1.45019 4.2965 1.4502 4.97634 1.4502ZM3.40298 2.58243C3.02012 2.61372 2.79184 2.67259 2.61491 2.76274C2.248 2.94969 1.94968 3.248 1.76273 3.61492C1.67258 3.79185 1.61371 4.02013 1.58243 4.40299C1.55062 4.79228 1.55019 5.29106 1.55019 6.0002V8.0002C1.55019 8.70934 1.55062 9.20812 1.58243 9.59741C1.61371 9.98028 1.67258 10.2086 1.76273 10.3855C1.94968 10.7524 2.248 11.0507 2.61491 11.2377C2.79184 11.3278 3.02012 11.3867 3.40298 11.418C3.79227 11.4498 4.29105 11.4502 5.00019 11.4502H9.00019C9.70933 11.4502 10.2081 11.4498 10.5974 11.418C10.9803 11.3867 11.2086 11.3278 11.3855 11.2377C11.7524 11.0507 12.0507 10.7524 12.2377 10.3855C12.3278 10.2086 12.3867 9.98028 12.418 9.59741C12.4498 9.20812 12.4502 8.70934 12.4502 8.0002V6.0002C12.4502 5.29106 12.4498 4.79228 12.418 4.40299C12.3867 4.02013 12.3278 3.79185 12.2377 3.61492C12.0507 3.248 11.7524 2.94969 11.3855 2.76274C11.2086 2.67259 10.9803 2.61372 10.5974 2.58243C10.2081 2.55063 9.70933 2.5502 9.00019 2.5502H5.00019C4.29105 2.5502 3.79227 2.55063 3.40298 2.58243Z",fill:"currentColor"}),p.jsx("rect",{x:"4.25",y:"8.25",width:"5.5",height:"0.5",rx:"0.25",stroke:"black",strokeWidth:"0.5"}),p.jsx("rect",{x:"6",y:"6",width:"2",height:"1",rx:"0.5",fill:"currentColor"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.1999 0.450195C4.50366 0.450195 4.7499 0.696438 4.7499 1.00019V2.75019C4.7499 3.05395 4.50366 3.30019 4.1999 3.30019C3.89614 3.30019 3.6499 3.05395 3.6499 2.75019V1.00019C3.6499 0.696438 3.89614 0.450195 4.1999 0.450195Z",fill:"currentColor"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.8 0.450195C10.1037 0.450195 10.35 0.696438 10.35 1.00019V2.75019C10.35 3.05395 10.1037 3.30019 9.8 3.30019C9.49625 3.30019 9.25 3.05395 9.25 2.75019V1.00019C9.25 0.696438 9.49625 0.450195 9.8 0.450195Z",fill:"currentColor"})]}))}var sF={title:"Logo with Text (Horizontal)",description:"Logo and a text horizontally",searchTerms:["logo","text"],icon:p.jsx(rF,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().deleteRange(e).insertContent({type:"columns",attrs:{showIfKey:null,gap:8},content:[{type:"column",attrs:{columnId:"36de3eda-0677-47c3-a8b7-e071dec9ce30",width:"auto",verticalAlign:"middle"},content:[{type:"image",attrs:{src:"https://maily.to/brand/logo.png",alt:null,title:null,width:"32",height:"32",alignment:"left",externalLink:null,isExternalLinkVariable:!1,isSrcVariable:!1,showIfKey:null}}]},{type:"column",attrs:{columnId:"6feb593e-374a-4479-a1c7-872c60c2f4e0",width:"auto",verticalAlign:"bottom"},content:[{type:"heading",attrs:{textAlign:"right",level:3,showIfKey:null},content:[{type:"text",marks:[{type:"bold"}],text:"Weekly Newsletter"}]}]}]}).run()}},oF={title:"Logo with Text (Vertical)",description:"Logo and a text vertically",searchTerms:["logo","text"],icon:p.jsx(iF,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().deleteRange(e).insertContent([{type:"image",attrs:{src:"https://maily.to/brand/logo.png",alt:null,title:null,width:"48",height:"48",alignment:"center",externalLink:null,isExternalLinkVariable:!1,isSrcVariable:!1,showIfKey:null}},{type:"spacer",attrs:{height:8,showIfKey:null}},{type:"heading",attrs:{textAlign:"center",level:2,showIfKey:null},content:[{type:"text",text:"Maily"}]}]).run()}},aF={title:"Logo with Cover Image",description:"Logo and a cover image",searchTerms:["logo","cover","image"],icon:p.jsx(nF,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{const n=new Date().toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});t.chain().deleteRange(e).insertContent([{type:"image",attrs:{src:"https://maily.to/og-image.png",alt:null,title:null,width:600,height:314,alignment:"center",externalLink:null,isExternalLinkVariable:!1,isSrcVariable:!1,showIfKey:null}},{type:"columns",attrs:{showIfKey:null,gap:8},content:[{type:"column",attrs:{columnId:"36de3eda-0677-47c3-a8b7-e071dec9ce30",width:"auto",verticalAlign:"middle"},content:[{type:"image",attrs:{src:"https://maily.to/brand/logo.png",alt:null,title:null,width:"48",height:"48",alignment:"left",externalLink:null,isExternalLinkVariable:!1,isSrcVariable:!1,showIfKey:null}}]},{type:"column",attrs:{columnId:"6feb593e-374a-4479-a1c7-872c60c2f4e0",width:"auto",verticalAlign:"middle"},content:[{type:"paragraph",attrs:{textAlign:"right",showIfKey:null},content:[{type:"text",marks:[{type:"bold"}],text:"Weekly Newsletter"},{type:"hardBreak"},{type:"text",marks:[{type:"textStyle",attrs:{color:"#929292"}}],text:n}]}]}]}]).run()}},lF={title:"Footer Copyright",description:"Copyright text for the footer.",searchTerms:["footer","copyright"],icon:p.jsx(n2,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{const n=new Date().getFullYear();t.chain().focus().deleteRange(e).insertContent({type:"paragraph",attrs:{textAlign:"center",showIfKey:null},content:[{type:"text",marks:[{type:"textStyle",attrs:{color:"#AAAAAA"}}],text:`Maily © ${n}. All rights reserved.`}]}).run()}},cF={title:"Footer Community Feedback CTA",description:"Community feedback CTA for the footer.",searchTerms:["footer","community","feedback","cta"],icon:p.jsx(vx,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).insertContent([{type:"image",attrs:{src:"https://maily.to/brand/logo.png",alt:null,title:null,width:"42",height:"42",alignment:"left",externalLink:null,isExternalLinkVariable:!1,isSrcVariable:!1,showIfKey:null}},{type:"spacer",attrs:{height:16,showIfKey:null}},{type:"footer",attrs:{textAlign:null,"maily-component":"footer"},content:[{type:"text",marks:[{type:"textStyle",attrs:{color:""}}],text:"Enjoyed this month’s update?"},{type:"hardBreak"},{type:"text",marks:[{type:"textStyle",attrs:{color:""}}],text:"And, as always, we'd love your feedback – simply reply to the email or reach out via the Discord community!"}]}]).run()}},dF={title:"Footer Company Signature",description:"Company signature for the footer.",searchTerms:["footer","company","signature"],icon:p.jsx(S2,{className:"mly:h-4 mly:w-4"}),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).insertContent([{type:"horizontalRule"},{type:"image",attrs:{src:"https://maily.to/brand/logo.png",alt:null,title:null,width:"48",height:"48",alignment:"center",externalLink:null,isExternalLinkVariable:!1,isSrcVariable:!1,showIfKey:null}},{type:"spacer",attrs:{height:16,showIfKey:null}},{type:"heading",attrs:{textAlign:"center",level:3,showIfKey:null},content:[{type:"text",text:"Maily"}]},{type:"spacer",attrs:{height:4,showIfKey:null}},{type:"footer",attrs:{textAlign:"center","maily-component":"footer"},content:[{type:"text",marks:[{type:"textStyle",attrs:{color:""}}],text:"1234 Example Street, Example, DE 19801, United States"},{type:"hardBreak"},{type:"text",marks:[{type:"link",attrs:{href:"https://maily.to",target:"_blank",rel:"noopener noreferrer nofollow",class:"mly:no-underline",isUrlVariable:!1}},{type:"textStyle",attrs:{color:"#64748b"}},{type:"underline"}],text:"VISIT COMPANY"},{type:"text",marks:[{type:"textStyle",attrs:{color:"#64748b"}}],text:" | "},{type:"text",marks:[{type:"link",attrs:{href:"https://maily.to",target:"_blank",rel:"noopener noreferrer nofollow",class:"mly:no-underline",isUrlVariable:!1}},{type:"textStyle",attrs:{color:"#64748b"}},{type:"underline"}],text:"VISIT OUR BLOG"},{type:"text",marks:[{type:"textStyle",attrs:{color:"#64748b"}}],text:" | "},{type:"text",marks:[{type:"link",attrs:{href:"https://maily.to",target:"_blank",rel:"noopener noreferrer nofollow",class:"mly:no-underline",isUrlVariable:!1}},{type:"textStyle",attrs:{color:"#64748b"}},{type:"underline"}],text:"UNSUBSCRIBE"}]},{type:"paragraph",attrs:{textAlign:"center",showIfKey:null},content:[{type:"inlineImage",attrs:{height:20,width:20,src:"https://cdn.usemaily.com/images/icons/linkedin.png",isSrcVariable:!1,alt:null,title:null,externalLink:"https://www.linkedin.com/in/arikchakma/",isExternalLinkVariable:!1}},{type:"text",text:" "},{type:"inlineImage",attrs:{height:20,width:20,src:"https://cdn.usemaily.com/images/icons/youtube.png",isSrcVariable:!1,alt:null,title:null,externalLink:"https://www.youtube.com/arikchakma",isExternalLinkVariable:!1}},{type:"text",text:" "},{type:"inlineImage",attrs:{height:20,width:20,src:"https://cdn.usemaily.com/images/icons/twitter.png",isSrcVariable:!1,alt:null,title:null,externalLink:"https://x.com/imarikchakma",isExternalLinkVariable:!1}}]}]).run()}},gp=[{title:"Blocks",commands:[q9,Y9,J9,X9,W9,G9,$9,j9,F9,H9,z9,U9,K9,V9,L9,P9,Z9,Q9,eF,tF]},{title:"Components",commands:[{id:"headers",title:"Headers",description:"Add pre-designed headers block",searchTerms:["header","headers"],icon:p.jsx(Ch,{className:"mly:h-4 mly:w-4"}),preview:"https://cdn.usemaily.com/previews/header-preview-xyz.png",commands:[oF,sF,aF]},{id:"footers",title:"Footers",description:"Add pre-designed footers block",searchTerms:["footers"],icon:p.jsx(Sh,{className:"mly:h-4 mly:w-4"}),commands:[lF,cF,dF]},B9]}],cd="https://maily.to/",HE=x.createContext({placeholderUrl:cd,blocks:gp});function uF(t){const e=t,{children:n}=e,r=Pn(e,["children"]);return p.jsx(HE.Provider,{value:r,children:n})}function zE(){const t=x.useContext(HE);if(!t)throw new Error("Missing MailyContext.Provider in the component tree");return t}var fF=x.forwardRef((t,e)=>{const{items:n,onSelectItem:r}=t,[i,s]=x.useState(0),o=x.useRef(null),a=x.useRef([]),l=c=>{const d=o.current,u=a.current[c];if(!d||!u)return;const f=d.getBoundingClientRect(),h=u.getBoundingClientRect(),m=4;h.bottom>f.bottom?d.scrollTop+=h.bottom-f.bottom+m:h.top<f.top&&(d.scrollTop+=h.top-f.top-m)};return x.useEffect(()=>{s(0),o.current&&(o.current.scrollTop=0),a.current=n.map(()=>null)},[n]),x.useEffect(()=>{l(i)},[i]),x.useImperativeHandle(e,()=>({moveUp:()=>{s((i+n.length-1)%n.length)},moveDown:()=>{s((i+1)%n.length)},select:()=>{const c=n[i];c&&r(c)}})),p.jsxs("div",{className:"mly:z-50 mly:w-64 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:shadow-md mly:transition-all",children:[p.jsxs("div",{className:"mly:flex mly:items-center mly:justify-between mly:gap-2 mly:border-b mly:border-gray-200 mly:bg-soft-gray/40 mly:px-1 mly:py-1.5 mly:text-gray-500",children:[p.jsx("span",{className:"mly:text-xs mly:uppercase",children:"Variables"}),p.jsx(Ua,{children:p.jsx(Ki,{className:"mly:size-3 mly:stroke-[2.5]"})})]}),p.jsx("div",{ref:o,className:"mly:max-h-52 mly:overflow-y-auto mly:scrollbar-thin mly:scrollbar-track-transparent mly:scrollbar-thumb-gray-200",children:p.jsx("div",{className:"mly:flex mly:w-fit mly:min-w-full mly:flex-col mly:gap-0.5 mly:p-1",children:n!=null&&n.length?n==null?void 0:n.map((c,d)=>p.jsxs("button",{ref:u=>a.current[d]=u,onClick:()=>r(c),className:ye("mly:flex mly:w-fit mly:min-w-full mly:items-center mly:gap-2 mly:rounded-md mly:px-2 mly:py-1 mly:text-left mly:font-mono mly:text-sm mly:text-gray-900 mly:hover:bg-soft-gray",d===i?"mly:bg-soft-gray":"mly:bg-white"),children:[p.jsx(Ki,{className:"mly:size-3 mly:stroke-[2.5] mly:text-rose-600"}),(c==null?void 0:c.label)||c.name]},d)):p.jsx("div",{className:"mly:flex mly:h-7 mly:w-full mly:items-center mly:gap-2 mly:rounded-md mly:px-2 mly:py-1 mly:text-left mly:font-mono mly:text-[13px] mly:text-gray-900 mly:hover:bg-soft-gray",children:"No result"})})}),p.jsxs("div",{className:"mly:flex mly:items-center mly:justify-between mly:gap-2 mly:border-t mly:border-gray-200 mly:px-1 mly:py-1.5 mly:text-gray-500",children:[p.jsxs("div",{className:"mly:flex mly:items-center mly:gap-1",children:[p.jsx(Ua,{children:p.jsx(LR,{className:"mly:size-3 mly:stroke-[2.5]"})}),p.jsx(Ua,{children:p.jsx(BR,{className:"mly:size-3 mly:stroke-[2.5]"})}),p.jsx("span",{className:"mly:text-xs mly:text-gray-500",children:"Navigate"})]}),p.jsx(Ua,{children:p.jsx(ux,{className:"mly:size-3 mly:stroke-[2.5]"})})]})]})});function Ua(t){const{className:e,children:n}=t;return p.jsx("div",{className:ye("mly:flex mly:size-5 mly:items-center mly:justify-center mly:rounded-md mly:border mly:border-gray-200",e),children:n})}function hF(t){const{node:e,updateAttributes:n,editor:r}=t,{id:i,fallback:s,required:o,hideDefaultValue:a=!1,label:l}=e.attrs,c=x.useMemo(()=>{var d,u;return(u=(d=_E(r,"variable"))==null?void 0:d.renderVariable)!=null?u:UE},[r]);return p.jsx(gi,{className:"react-component mly:inline-block mly:leading-none",draggable:"false",children:p.jsxs(rn,{onOpenChange:d=>{r.storage.variable.popover=d},children:[p.jsx(sn,{children:c({variable:{name:i,required:o,valid:!0,label:l},fallback:s,editor:r,from:"content-variable"})}),p.jsx(Kt,{align:"start",side:"bottom",className:"mly:w-max mly:rounded-lg mly:p-0.5!",sideOffset:8,onOpenAutoFocus:d=>d.preventDefault(),onCloseAutoFocus:d=>d.preventDefault(),children:p.jsx(Vt,{children:p.jsxs("div",{className:"mly:flex mly:items-stretch mly:text-midnight-gray",children:[p.jsxs("label",{className:"mly:relative",children:[p.jsx("span",{className:"mly:inline-block mly:px-2 mly:text-xs mly:text-midnight-gray",children:"Variable"}),p.jsx("input",le(U({},bs),{value:i??"",onChange:d=>{n({id:d.target.value})},placeholder:"ie. name...",className:"mly:h-7 mly:w-36 mly:rounded-md mly:bg-soft-gray mly:px-2 mly:text-sm mly:text-midnight-gray mly:focus:bg-soft-gray mly:focus:outline-hidden mly:disabled:cursor-not-allowed"}))]}),!a&&p.jsxs(p.Fragment,{children:[p.jsx(Ue,{className:"mly:mx-1.5"}),p.jsxs("label",{className:"mly:relative",children:[p.jsx("span",{className:"mly:inline-block mly:px-2 mly:pl-1 mly:text-xs mly:text-midnight-gray",children:"Default"}),p.jsx("input",le(U({},bs),{value:s??"",onChange:d=>{n({fallback:d.target.value})},placeholder:"ie. John Doe...",className:"mly:h-7 mly:w-32 mly:rounded-md mly:bg-soft-gray mly:px-2 mly:pr-6 mly:text-sm mly:text-midnight-gray mly:focus:bg-soft-gray mly:focus:outline-none"})),p.jsx("div",{className:"mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center",children:p.jsx(H2,{className:"mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray"})})]})]})]})})})]})})}var pF=t=>{const{variable:e,fallback:n,from:r}=t,{name:i,required:s,valid:o,label:a}=e,l=a||i;return r==="button-variable"?p.jsxs("div",{className:"mly:inline-grid mly:max-w-xs mly:grid-cols-[12px_1fr] mly:items-center mly:gap-1.5 mly:rounded-md mly:border mly:border-(--button-var-border-color) mly:px-2 mly:py-px mly:font-mono mly:text-xs",children:[p.jsx(Ki,{className:"mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]"}),p.jsx("span",{className:"mly:min-w-0 mly:truncate mly:text-left",children:l})]}):r==="bubble-variable"?p.jsxs("div",{className:ye("mly:inline-grid mly:h-7 mly:min-w-28 mly:max-w-xs mly:grid-cols-[12px_1fr] mly:items-center mly:gap-1.5 mly:rounded-md mly:border mly:border-gray-200 mly:px-2 mly:font-mono mly:text-sm mly:hover:bg-soft-gray",!o&&"mly:border-rose-400 mly:bg-rose-50 mly:text-rose-600 mly:hover:bg-rose-100"),children:[p.jsx(Ki,{className:"mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600"}),p.jsx("span",{className:"mly:min-w-0 mly:truncate mly:text-left",children:l})]}):p.jsxs("span",{tabIndex:-1,className:"mly:inline-flex mly:items-center mly:gap-(--variable-icon-gap) mly:rounded-full mly:border mly:border-gray-200 mly:px-1.5 mly:py-0.5 mly:leading-none",children:[p.jsx(Ki,{className:"mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600"}),l,s&&!n&&p.jsx(dI,{className:"mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5]"})]})},yp="@",mF=[],UE=pF,gF=fF,yF=new Be("variable"),VE=Je.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addStorage(){return{popover:!1}},addOptions(){return{variables:mF,variableSuggestionsPopover:gF,renderVariable:UE,disableInput:!1,renderLabel(t){var e;const{node:n}=t;return`${(e=n.attrs.label)!=null?e:n.attrs.id}`},suggestion:{char:"@",pluginKey:yF,command:({editor:t,range:e,props:n})=>{var r,i;const s=t.view.state.selection.$to.nodeAfter;((r=s==null?void 0:s.text)==null?void 0:r.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(i=window.getSelection())==null||i.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},fallback:{default:null,parseHTML:t=>t.getAttribute("data-fallback"),renderHTML:t=>t.fallback?{"data-fallback":t.fallback}:{}},required:{default:!0,parseHTML:t=>t.hasAttribute("data-required"),renderHTML:t=>{var e;return{"data-required":(e=t==null?void 0:t.required)!=null?e:!0}}},hideDefaultValue:{default:!1}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["div",Ae({"data-type":this.name},e),this.options.renderLabel({options:this.options,node:t})]},renderText({node:t}){return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:i,anchor:s}=r;return i?(e.doc.nodesBetween(s-1,s,(o,a)=>{if(o.type.name===this.name)return n=!0,t.insertText(this.options.suggestion.char||"",a,a+o.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[Qw(U({editor:this.editor},this.options.suggestion))]},addNodeView(){return yi(hF,{className:"mly:relative mly:inline-block",as:"div"})}});function vs(t){var e,n;const{defaultValue:r="",onValueChange:i,tooltip:s,icon:o=nf,editor:a,isVariable:l}=t,[c,d]=x.useState(!1),[u,f]=x.useState(!l),h=x.useRef(null),{placeholderUrl:m=cd}=zE(),g=xi(a),y=g==null?void 0:g.renderVariable,b=g==null?void 0:g.variables,w=(n=(e=g==null?void 0:g.suggestion)==null?void 0:e.char)!=null?n:yp,E=x.useMemo(()=>{const S=r.replace(new RegExp(w,"g"),"");return na(b,{query:S||"",from:"bubble-variable",editor:a}).map(k=>k.name)},[b,w,r,a]),v=p.jsx(sn,{asChild:!0,children:p.jsx(Rt,{variant:"ghost",size:"sm",type:"button",className:"mly:h-7! mly:w-7!","data-state":!!r,children:p.jsx(o,{className:"mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-midnight-gray"})})});return p.jsxs(rn,{open:c,onOpenChange:S=>{d(S),S&&setTimeout(()=>{var k;(k=h.current)==null||k.focus()},0)},children:[s?p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:v}),p.jsx(xt,{sideOffset:8,children:s})]}):v,p.jsx(Kt,{align:"end",side:"top",className:"mly:w-max mly:rounded-none mly:border-none mly:bg-transparent mly:p-0! mly:shadow-none",sideOffset:8,onCloseAutoFocus:S=>S.preventDefault(),children:p.jsx("form",{onSubmit:S=>{S.preventDefault();const k=h.current;k&&(i==null||i(k.value),d(!1))},children:p.jsxs("div",{className:"mly:isolate mly:flex mly:rounded-lg",children:[!u&&p.jsx("div",{className:"mly:flex mly:h-8 mly:items-center mly:rounded-lg mly:border mly:border-gray-300 mly:bg-white mly:px-0.5",children:p.jsx("button",{onClick:()=>{f(!0),setTimeout(()=>{var S;(S=h.current)==null||S.focus()},0)},children:y({variable:{name:r,valid:!0},fallback:"",from:"bubble-variable",editor:a})})}),u&&p.jsxs("div",{className:"mly:relative",children:[p.jsx("div",{className:"mly:absolute mly:inset-y-0 mly:left-1.5 mly:z-10 mly:flex mly:items-center",children:p.jsx(nf,{className:"mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray"})}),p.jsx(ra,{editor:a,value:r,onValueChange:S=>{i==null||i(S)},autoCompleteOptions:E,ref:h,placeholder:m,className:"-mly:ms-px mly:block mly:h-8 mly:w-56 mly:rounded-lg mly:border mly:border-gray-300 mly:px-2 mly:py-1.5 mly:pl-6 mly:pr-6 mly:text-sm mly:shadow-sm mly:outline-hidden mly:placeholder:text-gray-400",triggerChar:w,onSelectOption:S=>{var k;const C=(k=E.includes(S))!=null?k:!1;C&&f(!1),i==null||i(S,C),d(!1)}})]})]})})})]})}function Af(t){const{value:e,onValueChange:n,dimension:r}=t;return p.jsxs("label",{className:"mly:relative mly:flex mly:items-center",children:[p.jsx("span",{className:"mly:absolute mly:inset-y-0 mly:left-2 mly:flex mly:items-center mly:text-xs mly:leading-none mly:text-gray-400",children:r==="width"?"W":"H"}),p.jsx("input",le(U({},bs),{className:"hide-number-controls mly:h-auto mly:max-w-20 mly:appearance-none mly:border-0 mly:border-none mly:p-1 mly:px-[26px] mly:text-sm mly:uppercase mly:tabular-nums mly:outline-hidden mly:focus-visible:outline-hidden",type:"number",value:e,onChange:i=>n(i.target.value)})),p.jsx("span",{className:"mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center mly:text-xs mly:leading-none mly:text-gray-400",children:"PX"})]})}var bF=t=>In({editor:t,selector:({editor:n})=>{var r,i,s,o,a,l,c,d,u,f,h,m,g,y,b,w;return{width:String(n.getAttributes("image").width),height:String(n.getAttributes("image").height),isImageActive:n.isActive("image"),isLogoActive:n.isActive("logo"),alignment:((r=n.getAttributes("image"))==null?void 0:r.alignment)||((i=n.getAttributes("logo"))==null?void 0:i.alignment),borderRadius:(s=n.getAttributes("image"))==null?void 0:s.borderRadius,logoSize:((o=n.getAttributes("logo"))==null?void 0:o.size)||jE,imageSrc:((a=n.getAttributes("image"))==null?void 0:a.src)||((l=n.getAttributes("logo"))==null?void 0:l.src)||"",isSrcVariable:(f=(u=(c=n.getAttributes("image"))==null?void 0:c.isSrcVariable)!=null?u:(d=n.getAttributes("logo"))==null?void 0:d.isSrcVariable)!=null?f:!1,imageExternalLink:((h=n.getAttributes("image"))==null?void 0:h.externalLink)||"",isExternalLinkVariable:(m=n.getAttributes("image"))==null?void 0:m.isExternalLinkVariable,lockAspectRatio:(g=n.getAttributes("image"))==null?void 0:g.lockAspectRatio,aspectRatio:(y=n.getAttributes("image"))==null?void 0:y.aspectRatio,currentShowIfKey:((b=n.getAttributes("image"))==null?void 0:b.showIfKey)||((w=n.getAttributes("logo"))==null?void 0:w.showIfKey)||""}},equalityFn:$r});function vF(t){var e,n,r,i;const{editor:s,appendTo:o}=t;if(!s)return null;const a=bF(s),l=le(U(U({},t),o?{appendTo:o.current}:{}),{shouldShow:({editor:d})=>d.isEditable?d.isActive("logo")||d.isActive("image"):!1,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},plugins:[mi],sticky:"popper",maxWidth:"100%"}}),{lockAspectRatio:c}=a;return p.jsx(rr,le(U({},l),{className:"mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsxs(Vt,{children:[a.isLogoActive&&a.imageSrc&&p.jsxs(p.Fragment,{children:[p.jsx(Cn,{label:"Size",tooltip:"Size",value:a.logoSize,options:M9.map(d=>({value:d,label:d})),onValueChange:d=>{s==null||s.chain().focus().setLogoAttributes({size:d}).run()}}),p.jsx(Ue,{})]}),p.jsxs("div",{className:"mly:flex mly:gap-x-0.5",children:[p.jsx(ld,{alignment:a.alignment,onAlignmentChange:d=>{a.isImageActive?s==null||s.chain().focus().updateAttributes("image",{alignment:d}).run():s==null||s.chain().focus().setLogoAttributes({alignment:d}).run()}}),p.jsx(vs,{defaultValue:(e=a==null?void 0:a.imageSrc)!=null?e:"",onValueChange:(d,u)=>{a.isLogoActive?s==null||s.chain().setLogoAttributes({src:d,isSrcVariable:u??!1}).run():s==null||s.chain().updateAttributes("image",{src:d,isSrcVariable:u??!1}).run()},tooltip:"Source URL",icon:mx,editor:s,isVariable:a.isSrcVariable}),a.isImageActive&&p.jsx(vs,{defaultValue:(n=a==null?void 0:a.imageExternalLink)!=null?n:"",onValueChange:(d,u)=>{s==null||s.chain().updateAttributes("image",{externalLink:d,isExternalLinkVariable:u??!1}).run()},tooltip:"External URL",editor:s,isVariable:a.isExternalLinkVariable})]}),a.isImageActive&&a.imageSrc&&p.jsxs(p.Fragment,{children:[p.jsx(Ue,{}),p.jsx(Cn,{label:"Border Radius",value:a==null?void 0:a.borderRadius,options:D9.map(d=>({value:String(d.value),label:d.name})),onValueChange:d=>{s==null||s.chain().updateAttributes("image",{borderRadius:Number(d)}).run()},tooltip:"Border Radius",className:"mly:capitalize"}),p.jsxs("div",{className:"mly:flex mly:gap-x-0.5",children:[p.jsx(Af,{dimension:"width",value:(r=a==null?void 0:a.width)!=null?r:"",onValueChange:d=>{const u=Math.min(Number(d)||0,$E),f=Number(a.height)||0,h=Number(a.width)||0,m=a.aspectRatio&&isFinite(a.aspectRatio)&&a.aspectRatio>0,g=m?a.aspectRatio:f>0?h/f:1,y=!a.height||a.height==="auto",b=(c||y)&&d&&(m||f>0);s==null||s.chain().updateAttributes("image",U({width:String(u)},b?{height:String(Tf(u,g))}:{})).run()}}),p.jsx(Af,{dimension:"height",value:(i=a==null?void 0:a.height)!=null?i:"",onValueChange:d=>{const u=Number(d)||0,f=Number(a.height)||0,h=Number(a.width)||0,m=a.aspectRatio&&isFinite(a.aspectRatio)&&a.aspectRatio>0,g=m?a.aspectRatio:f>0?h/f:1,y=!a.width||a.width==="auto",b=(c||y)&&d&&(m||h>0);s==null||s.chain().updateAttributes("image",U({height:String(u)},b?{width:String(N9(u,g))}:{})).run()}}),p.jsx(cn,{isActive:()=>c,command:()=>{const d=Number(a.width)||0,u=Number(a.height)||0,f=d/u;s==null||s.chain().updateAttributes("image",{lockAspectRatio:!c,aspectRatio:f}).run()},icon:c?I2:O2,tooltip:"Lock Aspect Ratio"})]})]}),p.jsx(Ue,{}),p.jsx(wi,{showIfKey:a.currentShowIfKey,onShowIfKeyValueChange:d=>{s==null||s.chain().updateAttributes(a.isLogoActive?"logo":"image",{showIfKey:d}).run()},editor:s})]})}))}var bp=20,vp=20,KE=Je.create({name:"inlineImage",inline:!0,group:"inline",selectable:!1,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{height:{default:bp},width:{default:vp},src:{default:null},isSrcVariable:{default:!1,renderHTML(t){return t.isSrcVariable?{"data-is-src-variable":"true"}:{}}},alt:{default:null},title:{default:null},externalLink:{default:null,renderHTML(t){return t.externalLink?{"data-external-link":t.externalLink}:{}}},isExternalLinkVariable:{default:!1,renderHTML(t){return t.isExternalLinkVariable?{"data-is-external-link-variable":"true"}:{}}}}},parseHTML(){return[{tag:`img[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["img",Ae(this.options.HTMLAttributes,t,{"data-type":this.name,class:"mly:relative",style:`display: inline; --mly-inline-image-height: ${t.height}px; --mly-inline-image-width: ${t.width}px; margin:0; vertical-align: middle;`,draggable:"false",loading:"lazy"})]},addCommands(){return{setInlineImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addProseMirrorPlugins(){return[new $e({key:new Be("inlineImage"),props:{handleClickOn:(t,e,n)=>{if(n.type!==this.type)return!1;const r=e,i=e+n.nodeSize;return this.editor.commands.setTextSelection({from:r,to:i}),!0}}})]}}),xF=t=>In({editor:t,selector:({editor:n})=>{var r,i,s,o,a,l,c,d;return{height:((r=n.getAttributes("inlineImage"))==null?void 0:r.height)||bp,width:((i=n.getAttributes("inlineImage"))==null?void 0:i.width)||vp,src:((s=n.getAttributes("inlineImage"))==null?void 0:s.src)||"",isSrcVariable:(a=(o=n.getAttributes("inlineImage"))==null?void 0:o.isSrcVariable)!=null?a:!1,imageExternalLink:((l=n.getAttributes("inlineImage"))==null?void 0:l.externalLink)||"",isExternalLinkVariable:(d=(c=n.getAttributes("inlineImage"))==null?void 0:c.isExternalLinkVariable)!=null?d:!1}},equalityFn:$r});function wF(t){var e,n;const{editor:r,appendTo:i}=t;if(!r)return null;const s=xF(r),o=le(U(U({},t),i?{appendTo:i.current}:{}),{shouldShow:({editor:a})=>a.isEditable?a.isActive("inlineImage"):!1,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},plugins:[mi],sticky:"popper",maxWidth:"100%"}});return p.jsx(rr,le(U({},o),{className:"mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsx(Vt,{children:p.jsxs("div",{className:"mly:flex mly:gap-x-0.5",children:[p.jsx(vs,{defaultValue:(e=s==null?void 0:s.src)!=null?e:"",onValueChange:(a,l)=>{r==null||r.chain().updateAttributes("inlineImage",{src:a,isSrcVariable:l??!1}).run()},tooltip:"Source URL",icon:mx,editor:r,isVariable:s.isSrcVariable}),p.jsx(vs,{defaultValue:(n=s==null?void 0:s.imageExternalLink)!=null?n:"",onValueChange:(a,l)=>{r==null||r.chain().updateAttributes("inlineImage",{externalLink:a,isExternalLinkVariable:l??!1}).run()},tooltip:"External URL",editor:r,isVariable:s.isExternalLinkVariable}),p.jsx(Af,{dimension:"height",value:s==null?void 0:s.height,onValueChange:a=>{r==null||r.chain().updateAttributes("inlineImage",{width:a||vp,height:a||bp}).run()}})]})})}))}var EF=t=>In({editor:t,selector:n=>{var r,i;return{each:(r=n.editor.getAttributes("repeat"))==null?void 0:r.each,currentShowIfKey:((i=n.editor.getAttributes("repeat"))==null?void 0:i.showIfKey)||"",isSectionActive:n.editor.isActive("section")}},equalityFn:$r});function kF(t){const{appendTo:e,editor:n}=t;if(!n)return null;const r=EF(n),i=x.useCallback(()=>{const g=od(n,"repeat");return(g==null?void 0:g.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},[n]),s=le(U(U({},t),e?{appendTo:e.current}:{}),{shouldShow:({editor:g})=>{var y;const b=nr(g,"repeat"),E=(b?(y=es(b==null?void 0:b.node,v=>v.type.name==="section"))==null?void 0:y[0]:null)&&g.isActive("section");return ad(g)||E||!g.isEditable?!1:g.isActive("repeat")},tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:i,appendTo:()=>e==null?void 0:e.current,plugins:[mi],sticky:"popper",maxWidth:"auto"},pluginKey:"repeatBubbleMenu"}),o=xi(n),a=o==null?void 0:o.variables,l=o==null?void 0:o.renderVariable,c=x.useRef(null),[d,u]=x.useState(!1),f=(r==null?void 0:r.each)||"",h=x.useMemo(()=>na(a,{query:f||"",editor:n,from:"repeat-variable"}).map(g=>g.name),[a,f,n]),m=f;return p.jsx(rr,le(U({},s),{className:"mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsxs(Vt,{children:[p.jsxs("div",{className:"mly:flex mly:items-center mly:gap-1.5 mly:px-1.5 mly:text-sm mly:leading-none",children:["Repeat",p.jsxs(Nt,{children:[p.jsx(Tt,{children:p.jsx(gx,{className:ye("mly:size-3 mly:stroke-[2.5] mly:text-gray-500")})}),p.jsx(xt,{sideOffset:14,className:"mly:max-w-[260px]",align:"start",children:"Ensure the selected variable is iterable, such as an array of objects."})]})]}),!d&&p.jsx("button",{onClick:()=>{u(!0),setTimeout(()=>{var g;(g=c.current)==null||g.focus()},0)},children:l({variable:{name:r==null?void 0:r.each,valid:m},fallback:"",from:"bubble-variable",editor:n})}),d&&p.jsx("form",{onSubmit:g=>{g.preventDefault(),u(!1)},onKeyDown:g=>{g.key==="Escape"&&u(!1)},children:p.jsx(ra,{editor:n,placeholder:"ie. payload.items",value:(r==null?void 0:r.each)||"",onValueChange:g=>{n.commands.updateRepeat({each:g})},onOutsideClick:()=>{u(!1)},onSelectOption:g=>{n.commands.updateRepeat({each:g}),u(!1)},autoCompleteOptions:h,ref:c})}),p.jsx(Ue,{}),p.jsx(wi,{showIfKey:r.currentShowIfKey,onShowIfKeyValueChange:g=>{n.commands.updateRepeat({showIfKey:g})},editor:n})]})}))}function SF(t){const e=t,{topBarClassName:n}=e,r=Pn(e,["topBarClassName"]);return p.jsxs("svg",le(U({width:11,height:12,viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),{children:[p.jsx("path",{d:"M0 11H10.6667",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M0.666504 9V6.33333C0.666504 3.38781 3.05432 1 5.99984 1H10.6665",strokeWidth:"1.5",className:n})]}))}function CF(t){return p.jsx("svg",le(U({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),{children:p.jsx("path",{d:"M10.5 10.499V1.49902M1.5 10.499V1.49902M4.5 5.99902C4.5 5.53308 4.5 5.30011 4.57612 5.11634C4.67761 4.87131 4.87229 4.67664 5.11732 4.57514C5.30109 4.49902 5.53406 4.49902 6 4.49902C6.46594 4.49902 6.69891 4.49902 6.88268 4.57514C7.12771 4.67664 7.32239 4.87131 7.42388 5.11634C7.5 5.30011 7.5 5.53308 7.5 5.99902C7.5 6.46496 7.5 6.69794 7.42388 6.88171C7.32239 7.12673 7.12771 7.32141 6.88268 7.4229C6.69891 7.49902 6.46594 7.49902 6 7.49902C5.53406 7.49902 5.30109 7.49902 5.11732 7.4229C4.87229 7.32141 4.67761 7.12673 4.57612 6.88171C4.5 6.69794 4.5 6.46496 4.5 5.99902Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}))}function _F(t){return p.jsx("svg",le(U({width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),{children:p.jsx("path",{d:"M9.50244 0.501526L9.10244 0.501526C8.54239 0.501526 8.26236 0.501526 8.04845 0.610519C7.86029 0.706392 7.70731 0.859373 7.61144 1.04754C7.50244 1.26145 7.50244 1.54147 7.50244 2.10153V7.90153C7.50244 8.46158 7.50244 8.74161 7.61144 8.95552C7.70731 9.14368 7.86029 9.29666 8.04845 9.39253C8.26236 9.50153 8.54239 9.50153 9.10244 9.50153H9.50244M0.502441 0.501527L0.902441 0.501527C1.46249 0.501527 1.74252 0.501527 1.95643 0.61052C2.14459 0.706393 2.29757 0.859374 2.39345 1.04754C2.50244 1.26145 2.50244 1.54147 2.50244 2.10153L2.50244 7.90153C2.50244 8.46158 2.50244 8.74161 2.39345 8.95552C2.29757 9.14368 2.14459 9.29666 1.95643 9.39253C1.74252 9.50153 1.46249 9.50153 0.902442 9.50153H0.502442M4.99994 7.99903V1.99903",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}))}function Uo(t){const{color:e,onColorChange:n,borderColor:r,backgroundColor:i,tooltip:s,className:o,children:a,onClose:l,suggestedColors:c=[]}=t,d=f=>{queueMicrotask(()=>{n(f)})},u=p.jsx(sn,{asChild:!0,children:a||p.jsx(Rt,{variant:"ghost",className:"mly:h-7 mly:w-7 mly:shrink-0",size:"sm",type:"button",children:p.jsx("div",{className:ye("mly:h-4 mly:w-4 mly:shrink-0 mly:rounded mly:border-2 mly:border-gray-700",o),style:le(U({},r?{borderColor:r}:{}),{backgroundColor:i||"transparent"})})})});return p.jsxs(rn,{onOpenChange:f=>{f||l==null||l(e)},children:[s?p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:u}),p.jsx(xt,{sideOffset:8,children:s})]}):u,p.jsx(Kt,{className:"mly:w-full mly:rounded-none mly:border-0 mly:bg-transparent! mly:p-0! mly:shadow-none mly:drop-shadow-md",sideOffset:8,children:p.jsxs("div",{className:"mly:min-w-[260px] mly:rounded-xl mly:border mly:border-gray-200 mly:bg-white mly:p-4",children:[p.jsx(wB,{color:e,onChange:d,className:"mly:flex mly:w-full! mly:flex-col mly:gap-4"}),p.jsx(SB,{alpha:!0,color:e,onChange:d,className:"mly:mt-4 mly:w-full mly:min-w-0 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:px-2 mly:py-1.5 mly:text-sm mly:uppercase mly:focus-visible:border-gray-400 mly:focus-visible:outline-hidden",prefixed:!0}),c.length>0&&p.jsxs("div",{children:[p.jsx("div",{className:"-mly:mx-4 mly:my-4 mly:h-px mly:bg-gray-200"}),p.jsx("h2",{className:"mly:text-xs mly:text-gray-500",children:"Recently used"}),p.jsx("div",{className:"mly:mt-2 mly:flex mly:flex-wrap mly:gap-0.5",children:c.map(f=>p.jsx(Rt,{variant:"ghost",size:"sm",className:"!mly:size-7 mly:shrink-0",type:"button",onClick:()=>d(f),children:p.jsx("div",{className:"mly:h-4 mly:w-4 mly:shrink-0 mly:rounded",style:{backgroundColor:f}})},f))})]})]})})]})}var NF=t=>In({editor:t,selector:n=>{var r,i,s,o,a,l,c,d,u,f,h,m,g,y;return{currentAlignment:((r=n.editor.getAttributes("section"))==null?void 0:r.align)||"left",currentBorderRadius:Number((i=n.editor.getAttributes("section"))==null?void 0:i.borderRadius)||0,currentBackgroundColor:((s=n.editor.getAttributes("section"))==null?void 0:s.backgroundColor)||DE,currentBorderColor:((o=n.editor.getAttributes("section"))==null?void 0:o.borderColor)||LE,currentBorderWidth:Number((a=n.editor.getAttributes("section"))==null?void 0:a.borderWidth)||0,currentMarginTop:Number((l=n.editor.getAttributes("section"))==null?void 0:l.marginTop)||0,currentMarginRight:Number((c=n.editor.getAttributes("section"))==null?void 0:c.marginRight)||0,currentMarginBottom:Number((d=n.editor.getAttributes("section"))==null?void 0:d.marginBottom)||0,currentMarginLeft:Number((u=n.editor.getAttributes("section"))==null?void 0:u.marginLeft)||0,currentPaddingTop:Number((f=n.editor.getAttributes("section"))==null?void 0:f.paddingTop)||0,currentPaddingRight:Number((h=n.editor.getAttributes("section"))==null?void 0:h.paddingRight)||0,currentPaddingBottom:Number((m=n.editor.getAttributes("section"))==null?void 0:m.paddingBottom)||0,currentPaddingLeft:Number((g=n.editor.getAttributes("section"))==null?void 0:g.paddingLeft)||0,isColumnsActive:n.editor.isActive("columns"),currentShowIfKey:((y=n.editor.getAttributes("section"))==null?void 0:y.showIfKey)||""}},equalityFn:$r});function TF(t){const{appendTo:e,editor:n}=t;if(!n)return null;const r=x.useCallback(()=>{const a=od(n,"section");return(a==null?void 0:a.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},[n]),i=le(U(U({},t),e?{appendTo:e.current}:{}),{shouldShow:({editor:a})=>{var l,c;const d=nr(a,"section"),u=d?(l=es(d==null?void 0:d.node,g=>g.type.name==="repeat"))==null?void 0:l[0]:null,f=d?(c=es(d==null?void 0:d.node,g=>g.type.name==="inlineImage"))==null?void 0:c[0]:null,h=u&&a.isActive("repeat"),m=f&&a.isActive("inlineImage");return ad(a)||h||m||!a.isEditable?!1:a.isActive("section")},tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,appendTo:()=>e==null?void 0:e.current,plugins:[mi],sticky:"popper",maxWidth:"auto"},pluginKey:"sectionBubbleMenu"}),s=NF(n),o=[{value:"0",label:"Sharp"},{value:"6",label:"Smooth"},{value:"9999",label:"Round"}];return p.jsx(rr,le(U({},i),{className:"mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsxs(Vt,{children:[p.jsx(ld,{alignment:s.currentAlignment,onAlignmentChange:a=>{var l;(l=n==null?void 0:n.commands)==null||l.updateSection({align:a})}}),p.jsx(Ue,{}),p.jsxs("div",{className:"mly:flex mly:gap-x-0.5",children:[p.jsx(Cn,{label:"Border Radius",value:String(s.currentBorderRadius),options:o,onValueChange:a=>{var l;(l=n==null?void 0:n.commands)==null||l.updateSection({borderRadius:Number(a)})},tooltip:"Border Radius",className:"mly:capitalize"}),p.jsx(Cn,{label:"Border Width",value:String(s.currentBorderWidth),options:[{value:"0",label:"None"},{value:"1",label:"Thin"},{value:"2",label:"Medium"},{value:"3",label:"Thick"}],onValueChange:a=>{var l;(l=n==null?void 0:n.commands)==null||l.updateSection({borderWidth:Number(a)})},tooltip:"Border Width",className:"mly:capitalize"})]}),p.jsx(Ue,{}),p.jsx(Cn,{icon:CF,iconClassName:"mly:stroke-[1.2] mly:size-3.5",label:"Margin",value:String(s.currentMarginTop),options:[{value:"0",label:"None"},...zo.map(a=>({label:a.name,value:String(a.value)}))],onValueChange:a=>{var l;const c=Number(a);(l=n==null?void 0:n.commands)==null||l.updateSection({marginTop:c,marginRight:c,marginBottom:c,marginLeft:c})},tooltip:"Margin",className:"mly:capitalize"}),p.jsx(Ue,{}),p.jsx(Cn,{icon:_F,iconClassName:"mly:stroke-[1]",label:"Padding",value:String(s.currentPaddingTop),options:[{value:"0",label:"None"},...zo.map(a=>({label:a.name,value:String(a.value)}))],onValueChange:a=>{var l;const c=Number(a);(l=n==null?void 0:n.commands)==null||l.updateSection({paddingTop:c,paddingRight:c,paddingBottom:c,paddingLeft:c})},tooltip:"Padding",className:"mly:capitalize"}),p.jsx(Ue,{}),p.jsxs("div",{className:"mly:flex mly:gap-x-0.5",children:[p.jsx(Uo,{color:s.currentBorderColor,onColorChange:a=>{var l;(l=n==null?void 0:n.commands)==null||l.updateSection({borderColor:a})},tooltip:"Border Color",children:p.jsx(Rt,{variant:"ghost",className:"mly:h-7 mly:w-7 mly:shrink-0",size:"sm",type:"button",children:p.jsx(SF,{className:"mly:size-3 mly:shrink-0",topBarClassName:"mly:stroke-midnight-gray",style:{color:s.currentBorderColor}})})}),p.jsx(Uo,{color:s.currentBackgroundColor,onColorChange:a=>{var l;(l=n==null?void 0:n.commands)==null||l.updateSection({backgroundColor:a})},backgroundColor:s.currentBackgroundColor,tooltip:"Background Color",className:"mly:rounded-full mly:border-[1.5px] mly:border-white mly:shadow"})]}),p.jsx(Ue,{}),p.jsx(cn,{icon:Ex,tooltip:"Delete Section",command:()=>{TE(n,"section")}}),p.jsx(Ue,{}),p.jsx(wi,{showIfKey:s.currentShowIfKey,onShowIfKeyValueChange:a=>{n.commands.updateSection({showIfKey:a})},editor:n}),s.isColumnsActive&&p.jsxs(p.Fragment,{children:[p.jsx(Ue,{}),p.jsxs(rn,{children:[p.jsxs(sn,{className:"mly:flex mly:items-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray",children:["Column",p.jsx(WR,{className:"mly:h-3 mly:w-3"})]}),p.jsx(Kt,{className:"mly:w-max mly:rounded-lg mly:p-0.5!",side:"top",sideOffset:8,align:"end",onOpenAutoFocus:a=>{a.preventDefault()},onCloseAutoFocus:a=>{a.preventDefault()},children:p.jsx(AE,{editor:n})})]})]})]})}))}var AF=t=>In({editor:t,selector:n=>{var r;return{currentShowIfKey:((r=n.editor.getAttributes("spacer"))==null?void 0:r.showIfKey)||""}},equalityFn:$r});function MF(t){const{editor:e,appendTo:n}=t;if(!e)return null;const r=x.useMemo(()=>zo.map(o=>{const{value:a,short:l}=o;return{name:l,isActive:()=>e==null?void 0:e.isActive("spacer",{height:a}),command:()=>{e==null||e.chain().focus().setSpacer({height:a}).run()}}}),[e]),i=le(U(U({},t),n?{appendTo:n.current}:{}),{shouldShow:({editor:o})=>o.isEditable?o.isActive("spacer"):!1,tippyOptions:{maxWidth:"100%",moveTransition:"mly:transform 0.15s mly:ease-out"}}),s=AF(e);return p.jsx(rr,le(U({},i),{className:"mly:flex mly:gap-0.5 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsxs(Vt,{children:[r.map((o,a)=>p.jsx(cn,U({className:"!mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",iconClassName:"mly:w-3 mly:h-3",nameClassName:"mly:text-xs"},o),a)),p.jsx(Ue,{}),p.jsx(wi,{showIfKey:s.currentShowIfKey,onShowIfKeyValueChange:o=>{e.commands.setSpacerShowIfKey(o)},editor:e})]})}))}var Yy=8,WE=Je.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addAttributes(){return{showIfKey:{default:Qe,parseHTML:t=>t.getAttribute("data-show-if-key")||Qe,renderHTML(t){return t.showIfKey?{"data-show-if-key":t.showIfKey}:{}}},gap:{default:Yy,parseHTML:t=>Number(t.style.gap)||Yy,renderHTML(t){return t.gap?{style:`gap: ${t.gap}px`}:{}}}}},addCommands(){return{setColumns:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{},content:[{type:"column",attrs:{columnId:wo()},content:[{type:"paragraph"}]},{type:"column",attrs:{columnId:wo()},content:[{type:"paragraph"}]}]}),updateColumns:t=>As(this.name,t)}},renderHTML({HTMLAttributes:t}){return["div",Ae(t,{"data-type":"columns",class:"mly:relative"}),0]},parseHTML(){return[{tag:'div[data-type="columns"]'}]},addKeyboardShortcuts(){return{Tab:()=>Iy(this.editor,"next"),"Shift-Tab":()=>Iy(this.editor,"previous")}}}),GE=r1.extend({addInputRules(){return[new Go({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{const n={},{tr:r}=t,i=e.from,s=e.to;r.insert(i-1,this.type.create(n)).delete(r.mapping.map(i),r.mapping.map(s))}})]},addOptions(){return{HTMLAttributes:{class:"mly:relative"}}}}),qE=8,YE=Je.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:qE,parseHTML:t=>Number(t.getAttribute("data-height")),renderHTML:t=>({"data-height":t.height})},showIfKey:{default:Qe,parseHTML:t=>t.getAttribute("data-show-if-key")||Qe,renderHTML(t){return t.showIfKey?{"data-show-if-key":t.showIfKey}:{}}}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>e.updateAttributes("spacer",{height:t}),setSpacerShowIfKey:t=>({commands:e})=>e.updateAttributes("spacer",{showIfKey:t}),unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){const{height:n}=e.attrs;return["div",Ae({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer mly:relative mly:full mly:z-50",contenteditable:!1,style:`height: ${n}px;--spacer-height: ${n}px;`})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}}),Wr=x.forwardRef((t,e)=>{var n=t,{className:r,type:i}=n,s=Pn(n,["className","type"]);return p.jsx("input",U(le(U({},bs),{type:i,className:ye("mly:flex mly:h-10 mly:w-full mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:px-3 mly:py-2 mly:text-sm mly:ring-offset-white mly:file:border-0 mly:file:bg-transparent mly:file:text-sm mly:file:font-medium mly:placeholder:text-gray-500 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2 mly:disabled:cursor-not-allowed mly:disabled:opacity-50","mly-editor",r),ref:e}),s))});Wr.displayName="Input";var JE=x.forwardRef((t,e)=>{var n=t,{className:r}=n,i=Pn(n,["className"]);return p.jsx("textarea",U({className:ye("mly:flex mly:min-h-24 mly:w-full mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:px-3 mly:py-2 mly:text-sm mly:ring-offset-white mly:file:border-0 mly:file:bg-transparent mly:file:text-sm mly:file:font-medium mly:placeholder:text-gray-500 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2 mly:disabled:cursor-not-allowed mly:disabled:opacity-50","mly-editor",r),ref:e},i))});JE.displayName="Textarea";function OF(t){const{title:e,description:n,link:r,linkTitle:i,image:s,badgeText:o,subTitle:a}=t.node.attrs,{getPos:l,editor:c}=t;return p.jsx(gi,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:c.isEditable,"data-drag-handle":c.isEditable,children:p.jsxs(rn,{open:t.selected,children:[p.jsx(sn,{asChild:!0,children:p.jsx("div",{tabIndex:-1,onClick:d=>{d.preventDefault();const u=l();c.commands.setNodeSelection(u)},children:p.jsxs("div",{className:"mly:no-prose mly:flex mly:flex-col mly:rounded-lg mly:border mly:border-gray-300",children:[s&&p.jsx("div",{className:"mly:relative mly:mb-1.5 mly:w-full mly:shrink-0",children:p.jsx("img",{src:s,alt:"link-card",className:"mly:no-prose mly:mb-0! mly:h-full mly:w-full mly:rounded-t-lg",draggable:c.isEditable})}),p.jsx("div",{className:"mly:flex mly:items-stretch mly:p-3",children:p.jsxs("div",{className:ye("mly:flex mly:flex-col"),children:[p.jsxs("div",{className:"!mly:mb-1.5 mly:flex mly:items-center mly:gap-1.5",children:[p.jsx("h2",{className:"!mly:mb-0 mly:text-lg! mly:font-semibold",children:e}),o&&p.jsx("span",{className:"!mly:font-base mly:rounded-md mly:bg-yellow-200 mly:px-2 mly:py-1 mly:font-semibold mly:leading-none text-xs",children:o})," ",a&&!o&&p.jsx("span",{className:"!mly:font-base mly:font-regular mly:rounded-md mly:leading-none mly:text-gray-400 text-xs",children:a})]}),p.jsxs("p",{className:"!mly:my-0 mly:text-base! mly:text-gray-500",children:[n," ",i?p.jsx("a",{href:r,className:"mly:font-semibold",children:i}):null]})]})})]})})}),p.jsxs(Kt,{align:"end",className:"mly:flex mly:w-96 mly:flex-col mly:gap-2",sideOffset:10,onOpenAutoFocus:d=>d.preventDefault(),onCloseAutoFocus:d=>d.preventDefault(),children:[p.jsxs("label",{className:"mly:w-full mly:space-y-1",children:[p.jsx("span",{className:"mly:text-xs mly:font-normal mly:text-slate-400",children:"Image"}),p.jsx(Wr,{placeholder:"Add Image",type:"url",value:s,onChange:d=>{t.updateAttributes({image:d.target.value})}})]}),p.jsxs("label",{className:"mly:w-full mly:space-y-1",children:[p.jsx("span",{className:"mly:text-xs mly:font-normal mly:text-slate-400",children:"Title"}),p.jsx(Wr,{placeholder:"Add title",value:e,onChange:d=>{t.updateAttributes({title:d.target.value})}})]}),p.jsxs("label",{className:"mly:w-full mly:space-y-1",children:[p.jsx("span",{className:"mly:text-xs mly:font-normal mly:text-slate-400",children:"Description"}),p.jsx(JE,{placeholder:"Add description here",value:n,onChange:d=>{t.updateAttributes({description:d.target.value})}})]}),p.jsxs("div",{className:"mly:grid mly:grid-cols-2 mly:gap-2",children:[p.jsxs("label",{className:"mly:w-full mly:space-y-1",children:[p.jsx("span",{className:"mly:text-xs mly:font-normal mly:text-slate-400",children:"Link Title"}),p.jsx(Wr,{placeholder:"Add link title here",value:i,onChange:d=>{t.updateAttributes({linkTitle:d.target.value})}})]}),p.jsxs("label",{className:"mly:w-full mly:space-y-1",children:[p.jsx("span",{className:"mly:text-xs mly:font-normal mly:text-slate-400",children:"Link"}),p.jsx(Wr,{placeholder:"Add link here",value:r,onChange:d=>{t.updateAttributes({link:d.target.value})}})]})]}),p.jsxs("div",{className:"mly:grid mly:grid-cols-2 mly:gap-2",children:[p.jsxs("label",{className:"mly:w-full mly:space-y-1",children:[p.jsx("span",{className:"mly:text-xs mly:font-normal mly:text-slate-400",children:"Badge Text"}),p.jsx(Wr,{placeholder:"Add badge text here",value:o,onChange:d=>{t.updateAttributes({badgeText:d.target.value})}})]}),p.jsxs("label",{className:"mly:w-full mly:space-y-1",children:[p.jsx("span",{className:"mly:text-xs mly:font-normal mly:text-slate-400",children:"Sub Title"}),p.jsx(Wr,{placeholder:"Add sub title here",value:a,onChange:d=>{t.updateAttributes({subTitle:d.target.value})}})]})]})]})]})})}var XE=Je.create({name:"linkCard",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"linkCard"},title:{default:""},description:{default:""},link:{default:""},linkTitle:{default:""},image:{default:""},subTitle:{default:""},badgeText:{default:""}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",Ae({"data-maily-component":this.name},t)]},addCommands(){return{setLinkCard:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return yi(OF,{className:"mly:relative"})}});function RF(t){var e,n;const{value:r,onValueChange:i,isVariable:s,editor:o}=t,a=x.useRef(null),[l,c]=x.useState(!s),{placeholderUrl:d=cd}=zE(),u=xi(o),f=u==null?void 0:u.variables,h=(n=(e=u==null?void 0:u.suggestion)==null?void 0:e.char)!=null?n:yp,m=u==null?void 0:u.renderVariable,g=x.useMemo(()=>{const y=r.replace(new RegExp(h,"g"),"");return na(f,{query:y||"",from:"bubble-variable",editor:o}).map(b=>b.name)},[f,r,o]);return p.jsxs("div",{className:"mly:isolate mly:flex mly:rounded-lg",children:[!l&&p.jsx("button",{onClick:()=>{c(!0),setTimeout(()=>{var y;(y=a.current)==null||y.focus()},0)},children:m({variable:{name:r,valid:!0},fallback:"",from:"bubble-variable",editor:o})}),l&&p.jsx(ra,{editor:o,value:r,onValueChange:y=>{i==null||i(y)},autoCompleteOptions:g,ref:a,placeholder:d,className:"mly:h-7 mly:w-40 mly:rounded-md mly:px-2 mly:pr-6 mly:text-sm mly:text-midnight-gray mly:hover:bg-soft-gray mly:focus:bg-soft-gray mly:focus:outline-hidden",triggerChar:h,onSelectOption:y=>{var b;const w=(b=g.includes(y))!=null?b:!1;w&&c(!1),i==null||i(y,w)}})]})}function IF(t){const{node:e,editor:n,getPos:r,updateAttributes:i}=t,{text:s,isTextVariable:o,alignment:a,variant:l,borderRadius:c,buttonColor:d,textColor:u,url:f,showIfKey:h="",isUrlVariable:m,paddingTop:g,paddingRight:y,paddingBottom:b,paddingLeft:w}=e.attrs,E=xi(n),v=E==null?void 0:E.renderVariable,S=x.useMemo(()=>({small:{paddingX:24,paddingY:6},medium:{paddingX:32,paddingY:10},large:{paddingX:40,paddingY:14}}),[]),k=x.useMemo(()=>{var C;return(C=Object.entries(S).find(([,{paddingX:T,paddingY:M}])=>y===T&&g===M))==null?void 0:C[0]},[y,g,S]);return p.jsx(gi,{draggable:n.isEditable,"data-drag-handle":n.isEditable,"data-type":"button",style:{textAlign:a},children:p.jsxs(rn,{open:t.selected&&n.isEditable,children:[p.jsx(sn,{asChild:!0,children:p.jsx("div",{children:p.jsx("button",{className:ye("mly:inline-flex mly:items-center mly:justify-center mly:rounded-md mly:text-sm mly:font-medium mly:ring-offset-white mly:transition-colors mly:disabled:pointer-events-none mly:disabled:opacity-50","mly:font-semibold mly:no-underline",{"mly:rounded-full!":c==="round","mly:rounded-md!":c==="smooth","mly:rounded-none!":c==="sharp"}),tabIndex:-1,style:{backgroundColor:l==="filled"?d||"var(--mly-button-background-color)":"transparent",color:u||"var(--mly-button-text-color)",borderWidth:2,borderStyle:"solid",borderColor:d||"var(--mly-button-background-color)","--button-var-border-color":u?`${u}80`:"color-mix(in srgb, var(--mly-button-text-color) 80%, transparent)",paddingTop:g||"var(--mly-button-padding-top)",paddingRight:y||"var(--mly-button-padding-right)",paddingBottom:b||"var(--mly-button-padding-bottom)",paddingLeft:w||"var(--mly-button-padding-left)"},onClick:C=>{if(C.preventDefault(),!n.isEditable)return;const T=r();n.commands.setNodeSelection(T)},children:o?v({variable:{name:s,valid:!0},fallback:s,from:"button-variable",editor:n}):s})})}),p.jsx(Kt,{align:"end",side:"top",className:"mly:w-max mly:rounded-lg mly:p-0.5!",sideOffset:8,onOpenAutoFocus:C=>C.preventDefault(),onCloseAutoFocus:C=>C.preventDefault(),children:p.jsx(Vt,{children:p.jsxs("div",{className:"mly:flex mly:items-stretch mly:text-midnight-gray",children:[p.jsx(RF,{value:s,onValueChange:(C,T)=>{i({text:C,isTextVariable:T??!1})},isVariable:o,editor:n}),p.jsx(Ue,{}),p.jsxs("div",{className:"mly:flex mly:gap-x-0.5",children:[p.jsx(Cn,{label:"Border Radius",value:c,options:UF.map(C=>({value:C,label:C})),onValueChange:C=>{i({borderRadius:C})},tooltip:"Border Radius",className:"mly:capitalize"}),p.jsx(Cn,{label:"Style",value:l,options:zF.map(C=>({value:C,label:C})),onValueChange:C=>{i({variant:C})},tooltip:"Style",className:"mly:capitalize"}),p.jsx(Cn,{label:"Size",value:k,options:[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],onValueChange:C=>{const{paddingX:T,paddingY:M}=S[C];i({paddingTop:M,paddingRight:T,paddingBottom:M,paddingLeft:T})},tooltip:"Size",placeholder:"Size"})]}),p.jsx(Ue,{}),p.jsxs("div",{className:"mly:flex mly:gap-x-0.5",children:[p.jsx(ld,{alignment:a,onAlignmentChange:C=>{i({alignment:C})}}),p.jsx(vs,{defaultValue:f||"",onValueChange:(C,T)=>{i({url:C,isUrlVariable:T??!1})},tooltip:"Update External Link",editor:n,isVariable:m})]}),p.jsx(Ue,{}),p.jsxs("div",{className:"mly:flex mly:gap-x-0.5",children:[p.jsx(DF,{variant:l,color:d||"transparent",onChange:C=>{i({buttonColor:C})}}),p.jsx(LF,{color:u||"transparent",onChange:C=>{i({textColor:C})}})]}),p.jsx(Ue,{}),p.jsx(wi,{showIfKey:h,onShowIfKeyValueChange:C=>{i({showIfKey:C})},editor:n})]})})})]})})}function DF(t){const{color:e,onChange:n,variant:r}=t;return p.jsx(Uo,{color:e,onColorChange:n,tooltip:"Background Color",children:p.jsx(Rt,{variant:"ghost",size:"sm",type:"button",className:"mly:size-7",children:p.jsx("div",{className:"mly:h-4 mly:w-4 mly:shrink-0 mly:rounded-full mly:shadow",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:2,borderColor:r==="filled"?"white":e}})})})}function LF(t){const{color:e,onChange:n}=t;return p.jsx(Uo,{color:e,onColorChange:n,tooltip:"Text Color",children:p.jsx(Rt,{variant:"ghost",size:"sm",type:"button",className:"mly:size-7",children:p.jsxs("div",{className:"mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px",children:[p.jsx("span",{className:"mly:font-bolder mly:font-mono mly:text-xs mly:text-midnight-gray",children:"A"}),p.jsx("div",{className:"mly:h-[2px] mly:w-3 mly:shrink-0 mly:rounded-md mly:shadow",style:{backgroundColor:e}})]})})})}var Jy="left",Xy="filled",Zy="smooth",PF=null,BF=null,$F=null,jF=null,FF=null,HF=null,zF=["filled","outline"],UF=["sharp","smooth","round"],ZE=Je.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{text:{default:"Button",parseHTML:t=>t.getAttribute("data-text")||"",renderHTML:t=>({"data-text":t.text})},isTextVariable:{default:!1,parseHTML:t=>t.getAttribute("data-is-text-variable")==="true",renderHTML:t=>t.isTextVariable?{"data-is-text-variable":"true"}:{}},url:{default:"",parseHTML:t=>t.getAttribute("data-url")||"",renderHTML:t=>({"data-url":t.url})},isUrlVariable:{default:!1,parseHTML:t=>t.getAttribute("data-is-url-variable")==="true",renderHTML:t=>t.isUrlVariable?{"data-is-url-variable":"true"}:{}},alignment:{default:Jy,parseHTML:t=>t.getAttribute("data-alignment")||Jy,renderHTML:t=>({"data-alignment":t.alignment})},variant:{default:Xy,parseHTML:t=>t.getAttribute("data-variant")||Xy,renderHTML:t=>({"data-variant":t.variant})},borderRadius:{default:Zy,parseHTML:t=>t.getAttribute("data-border-radius")||Zy,renderHTML:t=>({"data-border-radius":t.borderRadius})},showIfKey:{default:Qe,parseHTML:t=>t.getAttribute("data-show-if-key")||Qe,renderHTML(t){return t.showIfKey?{"data-show-if-key":t.showIfKey}:{}}},buttonColor:PF,textColor:BF,paddingTop:$F,paddingRight:jF,paddingBottom:FF,paddingLeft:HF}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",Ae(t,{"data-type":this.name})]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{},content:[]}),updateButton:t=>As(this.name,t)}},addNodeView(){return yi(IF,{contentDOMElementTag:"div",className:"mly:relative"})}}),VF=0,QE=Wh.extend({addAttributes(){var t;return le(U({},(t=this.parent)==null?void 0:t.call(this)),{width:{default:"auto",parseHTML:e=>{var n,r,i;return e.getAttribute("width")||((i=((n=e.style)==null?void 0:n.width)||((r=e.style)==null?void 0:r.inlineSize))==null?void 0:i.replace("px",""))||null},renderHTML:({width:e})=>({width:e})},height:{default:"auto",parseHTML:e=>{var n,r,i;return e.getAttribute("height")||((i=((n=e.style)==null?void 0:n.height)||((r=e.style)==null?void 0:r.blockSize))==null?void 0:i.replace("px",""))||null},renderHTML:({height:e})=>({height:e})},alignment:{default:"center",renderHTML:({alignment:e})=>({"data-alignment":e}),parseHTML:e=>e.getAttribute("data-alignment")||"center"},externalLink:{default:null,renderHTML:({externalLink:e})=>e?{"data-external-link":e}:{},parseHTML:e=>{const n=e.getAttribute("data-external-link");return n?{externalLink:n}:null}},isExternalLinkVariable:{default:!1,parseHTML:e=>e.getAttribute("data-is-external-link-variable")==="true",renderHTML:e=>e.isExternalLinkVariable?{"data-is-external-link-variable":"true"}:{}},borderRadius:{default:VF,parseHTML:e=>Number(e.getAttribute("data-border-radius")),renderHTML:e=>({"data-border-radius":e.borderRadius})},isSrcVariable:{default:!1,parseHTML:e=>e.getAttribute("data-is-src-variable")==="true",renderHTML:e=>e.isSrcVariable?{"data-is-src-variable":"true"}:{}},aspectRatio:{default:null,parseHTML:e=>e.getAttribute("data-aspect-ratio")||null,renderHTML:e=>e!=null&&e.aspectRatio?{"data-aspect-ratio":e==null?void 0:e.aspectRatio}:{}},lockAspectRatio:{default:!0,parseHTML:e=>e.getAttribute("data-lock-aspect-ratio")==="true",renderHTML:e=>e.lockAspectRatio?{"data-lock-aspect-ratio":"true"}:{}},showIfKey:{default:Qe,parseHTML:e=>e.getAttribute("data-show-if-key")||Qe,renderHTML(e){return e.showIfKey?{"data-show-if-key":e.showIfKey}:{}}}})},addNodeView(){return yi(T9,{className:"mly:relative"})}});function KF(t){const{node:e,updateAttributes:n}=t;let{language:r,activeTab:i="code"}=e.attrs;i||(i="code");const s=r?`language-${r}`:"",o=x.useMemo(()=>{const l=e.content.content.reduce((m,g)=>{if(g.type.name==="text")return m+g.text;if(g.type.name==="variable"){const{id:y,fallback:b}=(g==null?void 0:g.attrs)||{},w=b?`{{${y},fallback=${b}}}`:`{{${y}}}`;return m+w}return m},""),d=new DOMParser().parseFromString(l,"text/html"),u=d.querySelectorAll("style"),f=d.body;return`<style>${Array.from(u).map(m=>m.innerHTML).join(`
|
|
495
|
+
`)}</style>${f.innerHTML}`},[i]),a=o==="";return p.jsxs(gi,{draggable:!1,"data-drag-handle":!1,"data-type":"htmlCodeBlock",children:[i==="code"&&p.jsx("pre",{className:"mly:my-0 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-2 mly:text-black",children:p.jsx(mv,{as:"code",className:ye("is-editable",s)})}),i==="preview"&&p.jsx("div",{className:ye("mly:not-prose mly:rounded-lg mly:border mly:border-gray-200 mly:p-2",a&&"mly:min-h-[42px]"),ref:l=>{if(!l||l!=null&&l.shadowRoot)return;const c=l.attachShadow({mode:"open"}),d=new CSSStyleSheet;d.replaceSync(`
|
|
496
|
+
* { font-family: 'Inter', sans-serif; }
|
|
497
|
+
blockquote, h1, h2, h3, img, li, ol, p, ul {
|
|
498
|
+
margin-top: 0;
|
|
499
|
+
margin-bottom: 0;
|
|
500
|
+
}
|
|
501
|
+
`),c.adoptedStyleSheets=[d];const u=document.createElement("div");u.innerHTML=o,c.appendChild(u)},contentEditable:!1,onClick:()=>{a&&n({activeTab:"code"})}})]})}var WF=K5.extend({addStorage(){return{colors:new Set}}}),GF=["ltr","rtl"],dn="ltr",qF=ip.extend({addAttributes(){var t;return le(U({},((t=this==null?void 0:this.parent)==null?void 0:t.call(this))||{}),{textDirection:{default:dn,parseHTML:e=>e.getAttribute("data-text-direction")||e.getAttribute("dir")||dn,renderHTML(e){return!e.textDirection||e.textDirection===dn?{}:{"data-text-direction":e.textDirection,dir:e.textDirection}}},showIfKey:{default:Qe,parseHTML:e=>e.getAttribute("data-show-if-key")||Qe,renderHTML(e){return e.showIfKey?{"data-show-if-key":e.showIfKey}:{}}}})},addCommands(){var t;return le(U({},(t=this.parent)==null?void 0:t.call(this)),{setTextDirection:e=>({commands:n})=>n.updateAttributes(this.name,{textDirection:e})})}}),Qy=Je.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")},textDirection:{default:dn,parseHTML:t=>t.getAttribute("data-text-direction")||t.getAttribute("dir")||dn,renderHTML(t){return!t.textDirection||t.textDirection===dn?{}:{"data-text-direction":t.textDirection,dir:t.textDirection}}}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name),setFooterTextDirection:t=>({commands:e})=>e.updateAttributes("footer",{textDirection:t})}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",Ae(this.options.HTMLAttributes,t,{class:"footer mly:block mly:text-[13px] mly:text-slate-500 mly:relative"}),0]}}),YF=dj.extend({addAttributes(){var t;return le(U({},(t=this.parent)==null?void 0:t.call(this)),{isUrlVariable:{default:!1}})},addCommands(){var t;return le(U({},(t=this.parent)==null?void 0:t.call(this)),{setIsUrlVariable:e=>({chain:n})=>n().setMark("link",{isUrlVariable:e}).run()})}}),JF=rp.extend({addAttributes(){var t;return le(U({},((t=this==null?void 0:this.parent)==null?void 0:t.call(this))||{}),{textDirection:{default:dn,parseHTML:e=>e.getAttribute("data-text-direction")||e.getAttribute("dir")||dn,renderHTML(e){return!e.textDirection||e.textDirection===dn?{}:{"data-text-direction":e.textDirection,dir:e.textDirection}}},showIfKey:{default:Qe,parseHTML:e=>e.getAttribute("data-show-if-key")||Qe,renderHTML(e){return e.showIfKey?{"data-show-if-key":e.showIfKey}:{}}}})}});function XF(t){const{editor:e,getPos:n}=t;return p.jsxs(gi,{"data-type":"repeat",draggable:e.isEditable,"data-drag-handle":e.isEditable,className:"mly:relative",children:[p.jsx(mv,{className:"is-editable"}),p.jsxs("div",{role:"button","data-repeat-indicator":"",className:"mly:absolute mly:inset-y-0 mly:right-0 mly:flex mly:translate-x-full mly:cursor-pointer mly:flex-col mly:items-center mly:gap-1 mly:opacity-60",contentEditable:!1,onClick:()=>{e.commands.setNodeSelection(n())},children:[p.jsx(xx,{className:"mly:size-3 mly:stroke-[2.5] mly:text-midnight-gray"}),p.jsx("div",{className:"mly:w-[1.5px] mly:grow mly:rounded-full mly:bg-rose-300"})]})]})}var ek=Je.create({name:"repeat",group:"block",content:"(block|columns)+",draggable:!0,isolating:!0,addAttributes(){return{each:{default:"items",parseHTML:t=>t.getAttribute("each")||"",renderHTML:t=>t.each?{each:t.each}:{}},isUpdatingKey:{default:!1},showIfKey:{default:Qe,parseHTML:t=>t.getAttribute("data-show-if-key")||Qe,renderHTML(t){return t.showIfKey?{"data-show-if-key":t.showIfKey}:{}}}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",Ae(t,{"data-type":this.name}),0]},addCommands(){return{setRepeat:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{},content:[{type:"paragraph"}]}),updateRepeat:t=>As(this.name,t)}},addNodeView(){return yi(XF,{contentDOMElementTag:"div",className:"mly:relative"})}}),ZF=We.create({name:"maily-kit",addOptions(){return{link:{HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:"mly:no-underline"},openOnClick:!1}}},addExtensions(){const t=[Y1.extend({content:"(block|columns)+"}),P$.configure({code:{HTMLAttributes:{class:"mly:px-1 mly:relative mly:py-0.5 mly:bg-[#efefef] mly:text-sm mly:rounded-md mly:tracking-normal mly:font-normal"}},blockquote:{HTMLAttributes:{class:"mly:not-prose mly:border-l-4 mly:border-gray-300 mly:pl-4 mly:mt-4 mly:mb-4 mly:relative"}},bulletList:{HTMLAttributes:{class:"mly:relative"}},orderedList:{HTMLAttributes:{class:"mly:relative"}},heading:!1,paragraph:!1,horizontalRule:!1,dropcursor:!1,document:!1}),$$,WF.configure({types:[yy.name,nE.name]}),yy.configure(),B$.configure({types:[ip.name,rp.name,Qy.name]}),GE,Qy,j$,J1.configure({color:"#555",width:3,class:"ProseMirror-dropcursor"}),JF.configure({levels:[1,2,3],HTMLAttributes:{class:"mly:relative"}}),qF.configure({HTMLAttributes:{class:"mly:relative"}})];return this.options.linkCard!==!1&&t.push(XE.configure(this.options.linkCard)),this.options.repeat!==!1&&t.push(ek),this.options.section!==!1&&t.push(PE),this.options.columns!==!1&&t.push(WE),this.options.column!==!1&&t.push(pE),this.options.button!==!1&&t.push(ZE),this.options.spacer!==!1&&t.push(YE),this.options.logo!==!1&&t.push(FE),this.options.image!==!1&&t.push(QE),this.options.link!==!1&&t.push(YF.configure(this.options.link)),t}}),QF=uj.configure({placeholder:({node:t})=>t.type.name==="heading"?`Heading ${t.attrs.level}`:t.type.name==="htmlCodeBlock"?"Type your HTML code...":["columns","column","section","repeat","show","blockquote"].includes(t.type.name)?"":"Write something or / to see commands",includeChildren:!0}),eH=We.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Qw(U({editor:this.editor},this.options.suggestion))]}});function tH(t){var e;const{item:n,groupIndex:r,commandIndex:i,selectedGroupIndex:s,selectedCommandIndex:o,editor:a,activeCommandRef:l,selectItem:c,hoveredItemKey:d,onHover:u}=t,[f,h]=x.useState(!1),m=r===s&&i===o,g=`${r}-${i}`,y=d===g,b=n&&"commands"in n,w=!!(n!=null&&n.preview)&&(y||m&&!d),v=typeof n.render=="function"?(e=n.render)==null?void 0:e.call(n,a):null;let S=p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"mly:flex mly:h-6 mly:w-6 mly:shrink-0 mly:items-center mly:justify-center",children:n.icon}),p.jsxs("div",{className:"mly:grow",children:[p.jsx("p",{className:"mly:font-medium",children:n.title}),p.jsx("p",{className:"mly:text-xs mly:text-gray-400",children:n.description})]}),b&&p.jsx("span",{className:"mly:block mly:px-1 mly:text-gray-400",children:p.jsx(VR,{className:"mly:size-3.5 mly:stroke-[2.5]"})})]});v!==null&&v!==!0&&(S=v);const k=x.useRef(0),C=x.useCallback(()=>{window.clearTimeout(k.current);const T=200;k.current=window.setTimeout(()=>{h(!0),k.current=0},T)},[h]);return x.useEffect(()=>{w?C():(window.clearTimeout(k.current),k.current=0,h(!1))},[w]),x.useEffect(()=>()=>{k.current&&(window.clearTimeout(k.current),k.current=0)},[]),p.jsxs(Nt,{open:f,children:[p.jsx(Tt,{asChild:!0,children:p.jsx("button",{className:ye("mly:flex mly:w-full mly:items-center mly:gap-2 mly:rounded-md mly:px-2 mly:py-1 mly:text-left mly:text-sm mly:text-gray-900 mly:hover:bg-gray-100 mly:hover:text-gray-900",m?"mly:bg-gray-100 mly:text-gray-900":"mly:bg-transparent"),onClick:()=>c(r,i),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),type:"button",ref:m?l:null,children:S})}),p.jsx(xt,{side:"right",sideOffset:10,className:"mly:w-52 mly:rounded-lg mly:border-none mly:p-1 mly:shadow",children:typeof n.preview=="function"?n==null?void 0:n.preview(a):p.jsxs(p.Fragment,{children:[p.jsx("figure",{className:"mly:relative mly:aspect-[2.5] mly:w-full mly:overflow-hidden mly:rounded-md mly:border mly:border-gray-200",children:p.jsx("img",{src:n==null?void 0:n.preview,alt:n==null?void 0:n.title,className:"mly:absolute mly:inset-0 mly:h-full mly:w-full mly:object-cover"})}),p.jsx("p",{className:"mly:mt-2 mly:px-0.5 mly:text-gray-500",children:n.description})]})})]},`${r}-${i}`)}function nH(t){const{groups:e,query:n,editor:r}=t,i=[...e];let s=n==null?void 0:n.toLowerCase();const o=s.match(/^([^.]+)\./);if(o){const[l,c]=o,d=rH(e,c);if(d){const u=s.slice(l.length),f=d.commands.filter(h=>!u||ol(h,u));return f.length?[le(U({},d),{commands:f})]:[]}}return i.map(l=>le(U({},l),{commands:l.commands.flatMap(c=>sH({item:c,search:s,editor:r}))})).filter(l=>l.commands.length>0)}function rH(t,e){return t.flatMap(n=>n.commands).find(n=>{var r;return"commands"in n&&((r=n.id)==null?void 0:r.toLowerCase())===e.toLowerCase()})}function xu(t,e){return t?t.toLowerCase().includes(e.toLowerCase()):!1}function ol(t,e){var n,r;return xu(t.title,e)||xu(t.description,e)||((r=(n=t.searchTerms)==null?void 0:n.some(i=>xu(i,e)))!=null?r:!1)}function iH(t){return"commands"in t&&Array.isArray(t.commands)&&!!t.id}function sH(t){var e,n,r,i;const{item:s,search:o,editor:a}=t;if(((e=s==null?void 0:s.render)==null?void 0:e.call(s,a))===null)return[];const c=o.length>0;if(iH(s)){const d=le(U({},s),{command:h=>{const{editor:m,range:g}=h;m.chain().focus().insertContentAt(g,`/${s.id}.`).run()}});return ol(d,o)?[d]:((r=(n=d==null?void 0:d.commands)==null?void 0:n.some(h=>ol(h,o)))!=null?r:!1)?(i=d==null?void 0:d.commands)!=null?i:[]:[]}return!c||ol(s,o)?[s]:[]}var oH=x.forwardRef((t,e)=>{const{items:n,command:r,editor:i,range:s,query:o}=t,[a,l]=x.useState(0),[c,d]=x.useState(0),[u,f]=x.useState(null),h=x.useRef(""),m=x.useRef(0),g=x.useRef(0),y=x.useCallback((E,v)=>{const S=n[E].commands[v];S&&r(S)},[r]);x.useImperativeHandle(e,()=>({onKeyDown:({event:E})=>{var v,S,k,C;if(["ArrowUp","ArrowDown","Enter","ArrowLeft","ArrowRight"].includes(E.key)){let M=c,D=a;switch(E.key){case"ArrowLeft":E.preventDefault();const F=n==null?void 0:n[a];return F&&"id"in F?(i.chain().focus().insertContentAt(s,`/${h.current}`).run(),setTimeout(()=>{l(m.current),d(g.current)},0),!0):!1;case"ArrowRight":E.preventDefault();const z=(S=(v=n==null?void 0:n[a])==null?void 0:v.commands)==null?void 0:S[c];return z&&"commands"in z?(y(a,c),h.current=o,m.current=a,g.current=c,!0):!1;case"Enter":return n.length?(y(a,c),h.current=o,m.current=a,g.current=c,!0):!1;case"ArrowUp":return n.length?(M=c-1,D=a,M<0&&(D=a-1,M=((k=n[D])==null?void 0:k.commands.length)-1||0),D<0&&(D=n.length-1,M=((C=n[D])==null?void 0:C.commands.length)-1||0),l(D),d(M),!0):!1;case"ArrowDown":if(!n.length)return!1;const G=n[a].commands;return M=c+1,D=a,G.length-1<M&&(M=0,D=a+1),n.length-1<D&&(D=0),l(D),d(M),!0;default:return!1}}}}));const b=x.useRef(null),w=x.useRef(null);return x.useLayoutEffect(()=>{const E=b==null?void 0:b.current,v=w==null?void 0:w.current;if(!E||!v)return;const{offsetTop:S,offsetHeight:k}=v;E.style.transition="none",E.scrollTop=S-k},[a,c,b,w]),x.useEffect(()=>{l(0),d(0)},[n]),x.useEffect(()=>()=>{h.current="",m.current=0,g.current=0},[]),!n||n.length===0?null:p.jsx(Vt,{children:p.jsxs("div",{className:"mly:z-50 mly:w-72 mly:overflow-hidden mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:shadow-md mly:transition-all",children:[p.jsx("div",{id:"slash-command",ref:b,className:"mly:no-scrollbar mly:h-auto mly:max-h-[330px] mly:overflow-y-auto",children:n.map((E,v)=>p.jsxs(x.Fragment,{children:[p.jsx("span",{className:ye("mly:block mly:border-b mly:border-gray-200 mly:bg-soft-gray mly:p-2 mly:text-xs mly:uppercase mly:text-gray-400",v>0?"mly:border-t":""),children:E.title}),p.jsx("div",{className:"mly:space-y-0.5 mly:p-1",children:E.commands.map((S,k)=>{const C=`${v}-${k}`;return p.jsx(tH,{item:S,groupIndex:v,commandIndex:k,selectedGroupIndex:a,selectedCommandIndex:c,selectItem:()=>y(v,k),editor:i,activeCommandRef:w,hoveredItemKey:u,onHover:T=>f(T?C:null)},C)})})]},v))}),p.jsx("div",{className:"mly:border-t mly:border-gray-200 mly:px-1 mly:py-3 mly:pl-4",children:p.jsxs("div",{className:"mly:flex mly:items-center",children:[p.jsxs("p",{className:"mly:text-center mly:text-xs mly:text-gray-400",children:[p.jsx("kbd",{className:"mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium",children:"↑"}),p.jsx("kbd",{className:"mly:ml-1 mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium",children:"↓"})," ","to navigate"]}),p.jsx("span",{"aria-hidden":"true",className:"mly:select-none mly:px-1",children:"·"}),p.jsxs("p",{className:"mly:text-center mly:text-xs mly:text-gray-400",children:[p.jsx("kbd",{className:"mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-1.5 mly:font-medium",children:"Enter"})," ","to select"]})]})})]})})});function aH(t=gp){return{items:({query:e,editor:n})=>nH({query:e,editor:n,groups:t}),allow:({editor:e})=>!e.isActive("htmlCodeBlock"),render:()=>{let e,n=null;return{onStart:r=>{e=new dh(oH,{props:r,editor:r.editor}),n=Br("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start"})},onUpdate:r=>{var i;const s=n==null?void 0:n[0];!s||(i=s==null?void 0:s.state)!=null&&i.isDestroyed||(e==null||e.updateProps(r),s.setProps({getReferenceClientRect:r.clientRect}))},onKeyDown:r=>{var i,s;if(r.event.key==="Escape"){const o=n==null?void 0:n[0];return(i=o==null?void 0:o.state)!=null&&i.isDestroyed||o==null||o.destroy(),e==null||e.destroy(),!0}return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(r)},onExit:()=>{if(!n||!(n!=null&&n[0])||!e)return;const r=n==null?void 0:n[0];r.state.isDestroyed||r.destroy(),e==null||e.destroy()}}}}}var tk=x.forwardRef((t,e)=>{var n;const{items:r=[],editor:i}=t,s=x.useRef(null),o=(n=xi(i))==null?void 0:n.variableSuggestionsPopover;return x.useImperativeHandle(e,()=>({onKeyDown:({event:a})=>{if(!s.current)return!1;const{moveUp:l,moveDown:c,select:d}=s.current||{};return a.key==="ArrowUp"?(a.preventDefault(),l(),!0):a.key==="ArrowDown"?(a.preventDefault(),c(),!0):a.key==="Enter"?(d(),!0):!1}})),p.jsx(o,{items:r,onSelectItem:a=>{var l,c;t.command({id:a.name,required:(l=a.required)!=null?l:!0,hideDefaultValue:(c=a==null?void 0:a.hideDefaultValue)!=null?c:!1,label:a==null?void 0:a.label})},ref:s})});tk.displayName="VariableList";function lH(t=yp){return{char:t,items:({query:e,editor:n})=>{var r;const i=(r=NE(n))==null?void 0:r.variables;return na(i,{query:e,editor:n,from:"content-variable"})},render:()=>{let e,n=null;return{onStart:r=>{e=new dh(tk,{props:r,editor:r.editor}),r.clientRect&&(n=Br("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(r){var i;e.updateProps(r),r.clientRect&&((i=n==null?void 0:n[0])==null||i.setProps({getReferenceClientRect:r.clientRect}))},onKeyDown(r){var i;return r.event.key==="Escape"?(n==null||n[0].hide(),!0):(i=e.ref)==null?void 0:i.onKeyDown(r)},onExit(){!n||!(n!=null&&n[0])||!e||(n==null||n[0].destroy(),e.destroy())}}}}}var nk=z5(W4);nk.register("html",v1);var rk=_3.extend({name:"htmlCodeBlock",content:"(text|variable)*",addAttributes(){var t;return le(U({},(t=this.parent)==null?void 0:t.call(this)),{activeTab:"code",showIfKey:{default:Qe,parseHTML:e=>e.getAttribute("data-show-if-key")||Qe,renderHTML(e){return e.showIfKey?{"data-show-if-key":e.showIfKey}:{}}}})},addNodeView(){return yi(KF,{className:"mly:relative",attrs:({node:t})=>{var e;return{"data-active-tab":((e=t==null?void 0:t.attrs)==null?void 0:e.activeTab)||"code"}}})},addCommands(){return{setHtmlCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleHtmlCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t),updateHtmlCodeBlock:t=>As(this.name,t)}},addKeyboardShortcuts(){var t;return le(U({},(t=this.parent)==null?void 0:t.call(this)),{"Mod-a":({editor:e})=>{const{selection:n}=e.state,r=n.$anchor;if(r.node(r.depth).type.name!==this.name)return!1;let s=r.depth;for(let d=s;d>0;d--)if(r.node(d).type.name===this.name){s=d;break}const o=r.before(s)+1,a=r.after(s)-1,l=e.state.doc.resolve(o),c=e.state.doc.resolve(a);if(l&&c){const d=e.state.tr.setSelection(ue.between(l,c));return e.view.dispatch(d),!0}return!1}})}}).configure({lowlight:nk}),cH=(t,e)=>[GE.name,Wh.name,YE.name,QE.name,VE.name,XE.name,FE.name,ZE.name,rk.name,KE.name].some(r=>t.isActive(r));function dH(t){return p.jsxs("svg",le(U({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),{children:[p.jsx("path",{d:"M11 5h6"}),p.jsx("path",{d:"M11 5v14"}),p.jsx("path",{d:"M15 5v14"}),p.jsx("path",{d:"M6 18l-3-3 3-3"}),p.jsx("path",{d:"M3 15h5"})]}))}function uH(t){return p.jsxs("svg",le(U({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),{children:[p.jsx("path",{d:"M8 5h6"}),p.jsx("path",{d:"M10 5v14"}),p.jsx("path",{d:"M14 5v14"}),p.jsx("path",{d:"M18 18l3-3-3-3"}),p.jsx("path",{d:"M16 15h5"})]}))}function fH(t){const{direction:e,onDirectionChange:n}=t,r=GF.includes(e)?e:"ltr",i={ltr:{icon:dH,tooltip:"Left to Right",onClick:()=>{n("ltr")}},rtl:{icon:uH,tooltip:"Right to Left",onClick:()=>{n("rtl")}}},s=i[r];return p.jsxs(rn,{children:[p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:p.jsx(sn,{className:ye("mly:flex mly:size-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2"),children:p.jsx(s.icon,{className:"mly:h-3 mly:w-3 mly:stroke-[2.5]"})})}),p.jsx(xt,{sideOffset:8,children:"Text Direction"})]}),p.jsx(Kt,{className:"mly:flex mly:w-max mly:gap-0.5 mly:rounded-lg mly:p-0.5!",side:"top",sideOffset:8,align:"center",onOpenAutoFocus:o=>{o.preventDefault()},onCloseAutoFocus:o=>{o.preventDefault()},children:Object.entries(i).map(([o,a])=>p.jsx(cn,{icon:a.icon,tooltip:a.tooltip,command:a.onClick,isActive:()=>o===r},o))})]})}var hH="#374151",pH=t=>In({editor:t,selector:n=>{var r,i,s,o,a,l,c,d,u,f,h,m;return{currentTextColor:n.editor.getAttributes("textStyle").color||hH,linkUrl:(r=n.editor)==null?void 0:r.getAttributes("link").href,textAlign:(i=n.editor)!=null&&i.isActive({textAlign:"left"})?"left":(s=n.editor)!=null&&s.isActive({textAlign:"center"})?"center":(o=n.editor)!=null&&o.isActive({textAlign:"right"})?"right":(a=n.editor)!=null&&a.isActive({textAlign:"justify"})?"justify":"left",textDirection:((l=n.editor.getAttributes("paragraph"))==null?void 0:l.textDirection)||((c=n.editor.getAttributes("heading"))==null?void 0:c.textDirection)||((d=n.editor.getAttributes("footer"))==null?void 0:d.textDirection)||dn,isFooterActive:n.editor.isActive("footer"),footerTextDirection:((u=n.editor.getAttributes("footer"))==null?void 0:u.textDirection)||dn,isListActive:n.editor.isActive("bulletList")||n.editor.isActive("orderedList"),isUrlVariable:(f=n.editor.getAttributes("link").isUrlVariable)!=null?f:!1,isHeadingActive:n.editor.isActive("heading"),headingShowIfKey:((h=n.editor.getAttributes("heading"))==null?void 0:h.showIfKey)||"",isParagraphActive:n.editor.isActive("paragraph"),paragraphShowIfKey:((m=n.editor.getAttributes("paragraph"))==null?void 0:m.showIfKey)||""}},equalityFn:$r});function ik(t){var e,n,r,i;const{editor:s,showListMenu:o=!0}=t,a=pH(s),l=s==null?void 0:s.storage.color.colors,c=(r=(n=(e=Array==null?void 0:Array.from(l))==null?void 0:e.reverse())==null?void 0:n.slice(0,6))!=null?r:[],d=[{name:"bold",isActive:()=>s==null?void 0:s.isActive("bold"),command:()=>s==null?void 0:s.chain().focus().toggleBold().run(),icon:ax,tooltip:"Bold"},{name:"italic",isActive:()=>s==null?void 0:s.isActive("italic"),command:()=>s==null?void 0:s.chain().focus().toggleItalic().run(),icon:yx,tooltip:"Italic"},{name:"underline",isActive:()=>s==null?void 0:s.isActive("underline"),command:()=>s==null?void 0:s.chain().focus().toggleUnderline().run(),icon:kx,tooltip:"Underline"},{name:"strike",isActive:()=>s==null?void 0:s.isActive("strike"),command:()=>s==null?void 0:s.chain().focus().toggleStrike().run(),icon:wx,tooltip:"Strikethrough"},{name:"code",isActive:()=>s==null?void 0:s.isActive("code"),command:()=>s==null?void 0:s.chain().focus().toggleCode().run(),icon:YR,tooltip:"Code"}];return p.jsxs(p.Fragment,{children:[d.map((u,f)=>p.jsx(cn,U({},u),f)),p.jsx(ld,{alignment:a.textAlign,onAlignmentChange:u=>{s==null||s.chain().focus().setTextAlign(u).run()}}),p.jsx(fH,{direction:a.textDirection,onDirectionChange:u=>{a.isFooterActive?s==null||s.chain().focus().setFooterTextDirection(u).run():a.isHeadingActive?s==null||s.chain().focus().updateAttributes("heading",{textDirection:u}).run():s==null||s.chain().focus().setTextDirection(u).run()}}),!a.isListActive&&o&&p.jsxs(p.Fragment,{children:[p.jsx(cn,{icon:Th,command:()=>{s.chain().focus().toggleBulletList().run()},tooltip:"Bullet List"}),p.jsx(cn,{icon:Nh,command:()=>{s.chain().focus().toggleOrderedList().run()},tooltip:"Ordered List"})]}),p.jsx(vs,{defaultValue:(i=a==null?void 0:a.linkUrl)!=null?i:"",onValueChange:(u,f)=>{if(!u){s==null||s.chain().focus().extendMarkRange("link").unsetLink().unsetUnderline().run();return}s==null||s.chain().extendMarkRange("link").setLink({href:u}).setIsUrlVariable(f??!1).setUnderline().run()},tooltip:"External URL",editor:s,isVariable:a.isUrlVariable}),p.jsx(Ue,{}),p.jsx(Uo,{color:a.currentTextColor,onColorChange:u=>{s==null||s.chain().setColor(u).run()},tooltip:"Text Color",suggestedColors:c,children:p.jsx(Rt,{variant:"ghost",size:"sm",type:"button",className:"mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",children:p.jsxs("div",{className:"mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px",children:[p.jsx("span",{className:"mly:font-bolder mly:font-mono mly:text-xs mly:text-slate-700",children:"A"}),p.jsx("div",{className:"mly:h-[2px] mly:w-3",style:{backgroundColor:a.currentTextColor}})]})})})]})}var mH=t=>t.type==="option",gH=t=>t.type==="category";function yH(t){const{options:e}=t,n=x.useMemo(()=>e.find(i=>i.type==="option"&&i.isActive()),[e]),{icon:r=bx}=n||{};return p.jsxs(rn,{children:[p.jsxs(Nt,{children:[p.jsx(Tt,{asChild:!0,children:p.jsxs(sn,{className:ye("mly:flex mly:aspect-square mly:h-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2"),children:[p.jsx(r,{className:"mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]"}),p.jsx(lx,{className:"mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]"})]})}),p.jsx(xt,{sideOffset:8,children:"Turn into"})]}),p.jsx(Kt,{align:"start",side:"bottom",sideOffset:8,className:"mly:flex mly:w-[160px] mly:flex-col mly:rounded-md mly:p-1",children:e.map((i,s)=>{if(mH(i))return p.jsxs(Rt,{onClick:i.onClick,variant:"ghost",className:"mly:mb-0.5 mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:px-2 mly:py-1 mly:text-sm mly:font-normal mly:text-midnight-gray",children:[p.jsx(i.icon,{className:"mly:size-[15px] mly:shrink-0"}),i.label]},i.id);if(gH(i))return p.jsx("label",{className:ye("mly:px-2 mly:text-xs mly:font-medium mly:text-midnight-gray/60",s===0?"mly:mb-2 mly:mt-1":"mly:my-2"),children:i.label},i.id)})})]})}function bH(t){return In({editor:t,selector:({editor:e})=>[{type:"category",label:"Hierarchy",id:"hierarchy"},{icon:bx,onClick:()=>e.chain().focus().liftListItem("listItem").setParagraph().run(),id:"paragraph",disabled:()=>!e.can().setParagraph(),isActive:()=>e.isActive("paragraph")&&!e.isActive("orderedList")&&!e.isActive("bulletList")&&!e.isActive("taskList"),label:"Paragraph",type:"option"},{icon:Ch,onClick:()=>e.chain().focus().liftListItem("listItem").setHeading({level:1}).run(),id:"heading1",disabled:()=>!e.can().setHeading({level:1}),isActive:()=>e.isActive("heading",{level:1}),label:"Heading 1",type:"option"},{icon:hx,onClick:()=>e.chain().focus().liftListItem("listItem").setHeading({level:2}).run(),id:"heading2",disabled:()=>!e.can().setHeading({level:2}),isActive:()=>e.isActive("heading",{level:2}),label:"Heading 2",type:"option"},{icon:px,onClick:()=>e.chain().focus().liftListItem("listItem").setHeading({level:3}).run(),id:"heading3",disabled:()=>!e.can().setHeading({level:3}),isActive:()=>e.isActive("heading",{level:3}),label:"Heading 3",type:"option"},{id:"footer",type:"option",label:"Footer",icon:Sh,onClick:()=>{e.chain().focus().liftListItem("listItem").setFooter().run()},disabled:()=>!e.can().setFooter(),isActive:()=>e.isActive("footer")},{type:"category",label:"Lists",id:"lists"},{icon:Th,onClick:()=>e.chain().focus().toggleBulletList().run(),id:"bulletList",disabled:()=>!e.can().toggleBulletList(),isActive:()=>e.isActive("bulletList"),label:"Bullet list",type:"option"},{icon:Nh,onClick:()=>e.chain().focus().toggleOrderedList().run(),id:"orderedList",disabled:()=>!e.can().toggleOrderedList(),isActive:()=>e.isActive("orderedList"),label:"Numbered list",type:"option"}]})}function vH(t){const{editor:e,appendTo:n}=t;if(!e)return null;const r=le(U(U({},t),n?{appendTo:n.current}:{}),{pluginKey:"text-menu",shouldShow:({editor:s,from:o,view:a})=>{var l;if(!a||s.view.dragging)return!1;const c=a.domAtPos(o||0).node,u=a.nodeDOM(o||0)||c;if(cH(s)||!s.isEditable)return!1;const h=[ek.name,PE.name,WE.name,pE.name].some(m=>s.isActive(m))&&((l=u==null?void 0:u.classList)==null?void 0:l.contains("ProseMirror-selectednode"));return ad(s)&&!h},tippyOptions:{popperOptions:{placement:"top-start",modifiers:[{name:"preventOverflow",options:{boundary:"viewport",padding:8}},{name:"flip",options:{fallbackPlacements:["bottom-start","top-end","bottom-end"]}}]},maxWidth:"100%"}}),i=bH(e);return p.jsx(rr,le(U({},r),{className:"mly:flex mly:gap-0.5 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsxs(Vt,{children:[p.jsx(yH,{options:i}),p.jsx(Ue,{className:"mly:mx-0"}),p.jsx(ik,{editor:e})]})}))}function xH(t){const{editor:e,appendTo:n}=t;if(!e)return null;const r=le(U({},t),{pluginKey:"variable-menu",shouldShow:({editor:i})=>{var s;return i.isActive("variable")&&!((s=i.storage.variable)!=null&&s.popover)},tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},plugins:[mi],sticky:"popper",maxWidth:"100%",appendTo:()=>(n==null?void 0:n.current)||"parent",placement:"top-start"}});return p.jsx(rr,le(U({},r),{className:"mly:flex mly:gap-0.5 mly:rounded-lg mly:border mly:border-slate-200 mly:bg-white mly:p-0.5 mly:shadow-md",children:p.jsx(Vt,{children:p.jsx(ik,{showListMenu:!1,editor:e})})}))}var wH=We.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new $e({key:new Be("selection"),props:{decorations(e){return e.selection.empty||t.isFocused===!0?null:ze.create(e.doc,[pt.inline(e.selection.from,e.selection.to,{class:"selection mly:bg-blue-200 mly:inline mly:py-1"})])}}})]}});function EH(t){const{blocks:e,extensions:n=[]}=t;return[...[ZF,eH.configure({suggestion:aH(e)}),VE.configure({suggestion:lH()}),rk,KE,QF,wH].filter(i=>!n.some(s=>s.name===i.name)),...n]}function eb(t){var e,n;const r=[t];for(;r.length;){const i=r.pop();if(i){if(i.type==="for"&&(i.type="repeat"),i.type==="spacer"){let s=(e=i.attrs)==null?void 0:e.height;typeof s=="string"&&["sm","md","lg","xl"].includes(s)&&(s=((n=zo.find(o=>o.short===s))==null?void 0:n.value)||qE),i.attrs=le(U({},i.attrs),{height:s})}i.content&&r.push(...i.content)}}return t}function kH(t){const{config:{wrapClassName:e="",contentClassName:n="",bodyClassName:r="",hasMenuBar:i=!0,hideContextMenu:s=!1,spellCheck:o=!1,autofocus:a="end",immediatelyRender:l=!1}={},onCreate:c,onUpdate:d,extensions:u,contentHtml:f,contentJson:h,blocks:m=gp,editable:g=!0,placeholderUrl:y=cd,scrollThreshold:b=40,scrollMargin:w=40}=t,E=x.useMemo(()=>{if(h){const k=(h==null?void 0:h.type)==="doc"?h:{type:"doc",content:h};return eb(k)}else return f||{type:"doc",content:[{type:"paragraph",content:[]}]}},[f,h,eb]),v=x.useRef(null),S=iM({editorProps:{scrollThreshold:b,scrollMargin:w,attributes:{class:ye("mly:prose mly:w-full",n),spellCheck:o?"true":"false"}},immediatelyRender:l,onCreate:({editor:k})=>{c==null||c(k)},onUpdate:({editor:k})=>{d==null||d(k)},extensions:EH({extensions:u,blocks:m}),content:E,autofocus:a,editable:g});return S?p.jsx(uF,{placeholderUrl:y,children:p.jsxs("div",{id:"mly-editor",className:ye("mly-editor mly:antialiased",S.isEditable?"mly-editable":"mly-not-editable",e),ref:v,children:[i&&p.jsx(h9,{config:t.config,editor:S}),p.jsxs("div",{className:ye("mly:mt-4 mly:rounded mly:border mly:border-gray-200 mly:bg-white mly:p-4",r),children:[p.jsx(vH,{editor:S,appendTo:v}),p.jsx(vF,{editor:S,appendTo:v}),p.jsx(MF,{editor:S,appendTo:v}),p.jsx(YA,{editor:S}),p.jsx(TF,{editor:S,appendTo:v}),p.jsx(s9,{editor:S,appendTo:v}),!s&&p.jsx(f9,{editor:S}),p.jsx(xH,{editor:S,appendTo:v}),p.jsx(kF,{editor:S,appendTo:v}),p.jsx(m9,{editor:S,appendTo:v}),p.jsx(wF,{editor:S,appendTo:v})]})]})}):null}const SH={type:"doc",content:[{type:"paragraph"}]};function $H({slug:t}){const{data:e,loading:n,error:r,refetch:i}=rb(()=>Vn.template(t),[t]);return p.jsx(ck,{loading:n&&!e,error:r,empty:!e,emptyLabel:"Template not found.",retry:i,children:e&&p.jsx(CH,{tpl:e,slug:t,refetch:i})})}function CH({tpl:t,slug:e,refetch:n}){var Te,ke,je,Oe,de,Ke,Z,ne,Ce;const[r,i]=Q.useState("design"),[s,o]=Q.useState(SH),[a,l]=Q.useState(((Te=t.draft)==null?void 0:Te.subject)??t.subject??""),[c,d]=Q.useState(((ke=t.draft)==null?void 0:ke.preheader)??t.preheader??""),[u,f]=Q.useState(((je=t.draft)==null?void 0:je.fromName)??t.fromName??""),[h,m]=Q.useState(((Oe=t.draft)==null?void 0:Oe.fromEmail)??t.fromEmail??""),[g,y]=Q.useState(((de=t.draft)==null?void 0:de.replyTo)??t.replyTo??""),[b,w]=Q.useState(!1),[E,v]=Q.useState(""),[S,k]=Q.useState(!1),C=Q.useRef(null),T=Q.useRef(!1),[M,D]=Q.useState(null),[F,B]=Q.useState(null),[z,W]=Q.useState(!1),[G,A]=Q.useState(""),[N,_]=Q.useState(null),[I,$]=Q.useState(!1);async function q(){B(null),v("Generating preview…");try{const H=await Vn.previewTemplate(e,{useDraft:!0});D(H),v("")}catch(H){B(String((H==null?void 0:H.message)??H)),v("")}}async function se(){if(!(!G.trim()||I)){$(!0),_("Sending…");try{await Vn.sendTestTemplate(e,{to:G.trim()}),_(`Sent test to ${G.trim()}`)}catch(H){_(`Failed: ${(H==null?void 0:H.message)??H}`)}finally{$(!1)}}}const ae=t.kind??"marketing",K=t.name??e,X=t.slug??e,me=((Ke=t.body)==null?void 0:Ke.mjml)??((Z=t.draft)==null?void 0:Z.mjml)??"",he=((ne=t.body)==null?void 0:ne.plainText)??"",Se=_H(e,{subject:a,preheader:c,editorJson:s,fromEmail:h||t.fromEmail,kind:ae}),Ee=(((Ce=Se.data)==null?void 0:Ce.errors.length)??0)>0;Q.useEffect(()=>{var ve,Ge;if(T.current)return;T.current=!0;const H=((ve=t.draft)==null?void 0:ve.editorJson)??((Ge=t.body)==null?void 0:Ge.editorJson);H&&o(H)},[t]);async function Ne(){v("Saving draft…"),await Vn.updateTemplateDraft(e,{subject:a,preheader:c,editorJson:s,fromName:u||void 0,fromEmail:h||void 0,replyTo:g||void 0})}async function Me(){k(!0);try{await Ne(),v("Publishing…");const H=await Vn.publishTemplate(e);v(`Published v${H.version}`),w(!1),n()}catch(H){v(`Error: ${(H==null?void 0:H.message)??String(H)}`)}finally{k(!1)}}return p.jsxs(p.Fragment,{children:[p.jsx(dk,{title:K,desc:p.jsxs(p.Fragment,{children:[p.jsxs("span",{className:"mono",children:["templates/",X]})," · ",p.jsx("span",{className:"pill "+(ae==="transactional"?"blue":"neutral"),style:{marginLeft:4},children:ae})]}),actions:p.jsxs(p.Fragment,{children:[p.jsxs("button",{className:"btn",onClick:q,children:[p.jsx(Va.Eye,{size:14}),"Preview"]}),p.jsxs("button",{className:"btn",onClick:()=>{W(!0),_(null)},children:[p.jsx(Va.Send,{size:14}),"Test send"]}),p.jsxs("button",{className:"btn btn-primary",disabled:S||Ee,onClick:Me,title:Ee?"Resolve content-lint errors before publishing.":void 0,children:[p.jsx(Va.Rocket,{size:14}),"Publish"]}),Se.data&&p.jsx("span",{className:"text-xs subtle",style:{marginLeft:8},children:p.jsx(sk,{data:Se.data})}),E&&p.jsx("span",{className:"text-xs subtle",style:{marginLeft:8},children:E})]})}),p.jsxs("div",{className:"split split-asym",style:{gap:16},children:[p.jsxs("div",{className:"card",style:{overflow:"hidden"},children:[p.jsxs("div",{className:"card-head",children:[p.jsxs("div",{className:"seg",children:[p.jsx("span",{className:"seg-item"+(r==="design"?" active":""),onClick:()=>i("design"),children:"Design"}),p.jsx("span",{className:"seg-item"+(r==="source"?" active":""),onClick:()=>i("source"),children:"MJML"}),p.jsx("span",{className:"seg-item"+(r==="plaintext"?" active":""),onClick:()=>i("plaintext"),children:"Plain text"})]}),p.jsx("div",{className:"card-actions",children:p.jsx("span",{className:"text-xs subtle",children:b?"Unsaved changes":E.startsWith("Published")||E==="Saved"?E:""})})]}),p.jsxs("div",{style:{padding:16},children:[p.jsxs("div",{className:"field",children:[p.jsx("label",{className:"field-label",children:"Subject"}),p.jsx("input",{className:"input",value:a,onChange:H=>{l(H.target.value),w(!0)}})]}),p.jsxs("div",{className:"field",children:[p.jsx("label",{className:"field-label",children:"Preheader"}),p.jsx("input",{className:"input",value:c,onChange:H=>{d(H.target.value),w(!0)}})]})]}),r==="design"&&p.jsx("div",{className:"maily-host",style:{padding:16,background:"var(--bg-sunken)",minHeight:480},children:p.jsx(kH,{contentJson:s,onCreate:H=>{C.current=H},onUpdate:H=>{C.current=H,o(H.getJSON()),w(!0)},config:{hasMenuBar:!0,contentClassName:"mly-content",wrapClassName:"mly-wrap",bodyClassName:"mly-body",spellCheck:!0}})}),r==="source"&&p.jsx("pre",{className:"code",style:{margin:16,padding:16,maxHeight:520,overflow:"auto",whiteSpace:"pre-wrap"},children:me||"/* No MJML stored for this template (Maily-authored). Switch to Design to edit. */"}),r==="plaintext"&&p.jsx("pre",{className:"code",style:{margin:16,padding:16,maxHeight:520,overflow:"auto",whiteSpace:"pre-wrap"},children:he||"/* Plain text is auto-derived on publish. */"})]}),p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[p.jsx(NH,{lint:Se}),p.jsx(TH,{slug:e,refetchTemplate:n}),p.jsxs("div",{className:"card",children:[p.jsx("div",{className:"card-head",children:p.jsx("span",{className:"card-title",children:"Sender"})}),p.jsxs("div",{className:"card-body",children:[p.jsxs("div",{className:"field",children:[p.jsx("label",{className:"field-label",children:"From name"}),p.jsx("input",{className:"input",value:u,placeholder:"(default from mailer config)",onChange:H=>{f(H.target.value),w(!0)}})]}),p.jsxs("div",{className:"field",children:[p.jsx("label",{className:"field-label",children:"From email"}),p.jsx("input",{className:"input",value:h,placeholder:"(default from mailer config)",onChange:H=>{m(H.target.value),w(!0)}})]}),p.jsxs("div",{className:"field",style:{marginBottom:0},children:[p.jsx("label",{className:"field-label",children:"Reply-to"}),p.jsx("input",{className:"input",value:g,placeholder:"(same as From)",onChange:H=>{y(H.target.value),w(!0)}})]})]})]})]})]}),M&&p.jsxs(Eu,{onClose:()=>D(null),title:"Preview",children:[p.jsx("div",{className:"text-sm f500",children:M.subject}),p.jsx("div",{className:"text-xs subtle",style:{marginBottom:8},children:M.preheader}),p.jsx("iframe",{title:"preview",sandbox:"",srcDoc:M.html,style:{width:"100%",minHeight:480,border:"1px solid var(--border)",borderRadius:6,background:"#fff"}})]}),F&&p.jsx(Eu,{onClose:()=>B(null),title:"Preview failed",children:p.jsx("div",{className:"text-sm",style:{color:"var(--red-fg)"},children:F})}),z&&p.jsx(Eu,{onClose:()=>W(!1),title:"Send test email",children:p.jsxs("div",{className:"vstack",style:{gap:12},children:[p.jsxs("div",{className:"field",style:{marginBottom:0},children:[p.jsx("label",{className:"field-label",children:"To"}),p.jsx("input",{className:"input",type:"email",placeholder:"you@example.com",value:G,onChange:H=>A(H.target.value)}),p.jsx("div",{className:"field-hint",children:"Uses the published version (publish first if you want to test recent edits)."})]}),N&&p.jsx("div",{className:"text-xs",children:N}),p.jsxs("div",{className:"hstack",style:{gap:8},children:[p.jsx("button",{className:"btn btn-primary",onClick:se,disabled:!G.trim()||I,children:I?"Sending…":"Send"}),p.jsx("button",{className:"btn",onClick:()=>W(!1),children:"Close"})]})]})})]})}function _H(t,e){const[n,r]=Q.useState({data:null,loading:!1,error:null}),i=JSON.stringify(e),s=Q.useRef(e);return s.current=e,Q.useEffect(()=>{const o=new AbortController;r(l=>({...l,loading:!0}));const a=setTimeout(async()=>{try{const l=await Vn.lintTemplate(t,s.current,o.signal);r({data:l,loading:!1,error:null})}catch(l){if((l==null?void 0:l.name)==="AbortError")return;r(c=>({data:c.data,loading:!1,error:String((l==null?void 0:l.message)??l)}))}},500);return()=>{o.abort(),clearTimeout(a)}},[i,t]),n}function sk({data:t}){const{errors:e,warnings:n,infos:r}=t;return e.length+n.length+r.length===0?p.jsxs("span",{style:{color:"var(--green-fg)"},children:[p.jsx("span",{className:"dot"}),"Lint: clean"]}):p.jsxs("span",{className:"hstack",style:{gap:6},children:[e.length>0&&p.jsxs("span",{style:{color:"var(--red-fg)"},children:[e.length," error",e.length===1?"":"s"]}),n.length>0&&p.jsxs("span",{style:{color:"var(--amber-fg)"},children:[n.length," warning",n.length===1?"":"s"]}),r.length>0&&p.jsxs("span",{style:{color:"var(--fg-muted)"},children:[r.length," info"]})]})}function NH({lint:t}){const e=t.data;return p.jsxs("div",{className:"card",children:[p.jsxs("div",{className:"card-head",children:[p.jsx("span",{className:"card-title",children:"Issues"}),p.jsx("span",{className:"card-sub",children:t.loading&&!e?"Checking…":e?p.jsx(sk,{data:e}):"—"})]}),p.jsxs("div",{className:"card-body",style:{padding:0},children:[t.error&&p.jsx("div",{className:"text-xs",style:{padding:12,color:"var(--red-fg)"},children:t.error}),e&&e.compileFailed&&p.jsx("div",{className:"text-xs",style:{padding:12,color:"var(--red-fg)"},children:"Template compile failed — see error below."}),e&&p.jsxs("div",{style:{maxHeight:360,overflow:"auto"},children:[e.errors.map(n=>p.jsx(wu,{issue:n},`e-${n.rule}`)),e.warnings.map(n=>p.jsx(wu,{issue:n},`w-${n.rule}`)),e.infos.map(n=>p.jsx(wu,{issue:n},`n-${n.rule}`)),e.errors.length===0&&e.warnings.length===0&&e.infos.length===0&&p.jsx("div",{className:"text-xs subtle",style:{padding:12},children:"No issues."})]})]})]})}function wu({issue:t}){const e=t.severity==="error"?"var(--red-fg)":t.severity==="warning"?"var(--amber-fg)":"var(--fg-muted)";return p.jsxs("div",{style:{padding:"8px 12px",borderTop:"1px solid var(--border)",display:"grid",gap:4},children:[p.jsxs("div",{className:"text-xs",style:{color:e,fontWeight:500},children:[t.severity.toUpperCase()," · ",t.rule]}),p.jsx("div",{className:"text-xs",children:t.message}),t.hint&&p.jsx("div",{className:"text-xs subtle",children:t.hint})]})}function TH({slug:t,refetchTemplate:e}){const{data:n,refetch:r}=rb(()=>Vn.mailTesterStatus(t),[t]),[i,s]=Q.useState(!1),[o,a]=Q.useState(null),[l,c]=Q.useState(null),[d,u]=Q.useState(null),f=Q.useRef(r),h=Q.useRef(e);f.current=r,h.current=e,Q.useEffect(()=>{if(!o)return;let w=!1,E=0;const v=30,S=setInterval(async()=>{E++;try{const k=await Vn.fetchMailTesterResult(t,o.checkId);if(w)return;k.status==="ready"&&k.score?(u(k.score),a(null),s(!1),f.current(),h.current()):E>=v&&(c("Timed out waiting for Mail-Tester to score the message. It may still be processing — refresh to check."),a(null),s(!1))}catch(k){if(w)return;c(String((k==null?void 0:k.message)??k)),a(null),s(!1)}},3e3);return()=>{w=!0,clearInterval(S)}},[o,t]);async function m(){s(!0),c(null),u(null);try{const w=await Vn.startMailTesterCheck(t);if(w.status==="ready"&&w.score){u(w.score),s(!1),r();return}w.checkId&&w.contentKey?a({checkId:w.checkId,contentKey:w.contentKey}):(c("Unexpected response from server."),s(!1))}catch(w){c(String((w==null?void 0:w.message)??w)),s(!1)}}const g=d??(n==null?void 0:n.score)??null,y=(n==null?void 0:n.minScore)??8,b=g!=null&&g.score<y;return p.jsxs("div",{className:"card",children:[p.jsxs("div",{className:"card-head",children:[p.jsx("span",{className:"card-title",children:"Deliverability check"}),p.jsx("span",{className:"card-sub",children:n?n.configured?g?`Cached for ${n.cacheHours}h after each check`:"Run a Mail-Tester check before publishing":"Mail-Tester not configured":"Loading…"}),(n==null?void 0:n.configured)&&p.jsx("div",{className:"card-actions",children:p.jsx("button",{className:"btn btn-xs",disabled:i,onClick:m,children:i?o?"Waiting for score…":"Sending…":g?"Re-run check":"Run check"})})]}),p.jsxs("div",{className:"card-body",style:{display:"grid",gap:10},children:[!(n!=null&&n.configured)&&p.jsxs("div",{className:"text-xs subtle",children:["Set ",p.jsx("code",{children:"mailer.config.mailTester.apiKey"})," to enable. Mail-Tester runs SpamAssassin + DNS auth checks + content red-flag scoring against a real receipt of this template."]}),l&&p.jsx("div",{className:"text-xs",style:{color:"var(--red-fg)"},children:l}),g&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"hstack",style:{gap:16,alignItems:"baseline"},children:[p.jsxs("div",{children:[p.jsx("div",{className:"text-xs subtle",children:"Score"}),p.jsxs("div",{style:{fontSize:28,fontWeight:600,color:b?"var(--red-fg)":g.score>=9?"var(--green-fg)":"var(--amber-fg)"},children:[g.score.toFixed(1)," ",p.jsx("span",{className:"text-xs subtle",children:"/ 10"})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs subtle",children:"Threshold"}),p.jsx("div",{className:"text-sm mono",children:y.toFixed(1)})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs subtle",children:"Checked"}),p.jsx("div",{className:"text-xs",children:new Date(g.fetchedAt).toLocaleString()})]})]}),b&&p.jsxs("div",{className:"text-xs",style:{color:"var(--red-fg)"},children:["Score below threshold — publish will be blocked. Address the feedback below or override with ",p.jsx("code",{children:"bypassMailTester: true"})," on the publish call."]}),g.feedback.length>0&&p.jsxs("div",{style:{display:"grid",gap:6,marginTop:4},children:[g.feedback.slice(0,12).map((w,E)=>p.jsxs("div",{className:"text-xs",style:{display:"grid",gap:2},children:[p.jsxs("div",{style:{color:w.severity==="error"?"var(--red-fg)":w.severity==="warning"?"var(--amber-fg)":"var(--fg-muted)",fontWeight:500},children:[w.severity.toUpperCase()," · ",w.category]}),p.jsx("div",{children:w.message})]},E)),g.feedback.length>12&&p.jsxs("div",{className:"text-xs subtle",children:["+ ",g.feedback.length-12," more items in raw report"]})]})]})]})]})}function Eu({title:t,onClose:e,children:n}){const r=Q.useId(),i=Q.useRef(null);return Q.useEffect(()=>{var a;const s=i.current;function o(l){if(l.key==="Escape"){e();return}if(l.key!=="Tab"||!s)return;const c=s.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(c.length===0)return;const d=c[0],u=c[c.length-1],f=document.activeElement;l.shiftKey&&(f===d||!s.contains(f))?(l.preventDefault(),u.focus()):!l.shiftKey&&f===u&&(l.preventDefault(),d.focus())}return document.addEventListener("keydown",o),(a=i.current)==null||a.focus(),()=>document.removeEventListener("keydown",o)},[e]),p.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":r,onClick:e,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"grid",placeItems:"center",zIndex:50},children:p.jsxs("div",{ref:i,tabIndex:-1,onClick:s=>s.stopPropagation(),className:"card",style:{width:"min(680px, 90vw)",maxHeight:"85vh",overflow:"auto",padding:0},children:[p.jsxs("div",{className:"card-head",children:[p.jsx("span",{className:"card-title",id:r,children:t}),p.jsx("span",{className:"grow"}),p.jsx("button",{className:"icon-btn","aria-label":"Close",onClick:e,children:p.jsx(Va.X,{size:14})})]}),p.jsx("div",{className:"card-body",children:n})]})})}export{$H as TemplateEditor};
|
|
502
|
+
//# sourceMappingURL=template-editor-Bn28OPMU.js.map
|