@aquera/nile-elements 0.1.67-beta-1.2 → 0.1.67-beta-1.3

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.
Files changed (25) hide show
  1. package/demo/index.html +9 -9
  2. package/dist/index.js +31 -29
  3. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
  4. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
  5. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
  6. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
  7. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +3 -1
  8. package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
  9. package/dist/nile-rich-text-editor/utils.cjs.js +1 -1
  10. package/dist/nile-rich-text-editor/utils.cjs.js.map +1 -1
  11. package/dist/nile-rich-text-editor/utils.esm.js +1 -1
  12. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +3 -1
  13. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
  14. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +1 -0
  15. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +64 -8
  16. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
  17. package/dist/src/nile-rich-text-editor/utils.d.ts +2 -2
  18. package/dist/src/nile-rich-text-editor/utils.js +181 -27
  19. package/dist/src/nile-rich-text-editor/utils.js.map +1 -1
  20. package/dist/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +1 -1
  22. package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +3 -1
  23. package/src/nile-rich-text-editor/nile-rich-text-editor.ts +89 -11
  24. package/src/nile-rich-text-editor/utils.ts +248 -26
  25. package/vscode-html-custom-data.json +1 -1
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ const e=globalThis,M=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
15
15
  * Copyright 2017 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- const h=globalThis,L=h.trustedTypes,x=L?L.createPolicy("lit-html",{createHTML:t=>t}):void 0,p="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,Q="?"+S,E=`<${Q}>`,k=document,w=()=>k.createComment(""),m=t=>null===t||"object"!=typeof t&&"function"!=typeof t,U=Array.isArray,C=t=>U(t)||"function"==typeof t?.[Symbol.iterator],Y="[ \t\n\f\r]",b=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,f=/-->/g,v=/>/g,Z=RegExp(`>|${Y}(?:([^\\s"'>=/]+)(${Y}*=${Y}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,W=/"/g,P=/^(?:script|style|textarea|title)$/i,R=(t=>(e,...M)=>({_$litType$:t,strings:e,values:M}))(1),G=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),_=new WeakMap,F=k.createTreeWalker(k,129);function J(t,e){if(!U(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==x?x.createHTML(e):e}const H=(t,e)=>{const M=t.length-1,i=[];let N,o=2===e?"<svg>":3===e?"<math>":"",n=b;for(let e=0;e<M;e++){const M=t[e];let s,r,D=-1,a=0;for(;a<M.length&&(n.lastIndex=a,r=n.exec(M),null!==r);)a=n.lastIndex,n===b?"!--"===r[1]?n=f:void 0!==r[1]?n=v:void 0!==r[2]?(P.test(r[2])&&(N=RegExp("</"+r[2],"g")),n=Z):void 0!==r[3]&&(n=Z):n===Z?">"===r[0]?(n=N??b,D=-1):void 0===r[1]?D=-2:(D=n.lastIndex-r[2].length,s=r[1],n=void 0===r[3]?Z:'"'===r[3]?W:V):n===W||n===V?n=Z:n===f||n===v?n=b:(n=Z,N=void 0);const l=n===Z&&t[e+1].startsWith("/>")?" ":"";o+=n===b?M+E:D>=0?(i.push(s),M.slice(0,D)+p+M.slice(D)+S+l):M+S+(-2===D?e:l)}return[J(t,o+(t[M]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class X{constructor({strings:t,_$litType$:e},M){let i;this.parts=[];let N=0,o=0;const n=t.length-1,s=this.parts,[r,D]=H(t,e);if(this.el=X.createElement(r,M),F.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=F.nextNode())&&s.length<n;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(p)){const e=D[o++],M=i.getAttribute(t).split(S),n=/([.?@])?(.*)/.exec(e);s.push({type:1,index:N,name:n[2],strings:M,ctor:"."===n[1]?et:"?"===n[1]?Mt:"@"===n[1]?it:tt}),i.removeAttribute(t)}else t.startsWith(S)&&(s.push({type:6,index:N}),i.removeAttribute(t));if(P.test(i.tagName)){const t=i.textContent.split(S),e=t.length-1;if(e>0){i.textContent=L?L.emptyScript:"";for(let M=0;M<e;M++)i.append(t[M],w()),F.nextNode(),s.push({type:2,index:++N});i.append(t[e],w())}}}else if(8===i.nodeType)if(i.data===Q)s.push({type:2,index:N});else{let t=-1;for(;-1!==(t=i.data.indexOf(S,t+1));)s.push({type:7,index:N}),t+=S.length-1}N++}}static createElement(t,e){const M=k.createElement("template");return M.innerHTML=t,M}}function $(t,e,M=t,i){if(e===G)return e;let N=void 0!==i?M._$Co?.[i]:M._$Cl;const o=m(e)?void 0:e._$litDirective$;return N?.constructor!==o&&(N?._$AO?.(!1),void 0===o?N=void 0:(N=new o(t),N._$AT(t,M,i)),void 0!==i?(M._$Co??=[])[i]=N:M._$Cl=N),void 0!==N&&(e=$(t,N._$AS(t,e.values),N,i)),e}let q=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:M}=this._$AD,i=(t?.creationScope??k).importNode(e,!0);F.currentNode=i;let N=F.nextNode(),o=0,n=0,s=M[0];for(;void 0!==s;){if(o===s.index){let e;2===s.type?e=new K(N,N.nextSibling,this,t):1===s.type?e=new s.ctor(N,s.name,s.strings,this,t):6===s.type&&(e=new Nt(N,this,t)),this._$AV.push(e),s=M[++n]}o!==s?.index&&(N=F.nextNode(),o++)}return F.currentNode=k,i}p(t){let e=0;for(const M of this._$AV)void 0!==M&&(void 0!==M.strings?(M._$AI(t,M,e),e+=M.strings.length-2):M._$AI(t[e])),e++}};class K{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,M,i){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=M,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=$(this,t,e),m(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==G&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):C(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&m(this._$AH)?this._$AA.nextSibling.data=t:this.T(k.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:M}=t,i="number"==typeof M?this._$AC(t):(void 0===M.el&&(M.el=X.createElement(J(M.h,M.h[0]),this.options)),M);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new q(i,this),M=t.u(this.options);t.p(e),this.T(M),this._$AH=t}}_$AC(t){let e=_.get(t.strings);return void 0===e&&_.set(t.strings,e=new X(t)),e}k(t){U(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let M,i=0;for(const N of t)i===e.length?e.push(M=new K(this.O(w()),this.O(w()),this,this.options)):M=e[i],M._$AI(N),i++;i<e.length&&(this._$AR(M&&M._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,M,i,N){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=N,M.length>2||""!==M[0]||""!==M[1]?(this._$AH=Array(M.length-1).fill(new String),this.strings=M):this._$AH=B}_$AI(t,e=this,M,i){const N=this.strings;let o=!1;if(void 0===N)t=$(this,t,e,0),o=!m(t)||t!==this._$AH&&t!==G,o&&(this._$AH=t);else{const i=t;let n,s;for(t=N[0],n=0;n<N.length-1;n++)s=$(this,i[M+n],e,n),s===G&&(s=this._$AH[n]),o||=!m(s)||s!==this._$AH[n],s===B?t=B:t!==B&&(t+=(s??"")+N[n+1]),this._$AH[n]=s}o&&!i&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class Mt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class it extends tt{constructor(t,e,M,i,N){super(t,e,M,i,N),this.type=5}_$AI(t,e=this){if((t=$(this,t,e,0)??B)===G)return;const M=this._$AH,i=t===B&&M!==B||t.capture!==M.capture||t.once!==M.once||t.passive!==M.passive,N=t!==B&&(M===B||i);i&&this.element.removeEventListener(this.name,this,M),N&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Nt{constructor(t,e,M){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=M}get _$AU(){return this._$AM._$AU}_$AI(t){$(this,t)}}const ot={M:p,P:S,A:Q,C:1,L:H,R:q,D:C,V:$,I:K,H:tt,N:Mt,U:it,B:et,F:Nt},nt=h.litHtmlPolyfillSupport;nt?.(X,K),(h.litHtmlVersions??=[]).push("3.2.1");const st=(t,e,M)=>{const i=M?.renderBefore??e;let N=i._$litPart$;if(void 0===N){const t=M?.renderBefore??null;i._$litPart$=N=new K(e.insertBefore(w(),t),t,void 0,M??{})}return N._$AI(t),N
18
+ const h=globalThis,L=h.trustedTypes,x=L?L.createPolicy("lit-html",{createHTML:t=>t}):void 0,p="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,Q="?"+S,E=`<${Q}>`,k=document,w=()=>k.createComment(""),m=t=>null===t||"object"!=typeof t&&"function"!=typeof t,U=Array.isArray,C=t=>U(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",b=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,v=/>/g,Z=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,W=/"/g,P=/^(?:script|style|textarea|title)$/i,R=(t=>(e,...M)=>({_$litType$:t,strings:e,values:M}))(1),G=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),_=new WeakMap,F=k.createTreeWalker(k,129);function J(t,e){if(!U(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==x?x.createHTML(e):e}const H=(t,e)=>{const M=t.length-1,i=[];let N,o=2===e?"<svg>":3===e?"<math>":"",n=b;for(let e=0;e<M;e++){const M=t[e];let s,r,D=-1,a=0;for(;a<M.length&&(n.lastIndex=a,r=n.exec(M),null!==r);)a=n.lastIndex,n===b?"!--"===r[1]?n=Y:void 0!==r[1]?n=v:void 0!==r[2]?(P.test(r[2])&&(N=RegExp("</"+r[2],"g")),n=Z):void 0!==r[3]&&(n=Z):n===Z?">"===r[0]?(n=N??b,D=-1):void 0===r[1]?D=-2:(D=n.lastIndex-r[2].length,s=r[1],n=void 0===r[3]?Z:'"'===r[3]?W:V):n===W||n===V?n=Z:n===Y||n===v?n=b:(n=Z,N=void 0);const l=n===Z&&t[e+1].startsWith("/>")?" ":"";o+=n===b?M+E:D>=0?(i.push(s),M.slice(0,D)+p+M.slice(D)+S+l):M+S+(-2===D?e:l)}return[J(t,o+(t[M]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class X{constructor({strings:t,_$litType$:e},M){let i;this.parts=[];let N=0,o=0;const n=t.length-1,s=this.parts,[r,D]=H(t,e);if(this.el=X.createElement(r,M),F.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=F.nextNode())&&s.length<n;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(p)){const e=D[o++],M=i.getAttribute(t).split(S),n=/([.?@])?(.*)/.exec(e);s.push({type:1,index:N,name:n[2],strings:M,ctor:"."===n[1]?et:"?"===n[1]?Mt:"@"===n[1]?it:tt}),i.removeAttribute(t)}else t.startsWith(S)&&(s.push({type:6,index:N}),i.removeAttribute(t));if(P.test(i.tagName)){const t=i.textContent.split(S),e=t.length-1;if(e>0){i.textContent=L?L.emptyScript:"";for(let M=0;M<e;M++)i.append(t[M],w()),F.nextNode(),s.push({type:2,index:++N});i.append(t[e],w())}}}else if(8===i.nodeType)if(i.data===Q)s.push({type:2,index:N});else{let t=-1;for(;-1!==(t=i.data.indexOf(S,t+1));)s.push({type:7,index:N}),t+=S.length-1}N++}}static createElement(t,e){const M=k.createElement("template");return M.innerHTML=t,M}}function $(t,e,M=t,i){if(e===G)return e;let N=void 0!==i?M._$Co?.[i]:M._$Cl;const o=m(e)?void 0:e._$litDirective$;return N?.constructor!==o&&(N?._$AO?.(!1),void 0===o?N=void 0:(N=new o(t),N._$AT(t,M,i)),void 0!==i?(M._$Co??=[])[i]=N:M._$Cl=N),void 0!==N&&(e=$(t,N._$AS(t,e.values),N,i)),e}let q=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:M}=this._$AD,i=(t?.creationScope??k).importNode(e,!0);F.currentNode=i;let N=F.nextNode(),o=0,n=0,s=M[0];for(;void 0!==s;){if(o===s.index){let e;2===s.type?e=new K(N,N.nextSibling,this,t):1===s.type?e=new s.ctor(N,s.name,s.strings,this,t):6===s.type&&(e=new Nt(N,this,t)),this._$AV.push(e),s=M[++n]}o!==s?.index&&(N=F.nextNode(),o++)}return F.currentNode=k,i}p(t){let e=0;for(const M of this._$AV)void 0!==M&&(void 0!==M.strings?(M._$AI(t,M,e),e+=M.strings.length-2):M._$AI(t[e])),e++}};class K{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,M,i){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=M,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=$(this,t,e),m(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==G&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):C(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&m(this._$AH)?this._$AA.nextSibling.data=t:this.T(k.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:M}=t,i="number"==typeof M?this._$AC(t):(void 0===M.el&&(M.el=X.createElement(J(M.h,M.h[0]),this.options)),M);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new q(i,this),M=t.u(this.options);t.p(e),this.T(M),this._$AH=t}}_$AC(t){let e=_.get(t.strings);return void 0===e&&_.set(t.strings,e=new X(t)),e}k(t){U(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let M,i=0;for(const N of t)i===e.length?e.push(M=new K(this.O(w()),this.O(w()),this,this.options)):M=e[i],M._$AI(N),i++;i<e.length&&(this._$AR(M&&M._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,M,i,N){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=N,M.length>2||""!==M[0]||""!==M[1]?(this._$AH=Array(M.length-1).fill(new String),this.strings=M):this._$AH=B}_$AI(t,e=this,M,i){const N=this.strings;let o=!1;if(void 0===N)t=$(this,t,e,0),o=!m(t)||t!==this._$AH&&t!==G,o&&(this._$AH=t);else{const i=t;let n,s;for(t=N[0],n=0;n<N.length-1;n++)s=$(this,i[M+n],e,n),s===G&&(s=this._$AH[n]),o||=!m(s)||s!==this._$AH[n],s===B?t=B:t!==B&&(t+=(s??"")+N[n+1]),this._$AH[n]=s}o&&!i&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class Mt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class it extends tt{constructor(t,e,M,i,N){super(t,e,M,i,N),this.type=5}_$AI(t,e=this){if((t=$(this,t,e,0)??B)===G)return;const M=this._$AH,i=t===B&&M!==B||t.capture!==M.capture||t.once!==M.once||t.passive!==M.passive,N=t!==B&&(M===B||i);i&&this.element.removeEventListener(this.name,this,M),N&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Nt{constructor(t,e,M){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=M}get _$AU(){return this._$AM._$AU}_$AI(t){$(this,t)}}const ot={M:p,P:S,A:Q,C:1,L:H,R:q,D:C,V:$,I:K,H:tt,N:Mt,U:it,B:et,F:Nt},nt=h.litHtmlPolyfillSupport;nt?.(X,K),(h.litHtmlVersions??=[]).push("3.2.1");const st=(t,e,M)=>{const i=M?.renderBefore??e;let N=i._$litPart$;if(void 0===N){const t=M?.renderBefore??null;i._$litPart$=N=new K(e.insertBefore(w(),t),t,void 0,M??{})}return N._$AI(t),N
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
@@ -110,7 +110,7 @@ const Tt=1,Ot=2,yt=3,dt=4,At=t=>(...e)=>({_$litDirective$:t,values:e});let ht=cl
110
110
  .nds-icon--push {
111
111
  margin-right: 12px;
112
112
  }
113
- `,t([gt({type:String,reflect:!0})],wt.prototype,"set",void 0),t([gt({type:String,reflect:!0})],wt.prototype,"name",void 0),t([gt({type:String,reflect:!0})],wt.prototype,"description",void 0),t([gt({type:String,reflect:!0})],wt.prototype,"method",void 0),t([gt({type:String})],wt.prototype,"customSvgPath",void 0),t([gt({type:String,reflect:!0})],wt.prototype,"size",void 0),t([jt()],wt.prototype,"_svg",void 0),t([gt({type:String})],wt.prototype,"title",void 0),t([gt({reflect:!0})],wt.prototype,"color",void 0),t([gt({type:Boolean})],wt.prototype,"push",void 0),t([gt({reflect:!0})],wt.prototype,"frame",void 0),wt=t([at("nile-icon")],wt);const mt=new WeakMap,Ut=new WeakMap,Ct=new WeakSet,Yt=new WeakMap;class bt{constructor(t,e){(this.host=t).addController(this),this.options={form:t=>{if(t.hasAttribute("form")&&""!==t.getAttribute("form")){const e=t.getRootNode(),M=t.getAttribute("form");if(M)return e.getElementById(M)}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>t.disabled??!1,reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["nile-input"],...e},this.handleFormData=this.handleFormData.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleFormReset=this.handleFormReset.bind(this),this.reportFormValidity=this.reportFormValidity.bind(this),this.handleInteraction=this.handleInteraction.bind(this)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),Yt.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),Yt.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(t){t?(this.form=t,mt.has(this.form)?mt.get(this.form).add(this.host):mt.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),Ut.has(this.form)||(Ut.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){this.form&&(mt.get(this.form)?.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),Ut.has(this.form)&&(this.form.reportValidity=Ut.get(this.form),Ut.delete(this.form))),this.form=void 0}handleFormData(t){const e=this.options.disabled(this.host),M=this.options.name(this.host),i=this.options.value(this.host),N="nile-button"===this.host.tagName.toLowerCase();!e&&!N&&"string"==typeof M&&M.length>0&&void 0!==i&&(Array.isArray(i)?i.forEach((e=>{t.formData.append(M,e.toString())})):t.formData.append(M,i.toString()))}handleFormSubmit(t){const e=this.options.disabled(this.host),M=this.options.reportValidity;this.form&&!this.form.noValidate&&mt.get(this.form)?.forEach((t=>{this.setUserInteracted(t,!0)})),!this.form||this.form.noValidate||e||M(this.host)||(t.preventDefault(),t.stopImmediatePropagation())}handleFormReset(){this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),Yt.set(this.host,[])}handleInteraction(t){const e=Yt.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)}reportFormValidity(){if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){e?Ct.add(t):Ct.delete(t),t.requestUpdate()}doAction(t,e){if(this.form){const M=document.createElement("button");M.type=t,M.style.position="absolute",M.style.width="0",M.style.height="0",M.style.clipPath="inset(50%)",M.style.overflow="hidden",M.style.whiteSpace="nowrap",e&&(M.name=e.name,M.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&M.setAttribute(t,e.getAttribute(t))}))),this.form.append(M),M.click(),M.remove()}}getForm(){return this.form??null}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){const e=this.host,M=Boolean(Ct.has(e)),i=Boolean(e.required);e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&M),e.toggleAttribute("data-user-valid",t&&M)}updateValidity(){const t=this.host;this.setValidity(t.validity.valid)}emitInvalidEvent(t){const e=new CustomEvent("nile-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault(),this.host.dispatchEvent(e)||t?.preventDefault()}}const ft=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1});Object.freeze({...ft,valid:!1,valueMissing:!0}),Object.freeze({...ft,valid:!1,customError:!0});let vt=class{constructor(t,...e){this.slotNames=[],(this.host=t).addController(this),this.slotNames=e,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("nile-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(t){const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()}};
113
+ `,t([gt({type:String,reflect:!0})],wt.prototype,"set",void 0),t([gt({type:String,reflect:!0})],wt.prototype,"name",void 0),t([gt({type:String,reflect:!0})],wt.prototype,"description",void 0),t([gt({type:String,reflect:!0})],wt.prototype,"method",void 0),t([gt({type:String})],wt.prototype,"customSvgPath",void 0),t([gt({type:String,reflect:!0})],wt.prototype,"size",void 0),t([jt()],wt.prototype,"_svg",void 0),t([gt({type:String})],wt.prototype,"title",void 0),t([gt({reflect:!0})],wt.prototype,"color",void 0),t([gt({type:Boolean})],wt.prototype,"push",void 0),t([gt({reflect:!0})],wt.prototype,"frame",void 0),wt=t([at("nile-icon")],wt);const mt=new WeakMap,Ut=new WeakMap,Ct=new WeakSet,ft=new WeakMap;class bt{constructor(t,e){(this.host=t).addController(this),this.options={form:t=>{if(t.hasAttribute("form")&&""!==t.getAttribute("form")){const e=t.getRootNode(),M=t.getAttribute("form");if(M)return e.getElementById(M)}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>t.disabled??!1,reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["nile-input"],...e},this.handleFormData=this.handleFormData.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleFormReset=this.handleFormReset.bind(this),this.reportFormValidity=this.reportFormValidity.bind(this),this.handleInteraction=this.handleInteraction.bind(this)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),ft.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),ft.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(t){t?(this.form=t,mt.has(this.form)?mt.get(this.form).add(this.host):mt.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),Ut.has(this.form)||(Ut.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){this.form&&(mt.get(this.form)?.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),Ut.has(this.form)&&(this.form.reportValidity=Ut.get(this.form),Ut.delete(this.form))),this.form=void 0}handleFormData(t){const e=this.options.disabled(this.host),M=this.options.name(this.host),i=this.options.value(this.host),N="nile-button"===this.host.tagName.toLowerCase();!e&&!N&&"string"==typeof M&&M.length>0&&void 0!==i&&(Array.isArray(i)?i.forEach((e=>{t.formData.append(M,e.toString())})):t.formData.append(M,i.toString()))}handleFormSubmit(t){const e=this.options.disabled(this.host),M=this.options.reportValidity;this.form&&!this.form.noValidate&&mt.get(this.form)?.forEach((t=>{this.setUserInteracted(t,!0)})),!this.form||this.form.noValidate||e||M(this.host)||(t.preventDefault(),t.stopImmediatePropagation())}handleFormReset(){this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),ft.set(this.host,[])}handleInteraction(t){const e=ft.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)}reportFormValidity(){if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){e?Ct.add(t):Ct.delete(t),t.requestUpdate()}doAction(t,e){if(this.form){const M=document.createElement("button");M.type=t,M.style.position="absolute",M.style.width="0",M.style.height="0",M.style.clipPath="inset(50%)",M.style.overflow="hidden",M.style.whiteSpace="nowrap",e&&(M.name=e.name,M.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&M.setAttribute(t,e.getAttribute(t))}))),this.form.append(M),M.click(),M.remove()}}getForm(){return this.form??null}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){const e=this.host,M=Boolean(Ct.has(e)),i=Boolean(e.required);e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&M),e.toggleAttribute("data-user-valid",t&&M)}updateValidity(){const t=this.host;this.setValidity(t.validity.valid)}emitInvalidEvent(t){const e=new CustomEvent("nile-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault(),this.host.dispatchEvent(e)||t?.preventDefault()}}const Yt=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1});Object.freeze({...Yt,valid:!1,valueMissing:!0}),Object.freeze({...Yt,valid:!1,customError:!0});let vt=class{constructor(t,...e){this.slotNames=[],(this.host=t).addController(this),this.slotNames=e,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("nile-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(t){const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()}};
114
114
  /**
115
115
  * @license
116
116
  * Copyright 2018 Google LLC
@@ -817,7 +817,7 @@ const Zt=t=>t??B;function Vt(t,e){const M={waitUntilFirstUpdate:!1,...e};return(
817
817
  * @license
818
818
  * Copyright 2020 Google LLC
819
819
  * SPDX-License-Identifier: BSD-3-Clause
820
- */const Rt=Symbol.for(""),Gt=(t,...e)=>({_$litStatic$:e.reduce(((e,M,i)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(M)+t[i+1]),t[0]),r:Rt});let Bt=class extends Pt{constructor(){super(...arguments),this.formControlController=new bt(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),M=t.getAttribute("form");return e.getElementById(M)}return t.closest("form")},assumeInteractionOn:["click"]}),this.hasSlotController=new vt(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.invalid=!1,this.title="",this.variant="primary",this.size="medium",this.caret=!1,this.disabled=!1,this.loading=!1,this.outline=!1,this.pill=!1,this.circle=!1,this.type="button",this.name="",this.value="",this.href="",this.rel="noreferrer noopener",this.hideBorder=!1}get validity(){return this.isButton()?this.button.validity:ft}get validationMessage(){return this.isButton()?this.button.validationMessage:""}connectedCallback(){super.connectedCallback(),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.emit("nile-destroy")}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}handleClick(){"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleHostClick(t){(this.disabled||this.loading)&&(t.preventDefault(),t.stopImmediatePropagation())}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(t){this.isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}render(){this.isLink()?Gt`a`:Gt`button`;const t={primary:"white",secondary:"black",tertiary:"black",caution:"white",ghost:"black",destructive:"white","secondary-grey":"black","secondary-blue":"black","tertiary-blue":"black"};return this.isLink()?R`
820
+ */const Rt=Symbol.for(""),Gt=(t,...e)=>({_$litStatic$:e.reduce(((e,M,i)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(M)+t[i+1]),t[0]),r:Rt});let Bt=class extends Pt{constructor(){super(...arguments),this.formControlController=new bt(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),M=t.getAttribute("form");return e.getElementById(M)}return t.closest("form")},assumeInteractionOn:["click"]}),this.hasSlotController=new vt(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.invalid=!1,this.title="",this.variant="primary",this.size="medium",this.caret=!1,this.disabled=!1,this.loading=!1,this.outline=!1,this.pill=!1,this.circle=!1,this.type="button",this.name="",this.value="",this.href="",this.rel="noreferrer noopener",this.hideBorder=!1}get validity(){return this.isButton()?this.button.validity:Yt}get validationMessage(){return this.isButton()?this.button.validationMessage:""}connectedCallback(){super.connectedCallback(),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.emit("nile-destroy")}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}handleClick(){"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleHostClick(t){(this.disabled||this.loading)&&(t.preventDefault(),t.stopImmediatePropagation())}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(t){this.isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}render(){this.isLink()?Gt`a`:Gt`button`;const t={primary:"white",secondary:"black",tertiary:"black",caution:"white",ghost:"black",destructive:"white","secondary-grey":"black","secondary-blue":"black","tertiary-blue":"black"};return this.isLink()?R`
821
821
  <a
822
822
  part="base"
823
823
  class=${Lt({button:!0,"button--primary":"primary"===this.variant,"button--secondary":"secondary"===this.variant,"button--tertiary":"tertiary"===this.variant,"button--caution":"caution"===this.variant,"button--ghost":"ghost"===this.variant,"button--destructive":"destructive"===this.variant,"button--secondary-grey":"secondary-grey"===this.variant,"button--secondary-blue":"secondary-blue"===this.variant,"button--hideborder":this.hideBorder,"button--medium":"medium"===this.size,"button--caret":this.caret,"button--circle":this.circle,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--loading":this.loading,"button--standard":!this.outline,"button--outline":this.outline,"button--pill":this.pill,"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})}
@@ -2326,7 +2326,7 @@ const Zt=t=>t??B;function Vt(t,e){const M={waitUntilFirstUpdate:!1,...e};return(
2326
2326
  cursor: pointer;
2327
2327
  margin-right: 12px;
2328
2328
  }
2329
- `;let Ye=class extends Pt{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.indeterminate=!1,this.defaultChecked=!1,this.helpText="",this.errorMessage="",this.showHelpText=!1,this.form="",this.required=!1}toggleHelpText(){this.showHelpText=!this.showHelpText}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("nile-change",{checked:this.checked}),this.emit("valueChange",{checked:this.checked})}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}connectedCallback(){super.connectedCallback(),this.updateHostClass(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}updated(t){super.updated(t),t.has("helpText")&&this.updateHostClass()}updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width")}render(){const t=!!this.helpText,e=!!this.errorMessage;return R`
2329
+ `;let fe=class extends Pt{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.indeterminate=!1,this.defaultChecked=!1,this.helpText="",this.errorMessage="",this.showHelpText=!1,this.form="",this.required=!1}toggleHelpText(){this.showHelpText=!this.showHelpText}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("nile-change",{checked:this.checked}),this.emit("valueChange",{checked:this.checked})}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}connectedCallback(){super.connectedCallback(),this.updateHostClass(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}updated(t){super.updated(t),t.has("helpText")&&this.updateHostClass()}updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width")}render(){const t=!!this.helpText,e=!!this.errorMessage;return R`
2330
2330
  <label
2331
2331
  part="base"
2332
2332
  class=${Lt({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--medium":"medium"===this.size})}
@@ -2387,7 +2387,7 @@ const Zt=t=>t??B;function Vt(t,e){const M={waitUntilFirstUpdate:!1,...e};return(
2387
2387
  >${this.errorMessage}</nile-form-error-message
2388
2388
  >
2389
2389
  `:""}
2390
- `}};Ye.styles=Ce,t([zt('input[type="checkbox"]')],Ye.prototype,"input",void 0),t([jt()],Ye.prototype,"hasFocus",void 0),t([gt()],Ye.prototype,"title",void 0),t([gt()],Ye.prototype,"name",void 0),t([gt()],Ye.prototype,"value",void 0),t([gt({reflect:!0})],Ye.prototype,"size",void 0),t([gt({type:Boolean,reflect:!0})],Ye.prototype,"disabled",void 0),t([gt({type:Boolean,reflect:!0})],Ye.prototype,"checked",void 0),t([gt({type:String,reflect:!0})],Ye.prototype,"label",void 0),t([gt({type:Boolean,reflect:!0})],Ye.prototype,"indeterminate",void 0),t([Jt("checked")],Ye.prototype,"defaultChecked",void 0),t([gt({attribute:"help-text",reflect:!0})],Ye.prototype,"helpText",void 0),t([gt({attribute:"error-message",reflect:!0})],Ye.prototype,"errorMessage",void 0),t([gt({type:Boolean})],Ye.prototype,"showHelpText",void 0),t([gt({reflect:!0})],Ye.prototype,"form",void 0),t([gt({type:Boolean,reflect:!0})],Ye.prototype,"required",void 0),t([Vt(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],Ye.prototype,"handleStateChange",null),Ye=t([at("nile-checkbox")],Ye);const be=n`
2390
+ `}};fe.styles=Ce,t([zt('input[type="checkbox"]')],fe.prototype,"input",void 0),t([jt()],fe.prototype,"hasFocus",void 0),t([gt()],fe.prototype,"title",void 0),t([gt()],fe.prototype,"name",void 0),t([gt()],fe.prototype,"value",void 0),t([gt({reflect:!0})],fe.prototype,"size",void 0),t([gt({type:Boolean,reflect:!0})],fe.prototype,"disabled",void 0),t([gt({type:Boolean,reflect:!0})],fe.prototype,"checked",void 0),t([gt({type:String,reflect:!0})],fe.prototype,"label",void 0),t([gt({type:Boolean,reflect:!0})],fe.prototype,"indeterminate",void 0),t([Jt("checked")],fe.prototype,"defaultChecked",void 0),t([gt({attribute:"help-text",reflect:!0})],fe.prototype,"helpText",void 0),t([gt({attribute:"error-message",reflect:!0})],fe.prototype,"errorMessage",void 0),t([gt({type:Boolean})],fe.prototype,"showHelpText",void 0),t([gt({reflect:!0})],fe.prototype,"form",void 0),t([gt({type:Boolean,reflect:!0})],fe.prototype,"required",void 0),t([Vt(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],fe.prototype,"handleStateChange",null),fe=t([at("nile-checkbox")],fe);const be=n`
2391
2391
  :host {
2392
2392
  display: block;
2393
2393
  }
@@ -2511,7 +2511,7 @@ const Zt=t=>t??B;function Vt(t,e){const M={waitUntilFirstUpdate:!1,...e};return(
2511
2511
  border-radius: 4px;
2512
2512
  border: 1px solid var(--Neutral-Normal, var(--nile-colors-neutral-400));
2513
2513
  }
2514
- `;let fe=class extends Pt{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.value="",this.size="medium",this.disabled=!1,this.islabelborder=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners(),this.emit("nile-init")}disconnectedCallback(){this.removeEventListeners(),this.emit("nile-destroy")}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return R`
2514
+ `;let Ye=class extends Pt{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.value="",this.size="medium",this.disabled=!1,this.islabelborder=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners(),this.emit("nile-init")}disconnectedCallback(){this.removeEventListeners(),this.emit("nile-destroy")}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return R`
2515
2515
  <span
2516
2516
  part="base"
2517
2517
  class=${Lt({radio:!0,"radio--checked":this.checked,"radio--disabled":this.disabled,"radio--focused":this.hasFocus,"radio--medium":"medium"===this.size,radio__label_border:this.islabelborder})}
@@ -2522,7 +2522,7 @@ const Zt=t=>t??B;function Vt(t,e){const M={waitUntilFirstUpdate:!1,...e};return(
2522
2522
 
2523
2523
  <slot part="label" class="radio__label"></slot>
2524
2524
  </span>
2525
- `}};fe.styles=be,t([gt({type:Boolean})],fe.prototype,"checked",void 0),t([jt()],fe.prototype,"hasFocus",void 0),t([gt()],fe.prototype,"value",void 0),t([gt({reflect:!0})],fe.prototype,"size",void 0),t([gt({type:Boolean,reflect:!0})],fe.prototype,"disabled",void 0),t([gt({type:Boolean,reflect:!0})],fe.prototype,"islabelborder",void 0),t([Vt("checked")],fe.prototype,"handleCheckedChange",null),t([Vt("disabled",{waitUntilFirstUpdate:!0})],fe.prototype,"handleDisabledChange",null),fe=t([at("nile-radio")],fe);var ve=n`
2525
+ `}};Ye.styles=be,t([gt({type:Boolean})],Ye.prototype,"checked",void 0),t([jt()],Ye.prototype,"hasFocus",void 0),t([gt()],Ye.prototype,"value",void 0),t([gt({reflect:!0})],Ye.prototype,"size",void 0),t([gt({type:Boolean,reflect:!0})],Ye.prototype,"disabled",void 0),t([gt({type:Boolean,reflect:!0})],Ye.prototype,"islabelborder",void 0),t([Vt("checked")],Ye.prototype,"handleCheckedChange",null),t([Vt("disabled",{waitUntilFirstUpdate:!0})],Ye.prototype,"handleDisabledChange",null),Ye=t([at("nile-radio")],Ye);var ve=n`
2526
2526
 
2527
2527
  :host {
2528
2528
  display: block;
@@ -2625,7 +2625,7 @@ const Zt=t=>t??B;function Vt(t,e){const M={waitUntilFirstUpdate:!1,...e};return(
2625
2625
  `:""}
2626
2626
 
2627
2627
  </fieldset>
2628
- `}};Ze.styles=ve,t([zt("slot:not([name])")],Ze.prototype,"defaultSlot",void 0),t([jt()],Ze.prototype,"hasButtonGroup",void 0),t([jt()],Ze.prototype,"defaultValue",void 0),t([gt()],Ze.prototype,"label",void 0),t([gt()],Ze.prototype,"name",void 0),t([gt({reflect:!0})],Ze.prototype,"value",void 0),t([gt({reflect:!0})],Ze.prototype,"form",void 0),t([gt({type:Boolean,reflect:!0})],Ze.prototype,"required",void 0),t([gt({type:Boolean,reflect:!0})],Ze.prototype,"labelInline",void 0),t([gt({type:Boolean,reflect:!0})],Ze.prototype,"disabled",void 0),t([gt({attribute:"help-text",reflect:!0})],Ze.prototype,"helpText",void 0),t([gt({attribute:"error-message",reflect:!0})],Ze.prototype,"errorMessage",void 0),t([gt({type:Boolean,reflect:!0})],Ze.prototype,"islabelborder",void 0),t([Vt("disabled",{waitUntilFirstUpdate:!0})],Ze.prototype,"handleDisabledChange",null),t([Vt("value")],Ze.prototype,"handleValueChange",null),Ze=t([at("nile-radio-group")],Ze);const Ve=Math.min,We=Math.max,Pe=Math.round,Re=Math.floor,Ge=t=>({x:t,y:t}),Be={left:"right",right:"left",bottom:"top",top:"bottom"},_e={start:"end",end:"start"};function Fe(t,e,M){return We(t,Ve(e,M))}function Je(t,e){return"function"==typeof t?t(e):t}function He(t){return t.split("-")[0]}function Xe(t){return t.split("-")[1]}function $e(t){return"x"===t?"y":"x"}function qe(t){return"y"===t?"height":"width"}function Ke(t){return["top","bottom"].includes(He(t))?"y":"x"}function tM(t){return $e(Ke(t))}function eM(t){return t.replace(/start|end/g,(t=>_e[t]))}function MM(t){return t.replace(/left|right|bottom|top/g,(t=>Be[t]))}function iM(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function NM(t){const{x:e,y:M,width:i,height:N}=t;return{width:i,height:N,top:M,left:e,right:e+i,bottom:M+N,x:e,y:M}}function oM(t,e,M){let{reference:i,floating:N}=t;const o=Ke(e),n=tM(e),s=qe(n),r=He(e),D="y"===o,a=i.x+i.width/2-N.width/2,l=i.y+i.height/2-N.height/2,u=i[s]/2-N[s]/2;let g;switch(r){case"top":g={x:a,y:i.y-N.height};break;case"bottom":g={x:a,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:l};break;case"left":g={x:i.x-N.width,y:l};break;default:g={x:i.x,y:i.y}}switch(Xe(e)){case"start":g[n]-=u*(M&&D?-1:1);break;case"end":g[n]+=u*(M&&D?-1:1)}return g}async function nM(t,e){var M;void 0===e&&(e={});const{x:i,y:N,platform:o,rects:n,elements:s,strategy:r}=t,{boundary:D="clippingAncestors",rootBoundary:a="viewport",elementContext:l="floating",altBoundary:u=!1,padding:g=0}=Je(e,t),j=iM(g),c=s[u?"floating"===l?"reference":"floating":l],z=NM(await o.getClippingRect({element:null==(M=await(null==o.isElement?void 0:o.isElement(c)))||M?c:c.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:D,rootBoundary:a,strategy:r})),I="floating"===l?{x:i,y:N,width:n.floating.width,height:n.floating.height}:n.reference,T=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),O=await(null==o.isElement?void 0:o.isElement(T))&&await(null==o.getScale?void 0:o.getScale(T))||{x:1,y:1},y=NM(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:I,offsetParent:T,strategy:r}):I);return{top:(z.top-y.top+j.top)/O.y,bottom:(y.bottom-z.bottom+j.bottom)/O.y,left:(z.left-y.left+j.left)/O.x,right:(y.right-z.right+j.right)/O.x}}function sM(){return"undefined"!=typeof window}function rM(t){return lM(t)?(t.nodeName||"").toLowerCase():"#document"}function DM(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function aM(t){var e;return null==(e=(lM(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function lM(t){return!!sM()&&(t instanceof Node||t instanceof DM(t).Node)}function uM(t){return!!sM()&&(t instanceof Element||t instanceof DM(t).Element)}function gM(t){return!!sM()&&(t instanceof HTMLElement||t instanceof DM(t).HTMLElement)}function jM(t){return!(!sM()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof DM(t).ShadowRoot)}function cM(t){const{overflow:e,overflowX:M,overflowY:i,display:N}=dM(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+M)&&!["inline","contents"].includes(N)}function zM(t){return["table","td","th"].includes(rM(t))}function IM(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function TM(t){const e=OM(),M=uM(t)?dM(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!M[t]&&"none"!==M[t]))||!!M.containerType&&"normal"!==M.containerType||!e&&!!M.backdropFilter&&"none"!==M.backdropFilter||!e&&!!M.filter&&"none"!==M.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(M.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(M.contain||"").includes(t)))}function OM(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function yM(t){return["html","body","#document"].includes(rM(t))}function dM(t){return DM(t).getComputedStyle(t)}function AM(t){return uM(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function hM(t){if("html"===rM(t))return t;const e=t.assignedSlot||t.parentNode||jM(t)&&t.host||aM(t);return jM(e)?e.host:e}function LM(t){const e=hM(t);return yM(e)?t.ownerDocument?t.ownerDocument.body:t.body:gM(e)&&cM(e)?e:LM(e)}function xM(t,e,M){var i;void 0===e&&(e=[]),void 0===M&&(M=!0);const N=LM(t),o=N===(null==(i=t.ownerDocument)?void 0:i.body),n=DM(N);if(o){const t=pM(n);return e.concat(n,n.visualViewport||[],cM(N)?N:[],t&&M?xM(t):[])}return e.concat(N,xM(N,[],M))}function pM(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function SM(t){const e=dM(t);let M=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const N=gM(t),o=N?t.offsetWidth:M,n=N?t.offsetHeight:i,s=Pe(M)!==o||Pe(i)!==n;return s&&(M=o,i=n),{width:M,height:i,$:s}}function QM(t){return uM(t)?t:t.contextElement}function EM(t){const e=QM(t);if(!gM(e))return Ge(1);const M=e.getBoundingClientRect(),{width:i,height:N,$:o}=SM(e);let n=(o?Pe(M.width):M.width)/i,s=(o?Pe(M.height):M.height)/N;return n&&Number.isFinite(n)||(n=1),s&&Number.isFinite(s)||(s=1),{x:n,y:s}}const kM=Ge(0);function wM(t){const e=DM(t);return OM()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:kM}function mM(t,e,M,i){void 0===e&&(e=!1),void 0===M&&(M=!1);const N=t.getBoundingClientRect(),o=QM(t);let n=Ge(1);e&&(i?uM(i)&&(n=EM(i)):n=EM(t));const s=function(t,e,M){return void 0===e&&(e=!1),!(!M||e&&M!==DM(t))&&e}(o,M,i)?wM(o):Ge(0);let r=(N.left+s.x)/n.x,D=(N.top+s.y)/n.y,a=N.width/n.x,l=N.height/n.y;if(o){const t=DM(o),e=i&&uM(i)?DM(i):i;let M=t,N=pM(M);for(;N&&i&&e!==M;){const t=EM(N),e=N.getBoundingClientRect(),i=dM(N),o=e.left+(N.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(N.clientTop+parseFloat(i.paddingTop))*t.y;r*=t.x,D*=t.y,a*=t.x,l*=t.y,r+=o,D+=n,M=DM(N),N=pM(M)}}return NM({width:a,height:l,x:r,y:D})}function UM(t,e){const M=AM(t).scrollLeft;return e?e.left+M:mM(aM(t)).left+M}function CM(t,e,M){void 0===M&&(M=!1);const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-(M?0:UM(t,i)),y:i.top+e.scrollTop}}function YM(t,e,M){let i;if("viewport"===e)i=function(t,e){const M=DM(t),i=aM(t),N=M.visualViewport;let o=i.clientWidth,n=i.clientHeight,s=0,r=0;if(N){o=N.width,n=N.height;const t=OM();(!t||t&&"fixed"===e)&&(s=N.offsetLeft,r=N.offsetTop)}return{width:o,height:n,x:s,y:r}}(t,M);else if("document"===e)i=function(t){const e=aM(t),M=AM(t),i=t.ownerDocument.body,N=We(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=We(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let n=-M.scrollLeft+UM(t);const s=-M.scrollTop;return"rtl"===dM(i).direction&&(n+=We(e.clientWidth,i.clientWidth)-N),{width:N,height:o,x:n,y:s}}(aM(t));else if(uM(e))i=function(t,e){const M=mM(t,!0,"fixed"===e),i=M.top+t.clientTop,N=M.left+t.clientLeft,o=gM(t)?EM(t):Ge(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:N*o.x,y:i*o.y}}(e,M);else{const M=wM(t);i={x:e.x-M.x,y:e.y-M.y,width:e.width,height:e.height}}return NM(i)}function bM(t,e){const M=hM(t);return!(M===e||!uM(M)||yM(M))&&("fixed"===dM(M).position||bM(M,e))}function fM(t,e,M){const i=gM(e),N=aM(e),o="fixed"===M,n=mM(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const r=Ge(0);if(i||!i&&!o)if(("body"!==rM(e)||cM(N))&&(s=AM(e)),i){const t=mM(e,!0,o,e);r.x=t.x+e.clientLeft,r.y=t.y+e.clientTop}else N&&(r.x=UM(N));const D=!N||i||o?Ge(0):CM(N,s);return{x:n.left+s.scrollLeft-r.x-D.x,y:n.top+s.scrollTop-r.y-D.y,width:n.width,height:n.height}}function vM(t){return"static"===dM(t).position}function ZM(t,e){if(!gM(t)||"fixed"===dM(t).position)return null;if(e)return e(t);let M=t.offsetParent;return aM(t)===M&&(M=M.ownerDocument.body),M}function VM(t,e){const M=DM(t);if(IM(t))return M;if(!gM(t)){let e=hM(t);for(;e&&!yM(e);){if(uM(e)&&!vM(e))return e;e=hM(e)}return M}let i=ZM(t,e);for(;i&&zM(i)&&vM(i);)i=ZM(i,e);return i&&yM(i)&&vM(i)&&!TM(i)?M:i||function(t){let e=hM(t);for(;gM(e)&&!yM(e);){if(TM(e))return e;if(IM(e))return null;e=hM(e)}return null}(t)||M}const WM={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:M,offsetParent:i,strategy:N}=t;const o="fixed"===N,n=aM(i),s=!!e&&IM(e.floating);if(i===n||s&&o)return M;let r={scrollLeft:0,scrollTop:0},D=Ge(1);const a=Ge(0),l=gM(i);if((l||!l&&!o)&&(("body"!==rM(i)||cM(n))&&(r=AM(i)),gM(i))){const t=mM(i);D=EM(i),a.x=t.x+i.clientLeft,a.y=t.y+i.clientTop}const u=!n||l||o?Ge(0):CM(n,r,!0);return{width:M.width*D.x,height:M.height*D.y,x:M.x*D.x-r.scrollLeft*D.x+a.x+u.x,y:M.y*D.y-r.scrollTop*D.y+a.y+u.y}},getDocumentElement:aM,getClippingRect:function(t){let{element:e,boundary:M,rootBoundary:i,strategy:N}=t;const o="clippingAncestors"===M?IM(e)?[]:function(t,e){const M=e.get(t);if(M)return M;let i=xM(t,[],!1).filter((t=>uM(t)&&"body"!==rM(t))),N=null;const o="fixed"===dM(t).position;let n=o?hM(t):t;for(;uM(n)&&!yM(n);){const e=dM(n),M=TM(n);M||"fixed"!==e.position||(N=null),(o?!M&&!N:!M&&"static"===e.position&&N&&["absolute","fixed"].includes(N.position)||cM(n)&&!M&&bM(t,n))?i=i.filter((t=>t!==n)):N=e,n=hM(n)}return e.set(t,i),i}(e,this._c):[].concat(M),n=[...o,i],s=n[0],r=n.reduce(((t,M)=>{const i=YM(e,M,N);return t.top=We(i.top,t.top),t.right=Ve(i.right,t.right),t.bottom=Ve(i.bottom,t.bottom),t.left=We(i.left,t.left),t}),YM(e,s,N));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:VM,getElementRects:async function(t){const e=this.getOffsetParent||VM,M=this.getDimensions,i=await M(t.floating);return{reference:fM(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:M}=SM(t);return{width:e,height:M}},getScale:EM,isElement:uM,isRTL:function(t){return"rtl"===dM(t).direction}};function PM(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function RM(t,e,M,i){void 0===i&&(i={});const{ancestorScroll:N=!0,ancestorResize:o=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:r=!1}=i,D=QM(t),a=N||o?[...D?xM(D):[],...xM(e)]:[];a.forEach((t=>{N&&t.addEventListener("scroll",M,{passive:!0}),o&&t.addEventListener("resize",M)}));const l=D&&s?function(t,e){let M,i=null;const N=aM(t);function o(){var t;clearTimeout(M),null==(t=i)||t.disconnect(),i=null}return function n(s,r){void 0===s&&(s=!1),void 0===r&&(r=1),o();const D=t.getBoundingClientRect(),{left:a,top:l,width:u,height:g}=D;if(s||e(),!u||!g)return;const j={rootMargin:-Re(l)+"px "+-Re(N.clientWidth-(a+u))+"px "+-Re(N.clientHeight-(l+g))+"px "+-Re(a)+"px",threshold:We(0,Ve(1,r))||1};let c=!0;function z(e){const i=e[0].intersectionRatio;if(i!==r){if(!c)return n();i?n(!1,i):M=setTimeout((()=>{n(!1,1e-7)}),1e3)}1!==i||PM(D,t.getBoundingClientRect())||n(),c=!1}try{i=new IntersectionObserver(z,{...j,root:N.ownerDocument})}catch(t){i=new IntersectionObserver(z,j)}i.observe(t)}(!0),o}(D,M):null;let u,g=-1,j=null;n&&(j=new ResizeObserver((t=>{let[i]=t;i&&i.target===D&&j&&(j.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{var t;null==(t=j)||t.observe(e)}))),M()})),D&&!r&&j.observe(D),j.observe(e));let c=r?mM(t):null;return r&&function e(){const i=mM(t);c&&!PM(c,i)&&M();c=i,u=requestAnimationFrame(e)}(),M(),()=>{var t;a.forEach((t=>{N&&t.removeEventListener("scroll",M),o&&t.removeEventListener("resize",M)})),null==l||l(),null==(t=j)||t.disconnect(),j=null,r&&cancelAnimationFrame(u)}}const GM=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var M,i;const{x:N,y:o,placement:n,middlewareData:s}=e,r=await async function(t,e){const{placement:M,platform:i,elements:N}=t,o=await(null==i.isRTL?void 0:i.isRTL(N.floating)),n=He(M),s=Xe(M),r="y"===Ke(M),D=["left","top"].includes(n)?-1:1,a=o&&r?-1:1,l=Je(e,t);let{mainAxis:u,crossAxis:g,alignmentAxis:j}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&"number"==typeof j&&(g="end"===s?-1*j:j),r?{x:g*a,y:u*D}:{x:u*D,y:g*a}}(e,t);return n===(null==(M=s.offset)?void 0:M.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:N+r.x,y:o+r.y,data:{...r,placement:n}}}}},BM=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:M,y:i,placement:N}=e,{mainAxis:o=!0,crossAxis:n=!1,limiter:s={fn:t=>{let{x:e,y:M}=t;return{x:e,y:M}}},...r}=Je(t,e),D={x:M,y:i},a=await nM(e,r),l=Ke(He(N)),u=$e(l);let g=D[u],j=D[l];if(o){const t="y"===u?"bottom":"right";g=Fe(g+a["y"===u?"top":"left"],g,g-a[t])}if(n){const t="y"===l?"bottom":"right";j=Fe(j+a["y"===l?"top":"left"],j,j-a[t])}const c=s.fn({...e,[u]:g,[l]:j});return{...c,data:{x:c.x-M,y:c.y-i,enabled:{[u]:o,[l]:n}}}}}},_M=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var M,i;const{placement:N,middlewareData:o,rects:n,initialPlacement:s,platform:r,elements:D}=e,{mainAxis:a=!0,crossAxis:l=!0,fallbackPlacements:u,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:c=!0,...z}=Je(t,e);if(null!=(M=o.arrow)&&M.alignmentOffset)return{};const I=He(N),T=Ke(s),O=He(s)===s,y=await(null==r.isRTL?void 0:r.isRTL(D.floating)),d=u||(O||!c?[MM(s)]:function(t){const e=MM(t);return[eM(t),e,eM(e)]}(s)),A="none"!==j;!u&&A&&d.push(...function(t,e,M,i){const N=Xe(t);let o=function(t,e,M){const i=["left","right"],N=["right","left"],o=["top","bottom"],n=["bottom","top"];switch(t){case"top":case"bottom":return M?e?N:i:e?i:N;case"left":case"right":return e?o:n;default:return[]}}(He(t),"start"===M,i);return N&&(o=o.map((t=>t+"-"+N)),e&&(o=o.concat(o.map(eM)))),o}(s,c,j,y));const h=[s,...d],L=await nM(e,z),x=[];let p=(null==(i=o.flip)?void 0:i.overflows)||[];if(a&&x.push(L[I]),l){const t=function(t,e,M){void 0===M&&(M=!1);const i=Xe(t),N=tM(t),o=qe(N);let n="x"===N?i===(M?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(n=MM(n)),[n,MM(n)]}(N,n,y);x.push(L[t[0]],L[t[1]])}if(p=[...p,{placement:N,overflows:x}],!x.every((t=>t<=0))){var S,Q;const t=((null==(S=o.flip)?void 0:S.index)||0)+1,e=h[t];if(e)return{data:{index:t,overflows:p},reset:{placement:e}};let M=null==(Q=p.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:Q.placement;if(!M)switch(g){case"bestFit":{var E;const t=null==(E=p.filter((t=>{if(A){const e=Ke(t.placement);return e===T||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:E[0];t&&(M=t);break}case"initialPlacement":M=s}if(N!==M)return{reset:{placement:M}}}return{}}}},FM=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var M,i;const{placement:N,rects:o,platform:n,elements:s}=e,{apply:r=()=>{},...D}=Je(t,e),a=await nM(e,D),l=He(N),u=Xe(N),g="y"===Ke(N),{width:j,height:c}=o.floating;let z,I;"top"===l||"bottom"===l?(z=l,I=u===(await(null==n.isRTL?void 0:n.isRTL(s.floating))?"start":"end")?"left":"right"):(I=l,z="end"===u?"top":"bottom");const T=c-a.top-a.bottom,O=j-a.left-a.right,y=Ve(c-a[z],T),d=Ve(j-a[I],O),A=!e.middlewareData.shift;let h=y,L=d;if(null!=(M=e.middlewareData.shift)&&M.enabled.x&&(L=O),null!=(i=e.middlewareData.shift)&&i.enabled.y&&(h=T),A&&!u){const t=We(a.left,0),e=We(a.right,0),M=We(a.top,0),i=We(a.bottom,0);g?L=j-2*(0!==t||0!==e?t+e:We(a.left,a.right)):h=c-2*(0!==M||0!==i?M+i:We(a.top,a.bottom))}await r({...e,availableWidth:L,availableHeight:h});const x=await n.getDimensions(s.floating);return j!==x.width||c!==x.height?{reset:{rects:!0}}:{}}}},JM=t=>({name:"arrow",options:t,async fn(e){const{x:M,y:i,placement:N,rects:o,platform:n,elements:s,middlewareData:r}=e,{element:D,padding:a=0}=Je(t,e)||{};if(null==D)return{};const l=iM(a),u={x:M,y:i},g=tM(N),j=qe(g),c=await n.getDimensions(D),z="y"===g,I=z?"top":"left",T=z?"bottom":"right",O=z?"clientHeight":"clientWidth",y=o.reference[j]+o.reference[g]-u[g]-o.floating[j],d=u[g]-o.reference[g],A=await(null==n.getOffsetParent?void 0:n.getOffsetParent(D));let h=A?A[O]:0;h&&await(null==n.isElement?void 0:n.isElement(A))||(h=s.floating[O]||o.floating[j]);const L=y/2-d/2,x=h/2-c[j]/2-1,p=Ve(l[I],x),S=Ve(l[T],x),Q=p,E=h-c[j]-S,k=h/2-c[j]/2+L,w=Fe(Q,k,E),m=!r.arrow&&null!=Xe(N)&&k!==w&&o.reference[j]/2-(k<Q?p:S)-c[j]/2<0,U=m?k<Q?k-Q:k-E:0;return{[g]:u[g]+U,data:{[g]:w,centerOffset:k-w-U,...m&&{alignmentOffset:U}},reset:m}}}),HM=(t,e,M)=>{const i=new Map,N={platform:WM,...M},o={...N.platform,_c:i};return(async(t,e,M)=>{const{placement:i="bottom",strategy:N="absolute",middleware:o=[],platform:n}=M,s=o.filter(Boolean),r=await(null==n.isRTL?void 0:n.isRTL(e));let D=await n.getElementRects({reference:t,floating:e,strategy:N}),{x:a,y:l}=oM(D,i,r),u=i,g={},j=0;for(let M=0;M<s.length;M++){const{name:o,fn:c}=s[M],{x:z,y:I,data:T,reset:O}=await c({x:a,y:l,initialPlacement:i,placement:u,strategy:N,middlewareData:g,rects:D,platform:n,elements:{reference:t,floating:e}});a=null!=z?z:a,l=null!=I?I:l,g={...g,[o]:{...g[o],...T}},O&&j<=50&&(j++,"object"==typeof O&&(O.placement&&(u=O.placement),O.rects&&(D=!0===O.rects?await n.getElementRects({reference:t,floating:e,strategy:N}):O.rects),({x:a,y:l}=oM(D,u,r))),M=-1)}return{x:a,y:l,placement:u,strategy:N,middlewareData:g}})(t,e,{...N,platform:o})};function XM(t){return function(t){for(let e=t;e;e=$M(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=$M(t);e;e=$M(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}(t)}function $M(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}const qM=n`
2628
+ `}};Ze.styles=ve,t([zt("slot:not([name])")],Ze.prototype,"defaultSlot",void 0),t([jt()],Ze.prototype,"hasButtonGroup",void 0),t([jt()],Ze.prototype,"defaultValue",void 0),t([gt()],Ze.prototype,"label",void 0),t([gt()],Ze.prototype,"name",void 0),t([gt({reflect:!0})],Ze.prototype,"value",void 0),t([gt({reflect:!0})],Ze.prototype,"form",void 0),t([gt({type:Boolean,reflect:!0})],Ze.prototype,"required",void 0),t([gt({type:Boolean,reflect:!0})],Ze.prototype,"labelInline",void 0),t([gt({type:Boolean,reflect:!0})],Ze.prototype,"disabled",void 0),t([gt({attribute:"help-text",reflect:!0})],Ze.prototype,"helpText",void 0),t([gt({attribute:"error-message",reflect:!0})],Ze.prototype,"errorMessage",void 0),t([gt({type:Boolean,reflect:!0})],Ze.prototype,"islabelborder",void 0),t([Vt("disabled",{waitUntilFirstUpdate:!0})],Ze.prototype,"handleDisabledChange",null),t([Vt("value")],Ze.prototype,"handleValueChange",null),Ze=t([at("nile-radio-group")],Ze);const Ve=Math.min,We=Math.max,Pe=Math.round,Re=Math.floor,Ge=t=>({x:t,y:t}),Be={left:"right",right:"left",bottom:"top",top:"bottom"},_e={start:"end",end:"start"};function Fe(t,e,M){return We(t,Ve(e,M))}function Je(t,e){return"function"==typeof t?t(e):t}function He(t){return t.split("-")[0]}function Xe(t){return t.split("-")[1]}function $e(t){return"x"===t?"y":"x"}function qe(t){return"y"===t?"height":"width"}function Ke(t){return["top","bottom"].includes(He(t))?"y":"x"}function tM(t){return $e(Ke(t))}function eM(t){return t.replace(/start|end/g,(t=>_e[t]))}function MM(t){return t.replace(/left|right|bottom|top/g,(t=>Be[t]))}function iM(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function NM(t){const{x:e,y:M,width:i,height:N}=t;return{width:i,height:N,top:M,left:e,right:e+i,bottom:M+N,x:e,y:M}}function oM(t,e,M){let{reference:i,floating:N}=t;const o=Ke(e),n=tM(e),s=qe(n),r=He(e),D="y"===o,a=i.x+i.width/2-N.width/2,l=i.y+i.height/2-N.height/2,u=i[s]/2-N[s]/2;let g;switch(r){case"top":g={x:a,y:i.y-N.height};break;case"bottom":g={x:a,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:l};break;case"left":g={x:i.x-N.width,y:l};break;default:g={x:i.x,y:i.y}}switch(Xe(e)){case"start":g[n]-=u*(M&&D?-1:1);break;case"end":g[n]+=u*(M&&D?-1:1)}return g}async function nM(t,e){var M;void 0===e&&(e={});const{x:i,y:N,platform:o,rects:n,elements:s,strategy:r}=t,{boundary:D="clippingAncestors",rootBoundary:a="viewport",elementContext:l="floating",altBoundary:u=!1,padding:g=0}=Je(e,t),j=iM(g),c=s[u?"floating"===l?"reference":"floating":l],z=NM(await o.getClippingRect({element:null==(M=await(null==o.isElement?void 0:o.isElement(c)))||M?c:c.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:D,rootBoundary:a,strategy:r})),I="floating"===l?{x:i,y:N,width:n.floating.width,height:n.floating.height}:n.reference,T=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),O=await(null==o.isElement?void 0:o.isElement(T))&&await(null==o.getScale?void 0:o.getScale(T))||{x:1,y:1},y=NM(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:I,offsetParent:T,strategy:r}):I);return{top:(z.top-y.top+j.top)/O.y,bottom:(y.bottom-z.bottom+j.bottom)/O.y,left:(z.left-y.left+j.left)/O.x,right:(y.right-z.right+j.right)/O.x}}function sM(){return"undefined"!=typeof window}function rM(t){return lM(t)?(t.nodeName||"").toLowerCase():"#document"}function DM(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function aM(t){var e;return null==(e=(lM(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function lM(t){return!!sM()&&(t instanceof Node||t instanceof DM(t).Node)}function uM(t){return!!sM()&&(t instanceof Element||t instanceof DM(t).Element)}function gM(t){return!!sM()&&(t instanceof HTMLElement||t instanceof DM(t).HTMLElement)}function jM(t){return!(!sM()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof DM(t).ShadowRoot)}function cM(t){const{overflow:e,overflowX:M,overflowY:i,display:N}=dM(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+M)&&!["inline","contents"].includes(N)}function zM(t){return["table","td","th"].includes(rM(t))}function IM(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function TM(t){const e=OM(),M=uM(t)?dM(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!M[t]&&"none"!==M[t]))||!!M.containerType&&"normal"!==M.containerType||!e&&!!M.backdropFilter&&"none"!==M.backdropFilter||!e&&!!M.filter&&"none"!==M.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(M.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(M.contain||"").includes(t)))}function OM(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function yM(t){return["html","body","#document"].includes(rM(t))}function dM(t){return DM(t).getComputedStyle(t)}function AM(t){return uM(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function hM(t){if("html"===rM(t))return t;const e=t.assignedSlot||t.parentNode||jM(t)&&t.host||aM(t);return jM(e)?e.host:e}function LM(t){const e=hM(t);return yM(e)?t.ownerDocument?t.ownerDocument.body:t.body:gM(e)&&cM(e)?e:LM(e)}function xM(t,e,M){var i;void 0===e&&(e=[]),void 0===M&&(M=!0);const N=LM(t),o=N===(null==(i=t.ownerDocument)?void 0:i.body),n=DM(N);if(o){const t=pM(n);return e.concat(n,n.visualViewport||[],cM(N)?N:[],t&&M?xM(t):[])}return e.concat(N,xM(N,[],M))}function pM(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function SM(t){const e=dM(t);let M=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const N=gM(t),o=N?t.offsetWidth:M,n=N?t.offsetHeight:i,s=Pe(M)!==o||Pe(i)!==n;return s&&(M=o,i=n),{width:M,height:i,$:s}}function QM(t){return uM(t)?t:t.contextElement}function EM(t){const e=QM(t);if(!gM(e))return Ge(1);const M=e.getBoundingClientRect(),{width:i,height:N,$:o}=SM(e);let n=(o?Pe(M.width):M.width)/i,s=(o?Pe(M.height):M.height)/N;return n&&Number.isFinite(n)||(n=1),s&&Number.isFinite(s)||(s=1),{x:n,y:s}}const kM=Ge(0);function wM(t){const e=DM(t);return OM()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:kM}function mM(t,e,M,i){void 0===e&&(e=!1),void 0===M&&(M=!1);const N=t.getBoundingClientRect(),o=QM(t);let n=Ge(1);e&&(i?uM(i)&&(n=EM(i)):n=EM(t));const s=function(t,e,M){return void 0===e&&(e=!1),!(!M||e&&M!==DM(t))&&e}(o,M,i)?wM(o):Ge(0);let r=(N.left+s.x)/n.x,D=(N.top+s.y)/n.y,a=N.width/n.x,l=N.height/n.y;if(o){const t=DM(o),e=i&&uM(i)?DM(i):i;let M=t,N=pM(M);for(;N&&i&&e!==M;){const t=EM(N),e=N.getBoundingClientRect(),i=dM(N),o=e.left+(N.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(N.clientTop+parseFloat(i.paddingTop))*t.y;r*=t.x,D*=t.y,a*=t.x,l*=t.y,r+=o,D+=n,M=DM(N),N=pM(M)}}return NM({width:a,height:l,x:r,y:D})}function UM(t,e){const M=AM(t).scrollLeft;return e?e.left+M:mM(aM(t)).left+M}function CM(t,e,M){void 0===M&&(M=!1);const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-(M?0:UM(t,i)),y:i.top+e.scrollTop}}function fM(t,e,M){let i;if("viewport"===e)i=function(t,e){const M=DM(t),i=aM(t),N=M.visualViewport;let o=i.clientWidth,n=i.clientHeight,s=0,r=0;if(N){o=N.width,n=N.height;const t=OM();(!t||t&&"fixed"===e)&&(s=N.offsetLeft,r=N.offsetTop)}return{width:o,height:n,x:s,y:r}}(t,M);else if("document"===e)i=function(t){const e=aM(t),M=AM(t),i=t.ownerDocument.body,N=We(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=We(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let n=-M.scrollLeft+UM(t);const s=-M.scrollTop;return"rtl"===dM(i).direction&&(n+=We(e.clientWidth,i.clientWidth)-N),{width:N,height:o,x:n,y:s}}(aM(t));else if(uM(e))i=function(t,e){const M=mM(t,!0,"fixed"===e),i=M.top+t.clientTop,N=M.left+t.clientLeft,o=gM(t)?EM(t):Ge(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:N*o.x,y:i*o.y}}(e,M);else{const M=wM(t);i={x:e.x-M.x,y:e.y-M.y,width:e.width,height:e.height}}return NM(i)}function bM(t,e){const M=hM(t);return!(M===e||!uM(M)||yM(M))&&("fixed"===dM(M).position||bM(M,e))}function YM(t,e,M){const i=gM(e),N=aM(e),o="fixed"===M,n=mM(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const r=Ge(0);if(i||!i&&!o)if(("body"!==rM(e)||cM(N))&&(s=AM(e)),i){const t=mM(e,!0,o,e);r.x=t.x+e.clientLeft,r.y=t.y+e.clientTop}else N&&(r.x=UM(N));const D=!N||i||o?Ge(0):CM(N,s);return{x:n.left+s.scrollLeft-r.x-D.x,y:n.top+s.scrollTop-r.y-D.y,width:n.width,height:n.height}}function vM(t){return"static"===dM(t).position}function ZM(t,e){if(!gM(t)||"fixed"===dM(t).position)return null;if(e)return e(t);let M=t.offsetParent;return aM(t)===M&&(M=M.ownerDocument.body),M}function VM(t,e){const M=DM(t);if(IM(t))return M;if(!gM(t)){let e=hM(t);for(;e&&!yM(e);){if(uM(e)&&!vM(e))return e;e=hM(e)}return M}let i=ZM(t,e);for(;i&&zM(i)&&vM(i);)i=ZM(i,e);return i&&yM(i)&&vM(i)&&!TM(i)?M:i||function(t){let e=hM(t);for(;gM(e)&&!yM(e);){if(TM(e))return e;if(IM(e))return null;e=hM(e)}return null}(t)||M}const WM={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:M,offsetParent:i,strategy:N}=t;const o="fixed"===N,n=aM(i),s=!!e&&IM(e.floating);if(i===n||s&&o)return M;let r={scrollLeft:0,scrollTop:0},D=Ge(1);const a=Ge(0),l=gM(i);if((l||!l&&!o)&&(("body"!==rM(i)||cM(n))&&(r=AM(i)),gM(i))){const t=mM(i);D=EM(i),a.x=t.x+i.clientLeft,a.y=t.y+i.clientTop}const u=!n||l||o?Ge(0):CM(n,r,!0);return{width:M.width*D.x,height:M.height*D.y,x:M.x*D.x-r.scrollLeft*D.x+a.x+u.x,y:M.y*D.y-r.scrollTop*D.y+a.y+u.y}},getDocumentElement:aM,getClippingRect:function(t){let{element:e,boundary:M,rootBoundary:i,strategy:N}=t;const o="clippingAncestors"===M?IM(e)?[]:function(t,e){const M=e.get(t);if(M)return M;let i=xM(t,[],!1).filter((t=>uM(t)&&"body"!==rM(t))),N=null;const o="fixed"===dM(t).position;let n=o?hM(t):t;for(;uM(n)&&!yM(n);){const e=dM(n),M=TM(n);M||"fixed"!==e.position||(N=null),(o?!M&&!N:!M&&"static"===e.position&&N&&["absolute","fixed"].includes(N.position)||cM(n)&&!M&&bM(t,n))?i=i.filter((t=>t!==n)):N=e,n=hM(n)}return e.set(t,i),i}(e,this._c):[].concat(M),n=[...o,i],s=n[0],r=n.reduce(((t,M)=>{const i=fM(e,M,N);return t.top=We(i.top,t.top),t.right=Ve(i.right,t.right),t.bottom=Ve(i.bottom,t.bottom),t.left=We(i.left,t.left),t}),fM(e,s,N));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:VM,getElementRects:async function(t){const e=this.getOffsetParent||VM,M=this.getDimensions,i=await M(t.floating);return{reference:YM(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:M}=SM(t);return{width:e,height:M}},getScale:EM,isElement:uM,isRTL:function(t){return"rtl"===dM(t).direction}};function PM(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function RM(t,e,M,i){void 0===i&&(i={});const{ancestorScroll:N=!0,ancestorResize:o=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:r=!1}=i,D=QM(t),a=N||o?[...D?xM(D):[],...xM(e)]:[];a.forEach((t=>{N&&t.addEventListener("scroll",M,{passive:!0}),o&&t.addEventListener("resize",M)}));const l=D&&s?function(t,e){let M,i=null;const N=aM(t);function o(){var t;clearTimeout(M),null==(t=i)||t.disconnect(),i=null}return function n(s,r){void 0===s&&(s=!1),void 0===r&&(r=1),o();const D=t.getBoundingClientRect(),{left:a,top:l,width:u,height:g}=D;if(s||e(),!u||!g)return;const j={rootMargin:-Re(l)+"px "+-Re(N.clientWidth-(a+u))+"px "+-Re(N.clientHeight-(l+g))+"px "+-Re(a)+"px",threshold:We(0,Ve(1,r))||1};let c=!0;function z(e){const i=e[0].intersectionRatio;if(i!==r){if(!c)return n();i?n(!1,i):M=setTimeout((()=>{n(!1,1e-7)}),1e3)}1!==i||PM(D,t.getBoundingClientRect())||n(),c=!1}try{i=new IntersectionObserver(z,{...j,root:N.ownerDocument})}catch(t){i=new IntersectionObserver(z,j)}i.observe(t)}(!0),o}(D,M):null;let u,g=-1,j=null;n&&(j=new ResizeObserver((t=>{let[i]=t;i&&i.target===D&&j&&(j.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{var t;null==(t=j)||t.observe(e)}))),M()})),D&&!r&&j.observe(D),j.observe(e));let c=r?mM(t):null;return r&&function e(){const i=mM(t);c&&!PM(c,i)&&M();c=i,u=requestAnimationFrame(e)}(),M(),()=>{var t;a.forEach((t=>{N&&t.removeEventListener("scroll",M),o&&t.removeEventListener("resize",M)})),null==l||l(),null==(t=j)||t.disconnect(),j=null,r&&cancelAnimationFrame(u)}}const GM=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var M,i;const{x:N,y:o,placement:n,middlewareData:s}=e,r=await async function(t,e){const{placement:M,platform:i,elements:N}=t,o=await(null==i.isRTL?void 0:i.isRTL(N.floating)),n=He(M),s=Xe(M),r="y"===Ke(M),D=["left","top"].includes(n)?-1:1,a=o&&r?-1:1,l=Je(e,t);let{mainAxis:u,crossAxis:g,alignmentAxis:j}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&"number"==typeof j&&(g="end"===s?-1*j:j),r?{x:g*a,y:u*D}:{x:u*D,y:g*a}}(e,t);return n===(null==(M=s.offset)?void 0:M.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:N+r.x,y:o+r.y,data:{...r,placement:n}}}}},BM=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:M,y:i,placement:N}=e,{mainAxis:o=!0,crossAxis:n=!1,limiter:s={fn:t=>{let{x:e,y:M}=t;return{x:e,y:M}}},...r}=Je(t,e),D={x:M,y:i},a=await nM(e,r),l=Ke(He(N)),u=$e(l);let g=D[u],j=D[l];if(o){const t="y"===u?"bottom":"right";g=Fe(g+a["y"===u?"top":"left"],g,g-a[t])}if(n){const t="y"===l?"bottom":"right";j=Fe(j+a["y"===l?"top":"left"],j,j-a[t])}const c=s.fn({...e,[u]:g,[l]:j});return{...c,data:{x:c.x-M,y:c.y-i,enabled:{[u]:o,[l]:n}}}}}},_M=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var M,i;const{placement:N,middlewareData:o,rects:n,initialPlacement:s,platform:r,elements:D}=e,{mainAxis:a=!0,crossAxis:l=!0,fallbackPlacements:u,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:c=!0,...z}=Je(t,e);if(null!=(M=o.arrow)&&M.alignmentOffset)return{};const I=He(N),T=Ke(s),O=He(s)===s,y=await(null==r.isRTL?void 0:r.isRTL(D.floating)),d=u||(O||!c?[MM(s)]:function(t){const e=MM(t);return[eM(t),e,eM(e)]}(s)),A="none"!==j;!u&&A&&d.push(...function(t,e,M,i){const N=Xe(t);let o=function(t,e,M){const i=["left","right"],N=["right","left"],o=["top","bottom"],n=["bottom","top"];switch(t){case"top":case"bottom":return M?e?N:i:e?i:N;case"left":case"right":return e?o:n;default:return[]}}(He(t),"start"===M,i);return N&&(o=o.map((t=>t+"-"+N)),e&&(o=o.concat(o.map(eM)))),o}(s,c,j,y));const h=[s,...d],L=await nM(e,z),x=[];let p=(null==(i=o.flip)?void 0:i.overflows)||[];if(a&&x.push(L[I]),l){const t=function(t,e,M){void 0===M&&(M=!1);const i=Xe(t),N=tM(t),o=qe(N);let n="x"===N?i===(M?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(n=MM(n)),[n,MM(n)]}(N,n,y);x.push(L[t[0]],L[t[1]])}if(p=[...p,{placement:N,overflows:x}],!x.every((t=>t<=0))){var S,Q;const t=((null==(S=o.flip)?void 0:S.index)||0)+1,e=h[t];if(e)return{data:{index:t,overflows:p},reset:{placement:e}};let M=null==(Q=p.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:Q.placement;if(!M)switch(g){case"bestFit":{var E;const t=null==(E=p.filter((t=>{if(A){const e=Ke(t.placement);return e===T||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:E[0];t&&(M=t);break}case"initialPlacement":M=s}if(N!==M)return{reset:{placement:M}}}return{}}}},FM=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var M,i;const{placement:N,rects:o,platform:n,elements:s}=e,{apply:r=()=>{},...D}=Je(t,e),a=await nM(e,D),l=He(N),u=Xe(N),g="y"===Ke(N),{width:j,height:c}=o.floating;let z,I;"top"===l||"bottom"===l?(z=l,I=u===(await(null==n.isRTL?void 0:n.isRTL(s.floating))?"start":"end")?"left":"right"):(I=l,z="end"===u?"top":"bottom");const T=c-a.top-a.bottom,O=j-a.left-a.right,y=Ve(c-a[z],T),d=Ve(j-a[I],O),A=!e.middlewareData.shift;let h=y,L=d;if(null!=(M=e.middlewareData.shift)&&M.enabled.x&&(L=O),null!=(i=e.middlewareData.shift)&&i.enabled.y&&(h=T),A&&!u){const t=We(a.left,0),e=We(a.right,0),M=We(a.top,0),i=We(a.bottom,0);g?L=j-2*(0!==t||0!==e?t+e:We(a.left,a.right)):h=c-2*(0!==M||0!==i?M+i:We(a.top,a.bottom))}await r({...e,availableWidth:L,availableHeight:h});const x=await n.getDimensions(s.floating);return j!==x.width||c!==x.height?{reset:{rects:!0}}:{}}}},JM=t=>({name:"arrow",options:t,async fn(e){const{x:M,y:i,placement:N,rects:o,platform:n,elements:s,middlewareData:r}=e,{element:D,padding:a=0}=Je(t,e)||{};if(null==D)return{};const l=iM(a),u={x:M,y:i},g=tM(N),j=qe(g),c=await n.getDimensions(D),z="y"===g,I=z?"top":"left",T=z?"bottom":"right",O=z?"clientHeight":"clientWidth",y=o.reference[j]+o.reference[g]-u[g]-o.floating[j],d=u[g]-o.reference[g],A=await(null==n.getOffsetParent?void 0:n.getOffsetParent(D));let h=A?A[O]:0;h&&await(null==n.isElement?void 0:n.isElement(A))||(h=s.floating[O]||o.floating[j]);const L=y/2-d/2,x=h/2-c[j]/2-1,p=Ve(l[I],x),S=Ve(l[T],x),Q=p,E=h-c[j]-S,k=h/2-c[j]/2+L,w=Fe(Q,k,E),m=!r.arrow&&null!=Xe(N)&&k!==w&&o.reference[j]/2-(k<Q?p:S)-c[j]/2<0,U=m?k<Q?k-Q:k-E:0;return{[g]:u[g]+U,data:{[g]:w,centerOffset:k-w-U,...m&&{alignmentOffset:U}},reset:m}}}),HM=(t,e,M)=>{const i=new Map,N={platform:WM,...M},o={...N.platform,_c:i};return(async(t,e,M)=>{const{placement:i="bottom",strategy:N="absolute",middleware:o=[],platform:n}=M,s=o.filter(Boolean),r=await(null==n.isRTL?void 0:n.isRTL(e));let D=await n.getElementRects({reference:t,floating:e,strategy:N}),{x:a,y:l}=oM(D,i,r),u=i,g={},j=0;for(let M=0;M<s.length;M++){const{name:o,fn:c}=s[M],{x:z,y:I,data:T,reset:O}=await c({x:a,y:l,initialPlacement:i,placement:u,strategy:N,middlewareData:g,rects:D,platform:n,elements:{reference:t,floating:e}});a=null!=z?z:a,l=null!=I?I:l,g={...g,[o]:{...g[o],...T}},O&&j<=50&&(j++,"object"==typeof O&&(O.placement&&(u=O.placement),O.rects&&(D=!0===O.rects?await n.getElementRects({reference:t,floating:e,strategy:N}):O.rects),({x:a,y:l}=oM(D,u,r))),M=-1)}return{x:a,y:l,placement:u,strategy:N,middlewareData:g}})(t,e,{...N,platform:o})};function XM(t){return function(t){for(let e=t;e;e=$M(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=$M(t);e;e=$M(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}(t)}function $M(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}const qM=n`
2629
2629
  :host {
2630
2630
  --arrow-color: hsl(240 4.8% 95.9%);
2631
2631
  --arrow-size: 6px;
@@ -4389,7 +4389,7 @@ const Zt=t=>t??B;function Vt(t,e){const M={waitUntilFirstUpdate:!1,...e};return(
4389
4389
  * @license
4390
4390
  * Copyright 2017 Google LLC
4391
4391
  * SPDX-License-Identifier: BSD-3-Clause
4392
- */,{is:Si,defineProperty:Qi,getOwnPropertyDescriptor:Ei,getOwnPropertyNames:ki,getOwnPropertySymbols:wi,getPrototypeOf:mi}=Object,Ui=globalThis,Ci=Ui.trustedTypes,Yi=Ci?Ci.emptyScript:"",bi=Ui.reactiveElementPolyfillSupport,fi=(t,e)=>t,vi={toAttribute(t,e){switch(e){case Boolean:t=t?Yi:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let M=t;switch(e){case Boolean:M=null!==t;break;case Number:M=null===t?null:Number(t);break;case Object:case Array:try{M=JSON.parse(t)}catch(t){M=null}}return M}},Zi=(t,e)=>!Si(t,e),Vi={attribute:!0,type:String,converter:vi,reflect:!1,hasChanged:Zi};Symbol.metadata??=Symbol("metadata"),Ui.litPropertyMetadata??=new WeakMap;class Wi extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Vi){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const M=Symbol(),i=this.getPropertyDescriptor(t,M,e);void 0!==i&&Qi(this.prototype,t,i)}}static getPropertyDescriptor(t,e,M){const{get:i,set:N}=Ei(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);N.call(this,e),this.requestUpdate(t,o,M)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Vi}static _$Ei(){if(this.hasOwnProperty(fi("elementProperties")))return;const t=mi(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(fi("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(fi("properties"))){const t=this.properties,e=[...ki(t),...wi(t)];for(const M of e)this.createProperty(M,t[M])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,M]of e)this.elementProperties.set(t,M)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const M=this._$Eu(t,e);void 0!==M&&this._$Eh.set(M,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const M=new Set(t.flat(1/0).reverse());for(const t of M)e.unshift(pi(t))}else void 0!==t&&e.push(pi(t));return e}static _$Eu(t,e){const M=e.attribute;return!1===M?void 0:"string"==typeof M?M:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const M of e.keys())this.hasOwnProperty(M)&&(t.set(M,this[M]),delete this[M]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(Ai)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const M of e){const e=document.createElement("style"),i=di.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=M.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,M){this._$AK(t,M)}_$EC(t,e){const M=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,M);if(void 0!==i&&!0===M.reflect){const N=(void 0!==M.converter?.toAttribute?M.converter:vi).toAttribute(e,M.type);this._$Em=t,null==N?this.removeAttribute(i):this.setAttribute(i,N),this._$Em=null}}_$AK(t,e){const M=this.constructor,i=M._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=M.getPropertyOptions(i),N="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:vi;this._$Em=i,this[i]=N.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,M){if(void 0!==t){if(M??=this.constructor.getPropertyOptions(t),!(M.hasChanged??Zi)(this[t],e))return;this.P(t,e,M)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,M){this._$AL.has(t)||this._$AL.set(t,e),!0===M.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,M]of t)!0!==M.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],M)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}Wi.elementStyles=[],Wi.shadowRootOptions={mode:"open"},Wi[fi("elementProperties")]=new Map,Wi[fi("finalized")]=new Map,bi?.({ReactiveElement:Wi}),(Ui.reactiveElementVersions??=[]).push("2.0.4");
4392
+ */,{is:Si,defineProperty:Qi,getOwnPropertyDescriptor:Ei,getOwnPropertyNames:ki,getOwnPropertySymbols:wi,getPrototypeOf:mi}=Object,Ui=globalThis,Ci=Ui.trustedTypes,fi=Ci?Ci.emptyScript:"",bi=Ui.reactiveElementPolyfillSupport,Yi=(t,e)=>t,vi={toAttribute(t,e){switch(e){case Boolean:t=t?fi:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let M=t;switch(e){case Boolean:M=null!==t;break;case Number:M=null===t?null:Number(t);break;case Object:case Array:try{M=JSON.parse(t)}catch(t){M=null}}return M}},Zi=(t,e)=>!Si(t,e),Vi={attribute:!0,type:String,converter:vi,reflect:!1,hasChanged:Zi};Symbol.metadata??=Symbol("metadata"),Ui.litPropertyMetadata??=new WeakMap;class Wi extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Vi){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const M=Symbol(),i=this.getPropertyDescriptor(t,M,e);void 0!==i&&Qi(this.prototype,t,i)}}static getPropertyDescriptor(t,e,M){const{get:i,set:N}=Ei(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);N.call(this,e),this.requestUpdate(t,o,M)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Vi}static _$Ei(){if(this.hasOwnProperty(Yi("elementProperties")))return;const t=mi(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Yi("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Yi("properties"))){const t=this.properties,e=[...ki(t),...wi(t)];for(const M of e)this.createProperty(M,t[M])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,M]of e)this.elementProperties.set(t,M)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const M=this._$Eu(t,e);void 0!==M&&this._$Eh.set(M,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const M=new Set(t.flat(1/0).reverse());for(const t of M)e.unshift(pi(t))}else void 0!==t&&e.push(pi(t));return e}static _$Eu(t,e){const M=e.attribute;return!1===M?void 0:"string"==typeof M?M:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const M of e.keys())this.hasOwnProperty(M)&&(t.set(M,this[M]),delete this[M]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(Ai)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const M of e){const e=document.createElement("style"),i=di.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=M.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,M){this._$AK(t,M)}_$EC(t,e){const M=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,M);if(void 0!==i&&!0===M.reflect){const N=(void 0!==M.converter?.toAttribute?M.converter:vi).toAttribute(e,M.type);this._$Em=t,null==N?this.removeAttribute(i):this.setAttribute(i,N),this._$Em=null}}_$AK(t,e){const M=this.constructor,i=M._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=M.getPropertyOptions(i),N="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:vi;this._$Em=i,this[i]=N.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,M){if(void 0!==t){if(M??=this.constructor.getPropertyOptions(t),!(M.hasChanged??Zi)(this[t],e))return;this.P(t,e,M)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,M){this._$AL.has(t)||this._$AL.set(t,e),!0===M.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,M]of t)!0!==M.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],M)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}Wi.elementStyles=[],Wi.shadowRootOptions={mode:"open"},Wi[Yi("elementProperties")]=new Map,Wi[Yi("finalized")]=new Map,bi?.({ReactiveElement:Wi}),(Ui.reactiveElementVersions??=[]).push("2.0.4");
4393
4393
  /**
4394
4394
  * @license
4395
4395
  * Copyright 2017 Google LLC
@@ -4427,7 +4427,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
4427
4427
  * @license
4428
4428
  * Copyright 2021 Google LLC
4429
4429
  * SPDX-License-Identifier: BSD-3-Clause
4430
- */(this._hostElement,t),this._scrollerController=new iN(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((t=>this._childrenRO.observe(t))),this._scrollEventListeners.forEach((t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${nN}]`);e||(e=document.createElement("div"),e.setAttribute(nN,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent="&nbsp;",e.setAttribute(nN,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const e=t.type||sN;if("function"==typeof e&&this._layout instanceof e){const e={...t};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(t){let e,M;if("function"==typeof t.type){M=t.type;const i={...t};delete i.type,e=i}else e=t;void 0===M&&(sN=M=(await Promise.resolve().then((function(){return Dp}))).FlowLayout),this._layout=new M((t=>this._handleLayoutMessage(t)),e),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const t=window.performance.now(),e=t-this._benchmarkStart,M=performance.getEntriesByName("uv-virtualizing","measure").filter((e=>e.startTime>=this._benchmarkStart&&e.startTime<t)).reduce(((t,e)=>t+e.duration),0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:M}}return null}_measureChildren(){const t={},e=this._children,M=this._measureChildOverride||this._measureChild;for(let i=0;i<e.length;i++){const N=e[i],o=this._first+i;(this._itemsChanged||this._toBeMeasured.has(N))&&(t[o]=M.call(this,N,this._items[o]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:e,height:M}=t.getBoundingClientRect();return Object.assign({width:e,height:M},function(t){const e=window.getComputedStyle(t);return{marginTop:DN(e.marginTop),marginRight:DN(e.marginRight),marginBottom:DN(e.marginBottom),marginLeft:DN(e.marginLeft)}}(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:e,_itemsChanged:M}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||M)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((t=>this._childrenRO.observe(t))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){if("scroll"===t.type)(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",t)}_handleLayoutMessage(t){"stateChanged"===t.type?this._updateDOM(t):"visibilityChanged"===t.type?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):"unpinned"===t.type&&this._hostElement.dispatchEvent(new eN)}get _children(){const t=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(nN)||t.push(e),e=e.nextElementSibling;return t}_updateView(){const t=this._hostElement,e=this._scrollerController?.element,M=this._layout;if(t&&e&&M){let i,N,o,n;const s=t.getBoundingClientRect();i=0,N=0,o=window.innerHeight,n=window.innerWidth;const r=this._clippingAncestors.map((t=>t.getBoundingClientRect()));r.unshift(s);for(const t of r)i=Math.max(i,t.top),N=Math.max(N,t.left),o=Math.min(o,t.bottom),n=Math.min(n,t.right);const D=e.getBoundingClientRect(),a={left:s.left-D.left,top:s.top-D.top},l={width:e.scrollWidth,height:e.scrollHeight},u=i-s.top+t.scrollTop,g=N-s.left+t.scrollLeft,j=Math.max(0,o-i),c=Math.max(0,n-N);M.viewportSize={width:c,height:j},M.viewportScroll={top:u,left:g},M.totalScrollSize=l,M.offsetWithinScroller=a}}_sizeHostElement(t){const e=82e5,M=t&&null!==t.width?Math.min(e,t.width):0,i=t&&null!==t.height?Math.min(e,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${M}px, ${i}px)`;else{const t=this._hostElement.style;t.minWidth=M?`${M}px`:"100%",t.minHeight=i?`${i}px`:"100%"}}_positionChildren(t){t&&t.forEach((({top:t,left:e,width:M,height:i,xOffset:N,yOffset:o},n)=>{const s=this._children[n-this._first];s&&(s.style.position="absolute",s.style.boxSizing="border-box",s.style.transform=`translate(${e}px, ${t}px)`,void 0!==M&&(s.style.width=M+"px"),void 0!==i&&(s.style.height=i+"px"),s.style.left=void 0===N?null:N+"px",s.style.top=void 0===o?null:o+"px")}))}async _adjustRange(t){const{_first:e,_last:M,_firstVisible:i,_lastVisible:N}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==M,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==i||this._lastVisible!==N}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:M,left:i}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-M,left:e-i})}}element(t){return t===1/0&&(t=this._items.length-1),void 0===this._items?.[t]?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),"smooth"===t.behavior){const e=this._layout.getScrollIntoViewCoordinates(t),{behavior:M}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:M}),(()=>this._layout.getScrollIntoViewCoordinates(t)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new Ki({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new tN({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(const e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function DN(t){const e=t?parseFloat(t):NaN;return Number.isNaN(e)?0:e}function aN(t){if(null!==t.assignedSlot)return t.assignedSlot;if(null!==t.parentElement)return t.parentElement;const e=t.parentNode;return e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host||null}const lN=At(class extends Xi{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(t,e)=>((t,e)=>R`${e}: ${JSON.stringify(t,null,2)}`)(t,e+this._first),this._keyFunction=(t,e)=>(t=>t)(t,this._first),this._items=[],t.type!==Ot)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const e=[];if(this._first>=0&&this._last>=this._first)for(let t=this._first;t<=this._last;t++)e.push(this._items[t]);return qi(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);const M=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),M?G:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const M=t.parentNode;this._makeVirtualizer(M,e)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:e,keyFunction:M}=t;e&&(this._renderItem=(t,M)=>e(t,M+this._first)),M&&(this._keyFunction=(t,e)=>M(t,e+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:M,scroller:i,items:N}=e;this._virtualizer=new rN({hostElement:t,layout:M,scroller:i}),this._virtualizer.items=N,this._virtualizer.connected()}_initialize(t,e){const M=t.parentNode;M&&1===M.nodeType&&(M.addEventListener("rangeChanged",(t=>{this._first=t.first,this._last=t.last,this.setValue(this.render())})),this._makeVirtualizer(M,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});let uN=class extends Pt{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.loading=!1,this.filterFunction=(t,e)=>t.toLowerCase().includes(e.toLowerCase()),this.renderItemFunction=t=>t,this.allMenuItems=[],this.menuItems=[]}connectedCallback(){super.connectedCallback(),this.renderItemFunction=t=>t}updated(t){super.updated(t),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction))}render(){const t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return R`
4430
+ */(this._hostElement,t),this._scrollerController=new iN(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach((t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)})),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach((t=>this._childrenRO.observe(t))),this._scrollEventListeners.forEach((t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions)))}disconnected(){this._scrollEventListeners.forEach((t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions))),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${nN}]`);e||(e=document.createElement("div"),e.setAttribute(nN,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent="&nbsp;",e.setAttribute(nN,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const e=t.type||sN;if("function"==typeof e&&this._layout instanceof e){const e={...t};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(t){let e,M;if("function"==typeof t.type){M=t.type;const i={...t};delete i.type,e=i}else e=t;void 0===M&&(sN=M=(await Promise.resolve().then((function(){return gp}))).FlowLayout),this._layout=new M((t=>this._handleLayoutMessage(t)),e),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const t=window.performance.now(),e=t-this._benchmarkStart,M=performance.getEntriesByName("uv-virtualizing","measure").filter((e=>e.startTime>=this._benchmarkStart&&e.startTime<t)).reduce(((t,e)=>t+e.duration),0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:M}}return null}_measureChildren(){const t={},e=this._children,M=this._measureChildOverride||this._measureChild;for(let i=0;i<e.length;i++){const N=e[i],o=this._first+i;(this._itemsChanged||this._toBeMeasured.has(N))&&(t[o]=M.call(this,N,this._items[o]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:e,height:M}=t.getBoundingClientRect();return Object.assign({width:e,height:M},function(t){const e=window.getComputedStyle(t);return{marginTop:DN(e.marginTop),marginRight:DN(e.marginRight),marginBottom:DN(e.marginBottom),marginLeft:DN(e.marginLeft)}}(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:e,_itemsChanged:M}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||M)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach((t=>this._childrenRO.observe(t))),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){if("scroll"===t.type)(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",t)}_handleLayoutMessage(t){"stateChanged"===t.type?this._updateDOM(t):"visibilityChanged"===t.type?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):"unpinned"===t.type&&this._hostElement.dispatchEvent(new eN)}get _children(){const t=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(nN)||t.push(e),e=e.nextElementSibling;return t}_updateView(){const t=this._hostElement,e=this._scrollerController?.element,M=this._layout;if(t&&e&&M){let i,N,o,n;const s=t.getBoundingClientRect();i=0,N=0,o=window.innerHeight,n=window.innerWidth;const r=this._clippingAncestors.map((t=>t.getBoundingClientRect()));r.unshift(s);for(const t of r)i=Math.max(i,t.top),N=Math.max(N,t.left),o=Math.min(o,t.bottom),n=Math.min(n,t.right);const D=e.getBoundingClientRect(),a={left:s.left-D.left,top:s.top-D.top},l={width:e.scrollWidth,height:e.scrollHeight},u=i-s.top+t.scrollTop,g=N-s.left+t.scrollLeft,j=Math.max(0,o-i),c=Math.max(0,n-N);M.viewportSize={width:c,height:j},M.viewportScroll={top:u,left:g},M.totalScrollSize=l,M.offsetWithinScroller=a}}_sizeHostElement(t){const e=82e5,M=t&&null!==t.width?Math.min(e,t.width):0,i=t&&null!==t.height?Math.min(e,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${M}px, ${i}px)`;else{const t=this._hostElement.style;t.minWidth=M?`${M}px`:"100%",t.minHeight=i?`${i}px`:"100%"}}_positionChildren(t){t&&t.forEach((({top:t,left:e,width:M,height:i,xOffset:N,yOffset:o},n)=>{const s=this._children[n-this._first];s&&(s.style.position="absolute",s.style.boxSizing="border-box",s.style.transform=`translate(${e}px, ${t}px)`,void 0!==M&&(s.style.width=M+"px"),void 0!==i&&(s.style.height=i+"px"),s.style.left=void 0===N?null:N+"px",s.style.top=void 0===o?null:o+"px")}))}async _adjustRange(t){const{_first:e,_last:M,_firstVisible:i,_lastVisible:N}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==M,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==i||this._lastVisible!==N}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:M,left:i}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-M,left:e-i})}}element(t){return t===1/0&&(t=this._items.length-1),void 0===this._items?.[t]?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),"smooth"===t.behavior){const e=this._layout.getScrollIntoViewCoordinates(t),{behavior:M}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:M}),(()=>this._layout.getScrollIntoViewCoordinates(t)),(()=>this._scrollIntoViewTarget=null)),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new Ki({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new tN({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise(((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e}))),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame((()=>requestAnimationFrame((()=>this._resolveLayoutCompletePromise())))))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(const e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function DN(t){const e=t?parseFloat(t):NaN;return Number.isNaN(e)?0:e}function aN(t){if(null!==t.assignedSlot)return t.assignedSlot;if(null!==t.parentElement)return t.parentElement;const e=t.parentNode;return e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host||null}const lN=At(class extends Xi{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(t,e)=>((t,e)=>R`${e}: ${JSON.stringify(t,null,2)}`)(t,e+this._first),this._keyFunction=(t,e)=>(t=>t)(t,this._first),this._items=[],t.type!==Ot)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const e=[];if(this._first>=0&&this._last>=this._first)for(let t=this._first;t<=this._last;t++)e.push(this._items[t]);return qi(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);const M=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),M?G:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const M=t.parentNode;this._makeVirtualizer(M,e)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:e,keyFunction:M}=t;e&&(this._renderItem=(t,M)=>e(t,M+this._first)),M&&(this._keyFunction=(t,e)=>M(t,e+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:M,scroller:i,items:N}=e;this._virtualizer=new rN({hostElement:t,layout:M,scroller:i}),this._virtualizer.items=N,this._virtualizer.connected()}_initialize(t,e){const M=t.parentNode;M&&1===M.nodeType&&(M.addEventListener("rangeChanged",(t=>{this._first=t.first,this._last=t.last,this.setValue(this.render())})),this._makeVirtualizer(M,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});let uN=class extends Pt{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.loading=!1,this.filterFunction=(t,e)=>t.toLowerCase().includes(e.toLowerCase()),this.renderItemFunction=t=>t,this.allMenuItems=[],this.menuItems=[]}connectedCallback(){super.connectedCallback(),this.renderItemFunction=t=>t}updated(t){super.updated(t),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction))}render(){const t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return R`
4431
4431
  <nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick>
4432
4432
  <nile-input class="nile-auto-complete--input"
4433
4433
  ?no-border=${this.noBorder}
@@ -5809,7 +5809,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
5809
5809
  * @license
5810
5810
  * Copyright 2017 Google LLC
5811
5811
  * SPDX-License-Identifier: BSD-3-Clause
5812
- */}("nile-button-toggle")],CN.prototype,"toggles",void 0),t([zt("slot:not([name])")],CN.prototype,"defaultSlot",void 0),t([gt({type:Boolean,reflect:!0})],CN.prototype,"disabled",void 0),t([gt()],CN.prototype,"value",void 0),t([gt({type:Boolean})],CN.prototype,"multiple",void 0),t([gt({type:Boolean})],CN.prototype,"disableUserInput",void 0),t([gt({type:Boolean})],CN.prototype,"emptyDefault",void 0),CN=t([at("nile-button-toggle-group")],CN);const YN=n`
5812
+ */}("nile-button-toggle")],CN.prototype,"toggles",void 0),t([zt("slot:not([name])")],CN.prototype,"defaultSlot",void 0),t([gt({type:Boolean,reflect:!0})],CN.prototype,"disabled",void 0),t([gt()],CN.prototype,"value",void 0),t([gt({type:Boolean})],CN.prototype,"multiple",void 0),t([gt({type:Boolean})],CN.prototype,"disableUserInput",void 0),t([gt({type:Boolean})],CN.prototype,"emptyDefault",void 0),CN=t([at("nile-button-toggle-group")],CN);const fN=n`
5813
5813
  :host {
5814
5814
  width: 100%;
5815
5815
  box-sizing: border-box;
@@ -5921,7 +5921,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
5921
5921
  * @license
5922
5922
  * Copyright 2021 Google LLC
5923
5923
  * SPDX-License-Identifier: BSD-3-Clause
5924
- */;var bN,fN,vN,ZN;!function(t){t.INLINE="inline",t.BLOCK="block"}(bN||(bN={})),function(t){t.DEFAULT="defaultInput",t.SWITCH="switchInput"}(fN||(fN={})),function(t){t.DROPDOWN="dropdown",t.TEXT="text",t.CHECKBOX="checkbox",t.TEXTAREA="text-area",t.RADIO="radio",t.CONTENTEDITOR="content-editor",t.OBJECT_MAPPER="object-mapper",t.CODE_EDITOR="code-editor"}(vN||(vN={})),function(t){t.CREATE="create",t.EDIT="edit"}(ZN||(ZN={}));let VN=class extends Pt{constructor(){super(...arguments),this.hasSlotController=new vt(this,"label"),this.current=0,this.isToggleSwitch=t=>void 0===t||t}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}handleSwitcherChange(){this.setCurrentInput()}setCurrentInput(){this.nileSwitchConfig?.inputs&&(this.currentInput=this.nileSwitchConfig.inputs.filter(((t,e)=>e===this.current))[0])}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(t){const{value:e,label:M,placeholder:i,disabled:N,required:o,error:n,errorMessage:s,inputType:r,noborder:D}=t;return R`<nile-input
5924
+ */;var bN,YN,vN,ZN;!function(t){t.INLINE="inline",t.BLOCK="block"}(bN||(bN={})),function(t){t.DEFAULT="defaultInput",t.SWITCH="switchInput"}(YN||(YN={})),function(t){t.DROPDOWN="dropdown",t.TEXT="text",t.CHECKBOX="checkbox",t.TEXTAREA="text-area",t.RADIO="radio",t.CONTENTEDITOR="content-editor",t.OBJECT_MAPPER="object-mapper",t.CODE_EDITOR="code-editor"}(vN||(vN={})),function(t){t.CREATE="create",t.EDIT="edit"}(ZN||(ZN={}));let VN=class extends Pt{constructor(){super(...arguments),this.hasSlotController=new vt(this,"label"),this.current=0,this.isToggleSwitch=t=>void 0===t||t}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}handleSwitcherChange(){this.setCurrentInput()}setCurrentInput(){this.nileSwitchConfig?.inputs&&(this.currentInput=this.nileSwitchConfig.inputs.filter(((t,e)=>e===this.current))[0])}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(t){const{value:e,label:M,placeholder:i,disabled:N,required:o,error:n,errorMessage:s,inputType:r,noborder:D}=t;return R`<nile-input
5925
5925
  class=${Lt({"switcher-input":!0,"switcher-input--noborder":!!D})}
5926
5926
  .value=${e}
5927
5927
  .label=${M}
@@ -6048,7 +6048,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
6048
6048
  ${M?"":R`${this.renderIcon()}`}
6049
6049
  </div>
6050
6050
  ${this.singleFieldSwitcher()}
6051
- </div>`}};VN.styles=YN,t([gt({type:Object})],VN.prototype,"nileSwitchConfig",void 0),t([gt({type:Number})],VN.prototype,"current",void 0),t([gt({type:Object})],VN.prototype,"currentInput",void 0),t([Vt(["current"],{waitUntilFirstUpdate:!0})],VN.prototype,"handleSwitcherChange",null),VN=t([at("nile-switcher")],VN);const WN=n`
6051
+ </div>`}};VN.styles=fN,t([gt({type:Object})],VN.prototype,"nileSwitchConfig",void 0),t([gt({type:Number})],VN.prototype,"current",void 0),t([gt({type:Object})],VN.prototype,"currentInput",void 0),t([Vt(["current"],{waitUntilFirstUpdate:!0})],VN.prototype,"handleSwitcherChange",null),VN=t([at("nile-switcher")],VN);const WN=n`
6052
6052
  :host {
6053
6053
  box-sizing: border-box;
6054
6054
  font-size: 14px;
@@ -6916,7 +6916,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
6916
6916
  .code__editor__container:hover > .expand__icon__container{
6917
6917
  display: flex;
6918
6918
  }
6919
- `;let io=[],No=[];function oo(t){if(t<768)return!1;for(let e=0,M=io.length;;){let i=e+M>>1;if(t<io[i])M=i;else{if(!(t>=No[i]))return!0;e=i+1}if(e==M)return!1}}function no(t){return t>=127462&&t<=127487}(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,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,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let e=0,M=0;e<t.length;e++)(e%2?No:io).push(M+=t[e])})();function so(t,e,M=!0,i=!0){return(M?ro:Do)(t,e,i)}function ro(t,e,M){if(e==t.length)return e;e&&lo(t.charCodeAt(e))&&uo(t.charCodeAt(e-1))&&e--;let i=ao(t,e);for(e+=go(i);e<t.length;){let N=ao(t,e);if(8205==i||8205==N||M&&oo(N))e+=go(N),i=N;else{if(!no(N))break;{let M=0,i=e-2;for(;i>=0&&no(ao(t,i));)M++,i-=2;if(M%2==0)break;e+=2}}}return e}function Do(t,e,M){for(;e>0;){let i=ro(t,e-2,M);if(i<e)return i;e--}return 0}function ao(t,e){let M=t.charCodeAt(e);if(!uo(M)||e+1==t.length)return M;let i=t.charCodeAt(e+1);return lo(i)?i-56320+(M-55296<<10)+65536:M}function lo(t){return t>=56320&&t<57344}function uo(t){return t>=55296&&t<56320}function go(t){return t<65536?1:2}class jo{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,M){[t,e]=Lo(this,t,e);let i=[];return this.decompose(0,t,i,2),M.length&&M.decompose(0,M.length,i,3),this.decompose(e,this.length,i,1),zo.from(i,this.length-(e-t)+M.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Lo(this,t,e);let M=[];return this.decompose(t,e,M,0),zo.from(M,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),M=this.length-this.scanIdentical(t,-1),i=new Oo(this),N=new Oo(t);for(let t=e,o=e;;){if(i.next(t),N.next(t),t=0,i.lineBreak!=N.lineBreak||i.done!=N.done||i.value!=N.value)return!1;if(o+=i.value.length,i.done||o>=M)return!0}}iter(t=1){return new Oo(this,t)}iterRange(t,e=this.length){return new yo(this,t,e)}iterLines(t,e){let M;if(null==t)M=this.iter();else{null==e&&(e=this.lines+1);let i=this.line(t).from;M=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Ao(M)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new co(t):zo.from(co.split(t,[])):jo.empty}}class co extends jo{constructor(t,e=function(t){let e=-1;for(let M of t)e+=M.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,M,i){for(let N=0;;N++){let o=this.text[N],n=i+o.length;if((e?M:n)>=t)return new ho(i,n,M,o);i=n+1,M++}}decompose(t,e,M,i){let N=t<=0&&e>=this.length?this:new co(To(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){let t=M.pop(),e=Io(N.text,t.text.slice(),0,N.length);if(e.length<=32)M.push(new co(e,t.length+N.length));else{let t=e.length>>1;M.push(new co(e.slice(0,t)),new co(e.slice(t)))}}else M.push(N)}replace(t,e,M){if(!(M instanceof co))return super.replace(t,e,M);[t,e]=Lo(this,t,e);let i=Io(this.text,Io(M.text,To(this.text,0,t)),e),N=this.length+M.length-(e-t);return i.length<=32?new co(i,N):zo.from(co.split(i,[]),N)}sliceString(t,e=this.length,M="\n"){[t,e]=Lo(this,t,e);let i="";for(let N=0,o=0;N<=e&&o<this.text.length;o++){let n=this.text[o],s=N+n.length;N>t&&o&&(i+=M),t<s&&e>N&&(i+=n.slice(Math.max(0,t-N),e-N)),N=s+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let M=[],i=-1;for(let N of t)M.push(N),i+=N.length+1,32==M.length&&(e.push(new co(M,i)),M=[],i=-1);return i>-1&&e.push(new co(M,i)),e}}class zo extends jo{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,M,i){for(let N=0;;N++){let o=this.children[N],n=i+o.length,s=M+o.lines-1;if((e?s:n)>=t)return o.lineInner(t,e,M,i);i=n+1,M=s+1}}decompose(t,e,M,i){for(let N=0,o=0;o<=e&&N<this.children.length;N++){let n=this.children[N],s=o+n.length;if(t<=s&&e>=o){let N=i&((o<=t?1:0)|(s>=e?2:0));o>=t&&s<=e&&!N?M.push(n):n.decompose(t-o,e-o,M,N)}o=s+1}}replace(t,e,M){if([t,e]=Lo(this,t,e),M.lines<this.lines)for(let i=0,N=0;i<this.children.length;i++){let o=this.children[i],n=N+o.length;if(t>=N&&e<=n){let s=o.replace(t-N,e-N,M),r=this.lines-o.lines+s.lines;if(s.lines<r>>4&&s.lines>r>>6){let N=this.children.slice();return N[i]=s,new zo(N,this.length-(e-t)+M.length)}return super.replace(N,n,s)}N=n+1}return super.replace(t,e,M)}sliceString(t,e=this.length,M="\n"){[t,e]=Lo(this,t,e);let i="";for(let N=0,o=0;N<this.children.length&&o<=e;N++){let n=this.children[N],s=o+n.length;o>t&&N&&(i+=M),t<s&&e>o&&(i+=n.sliceString(t-o,e-o,M)),o=s+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof zo))return 0;let M=0,[i,N,o,n]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,N+=e){if(i==o||N==n)return M;let s=this.children[i],r=t.children[N];if(s!=r)return M+s.scanIdentical(r,e);M+=s.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let M=0;for(let e of t)M+=e.lines;if(M<32){let M=[];for(let e of t)e.flatten(M);return new co(M,e)}let i=Math.max(32,M>>5),N=i<<1,o=i>>1,n=[],s=0,r=-1,D=[];function a(t){let e;if(t.lines>N&&t instanceof zo)for(let e of t.children)a(e);else t.lines>o&&(s>o||!s)?(l(),n.push(t)):t instanceof co&&s&&(e=D[D.length-1])instanceof co&&t.lines+e.lines<=32?(s+=t.lines,r+=t.length+1,D[D.length-1]=new co(e.text.concat(t.text),e.length+1+t.length)):(s+t.lines>i&&l(),s+=t.lines,r+=t.length+1,D.push(t))}function l(){0!=s&&(n.push(1==D.length?D[0]:zo.from(D,r)),r=-1,s=D.length=0)}for(let e of t)a(e);return l(),1==n.length?n[0]:new zo(n,e)}}function Io(t,e,M=0,i=1e9){for(let N=0,o=0,n=!0;o<t.length&&N<=i;o++){let s=t[o],r=N+s.length;r>=M&&(r>i&&(s=s.slice(0,i-N)),N<M&&(s=s.slice(M-N)),n?(e[e.length-1]+=s,n=!1):e.push(s)),N=r+1}return e}function To(t,e,M){return Io(t,[""],e,M)}jo.empty=new co([""],0);class Oo{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof co?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let M=this.nodes.length-1,i=this.nodes[M],N=this.offsets[M],o=N>>1,n=i instanceof co?i.text.length:i.children.length;if(o==(e>0?n:0)){if(0==M)return this.done=!0,this.value="",this;e>0&&this.offsets[M-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&N)==(e>0?0:1)){if(this.offsets[M]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof co){let N=i.text[o+(e<0?-1:0)];if(this.offsets[M]+=e,N.length>Math.max(0,t))return this.value=0==t?N:e>0?N.slice(t):N.slice(0,N.length-t),this;t-=N.length}else{let N=i.children[o+(e<0?-1:0)];t>N.length?(t-=N.length,this.offsets[M]+=e):(e<0&&this.offsets[M]--,this.nodes.push(N),this.offsets.push(e>0?1:(N instanceof co?N.text.length:N.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class yo{constructor(t,e,M){this.value="",this.done=!1,this.cursor=new Oo(t,e>M?-1:1),this.pos=e>M?t.length:0,this.from=Math.min(e,M),this.to=Math.max(e,M)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let M=e<0?this.pos-this.from:this.to-this.pos;t>M&&(t=M),M-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=M?i:e<0?i.slice(i.length-M):i.slice(0,M),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Ao{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:M,value:i}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):M?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(jo.prototype[Symbol.iterator]=function(){return this.iter()},Oo.prototype[Symbol.iterator]=yo.prototype[Symbol.iterator]=Ao.prototype[Symbol.iterator]=function(){return this});class ho{constructor(t,e,M,i){this.from=t,this.to=e,this.number=M,this.text=i}get length(){return this.to-this.from}}function Lo(t,e,M){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,M))]}function xo(t,e,M=!0,i=!0){return so(t,e,M,i)}function po(t,e){let M=t.charCodeAt(e);if(!(i=M,i>=55296&&i<56320&&e+1!=t.length))return M;var i;let N=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344}(N)?N-56320+(M-55296<<10)+65536:M}function So(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function Qo(t){return t<65536?1:2}const Eo=/\r\n?|\n/;var ko=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(ko||(ko={}));class wo{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let M=this.sections[e+1];t+=M<0?this.sections[e]:M}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,M=0,i=0;e<this.sections.length;){let N=this.sections[e++],o=this.sections[e++];o<0?(t(M,i,N),i+=N):i+=o,M+=N}}iterChangedRanges(t,e=!1){Yo(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let M=this.sections[e++],i=this.sections[e++];i<0?t.push(M,i):t.push(i,M)}return new wo(t)}composeDesc(t){return this.empty?t:t.empty?this:fo(this,t)}mapDesc(t,e=!1){return t.empty?this:bo(this,t,e)}mapPos(t,e=-1,M=ko.Simple){let i=0,N=0;for(let o=0;o<this.sections.length;){let n=this.sections[o++],s=this.sections[o++],r=i+n;if(s<0){if(r>t)return N+(t-i);N+=n}else{if(M!=ko.Simple&&r>=t&&(M==ko.TrackDel&&i<t&&r>t||M==ko.TrackBefore&&i<t||M==ko.TrackAfter&&r>t))return null;if(r>t||r==t&&e<0&&!n)return t==i||e<0?N:N+s;N+=s}i=r}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return N}touchesRange(t,e=t){for(let M=0,i=0;M<this.sections.length&&i<=e;){let N=i+this.sections[M++];if(this.sections[M++]>=0&&i<=e&&N>=t)return!(i<t&&N>e)||"cover";i=N}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let M=this.sections[e++],i=this.sections[e++];t+=(t?" ":"")+M+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new wo(t)}static create(t){return new wo(t)}}class mo extends wo{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Yo(this,((e,M,i,N,o)=>t=t.replace(i,i+(M-e),o)),!1),t}mapDesc(t,e=!1){return bo(this,t,e,!0)}invert(t){let e=this.sections.slice(),M=[];for(let i=0,N=0;i<e.length;i+=2){let o=e[i],n=e[i+1];if(n>=0){e[i]=n,e[i+1]=o;let s=i>>1;for(;M.length<s;)M.push(jo.empty);M.push(o?t.slice(N,N+o):jo.empty)}N+=o}return new mo(e,M)}compose(t){return this.empty?t:t.empty?this:fo(this,t,!0)}map(t,e=!1){return t.empty?this:bo(this,t,e,!0)}iterChanges(t,e=!1){Yo(this,t,e)}get desc(){return wo.create(this.sections)}filter(t){let e=[],M=[],i=[],N=new vo(this);t:for(let o=0,n=0;;){let s=o==t.length?1e9:t[o++];for(;n<s||n==s&&0==N.len;){if(N.done)break t;let t=Math.min(N.len,s-n);Uo(i,t,-1);let o=-1==N.ins?-1:0==N.off?N.ins:0;Uo(e,t,o),o>0&&Co(M,e,N.text),N.forward(t),n+=t}let r=t[o++];for(;n<r;){if(N.done)break t;let t=Math.min(N.len,r-n);Uo(e,t,-1),Uo(i,t,-1==N.ins?-1:0==N.off?N.ins:0),N.forward(t),n+=t}}return{changes:new mo(e,M),filtered:wo.create(i)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let M=this.sections[e],i=this.sections[e+1];i<0?t.push(M):0==i?t.push([M]):t.push([M].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,M){let i=[],N=[],o=0,n=null;function s(t=!1){if(!t&&!i.length)return;o<e&&Uo(i,e-o,-1);let M=new mo(i,N);n=n?n.compose(M.map(n)):M,i=[],N=[],o=0}return function t(r){if(Array.isArray(r))for(let e of r)t(e);else if(r instanceof mo){if(r.length!=e)throw new RangeError(`Mismatched change set length (got ${r.length}, expected ${e})`);s(),n=n?n.compose(r.map(n)):r}else{let{from:t,to:n=t,insert:D}=r;if(t>n||t<0||n>e)throw new RangeError(`Invalid change range ${t} to ${n} (in doc of length ${e})`);let a=D?"string"==typeof D?jo.of(D.split(M||Eo)):D:jo.empty,l=a.length;if(t==n&&0==l)return;t<o&&s(),t>o&&Uo(i,t-o,-1),Uo(i,n-t,l),Co(N,i,a),o=n}}(t),s(!n),n}static empty(t){return new mo(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],M=[];for(let i=0;i<t.length;i++){let N=t[i];if("number"==typeof N)e.push(N,-1);else{if(!Array.isArray(N)||"number"!=typeof N[0]||N.some(((t,e)=>e&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==N.length)e.push(N[0],0);else{for(;M.length<i;)M.push(jo.empty);M[i]=jo.of(N.slice(1)),e.push(N[0],M[i].length)}}}return new mo(e,M)}static createSet(t,e){return new mo(t,e)}}function Uo(t,e,M,i=!1){if(0==e&&M<=0)return;let N=t.length-2;N>=0&&M<=0&&M==t[N+1]?t[N]+=e:N>=0&&0==e&&0==t[N]?t[N+1]+=M:i?(t[N]+=e,t[N+1]+=M):t.push(e,M)}function Co(t,e,M){if(0==M.length)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(M);else{for(;t.length<i;)t.push(jo.empty);t.push(M)}}function Yo(t,e,M){let i=t.inserted;for(let N=0,o=0,n=0;n<t.sections.length;){let s=t.sections[n++],r=t.sections[n++];if(r<0)N+=s,o+=s;else{let D=N,a=o,l=jo.empty;for(;D+=s,a+=r,r&&i&&(l=l.append(i[n-2>>1])),!(M||n==t.sections.length||t.sections[n+1]<0);)s=t.sections[n++],r=t.sections[n++];e(N,D,o,a,l),N=D,o=a}}}function bo(t,e,M,i=!1){let N=[],o=i?[]:null,n=new vo(t),s=new vo(e);for(let t=-1;;){if(n.done&&s.len||s.done&&n.len)throw new Error("Mismatched change set lengths");if(-1==n.ins&&-1==s.ins){let t=Math.min(n.len,s.len);Uo(N,t,-1),n.forward(t),s.forward(t)}else if(s.ins>=0&&(n.ins<0||t==n.i||0==n.off&&(s.len<n.len||s.len==n.len&&!M))){let e=s.len;for(Uo(N,s.ins,-1);e;){let M=Math.min(n.len,e);n.ins>=0&&t<n.i&&n.len<=M&&(Uo(N,0,n.ins),o&&Co(o,N,n.text),t=n.i),n.forward(M),e-=M}s.next()}else{if(!(n.ins>=0)){if(n.done&&s.done)return o?mo.createSet(N,o):wo.create(N);throw new Error("Mismatched change set lengths")}{let e=0,M=n.len;for(;M;)if(-1==s.ins){let t=Math.min(M,s.len);e+=t,M-=t,s.forward(t)}else{if(!(0==s.ins&&s.len<M))break;M-=s.len,s.next()}Uo(N,e,t<n.i?n.ins:0),o&&t<n.i&&Co(o,N,n.text),t=n.i,n.forward(n.len-M)}}}}function fo(t,e,M=!1){let i=[],N=M?[]:null,o=new vo(t),n=new vo(e);for(let t=!1;;){if(o.done&&n.done)return N?mo.createSet(i,N):wo.create(i);if(0==o.ins)Uo(i,o.len,0,t),o.next();else if(0!=n.len||n.done){if(o.done||n.done)throw new Error("Mismatched change set lengths");{let e=Math.min(o.len2,n.len),M=i.length;if(-1==o.ins){let M=-1==n.ins?-1:n.off?0:n.ins;Uo(i,e,M,t),N&&M&&Co(N,i,n.text)}else-1==n.ins?(Uo(i,o.off?0:o.len,e,t),N&&Co(N,i,o.textBit(e))):(Uo(i,o.off?0:o.len,n.off?0:n.ins,t),N&&!n.off&&Co(N,i,n.text));t=(o.ins>e||n.ins>=0&&n.len>e)&&(t||i.length>M),o.forward2(e),n.forward(e)}}else Uo(i,0,n.ins,t),N&&Co(N,i,n.text),n.next()}}class vo{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?jo.empty:t[e]}textBit(t){let{inserted:e}=this.set,M=this.i-2>>1;return M>=e.length&&!t?jo.empty:e[M].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class Zo{constructor(t,e,M){this.from=t,this.to=e,this.flags=M}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let M,i;return this.empty?M=i=t.mapPos(this.from,e):(M=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),M==this.from&&i==this.to?this:new Zo(M,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return Vo.range(t,e);let M=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return Vo.range(this.anchor,M)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Vo.range(t.anchor,t.head)}static create(t,e,M){return new Zo(t,e,M)}}class Vo{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:Vo.create(this.ranges.map((M=>M.map(t,e))),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let M=0;M<this.ranges.length;M++)if(!this.ranges[M].eq(t.ranges[M],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new Vo([this.main],0)}addRange(t,e=!0){return Vo.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let M=this.ranges.slice();return M[e]=t,Vo.create(M,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((t=>t.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Vo(t.ranges.map((t=>Zo.fromJSON(t))),t.main)}static single(t,e=t){return new Vo([Vo.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let M=0,i=0;i<t.length;i++){let N=t[i];if(N.empty?N.from<=M:N.from<M)return Vo.normalized(t.slice(),e);M=N.to}return new Vo(t,e)}static cursor(t,e=0,M,i){return Zo.create(t,t,(0==e?0:e<0?8:16)|(null==M?7:Math.min(6,M))|(null!=i?i:16777215)<<6)}static range(t,e,M,i){let N=(null!=M?M:16777215)<<6|(null==i?7:Math.min(6,i));return e<t?Zo.create(e,t,48|N):Zo.create(t,e,(e>t?8:0)|N)}static normalized(t,e=0){let M=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(M);for(let M=1;M<t.length;M++){let i=t[M],N=t[M-1];if(i.empty?i.from<=N.to:i.from<N.to){let o=N.from,n=Math.max(i.to,N.to);M<=e&&e--,t.splice(--M,2,i.anchor>i.head?Vo.range(n,o):Vo.range(o,n))}}return new Vo(t,e)}}function Wo(t,e){for(let M of t.ranges)if(M.to>e)throw new RangeError("Selection points outside of document")}let Po=0;class Ro{constructor(t,e,M,i,N){this.combine=t,this.compareInput=e,this.compare=M,this.isStatic=i,this.id=Po++,this.default=t([]),this.extensions="function"==typeof N?N(this):N}get reader(){return this}static define(t={}){return new Ro(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:Go),!!t.static,t.enables)}of(t){return new Bo([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bo(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bo(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(M=>e(M.field(t))))}}function Go(t,e){return t==e||t.length==e.length&&t.every(((t,M)=>t===e[M]))}class Bo{constructor(t,e,M,i){this.dependencies=t,this.facet=e,this.type=M,this.value=i,this.id=Po++}dynamicSlot(t){var e;let M=this.value,i=this.facet.compareInput,N=this.id,o=t[N]>>1,n=2==this.type,s=!1,r=!1,D=[];for(let M of this.dependencies)"doc"==M?s=!0:"selection"==M?r=!0:1&(null!==(e=t[M.id])&&void 0!==e?e:1)||D.push(t[M.id]);return{create:t=>(t.values[o]=M(t),1),update(t,e){if(s&&e.docChanged||r&&(e.docChanged||e.selection)||Fo(t,D)){let e=M(t);if(n?!_o(e,t.values[o],i):!i(e,t.values[o]))return t.values[o]=e,1}return 0},reconfigure:(t,e)=>{let s,r=e.config.address[N];if(null!=r){let N=Dn(e,r);if(this.dependencies.every((M=>M instanceof Ro?e.facet(M)===t.facet(M):!(M instanceof Xo)||e.field(M,!1)==t.field(M,!1)))||(n?_o(s=M(t),N,i):i(s=M(t),N)))return t.values[o]=N,0}else s=M(t);return t.values[o]=s,1}}}}function _o(t,e,M){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!M(t[i],e[i]))return!1;return!0}function Fo(t,e){let M=!1;for(let i of e)1&rn(t,i)&&(M=!0);return M}function Jo(t,e,M){let i=M.map((e=>t[e.id])),N=M.map((t=>t.type)),o=i.filter((t=>!(1&t))),n=t[e.id]>>1;function s(t){let M=[];for(let e=0;e<i.length;e++){let o=Dn(t,i[e]);if(2==N[e])for(let t of o)M.push(t);else M.push(o)}return e.combine(M)}return{create(t){for(let e of i)rn(t,e);return t.values[n]=s(t),1},update(t,M){if(!Fo(t,o))return 0;let i=s(t);return e.compare(i,t.values[n])?0:(t.values[n]=i,1)},reconfigure(t,N){let o=Fo(t,i),r=N.config.facets[e.id],D=N.facet(e);if(r&&!o&&Go(M,r))return t.values[n]=D,0;let a=s(t);return e.compare(a,D)?(t.values[n]=D,0):(t.values[n]=a,1)}}}const Ho=Ro.define({static:!0});class Xo{constructor(t,e,M,i,N){this.id=t,this.createF=e,this.updateF=M,this.compareF=i,this.spec=N,this.provides=void 0}static define(t){let e=new Xo(Po++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(Ho).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,M)=>{let i=t.values[e],N=this.updateF(i,M);return this.compareF(i,N)?0:(t.values[e]=N,1)},reconfigure:(t,M)=>{let i,N=t.facet(Ho),o=M.facet(Ho);return(i=N.find((t=>t.field==this)))&&i!=o.find((t=>t.field==this))?(t.values[e]=i.create(t),1):null!=M.config.address[this.id]?(t.values[e]=M.field(this),0):(t.values[e]=this.create(t),1)}}}init(t){return[this,Ho.of({field:this,create:t})]}get extension(){return this}}const $o=4,qo=3,Ko=2,tn=1;function en(t){return e=>new Nn(e,t)}const Mn={highest:en(0),high:en(tn),default:en(Ko),low:en(qo),lowest:en($o)};class Nn{constructor(t,e){this.inner=t,this.prec=e}}class on{of(t){return new nn(this,t)}reconfigure(t){return on.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class nn{constructor(t,e){this.compartment=t,this.inner=e}}class sn{constructor(t,e,M,i,N,o){for(this.base=t,this.compartments=e,this.dynamicSlots=M,this.address=i,this.staticValues=N,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<M.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,M){let i=[],N=Object.create(null),o=new Map;for(let M of function(t,e,M){let i=[[],[],[],[],[]],N=new Map;function o(t,n){let s=N.get(t);if(null!=s){if(s<=n)return;let e=i[s].indexOf(t);e>-1&&i[s].splice(e,1),t instanceof nn&&M.delete(t.compartment)}if(N.set(t,n),Array.isArray(t))for(let e of t)o(e,n);else if(t instanceof nn){if(M.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=e.get(t.compartment)||t.inner;M.set(t.compartment,i),o(i,n)}else if(t instanceof Nn)o(t.inner,t.prec);else if(t instanceof Xo)i[n].push(t),t.provides&&o(t.provides,n);else if(t instanceof Bo)i[n].push(t),t.facet.extensions&&o(t.facet.extensions,Ko);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(e,n)}}return o(t,Ko),i.reduce(((t,e)=>t.concat(e)))}(t,e,o))M instanceof Xo?i.push(M):(N[M.facet.id]||(N[M.facet.id]=[])).push(M);let n=Object.create(null),s=[],r=[];for(let t of i)n[t.id]=r.length<<1,r.push((e=>t.slot(e)));let D=null==M?void 0:M.config.facets;for(let t in N){let e=N[t],i=e[0].facet,o=D&&D[t]||[];if(e.every((t=>0==t.type)))if(n[i.id]=s.length<<1|1,Go(o,e))s.push(M.facet(i));else{let t=i.combine(e.map((t=>t.value)));s.push(M&&i.compare(t,M.facet(i))?M.facet(i):t)}else{for(let t of e)0==t.type?(n[t.id]=s.length<<1|1,s.push(t.value)):(n[t.id]=r.length<<1,r.push((e=>t.dynamicSlot(e))));n[i.id]=r.length<<1,r.push((t=>Jo(t,i,e)))}}let a=r.map((t=>t(n)));return new sn(t,o,a,n,s,N)}}function rn(t,e){if(1&e)return 2;let M=e>>1,i=t.status[M];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;t.status[M]=4;let N=t.computeSlot(t,t.config.dynamicSlots[M]);return t.status[M]=2|N}function Dn(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const an=Ro.define(),ln=Ro.define({combine:t=>t.some((t=>t)),static:!0}),un=Ro.define({combine:t=>t.length?t[0]:void 0,static:!0}),gn=Ro.define(),jn=Ro.define(),cn=Ro.define(),zn=Ro.define({combine:t=>!!t.length&&t[0]});class In{constructor(t,e){this.type=t,this.value=e}static define(){return new Tn}}class Tn{of(t){return new In(this,t)}}class On{constructor(t){this.map=t}of(t){return new yn(this,t)}}class yn{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new yn(this.type,e)}is(t){return this.type==t}static define(t={}){return new On(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let M=[];for(let i of t){let t=i.map(e);t&&M.push(t)}return M}}yn.reconfigure=yn.define(),yn.appendConfig=yn.define();class dn{constructor(t,e,M,i,N,o){this.startState=t,this.changes=e,this.selection=M,this.effects=i,this.annotations=N,this.scrollIntoView=o,this._doc=null,this._state=null,M&&Wo(M,e.newLength),N.some((t=>t.type==dn.time))||(this.annotations=N.concat(dn.time.of(Date.now())))}static create(t,e,M,i,N,o){return new dn(t,e,M,i,N,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(dn.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function An(t,e){let M=[];for(let i=0,N=0;;){let o,n;if(i<t.length&&(N==e.length||e[N]>=t[i]))o=t[i++],n=t[i++];else{if(!(N<e.length))return M;o=e[N++],n=e[N++]}!M.length||M[M.length-1]<o?M.push(o,n):M[M.length-1]<n&&(M[M.length-1]=n)}}function hn(t,e,M){var i;let N,o,n;return M?(N=e.changes,o=mo.empty(e.changes.length),n=t.changes.compose(e.changes)):(N=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),n=t.changes.compose(N)),{changes:n,selection:e.selection?e.selection.map(o):null===(i=t.selection)||void 0===i?void 0:i.map(N),effects:yn.mapEffects(t.effects,N).concat(yn.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Ln(t,e,M){let i=e.selection,N=Sn(e.annotations);return e.userEvent&&(N=N.concat(dn.userEvent.of(e.userEvent))),{changes:e.changes instanceof mo?e.changes:mo.of(e.changes||[],M,t.facet(un)),selection:i&&(i instanceof Vo?i:Vo.single(i.anchor,i.head)),effects:Sn(e.effects),annotations:N,scrollIntoView:!!e.scrollIntoView}}function xn(t,e,M){let i=Ln(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(M=!1);for(let N=1;N<e.length;N++){!1===e[N].filter&&(M=!1);let o=!!e[N].sequential;i=hn(i,Ln(t,e[N],o?i.changes.newLength:t.doc.length),o)}let N=dn.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(t){let e=t.startState,M=e.facet(cn),i=t;for(let N=M.length-1;N>=0;N--){let o=M[N](t);o&&Object.keys(o).length&&(i=hn(i,Ln(e,o,t.changes.newLength),!0))}return i==t?t:dn.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(M?function(t){let e=t.startState,M=!0;for(let i of e.facet(gn)){let e=i(t);if(!1===e){M=!1;break}Array.isArray(e)&&(M=!0===M?e:An(M,e))}if(!0!==M){let i,N;if(!1===M)N=t.changes.invertedDesc,i=mo.empty(e.doc.length);else{let e=t.changes.filter(M);i=e.changes,N=e.filtered.mapDesc(e.changes).invertedDesc}t=dn.create(e,i,t.selection&&t.selection.map(N),yn.mapEffects(t.effects,N),t.annotations,t.scrollIntoView)}let i=e.facet(jn);for(let M=i.length-1;M>=0;M--){let N=i[M](t);t=N instanceof dn?N:Array.isArray(N)&&1==N.length&&N[0]instanceof dn?N[0]:xn(e,Sn(N),!1)}return t}(N):N)}dn.time=In.define(),dn.userEvent=In.define(),dn.addToHistory=In.define(),dn.remote=In.define();const pn=[];function Sn(t){return null==t?pn:Array.isArray(t)?t:[t]}var Qn=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Qn||(Qn={}));const En=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let kn;try{kn=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(v){}function wn(t){return e=>{if(!/\S/.test(e))return Qn.Space;if(function(t){if(kn)return kn.test(t);for(let e=0;e<t.length;e++){let M=t[e];if(/\w/.test(M)||M>"€"&&(M.toUpperCase()!=M.toLowerCase()||En.test(M)))return!0}return!1}(e))return Qn.Word;for(let M=0;M<t.length;M++)if(e.indexOf(t[M])>-1)return Qn.Word;return Qn.Other}}class mn{constructor(t,e,M,i,N,o){this.config=t,this.doc=e,this.selection=M,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=N,o&&(o._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)rn(this,t<<1);this.computeSlot=null}field(t,e=!0){let M=this.config.address[t.id];if(null!=M)return rn(this,M),Dn(this,M);if(e)throw new RangeError("Field is not present in this state")}update(...t){return xn(this,t,!0)}applyTransaction(t){let e,M=this.config,{base:i,compartments:N}=M;for(let e of t.effects)e.is(on.reconfigure)?(M&&(N=new Map,M.compartments.forEach(((t,e)=>N.set(e,t))),M=null),N.set(e.value.compartment,e.value.extension)):e.is(yn.reconfigure)?(M=null,i=e.value):e.is(yn.appendConfig)&&(M=null,i=Sn(i).concat(e.value));if(M)e=t.startState.values.slice();else{M=sn.resolve(i,N,this),e=new mn(M,this.doc,this.selection,M.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values}let o=t.startState.facet(ln)?t.newSelection:t.newSelection.asSingle();new mn(M,t.newDoc,o,e,((e,M)=>M.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:Vo.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,M=t(e.ranges[0]),i=this.changes(M.changes),N=[M.range],o=Sn(M.effects);for(let M=1;M<e.ranges.length;M++){let n=t(e.ranges[M]),s=this.changes(n.changes),r=s.map(i);for(let t=0;t<M;t++)N[t]=N[t].map(r);let D=i.mapDesc(s,!0);N.push(n.range.map(D)),i=i.compose(r),o=yn.mapEffects(o,r).concat(yn.mapEffects(Sn(n.effects),D))}return{changes:i,selection:Vo.create(N,e.mainIndex),effects:o}}changes(t=[]){return t instanceof mo?t:mo.of(t,this.doc.length,this.facet(mn.lineSeparator))}toText(t){return jo.of(t.split(this.facet(mn.lineSeparator)||Eo))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(rn(this,e),Dn(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let M in t){let i=t[M];i instanceof Xo&&null!=this.config.address[i.id]&&(e[M]=i.spec.toJSON(this.field(t[M]),this))}return e}static fromJSON(t,e={},M){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(M)for(let e in M)if(Object.prototype.hasOwnProperty.call(t,e)){let N=M[e],o=t[e];i.push(N.init((t=>N.spec.fromJSON(o,t))))}return mn.create({doc:t.doc,selection:Vo.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=sn.resolve(t.extensions||[],new Map),M=t.doc instanceof jo?t.doc:jo.of((t.doc||"").split(e.staticFacet(mn.lineSeparator)||Eo)),i=t.selection?t.selection instanceof Vo?t.selection:Vo.single(t.selection.anchor,t.selection.head):Vo.single(0);return Wo(i,M.length),e.staticFacet(ln)||(i=i.asSingle()),new mn(e,M,i,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(mn.tabSize)}get lineBreak(){return this.facet(mn.lineSeparator)||"\n"}get readOnly(){return this.facet(zn)}phrase(t,...e){for(let e of this.facet(mn.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,M)=>{if("$"==M)return"$";let i=+(M||1);return!i||i>e.length?t:e[i-1]}))),t}languageDataAt(t,e,M=-1){let i=[];for(let N of this.facet(an))for(let o of N(this,e,M))Object.prototype.hasOwnProperty.call(o,t)&&i.push(o[t]);return i}charCategorizer(t){return wn(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:M,length:i}=this.doc.lineAt(t),N=this.charCategorizer(t),o=t-M,n=t-M;for(;o>0;){let t=xo(e,o,!1);if(N(e.slice(t,o))!=Qn.Word)break;o=t}for(;n<i;){let t=xo(e,n);if(N(e.slice(n,t))!=Qn.Word)break;n=t}return o==n?null:Vo.range(o+M,n+M)}}function Un(t,e,M={}){let i={};for(let e of t)for(let t of Object.keys(e)){let N=e[t],o=i[t];if(void 0===o)i[t]=N;else if(o===N||void 0===N);else{if(!Object.hasOwnProperty.call(M,t))throw new Error("Config merge conflict for field "+t);i[t]=M[t](o,N)}}for(let t in e)void 0===i[t]&&(i[t]=e[t]);return i}mn.allowMultipleSelections=ln,mn.tabSize=Ro.define({combine:t=>t.length?t[0]:4}),mn.lineSeparator=un,mn.readOnly=zn,mn.phrases=Ro.define({compare(t,e){let M=Object.keys(t),i=Object.keys(e);return M.length==i.length&&M.every((M=>t[M]==e[M]))}}),mn.languageData=an,mn.changeFilter=gn,mn.transactionFilter=jn,mn.transactionExtender=cn,on.reconfigure=yn.define();class Cn{eq(t){return this==t}range(t,e=t){return Yn.create(t,e,this)}}Cn.prototype.startSide=Cn.prototype.endSide=0,Cn.prototype.point=!1,Cn.prototype.mapMode=ko.TrackDel;let Yn=class t{constructor(t,e,M){this.from=t,this.to=e,this.value=M}static create(e,M,i){return new t(e,M,i)}};function bn(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class fn{constructor(t,e,M,i){this.from=t,this.to=e,this.value=M,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,M,i=0){let N=M?this.to:this.from;for(let o=i,n=N.length;;){if(o==n)return o;let i=o+n>>1,s=N[i]-t||(M?this.value[i].endSide:this.value[i].startSide)-e;if(i==o)return s>=0?o:n;s>=0?n=i:o=i+1}}between(t,e,M,i){for(let N=this.findIndex(e,-1e9,!0),o=this.findIndex(M,1e9,!1,N);N<o;N++)if(!1===i(this.from[N]+t,this.to[N]+t,this.value[N]))return!1}map(t,e){let M=[],i=[],N=[],o=-1,n=-1;for(let s=0;s<this.value.length;s++){let r,D,a=this.value[s],l=this.from[s]+t,u=this.to[s]+t;if(l==u){let t=e.mapPos(l,a.startSide,a.mapMode);if(null==t)continue;if(r=D=t,a.startSide!=a.endSide&&(D=e.mapPos(l,a.endSide),D<r))continue}else if(r=e.mapPos(l,a.startSide),D=e.mapPos(u,a.endSide),r>D||r==D&&a.startSide>0&&a.endSide<=0)continue;(D-r||a.endSide-a.startSide)<0||(o<0&&(o=r),a.point&&(n=Math.max(n,D-r)),M.push(a),i.push(r-o),N.push(D-o))}return{mapped:M.length?new fn(i,N,M,n):null,pos:o}}}class vn{constructor(t,e,M,i){this.chunkPos=t,this.chunk=e,this.nextLayer=M,this.maxPoint=i}static create(t,e,M,i){return new vn(t,e,M,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:M=!1,filterFrom:i=0,filterTo:N=this.length}=t,o=t.filter;if(0==e.length&&!o)return this;if(M&&(e=e.slice().sort(bn)),this.isEmpty)return e.length?vn.of(e):this;let n=new Wn(this,null,-1).goto(0),s=0,r=[],D=new Zn;for(;n.value||s<e.length;)if(s<e.length&&(n.from-e[s].from||n.startSide-e[s].value.startSide)>=0){let t=e[s++];D.addInner(t.from,t.to,t.value)||r.push(t)}else 1==n.rangeIndex&&n.chunkIndex<this.chunk.length&&(s==e.length||this.chunkEnd(n.chunkIndex)<e[s].from)&&(!o||i>this.chunkEnd(n.chunkIndex)||N<this.chunkPos[n.chunkIndex])&&D.addChunk(this.chunkPos[n.chunkIndex],this.chunk[n.chunkIndex])?n.nextChunk():((!o||i>n.to||N<n.from||o(n.from,n.to,n.value))&&(D.addInner(n.from,n.to,n.value)||r.push(Yn.create(n.from,n.to,n.value))),n.next());return D.finishInner(this.nextLayer.isEmpty&&!r.length?vn.empty:this.nextLayer.update({add:r,filter:o,filterFrom:i,filterTo:N}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],M=[],i=-1;for(let N=0;N<this.chunk.length;N++){let o=this.chunkPos[N],n=this.chunk[N],s=t.touchesRange(o,o+n.length);if(!1===s)i=Math.max(i,n.maxPoint),e.push(n),M.push(t.mapPos(o));else if(!0===s){let{mapped:N,pos:s}=n.map(o,t);N&&(i=Math.max(i,N.maxPoint),e.push(N),M.push(s))}}let N=this.nextLayer.map(t);return 0==e.length?N:new vn(M,e,N||vn.empty,i)}between(t,e,M){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let N=this.chunkPos[i],o=this.chunk[i];if(e>=N&&t<=N+o.length&&!1===o.between(N,t-N,e-N,M))return}this.nextLayer.between(t,e,M)}}iter(t=0){return Pn.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Pn.from(t).goto(e)}static compare(t,e,M,i,N=-1){let o=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=N)),n=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=N)),s=Vn(o,n,M),r=new Gn(o,s,N),D=new Gn(n,s,N);M.iterGaps(((t,e,M)=>Bn(r,t,D,e,M,i))),M.empty&&0==M.length&&Bn(r,0,D,0,0,i)}static eq(t,e,M=0,i){null==i&&(i=999999999);let N=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),o=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(N.length!=o.length)return!1;if(!N.length)return!0;let n=Vn(N,o),s=new Gn(N,n,0).goto(M),r=new Gn(o,n,0).goto(M);for(;;){if(s.to!=r.to||!_n(s.active,r.active)||s.point&&(!r.point||!s.point.eq(r.point)))return!1;if(s.to>i)return!0;s.next(),r.next()}}static spans(t,e,M,i,N=-1){let o=new Gn(t,null,N).goto(e),n=e,s=o.openStart;for(;;){let t=Math.min(o.to,M);if(o.point){let M=o.activeForPoint(o.to),N=o.pointFrom<e?M.length+1:o.point.startSide<0?M.length:Math.min(M.length,s);i.point(n,t,o.point,M,N,o.pointRank),s=Math.min(o.openEnd(t),M.length)}else t>n&&(i.span(n,t,o.active,s),s=o.openEnd(t));if(o.to>M)return s+(o.point&&o.to>M?1:0);n=o.to,o.next()}}static of(t,e=!1){let M=new Zn;for(let i of t instanceof Yn?[t]:e?function(t){if(t.length>1)for(let e=t[0],M=1;M<t.length;M++){let i=t[M];if(bn(e,i)>0)return t.slice().sort(bn);e=i}return t}(t):t)M.add(i.from,i.to,i.value);return M.finish()}static join(t){if(!t.length)return vn.empty;let e=t[t.length-1];for(let M=t.length-2;M>=0;M--)for(let i=t[M];i!=vn.empty;i=i.nextLayer)e=new vn(i.chunkPos,i.chunk,e,Math.max(i.maxPoint,e.maxPoint));return e}}vn.empty=new vn([],[],null,-1),vn.empty.nextLayer=vn.empty;class Zn{finishChunk(t){this.chunks.push(new fn(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,M){this.addInner(t,e,M)||(this.nextLayer||(this.nextLayer=new Zn)).add(t,e,M)}addInner(t,e,M){let i=t-this.lastTo||M.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||M.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=M,this.lastFrom=t,this.lastTo=e,this.value.push(M),M.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let M=e.value.length-1;return this.last=e.value[M],this.lastFrom=e.from[M]+t,this.lastTo=e.to[M]+t,!0}finish(){return this.finishInner(vn.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=vn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Vn(t,e,M){let i=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&i.set(e.chunk[t],e.chunkPos[t]);let N=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let o=i.get(t.chunk[e]);null==o||(M?M.mapPos(o):o)!=t.chunkPos[e]||(null==M?void 0:M.touchesRange(o,o+t.chunk[e].length))||N.add(t.chunk[e])}return N}class Wn{constructor(t,e,M,i=0){this.layer=t,this.skip=e,this.minPoint=M,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,M){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,M=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!M||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],M=t+e.from[this.rangeIndex];if(this.from=M,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Pn{constructor(t){this.heap=t}static from(t,e=null,M=-1){let i=[];for(let N=0;N<t.length;N++)for(let o=t[N];!o.isEmpty;o=o.nextLayer)o.maxPoint>=M&&i.push(new Wn(o,e,M,N));return 1==i.length?i[0]:new Pn(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let M of this.heap)M.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Rn(this.heap,t);return this.next(),this}forward(t,e){for(let M of this.heap)M.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Rn(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Rn(this.heap,0)}}}function Rn(t,e){for(let M=t[e];;){let i=1+(e<<1);if(i>=t.length)break;let N=t[i];if(i+1<t.length&&N.compare(t[i+1])>=0&&(N=t[i+1],i++),M.compare(N)<0)break;t[i]=M,t[e]=N,e=i}}class Gn{constructor(t,e,M){this.minPoint=M,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Pn.from(t,e,M)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Fn(this.active,t),Fn(this.activeTo,t),Fn(this.activeRank,t),this.minActive=Hn(this.active,this.activeTo)}addActive(t){let e=0,{value:M,to:i,rank:N}=this.cursor;for(;e<this.activeRank.length&&(N-this.activeRank[e]||i-this.activeTo[e])>0;)e++;Jn(this.active,e,M),Jn(this.activeTo,e,i),Jn(this.activeRank,e,N),t&&Jn(t,e,this.cursor.from),this.minActive=Hn(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let M=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),M&&Fn(M,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(M),this.cursor.next()}}}if(M){this.openStart=0;for(let e=M.length-1;e>=0&&M[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let M=this.active.length-1;M>=0&&!(this.activeRank[M]<this.pointRank);M--)(this.activeTo[M]>t||this.activeTo[M]==t&&this.active[M].endSide>=this.point.endSide)&&e.push(this.active[M]);return e.reverse()}openEnd(t){let e=0;for(let M=this.activeTo.length-1;M>=0&&this.activeTo[M]>t;M--)e++;return e}}function Bn(t,e,M,i,N,o){t.goto(e),M.goto(i);let n=i+N,s=i,r=i-e;for(;;){let e=t.to+r-M.to,i=e||t.endSide-M.endSide,N=i<0?t.to+r:M.to,D=Math.min(N,n);if(t.point||M.point?t.point&&M.point&&(t.point==M.point||t.point.eq(M.point))&&_n(t.activeForPoint(t.to),M.activeForPoint(M.to))||o.comparePoint(s,D,t.point,M.point):D>s&&!_n(t.active,M.active)&&o.compareRange(s,D,t.active,M.active),N>n)break;(e||t.openEnd!=M.openEnd)&&o.boundChange&&o.boundChange(N),s=N,i<=0&&t.next(),i>=0&&M.next()}}function _n(t,e){if(t.length!=e.length)return!1;for(let M=0;M<t.length;M++)if(t[M]!=e[M]&&!t[M].eq(e[M]))return!1;return!0}function Fn(t,e){for(let M=e,i=t.length-1;M<i;M++)t[M]=t[M+1];t.pop()}function Jn(t,e,M){for(let M=t.length-1;M>=e;M--)t[M+1]=t[M];t[e]=M}function Hn(t,e){let M=-1,i=1e9;for(let N=0;N<e.length;N++)(e[N]-i||t[N].endSide-t[M].endSide)<0&&(M=N,i=e[N]);return M}function Xn(t,e,M=t.length){let i=0;for(let N=0;N<M&&N<t.length;)9==t.charCodeAt(N)?(i+=e-i%e,N++):(i++,N=xo(t,N));return i}function $n(t,e,M,i){for(let i=0,N=0;;){if(N>=e)return i;if(i==t.length)break;N+=9==t.charCodeAt(i)?M-N%M:1,i=xo(t,i)}return!0===i?-1:t.length}const qn="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),Kn="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),ts="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class es{constructor(t,e){this.rules=[];let{finish:M}=e||{};function i(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function N(t,e,o,n){let s=[],r=/^@(\w+)\b/.exec(t[0]),D=r&&"keyframes"==r[1];if(r&&null==e)return o.push(t[0]+";");for(let M in e){let n=e[M];if(/&/.test(M))N(M.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),n,o);else if(n&&"object"==typeof n){if(!r)throw new RangeError("The value of a property ("+M+") should be a primitive value.");N(i(M),n,s,D)}else null!=n&&s.push(M.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+n+";")}(s.length||D)&&o.push((!M||r||n?t:t.map(M)).join(", ")+" {"+s.join(" ")+"}")}for(let e in t)N(i(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=ts[qn]||1;return ts[qn]=t+1,"ͼ"+t.toString(36)}static mount(t,e,M){let i=t[Kn],N=M&&M.nonce;i?N&&i.setNonce(N):i=new is(t,N),i.mount(Array.isArray(e)?e:[e],t)}}let Ms=new Map;class is{constructor(t,e){let M=t.ownerDocument||t,i=M.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let e=Ms.get(M);if(e)return t[Kn]=e;this.sheet=new i.CSSStyleSheet,Ms.set(M,this)}else this.styleTag=M.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Kn]=this}mount(t,e){let M=this.sheet,i=0,N=0;for(let e=0;e<t.length;e++){let o=t[e],n=this.modules.indexOf(o);if(n<N&&n>-1&&(this.modules.splice(n,1),N--,n=-1),-1==n){if(this.modules.splice(N++,0,o),M)for(let t=0;t<o.rules.length;t++)M.insertRule(o.rules[t],i++)}else{for(;N<n;)i+=this.modules[N++].rules.length;i+=o.rules.length,N++}}if(M)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets]);else{let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t;let M=e.head||e;this.styleTag.parentNode!=M&&M.insertBefore(this.styleTag,M.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}for(var Ns={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:"'"},os={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ns="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ss="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),rs=0;rs<10;rs++)Ns[48+rs]=Ns[96+rs]=String(rs);for(rs=1;rs<=24;rs++)Ns[rs+111]="F"+rs;for(rs=65;rs<=90;rs++)Ns[rs]=String.fromCharCode(rs+32),os[rs]=String.fromCharCode(rs);for(var Ds in Ns)os.hasOwnProperty(Ds)||(os[Ds]=Ns[Ds]);function as(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function ls(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function us(t,e){if(!e.anchorNode)return!1;try{return ls(t,e.anchorNode)}catch(t){return!1}}function gs(t){return 3==t.nodeType?ps(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function js(t,e,M,i){return!!M&&(Is(t,e,M,i,-1)||Is(t,e,M,i,1))}function cs(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function zs(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Is(t,e,M,i,N){for(;;){if(t==M&&e==i)return!0;if(e==(N<0?0:Ts(t))){if("DIV"==t.nodeName)return!1;let M=t.parentNode;if(!M||1!=M.nodeType)return!1;e=cs(t)+(N<0?0:1),t=M}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(N<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=N<0?Ts(t):0}}}function Ts(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Os(t,e){let M=e?t.left:t.right;return{left:M,right:M,top:t.top,bottom:t.bottom}}function ys(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function ds(t,e){let M=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(M>.995&&M<1.005||!isFinite(M)||Math.abs(e.width-t.offsetWidth)<1)&&(M=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:M,scaleY:i}}class As{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:M}=t;this.set(e,Math.min(t.anchorOffset,e?Ts(e):0),M,Math.min(t.focusOffset,M?Ts(M):0))}set(t,e,M,i){this.anchorNode=t,this.anchorOffset=e,this.focusNode=M,this.focusOffset=i}}let hs,Ls=null;function xs(t){if(t.setActive)return t.setActive();if(Ls)return t.focus(Ls);let e=[];for(let M=t;M&&(e.push(M,M.scrollTop,M.scrollLeft),M!=M.ownerDocument);M=M.parentNode);if(t.focus(null==Ls?{get preventScroll(){return Ls={preventScroll:!0},!0}}:void 0),!Ls){Ls=!1;for(let t=0;t<e.length;){let M=e[t++],i=e[t++],N=e[t++];M.scrollTop!=i&&(M.scrollTop=i),M.scrollLeft!=N&&(M.scrollLeft=N)}}}function ps(t,e,M=e){let i=hs||(hs=document.createRange());return i.setEnd(t,M),i.setStart(t,e),i}function Ss(t,e,M,i){let N={key:e,code:e,keyCode:M,which:M,cancelable:!0};i&&({altKey:N.altKey,ctrlKey:N.ctrlKey,shiftKey:N.shiftKey,metaKey:N.metaKey}=i);let o=new KeyboardEvent("keydown",N);o.synthetic=!0,t.dispatchEvent(o);let n=new KeyboardEvent("keyup",N);return n.synthetic=!0,t.dispatchEvent(n),o.defaultPrevented||n.defaultPrevented}function Qs(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function Es(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function ks(t,e){for(let M=t,i=e;;){if(3==M.nodeType&&i>0)return{node:M,offset:i};if(1==M.nodeType&&i>0){if("false"==M.contentEditable)return null;M=M.childNodes[i-1],i=Ts(M)}else{if(!M.parentNode||zs(M))return null;i=cs(M),M=M.parentNode}}}function ws(t,e){for(let M=t,i=e;;){if(3==M.nodeType&&i<M.nodeValue.length)return{node:M,offset:i};if(1==M.nodeType&&i<M.childNodes.length){if("false"==M.contentEditable)return null;M=M.childNodes[i],i=0}else{if(!M.parentNode||zs(M))return null;i=cs(M)+1,M=M.parentNode}}}class ms{constructor(t,e,M=!0){this.node=t,this.offset=e,this.precise=M}static before(t,e){return new ms(t.parentNode,cs(t),e)}static after(t,e){return new ms(t.parentNode,cs(t)+1,e)}}const Us=[];class Cs{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let e=this.posAtStart;for(let M of this.children){if(M==t)return e;e+=M.length+M.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(2&this.flags){let M,i=this.dom,N=null;for(let o of this.children){if(7&o.flags){if(!o.dom&&(M=N?N.nextSibling:i.firstChild)){let t=Cs.get(M);(!t||!t.parent&&t.canReuseDOM(o))&&o.reuseDOM(M)}o.sync(t,e),o.flags&=-8}if(M=N?N.nextSibling:i.firstChild,e&&!e.written&&e.node==i&&M!=o.dom&&(e.written=!0),o.dom.parentNode==i)for(;M&&M!=o.dom;)M=Ys(M);else i.insertBefore(o.dom,M);N=o.dom}for(M=N?N.nextSibling:i.firstChild,M&&e&&e.node==i&&(e.written=!0);M;)M=Ys(M)}else if(1&this.flags)for(let M of this.children)7&M.flags&&(M.sync(t,e),M.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let M;if(t==this.dom)M=this.dom.childNodes[e];else{let i=0==Ts(t)?0:0==e?-1:1;for(;;){let e=t.parentNode;if(e==this.dom)break;0==i&&e.firstChild!=e.lastChild&&(i=t==e.firstChild?-1:1),t=e}M=i<0?t:t.nextSibling}if(M==this.dom.firstChild)return 0;for(;M&&!Cs.get(M);)M=M.nextSibling;if(!M)return this.length;for(let t=0,e=0;;t++){let i=this.children[t];if(i.dom==M)return e;e+=i.length+i.breakAfter}}domBoundsAround(t,e,M=0){let i=-1,N=-1,o=-1,n=-1;for(let s=0,r=M,D=M;s<this.children.length;s++){let M=this.children[s],a=r+M.length;if(r<t&&a>e)return M.domBoundsAround(t,e,r);if(a>=t&&-1==i&&(i=s,N=r),r>e&&M.dom.parentNode==this.dom){o=s,n=D;break}D=a,r=a+M.breakAfter}return{from:N,to:n<0?M+this.length:n,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),1&e.flags)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,M=Us){this.markDirty();for(let i=t;i<e;i++){let t=this.children[i];t.parent==this&&M.indexOf(t)<0&&t.destroy()}M.length<250?this.children.splice(t,e-t,...M):this.children=[].concat(this.children.slice(0,t),M,this.children.slice(e));for(let t=0;t<M.length;t++)M[t].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new bs(this.children,t,this.children.length)}childPos(t,e=1){return this.childCursor().findPos(t,e)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,e,M,i,N,o){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!(8&(this.flags|t.flags))}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}}function Ys(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}Cs.prototype.breakAfter=0;class bs{constructor(t,e,M){this.children=t,this.pos=e,this.i=M,this.off=0}findPos(t,e=1){for(;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let M=this.children[--this.i];this.pos-=M.length+M.breakAfter}}}function fs(t,e,M,i,N,o,n,s,r){let{children:D}=t,a=D.length?D[e]:null,l=o.length?o[o.length-1]:null,u=l?l.breakAfter:n;if(!(e==i&&a&&!n&&!u&&o.length<2&&a.merge(M,N,o.length?l:null,0==M,s,r))){if(i<D.length){let t=D[i];t&&(N<t.length||t.breakAfter&&(null==l?void 0:l.breakAfter))?(e==i&&(t=t.split(N),N=0),!u&&l&&t.merge(0,N,l,!0,0,r)?o[o.length-1]=t:((N||t.children.length&&!t.children[0].length)&&t.merge(0,N,null,!1,0,r),o.push(t))):(null==t?void 0:t.breakAfter)&&(l?l.breakAfter=1:n=1),i++}for(a&&(a.breakAfter=n,M>0&&(!n&&o.length&&a.merge(M,a.length,o[0],!1,s,0)?a.breakAfter=o.shift().breakAfter:(M<a.length||a.children.length&&0==a.children[a.children.length-1].length)&&a.merge(M,a.length,null,!1,s,0),e++));e<i&&o.length;)if(D[i-1].become(o[o.length-1]))i--,o.pop(),r=o.length?0:s;else{if(!D[e].become(o[0]))break;e++,o.shift(),s=o.length?0:r}!o.length&&e&&i<D.length&&!D[e-1].breakAfter&&D[i].merge(0,0,D[e-1],!1,s,r)&&e--,(e<i||o.length)&&t.replaceChildren(e,i,o)}}function vs(t,e,M,i,N,o){let n=t.childCursor(),{i:s,off:r}=n.findPos(M,1),{i:D,off:a}=n.findPos(e,-1),l=e-M;for(let t of i)l+=t.length;t.length+=l,fs(t,D,a,s,r,i,0,N,o)}let Zs="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Vs="undefined"!=typeof document?document:{documentElement:{style:{}}};const Ws=/Edge\/(\d+)/.exec(Zs.userAgent),Ps=/MSIE \d/.test(Zs.userAgent),Rs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zs.userAgent),Gs=!!(Ps||Rs||Ws),Bs=!Gs&&/gecko\/(\d+)/i.test(Zs.userAgent),_s=!Gs&&/Chrome\/(\d+)/.exec(Zs.userAgent),Fs="webkitFontSmoothing"in Vs.documentElement.style,Js=!Gs&&/Apple Computer/.test(Zs.vendor),Hs=Js&&(/Mobile\/\w+/.test(Zs.userAgent)||Zs.maxTouchPoints>2);var Xs={mac:Hs||/Mac/.test(Zs.platform),windows:/Win/.test(Zs.platform),linux:/Linux|X11/.test(Zs.platform),ie:Gs,ie_version:Ps?Vs.documentMode||6:Rs?+Rs[1]:Ws?+Ws[1]:0,gecko:Bs,gecko_version:Bs?+(/Firefox\/(\d+)/.exec(Zs.userAgent)||[0,0])[1]:0,chrome:!!_s,chrome_version:_s?+_s[1]:0,ios:Hs,android:/Android\b/.test(Zs.userAgent),webkit:Fs,safari:Js,webkit_version:Fs?+(/\bAppleWebKit\/(\d+)/.exec(Zs.userAgent)||[0,0])[1]:0,tabSize:null!=Vs.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class $s extends Cs{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,M){return!(8&this.flags||M&&(!(M instanceof $s)||this.length-(e-t)+M.length>256||8&M.flags))&&(this.text=this.text.slice(0,t)+(M?M.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new $s(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new ms(this.dom,t)}domBoundsAround(t,e,M){return{from:M,to:M+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return function(t,e,M){let i=t.nodeValue.length;e>i&&(e=i);let N=e,o=e,n=0;0==e&&M<0||e==i&&M>=0?Xs.chrome||Xs.gecko||(e?(N--,n=1):o<i&&(o++,n=-1)):M<0?N--:o<i&&o++;let s=ps(t,N,o).getClientRects();if(!s.length)return null;let r=s[(n?n<0:M>=0)?0:s.length-1];Xs.safari&&!n&&0==r.width&&(r=Array.prototype.find.call(s,(t=>t.width))||r);return n?Os(r,n<0):r||null}(this.dom,t,e)}}class qs extends Cs{constructor(t,e=[],M=0){super(),this.mark=t,this.children=e,this.length=M;for(let t of e)t.setParent(this)}setAttrs(t){if(Qs(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!(8&(this.flags|t.flags))}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,M,i,N,o){return(!M||!(!(M instanceof qs&&M.mark.eq(this.mark))||t&&N<=0||e<this.length&&o<=0))&&(vs(this,t,e,M?M.children.slice():[],N-1,o-1),this.markDirty(),!0)}split(t){let e=[],M=0,i=-1,N=0;for(let o of this.children){let n=M+o.length;n>t&&e.push(M<t?o.split(t-M):o),i<0&&M>=t&&(i=N),M=n,N++}let o=this.length-t;return this.length=t,i>-1&&(this.children.length=i,this.markDirty()),new qs(this.mark,e,o)}domAtPos(t){return er(this,t)}coordsAt(t,e){return ir(this,t,e)}}class Ks extends Cs{static create(t,e,M){return new Ks(t,e,M)}constructor(t,e,M){super(),this.widget=t,this.length=e,this.side=M,this.prevWidget=null}split(t){let e=Ks.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,M,i,N,o){return!(M&&(!(M instanceof Ks&&this.widget.compare(M.widget))||t>0&&N<=0||e<this.length&&o<=0))&&(this.length=t+(M?M.length:0)+(this.length-e),!0)}become(t){return t instanceof Ks&&t.side==this.side&&this.widget.constructor==t.widget.constructor&&(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0)}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(0==this.length)return jo.empty;let t=this;for(;t.parent;)t=t.parent;let{view:e}=t,M=e&&e.state.doc,i=this.posAtStart;return M?M.slice(i,i+this.length):jo.empty}domAtPos(t){return(this.length?0==t:this.side>0)?ms.before(this.dom):ms.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let M=this.widget.coordsAt(this.dom,t,e);if(M)return M;let i=this.dom.getClientRects(),N=null;if(!i.length)return null;let o=this.side?this.side<0:t>0;for(let e=o?i.length-1:0;N=i[e],!(t>0?0==e:e==i.length-1||N.top<N.bottom);e+=o?-1:1);return Os(N,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class tr extends Cs{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof tr&&t.side==this.side}split(){return new tr(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?ms.before(this.dom):ms.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return jo.empty}get isHidden(){return!0}}function er(t,e){let M=t.dom,{children:i}=t,N=0;for(let t=0;N<i.length;N++){let o=i[N],n=t+o.length;if(!(n==t&&o.getSide()<=0)){if(e>t&&e<n&&o.dom.parentNode==M)return o.domAtPos(e-t);if(e<=t)break;t=n}}for(let t=N;t>0;t--){let e=i[t-1];if(e.dom.parentNode==M)return e.domAtPos(e.length)}for(let t=N;t<i.length;t++){let e=i[t];if(e.dom.parentNode==M)return e.domAtPos(0)}return new ms(M,0)}function Mr(t,e,M){let i,{children:N}=t;M>0&&e instanceof qs&&N.length&&(i=N[N.length-1])instanceof qs&&i.mark.eq(e.mark)?Mr(i,e.children[0],M-1):(N.push(e),e.setParent(t)),t.length+=e.length}function ir(t,e,M){let i=null,N=-1,o=null,n=-1;!function t(e,s){for(let r=0,D=0;r<e.children.length&&D<=s;r++){let a=e.children[r],l=D+a.length;l>=s&&(a.children.length?t(a,s-D):(!o||o.isHidden&&M>0)&&(l>s||D==l&&a.getSide()>0)?(o=a,n=s-D):(D<s||D==l&&a.getSide()<0&&!a.isHidden)&&(i=a,N=s-D)),D=l}}(t,e);let s=(M<0?i:o)||i||o;return s?s.coordsAt(Math.max(0,s==i?N:n),M):function(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let M=gs(e);return M[M.length-1]||null}(t)}function Nr(t,e){for(let M in t)"class"==M&&e.class?e.class+=" "+t.class:"style"==M&&e.style?e.style+=";"+t.style:e[M]=t[M];return e}$s.prototype.children=Ks.prototype.children=tr.prototype.children=Us;const or=Object.create(null);function nr(t,e,M){if(t==e)return!0;t||(t=or),e||(e=or);let i=Object.keys(t),N=Object.keys(e);if(i.length-(M&&i.indexOf(M)>-1?1:0)!=N.length-(M&&N.indexOf(M)>-1?1:0))return!1;for(let o of i)if(o!=M&&(-1==N.indexOf(o)||t[o]!==e[o]))return!1;return!0}function sr(t,e,M){let i=!1;if(e)for(let N in e)M&&N in M||(i=!0,"style"==N?t.style.cssText="":t.removeAttribute(N));if(M)for(let N in M)e&&e[N]==M[N]||(i=!0,"style"==N?t.style.cssText=M[N]:t.setAttribute(N,M[N]));return i}function rr(t){let e=Object.create(null);for(let M=0;M<t.attributes.length;M++){let i=t.attributes[M];e[i.name]=i.value}return e}class Dr{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,M){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var ar=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(ar||(ar={}));class lr extends Cn{constructor(t,e,M,i){super(),this.startSide=t,this.endSide=e,this.widget=M,this.spec=i}get heightRelevant(){return!1}static mark(t){return new ur(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),M=!!t.block;return e+=M&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new jr(t,e,e,M,t.widget||null,!1)}static replace(t){let e,M,i=!!t.block;if(t.isBlockGap)e=-5e8,M=4e8;else{let{start:N,end:o}=cr(t,i);e=(N?i?-3e8:-1:5e8)-1,M=1+(o?i?2e8:1:-6e8)}return new jr(t,e,M,i,t.widget||null,!0)}static line(t){return new gr(t)}static set(t,e=!1){return vn.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}lr.none=vn.empty;class ur extends lr{constructor(t){let{start:e,end:M}=cr(t);super(e?-1:5e8,M?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,M;return this==t||t instanceof ur&&this.tagName==t.tagName&&(this.class||(null===(e=this.attrs)||void 0===e?void 0:e.class))==(t.class||(null===(M=t.attrs)||void 0===M?void 0:M.class))&&nr(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}ur.prototype.point=!1;class gr extends lr{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof gr&&this.spec.class==t.spec.class&&nr(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}gr.prototype.mapMode=ko.TrackBefore,gr.prototype.point=!0;class jr extends lr{constructor(t,e,M,i,N,o){super(e,M,N,t),this.block=i,this.isReplace=o,this.mapMode=i?e<=0?ko.TrackBefore:ko.TrackAfter:ko.TrackDel}get type(){return this.startSide!=this.endSide?ar.WidgetRange:this.startSide<=0?ar.WidgetBefore:ar.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof jr&&function(t,e){return t==e||!!(t&&e&&t.compare(e))}(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function cr(t,e=!1){let{inclusiveStart:M,inclusiveEnd:i}=t;return null==M&&(M=t.inclusive),null==i&&(i=t.inclusive),{start:null!=M?M:e,end:null!=i?i:e}}function zr(t,e,M,i=0){let N=M.length-1;N>=0&&M[N]+i>=t?M[N]=Math.max(M[N],e):M.push(t,e)}jr.prototype.point=!0;class Ir extends Cs{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,M,i,N,o){if(M){if(!(M instanceof Ir))return!1;this.dom||M.transferDOM(this)}return i&&this.setDeco(M?M.attrs:null),vs(this,t,e,M?M.children.slice():[],N,o),!0}split(t){let e=new Ir;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i:M,off:i}=this.childPos(t);i&&(e.append(this.children[M].split(i),0),this.children[M].merge(i,this.children[M].length,null,!1,0,0),M++);for(let t=M;t<this.children.length;t++)e.append(this.children[t],0);for(;M>0&&0==this.children[M-1].length;)this.children[--M].destroy();return this.children.length=M,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){nr(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){Mr(this,t,e)}addLineDeco(t){let e=t.spec.attributes,M=t.spec.class;e&&(this.attrs=Nr(e,this.attrs||{})),M&&(this.attrs=Nr({class:M},this.attrs||{}))}domAtPos(t){return er(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6)}sync(t,e){var M;this.dom?4&this.flags&&(Qs(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(sr(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let i=this.dom.lastChild;for(;i&&Cs.get(i)instanceof qs;)i=i.lastChild;if(!(i&&this.length&&("BR"==i.nodeName||0!=(null===(M=Cs.get(i))||void 0===M?void 0:M.isEditable)||Xs.ios&&this.children.some((t=>t instanceof $s))))){let t=document.createElement("BR");t.cmIgnore=!0,this.dom.appendChild(t)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t,e=0;for(let M of this.children){if(!(M instanceof $s)||/[^ -~]/.test(M.text))return null;let i=gs(M.dom);if(1!=i.length)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(t,e){let M=ir(this,t,e);if(!this.children.length&&M&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=M.bottom-M.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight<e){let i=(e-t.textHeight)/2;return{top:M.top+i,bottom:M.bottom-i,left:M.left,right:M.left}}}return M}become(t){return t instanceof Ir&&0==this.children.length&&0==t.children.length&&nr(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter}covers(){return!0}static find(t,e){for(let M=0,i=0;M<t.children.length;M++){let N=t.children[M],o=i+N.length;if(o>=e){if(N instanceof Ir)return N;if(o>e)break}i=o+N.breakAfter}return null}}class Tr extends Cs{constructor(t,e,M){super(),this.widget=t,this.length=e,this.deco=M,this.breakAfter=0,this.prevWidget=null}merge(t,e,M,i,N,o){return!(M&&(!(M instanceof Tr&&this.widget.compare(M.widget))||t>0&&N<=0||e<this.length&&o<=0))&&(this.length=t+(M?M.length:0)+(this.length-e),!0)}domAtPos(t){return 0==t?ms.before(this.dom):ms.after(this.dom,t==this.length)}split(t){let e=this.length-t;this.length=t;let M=new Tr(this.widget,e,this.deco);return M.breakAfter=this.breakAfter,M}get children(){return Us}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):jo.empty}domBoundsAround(){return null}become(t){return t instanceof Tr&&t.widget.constructor==this.widget.constructor&&(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,e){let M=this.widget.coordsAt(this.dom,t,e);return M||(this.widget instanceof Or?null:Os(this.dom.getBoundingClientRect(),this.length?0==t:e<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:e,endSide:M}=this.deco;return e!=M&&(t<0?e<0:M>0)}}class Or extends Dr{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class yr{constructor(t,e,M,i){this.doc=t,this.pos=e,this.end=M,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Tr&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ir),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(dr(new tr(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof Tr||this.getLine()}buildText(t,e,M){for(;t>0;){if(this.textOff==this.text.length){let{value:e,lineBreak:M,done:i}=this.cursor.next(this.skip);if(this.skip=0,i)throw new Error("Ran out of text content when drawing inline views");if(M){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}this.text=e,this.textOff=0}let i=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-M)),this.getLine().append(dr(new $s(this.text.slice(this.textOff,this.textOff+i)),e),M),this.atCursorPos=!0,this.textOff+=i,t-=i,M=0}}span(t,e,M,i){this.buildText(e-t,M,i),this.pos=e,this.openStart<0&&(this.openStart=i)}point(t,e,M,i,N,o){if(this.disallowBlockEffectsFor[o]&&M instanceof jr){if(M.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let n=e-t;if(M instanceof jr)if(M.block)M.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Tr(M.widget||Ar.block,n,M));else{let o=Ks.create(M.widget||Ar.inline,n,n?0:M.startSide),s=this.atCursorPos&&!o.isEditable&&N<=i.length&&(t<e||M.startSide>0),r=!o.isEditable&&(t<e||N>i.length||M.startSide<=0),D=this.getLine();2!=this.pendingBuffer||s||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(i),s&&(D.append(dr(new tr(1),i),N),N=i.length+Math.max(0,N-i.length)),D.append(dr(o,i),N),this.atCursorPos=r,this.pendingBuffer=r?t<e||N>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(M);n&&(this.textOff+n<=this.text.length?this.textOff+=n:(this.skip+=n-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=N)}static build(t,e,M,i,N){let o=new yr(t,e,M,N);return o.openEnd=vn.spans(i,e,M,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function dr(t,e){for(let M of e)t=new qs(M,[t],t.length);return t}class Ar extends Dr{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ar.inline=new Ar("span"),Ar.block=new Ar("div");var hr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(hr||(hr={}));const Lr=hr.LTR,xr=hr.RTL;function pr(t){let e=[];for(let M=0;M<t.length;M++)e.push(1<<+t[M]);return e}const Sr=pr("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Qr=pr("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Er=Object.create(null),kr=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),M=t.charCodeAt(1);Er[e]=M,Er[M]=-e}function wr(t){return t<=247?Sr[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Qr[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const mr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ur{get dir(){return this.level%2?xr:Lr}constructor(t,e,M){this.from=t,this.to=e,this.level=M}side(t,e){return this.dir==e==t?this.to:this.from}forward(t,e){return t==(this.dir==e)}static find(t,e,M,i){let N=-1;for(let o=0;o<t.length;o++){let n=t[o];if(n.from<=e&&n.to>=e){if(n.level==M)return o;(N<0||(0!=i?i<0?n.from<e:n.to>e:t[N].level>n.level))&&(N=o)}}if(N<0)throw new RangeError("Index out of range");return N}}function Cr(t,e){if(t.length!=e.length)return!1;for(let M=0;M<t.length;M++){let i=t[M],N=e[M];if(i.from!=N.from||i.to!=N.to||i.direction!=N.direction||!Cr(i.inner,N.inner))return!1}return!0}const Yr=[];function br(t,e,M,i,N,o,n){let s=i%2?2:1;if(i%2==N%2)for(let r=e,D=0;r<M;){let e=!0,a=!1;if(D==o.length||r<o[D].from){let t=Yr[r];t!=s&&(e=!1,a=16==t)}let l=e||1!=s?null:[],u=e?i:i+1,g=r;t:for(;;)if(D<o.length&&g==o[D].from){if(a)break t;let j=o[D];if(!e)for(let t=j.to,e=D+1;;){if(t==M)break t;if(!(e<o.length&&o[e].from==t)){if(Yr[t]==s)break t;break}t=o[e++].to}if(D++,l)l.push(j);else{j.from>r&&n.push(new Ur(r,j.from,u)),fr(t,j.direction==Lr!=!(u%2)?i+1:i,N,j.inner,j.from,j.to,n),r=j.to}g=j.to}else{if(g==M||(e?Yr[g]!=s:Yr[g]==s))break;g++}l?br(t,r,g,i+1,N,l,n):r<g&&n.push(new Ur(r,g,u)),r=g}else for(let r=M,D=o.length;r>e;){let M=!0,a=!1;if(!D||r>o[D-1].to){let t=Yr[r-1];t!=s&&(M=!1,a=16==t)}let l=M||1!=s?null:[],u=M?i:i+1,g=r;t:for(;;)if(D&&g==o[D-1].to){if(a)break t;let j=o[--D];if(!M)for(let t=j.from,M=D;;){if(t==e)break t;if(!M||o[M-1].to!=t){if(Yr[t-1]==s)break t;break}t=o[--M].from}if(l)l.push(j);else{j.to<r&&n.push(new Ur(j.to,r,u)),fr(t,j.direction==Lr!=!(u%2)?i+1:i,N,j.inner,j.from,j.to,n),r=j.from}g=j.from}else{if(g==e||(M?Yr[g-1]!=s:Yr[g-1]==s))break;g--}l?br(t,g,r,i+1,N,l,n):g<r&&n.push(new Ur(g,r,u)),r=g}}function fr(t,e,M,i,N,o,n){let s=e%2?2:1;!function(t,e,M,i,N){for(let o=0;o<=i.length;o++){let n=o?i[o-1].to:e,s=o<i.length?i[o].from:M,r=o?256:N;for(let e=n,M=r,i=r;e<s;e++){let N=wr(t.charCodeAt(e));512==N?N=M:8==N&&4==i&&(N=16),Yr[e]=4==N?2:N,7&N&&(i=N),M=N}for(let t=n,e=r,i=r;t<s;t++){let N=Yr[t];if(128==N)t<s-1&&e==Yr[t+1]&&24&e?N=Yr[t]=e:Yr[t]=256;else if(64==N){let N=t+1;for(;N<s&&64==Yr[N];)N++;let o=t&&8==e||N<M&&8==Yr[N]?1==i?1:8:256;for(let e=t;e<N;e++)Yr[e]=o;t=N-1}else 8==N&&1==i&&(Yr[t]=1);e=N,7&N&&(i=N)}}}(t,N,o,i,s),function(t,e,M,i,N){let o=1==N?2:1;for(let n=0,s=0,r=0;n<=i.length;n++){let D=n?i[n-1].to:e,a=n<i.length?i[n].from:M;for(let e,M,i,n=D;n<a;n++)if(M=Er[e=t.charCodeAt(n)])if(M<0){for(let t=s-3;t>=0;t-=3)if(kr[t+1]==-M){let e=kr[t+2],M=2&e?N:4&e?1&e?o:N:0;M&&(Yr[n]=Yr[kr[t]]=M),s=t;break}}else{if(189==kr.length)break;kr[s++]=n,kr[s++]=e,kr[s++]=r}else if(2==(i=Yr[n])||1==i){let t=i==N;r=t?0:1;for(let e=s-3;e>=0;e-=3){let M=kr[e+2];if(2&M)break;if(t)kr[e+2]|=2;else{if(4&M)break;kr[e+2]|=4}}}}}(t,N,o,i,s),function(t,e,M,i){for(let N=0,o=i;N<=M.length;N++){let n=N?M[N-1].to:t,s=N<M.length?M[N].from:e;for(let r=n;r<s;){let n=Yr[r];if(256==n){let n=r+1;for(;;)if(n==s){if(N==M.length)break;n=M[N++].to,s=N<M.length?M[N].from:e}else{if(256!=Yr[n])break;n++}let D=1==o,a=D==(1==(n<e?Yr[n]:i))?D?1:2:i;for(let e=n,i=N,o=i?M[i-1].to:t;e>r;)e==o&&(e=M[--i].from,o=i?M[i-1].to:t),Yr[--e]=a;r=n}else o=n,r++}}}(N,o,i,s),br(t,N,o,e,M,i,n)}function vr(t){return[new Ur(0,t,0)]}let Zr="";function Vr(t,e,M,i,N){var o;let n=i.head-t.from,s=Ur.find(e,n,null!==(o=i.bidiLevel)&&void 0!==o?o:-1,i.assoc),r=e[s],D=r.side(N,M);if(n==D){let t=s+=N?1:-1;if(t<0||t>=e.length)return null;r=e[s=t],n=r.side(!N,M),D=r.side(N,M)}let a=xo(t.text,n,r.forward(N,M));(a<r.from||a>r.to)&&(a=D),Zr=t.text.slice(Math.min(n,a),Math.max(n,a));let l=s==(N?e.length-1:0)?null:e[s+(N?1:-1)];return l&&a==D&&l.level+(N?0:1)<r.level?Vo.cursor(l.side(!N,M)+t.from,l.forward(N,M)?1:-1,l.level):Vo.cursor(a+t.from,r.forward(N,M)?-1:1,r.level)}function Wr(t,e,M){for(let i=e;i<M;i++){let e=wr(t.charCodeAt(i));if(1==e)return Lr;if(2==e||4==e)return xr}return Lr}const Pr=Ro.define(),Rr=Ro.define(),Gr=Ro.define(),Br=Ro.define(),_r=Ro.define(),Fr=Ro.define(),Jr=Ro.define(),Hr=Ro.define(),Xr=Ro.define(),$r=Ro.define({combine:t=>t.some((t=>t))}),qr=Ro.define({combine:t=>t.some((t=>t))}),Kr=Ro.define();class tD{constructor(t,e="nearest",M="nearest",i=5,N=5,o=!1){this.range=t,this.y=e,this.x=M,this.yMargin=i,this.xMargin=N,this.isSnapshot=o}map(t){return t.empty?this:new tD(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new tD(Vo.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const eD=yn.define({map:(t,e)=>t.map(e)}),MD=yn.define();function iD(t,e,M){let i=t.facet(Br);i.length?i[0](e):window.onerror?window.onerror(String(e),M,void 0,void 0,e):M?console.error(M+":",e):console.error(e)}const ND=Ro.define({combine:t=>!t.length||t[0]});let oD=0;const nD=Ro.define();class sD{constructor(t,e,M,i,N){this.id=t,this.create=e,this.domEventHandlers=M,this.domEventObservers=i,this.extension=N(this)}static define(t,e){const{eventHandlers:M,eventObservers:i,provide:N,decorations:o}=e||{};return new sD(oD++,t,M,i,(t=>{let e=[nD.of(t)];return o&&e.push(lD.of((e=>{let M=e.plugin(t);return M?o(M):lr.none}))),N&&e.push(N(t)),e}))}static fromClass(t,e){return sD.define((e=>new t(e)),e)}}class rD{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(iD(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){iD(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){iD(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const DD=Ro.define(),aD=Ro.define(),lD=Ro.define(),uD=Ro.define(),gD=Ro.define(),jD=Ro.define();function cD(t,e){let M=t.state.facet(jD);if(!M.length)return M;let i=M.map((e=>e instanceof Function?e(t):e)),N=[];return vn.spans(i,e.from,e.to,{point(){},span(t,M,i,o){let n=t-e.from,s=M-e.from,r=N;for(let t=i.length-1;t>=0;t--,o--){let M,N=i[t].spec.bidiIsolate;if(null==N&&(N=Wr(e.text,n,s)),o>0&&r.length&&(M=r[r.length-1]).to==n&&M.direction==N)M.to=s,r=M.inner;else{let t={from:n,to:s,direction:N,inner:[]};r.push(t),r=t.inner}}}}),N}const zD=Ro.define();function ID(t){let e=0,M=0,i=0,N=0;for(let o of t.state.facet(zD)){let n=o(t);n&&(null!=n.left&&(e=Math.max(e,n.left)),null!=n.right&&(M=Math.max(M,n.right)),null!=n.top&&(i=Math.max(i,n.top)),null!=n.bottom&&(N=Math.max(N,n.bottom)))}return{left:e,right:M,top:i,bottom:N}}const TD=Ro.define();class OD{constructor(t,e,M,i){this.fromA=t,this.toA=e,this.fromB=M,this.toB=i}join(t){return new OD(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,M=this;for(;e>0;e--){let i=t[e-1];if(!(i.fromA>M.toA)){if(i.toA<M.fromA)break;M=M.join(i),t.splice(e-1,1)}}return t.splice(e,0,M),t}static extendWithRanges(t,e){if(0==e.length)return t;let M=[];for(let i=0,N=0,o=0,n=0;;i++){let s=i==t.length?null:t[i],r=o-n,D=s?s.fromB:1e9;for(;N<e.length&&e[N]<D;){let t=e[N],i=e[N+1],o=Math.max(n,t),s=Math.min(D,i);if(o<=s&&new OD(o+r,s+r,o,s).addToSet(M),i>D)break;N+=2}if(!s)return M;new OD(s.fromA,s.toA,s.fromB,s.toB).addToSet(M),o=s.toA,n=s.toB}}}class yD{constructor(t,e,M){this.view=t,this.state=e,this.transactions=M,this.flags=0,this.startState=t.state,this.changes=mo.empty(this.startState.doc.length);for(let t of M)this.changes=this.changes.compose(t.changes);let i=[];this.changes.iterChangedRanges(((t,e,M,N)=>i.push(new OD(t,e,M,N)))),this.changedRanges=i}static create(t,e,M){return new yD(t,e,M)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((t=>t.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class dD extends Cs{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=lr.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Ir],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new OD(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let M=t.changedRanges;this.minWidth>0&&M.length&&(M.every((({fromA:t,toA:e})=>e<this.minWidthFrom||t>this.minWidthTo))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?i=this.domChanged.newSel.head:function(t,e){let M=!1;e&&t.iterChangedRanges(((t,i)=>{t<e.to&&i>e.from&&(M=!0)}));return M}(t.changes,this.hasComposition)||t.selectionSet||(i=t.state.selection.main.head));let N=i>-1?function(t,e,M){let i=AD(t,M);if(!i)return null;let{node:N,from:o,to:n}=i,s=N.nodeValue;if(/[\n\r]/.test(s))return null;if(t.state.doc.sliceString(i.from,i.to)!=s)return null;let r=e.invertedDesc,D=new OD(r.mapPos(o),r.mapPos(n),o,n),a=[];for(let e=N.parentNode;;e=e.parentNode){let M=Cs.get(e);if(M instanceof qs)a.push({node:e,deco:M.mark});else{if(M instanceof Ir||"DIV"==e.nodeName&&e.parentNode==t.contentDOM)return{range:D,text:N,marks:a,line:e};if(e==t.contentDOM)return null;a.push({node:e,deco:new ur({inclusive:!0,attributes:rr(e),tagName:e.tagName.toLowerCase()})})}}}(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:e,to:i}=this.hasComposition;M=new OD(e,i,t.changes.mapPos(e,-1),t.changes.mapPos(i,1)).addToSet(M.slice())}this.hasComposition=N?{from:N.range.fromB,to:N.range.toB}:null,(Xs.ie||Xs.chrome)&&!N&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=function(t,e,M){let i=new hD;return vn.compare(t,e,M,i),i.changes}(this.decorations,this.updateDeco(),t.changes);return M=OD.extendWithRanges(M,o),!!(7&this.flags||0!=M.length)&&(this.updateInner(M,t.startState.doc.length,N),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,M){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,M);let{observer:i}=this.view;i.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=Xs.chrome||Xs.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,t),this.flags&=-8,t&&(t.written||i.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((t=>t.flags&=-9));let N=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let t of this.children)t instanceof Tr&&t.widget instanceof Or&&N.push(t.dom);i.updateGaps(N)}updateChildren(t,e,M){let i=M?M.range.addToSet(t.slice()):t,N=this.childCursor(e);for(let t=i.length-1;;t--){let e=t>=0?i[t]:null;if(!e)break;let o,n,s,r,{fromA:D,toA:a,fromB:l,toB:u}=e;if(M&&M.range.fromB<u&&M.range.toB>l){let t=yr.build(this.view.state.doc,l,M.range.fromB,this.decorations,this.dynamicDecorationMap),e=yr.build(this.view.state.doc,M.range.toB,u,this.decorations,this.dynamicDecorationMap);n=t.breakAtStart,s=t.openStart,r=e.openEnd;let i=this.compositionView(M);e.breakAtStart?i.breakAfter=1:e.content.length&&i.merge(i.length,i.length,e.content[0],!1,e.openStart,0)&&(i.breakAfter=e.content[0].breakAfter,e.content.shift()),t.content.length&&i.merge(0,0,t.content[t.content.length-1],!0,0,t.openEnd)&&t.content.pop(),o=t.content.concat(i).concat(e.content)}else({content:o,breakAtStart:n,openStart:s,openEnd:r}=yr.build(this.view.state.doc,l,u,this.decorations,this.dynamicDecorationMap));let{i:g,off:j}=N.findPos(a,1),{i:c,off:z}=N.findPos(D,-1);fs(this,c,z,g,j,o,n,s,r)}M&&this.fixCompositionDOM(M)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let t of e.effects)t.is(MD)&&(this.editContextFormatting=t.value)}compositionView(t){let e=new $s(t.text.nodeValue);e.flags|=8;for(let{deco:M}of t.marks)e=new qs(M,[e],e.length);let M=new Ir;return M.append(e,0),M}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some((t=>7&t.flags))?1:0),this.markedForComposition.add(e);let M=Cs.get(t);M&&M!=e&&(M.dom=null),e.setDOM(t)},M=this.childPos(t.range.fromB,1),i=this.children[M.i];e(t.line,i);for(let N=t.marks.length-1;N>=-1;N--)M=i.childPos(M.off,1),i=i.children[M.i],e(N>=0?t.marks[N].node:t.text,i)}updateSelection(t=!1,e=!1){!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let M=this.view.root.activeElement,i=M==this.dom,N=!i&&!(this.view.state.facet(ND)||this.dom.tabIndex>-1)&&us(this.dom,this.view.observer.selectionRange)&&!(M&&this.dom.contains(M));if(!(i||e||N))return;let o=this.forceSelection;this.forceSelection=!1;let n=this.view.state.selection.main,s=this.moveToLine(this.domAtPos(n.anchor)),r=n.empty?s:this.moveToLine(this.domAtPos(n.head));if(Xs.gecko&&n.empty&&!this.hasComposition&&(1==(D=s).node.nodeType&&D.node.firstChild&&(0==D.offset||"false"==D.node.childNodes[D.offset-1].contentEditable)&&(D.offset==D.node.childNodes.length||"false"==D.node.childNodes[D.offset].contentEditable))){let t=document.createTextNode("");this.view.observer.ignore((()=>s.node.insertBefore(t,s.node.childNodes[s.offset]||null))),s=r=new ms(t,0),o=!0}var D;let a=this.view.observer.selectionRange;!o&&a.focusNode&&(js(s.node,s.offset,a.anchorNode,a.anchorOffset)&&js(r.node,r.offset,a.focusNode,a.focusOffset)||this.suppressWidgetCursorChange(a,n))||(this.view.observer.ignore((()=>{Xs.android&&Xs.chrome&&this.dom.contains(a.focusNode)&&function(t,e){for(let M=t;M&&M!=e;M=M.assignedSlot||M.parentNode)if(1==M.nodeType&&"false"==M.contentEditable)return!0;return!1}(a.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=as(this.view.root);if(t)if(n.empty){if(Xs.gecko){let t=function(t,e){return 1!=t.nodeType?0:(e&&"false"==t.childNodes[e-1].contentEditable?1:0)|(e<t.childNodes.length&&"false"==t.childNodes[e].contentEditable?2:0)}(s.node,s.offset);if(t&&3!=t){let e=(1==t?ks:ws)(s.node,s.offset);e&&(s=new ms(e.node,e.offset))}}t.collapse(s.node,s.offset),null!=n.bidiLevel&&void 0!==t.caretBidiLevel&&(t.caretBidiLevel=n.bidiLevel)}else if(t.extend){t.collapse(s.node,s.offset);try{t.extend(r.node,r.offset)}catch(t){}}else{let e=document.createRange();n.anchor>n.head&&([s,r]=[r,s]),e.setEnd(r.node,r.offset),e.setStart(s.node,s.offset),t.removeAllRanges(),t.addRange(e)}else;N&&this.view.root.activeElement==this.dom&&(this.dom.blur(),M&&M.focus())})),this.view.observer.setSelectionRange(s,r)),this.impreciseAnchor=s.precise?null:new ms(a.anchorNode,a.anchorOffset),this.impreciseHead=r.precise?null:new ms(a.focusNode,a.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&js(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,M=as(t.root),{anchorNode:i,anchorOffset:N}=t.observer.selectionRange;if(!(M&&e.empty&&e.assoc&&M.modify))return;let o=Ir.find(this,e.head);if(!o)return;let n=o.posAtStart;if(e.head==n||e.head==n+o.length)return;let s=this.coordsAt(e.head,-1),r=this.coordsAt(e.head,1);if(!s||!r||s.bottom>r.top)return;let D=this.domAtPos(e.head+e.assoc);M.collapse(D.node,D.offset),M.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let a=t.observer.selectionRange;t.docView.posFromDOM(a.anchorNode,a.anchorOffset)!=e.from&&M.collapse(i,N)}moveToLine(t){let e,M=this.dom;if(t.node!=M)return t;for(let i=t.offset;!e&&i<M.childNodes.length;i++){let t=Cs.get(M.childNodes[i]);t instanceof Ir&&(e=t.domAtPos(0))}for(let i=t.offset-1;!e&&i>=0;i--){let t=Cs.get(M.childNodes[i]);t instanceof Ir&&(e=t.domAtPos(t.length))}return e?new ms(e.node,e.offset,!0):t}nearest(t){for(let e=t;e;){let t=Cs.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let M=this.nearest(t);if(!M)throw new RangeError("Trying to find position for a DOM position outside of the document");return M.localPosFromDOM(t,e)+M.posAtStart}domAtPos(t){let{i:e,off:M}=this.childCursor().findPos(t,-1);for(;e<this.children.length-1;){let t=this.children[e];if(M<t.length||t instanceof Ir)break;e++,M=0}return this.children[e].domAtPos(M)}coordsAt(t,e){let M=null,i=0;for(let N=this.length,o=this.children.length-1;o>=0;o--){let n=this.children[o],s=N-n.breakAfter,r=s-n.length;if(s<t)break;if(r<=t&&(r<t||n.covers(-1))&&(s>t||n.covers(1))&&(!M||n instanceof Ir&&!(M instanceof Ir&&e>=0)))M=n,i=r;else if(M&&r==t&&s==t&&n instanceof Tr&&Math.abs(e)<2){if(n.deco.startSide<0)break;o&&(M=null)}N=r}return M?M.coordsAt(t-i,e):null}coordsForChar(t){let{i:e,off:M}=this.childPos(t,1),i=this.children[e];if(!(i instanceof Ir))return null;for(;i.children.length;){let{i:t,off:e}=i.childPos(M,1);for(;;t++){if(t==i.children.length)return null;if((i=i.children[t]).length)break}M=e}if(!(i instanceof $s))return null;let N=xo(i.text,M);if(N==M)return null;let o=ps(i.dom,M,N).getClientRects();for(let t=0;t<o.length;t++){let e=o[t];if(t==o.length-1||e.top<e.bottom&&e.left<e.right)return e}return null}measureVisibleLineHeights(t){let e=[],{from:M,to:i}=t,N=this.view.contentDOM.clientWidth,o=N>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,n=-1,s=this.view.textDirection==hr.LTR;for(let t=0,r=0;r<this.children.length;r++){let D=this.children[r],a=t+D.length;if(a>i)break;if(t>=M){let M=D.dom.getBoundingClientRect();if(e.push(M.height),o){let e=D.dom.lastChild,i=e?gs(e):[];if(i.length){let e=i[i.length-1],o=s?e.right-M.left:M.right-e.left;o>n&&(n=o,this.minWidth=N,this.minWidthFrom=t,this.minWidthTo=a)}}}t=a+D.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?hr.RTL:hr.LTR}measureTextSize(){for(let t of this.children)if(t instanceof Ir){let e=t.measureTextSize();if(e)return e}let t,e,M,i=document.createElement("div");return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(i);let N=gs(i.firstChild)[0];t=i.getBoundingClientRect().height,e=N?N.width/27:7,M=N?N.height:t,i.remove()})),{lineHeight:t,charWidth:e,textHeight:M}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new bs(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let M=0,i=0;;i++){let N=i==e.viewports.length?null:e.viewports[i],o=N?N.from-1:this.length;if(o>M){let i=(e.lineBlockAt(o).bottom-e.lineBlockAt(M).top)/this.view.scaleY;t.push(lr.replace({widget:new Or(i),block:!0,inclusive:!0,isBlockGap:!0}).range(M,o))}if(!N)break;M=N.to+1}return lr.set(t)}updateDeco(){let t=1,e=this.view.state.facet(lD).map((e=>(this.dynamicDecorationMap[t++]="function"==typeof e)?e(this.view):e)),M=!1,i=this.view.state.facet(uD).map(((t,e)=>{let i="function"==typeof t;return i&&(M=!0),i?t(this.view):t}));for(i.length&&(this.dynamicDecorationMap[t++]=M,e.push(vn.join(i))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations}scrollIntoView(t){if(t.isSnapshot){let e=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=e.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin)}for(let e of this.view.state.facet(Kr))try{if(e(this.view,t.range,t))return!0}catch(t){iD(this.view.state,t,"scroll handler")}let e,{range:M}=t,i=this.coordsAt(M.head,M.empty?M.assoc:M.head>M.anchor?-1:1);if(!i)return;!M.empty&&(e=this.coordsAt(M.anchor,M.anchor>M.head?-1:1))&&(i={left:Math.min(i.left,e.left),top:Math.min(i.top,e.top),right:Math.max(i.right,e.right),bottom:Math.max(i.bottom,e.bottom)});let N=ID(this.view),o={left:i.left-N.left,top:i.top-N.top,right:i.right+N.right,bottom:i.bottom+N.bottom},{offsetWidth:n,offsetHeight:s}=this.view.scrollDOM;!function(t,e,M,i,N,o,n,s){let r=t.ownerDocument,D=r.defaultView||window;for(let a=t,l=!1;a&&!l;)if(1==a.nodeType){let t,u=a==r.body,g=1,j=1;if(u)t=ys(D);else{if(/^(fixed|sticky)$/.test(getComputedStyle(a).position)&&(l=!0),a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth){a=a.assignedSlot||a.parentNode;continue}let e=a.getBoundingClientRect();({scaleX:g,scaleY:j}=ds(a,e)),t={left:e.left,right:e.left+a.clientWidth*g,top:e.top,bottom:e.top+a.clientHeight*j}}let c=0,z=0;if("nearest"==N)e.top<t.top?(z=-(t.top-e.top+n),M>0&&e.bottom>t.bottom+z&&(z=e.bottom-t.bottom+z+n)):e.bottom>t.bottom&&(z=e.bottom-t.bottom+n,M<0&&e.top-z<t.top&&(z=-(t.top+z-e.top+n)));else{let i=e.bottom-e.top,o=t.bottom-t.top;z=("center"==N&&i<=o?e.top+i/2-o/2:"start"==N||"center"==N&&M<0?e.top-n:e.bottom-o+n)-t.top}if("nearest"==i?e.left<t.left?(c=-(t.left-e.left+o),M>0&&e.right>t.right+c&&(c=e.right-t.right+c+o)):e.right>t.right&&(c=e.right-t.right+o,M<0&&e.left<t.left+c&&(c=-(t.left+c-e.left+o))):c=("center"==i?e.left+(e.right-e.left)/2-(t.right-t.left)/2:"start"==i==s?e.left-o:e.right-(t.right-t.left)+o)-t.left,c||z)if(u)D.scrollBy(c,z);else{let t=0,M=0;if(z){let t=a.scrollTop;a.scrollTop+=z/j,M=(a.scrollTop-t)*j}if(c){let e=a.scrollLeft;a.scrollLeft+=c/g,t=(a.scrollLeft-e)*g}e={left:e.left-t,top:e.top-M,right:e.right-t,bottom:e.bottom-M},t&&Math.abs(t-c)<1&&(i="nearest"),M&&Math.abs(M-z)<1&&(N="nearest")}if(u)break;a=a.assignedSlot||a.parentNode}else{if(11!=a.nodeType)break;a=a.host}}(this.view.scrollDOM,o,M.head<M.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,n),-n),Math.max(Math.min(t.yMargin,s),-s),this.view.textDirection==hr.LTR)}}function AD(t,e){let M=t.observer.selectionRange;if(!M.focusNode)return null;let i=ks(M.focusNode,M.focusOffset),N=ws(M.focusNode,M.focusOffset),o=i||N;if(N&&i&&N.node!=i.node){let e=Cs.get(N.node);if(!e||e instanceof $s&&e.text!=N.node.nodeValue)o=N;else if(t.docView.lastCompositionAfterCursor){let t=Cs.get(i.node);!t||t instanceof $s&&t.text!=i.node.nodeValue||(o=N)}}if(t.docView.lastCompositionAfterCursor=o!=i,!o)return null;let n=e-o.offset;return{from:n,to:n+o.node.nodeValue.length,node:o.node}}let hD=class{constructor(){this.changes=[]}compareRange(t,e){zr(t,e,this.changes)}comparePoint(t,e){zr(t,e,this.changes)}boundChange(t){zr(t,t,this.changes)}};function LD(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function xD(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function pD(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function SD(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function QD(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function ED(t,e,M){let i,N,o,n,s,r,D,a,l=!1;for(let u=t.firstChild;u;u=u.nextSibling){let t=gs(u);for(let g=0;g<t.length;g++){let j=t[g];N&&pD(N,j)&&(j=SD(QD(j,N.bottom),N.top));let c=LD(e,j),z=xD(M,j);if(0==c&&0==z)return 3==u.nodeType?kD(u,e,M):ED(u,e,M);if(!i||n>z||n==z&&o>c){i=u,N=j,o=c,n=z;let s=z?M<j.top?-1:1:c?e<j.left?-1:1:0;l=!s||(s>0?g<t.length-1:g>0)}0==c?M>j.bottom&&(!D||D.bottom<j.bottom)?(s=u,D=j):M<j.top&&(!a||a.top>j.top)&&(r=u,a=j):D&&pD(D,j)?D=QD(D,j.bottom):a&&pD(a,j)&&(a=SD(a,j.top))}}if(D&&D.bottom>=M?(i=s,N=D):a&&a.top<=M&&(i=r,N=a),!i)return{node:t,offset:0};let u=Math.max(N.left,Math.min(N.right,e));return 3==i.nodeType?kD(i,u,M):l&&"false"!=i.contentEditable?ED(i,u,M):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,i)+(e>=(N.left+N.right)/2?1:0)}}function kD(t,e,M){let i=t.nodeValue.length,N=-1,o=1e9,n=0;for(let s=0;s<i;s++){let i=ps(t,s,s+1).getClientRects();for(let r=0;r<i.length;r++){let D=i[r];if(D.top==D.bottom)continue;n||(n=e-D.left);let a=(D.top>M?D.top-M:M-D.bottom)-1;if(D.left-1<=e&&D.right+1>=e&&a<o){let M=e>=(D.left+D.right)/2,i=M;if(Xs.chrome||Xs.gecko){ps(t,s).getBoundingClientRect().left==D.right&&(i=!M)}if(a<=0)return{node:t,offset:s+(i?1:0)};N=s+(i?1:0),o=a}}}return{node:t,offset:N>-1?N:n>0?t.nodeValue.length:0}}function wD(t,e,M,i=-1){var N,o;let n,s=t.contentDOM.getBoundingClientRect(),r=s.top+t.viewState.paddingTop,{docHeight:D}=t.viewState,{x:a,y:l}=e,u=l-r;if(u<0)return 0;if(u>D)return t.state.doc.length;for(let e=t.viewState.heightOracle.textHeight/2,N=!1;n=t.elementAtHeight(u),n.type!=ar.Text;)for(;u=i>0?n.bottom+e:n.top-e,!(u>=0&&u<=D);){if(N)return M?null:0;N=!0,i=-i}l=r+u;let g=n.from;if(g<t.viewport.from)return 0==t.viewport.from?0:M?null:mD(t,s,n,a,l);if(g>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:M?null:mD(t,s,n,a,l);let j=t.dom.ownerDocument,c=t.root.elementFromPoint?t.root:j,z=c.elementFromPoint(a,l);z&&!t.contentDOM.contains(z)&&(z=null),z||(a=Math.max(s.left+1,Math.min(s.right-1,a)),z=c.elementFromPoint(a,l),z&&!t.contentDOM.contains(z)&&(z=null));let I,T=-1;if(z&&0!=(null===(N=t.docView.nearest(z))||void 0===N?void 0:N.isEditable)){if(j.caretPositionFromPoint){let t=j.caretPositionFromPoint(a,l);t&&({offsetNode:I,offset:T}=t)}else if(j.caretRangeFromPoint){let e=j.caretRangeFromPoint(a,l);e&&(({startContainer:I,startOffset:T}=e),(!t.contentDOM.contains(I)||Xs.safari&&function(t,e,M){let i;if(3!=t.nodeType||e!=(i=t.nodeValue.length))return!1;for(let e=t.nextSibling;e;e=e.nextSibling)if(1!=e.nodeType||"BR"!=e.nodeName)return!1;return ps(t,i-1,i).getBoundingClientRect().left>M}(I,T,a)||Xs.chrome&&function(t,e,M){if(0!=e)return!1;for(let e=t;;){let t=e.parentNode;if(!t||1!=t.nodeType||t.firstChild!=e)return!1;if(t.classList.contains("cm-line"))break;e=t}let i=1==t.nodeType?t.getBoundingClientRect():ps(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return M-i.left>5}(I,T,a))&&(I=void 0))}I&&(T=Math.min(Ts(I),T))}if(!I||!t.docView.dom.contains(I)){let e=Ir.find(t.docView,g);if(!e)return u>n.top+n.height/2?n.to:n.from;({node:I,offset:T}=ED(e.dom,a,l))}let O=t.docView.nearest(I);if(!O)return null;if(O.isWidget&&1==(null===(o=O.dom)||void 0===o?void 0:o.nodeType)){let t=O.dom.getBoundingClientRect();return e.y<t.top||e.y<=t.bottom&&e.x<=(t.left+t.right)/2?O.posAtStart:O.posAtEnd}return O.localPosFromDOM(I,T)+O.posAtStart}function mD(t,e,M,i,N){let o=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&M.height>1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;o+=Math.floor((N-M.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let n=t.state.sliceDoc(M.from,M.to);return M.from+$n(n,o,t.state.tabSize)}function UD(t,e){let M=t.lineBlockAt(e);if(Array.isArray(M.type))for(let t of M.type)if(t.to>e||t.to==e&&(t.to==M.to||t.type==ar.Text))return t;return M}function CD(t,e,M,i){let N=t.state.doc.lineAt(e.head),o=t.bidiSpans(N),n=t.textDirectionAt(N.from);for(let s=e,r=null;;){let e=Vr(N,o,n,s,M),D=Zr;if(!e){if(N.number==(M?t.state.doc.lines:1))return s;D="\n",N=t.state.doc.line(N.number+(M?1:-1)),o=t.bidiSpans(N),e=t.visualLineSide(N,!M)}if(r){if(!r(D))return s}else{if(!i)return e;r=i(D)}s=e}}function YD(t,e,M){for(;;){let i=0;for(let N of t)N.between(e-1,e+1,((t,N,o)=>{if(e>t&&e<N){let o=i||M||(e-t<N-e?-1:1);e=o<0?t:N,i=o}}));if(!i)return e}}function bD(t,e,M){let i=YD(t.state.facet(gD).map((e=>e(t))),M.from,e.head>M.from?-1:1);return i==M.from?M:Vo.cursor(i,i<M.from?1:-1)}const fD="￿";class vD{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(mn.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=fD}readRange(t,e){if(!t)return this;let M=t.parentNode;for(let i=t;;){this.findPointBefore(M,i);let t=this.text.length;this.readNode(i);let N=i.nextSibling;if(N==e)break;let o=Cs.get(i),n=Cs.get(N);(o&&n?o.breakAfter:(o?o.breakAfter:zs(i))||zs(N)&&("BR"!=i.nodeName||i.cmIgnore)&&this.text.length>t)&&this.lineBreak(),i=N}return this.findPointBefore(M,e),this}readTextNode(t){let e=t.nodeValue;for(let M of this.points)M.node==t&&(M.pos=this.text.length+Math.min(M.offset,e.length));for(let M=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let N,o=-1,n=1;if(this.lineSeparator?(o=e.indexOf(this.lineSeparator,M),n=this.lineSeparator.length):(N=i.exec(e))&&(o=N.index,n=N[0].length),this.append(e.slice(M,o<0?e.length:o)),o<0)break;if(this.lineBreak(),n>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=n-1);M=o+n}}readNode(t){if(t.cmIgnore)return;let e=Cs.get(t),M=e&&e.overrideDOMText;if(null!=M){this.findPointInside(t,M.length);for(let t=M.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let M of this.points)M.node==t&&t.childNodes[M.offset]==e&&(M.pos=this.text.length)}findPointInside(t,e){for(let M of this.points)(3==t.nodeType?M.node==t:t.contains(M.node))&&(M.pos=this.text.length+(ZD(t,M.node,M.offset)?e:0))}}function ZD(t,e,M){for(;;){if(!e||M<Ts(e))return!1;if(e==t)return!0;M=cs(e)+1,e=e.parentNode}}class VD{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class WD{constructor(t,e,M,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:N,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,M,0))){let e=N||o?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:M,anchorOffset:i,focusNode:N,focusOffset:o}=t.observer.selectionRange;M&&(e.push(new VD(M,i)),N==M&&o==i||e.push(new VD(N,o)));return e}(t),M=new vD(e,t.state);M.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=M.text,this.newSel=function(t,e){if(0==t.length)return null;let M=t[0].pos,i=2==t.length?t[1].pos:M;return M>-1&&i>-1?Vo.single(M+e,i+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,M=N&&N.node==e.focusNode&&N.offset==e.focusOffset||!ls(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),i=o&&o.node==e.anchorNode&&o.offset==e.anchorOffset||!ls(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),n=t.viewport;if((Xs.ios||Xs.chrome)&&t.state.selection.main.empty&&M!=i&&(n.from>0||n.to<t.state.doc.length)){let e=Math.min(M,i),N=Math.max(M,i),o=n.from-e,s=n.to-N;0!=o&&1!=o&&0!=e||0!=s&&-1!=s&&N!=t.state.doc.length||(M=0,i=t.state.doc.length)}this.newSel=Vo.single(i,M)}}}function PD(t,e){let M,{newSel:i}=e,N=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:i,to:n}=e.bounds,s=N.from,r=null;(8===o||Xs.android&&e.text.length<n-i)&&(s=N.to,r="end");let D=function(t,e,M,i){let N=Math.min(t.length,e.length),o=0;for(;o<N&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==N&&t.length==e.length)return null;let n=t.length,s=e.length;for(;n>0&&s>0&&t.charCodeAt(n-1)==e.charCodeAt(s-1);)n--,s--;if("end"==i){M-=n+Math.max(0,o-Math.min(n,s))-o}if(n<o&&t.length<e.length){o-=M<=o&&M>=n?o-M:0,s=o+(s-n),n=o}else if(s<o){o-=M<=o&&M>=s?o-M:0,n=o+(n-s),s=o}return{from:o,toA:n,toB:s}}(t.state.doc.sliceString(i,n,fD),e.text,s-i,r);D&&(Xs.chrome&&13==o&&D.toB==D.from+2&&e.text.slice(D.from,D.toB)==fD+fD&&D.toB--,M={from:i+D.from,to:i+D.toA,insert:jo.of(e.text.slice(D.from,D.toB).split(fD))})}else i&&(!t.hasFocus&&t.state.facet(ND)||i.main.eq(N))&&(i=null);if(!M&&!i)return!1;if(!M&&e.typeOver&&!N.empty&&i&&i.main.empty?M={from:N.from,to:N.to,insert:t.state.doc.slice(N.from,N.to)}:(Xs.mac||Xs.android)&&M&&M.from==M.to&&M.from==N.head-1&&/^\. ?$/.test(M.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(i&&2==M.insert.length&&(i=Vo.single(i.main.anchor-1,i.main.head-1)),M={from:M.from,to:M.to,insert:jo.of([M.insert.toString().replace("."," ")])}):M&&M.from>=N.from&&M.to<=N.to&&(M.from!=N.from||M.to!=N.to)&&N.to-N.from-(M.to-M.from)<=4?M={from:N.from,to:N.to,insert:t.state.doc.slice(N.from,M.from).append(M.insert).append(t.state.doc.slice(M.to,N.to))}:Xs.chrome&&M&&M.from==M.to&&M.from==N.head&&"\n "==M.insert.toString()&&t.lineWrapping&&(i&&(i=Vo.single(i.main.anchor-1,i.main.head-1)),M={from:N.from,to:N.to,insert:jo.of([" "])}),M)return RD(t,M,i,o);if(i&&!i.main.eq(N)){let e=!1,M="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),M=t.inputState.lastSelectionOrigin),t.dispatch({selection:i,scrollIntoView:e,userEvent:M}),!0}return!1}function RD(t,e,M,i=-1){if(Xs.ios&&t.inputState.flushIOSKey(e))return!0;let N=t.state.selection.main;if(Xs.android&&(e.to==N.to&&(e.from==N.from||e.from==N.from-1&&" "==t.state.sliceDoc(e.from,N.from))&&1==e.insert.length&&2==e.insert.lines&&Ss(t.contentDOM,"Enter",13)||(e.from==N.from-1&&e.to==N.to&&0==e.insert.length||8==i&&e.insert.length<e.to-e.from&&e.to>N.head)&&Ss(t.contentDOM,"Backspace",8)||e.from==N.from&&e.to==N.to+1&&0==e.insert.length&&Ss(t.contentDOM,"Delete",46)))return!0;let o,n=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s=()=>o||(o=function(t,e,M){let i,N=t.state,o=N.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!M||M.main.empty&&M.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let M=o.from<e.from?N.sliceDoc(o.from,e.from):"",n=o.to>e.to?N.sliceDoc(e.to,o.to):"";i=N.replaceSelection(t.state.toText(M+e.insert.sliceString(0,void 0,t.state.lineBreak)+n))}else{let n=N.changes(e),s=M&&M.main.to<=n.newLength?M.main:void 0;if(N.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let r,D=t.state.sliceDoc(e.from,e.to),a=M&&AD(t,M.main.head);if(a){let t=e.insert.length-(e.to-e.from);r={from:a.from,to:a.to-t}}else r=t.state.doc.lineAt(o.head);let l=o.to-e.to,u=o.to-o.from;i=N.changeByRange((M=>{if(M.from==o.from&&M.to==o.to)return{changes:n,range:s||M.map(n)};let i=M.to-l,a=i-D.length;if(M.to-M.from!=u||t.state.sliceDoc(a,i)!=D||M.to>=r.from&&M.from<=r.to)return{range:M};let g=N.changes({from:a,to:i,insert:e.insert}),j=M.to-o.to;return{changes:g,range:s?Vo.range(Math.max(0,s.anchor+j),Math.max(0,s.head+j)):M.map(g)}}))}else i={changes:n,selection:s&&N.selection.replaceRange(s)}}let n="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,n+=".compose",t.inputState.compositionFirstChange&&(n+=".start",t.inputState.compositionFirstChange=!1));return N.update(i,{userEvent:n,scrollIntoView:!0})}(t,e,M));return t.state.facet(Fr).some((M=>M(t,e.from,e.to,n,s)))||t.dispatch(s()),!0}class GD{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Xs.safari&&t.contentDOM.addEventListener("input",(()=>null)),Xs.gecko&&function(t){Ia.has(t)||(Ia.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{})))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let M,i=e.target;i!=t.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(M=Cs.get(i))&&M.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t))}runHandlers(t,e){let M=this.handlers[t];if(M){for(let t of M.observers)t(this.view,e);for(let t of M.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=_D(t),M=this.handlers,i=this.view.contentDOM;for(let t in e)if("scroll"!=t){let N=!e[t].handlers.length,o=M[t];o&&N!=!o.handlers.length&&(i.removeEventListener(t,this.handleEvent),o=null),o||i.addEventListener(t,this.handleEvent,{passive:N})}for(let t in M)"scroll"==t||e[t]||i.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&HD.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Xs.android&&Xs.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return!Xs.ios||t.synthetic||t.altKey||t.metaKey||!((e=FD.find((e=>e.keyCode==t.keyCode)))&&!t.ctrlKey||JD.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(!("Enter"==e.key&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString()))&&(this.pendingIOSKey=void 0,Ss(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0)))}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(Xs.safari&&!Xs.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function BD(t,e){return(M,i)=>{try{return e.call(t,i,M)}catch(t){iD(M.state,t)}}}function _D(t){let e=Object.create(null);function M(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec;if(t&&t.domEventHandlers)for(let i in t.domEventHandlers){let N=t.domEventHandlers[i];N&&M(i).handlers.push(BD(e.value,N))}if(t&&t.domEventObservers)for(let i in t.domEventObservers){let N=t.domEventObservers[i];N&&M(i).observers.push(BD(e.value,N))}}for(let t in qD)M(t).handlers.push(qD[t]);for(let t in KD)M(t).observers.push(KD[t]);return e}const FD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],JD="dthko",HD=[16,17,18,20,91,92,224,225];function XD(t){return.7*Math.max(0,t)+8}class $D{constructor(t,e,M,i){this.view=t,this.startEvent=e,this.style=M,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){let e,M,i=t.ownerDocument;for(let N=t.parentNode;N&&!(N==i.body||e&&M);)if(1==N.nodeType)!M&&N.scrollHeight>N.clientHeight&&(M=N),!e&&N.scrollWidth>N.clientWidth&&(e=N),N=N.assignedSlot||N.parentNode;else{if(11!=N.nodeType)break;N=N.host}return{x:e,y:M}}(t.contentDOM),this.atoms=t.state.facet(gD).map((e=>e(t)));let N=t.contentDOM.ownerDocument;N.addEventListener("mousemove",this.move=this.move.bind(this)),N.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(mn.allowMultipleSelections)&&function(t,e){let M=t.state.facet(Pr);return M.length?M[0](e):Xs.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:M}=t.state.selection;if(M.empty)return!1;let i=as(t.root);if(!i||0==i.rangeCount)return!0;let N=i.getRangeAt(0).getClientRects();for(let t=0;t<N.length;t++){let M=N[t];if(M.left<=e.clientX&&M.right>=e.clientX&&M.top<=e.clientY&&M.bottom>=e.clientY)return!0}return!1}(t,e)||1!=la(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&function(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,M=0,i=0,N=0,o=this.view.win.innerWidth,n=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:N,bottom:n}=this.scrollParents.y.getBoundingClientRect());let s=ID(this.view);t.clientX-s.left<=i+6?e=-XD(i-t.clientX):t.clientX+s.right>=o-6&&(e=XD(t.clientX-o)),t.clientY-s.top<=N+6?M=-XD(N-t.clientY):t.clientY+s.bottom>=n-6&&(M=XD(t.clientY-n)),this.setScrollSpeed(e,M)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let M=0;M<t.ranges.length;M++){let i=t.ranges[M],N=null;if(i.empty){let t=YD(this.atoms,i.from,0);t!=i.from&&(N=Vo.cursor(t,-1))}else{let t=YD(this.atoms,i.from,-1),e=YD(this.atoms,i.to,1);t==i.from&&e==i.to||(N=Vo.range(i.from==i.anchor?t:e,i.from==i.head?t:e))}N&&(e||(e=t.ranges.slice()),e[M]=N)}return e?Vo.create(e,t.mainIndex):t}select(t){let{view:e}=this,M=this.skipAtoms(this.style.get(t,this.extend,this.multiple));!this.mustSelect&&M.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:M,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some((t=>t.isUserEvent("input.type")))?this.destroy():this.style.update(t)&&setTimeout((()=>this.select(this.lastEvent)),20)}}const qD=Object.create(null),KD=Object.create(null),ta=Xs.ie&&Xs.ie_version<15||Xs.ios&&Xs.webkit_version<604;function ea(t,e,M){for(let i of t.facet(e))M=i(M,t);return M}function Ma(t,e){e=ea(t.state,Hr,e);let M,{state:i}=t,N=1,o=i.toText(e),n=o.lines==i.selection.ranges.length,s=null!=ga&&i.selection.ranges.every((t=>t.empty))&&ga==o.toString();if(s){let t=-1;M=i.changeByRange((M=>{let s=i.doc.lineAt(M.from);if(s.from==t)return{range:M};t=s.from;let r=i.toText((n?o.line(N++).text:e)+i.lineBreak);return{changes:{from:s.from,insert:r},range:Vo.cursor(M.from+r.length)}}))}else M=n?i.changeByRange((t=>{let e=o.line(N++);return{changes:{from:t.from,to:t.to,insert:e.text},range:Vo.cursor(t.from+e.length)}})):i.replaceSelection(o);t.dispatch(M,{userEvent:"input.paste",scrollIntoView:!0})}function ia(t,e,M,i){if(1==i)return Vo.cursor(e,M);if(2==i)return function(t,e,M=1){let i=t.charCategorizer(e),N=t.doc.lineAt(e),o=e-N.from;if(0==N.length)return Vo.cursor(e);0==o?M=1:o==N.length&&(M=-1);let n=o,s=o;M<0?n=xo(N.text,o,!1):s=xo(N.text,o);let r=i(N.text.slice(n,s));for(;n>0;){let t=xo(N.text,n,!1);if(i(N.text.slice(t,n))!=r)break;n=t}for(;s<N.length;){let t=xo(N.text,s);if(i(N.text.slice(s,t))!=r)break;s=t}return Vo.range(n+N.from,s+N.from)}(t.state,e,M);{let M=Ir.find(t.docView,e),i=t.state.doc.lineAt(M?M.posAtEnd:e),N=M?M.posAtStart:i.from,o=M?M.posAtEnd:i.to;return o<t.state.doc.length&&o==i.to&&o++,Vo.range(N,o)}}KD.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},qD.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),KD.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},KD.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},qD.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let M=null;for(let i of t.state.facet(Gr))if(M=i(t,e),M)break;if(M||0!=e.button||(M=function(t,e){let M=na(t,e),i=la(e),N=t.state.selection;return{update(t){t.docChanged&&(M.pos=t.changes.mapPos(M.pos),N=N.map(t.changes))},get(e,o,n){let s,r=na(t,e),D=ia(t,r.pos,r.bias,i);if(M.pos!=r.pos&&!o){let e=ia(t,M.pos,M.bias,i),N=Math.min(e.from,D.from),o=Math.max(e.to,D.to);D=N<D.from?Vo.range(N,o):Vo.range(o,N)}return o?N.replaceRange(N.main.extend(D.from,D.to)):n&&1==i&&N.ranges.length>1&&(s=function(t,e){for(let M=0;M<t.ranges.length;M++){let{from:i,to:N}=t.ranges[M];if(i<=e&&N>=e)return Vo.create(t.ranges.slice(0,M).concat(t.ranges.slice(M+1)),t.mainIndex==M?0:t.mainIndex-(t.mainIndex>M?1:0))}return null}(N,r.pos))?s:n?N.addRange(D):Vo.create([D])}}}(t,e)),M){let i=!t.hasFocus;t.inputState.startMouseSelection(new $D(t,e,M,i)),i&&t.observer.ignore((()=>{xs(t.contentDOM);let e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur()}));let N=t.inputState.mouseSelection;if(N)return N.start(e),!1===N.dragging}return!1};let Na=(t,e,M)=>e>=M.top&&e<=M.bottom&&t>=M.left&&t<=M.right;function oa(t,e,M,i){let N=Ir.find(t.docView,e);if(!N)return 1;let o=e-N.posAtStart;if(0==o)return 1;if(o==N.length)return-1;let n=N.coordsAt(o,-1);if(n&&Na(M,i,n))return-1;let s=N.coordsAt(o,1);return s&&Na(M,i,s)?1:n&&n.bottom>=i?-1:1}function na(t,e){let M=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:M,bias:oa(t,M,e.clientX,e.clientY)}}const sa=Xs.ie&&Xs.ie_version<=11;let ra=null,Da=0,aa=0;function la(t){if(!sa)return t.detail;let e=ra,M=aa;return ra=t,aa=Date.now(),Da=!e||M>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Da+1)%3:1}function ua(t,e,M,i){if(!(M=ea(t.state,Hr,M)))return;let N=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,n=i&&o&&function(t,e){let M=t.state.facet(Rr);return M.length?M[0](e):Xs.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:o.from,to:o.to}:null,s={from:N,insert:M},r=t.state.changes(n?[n,s]:s);t.focus(),t.dispatch({changes:r,selection:{anchor:r.mapPos(N,-1),head:r.mapPos(N,1)},userEvent:n?"move.drop":"input.drop"}),t.inputState.draggedContent=null}qD.dragstart=(t,e)=>{let{selection:{main:M}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let t=i.posAtStart,e=t+i.length;(t>=M.to||e<=M.from)&&(M=Vo.range(t,e))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=M,e.dataTransfer&&(e.dataTransfer.setData("Text",ea(t.state,Xr,t.state.sliceDoc(M.from,M.to))),e.dataTransfer.effectAllowed="copyMove"),!1},qD.dragend=t=>(t.inputState.draggedContent=null,!1),qD.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let M=e.dataTransfer.files;if(M&&M.length){let i=Array(M.length),N=0,o=()=>{++N==M.length&&ua(t,e,i.filter((t=>null!=t)).join(t.state.lineBreak),!1)};for(let t=0;t<M.length;t++){let e=new FileReader;e.onerror=o,e.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(i[t]=e.result),o()},e.readAsText(M[t])}return!0}{let M=e.dataTransfer.getData("Text");if(M)return ua(t,e,M,!0),!0}return!1},qD.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let M=ta?null:e.clipboardData;return M?(Ma(t,M.getData("text/plain")||M.getData("text/uri-list")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let M=e.appendChild(document.createElement("textarea"));M.style.cssText="position: fixed; left: -10000px; top: 10px",M.focus(),setTimeout((()=>{t.focus(),M.remove(),Ma(t,M.value)}),50)}(t),!1)};let ga=null;qD.copy=qD.cut=(t,e)=>{let{text:M,ranges:i,linewise:N}=function(t){let e=[],M=[],i=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),M.push(i));if(!e.length){let N=-1;for(let{from:i}of t.selection.ranges){let o=t.doc.lineAt(i);o.number>N&&(e.push(o.text),M.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),N=o.number}i=!0}return{text:ea(t,Xr,e.join(t.lineBreak)),ranges:M,linewise:i}}(t.state);if(!M&&!N)return!1;ga=N?M:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=ta?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",M),!0):(function(t,e){let M=t.dom.parentNode;if(!M)return;let i=M.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout((()=>{i.remove(),t.focus()}),50)}(t,M),!1)};const ja=In.define();function ca(t,e){let M=[];for(let i of t.facet(Jr)){let N=i(t,e);N&&M.push(N)}return M?t.update({effects:M,annotations:ja.of(!0)}):null}function za(t){setTimeout((()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let M=ca(t.state,e);M?t.dispatch(M):t.update([])}}),10)}KD.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),za(t)},KD.blur=t=>{t.observer.clearSelectionRange(),za(t)},KD.compositionstart=KD.compositionupdate=t=>{t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},KD.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Xs.chrome&&Xs.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then((()=>t.observer.flush())):setTimeout((()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])}),50))},KD.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},qD.beforeinput=(t,e)=>{var M,i;if("insertReplacementText"==e.inputType&&t.observer.editContext){let i=null===(M=e.dataTransfer)||void 0===M?void 0:M.getData("text/plain"),N=e.getTargetRanges();if(i&&N.length){let e=N[0],M=t.posAtDOM(e.startContainer,e.startOffset),o=t.posAtDOM(e.endContainer,e.endOffset);return RD(t,{from:M,to:o,insert:t.state.toText(i)},null),!0}}let N;if(Xs.chrome&&Xs.android&&(N=FD.find((t=>t.inputType==e.inputType)))&&(t.observer.delayAndroidKey(N.key,N.keyCode),"Backspace"==N.key||"Delete"==N.key)){let e=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout((()=>{var M;((null===(M=window.visualViewport)||void 0===M?void 0:M.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())}),100)}return Xs.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),Xs.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout((()=>KD.compositionend(t,e)),20),!1};const Ia=new Set;const Ta=["pre-wrap","normal","pre-line","break-spaces"];let Oa=!1;function ya(){Oa=!1}class da{constructor(t){this.lineWrapping=t,this.doc=jo.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let M=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(M+=Math.max(0,Math.ceil((e-t-M*this.lineLength*.5)/this.lineLength))),this.lineHeight*M}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Ta.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let M=0;M<t.length;M++){let i=t[M];i<0?M++:this.heightSamples[Math.floor(10*i)]||(e=!0,this.heightSamples[Math.floor(10*i)]=!0)}return e}refresh(t,e,M,i,N,o){let n=Ta.indexOf(t)>-1,s=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=n;if(this.lineWrapping=n,this.lineHeight=e,this.charWidth=M,this.textHeight=i,this.lineLength=N,s){this.heightSamples={};for(let t=0;t<o.length;t++){let e=o[t];e<0?t++:this.heightSamples[Math.floor(10*e)]=!0}}return s}}class Aa{constructor(t,e){this.from=t,this.heights=e,this.index=0}get more(){return this.index<this.heights.length}}class ha{constructor(t,e,M,i,N){this.from=t,this.length=e,this.top=M,this.height=i,this._content=N}get type(){return"number"==typeof this._content?ar.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof jr?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(t){let e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new ha(this.from,this.length+t.length,this.top,this.height+t.height,e)}}var La=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(La||(La={}));const xa=.001;class pa{constructor(t,e,M=2){this.length=t,this.height=e,this.flags=M}get outdated(){return(2&this.flags)>0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>xa&&(Oa=!0),this.height=t)}replace(t,e,M){return pa.of(M)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,M,i){let N=this,o=M.doc;for(let n=i.length-1;n>=0;n--){let{fromA:s,toA:r,fromB:D,toB:a}=i[n],l=N.lineAt(s,La.ByPosNoHeight,M.setDoc(e),0,0),u=l.to>=r?l:N.lineAt(r,La.ByPosNoHeight,M,0,0);for(a+=u.to-r,r=u.to;n>0&&l.from<=i[n-1].toA;)s=i[n-1].fromA,D=i[n-1].fromB,n--,s<l.from&&(l=N.lineAt(s,La.ByPosNoHeight,M,0,0));D+=l.from-s,s=l.from;let g=Ua.build(M.setDoc(o),t,D,a);N=Sa(N,N.replace(s,r,g))}return N.updateHeight(M,0)}static empty(){return new Ea(0,0)}static of(t){if(1==t.length)return t[0];let e=0,M=t.length,i=0,N=0;for(;;)if(e==M)if(i>2*N){let N=t[e-1];N.break?t.splice(--e,1,N.left,null,N.right):t.splice(--e,1,N.left,N.right),M+=1+N.break,i-=N.size}else{if(!(N>2*i))break;{let e=t[M];e.break?t.splice(M,1,e.left,null,e.right):t.splice(M,1,e.left,e.right),M+=2+e.break,N-=e.size}}else if(i<N){let M=t[e++];M&&(i+=M.size)}else{let e=t[--M];e&&(N+=e.size)}let o=0;return null==t[e-1]?(o=1,e--):null==t[e]&&(o=1,M++),new wa(pa.of(t.slice(0,e)),o,pa.of(t.slice(M)))}}function Sa(t,e){return t==e?t:(t.constructor!=e.constructor&&(Oa=!0),e)}pa.prototype.size=1;class Qa extends pa{constructor(t,e,M){super(t,e),this.deco=M}blockAt(t,e,M,i){return new ha(i,this.length,M,this.height,this.deco||0)}lineAt(t,e,M,i,N){return this.blockAt(0,M,i,N)}forEachLine(t,e,M,i,N,o){t<=N+this.length&&e>=N&&o(this.blockAt(0,M,i,N))}updateHeight(t,e=0,M=!1,i){return i&&i.from<=e&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ea extends Qa{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,M,i){return new ha(i,this.length,M,this.height,this.breaks)}replace(t,e,M){let i=M[0];return 1==M.length&&(i instanceof Ea||i instanceof ka&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof ka?i=new Ea(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):pa.of(M)}updateHeight(t,e=0,M=!1,i){return i&&i.from<=e&&i.more?this.setHeight(i.heights[i.index++]):(M||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ka extends pa{constructor(t){super(t,0)}heightMetrics(t,e){let M,i=t.doc.lineAt(e).number,N=t.doc.lineAt(e+this.length).number,o=N-i+1,n=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*o);M=e/o,this.length>o+1&&(n=(this.height-e)/(this.length-o-1))}else M=this.height/o;return{firstLine:i,lastLine:N,perLine:M,perChar:n}}blockAt(t,e,M,i){let{firstLine:N,lastLine:o,perLine:n,perChar:s}=this.heightMetrics(e,i);if(e.lineWrapping){let N=i+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-M)/this.height))*this.length)),o=e.doc.lineAt(N),r=n+o.length*s,D=Math.max(M,t-r/2);return new ha(o.from,o.length,D,r,0)}{let i=Math.max(0,Math.min(o-N,Math.floor((t-M)/n))),{from:s,length:r}=e.doc.line(N+i);return new ha(s,r,M+n*i,n,0)}}lineAt(t,e,M,i,N){if(e==La.ByHeight)return this.blockAt(t,M,i,N);if(e==La.ByPosNoHeight){let{from:e,to:i}=M.doc.lineAt(t);return new ha(e,i-e,0,0,0)}let{firstLine:o,perLine:n,perChar:s}=this.heightMetrics(M,N),r=M.doc.lineAt(t),D=n+r.length*s,a=r.number-o,l=i+n*a+s*(r.from-N-a);return new ha(r.from,r.length,Math.max(i,Math.min(l,i+this.height-D)),D,0)}forEachLine(t,e,M,i,N,o){t=Math.max(t,N),e=Math.min(e,N+this.length);let{firstLine:n,perLine:s,perChar:r}=this.heightMetrics(M,N);for(let D=t,a=i;D<=e;){let e=M.doc.lineAt(D);if(D==t){let M=e.number-n;a+=s*M+r*(t-N-M)}let i=s+r*e.length;o(new ha(e.from,e.length,a,i,0)),a+=i,D=e.to+1}}replace(t,e,M){let i=this.length-e;if(i>0){let t=M[M.length-1];t instanceof ka?M[M.length-1]=new ka(t.length+i):M.push(null,new ka(i-1))}if(t>0){let e=M[0];e instanceof ka?M[0]=new ka(t+e.length):M.unshift(new ka(t-1),null)}return pa.of(M)}decomposeLeft(t,e){e.push(new ka(t-1),null)}decomposeRight(t,e){e.push(null,new ka(this.length-t-1))}updateHeight(t,e=0,M=!1,i){let N=e+this.length;if(i&&i.from<=e+this.length&&i.more){let M=[],o=Math.max(e,i.from),n=-1;for(i.from>e&&M.push(new ka(i.from-e-1).updateHeight(t,e));o<=N&&i.more;){let e=t.doc.lineAt(o).length;M.length&&M.push(null);let N=i.heights[i.index++];-1==n?n=N:Math.abs(N-n)>=xa&&(n=-2);let s=new Ea(e,N);s.outdated=!1,M.push(s),o+=e+1}o<=N&&M.push(null,new ka(N-o).updateHeight(t,o));let s=pa.of(M);return(n<0||Math.abs(s.height-this.height)>=xa||Math.abs(n-this.heightMetrics(t,e).perLine)>=xa)&&(Oa=!0),Sa(this,s)}return(M||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class wa extends pa{constructor(t,e,M){super(t.length+e+M.length,t.height+M.height,e|(t.outdated||M.outdated?2:0)),this.left=t,this.right=M,this.size=t.size+M.size}get break(){return 1&this.flags}blockAt(t,e,M,i){let N=M+this.left.height;return t<N?this.left.blockAt(t,e,M,i):this.right.blockAt(t,e,N,i+this.left.length+this.break)}lineAt(t,e,M,i,N){let o=i+this.left.height,n=N+this.left.length+this.break,s=e==La.ByHeight?t<o:t<n,r=s?this.left.lineAt(t,e,M,i,N):this.right.lineAt(t,e,M,o,n);if(this.break||(s?r.to<n:r.from>n))return r;let D=e==La.ByPosNoHeight?La.ByPosNoHeight:La.ByPos;return s?r.join(this.right.lineAt(n,D,M,o,n)):this.left.lineAt(n,D,M,i,N).join(r)}forEachLine(t,e,M,i,N,o){let n=i+this.left.height,s=N+this.left.length+this.break;if(this.break)t<s&&this.left.forEachLine(t,e,M,i,N,o),e>=s&&this.right.forEachLine(t,e,M,n,s,o);else{let r=this.lineAt(s,La.ByPos,M,i,N);t<r.from&&this.left.forEachLine(t,r.from-1,M,i,N,o),r.to>=t&&r.from<=e&&o(r),e>r.to&&this.right.forEachLine(r.to+1,e,M,n,s,o)}}replace(t,e,M){let i=this.left.length+this.break;if(e<i)return this.balanced(this.left.replace(t,e,M),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-i,e-i,M));let N=[];t>0&&this.decomposeLeft(t,N);let o=N.length;for(let t of M)N.push(t);if(t>0&&ma(N,o-1),e<this.length){let t=N.length;this.decomposeRight(e,N),ma(N,t)}return pa.of(N)}decomposeLeft(t,e){let M=this.left.length;if(t<=M)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&(M++,t>=M&&e.push(null)),t>M&&this.right.decomposeLeft(t-M,e)}decomposeRight(t,e){let M=this.left.length,i=M+this.break;if(t>=i)return this.right.decomposeRight(t-i,e);t<M&&this.left.decomposeRight(t,e),this.break&&t<i&&e.push(null),e.push(this.right)}balanced(t,e){return t.size>2*e.size||e.size>2*t.size?pa.of(this.break?[t,null,e]:[t,e]):(this.left=Sa(this.left,t),this.right=Sa(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,M=!1,i){let{left:N,right:o}=this,n=e+N.length+this.break,s=null;return i&&i.from<=e+N.length&&i.more?s=N=N.updateHeight(t,e,M,i):N.updateHeight(t,e,M),i&&i.from<=n+o.length&&i.more?s=o=o.updateHeight(t,n,M,i):o.updateHeight(t,n,M),s?this.balanced(N,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ma(t,e){let M,i;null==t[e]&&(M=t[e-1])instanceof ka&&(i=t[e+1])instanceof ka&&t.splice(e-1,3,new ka(M.length+1+i.length))}class Ua{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),M=this.nodes[this.nodes.length-1];M instanceof Ea?M.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new Ea(t-this.pos,-1)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,M){if(t<e||M.heightRelevant){let i=M.widget?M.widget.estimatedHeight:0,N=M.widget?M.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=e-t;M.block?this.addBlock(new Qa(o,i,M)):(o||N||i>=5)&&this.addLineDeco(i,N,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new Ea(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let M=new ka(e-t);return this.oracle.doc.lineAt(t).to==e&&(M.flags|=4),M}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Ea)return t;let e=new Ea(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,M){let i=this.ensureLine();i.length+=M,i.collapsed+=M,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=e,this.writtenTo=this.pos=this.pos+M}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Ea||this.isCovered?(this.writtenTo<this.pos||null==e)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Ea(0,-1));let M=t;for(let t of this.nodes)t instanceof Ea&&t.updateHeight(this.oracle,M),M+=t?t.length:1;return this.nodes}static build(t,e,M,i){let N=new Ua(M,t);return vn.spans(e,M,i,N,0),N.finish(M)}}class Ca{constructor(){this.changes=[]}compareRange(){}comparePoint(t,e,M,i){(t<e||M&&M.heightRelevant||i&&i.heightRelevant)&&zr(t,e,this.changes,5)}}function Ya(t,e){let M=t.getBoundingClientRect(),i=t.ownerDocument,N=i.defaultView||window,o=Math.max(0,M.left),n=Math.min(N.innerWidth,M.right),s=Math.max(0,M.top),r=Math.min(N.innerHeight,M.bottom);for(let e=t.parentNode;e&&e!=i.body;)if(1==e.nodeType){let M=e,i=window.getComputedStyle(M);if((M.scrollHeight>M.clientHeight||M.scrollWidth>M.clientWidth)&&"visible"!=i.overflow){let i=M.getBoundingClientRect();o=Math.max(o,i.left),n=Math.min(n,i.right),s=Math.max(s,i.top),r=Math.min(e==t.parentNode?N.innerHeight:r,i.bottom)}e="absolute"==i.position||"fixed"==i.position?M.offsetParent:M.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:o-M.left,right:Math.max(o,n)-M.left,top:s-(M.top+e),bottom:Math.max(s,r)-(M.top+e)}}function ba(t,e){let M=t.getBoundingClientRect();return{left:0,right:M.right-M.left,top:e,bottom:M.bottom-(M.top+e)}}class fa{constructor(t,e,M,i){this.from=t,this.to=e,this.size=M,this.displaySize=i}static same(t,e){if(t.length!=e.length)return!1;for(let M=0;M<t.length;M++){let i=t[M],N=e[M];if(i.from!=N.from||i.to!=N.to||i.size!=N.size)return!1}return!0}draw(t,e){return lr.replace({widget:new va(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to)}}class va extends Dr{constructor(t,e){super(),this.size=t,this.vertical=e}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class Za{constructor(t){this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Ra,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=hr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let e=t.facet(aD).some((t=>"function"!=typeof t&&"cm-lineWrapping"==t.class));this.heightOracle=new da(e),this.stateDeco=t.facet(lD).filter((t=>"function"!=typeof t)),this.heightMap=pa.empty().applyChanges(this.stateDeco,jo.empty,this.heightOracle.setDoc(t.doc),[new OD(0,0,0,t.doc.length)]);for(let t=0;t<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());t++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=lr.set(this.lineGaps.map((t=>t.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let M=0;M<=1;M++){let i=M?e.head:e.anchor;if(!t.some((({from:t,to:e})=>i>=t&&i<=e))){let{from:e,to:M}=this.lineBlockAt(i);t.push(new Va(e,M))}}return this.viewports=t.sort(((t,e)=>t.from-e.from)),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Ra:new Ga(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(t=>{this.viewportLines.push(Ba(t,this.scaler))}))}update(t,e=null){this.state=t.state;let M=this.stateDeco;this.stateDeco=this.state.facet(lD).filter((t=>"function"!=typeof t));let i=t.changedRanges,N=OD.extendWithRanges(i,function(t,e,M){let i=new Ca;return vn.compare(t,e,M,i,0),i.changes}(M,this.stateDeco,t?t.changes:mo.empty(this.state.doc.length))),o=this.heightMap.height,n=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);ya(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),N),(this.heightMap.height!=o||Oa)&&(t.flags|=2),n?(this.scrollAnchorPos=t.changes.mapPos(n.from,-1),this.scrollAnchorHeight=n.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let s=N.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<s.from||e.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,e));let r=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,t.flags|=this.updateForViewport(),(r||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(qr)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,M=window.getComputedStyle(e),i=this.heightOracle,N=M.whiteSpace;this.defaultTextDirection="rtl"==M.direction?hr.RTL:hr.LTR;let o=this.heightOracle.mustRefreshForWrapping(N),n=e.getBoundingClientRect(),s=o||this.mustMeasureContent||this.contentDOMHeight!=n.height;this.contentDOMHeight=n.height,this.mustMeasureContent=!1;let r=0,D=0;if(n.width&&n.height){let{scaleX:t,scaleY:M}=ds(e,n);(t>.005&&Math.abs(this.scaleX-t)>.005||M>.005&&Math.abs(this.scaleY-M)>.005)&&(this.scaleX=t,this.scaleY=M,r|=16,o=s=!0)}let a=(parseInt(M.paddingTop)||0)*this.scaleY,l=(parseInt(M.paddingBottom)||0)*this.scaleY;this.paddingTop==a&&this.paddingBottom==l||(this.paddingTop=a,this.paddingBottom=l,r|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(s=!0),this.editorWidth=t.scrollDOM.clientWidth,r|=16);let u=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=u&&(this.scrollAnchorHeight=-1,this.scrollTop=u),this.scrolledToBottom=Es(t.scrollDOM);let g=(this.printing?ba:Ya)(e,this.paddingTop),j=g.top-this.pixelViewport.top,c=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let z=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(z!=this.inView&&(this.inView=z,z&&(s=!0)),!this.inView&&!this.scrollTarget&&!function(t){let e=t.getBoundingClientRect(),M=t.ownerDocument.defaultView||window;return e.left<M.innerWidth&&e.right>0&&e.top<M.innerHeight&&e.bottom>0}(t.dom))return 0;let I=n.width;if(this.contentDOMWidth==I&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=n.width,this.editorHeight=t.scrollDOM.clientHeight,r|=16),s){let e=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(e)&&(o=!0),o||i.lineWrapping&&Math.abs(I-this.contentDOMWidth)>i.charWidth){let{lineHeight:M,charWidth:n,textHeight:s}=t.docView.measureTextSize();o=M>0&&i.refresh(N,M,n,s,I/n,e),o&&(t.docView.minWidth=0,r|=16)}j>0&&c>0?D=Math.max(j,c):j<0&&c<0&&(D=Math.min(j,c)),ya();for(let M of this.viewports){let N=M.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(M);this.heightMap=(o?pa.empty().applyChanges(this.stateDeco,jo.empty,this.heightOracle,[new OD(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Aa(M.from,N))}Oa&&(r|=2)}let T=!this.viewportIsAppropriate(this.viewport,D)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(2&r&&(r|=this.updateScaler()),this.viewport=this.getViewport(D,this.scrollTarget),r|=this.updateForViewport()),(2&r||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),r|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),r}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let M=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,N=this.heightOracle,{visibleTop:o,visibleBottom:n}=this,s=new Va(i.lineAt(o-1e3*M,La.ByHeight,N,0,0).from,i.lineAt(n+1e3*(1-M),La.ByHeight,N,0,0).to);if(e){let{head:t}=e.range;if(t<s.from||t>s.to){let M,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),n=i.lineAt(t,La.ByPos,N,0,0);M="center"==e.y?(n.top+n.bottom)/2-o/2:"start"==e.y||"nearest"==e.y&&t<s.from?n.top:n.bottom-o,s=new Va(i.lineAt(M-500,La.ByHeight,N,0,0).from,i.lineAt(M+o+500,La.ByHeight,N,0,0).to)}}return s}mapViewport(t,e){let M=e.mapPos(t.from,-1),i=e.mapPos(t.to,1);return new Va(this.heightMap.lineAt(M,La.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,La.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:e},M=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(t,La.ByPos,this.heightOracle,0,0),{bottom:N}=this.heightMap.lineAt(e,La.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:n}=this;return(0==t||i<=o-Math.max(10,Math.min(-M,250)))&&(e==this.state.doc.length||N>=n+Math.max(10,Math.min(M,250)))&&i>o-2e3&&N<n+2e3}mapLineGaps(t,e){if(!t.length||e.empty)return t;let M=[];for(let i of t)e.touchesRange(i.from,i.to)||M.push(new fa(e.mapPos(i.from),e.mapPos(i.to),i.size,i.displaySize));return M}ensureLineGaps(t,e){let M=this.heightOracle.lineWrapping,i=M?1e4:2e3,N=i>>1,o=i<<1;if(this.defaultTextDirection!=hr.LTR&&!M)return[];let n=[],s=(i,o,r,D)=>{if(o-i<N)return;let a=this.state.selection.main,l=[a.from];a.empty||l.push(a.to);for(let t of l)if(t>i&&t<o)return s(i,t-10,r,D),void s(t+10,o,r,D);let u=function(t,e){for(let M of t)if(e(M))return M;return}(t,(t=>t.from>=r.from&&t.to<=r.to&&Math.abs(t.from-i)<N&&Math.abs(t.to-o)<N&&!l.some((e=>t.from<e&&t.to>e))));if(!u){if(o<r.to&&e&&M&&e.visibleRanges.some((t=>t.from<=o&&t.to>=o))){let t=e.moveToLineBoundary(Vo.cursor(o),!1,!0).head;t>i&&(o=t)}let t=this.gapSize(r,i,o,D);u=new fa(i,o,t,M||t<2e6?t:2e6)}n.push(u)},r=e=>{if(e.length<o||e.type!=ar.Text)return;let N=function(t,e,M){let i=[],N=t,o=0;vn.spans(M,t,e,{span(){},point(t,e){t>N&&(i.push({from:N,to:t}),o+=t-N),N=e}},20),N<e&&(i.push({from:N,to:e}),o+=e-N);return{total:o,ranges:i}}(e.from,e.to,this.stateDeco);if(N.total<o)return;let n,r,D=this.scrollTarget?this.scrollTarget.range.head:null;if(M){let t,M,o=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=D){let i=Pa(N,D),n=((this.visibleBottom-this.visibleTop)/2+o)/e.height;t=i-n,M=i+n}else t=(this.visibleTop-e.top-o)/e.height,M=(this.visibleBottom-e.top+o)/e.height;n=Wa(N,t),r=Wa(N,M)}else{let M=N.total*this.heightOracle.charWidth,o=i*this.heightOracle.charWidth,s=0;if(M>2e6)for(let M of t)M.from>=e.from&&M.from<e.to&&M.size!=M.displaySize&&M.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=M.size-M.displaySize);let a,l,u=this.pixelViewport.left+s,g=this.pixelViewport.right+s;if(null!=D){let t=Pa(N,D),e=((g-u)/2+o)/M;a=t-e,l=t+e}else a=(u-o)/M,l=(g+o)/M;n=Wa(N,a),r=Wa(N,l)}n>e.from&&s(e.from,n,e,N),r<e.to&&s(r,e.to,e,N)};for(let t of this.viewportLines)Array.isArray(t.type)?t.type.forEach(r):r(t);return n}gapSize(t,e,M,i){let N=Pa(i,M)-Pa(i,e);return this.heightOracle.lineWrapping?t.height*N:i.total*this.heightOracle.charWidth*N}updateLineGaps(t){fa.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=lr.set(t.map((t=>t.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(t){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let M=[];vn.spans(e,this.viewport.from,this.viewport.to,{span(t,e){M.push({from:t,to:e})},point(){}},20);let i=0;if(M.length!=this.visibleRanges.length)i=12;else for(let e=0;e<M.length&&!(8&i);e++){let N=this.visibleRanges[e],o=M[e];N.from==o.from&&N.to==o.to||(i|=4,t&&t.mapPos(N.from,-1)==o.from&&t.mapPos(N.to,1)==o.to||(i|=8))}return this.visibleRanges=M,i}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find((e=>e.from<=t&&e.to>=t))||Ba(this.heightMap.lineAt(t,La.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((e=>e.top<=t&&e.bottom>=t))||Ba(this.heightMap.lineAt(this.scaler.fromDOM(t),La.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Ba(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Va{constructor(t,e){this.from=t,this.to=e}}function Wa({total:t,ranges:e},M){if(M<=0)return e[0].from;if(M>=1)return e[e.length-1].to;let i=Math.floor(t*M);for(let t=0;;t++){let{from:M,to:N}=e[t],o=N-M;if(i<=o)return M+i;i-=o}}function Pa(t,e){let M=0;for(let{from:i,to:N}of t.ranges){if(e<=N){M+=e-i;break}M+=N-i}return M/t.total}const Ra={toDOM:t=>t,fromDOM:t=>t,scale:1,eq(t){return t==this}};class Ga{constructor(t,e,M){let i=0,N=0,o=0;this.viewports=M.map((({from:M,to:N})=>{let o=e.lineAt(M,La.ByPos,t,0,0).top,n=e.lineAt(N,La.ByPos,t,0,0).bottom;return i+=n-o,{from:M,to:N,top:o,bottom:n,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(e.height-i);for(let t of this.viewports)t.domTop=o+(t.top-N)*this.scale,o=t.domBottom=t.domTop+(t.bottom-t.top),N=t.bottom}toDOM(t){for(let e=0,M=0,i=0;;e++){let N=e<this.viewports.length?this.viewports[e]:null;if(!N||t<N.top)return i+(t-M)*this.scale;if(t<=N.bottom)return N.domTop+(t-N.top);M=N.bottom,i=N.domBottom}}fromDOM(t){for(let e=0,M=0,i=0;;e++){let N=e<this.viewports.length?this.viewports[e]:null;if(!N||t<N.domTop)return M+(t-i)/this.scale;if(t<=N.domBottom)return N.top+(t-N.domTop);M=N.bottom,i=N.domBottom}}eq(t){return t instanceof Ga&&(this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every(((e,M)=>e.from==t.viewports[M].from&&e.to==t.viewports[M].to)))}}function Ba(t,e){if(1==e.scale)return t;let M=e.toDOM(t.top),i=e.toDOM(t.bottom);return new ha(t.from,t.length,M,i-M,Array.isArray(t._content)?t._content.map((t=>Ba(t,e))):t._content)}const _a=Ro.define({combine:t=>t.join(" ")}),Fa=Ro.define({combine:t=>t.indexOf(!0)>-1}),Ja=es.newName(),Ha=es.newName(),Xa=es.newName(),$a={"&light":"."+Ha,"&dark":"."+Xa};function qa(t,e,M){return new es(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,(e=>{if("&"==e)return t;if(!M||!M[e])throw new RangeError(`Unsupported selector: ${e}`);return M[e]})):t+" "+e})}const Ka=qa("."+Ja,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},$a),tl={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},el=Xs.ie&&Xs.ie_version<=11;class Ml{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new As,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((e=>{for(let t of e)this.queue.push(t);(Xs.ie&&Xs.ie_version<=11||Xs.ios&&t.composing)&&e.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),!window.EditContext||!1===t.constructor.EDIT_CONTEXT||Xs.chrome&&Xs.chrome_version<126||(this.editContext=new ol(t),t.state.facet(ND)&&(t.contentDOM.editContext=this.editContext.editContext)),el&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()})),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(t){("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(((e,M)=>e!=t[M])))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:M}=this,i=this.selectionRange;if(M.state.facet(ND)?M.root.activeElement!=this.dom:!us(this.dom,i))return;let N=i.anchorNode&&M.docView.nearest(i.anchorNode);N&&N.ignoreEvent(t)?e||(this.selectionChanged=!1):(Xs.ie&&Xs.ie_version<=11||Xs.android&&Xs.chrome)&&!M.state.selection.main.empty&&i.focusNode&&js(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=as(t.root);if(!e)return!1;let M=Xs.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){let M=e.getComposedRanges(t.root)[0];if(M)return Nl(t,M)}let M=null;function i(t){t.preventDefault(),t.stopImmediatePropagation(),M=t.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),M?Nl(t,M):null}(this.view,e)||e;if(!M||this.selectionRange.eq(M))return!1;let i=us(this.dom,M);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&function(t,e){let M=e.focusNode,i=e.focusOffset;if(!M||e.anchorNode!=M||e.anchorOffset!=i)return!1;for(i=Math.min(i,Ts(M));;)if(i){if(1!=M.nodeType)return!1;let t=M.childNodes[i-1];"false"==t.contentEditable?i--:(M=t,i=Ts(M))}else{if(M==t)return!0;i=cs(M),M=M.parentNode}}(this.dom,M)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(M),i&&(this.selectionChanged=!0),!0)}setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,e=null;for(let M=this.dom;M;)if(1==M.nodeType)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==M?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(M),M=M.assignedSlot||M.parentNode;else{if(11!=M.nodeType)break;M=M.host}if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);for(let t of this.scrollTargets=e)t.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,tl),el&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),el&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,e){var M;if(!this.delayedAndroidKey){let t=()=>{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&Ss(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(null===(M=this.delayedAndroidKey)||void 0===M?void 0:M.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame((()=>{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,M=-1,i=!1;for(let N of t){let t=this.readMutation(N);t&&(t.typeOver&&(i=!0),-1==e?({from:e,to:M}=t):(e=Math.min(t.from,e),M=Math.max(t.to,M)))}return{from:e,to:M,typeOver:i}}readChange(){let{from:t,to:e,typeOver:M}=this.processRecords(),i=this.selectionChanged&&us(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let N=new WD(this.view,t,e,M);return this.view.docView.domChanged={newSel:N.newSel?N.newSel.main:null},N}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let M=this.view.state,i=PD(this.view,e);return this.view.state==M&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){let M=il(e,t.previousSibling||t.target.previousSibling,-1),i=il(e,t.nextSibling||t.target.nextSibling,1);return{from:M?e.posAfter(M):e.posAtStart,to:i?e.posBefore(i):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ND)!=t.state.facet(ND)&&(t.view.contentDOM.editContext=t.state.facet(ND)?this.editContext.editContext:null))}destroy(){var t,e,M;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(M=this.resizeScroll)||void 0===M||M.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function il(t,e,M){for(;e;){let i=Cs.get(e);if(i&&i.parent==t)return i;let N=e.parentNode;e=N!=t.dom?N:M>0?e.nextSibling:e.previousSibling}return null}function Nl(t,e){let M=e.startContainer,i=e.startOffset,N=e.endContainer,o=e.endOffset,n=t.docView.domAtPos(t.state.selection.main.anchor);return js(n.node,n.offset,N,o)&&([M,i,N,o]=[N,o,M,i]),{anchorNode:M,anchorOffset:i,focusNode:N,focusOffset:o}}class ol{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=e=>{let M=t.state.selection.main,{anchor:i,head:N}=M,o=this.toEditorPos(e.updateRangeStart),n=this.toEditorPos(e.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:e.updateRangeStart,editorBase:o,drifted:!1});let s={from:o,to:n,insert:jo.of(e.text.split("\n"))};if(s.from==this.from&&i<this.from?s.from=i:s.to==this.to&&i>this.to&&(s.to=i),s.from!=s.to||s.insert.length){if((Xs.mac||Xs.android)&&s.from==N-1&&/^\. ?$/.test(e.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(s={from:o,to:n,insert:jo.of([e.text.replace("."," ")])}),this.pendingContextChange=s,!t.state.readOnly){let M=this.to-this.from+(s.to-s.from+s.insert.length);RD(t,s,Vo.single(this.toEditorPos(e.selectionStart,M),this.toEditorPos(e.selectionEnd,M)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state))}else{let i=Vo.single(this.toEditorPos(e.selectionStart),this.toEditorPos(e.selectionEnd));i.main.eq(M)||t.dispatch({selection:i,userEvent:"select"})}},this.handlers.characterboundsupdate=M=>{let i=[],N=null;for(let e=this.toEditorPos(M.rangeStart),o=this.toEditorPos(M.rangeEnd);e<o;e++){let M=t.coordsForChar(e);N=M&&new DOMRect(M.left,M.top,M.right-M.left,M.bottom-M.top)||N||new DOMRect,i.push(N)}e.updateCharacterBounds(M.rangeStart,i)},this.handlers.textformatupdate=e=>{let M=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,i=t.underlineThickness;if("None"!=e&&"None"!=i){let N=this.toEditorPos(t.rangeStart),o=this.toEditorPos(t.rangeEnd);if(N<o){let t=`text-decoration: underline ${"Dashed"==e?"dashed ":"Squiggle"==e?"wavy ":""}${"Thin"==i?1:2}px`;M.push(lr.mark({attributes:{style:t}}).range(N,o))}}}t.dispatch({effects:MD.of(lr.set(M))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:e}=this.composing;this.composing=null,e&&this.reset(t.state)}};for(let t in this.handlers)e.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=as(t.root);e&&e.rangeCount&&this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,M=!1,i=this.pendingContextChange;return t.changes.iterChanges(((N,o,n,s,r)=>{if(M)return;let D=r.length-(o-N);if(i&&o>=i.to){if(i.from==N&&i.to==o&&i.insert.eq(r))return i=this.pendingContextChange=null,e+=D,void(this.to+=D);i=null,this.revertPending(t.state)}if(N+=e,(o+=e)<=this.from)this.from+=D,this.to+=D;else if(N<this.to){if(N<this.from||o>this.to||this.to-this.from+r.length>3e4)return void(M=!0);this.editContext.updateText(this.toContextPos(N),this.toContextPos(o),r.toString()),this.to+=D}e+=D})),i&&!M&&this.revertPending(t.state),!M}update(t){let e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some((t=>!t.isUserEvent("input.type")&&t.changes.touchesRange(this.from,this.to))))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,M=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),i=this.toContextPos(e.head);this.editContext.selectionStart==M&&this.editContext.selectionEnd==i||this.editContext.updateSelection(M,i)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>3e4)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let M=this.composing;return M&&M.drifted?M.editorBase+(t-M.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class nl{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:M}=t;this.dispatchTransactions=t.dispatchTransactions||M&&(t=>t.forEach((t=>M(t,this))))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new Za(t.state||mn.create(t)),t.scrollTo&&t.scrollTo.is(eD)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(nD).map((t=>new rD(t)));for(let t of this.plugins)t.update(this);this.observer=new Ml(this),this.inputState=new GD(this),this.inputState.ensureHandlers(this.plugins),this.docView=new dD(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then((()=>this.requestMeasure()))}dispatch(...t){let e=1==t.length&&t[0]instanceof dn?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,M=!1,i=!1,N=this.state;for(let e of t){if(e.startState!=N)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");N=e.state}if(this.destroyed)return void(this.viewState.state=N);let o=this.hasFocus,n=0,s=null;t.some((t=>t.annotation(ja)))?(this.inputState.notifiedFocused=o,n=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,s=ca(N,o),s||(n=1));let r=this.observer.delayedAndroidKey,D=null;if(r?(this.observer.clearDelayedAndroidKey(),D=this.observer.readChange(),(D&&!this.state.doc.eq(N.doc)||!this.state.selection.eq(N.selection))&&(D=null)):this.observer.clear(),N.facet(mn.phrases)!=this.state.facet(mn.phrases))return this.setState(N);e=yD.create(this,N,t),e.flags|=n;let a=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(a&&(a=a.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection;a=new tD(t.empty?t:Vo.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)t.is(eD)&&(a=t.value.clip(this.state))}this.viewState.update(e,a),this.bidiCache=Dl.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),M=this.docView.update(e),this.state.facet(TD)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(M,t.some((t=>t.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(e.startState.facet(_a)!=e.state.facet(_a)&&(this.viewState.mustMeasureContent=!0),(M||i||a||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),M&&this.docViewUpdate(),!e.empty)for(let t of this.state.facet(_r))try{t(e)}catch(t){iD(this.state,t,"update listener")}(s||D)&&Promise.resolve().then((()=>{s&&this.state==s.startState&&this.dispatch(s),D&&!PD(this,D)&&r.force&&Ss(this.contentDOM,r.key,r.keyCode)}))}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new Za(t),this.plugins=t.facet(nD).map((t=>new rD(t))),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new dD(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(nD),M=t.state.facet(nD);if(e!=M){let i=[];for(let N of M){let M=e.indexOf(N);if(M<0)i.push(new rD(N));else{let e=this.plugins[M];e.mustUpdate=t,i.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t<this.plugins.length;t++)this.plugins[t].update(this);e!=M&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let e=t.value;if(e&&e.docViewUpdate)try{e.docViewUpdate(this)}catch(t){iD(this.state,t,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,M=this.scrollDOM,i=M.scrollTop*this.scaleY,{scrollAnchorPos:N,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(o<0)if(Es(M))N=-1,o=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(i);N=t.from,o=t.top}this.updateState=1;let n=this.viewState.measure(this);if(!n&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let s=[];4&n||([this.measureRequests,s]=[s,this.measureRequests]);let r=s.map((t=>{try{return t.read(this)}catch(t){return iD(this.state,t),rl}})),D=yD.create(this,this.state,[]),a=!1;D.flags|=n,e?e.flags|=n:e=D,this.updateState=2,D.empty||(this.updatePlugins(D),this.inputState.update(D),this.updateAttrs(),a=this.docView.update(D),a&&this.docViewUpdate());for(let t=0;t<s.length;t++)if(r[t]!=rl)try{let e=s[t];e.write&&e.write(r[t],this)}catch(t){iD(this.state,t)}if(a&&this.docView.updateSelection(!0),!D.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}{let t=(N<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(N).top)-o;if(t>1||t<-1){i+=t,M.scrollTop=i/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(_r))t(e)}get themeClasses(){return Ja+" "+(this.state.facet(Fa)?Xa:Ha)+" "+this.state.facet(_a)}updateAttrs(){let t=al(this,DD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ND)?"true":"false",class:"cm-content",style:`${Xs.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),al(this,aD,e);let M=this.observer.ignore((()=>{let M=sr(this.contentDOM,this.contentAttrs,e),i=sr(this.dom,this.editorAttrs,t);return M||i}));return this.editorAttrs=t,this.contentAttrs=e,M}showAnnouncements(t){let e=!0;for(let M of t)for(let t of M.effects)if(t.is(nl.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(TD);let t=this.state.facet(nl.cspNonce);es.mount(this.root,this.styleModules.concat(Ka).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key)return void(this.measureRequests[e]=t);this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(void 0===e||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find((e=>e.spec==t))||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,M){return bD(this,t,CD(this,t,e,M))}moveByGroup(t,e){return bD(this,t,CD(this,t,e,(e=>function(t,e,M){let i=t.state.charCategorizer(e),N=i(M);return t=>{let e=i(t);return N==Qn.Space&&(N=e),N==e}}(this,t.head,e))))}visualLineSide(t,e){let M=this.bidiSpans(t),i=this.textDirectionAt(t.from),N=M[e?M.length-1:0];return Vo.cursor(N.side(e,i)+t.from,N.forward(!e,i)?1:-1)}moveToLineBoundary(t,e,M=!0){return function(t,e,M,i){let N=UD(t,e.head),o=i&&N.type==ar.Text&&(t.lineWrapping||N.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>N.from?e.head-1:e.head):null;if(o){let e=t.dom.getBoundingClientRect(),i=t.textDirectionAt(N.from),n=t.posAtCoords({x:M==(i==hr.LTR)?e.right-1:e.left+1,y:(o.top+o.bottom)/2});if(null!=n)return Vo.cursor(n,M?-1:1)}return Vo.cursor(M?N.to:N.from,M?-1:1)}(this,t,e,M)}moveVertically(t,e,M){return bD(this,t,function(t,e,M,i){let N=e.head,o=M?1:-1;if(N==(M?t.state.doc.length:0))return Vo.cursor(N,e.assoc);let n,s=e.goalColumn,r=t.contentDOM.getBoundingClientRect(),D=t.coordsAtPos(N,e.assoc||-1),a=t.documentTop;if(D)null==s&&(s=D.left-r.left),n=o<0?D.top:D.bottom;else{let e=t.viewState.lineBlockAt(N);null==s&&(s=Math.min(r.right-r.left,t.defaultCharacterWidth*(N-e.from))),n=(o<0?e.top:e.bottom)+a}let l=r.left+s,u=null!=i?i:t.viewState.heightOracle.textHeight>>1;for(let e=0;;e+=10){let M=n+(u+e)*o,i=wD(t,{x:l,y:M},!1,o);if(M<r.top||M>r.bottom||(o<0?i<N:i>N)){let e=t.docView.coordsForChar(i),N=!e||M<e.top?-1:1;return Vo.cursor(i,N,void 0,s)}}}(this,t,e,M))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),wD(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let M=this.docView.coordsAt(t,e);if(!M||M.left==M.right)return M;let i=this.state.doc.lineAt(t),N=this.bidiSpans(i);return Os(M,N[Ur.find(N,t-i.from,-1,e)].dir==hr.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet($r)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>sl)return vr(t.length);let e,M=this.textDirectionAt(t.from);for(let i of this.bidiCache)if(i.from==t.from&&i.dir==M&&(i.fresh||Cr(i.isolates,e=cD(this,t))))return i.order;e||(e=cD(this,t));let i=function(t,e,M){if(!t)return[new Ur(0,0,e==xr?1:0)];if(e==Lr&&!M.length&&!mr.test(t))return vr(t.length);if(M.length)for(;t.length>Yr.length;)Yr[Yr.length]=256;let i=[],N=e==Lr?0:1;return fr(t,N,N,M,0,t.length,i),i}(t.text,M,e);return this.bidiCache.push(new Dl(t.from,t.to,M,e,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Xs.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{xs(this.contentDOM),this.docView.updateSelection()}))}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return eD.of(new tD("number"==typeof t?Vo.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,M=this.viewState.scrollAnchorAt(t);return eD.of(new tD(Vo.cursor(M.from),"start","start",M.top-t,e,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return sD.define((()=>({})),{eventHandlers:t})}static domEventObservers(t){return sD.define((()=>({})),{eventObservers:t})}static theme(t,e){let M=es.newName(),i=[_a.of(M),TD.of(qa(`.${M}`,t))];return e&&e.dark&&i.push(Fa.of(!0)),i}static baseTheme(t){return Mn.lowest(TD.of(qa("."+Ja,t,$a)))}static findFromDOM(t){var e;let M=t.querySelector(".cm-content"),i=M&&Cs.get(M)||Cs.get(t);return(null===(e=null==i?void 0:i.rootView)||void 0===e?void 0:e.view)||null}}nl.styleModule=TD,nl.inputHandler=Fr,nl.clipboardInputFilter=Hr,nl.clipboardOutputFilter=Xr,nl.scrollHandler=Kr,nl.focusChangeEffect=Jr,nl.perLineTextDirection=$r,nl.exceptionSink=Br,nl.updateListener=_r,nl.editable=ND,nl.mouseSelectionStyle=Gr,nl.dragMovesSelection=Rr,nl.clickAddsSelectionRange=Pr,nl.decorations=lD,nl.outerDecorations=uD,nl.atomicRanges=gD,nl.bidiIsolatedRanges=jD,nl.scrollMargins=zD,nl.darkTheme=Fa,nl.cspNonce=Ro.define({combine:t=>t.length?t[0]:""}),nl.contentAttributes=aD,nl.editorAttributes=DD,nl.lineWrapping=nl.contentAttributes.of({class:"cm-lineWrapping"}),nl.announce=yn.define();const sl=4096,rl={};class Dl{constructor(t,e,M,i,N,o){this.from=t,this.to=e,this.dir=M,this.isolates=i,this.fresh=N,this.order=o}static update(t,e){if(e.empty&&!t.some((t=>t.fresh)))return t;let M=[],i=t.length?t[t.length-1].dir:hr.LTR;for(let N=Math.max(0,t.length-10);N<t.length;N++){let o=t[N];o.dir!=i||e.touchesRange(o.from,o.to)||M.push(new Dl(e.mapPos(o.from,1),e.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return M}}function al(t,e,M){for(let i=t.state.facet(e),N=i.length-1;N>=0;N--){let e=i[N],o="function"==typeof e?e(t):e;o&&Nr(o,M)}return M}const ll=Xs.mac?"mac":Xs.windows?"win":Xs.linux?"linux":"key";function ul(t,e,M){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==M&&e.shiftKey&&(t="Shift-"+t),t}const gl=Mn.default(nl.domEventHandlers({keydown:(t,e)=>yl(zl(e.state),t,e,"editor")})),jl=Ro.define({enables:gl}),cl=new WeakMap;function zl(t){let e=t.facet(jl),M=cl.get(e);return M||cl.set(e,M=function(t,e=ll){let M=Object.create(null),i=Object.create(null),N=(t,e)=>{let M=i[t];if(null==M)i[t]=e;else if(M!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},o=(t,i,o,n,s)=>{var r,D;let a=M[t]||(M[t]=Object.create(null)),l=i.split(/ (?!$)/).map((t=>function(t,e){const M=t.split(/-(?!$)/);let i,N,o,n,s=M[M.length-1];"Space"==s&&(s=" ");for(let t=0;t<M.length-1;++t){const s=M[t];if(/^(cmd|meta|m)$/i.test(s))n=!0;else if(/^a(lt)?$/i.test(s))i=!0;else if(/^(c|ctrl|control)$/i.test(s))N=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);"mac"==e?n=!0:N=!0}}return i&&(s="Alt-"+s),N&&(s="Ctrl-"+s),n&&(s="Meta-"+s),o&&(s="Shift-"+s),s}(t,e)));for(let e=1;e<l.length;e++){let M=l.slice(0,e).join(" ");N(M,!0),a[M]||(a[M]={preventDefault:!0,stopPropagation:!1,run:[e=>{let i=Il={view:e,prefix:M,scope:t};return setTimeout((()=>{Il==i&&(Il=null)}),Tl),!0}]})}let u=l.join(" ");N(u,!1);let g=a[u]||(a[u]={preventDefault:!1,stopPropagation:!1,run:(null===(D=null===(r=a._any)||void 0===r?void 0:r.run)||void 0===D?void 0:D.slice())||[]});o&&g.run.push(o),n&&(g.preventDefault=!0),s&&(g.stopPropagation=!0)};for(let i of t){let t=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let e of t){let t=M[e]||(M[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:N}=i;for(let e in t)t[e].run.push((t=>N(t,Ol)))}let N=i[e]||i.key;if(N)for(let e of t)o(e,N,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(e,"Shift-"+N,i.shift,i.preventDefault,i.stopPropagation)}return M}(e.reduce(((t,e)=>t.concat(e)),[]))),M}let Il=null;const Tl=4e3;let Ol=null;function yl(t,e,M,i){Ol=e;let N=function(t){var e=!(ns&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ss&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?os:Ns)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),o=Qo(po(N,0))==N.length&&" "!=N,n="",s=!1,r=!1,D=!1;Il&&Il.view==M&&Il.scope==i&&(n=Il.prefix+" ",HD.indexOf(e.keyCode)<0&&(r=!0,Il=null));let a,l,u=new Set,g=t=>{if(t){for(let e of t.run)if(!u.has(e)&&(u.add(e),e(M)))return t.stopPropagation&&(D=!0),!0;t.preventDefault&&(t.stopPropagation&&(D=!0),r=!0)}return!1},j=t[i];return j&&(g(j[n+ul(N,e,!o)])?s=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Xs.windows&&e.ctrlKey&&e.altKey)&&(a=Ns[e.keyCode])&&a!=N?(g(j[n+ul(a,e,!0)])||e.shiftKey&&(l=os[e.keyCode])!=N&&l!=a&&g(j[n+ul(l,e,!1)]))&&(s=!0):o&&e.shiftKey&&g(j[n+ul(N,e,!0)])&&(s=!0),!s&&g(j._any)&&(s=!0)),r&&(s=!0),s&&D&&e.stopPropagation(),Ol=null,s}class dl{constructor(t,e,M,i,N){this.className=t,this.left=e,this.top=M,this.width=i,this.height=N}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,M){if(M.empty){let i=t.coordsAtPos(M.head,M.assoc||1);if(!i)return[];let N=Al(t);return[new dl(e,i.left-N.left,i.top-N.top,null,i.bottom-i.top)]}return function(t,e,M){if(M.to<=t.viewport.from||M.from>=t.viewport.to)return[];let i=Math.max(M.from,t.viewport.from),N=Math.min(M.to,t.viewport.to),o=t.textDirection==hr.LTR,n=t.contentDOM,s=n.getBoundingClientRect(),r=Al(t),D=n.querySelector(".cm-line"),a=D&&window.getComputedStyle(D),l=s.left+(a?parseInt(a.paddingLeft)+Math.min(0,parseInt(a.textIndent)):0),u=s.right-(a?parseInt(a.paddingRight):0),g=UD(t,i),j=UD(t,N),c=g.type==ar.Text?g:null,z=j.type==ar.Text?j:null;c&&(t.lineWrapping||g.widgetLineBreaks)&&(c=hl(t,i,1,c));z&&(t.lineWrapping||j.widgetLineBreaks)&&(z=hl(t,N,-1,z));if(c&&z&&c.from==z.from&&c.to==z.to)return T(O(M.from,M.to,c));{let e=c?O(M.from,null,c):y(g,!1),i=z?O(null,M.to,z):y(j,!0),N=[];return(c||g).to<(z||j).from-(c&&z?1:0)||g.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2<i.top?N.push(I(l,e.bottom,u,i.top)):e.bottom<i.top&&t.elementAtHeight((e.bottom+i.top)/2).type==ar.Text&&(e.bottom=i.top=(e.bottom+i.top)/2),T(e).concat(N).concat(T(i))}function I(t,M,i,N){return new dl(e,t-r.left,M-r.top,i-t,N-M)}function T({top:t,bottom:e,horizontal:M}){let i=[];for(let N=0;N<M.length;N+=2)i.push(I(M[N],t,M[N+1],e));return i}function O(e,M,i){let N=1e9,n=-1e9,s=[];function r(e,M,r,D,a){let g=t.coordsAtPos(e,e==i.to?-2:2),j=t.coordsAtPos(r,r==i.from?2:-2);g&&j&&(N=Math.min(g.top,j.top,N),n=Math.max(g.bottom,j.bottom,n),a==hr.LTR?s.push(o&&M?l:g.left,o&&D?u:j.right):s.push(!o&&D?l:j.left,!o&&M?u:g.right))}let D=null!=e?e:i.from,a=null!=M?M:i.to;for(let i of t.visibleRanges)if(i.to>D&&i.from<a)for(let N=Math.max(i.from,D),o=Math.min(i.to,a);;){let i=t.state.doc.lineAt(N);for(let n of t.bidiSpans(i)){let t=n.from+i.from,s=n.to+i.from;if(t>=o)break;s>N&&r(Math.max(t,N),null==e&&t<=D,Math.min(s,o),null==M&&s>=a,n.dir)}if(N=i.to+1,N>=o)break}return 0==s.length&&r(D,null==e,a,null==M,t.textDirection),{top:N,bottom:n,horizontal:s}}function y(t,e){let M=s.top+(e?t.top:t.bottom);return{top:M,bottom:M,horizontal:[]}}}(t,e,M)}}function Al(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==hr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function hl(t,e,M,i){let N=t.coordsAtPos(e,2*M);if(!N)return i;let o=t.dom.getBoundingClientRect(),n=(N.top+N.bottom)/2,s=t.posAtCoords({x:o.left+1,y:n}),r=t.posAtCoords({x:o.right-1,y:n});return null==s||null==r?i:{from:Math.max(i.from,Math.min(s,r)),to:Math.min(i.to,Math.max(s,r))}}class Ll{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(xl)!=t.state.facet(xl)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,M=t.facet(xl);for(;e<M.length&&M[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:e}=this.view;t==this.scaleX&&e==this.scaleY||(this.scaleX=t,this.scaleY=e,this.dom.style.transform=`scale(${1/t}, ${1/e})`)}draw(t){if(t.length!=this.drawn.length||t.some(((t,e)=>!function(t,e){return t.constructor==e.constructor&&t.eq(e)}(t,this.drawn[e])))){let e=this.dom.firstChild,M=0;for(let i of t)i.update&&e&&i.constructor&&this.drawn[M].constructor&&i.update(e,this.drawn[M])?(e=e.nextSibling,M++):this.dom.insertBefore(i.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const xl=Ro.define();function pl(t){return[sD.define((e=>new Ll(e,t))),xl.of(t)]}const Sl=!(Xs.ios&&Xs.webkit&&Xs.webkit_version<534),Ql=Ro.define({combine:t=>Un(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function El(t){return t.startState.facet(Ql)!=t.state.facet(Ql)}const kl=pl({above:!0,markers(t){let{state:e}=t,M=e.facet(Ql),i=[];for(let N of e.selection.ranges){let o=N==e.selection.main;if(N.empty?!o||Sl:M.drawRangeCursor){let e=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",M=N.empty?N:Vo.cursor(N.head,N.head>N.anchor?-1:1);for(let N of dl.forRange(t,e,M))i.push(N)}}return i},update(t,e){t.transactions.some((t=>t.selection))&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let M=El(t);return M&&wl(t.state,e),t.docChanged||t.selectionSet||M},mount(t,e){wl(e.state,t)},class:"cm-cursorLayer"});function wl(t,e){e.style.animationDuration=t.facet(Ql).cursorBlinkRate+"ms"}const ml=pl({above:!1,markers:t=>t.state.selection.ranges.map((e=>e.empty?[]:dl.forRange(t,"cm-selectionBackground",e))).reduce(((t,e)=>t.concat(e))),update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||El(t),class:"cm-selectionLayer"}),Ul={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Sl&&(Ul[".cm-line"].caretColor=Ul[".cm-content"].caretColor="transparent !important");const Cl=Mn.highest(nl.theme(Ul)),Yl=yn.define({map:(t,e)=>null==t?null:e.mapPos(t)}),bl=Xo.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce(((t,e)=>e.is(Yl)?e.value:t),t))}),fl=sD.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let M=t.state.field(bl);null==M?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(bl)!=M||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(bl),M=null!=e&&t.coordsAtPos(e);if(!M)return null;let i=t.scrollDOM.getBoundingClientRect();return{left:M.left-i.left+t.scrollDOM.scrollLeft*t.scaleX,top:M.top-i.top+t.scrollDOM.scrollTop*t.scaleY,height:M.bottom-M.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:M}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/M+"px",this.cursor.style.height=t.height/M+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(bl)!=t&&this.view.dispatch({effects:Yl.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function vl(t,e,M,i,N){e.lastIndex=0;for(let o,n=t.iterRange(M,i),s=M;!n.next().done;s+=n.value.length)if(!n.lineBreak)for(;o=e.exec(n.value);)N(s+o.index,o)}class Zl{constructor(t){const{regexp:e,decoration:M,decorate:i,boundary:N,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,i)this.addMatch=(t,e,M,N)=>i(N,M,M+t[0].length,t,e);else if("function"==typeof M)this.addMatch=(t,e,i,N)=>{let o=M(t,e,i);o&&N(i,i+t[0].length,o)};else{if(!M)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,i,N)=>N(i,i+t[0].length,M)}this.boundary=N,this.maxLength=o}createDeco(t){let e=new Zn,M=e.add.bind(e);for(let{from:e,to:i}of function(t,e){let M=t.visibleRanges;if(1==M.length&&M[0].from==t.viewport.from&&M[0].to==t.viewport.to)return M;let i=[];for(let{from:N,to:o}of M)N=Math.max(t.state.doc.lineAt(N).from,N-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),i.length&&i[i.length-1].to>=N?i[i.length-1].to=o:i.push({from:N,to:o});return i}(t,this.maxLength))vl(t.state.doc,this.regexp,e,i,((e,i)=>this.addMatch(i,t,e,M)));return e.finish()}updateDeco(t,e){let M=1e9,i=-1;return t.docChanged&&t.changes.iterChanges(((e,N,o,n)=>{n>=t.view.viewport.from&&o<=t.view.viewport.to&&(M=Math.min(o,M),i=Math.max(n,i))})),t.viewportMoved||i-M>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,e.map(t.changes),M,i):e}updateRange(t,e,M,i){for(let N of t.visibleRanges){let o=Math.max(N.from,M),n=Math.min(N.to,i);if(n>o){let M=t.state.doc.lineAt(o),i=M.to<n?t.state.doc.lineAt(n):M,s=Math.max(N.from,M.from),r=Math.min(N.to,i.to);if(this.boundary){for(;o>M.from;o--)if(this.boundary.test(M.text[o-1-M.from])){s=o;break}for(;n<i.to;n++)if(this.boundary.test(i.text[n-i.from])){r=n;break}}let D,a=[],l=(t,e,M)=>a.push(M.range(t,e));if(M==i)for(this.regexp.lastIndex=s-M.from;(D=this.regexp.exec(M.text))&&D.index<r-M.from;)this.addMatch(D,t,D.index+M.from,l);else vl(t.state.doc,this.regexp,s,r,((e,M)=>this.addMatch(M,t,e,l)));e=e.update({filterFrom:s,filterTo:r,filter:(t,e)=>t<s||e>r,add:a})}}return e}}const Vl=null!=/x/.unicode?"gu":"g",Wl=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",Vl),Pl={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Rl=null;const Gl=Ro.define({combine(t){let e=Un(t,{render:null,specialChars:Wl,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==Rl&&"undefined"!=typeof document&&document.body){let e=document.body.style;Rl=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return Rl||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,Vl)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Vl)),e}});let Bl=null;class _l extends Dr{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),M=t.state.phrase("Control character")+" "+(Pl[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,M,e);if(i)return i;let N=document.createElement("span");return N.textContent=e,N.title=M,N.setAttribute("aria-label",M),N.className="cm-specialChar",N}ignoreEvent(){return!1}}class Fl extends Dr{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const Jl=lr.line({class:"cm-activeLine"}),Hl=sD.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,M=[];for(let i of t.state.selection.ranges){let N=t.lineBlockAt(i.head);N.from>e&&(M.push(Jl.range(N.from)),e=N.from)}return lr.set(M)}},{decorations:t=>t.decorations});class Xl extends Dr{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(t):this.content.cloneNode(!0)),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?gs(t.firstChild):[];if(!e.length)return null;let M=window.getComputedStyle(t.parentNode),i=Os(e[0],"rtl"!=M.direction),N=parseInt(M.lineHeight);return i.bottom-i.top>1.5*N?{left:i.left,right:i.right,top:i.top,bottom:i.top+N}:i}ignoreEvent(){return!1}}const $l=2e3;function ql(t,e){let M=t.posAtCoords({x:e.clientX,y:e.clientY},!1),i=t.state.doc.lineAt(M),N=M-i.from,o=N>$l?-1:N==i.length?function(t,e){let M=t.coordsAtPos(t.viewport.from);return M?Math.round(Math.abs((M.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):Xn(i.text,t.state.tabSize,M-i.from);return{line:i.number,col:o,off:N}}function Kl(t,e){let M=ql(t,e),i=t.state.selection;return M?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(M.line).from),N=t.state.doc.lineAt(e);M={line:N.number,col:M.col,off:Math.min(M.off,N.length)},i=i.map(t.changes)}},get(e,N,o){let n=ql(t,e);if(!n)return i;let s=function(t,e,M){let i=Math.min(e.line,M.line),N=Math.max(e.line,M.line),o=[];if(e.off>$l||M.off>$l||e.col<0||M.col<0){let n=Math.min(e.off,M.off),s=Math.max(e.off,M.off);for(let e=i;e<=N;e++){let M=t.doc.line(e);M.length<=s&&o.push(Vo.range(M.from+n,M.to+s))}}else{let n=Math.min(e.col,M.col),s=Math.max(e.col,M.col);for(let e=i;e<=N;e++){let M=t.doc.line(e),i=$n(M.text,n,t.tabSize,!0);if(i<0)o.push(Vo.cursor(M.to));else{let e=$n(M.text,s,t.tabSize);o.push(Vo.range(M.from+i,M.from+e))}}}return o}(t.state,M,n);return s.length?o?Vo.create(s.concat(i.ranges)):Vo.create(s):i}}:null}const tu={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},eu={style:"cursor: crosshair"};const Mu="-10000px";class iu{constructor(t,e,M,i){this.facet=e,this.createTooltipView=M,this.removeTooltipView=i,this.input=t.state.facet(e),this.tooltips=this.input.filter((t=>t));let N=null;this.tooltipViews=this.tooltips.map((t=>N=M(t,N)))}update(t,e){var M;let i=t.state.facet(this.facet),N=i.filter((t=>t));if(i===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let o=[],n=e?[]:null;for(let M=0;M<N.length;M++){let i=N[M],s=-1;if(i){for(let t=0;t<this.tooltips.length;t++){let e=this.tooltips[t];e&&e.create==i.create&&(s=t)}if(s<0)o[M]=this.createTooltipView(i,M?o[M-1]:null),n&&(n[M]=!!i.above);else{let i=o[M]=this.tooltipViews[s];n&&(n[M]=e[s]),i.update&&i.update(t)}}}for(let t of this.tooltipViews)o.indexOf(t)<0&&(this.removeTooltipView(t),null===(M=t.destroy)||void 0===M||M.call(t));return e&&(n.forEach(((t,M)=>e[M]=t)),e.length=n.length),this.input=i,this.tooltips=N,this.tooltipViews=o,!0}}function Nu(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const ou=Ro.define({combine:t=>{var e,M,i;return{position:Xs.ios?"absolute":(null===(e=t.find((t=>t.position)))||void 0===e?void 0:e.position)||"fixed",parent:(null===(M=t.find((t=>t.parent)))||void 0===M?void 0:M.parent)||null,tooltipSpace:(null===(i=t.find((t=>t.tooltipSpace)))||void 0===i?void 0:i.tooltipSpace)||Nu}}}),nu=new WeakMap,su=sD.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(ou);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver((()=>this.measureSoon())):null,this.manager=new iu(t,lu,((t,e)=>this.createTooltip(t,e)),(t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()})),this.above=this.manager.tooltips.map((t=>!!t.above)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let M=e||t.geometryChanged,i=t.state.facet(ou);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;M=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);M=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);M&&this.maybeMeasure()}createTooltip(t,e){let M=t.create(this.view),i=e?e.dom:null;if(M.dom.classList.add("cm-tooltip"),t.arrow&&!M.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",M.dom.appendChild(t)}return M.dom.style.position=this.position,M.dom.style.top=Mu,M.dom.style.left="0px",this.container.insertBefore(M.dom,i),M.mount&&M.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(M.dom),M}destroy(){var t,e,M;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(M=this.intersectionObserver)||void 0===M||M.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,M=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(Xs.gecko)M=t.offsetParent!=this.container.ownerDocument.body;else if(t.style.top==Mu&&"0px"==t.style.left){let e=t.getBoundingClientRect();M=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(M||"absolute"==this.position)if(this.parent){let M=this.parent.getBoundingClientRect();M.width&&M.height&&(t=M.width/this.parent.offsetWidth,e=M.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),N=ID(this.view);return{visible:{left:i.left+N.left,top:i.top+N.top,right:i.right-N.right,bottom:i.bottom-N.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(((t,e)=>{let M=this.manager.tooltipViews[e];return M.getCoords?M.getCoords(t.pos):this.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((({dom:t})=>t.getBoundingClientRect())),space:this.view.state.facet(ou).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:M}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{visible:M,space:i,scaleX:N,scaleY:o}=t,n=[];for(let s=0;s<this.manager.tooltips.length;s++){let r=this.manager.tooltips[s],D=this.manager.tooltipViews[s],{dom:a}=D,l=t.pos[s],u=t.size[s];if(!l||!1!==r.clip&&(l.bottom<=Math.max(M.top,i.top)||l.top>=Math.min(M.bottom,i.bottom)||l.right<Math.max(M.left,i.left)-.1||l.left>Math.min(M.right,i.right)+.1)){a.style.top=Mu;continue}let g=r.arrow?D.dom.querySelector(".cm-tooltip-arrow"):null,j=g?7:0,c=u.right-u.left,z=null!==(e=nu.get(D))&&void 0!==e?e:u.bottom-u.top,I=D.offset||au,T=this.view.textDirection==hr.LTR,O=u.width>i.right-i.left?T?i.left:i.right-u.width:T?Math.max(i.left,Math.min(l.left-(g?14:0)+I.x,i.right-c)):Math.min(Math.max(i.left,l.left-c+(g?14:0)-I.x),i.right-c),y=this.above[s];!r.strictSide&&(y?l.top-z-j-I.y<i.top:l.bottom+z+j+I.y>i.bottom)&&y==i.bottom-l.bottom>l.top-i.top&&(y=this.above[s]=!y);let d=(y?l.top-i.top:i.bottom-l.bottom)-j;if(d<z&&!1!==D.resize){if(d<this.view.defaultLineHeight){a.style.top=Mu;continue}nu.set(D,z),a.style.height=(z=d)/o+"px"}else a.style.height&&(a.style.height="");let A=y?l.top-z-j-I.y:l.bottom+j+I.y,h=O+c;if(!0!==D.overlap)for(let t of n)t.left<h&&t.right>O&&t.top<A+z&&t.bottom>A&&(A=y?t.top-z-2-j:t.bottom+j+2);if("absolute"==this.position?(a.style.top=(A-t.parent.top)/o+"px",ru(a,(O-t.parent.left)/N)):(a.style.top=A/o+"px",ru(a,O/N)),g){let t=l.left+(T?I.x:-I.x)-(O+14-7);g.style.left=t/N+"px"}!0!==D.overlap&&n.push({left:O,top:A,right:h,bottom:A+z}),a.classList.toggle("cm-tooltip-above",y),a.classList.toggle("cm-tooltip-below",!y),D.positioned&&D.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Mu}},{eventObservers:{scroll(){this.maybeMeasure()}}});function ru(t,e){let M=parseInt(t.style.left,10);(isNaN(M)||Math.abs(e-M)>1)&&(t.style.left=e+"px")}const Du=nl.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),au={x:0,y:0},lu=Ro.define({enables:[su,Du]}),uu=Ro.define({combine:t=>t.reduce(((t,e)=>t.concat(e)),[])});class gu{static create(t){return new gu(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new iu(t,uu,((t,e)=>this.createHostedView(t,e)),(t=>t.dom.remove()))}createHostedView(t,e){let M=t.create(this.view);return M.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(M.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&M.mount&&M.mount(this.view),M}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(t){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)null===(t=e.destroy)||void 0===t||t.call(e)}passProp(t){let e;for(let M of this.manager.tooltipViews){let i=M[t];if(void 0!==i)if(void 0===e)e=i;else if(e!==i)return}return e}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const ju=lu.compute([uu],(t=>{let e=t.facet(uu);return 0===e.length?null:{pos:Math.min(...e.map((t=>t.pos))),end:Math.max(...e.map((t=>{var e;return null!==(e=t.end)&&void 0!==e?e:t.pos}))),create:gu.create,above:e[0].above,arrow:e.some((t=>t.arrow))}}));class cu{constructor(t,e,M,i,N){this.view=t,this.source=e,this.field=M,this.setHover=i,this.hoverTime=N,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:e}=this,M=t.docView.nearest(e.target);if(!M)return;let i,N=1;if(M instanceof Ks)i=M.posAtStart;else{if(i=t.posAtCoords(e),null==i)return;let M=t.coordsAtPos(i);if(!M||e.y<M.top||e.y>M.bottom||e.x<M.left-t.defaultCharacterWidth||e.x>M.right+t.defaultCharacterWidth)return;let o=t.bidiSpans(t.state.doc.lineAt(i)).find((t=>t.from<=i&&t.to>=i)),n=o&&o.dir==hr.RTL?-1:1;N=e.x<M.left?-n:n}let o=this.source(t,i,N);if(null==o?void 0:o.then){let e=this.pending={pos:i};o.then((M=>{this.pending==e&&(this.pending=null,!M||Array.isArray(M)&&!M.length||t.dispatch({effects:this.setHover.of(Array.isArray(M)?M:[M])}))}),(e=>iD(t.state,e,"hover tooltip")))}else!o||Array.isArray(o)&&!o.length||t.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let t=this.view.plugin(su),e=t?t.manager.tooltips.findIndex((t=>t.create==gu.create)):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,M;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:N}=this;if(i.length&&N&&!function(t,e){let M,{left:i,right:N,top:o,bottom:n}=t.getBoundingClientRect();if(M=t.querySelector(".cm-tooltip-arrow")){let t=M.getBoundingClientRect();o=Math.min(t.top,o),n=Math.max(t.bottom,n)}return e.clientX>=i-zu&&e.clientX<=N+zu&&e.clientY>=o-zu&&e.clientY<=n+zu}(N.dom,t)||this.pending){let{pos:N}=i[0]||this.pending,o=null!==(M=null===(e=i[0])||void 0===e?void 0:e.end)&&void 0!==M?M:N;(N==o?this.view.posAtCoords(this.lastMove)==N:function(t,e,M,i,N){let o=t.scrollDOM.getBoundingClientRect(),n=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.right<i||o.top>N||Math.min(o.bottom,n)<N)return!1;let s=t.posAtCoords({x:i,y:N},!1);return s>=e&&s<=M}(this.view,N,o,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:e}=this;if(e.length){let{tooltip:e}=this;e&&e.dom.contains(t.relatedTarget)?this.watchTooltipLeave(e.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let e=M=>{t.removeEventListener("mouseleave",e),this.active.length&&!this.view.dom.contains(M.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const zu=4;function Iu(t,e={}){let M=yn.define(),i=Xo.define({create:()=>[],update(t,i){if(t.length&&(e.hideOnChange&&(i.docChanged||i.selection)?t=[]:e.hideOn&&(t=t.filter((t=>!e.hideOn(i,t)))),i.docChanged)){let e=[];for(let M of t){let t=i.changes.mapPos(M.pos,-1,ko.TrackDel);if(null!=t){let N=Object.assign(Object.create(null),M);N.pos=t,null!=N.end&&(N.end=i.changes.mapPos(N.end)),e.push(N)}}t=e}for(let e of i.effects)e.is(M)&&(t=e.value),e.is(Ou)&&(t=[]);return t},provide:t=>uu.from(t)});return{active:i,extension:[i,sD.define((N=>new cu(N,t,i,M,e.hoverTime||300))),ju]}}function Tu(t,e){let M=t.plugin(su);if(!M)return null;let i=M.manager.tooltips.indexOf(e);return i<0?null:M.manager.tooltipViews[i]}const Ou=yn.define(),yu=Ro.define({combine(t){let e,M;for(let i of t)e=e||i.topContainer,M=M||i.bottomContainer;return{topContainer:e,bottomContainer:M}}});function du(t,e){let M=t.plugin(Au),i=M?M.specs.indexOf(e):-1;return i>-1?M.panels[i]:null}const Au=sD.fromClass(class{constructor(t){this.input=t.state.facet(xu),this.specs=this.input.filter((t=>t)),this.panels=this.specs.map((e=>e(t)));let e=t.state.facet(yu);this.top=new hu(t,!0,e.topContainer),this.bottom=new hu(t,!1,e.bottomContainer),this.top.sync(this.panels.filter((t=>t.top))),this.bottom.sync(this.panels.filter((t=>!t.top)));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(yu);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new hu(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new hu(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let M=t.state.facet(xu);if(M!=this.input){let e=M.filter((t=>t)),i=[],N=[],o=[],n=[];for(let M of e){let e,s=this.specs.indexOf(M);s<0?(e=M(t.view),n.push(e)):(e=this.panels[s],e.update&&e.update(t)),i.push(e),(e.top?N:o).push(e)}this.specs=e,this.panels=i,this.top.sync(N),this.bottom.sync(o);for(let t of n)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>nl.scrollMargins.of((e=>{let M=e.plugin(t);return M&&{top:M.top.scrollMargin(),bottom:M.bottom.scrollMargin()}}))});class hu{constructor(t,e,M){this.view=t,this.top=e,this.container=M,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Lu(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Lu(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Lu(t){let e=t.nextSibling;return t.remove(),e}const xu=Ro.define({enables:Au});class pu extends Cn{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}pu.prototype.elementClass="",pu.prototype.toDOM=void 0,pu.prototype.mapMode=ko.TrackBefore,pu.prototype.startSide=pu.prototype.endSide=-1,pu.prototype.point=!0;const Su=Ro.define(),Qu=Ro.define(),Eu={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>vn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ku=Ro.define();function wu(t){return[Uu(),ku.of(Object.assign(Object.assign({},Eu),t))]}const mu=Ro.define({combine:t=>t.some((t=>t))});function Uu(t){let e=[Cu];return t&&!1===t.fixed&&e.push(mu.of(!0)),e}const Cu=sD.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(ku).map((e=>new vu(t,e)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!t.state.facet(mu),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,M=t.view.viewport,i=Math.min(e.to,M.to)-Math.max(e.from,M.from);this.syncGutters(i<.8*(M.to-M.from))}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(mu)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let M=vn.iter(this.view.state.facet(Su),this.view.viewport.from),i=[],N=this.gutters.map((t=>new fu(t,this.view.viewport,-this.view.documentPadding.top)));for(let t of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(t.type)){let e=!0;for(let o of t.type)if(o.type==ar.Text&&e){bu(M,i,o.from);for(let t of N)t.line(this.view,o,i);e=!1}else if(o.widget)for(let t of N)t.widget(this.view,o)}else if(t.type==ar.Text){bu(M,i,t.from);for(let e of N)e.line(this.view,t,i)}else if(t.widget)for(let e of N)e.widget(this.view,t);for(let t of N)t.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(ku),M=t.state.facet(ku),i=t.docChanged||t.heightChanged||t.viewportChanged||!vn.eq(t.startState.facet(Su),t.state.facet(Su),t.view.viewport.from,t.view.viewport.to);if(e==M)for(let e of this.gutters)e.update(t)&&(i=!0);else{i=!0;let N=[];for(let i of M){let M=e.indexOf(i);M<0?N.push(new vu(this.view,i)):(this.gutters[M].update(t),N.push(this.gutters[M]))}for(let t of this.gutters)t.dom.remove(),N.indexOf(t)<0&&t.destroy();for(let t of N)this.dom.appendChild(t.dom);this.gutters=N}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>nl.scrollMargins.of((e=>{let M=e.plugin(t);return M&&0!=M.gutters.length&&M.fixed?e.textDirection==hr.LTR?{left:M.dom.offsetWidth*e.scaleX}:{right:M.dom.offsetWidth*e.scaleX}:null}))});function Yu(t){return Array.isArray(t)?t:[t]}function bu(t,e,M){for(;t.value&&t.from<=M;)t.from==M&&e.push(t.value),t.next()}class fu{constructor(t,e,M){this.gutter=t,this.height=M,this.i=0,this.cursor=vn.iter(t.markers,e.from)}addElement(t,e,M){let{gutter:i}=this,N=(e.top-this.height)/t.scaleY,o=e.height/t.scaleY;if(this.i==i.elements.length){let e=new Zu(t,o,N,M);i.elements.push(e),i.dom.appendChild(e.dom)}else i.elements[this.i].update(t,o,N,M);this.height=e.bottom,this.i++}line(t,e,M){let i=[];bu(this.cursor,i,e.from),M.length&&(i=i.concat(M));let N=this.gutter.config.lineMarker(t,e,i);N&&i.unshift(N);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(t,e,i)}widget(t,e){let M=this.gutter.config.widgetMarker(t,e.widget,e),i=M?[M]:null;for(let M of t.state.facet(Qu)){let N=M(t,e.widget,e);N&&(i||(i=[])).push(N)}i&&this.addElement(t,e,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class vu{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let M in e.domEventHandlers)this.dom.addEventListener(M,(i=>{let N,o=i.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let t=o.getBoundingClientRect();N=(t.top+t.bottom)/2}else N=i.clientY;let n=t.lineBlockAtHeight(N-t.documentTop);e.domEventHandlers[M](t,n,i)&&i.preventDefault()}));this.markers=Yu(e.markers(t)),e.initialSpacer&&(this.spacer=new Zu(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Yu(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let M=t.view.viewport;return!vn.eq(this.markers,e,M.from,M.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class Zu{constructor(t,e,M,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,M,i)}update(t,e,M,i){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=M&&(this.dom.style.marginTop=(this.above=M)?M+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let M=0;M<t.length;M++)if(!t[M].compare(e[M]))return!1;return!0}(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,e){let M="cm-gutterElement",i=this.dom.firstChild;for(let N=0,o=0;;){let n=o,s=N<e.length?e[N++]:null,r=!1;if(s){let t=s.elementClass;t&&(M+=" "+t);for(let t=o;t<this.markers.length;t++)if(this.markers[t].compare(s)){n=t,r=!0;break}}else n=this.markers.length;for(;o<n;){let t=this.markers[o++];if(t.toDOM){t.destroy(i);let e=i.nextSibling;i.remove(),i=e}}if(!s)break;s.toDOM&&(r?i=i.nextSibling:this.dom.insertBefore(s.toDOM(t),i)),r&&o++}this.dom.className=M,this.markers=e}destroy(){this.setMarkers(null,[])}}const Vu=Ro.define(),Wu=Ro.define(),Pu=Ro.define({combine:t=>Un(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let M=Object.assign({},t);for(let t in e){let i=M[t],N=e[t];M[t]=i?(t,e,M)=>i(t,e,M)||N(t,e,M):N}return M}})});class Ru extends pu{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Gu(t,e){return t.state.facet(Pu).formatNumber(e,t.state)}const Bu=ku.compute([Pu],(t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(Vu),lineMarker:(t,e,M)=>M.some((t=>t.toDOM))?null:new Ru(Gu(t,t.state.doc.lineAt(e.from).number)),widgetMarker:(t,e,M)=>{for(let i of t.state.facet(Wu)){let N=i(t,e,M);if(N)return N}return null},lineMarkerChange:t=>t.startState.facet(Pu)!=t.state.facet(Pu),initialSpacer:t=>new Ru(Gu(t,_u(t.state.doc.lines))),updateSpacer(t,e){let M=Gu(e.view,_u(e.view.state.doc.lines));return M==t.number?t:new Ru(M)},domEventHandlers:t.facet(Pu).domEventHandlers})));function _u(t){let e=9;for(;e<t;)e=10*e+9;return e}const Fu=new class extends pu{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Ju=Su.compute(["selection"],(t=>{let e=[],M=-1;for(let i of t.selection.ranges){let N=t.doc.lineAt(i.head).from;N>M&&(M=N,e.push(Fu.range(N)))}return vn.of(e)}));const Hu=1024;let Xu=0;class $u{constructor(t,e){this.from=t,this.to=e}}class qu{constructor(t={}){this.id=Xu++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=eg.match(t)),e=>{let M=t(e);return void 0===M?null:[this,M]}}}qu.closedBy=new qu({deserialize:t=>t.split(" ")}),qu.openedBy=new qu({deserialize:t=>t.split(" ")}),qu.group=new qu({deserialize:t=>t.split(" ")}),qu.isolate=new qu({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),qu.contextHash=new qu({perNode:!0}),qu.lookAhead=new qu({perNode:!0}),qu.mounted=new qu({perNode:!0});class Ku{constructor(t,e,M){this.tree=t,this.overlay=e,this.parser=M}static get(t){return t&&t.props&&t.props[qu.mounted.id]}}const tg=Object.create(null);class eg{constructor(t,e,M,i=0){this.name=t,this.props=e,this.id=M,this.flags=i}static define(t){let e=t.props&&t.props.length?Object.create(null):tg,M=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),i=new eg(t.name||"",e,t.id,M);if(t.props)for(let M of t.props)if(Array.isArray(M)||(M=M(i)),M){if(M[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[M[0].id]=M[1]}return i}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(qu.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let M in t)for(let i of M.split(" "))e[i]=t[M];return t=>{for(let M=t.prop(qu.group),i=-1;i<(M?M.length:0);i++){let N=e[i<0?t.name:M[i]];if(N)return N}}}}eg.none=new eg("",Object.create(null),0,8);class Mg{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let M of this.types){let i=null;for(let e of t){let t=e(M);t&&(i||(i=Object.assign({},M.props)),i[t[0].id]=t[1])}e.push(i?new eg(M.name,i,M.id,M.flags):M)}return new Mg(e)}}const ig=new WeakMap,Ng=new WeakMap;var og;!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"}(og||(og={}));class ng{constructor(t,e,M,i,N){if(this.type=t,this.children=e,this.positions=M,this.length=i,this.props=null,N&&N.length){this.props=Object.create(null);for(let[t,e]of N)this.props["number"==typeof t?t:t.id]=e}}toString(){let t=Ku.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let t of this.children){let M=t.toString();M&&(e&&(e+=","),e+=M)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Og(this.topNode,t)}cursorAt(t,e=0,M=0){let i=ig.get(this)||this.topNode,N=new Og(i);return N.moveTo(t,e),ig.set(this,N._tree),N}get topNode(){return new ug(this,0,0,null)}resolve(t,e=0){let M=ag(ig.get(this)||this.topNode,t,e,!1);return ig.set(this,M),M}resolveInner(t,e=0){let M=ag(Ng.get(this)||this.topNode,t,e,!0);return Ng.set(this,M),M}resolveStack(t,e=0){return function(t,e,M){let i=t.resolveInner(e,M),N=null;for(let t=i instanceof ug?i:i.context.parent;t;t=t.parent)if(t.index<0){let o=t.parent;(N||(N=[i])).push(o.resolve(e,M)),t=o}else{let o=Ku.get(t.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let n=new ug(o.tree,o.overlay[0].from+t.from,-1,t);(N||(N=[i])).push(ag(n,e,M,!1))}}return N?Ig(N):i}(this,t,e)}iterate(t){let{enter:e,leave:M,from:i=0,to:N=this.length}=t,o=t.mode||0,n=(o&og.IncludeAnonymous)>0;for(let t=this.cursor(o|og.IncludeAnonymous);;){let o=!1;if(t.from<=N&&t.to>=i&&(!n&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;o=!0}for(;o&&M&&(n||!t.type.isAnonymous)&&M(t),!t.nextSibling();){if(!t.parent())return;o=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:hg(eg.none,this.children,this.positions,0,this.children.length,0,this.length,((t,e,M)=>new ng(this.type,t,e,M,this.propValues)),t.makeTree||((t,e,M)=>new ng(eg.none,t,e,M)))}static build(t){return function(t){var e;let{buffer:M,nodeSet:i,maxBufferLength:N=Hu,reused:o=[],minRepeatType:n=i.types.length}=t,s=Array.isArray(M)?new sg(M,M.length):M,r=i.types,D=0,a=0;function l(t,e,M,T,O,y){let{id:d,start:A,end:h,size:L}=s,x=a,p=D;for(;L<0;){if(s.next(),-1==L){let e=o[d];return M.push(e),void T.push(A-t)}if(-3==L)return void(D=d);if(-4==L)return void(a=d);throw new RangeError(`Unrecognized record size: ${L}`)}let S,Q,E=r[d],k=A-t;if(h-A<=N&&(Q=z(s.pos-e,O))){let e=new Uint16Array(Q.size-Q.skip),M=s.pos-Q.size,N=e.length;for(;s.pos>M;)N=I(Q.start,e,N);S=new rg(e,h-Q.start,i),k=Q.start-t}else{let t=s.pos-L;s.next();let e=[],M=[],i=d>=n?d:-1,o=0,r=h;for(;s.pos>t;)i>=0&&s.id==i&&s.size>=0?(s.end<=r-N&&(j(e,M,A,o,s.end,r,i,x,p),o=e.length,r=s.end),s.next()):y>2500?u(A,t,e,M):l(A,t,e,M,i,y+1);if(i>=0&&o>0&&o<e.length&&j(e,M,A,o,A,r,i,x,p),e.reverse(),M.reverse(),i>-1&&o>0){let t=g(E,p);S=hg(E,e,M,0,e.length,0,h-A,t,t)}else S=c(E,e,M,h-A,x-h,p)}M.push(S),T.push(k)}function u(t,e,M,o){let n=[],r=0,D=-1;for(;s.pos>e;){let{id:t,start:e,end:M,size:i}=s;if(i>4)s.next();else{if(D>-1&&e<D)break;D<0&&(D=M-N),n.push(t,e,M),r++,s.next()}}if(r){let e=new Uint16Array(4*r),N=n[n.length-2];for(let t=n.length-3,M=0;t>=0;t-=3)e[M++]=n[t],e[M++]=n[t+1]-N,e[M++]=n[t+2]-N,e[M++]=M;M.push(new rg(e,n[2]-N,i)),o.push(N-t)}}function g(t,e){return(M,i,N)=>{let o,n,s=0,r=M.length-1;if(r>=0&&(o=M[r])instanceof ng){if(!r&&o.type==t&&o.length==N)return o;(n=o.prop(qu.lookAhead))&&(s=i[r]+o.length+n)}return c(t,M,i,N,s,e)}}function j(t,e,M,N,o,n,s,r,D){let a=[],l=[];for(;t.length>N;)a.push(t.pop()),l.push(e.pop()+M-o);t.push(c(i.types[s],a,l,n-o,r-n,D)),e.push(o-M)}function c(t,e,M,i,N,o,n){if(o){let t=[qu.contextHash,o];n=n?[t].concat(n):[t]}if(N>25){let t=[qu.lookAhead,N];n=n?[t].concat(n):[t]}return new ng(t,e,M,i,n)}function z(t,e){let M=s.fork(),i=0,o=0,r=0,D=M.end-N,a={size:0,start:0,skip:0};t:for(let N=M.pos-t;M.pos>N;){let t=M.size;if(M.id==e&&t>=0){a.size=i,a.start=o,a.skip=r,r+=4,i+=4,M.next();continue}let s=M.pos-t;if(t<0||s<N||M.start<D)break;let l=M.id>=n?4:0,u=M.start;for(M.next();M.pos>s;){if(M.size<0){if(-3!=M.size)break t;l+=4}else M.id>=n&&(l+=4);M.next()}o=u,i+=t,r+=l}return(e<0||i==t)&&(a.size=i,a.start=o,a.skip=r),a.size>4?a:void 0}function I(t,e,M){let{id:i,start:N,end:o,size:r}=s;if(s.next(),r>=0&&i<n){let n=M;if(r>4){let i=s.pos-(r-4);for(;s.pos>i;)M=I(t,e,M)}e[--M]=n,e[--M]=o-t,e[--M]=N-t,e[--M]=i}else-3==r?D=i:-4==r&&(a=i);return M}let T=[],O=[];for(;s.pos>0;)l(t.start||0,t.bufferStart||0,T,O,-1,0);let y=null!==(e=t.length)&&void 0!==e?e:T.length?O[0]+T[0].length:0;return new ng(r[t.topID],T.reverse(),O.reverse(),y)}(t)}}ng.empty=new ng(eg.none,[],[],0);class sg{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new sg(this.buffer,this.index)}}class rg{constructor(t,e,M){this.buffer=t,this.length=e,this.set=M}get type(){return eg.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],M=this.buffer[t+3],i=this.set.types[e],N=i.name;if(/\W/.test(N)&&!i.isError&&(N=JSON.stringify(N)),M==(t+=4))return N;let o=[];for(;t<M;)o.push(this.childString(t)),t=this.buffer[t+3];return N+"("+o.join(",")+")"}findChild(t,e,M,i,N){let{buffer:o}=this,n=-1;for(let s=t;s!=e&&!(Dg(N,i,o[s+1],o[s+2])&&(n=s,M>0));s=o[s+3]);return n}slice(t,e,M){let i=this.buffer,N=new Uint16Array(e-t),o=0;for(let n=t,s=0;n<e;){N[s++]=i[n++],N[s++]=i[n++]-M;let e=N[s++]=i[n++]-M;N[s++]=i[n++]-t,o=Math.max(o,e)}return new rg(N,o,this.set)}}function Dg(t,e,M,i){switch(t){case-2:return M<e;case-1:return i>=e&&M<e;case 0:return M<e&&i>e;case 1:return M<=e&&i>e;case 2:return i>e;case 4:return!0}}function ag(t,e,M,i){for(var N;t.from==t.to||(M<1?t.from>=e:t.from>e)||(M>-1?t.to<=e:t.to<e);){let e=!i&&t instanceof ug&&t.index<0?null:t.parent;if(!e)return t;t=e}let o=i?0:og.IgnoreOverlays;if(i)for(let i=t,n=i.parent;n;i=n,n=i.parent)i instanceof ug&&i.index<0&&(null===(N=n.enter(e,M,o))||void 0===N?void 0:N.from)!=i.from&&(t=n);for(;;){let i=t.enter(e,M,o);if(!i)return t;t=i}}class lg{cursor(t=0){return new Og(this,t)}getChild(t,e=null,M=null){let i=gg(this,t,e,M);return i.length?i[0]:null}getChildren(t,e=null,M=null){return gg(this,t,e,M)}resolve(t,e=0){return ag(this,t,e,!1)}resolveInner(t,e=0){return ag(this,t,e,!0)}matchContext(t){return jg(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),M=this;for(;e;){let t=e.lastChild;if(!t||t.to!=e.to)break;t.type.isError&&t.from==t.to?(M=e,e=t.prevSibling):e=t}return M}get node(){return this}get next(){return this.parent}}class ug extends lg{constructor(t,e,M,i){super(),this._tree=t,this.from=e,this.index=M,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,M,i,N=0){for(let o=this;;){for(let{children:n,positions:s}=o._tree,r=e>0?n.length:-1;t!=r;t+=e){let r=n[t],D=s[t]+o.from;if(Dg(i,M,D,D+r.length))if(r instanceof rg){if(N&og.ExcludeBuffers)continue;let n=r.findChild(0,r.buffer.length,e,M-D,i);if(n>-1)return new zg(new cg(o,r,t,D),null,n)}else if(N&og.IncludeAnonymous||!r.type.isAnonymous||yg(r)){let n;if(!(N&og.IgnoreMounts)&&(n=Ku.get(r))&&!n.overlay)return new ug(n.tree,D,t,o);let s=new ug(r,D,t,o);return N&og.IncludeAnonymous||!s.type.isAnonymous?s:s.nextChild(e<0?r.children.length-1:0,e,M,i)}}if(N&og.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,M=0){let i;if(!(M&og.IgnoreOverlays)&&(i=Ku.get(this._tree))&&i.overlay){let M=t-this.from;for(let{from:t,to:N}of i.overlay)if((e>0?t<=M:t<M)&&(e<0?N>=M:N>M))return new ug(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,M)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function gg(t,e,M,i){let N=t.cursor(),o=[];if(!N.firstChild())return o;if(null!=M)for(let t=!1;!t;)if(t=N.type.is(M),!N.nextSibling())return o;for(;;){if(null!=i&&N.type.is(i))return o;if(N.type.is(e)&&o.push(N.node),!N.nextSibling())return null==i?o:[]}}function jg(t,e,M=e.length-1){for(let i=t;M>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[M]&&e[M]!=i.name)return!1;M--}}return!0}class cg{constructor(t,e,M,i){this.parent=t,this.buffer=e,this.index=M,this.start=i}}class zg extends lg{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,M){super(),this.context=t,this._parent=e,this.index=M,this.type=t.buffer.set.types[t.buffer.buffer[M]]}child(t,e,M){let{buffer:i}=this.context,N=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.context.start,M);return N<0?null:new zg(this.context,this,N)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,M=0){if(M&og.ExcludeBuffers)return null;let{buffer:i}=this.context,N=i.findChild(this.index+4,i.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return N<0?null:new zg(this.context,this,N)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new zg(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new zg(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:M}=this.context,i=this.index+4,N=M.buffer[this.index+3];if(N>i){let o=M.buffer[this.index+1];t.push(M.slice(i,N,o)),e.push(0)}return new ng(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ig(t){if(!t.length)return null;let e=0,M=t[0];for(let i=1;i<t.length;i++){let N=t[i];(N.from>M.from||N.to<M.to)&&(M=N,e=i)}let i=M instanceof ug&&M.index<0?null:M.parent,N=t.slice();return i?N[e]=i:N.splice(e,1),new Tg(N,M)}class Tg{constructor(t,e){this.heads=t,this.node=e}get next(){return Ig(this.heads)}}class Og{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ug)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let e=t._parent;e;e=e._parent)this.stack.unshift(e.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}yieldBuf(t,e){this.index=t;let{start:M,buffer:i}=this.buffer;return this.type=e||i.set.types[i.buffer[t]],this.from=M+i.buffer[t+1],this.to=M+i.buffer[t+2],!0}yield(t){return!!t&&(t instanceof ug?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,M){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,M,this.mode));let{buffer:i}=this.buffer,N=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.buffer.start,M);return!(N<0)&&(this.stack.push(this.index),this.yieldBuf(N))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,M=this.mode){return this.buffer?!(M&og.ExcludeBuffers)&&this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,M))}parent(){if(!this.buffer)return this.yieldNode(this.mode&og.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&og.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));let{buffer:e}=this.buffer,M=this.stack.length-1;if(t<0){let t=M<0?0:this.stack[M]+4;if(this.index!=t)return this.yieldBuf(e.findChild(t,this.index,-1,0,4))}else{let t=e.buffer[this.index+3];if(t<(M<0?e.buffer.length:e.buffer[this.stack[M]+3]))return this.yieldBuf(t)}return M<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,M,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let t=0;t<this.index;t++)if(i.buffer.buffer[t+3]<this.index)return!1;({index:e,parent:M}=i)}else({index:e,_parent:M}=this._tree);for(;M;({index:e,_parent:M}=M))if(e>-1)for(let i=e+t,N=t<0?-1:M._tree.children.length;i!=N;i+=t){let t=M._tree.children[i];if(this.mode&og.IncludeAnonymous||t instanceof rg||!t.type.isAnonymous||yg(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,M=0;if(t&&t.context==this.buffer)t:for(let i=this.index,N=this.stack.length;N>=0;){for(let o=t;o;o=o._parent)if(o.index==i){if(i==this.index)return o;e=o,M=N+1;break t}i=this.stack[--N]}for(let t=M;t<this.stack.length;t++)e=new zg(this.buffer,e,this.stack[t]);return this.bufferNode=new zg(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let M=0;;){let i=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){M++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&e&&e(this),i=this.type.isAnonymous,!M)return;if(this.nextSibling())break;this.parent(),M--,i=!0}}}matchContext(t){if(!this.buffer)return jg(this.node.parent,t);let{buffer:e}=this.buffer,{types:M}=e.set;for(let i=t.length-1,N=this.stack.length-1;i>=0;N--){if(N<0)return jg(this._tree,t,i);let o=M[e.buffer[this.stack[N]]];if(!o.isAnonymous){if(t[i]&&t[i]!=o.name)return!1;i--}}return!0}}function yg(t){return t.children.some((t=>t instanceof rg||!t.type.isAnonymous||yg(t)))}const dg=new WeakMap;function Ag(t,e){if(!t.isAnonymous||e instanceof rg||e.type!=t)return 1;let M=dg.get(e);if(null==M){M=1;for(let i of e.children){if(i.type!=t||!(i instanceof ng)){M=1;break}M+=Ag(t,i)}dg.set(e,M)}return M}function hg(t,e,M,i,N,o,n,s,r){let D=0;for(let M=i;M<N;M++)D+=Ag(t,e[M]);let a=Math.ceil(1.5*D/8),l=[],u=[];return function e(M,i,N,n,s){for(let D=N;D<n;){let N=D,g=i[D],j=Ag(t,M[D]);for(D++;D<n;D++){let e=Ag(t,M[D]);if(j+e>=a)break;j+=e}if(D==N+1){if(j>a){let t=M[N];e(t.children,t.positions,0,t.children.length,i[N]+s);continue}l.push(M[N])}else{let e=i[D-1]+M[D-1].length-g;l.push(hg(t,M,i,N,D,g,e,null,r))}u.push(g+s-o)}}(e,M,i,N,0),(s||r)(l,u,n)}class Lg{constructor(){this.map=new WeakMap}setBuffer(t,e,M){let i=this.map.get(t);i||this.map.set(t,i=new Map),i.set(e,M)}getBuffer(t,e){let M=this.map.get(t);return M&&M.get(e)}set(t,e){t instanceof zg?this.setBuffer(t.context.buffer,t.index,e):t instanceof ug&&this.map.set(t.tree,e)}get(t){return t instanceof zg?this.getBuffer(t.context.buffer,t.index):t instanceof ug?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class xg{constructor(t,e,M,i,N=!1,o=!1){this.from=t,this.to=e,this.tree=M,this.offset=i,this.open=(N?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],M=!1){let i=[new xg(0,t.length,t,0,!1,M)];for(let M of e)M.to>t.length&&i.push(M);return i}static applyChanges(t,e,M=128){if(!e.length)return t;let i=[],N=1,o=t.length?t[0]:null;for(let n=0,s=0,r=0;;n++){let D=n<e.length?e[n]:null,a=D?D.fromA:1e9;if(a-s>=M)for(;o&&o.from<a;){let e=o;if(s>=e.from||a<=e.to||r){let t=Math.max(e.from,s)-r,M=Math.min(e.to,a)-r;e=t>=M?null:new xg(t,M,e.tree,e.offset+r,n>0,!!D)}if(e&&i.push(e),o.to>a)break;o=N<t.length?t[N++]:null}if(!D)break;s=D.toA,r=D.toA-D.toB}return i}}class pg{startParse(t,e,M){return"string"==typeof t&&(t=new Sg(t)),M=M?M.length?M.map((t=>new $u(t.from,t.to))):[new $u(0,0)]:[new $u(0,t.length)],this.createParse(t,e||[],M)}parse(t,e,M){let i=this.startParse(t,e,M);for(;;){let t=i.advance();if(t)return t}}}class Sg{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}class Qg{constructor(t,e,M,i,N){this.parser=t,this.parse=e,this.overlay=M,this.target=i,this.from=N}}function Eg(t){if(!t.length||t.some((t=>t.from>=t.to)))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class kg{constructor(t,e,M,i,N,o,n){this.parser=t,this.predicate=e,this.mounts=M,this.index=i,this.start=N,this.target=o,this.prev=n,this.depth=0,this.ranges=[]}}const wg=new qu({perNode:!0});class mg{constructor(t,e,M,i,N){this.nest=e,this.input=M,this.fragments=i,this.ranges=N,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return null!=this.stoppedAt&&(t=new ng(t.type,t.children,t.positions,t.length,t.propValues.concat([[wg,this.stoppedAt]]))),t}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let M=Object.assign(Object.create(null),t.target.props);M[qu.mounted.id]=new Ku(e,t.overlay,t.parser),t.target.props=M}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].from<t&&(t=Math.min(t,this.inner[e].parse.parsedPos));return t}stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].parse.stopAt(t)}startInner(){let t=new fg(this.fragments),e=null,M=null,i=new Og(new ug(this.baseTree,this.ranges[0].from,0,null),og.IncludeAnonymous|og.IgnoreMounts);t:for(let N,o;;){let n,s=!0;if(null!=this.stoppedAt&&i.from>=this.stoppedAt)s=!1;else if(t.hasNode(i)){if(e){let t=e.mounts.find((t=>t.frag.from<=i.from&&t.frag.to>=i.to&&t.mount.overlay));if(t)for(let M of t.mount.overlay){let N=M.from+t.pos,o=M.to+t.pos;N>=i.from&&o<=i.to&&!e.ranges.some((t=>t.from<o&&t.to>N))&&e.ranges.push({from:N,to:o})}}s=!1}else if(M&&(o=Ug(M.ranges,i.from,i.to)))s=2!=o;else if(!i.type.isAnonymous&&(N=this.nest(i,this.input))&&(i.from<i.to||!N.overlay)){i.tree||Yg(i);let o=t.findMounts(i.from,N.parser);if("function"==typeof N.overlay)e=new kg(N.parser,N.overlay,o,this.inner.length,i.from,i.tree,e);else{let t=vg(this.ranges,N.overlay||(i.from<i.to?[new $u(i.from,i.to)]:[]));t.length&&Eg(t),!t.length&&N.overlay||this.inner.push(new Qg(N.parser,t.length?N.parser.startParse(this.input,Vg(o,t),t):N.parser.startParse(""),N.overlay?N.overlay.map((t=>new $u(t.from-i.from,t.to-i.from))):null,i.tree,t.length?t[0].from:i.from)),N.overlay?t.length&&(M={ranges:t,depth:0,prev:M}):s=!1}}else if(e&&(n=e.predicate(i))&&(!0===n&&(n=new $u(i.from,i.to)),n.from<n.to)){let t=e.ranges.length-1;t>=0&&e.ranges[t].to==n.from?e.ranges[t]={from:e.ranges[t].from,to:n.to}:e.ranges.push(n)}if(s&&i.firstChild())e&&e.depth++,M&&M.depth++;else for(;!i.nextSibling();){if(!i.parent())break t;if(e&&! --e.depth){let t=vg(this.ranges,e.ranges);t.length&&(Eg(t),this.inner.splice(e.index,0,new Qg(e.parser,e.parser.startParse(this.input,Vg(e.mounts,t),t),e.ranges.map((t=>new $u(t.from-e.start,t.to-e.start))),e.target,t[0].from))),e=e.prev}M&&! --M.depth&&(M=M.prev)}}}}function Ug(t,e,M){for(let i of t){if(i.from>=M)break;if(i.to>e)return i.from<=e&&i.to>=M?2:1}return 0}function Cg(t,e,M,i,N,o){if(e<M){let n=t.buffer[e+1];i.push(t.slice(e,M,n)),N.push(n-o)}}function Yg(t){let{node:e}=t,M=[],i=e.context.buffer;do{M.push(t.index),t.parent()}while(!t.tree);let N=t.tree,o=N.children.indexOf(i),n=N.children[o],s=n.buffer,r=[o];N.children[o]=function t(i,N,o,D,a,l){let u=M[l],g=[],j=[];Cg(n,i,u,g,j,D);let c=s[u+1],z=s[u+2];r.push(g.length);let I=l?t(u+4,s[u+3],n.set.types[s[u]],c,z-c,l-1):e.toTree();return g.push(I),j.push(c-D),Cg(n,s[u+3],N,g,j,D),new ng(o,g,j,a)}(0,s.length,eg.none,0,n.length,M.length-1);for(let e of r){let M=t.tree.children[e],i=t.tree.positions[e];t.yield(new ug(M,i+t.from,e,t._tree))}}class bg{constructor(t,e){this.offset=e,this.done=!1,this.cursor=t.cursor(og.IncludeAnonymous|og.IgnoreMounts)}moveTo(t){let{cursor:e}=this,M=t-this.offset;for(;!this.done&&e.from<M;)e.to>=t&&e.enter(M,1,og.IgnoreOverlays|og.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(!(e.children.length&&0==e.positions[0]&&e.children[0]instanceof ng))break;e=e.children[0]}return!1}}let fg=class{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let M=this.curFrag=t[0];this.curTo=null!==(e=M.tree.prop(wg))&&void 0!==e?e:M.to,this.inner=new bg(M.tree,-M.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=e.tree.prop(wg))&&void 0!==t?t:e.to,this.inner=new bg(e.tree,-e.offset)}}findMounts(t,e){var M;let i=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let t=this.inner.cursor.node;t;t=t.parent){let N=null===(M=t.tree)||void 0===M?void 0:M.prop(qu.mounted);if(N&&N.parser==e)for(let e=this.fragI;e<this.fragments.length;e++){let M=this.fragments[e];if(M.from>=t.to)break;M.tree==this.curFrag.tree&&i.push({frag:M,pos:t.from-M.offset,mount:N})}}}return i}};function vg(t,e){let M=null,i=e;for(let N=1,o=0;N<t.length;N++){let n=t[N-1].to,s=t[N].from;for(;o<i.length;o++){let t=i[o];if(t.from>=s)break;t.to<=n||(M||(i=M=e.slice()),t.from<n?(M[o]=new $u(t.from,n),t.to>s&&M.splice(o+1,0,new $u(s,t.to))):t.to>s?M[o--]=new $u(s,t.to):M.splice(o--,1))}}return i}function Zg(t,e,M,i){let N=0,o=0,n=!1,s=!1,r=-1e9,D=[];for(;;){let a=N==t.length?1e9:n?t[N].to:t[N].from,l=o==e.length?1e9:s?e[o].to:e[o].from;if(n!=s){let t=Math.max(r,M),e=Math.min(a,l,i);t<e&&D.push(new $u(t,e))}if(r=Math.min(a,l),1e9==r)break;a==r&&(n?(n=!1,N++):n=!0),l==r&&(s?(s=!1,o++):s=!0)}return D}function Vg(t,e){let M=[];for(let{pos:i,mount:N,frag:o}of t){let t=i+(N.overlay?N.overlay[0].from:0),n=t+N.tree.length,s=Math.max(o.from,t),r=Math.min(o.to,n);if(N.overlay){let n=N.overlay.map((t=>new $u(t.from+i,t.to+i))),D=Zg(e,n,s,r);for(let e=0,i=s;;e++){let n=e==D.length,s=n?r:D[e].from;if(s>i&&M.push(new xg(i,s,N.tree,-t,o.from>=i||o.openStart,o.to<=s||o.openEnd)),n)break;i=D[e].to}}else M.push(new xg(s,r,N.tree,-t,o.from>=t||o.openStart,o.to<=n||o.openEnd))}return M}let Wg=0;class Pg{constructor(t,e,M,i){this.name=t,this.set=e,this.base=M,this.modified=i,this.id=Wg++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let M="string"==typeof t?t:"?";if(t instanceof Pg&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let i=new Pg(M,[],null,[]);if(i.set.push(i),e)for(let t of e.set)i.set.push(t);return i}static defineModifier(t){let e=new Gg(t);return t=>t.modified.indexOf(e)>-1?t:Gg.get(t.base||t,t.modified.concat(e).sort(((t,e)=>t.id-e.id)))}}let Rg=0;class Gg{constructor(t){this.name=t,this.instances=[],this.id=Rg++}static get(t,e){if(!e.length)return t;let M=e[0].instances.find((M=>M.base==t&&function(t,e){return t.length==e.length&&t.every(((t,M)=>t==e[M]))}(e,M.modified)));if(M)return M;let i=[],N=new Pg(t.name,i,t,e);for(let t of e)t.instances.push(N);let o=function(t){let e=[[]];for(let M=0;M<t.length;M++)for(let i=0,N=e.length;i<N;i++)e.push(e[i].concat(t[M]));return e.sort(((t,e)=>e.length-t.length))}(e);for(let e of t.set)if(!e.modified.length)for(let t of o)i.push(Gg.get(e,t));return N}}function Bg(t){let e=Object.create(null);for(let M in t){let i=t[M];Array.isArray(i)||(i=[i]);for(let t of M.split(" "))if(t){let M=[],N=2,o=t;for(let e=0;;){if("..."==o&&e>0&&e+3==t.length){N=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw new RangeError("Invalid path: "+t);if(M.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),e+=i[0].length,e==t.length)break;let n=t[e++];if(e==t.length&&"!"==n){N=0;break}if("/"!=n)throw new RangeError("Invalid path: "+t);o=t.slice(e)}let n=M.length-1,s=M[n];if(!s)throw new RangeError("Invalid path: "+t);let r=new Fg(i,N,n>0?M.slice(0,n):null);e[s]=r.sort(e[s])}}return _g.add(e)}const _g=new qu;class Fg{constructor(t,e,M,i){this.tags=t,this.mode=e,this.context=M,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}function Jg(t,e){let M=Object.create(null);for(let e of t)if(Array.isArray(e.tag))for(let t of e.tag)M[t.id]=e.class;else M[e.tag.id]=e.class;let{scope:i,all:N=null}=e||{};return{style:t=>{let e=N;for(let i of t)for(let t of i.set){let i=M[t.id];if(i){e=e?e+" "+i:i;break}}return e},scope:i}}function Hg(t,e,M,i=0,N=t.length){let o=new Xg(i,Array.isArray(e)?e:[e],M);o.highlightRange(t.cursor(),i,N,"",o.highlighters),o.flush(N)}Fg.empty=new Fg([],2,null);class Xg{constructor(t,e,M){this.at=t,this.highlighters=e,this.span=M,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,M,i,N){let{type:o,from:n,to:s}=t;if(n>=M||s<=e)return;o.isTop&&(N=this.highlighters.filter((t=>!t.scope||t.scope(o))));let r=i,D=function(t){let e=t.type.prop(_g);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||Fg.empty,a=function(t,e){let M=null;for(let i of t){let t=i.style(e);t&&(M=M?M+" "+t:t)}return M}(N,D.tags);if(a&&(r&&(r+=" "),r+=a,1==D.mode&&(i+=(i?" ":"")+a)),this.startSpan(Math.max(e,n),r),D.opaque)return;let l=t.tree&&t.tree.prop(qu.mounted);if(l&&l.overlay){let o=t.node.enter(l.overlay[0].from+n,1),D=this.highlighters.filter((t=>!t.scope||t.scope(l.tree.type))),a=t.firstChild();for(let u=0,g=n;;u++){let j=u<l.overlay.length?l.overlay[u]:null,c=j?j.from+n:s,z=Math.max(e,g),I=Math.min(M,c);if(z<I&&a)for(;t.from<I&&(this.highlightRange(t,z,I,i,N),this.startSpan(Math.min(I,t.to),r),!(t.to>=c)&&t.nextSibling()););if(!j||c>M)break;g=j.to+n,g>e&&(this.highlightRange(o.cursor(),Math.max(e,j.from+n),Math.min(M,g),"",D),this.startSpan(Math.min(M,g),r))}a&&t.parent()}else if(t.firstChild()){l&&(i="");do{if(!(t.to<=e)){if(t.from>=M)break;this.highlightRange(t,e,M,i,N),this.startSpan(Math.min(M,t.to),r)}}while(t.nextSibling());t.parent()}}}const $g=Pg.define,qg=$g(),Kg=$g(),tj=$g(Kg),ej=$g(Kg),Mj=$g(),ij=$g(Mj),Nj=$g(Mj),oj=$g(),nj=$g(oj),sj=$g(),rj=$g(),Dj=$g(),aj=$g(Dj),lj=$g(),uj={comment:qg,lineComment:$g(qg),blockComment:$g(qg),docComment:$g(qg),name:Kg,variableName:$g(Kg),typeName:tj,tagName:$g(tj),propertyName:ej,attributeName:$g(ej),className:$g(Kg),labelName:$g(Kg),namespace:$g(Kg),macroName:$g(Kg),literal:Mj,string:ij,docString:$g(ij),character:$g(ij),attributeValue:$g(ij),number:Nj,integer:$g(Nj),float:$g(Nj),bool:$g(Mj),regexp:$g(Mj),escape:$g(Mj),color:$g(Mj),url:$g(Mj),keyword:sj,self:$g(sj),null:$g(sj),atom:$g(sj),unit:$g(sj),modifier:$g(sj),operatorKeyword:$g(sj),controlKeyword:$g(sj),definitionKeyword:$g(sj),moduleKeyword:$g(sj),operator:rj,derefOperator:$g(rj),arithmeticOperator:$g(rj),logicOperator:$g(rj),bitwiseOperator:$g(rj),compareOperator:$g(rj),updateOperator:$g(rj),definitionOperator:$g(rj),typeOperator:$g(rj),controlOperator:$g(rj),punctuation:Dj,separator:$g(Dj),bracket:aj,angleBracket:$g(aj),squareBracket:$g(aj),paren:$g(aj),brace:$g(aj),content:oj,heading:nj,heading1:$g(nj),heading2:$g(nj),heading3:$g(nj),heading4:$g(nj),heading5:$g(nj),heading6:$g(nj),contentSeparator:$g(oj),list:$g(oj),quote:$g(oj),emphasis:$g(oj),strong:$g(oj),link:$g(oj),monospace:$g(oj),strikethrough:$g(oj),inserted:$g(),deleted:$g(),changed:$g(),invalid:$g(),meta:lj,documentMeta:$g(lj),annotation:$g(lj),processingInstruction:$g(lj),definition:Pg.defineModifier("definition"),constant:Pg.defineModifier("constant"),function:Pg.defineModifier("function"),standard:Pg.defineModifier("standard"),local:Pg.defineModifier("local"),special:Pg.defineModifier("special")};for(let t in uj){let e=uj[t];e instanceof Pg&&(e.name=t)}var gj;Jg([{tag:uj.link,class:"tok-link"},{tag:uj.heading,class:"tok-heading"},{tag:uj.emphasis,class:"tok-emphasis"},{tag:uj.strong,class:"tok-strong"},{tag:uj.keyword,class:"tok-keyword"},{tag:uj.atom,class:"tok-atom"},{tag:uj.bool,class:"tok-bool"},{tag:uj.url,class:"tok-url"},{tag:uj.labelName,class:"tok-labelName"},{tag:uj.inserted,class:"tok-inserted"},{tag:uj.deleted,class:"tok-deleted"},{tag:uj.literal,class:"tok-literal"},{tag:uj.string,class:"tok-string"},{tag:uj.number,class:"tok-number"},{tag:[uj.regexp,uj.escape,uj.special(uj.string)],class:"tok-string2"},{tag:uj.variableName,class:"tok-variableName"},{tag:uj.local(uj.variableName),class:"tok-variableName tok-local"},{tag:uj.definition(uj.variableName),class:"tok-variableName tok-definition"},{tag:uj.special(uj.variableName),class:"tok-variableName2"},{tag:uj.definition(uj.propertyName),class:"tok-propertyName tok-definition"},{tag:uj.typeName,class:"tok-typeName"},{tag:uj.namespace,class:"tok-namespace"},{tag:uj.className,class:"tok-className"},{tag:uj.macroName,class:"tok-macroName"},{tag:uj.propertyName,class:"tok-propertyName"},{tag:uj.operator,class:"tok-operator"},{tag:uj.comment,class:"tok-comment"},{tag:uj.meta,class:"tok-meta"},{tag:uj.invalid,class:"tok-invalid"},{tag:uj.punctuation,class:"tok-punctuation"}]);const jj=new qu;function cj(t){return Ro.define({combine:t?e=>e.concat(t):void 0})}const zj=new qu;class Ij{constructor(t,e,M=[],i=""){this.data=t,this.name=i,mn.prototype.hasOwnProperty("tree")||Object.defineProperty(mn.prototype,"tree",{get(){return yj(this)}}),this.parser=e,this.extension=[Ej.of(this),mn.languageData.of(((t,e,M)=>{let i=Tj(t,e,M),N=i.type.prop(jj);if(!N)return[];let o=t.facet(N),n=i.type.prop(zj);if(n){let N=i.resolve(e-i.from,M);for(let e of n)if(e.test(N,t)){let M=t.facet(e.facet);return"replace"==e.type?M:M.concat(o)}}return o}))].concat(M)}isActiveAt(t,e,M=-1){return Tj(t,e,M).type.prop(jj)==this.data}findRegions(t){let e=t.facet(Ej);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let M=[],i=(t,e)=>{if(t.prop(jj)==this.data)return void M.push({from:e,to:e+t.length});let N=t.prop(qu.mounted);if(N){if(N.tree.prop(jj)==this.data){if(N.overlay)for(let t of N.overlay)M.push({from:t.from+e,to:t.to+e});else M.push({from:e,to:e+t.length});return}if(N.overlay){let t=M.length;if(i(N.tree,N.overlay[0].from+e),M.length>t)return}}for(let M=0;M<t.children.length;M++){let N=t.children[M];N instanceof ng&&i(N,t.positions[M]+e)}};return i(yj(t),0),M}get allowsNesting(){return!0}}function Tj(t,e,M){let i=t.facet(Ej),N=yj(t).topNode;if(!i||i.allowsNesting)for(let t=N;t;t=t.enter(e,M,og.ExcludeBuffers))t.type.isTop&&(N=t);return N}Ij.setState=yn.define();class Oj extends Ij{constructor(t,e,M){super(t,e,[],M),this.parser=e}static define(t){let e=cj(t.languageData);return new Oj(e,t.parser.configure({props:[jj.add((t=>t.isTop?e:void 0))]}),t.name)}configure(t,e){return new Oj(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function yj(t){let e=t.field(Ij.state,!1);return e?e.tree:ng.empty}class dj{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let M=this.cursorPos-this.string.length;return t<M||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-M,e-M)}}let Aj=null;class hj{constructor(t,e,M=[],i,N,o,n,s){this.parser=t,this.state=e,this.fragments=M,this.tree=i,this.treeLen=N,this.viewport=o,this.skipped=n,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,e,M){return new hj(t,e,[],ng.empty,0,M,[],null)}startParse(){return this.parser.startParse(new dj(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=ng.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var M;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(xg.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(M=this.parse.stoppedAt)&&void 0!==M?M:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}}))}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(xg.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=Aj;Aj=this;try{return t()}finally{Aj=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Lj(t,e.from,e.to);return t}changes(t,e){let{fragments:M,tree:i,treeLen:N,viewport:o,skipped:n}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,M,i,N)=>e.push({fromA:t,toA:M,fromB:i,toB:N}))),M=xg.applyChanges(M,e),i=ng.empty,N=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){n=[];for(let e of this.skipped){let M=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);M<i&&n.push({from:M,to:i})}}}return new hj(this.parser,e,M,i,N,o,n,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:M,to:i}=this.skipped[e];M<t.to&&i>t.from&&(this.fragments=Lj(this.fragments,M,i),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends pg{createParse(e,M,i){let N=i[0].from,o=i[i.length-1].to,n={parsedPos:N,advance(){let e=Aj;if(e){for(let t of i)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new ng(eg.none,[],[],o-N)},stoppedAt:null,stopAt(){}};return n}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return Aj}}function Lj(t,e,M){return xg.applyChanges(t,[{fromA:e,toA:M,fromB:e,toB:M}])}class xj{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),M=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,M)||e.takeTree(),new xj(e)}static init(t){let e=Math.min(3e3,t.doc.length),M=hj.create(t.facet(Ej).parser,t,{from:0,to:e});return M.work(20,e)||M.takeTree(),new xj(M)}}Ij.state=Xo.define({create:xj.init,update(t,e){for(let t of e.effects)if(t.is(Ij.setState))return t.value;return e.startState.facet(Ej)!=e.state.facet(Ej)?xj.init(e.state):t.apply(e)}});let pj=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(pj=t=>{let e=-1,M=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(M):cancelIdleCallback(e)});const Sj="undefined"!=typeof navigator&&(null===(gj=navigator.scheduling)||void 0===gj?void 0:gj.isInputPending)?()=>navigator.scheduling.isInputPending():null,Qj=sD.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Ij.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Ij.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=pj(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:M,viewport:{to:i}}=this.view,N=M.field(Ij.state);if(N.tree==N.context.tree&&N.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!Sj?Math.max(25,t.timeRemaining()-5):1e9),n=N.context.treeLen<i&&M.doc.length>i+1e3,s=N.context.work((()=>Sj&&Sj()||Date.now()>o),i+(n?0:1e5));this.chunkBudget-=Date.now()-e,(s||this.chunkBudget<=0)&&(N.context.takeTree(),this.view.dispatch({effects:Ij.setState.of(new xj(N.context))})),this.chunkBudget>0&&(!s||n)&&this.scheduleWork(),this.checkAsyncSchedule(N.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>iD(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ej=Ro.define({combine:t=>t.length?t[0]:null,enables:t=>[Ij.state,Qj,nl.contentAttributes.compute([t],(e=>{let M=e.facet(t);return M&&M.name?{"data-language":M.name}:{}}))]});class kj{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const wj=Ro.define(),mj=Ro.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Uj(t){let e=t.facet(mj);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function Cj(t,e){let M="",i=t.tabSize,N=t.facet(mj)[0];if("\t"==N){for(;e>=i;)M+="\t",e-=i;N=" "}for(let t=0;t<e;t++)M+=N;return M}function Yj(t,e){t instanceof mn&&(t=new bj(t));for(let M of t.state.facet(wj)){let i=M(t,e);if(void 0!==i)return i}let M=yj(t.state);return M.length>=e?function(t,e,M){let i=e.resolveStack(M),N=e.resolveInner(M,-1).resolve(M,0).enterUnfinishedNodesBefore(M);if(N!=i.node){let t=[];for(let e=N;e&&(e.from!=i.node.from||e.type!=i.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)i={node:t[e],next:i}}return vj(i,t,M)}(t,M,e):null}class bj{constructor(t,e={}){this.state=t,this.options=e,this.unit=Uj(t)}lineAt(t,e=1){let M=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:N}=this.options;return null!=i&&i>=M.from&&i<=M.to?N&&i==t?{text:"",from:t}:(e<0?i<t:i<=t)?{text:M.text.slice(i-M.from),from:i}:{text:M.text.slice(0,i-M.from),from:M.from}:M}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:M,from:i}=this.lineAt(t,e);return M.slice(t-i,Math.min(M.length,t+100-i))}column(t,e=1){let{text:M,from:i}=this.lineAt(t,e),N=this.countColumn(M,t-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(N+=o-this.countColumn(M,M.search(/\S|$/))),N}countColumn(t,e=t.length){return Xn(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:M,from:i}=this.lineAt(t,e),N=this.options.overrideIndentation;if(N){let t=N(i);if(t>-1)return t}return this.countColumn(M,M.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const fj=new qu;function vj(t,e,M){for(let i=t;i;i=i.next){let t=Zj(i.node);if(t)return t(Wj.create(e,M,i))}return 0}function Zj(t){let e=t.type.prop(fj);if(e)return e;let M,i=t.firstChild;if(i&&(M=i.type.prop(qu.closedBy))){let e=t.lastChild,i=e&&M.indexOf(e.name)>-1;return t=>Gj(t,!0,1,void 0,i&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?Vj:null}function Vj(){return 0}class Wj extends bj{constructor(t,e,M){super(t.state,t.options),this.base=t,this.pos=e,this.context=M}get node(){return this.context.node}static create(t,e,M){return new Wj(t,e,M)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let M=t.resolve(e.from);for(;M.parent&&M.parent.from==M.from;)M=M.parent;if(Pj(M,t))break;e=this.state.doc.lineAt(M.from)}return this.lineIndent(e.from)}continue(){return vj(this.context.next,this.base,this.pos)}}function Pj(t,e){for(let M=e;M;M=M.parent)if(t==M)return!0;return!1}function Rj({closing:t,align:e=!0,units:M=1}){return i=>Gj(i,e,M,t)}function Gj(t,e,M,i,N){let o=t.textAfter,n=o.match(/^\s*/)[0].length,s=i&&o.slice(n,n+i.length)==i||N==t.pos+n,r=e?function(t){let e=t.node,M=e.childAfter(e.from),i=e.lastChild;if(!M)return null;let N=t.options.simulateBreak,o=t.state.doc.lineAt(M.from),n=null==N||N<=o.from?o.to:Math.min(o.to,N);for(let t=M.to;;){let N=e.childAfter(t);if(!N||N==i)return null;if(!N.type.isSkipped){if(N.from>=n)return null;let t=/^ */.exec(o.text.slice(M.to-o.from))[0].length;return{from:M.from,to:M.to+t}}t=N.to}}(t):null;return r?s?t.column(r.from):t.column(r.to):t.baseIndent+(s?0:t.unit*M)}const Bj=t=>t.baseIndent;function _j({except:t,units:e=1}={}){return M=>{let i=t&&t.test(M.textAfter);return M.baseIndent+(i?0:e*M.unit)}}const Fj=Ro.define(),Jj=new qu;function Hj(t){let e=t.firstChild,M=t.lastChild;return e&&e.to<M.from?{from:e.to,to:M.type.isError?t.to:M.from}:null}function Xj(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function $j(t,e,M){for(let i of t.facet(Fj)){let N=i(t,e,M);if(N)return N}return function(t,e,M){let i=yj(t);if(i.length<M)return null;let N=null;for(let o=i.resolveStack(M,1);o;o=o.next){let n=o.node;if(n.to<=M||n.from>M)continue;if(N&&n.from<e)break;let s=n.type.prop(Jj);if(s&&(n.to<i.length-50||i.length==t.doc.length||!Xj(n))){let i=s(n,t);i&&i.from<=M&&i.from>=e&&i.to>M&&(N=i)}}return N}(t,e,M)}function qj(t,e){let M=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return M>=i?void 0:{from:M,to:i}}const Kj=yn.define({map:qj}),tc=yn.define({map:qj});function ec(t){let e=[];for(let{head:M}of t.state.selection.ranges)e.some((t=>t.from<=M&&t.to>=M))||e.push(t.lineBlockAt(M));return e}const Mc=Xo.define({create:()=>lr.none,update(t,e){t=t.map(e.changes);for(let M of e.effects)if(M.is(Kj)&&!Nc(t,M.value.from,M.value.to)){let{preparePlaceholder:i}=e.state.facet(Dc),N=i?lr.replace({widget:new gc(i(e.state,M.value))}):uc;t=t.update({add:[N.range(M.value.from,M.value.to)]})}else M.is(tc)&&(t=t.update({filter:(t,e)=>M.value.from!=t||M.value.to!=e,filterFrom:M.value.from,filterTo:M.value.to}));if(e.selection){let M=!1,{head:i}=e.selection.main;t.between(i,i,((t,e)=>{t<i&&e>i&&(M=!0)})),M&&(t=t.update({filterFrom:i,filterTo:i,filter:(t,e)=>e<=i||t>=i}))}return t},provide:t=>nl.decorations.from(t),toJSON(t,e){let M=[];return t.between(0,e.doc.length,((t,e)=>{M.push(t,e)})),M},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let M=0;M<t.length;){let i=t[M++],N=t[M++];if("number"!=typeof i||"number"!=typeof N)throw new RangeError("Invalid JSON for fold state");e.push(uc.range(i,N))}return lr.set(e,!0)}});function ic(t,e,M){var i;let N=null;return null===(i=t.field(Mc,!1))||void 0===i||i.between(e,M,((t,e)=>{(!N||N.from>t)&&(N={from:t,to:e})})),N}function Nc(t,e,M){let i=!1;return t.between(e,e,((t,N)=>{t==e&&N==M&&(i=!0)})),i}function oc(t,e){return t.field(Mc,!1)?e:e.concat(yn.appendConfig.of(ac()))}function nc(t,e,M=!0){let i=t.state.doc.lineAt(e.from).number,N=t.state.doc.lineAt(e.to).number;return nl.announce.of(`${t.state.phrase(M?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${N}.`)}const sc=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of ec(t)){let M=$j(t.state,e.from,e.to);if(M)return t.dispatch({effects:oc(t.state,[Kj.of(M),nc(t,M)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(Mc,!1))return!1;let e=[];for(let M of ec(t)){let i=ic(t.state,M.from,M.to);i&&e.push(tc.of(i),nc(t,i,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,M=[];for(let i=0;i<e.doc.length;){let N=t.lineBlockAt(i),o=$j(e,N.from,N.to);o&&M.push(Kj.of(o)),i=(o?t.lineBlockAt(o.to):N).to+1}return M.length&&t.dispatch({effects:oc(t.state,M)}),!!M.length}},{key:"Ctrl-Alt-]",run:t=>{let e=t.state.field(Mc,!1);if(!e||!e.size)return!1;let M=[];return e.between(0,t.state.doc.length,((t,e)=>{M.push(tc.of({from:t,to:e}))})),t.dispatch({effects:M}),!0}}],rc={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Dc=Ro.define({combine:t=>Un(t,rc)});function ac(t){let e=[Mc,zc];return t&&e.push(Dc.of(t)),e}function lc(t,e){let{state:M}=t,i=M.facet(Dc),N=e=>{let M=t.lineBlockAt(t.posAtDOM(e.target)),i=ic(t.state,M.from,M.to);i&&t.dispatch({effects:tc.of(i)}),e.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,N,e);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",M.phrase("folded code")),o.title=M.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=N,o}const uc=lr.replace({widget:new class extends Dr{toDOM(t){return lc(t,null)}}});class gc extends Dr{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return lc(t,this.value)}}const jc={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class cc extends pu{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}const zc=nl.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Ic{constructor(t,e){let M;function i(t){let e=es.newName();return(M||(M=Object.create(null)))["."+e]=t,e}this.specs=t;const N="string"==typeof e.all?e.all:e.all?i(e.all):void 0,o=e.scope;this.scope=o instanceof Ij?t=>t.prop(jj)==o.data:o?t=>t==o:void 0,this.style=Jg(t.map((t=>({tag:t.tag,class:t.class||i(Object.assign({},t,{tag:null}))}))),{all:N}).style,this.module=M?new es(M):null,this.themeType=e.themeType}static define(t,e){return new Ic(t,e||{})}}const Tc=Ro.define(),Oc=Ro.define({combine:t=>t.length?[t[0]]:null});function yc(t){let e=t.facet(Tc);return e.length?e:t.facet(Oc)}class dc{constructor(t){this.markCache=Object.create(null),this.tree=yj(t.state),this.decorations=this.buildDeco(t,yc(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=yj(t.state),M=yc(t.state),i=M!=yc(t.startState),{viewport:N}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<N.to&&!i&&e.type==this.tree.type&&o>=N.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||i)&&(this.tree=e,this.decorations=this.buildDeco(t.view,M),this.decoratedTo=N.to)}buildDeco(t,e){if(!e||!this.tree.length)return lr.none;let M=new Zn;for(let{from:i,to:N}of t.visibleRanges)Hg(this.tree,e,((t,e,i)=>{M.add(t,e,this.markCache[i]||(this.markCache[i]=lr.mark({class:i})))}),i,N);return M.finish()}}const Ac=Mn.high(sD.fromClass(dc,{decorations:t=>t.decorations})),hc=Ic.define([{tag:uj.meta,color:"#404740"},{tag:uj.link,textDecoration:"underline"},{tag:uj.heading,textDecoration:"underline",fontWeight:"bold"},{tag:uj.emphasis,fontStyle:"italic"},{tag:uj.strong,fontWeight:"bold"},{tag:uj.strikethrough,textDecoration:"line-through"},{tag:uj.keyword,color:"#708"},{tag:[uj.atom,uj.bool,uj.url,uj.contentSeparator,uj.labelName],color:"#219"},{tag:[uj.literal,uj.inserted],color:"#164"},{tag:[uj.string,uj.deleted],color:"#a11"},{tag:[uj.regexp,uj.escape,uj.special(uj.string)],color:"#e40"},{tag:uj.definition(uj.variableName),color:"#00f"},{tag:uj.local(uj.variableName),color:"#30a"},{tag:[uj.typeName,uj.namespace],color:"#085"},{tag:uj.className,color:"#167"},{tag:[uj.special(uj.variableName),uj.macroName],color:"#256"},{tag:uj.definition(uj.propertyName),color:"#00c"},{tag:uj.comment,color:"#940"},{tag:uj.invalid,color:"#f00"}]),Lc=nl.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),xc="()[]{}",pc=Ro.define({combine:t=>Un(t,{afterCursor:!0,brackets:xc,maxScanDistance:1e4,renderMatch:Ec})}),Sc=lr.mark({class:"cm-matchingBracket"}),Qc=lr.mark({class:"cm-nonmatchingBracket"});function Ec(t){let e=[],M=t.matched?Sc:Qc;return e.push(M.range(t.start.from,t.start.to)),t.end&&e.push(M.range(t.end.from,t.end.to)),e}const kc=Xo.define({create:()=>lr.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let M=[],i=e.state.facet(pc);for(let t of e.state.selection.ranges){if(!t.empty)continue;let N=Yc(e.state,t.head,-1,i)||t.head>0&&Yc(e.state,t.head-1,1,i)||i.afterCursor&&(Yc(e.state,t.head,1,i)||t.head<e.state.doc.length&&Yc(e.state,t.head+1,-1,i));N&&(M=M.concat(i.renderMatch(N,e.state)))}return lr.set(M,!0)},provide:t=>nl.decorations.from(t)}),wc=[kc,Lc];const mc=new qu;function Uc(t,e,M){let i=t.prop(e<0?qu.openedBy:qu.closedBy);if(i)return i;if(1==t.name.length){let i=M.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[M[i+e]]}return null}function Cc(t){let e=t.type.prop(mc);return e?e(t.node):t}function Yc(t,e,M,i={}){let N=i.maxScanDistance||1e4,o=i.brackets||xc,n=yj(t),s=n.resolveInner(e,M);for(let i=s;i;i=i.parent){let N=Uc(i.type,M,o);if(N&&i.from<i.to){let n=Cc(i);if(n&&(M>0?e>=n.from&&e<n.to:e>n.from&&e<=n.to))return bc(t,e,M,i,n,N,o)}}return function(t,e,M,i,N,o,n){let s=M<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),r=n.indexOf(s);if(r<0||r%2==0!=M>0)return null;let D={from:M<0?e-1:e,to:M>0?e+1:e},a=t.doc.iterRange(e,M>0?t.doc.length:0),l=0;for(let t=0;!a.next().done&&t<=o;){let o=a.value;M<0&&(t+=o.length);let s=e+t*M;for(let t=M>0?0:o.length-1,e=M>0?o.length:-1;t!=e;t+=M){let e=n.indexOf(o[t]);if(!(e<0||i.resolveInner(s+t,1).type!=N))if(e%2==0==M>0)l++;else{if(1==l)return{start:D,end:{from:s+t,to:s+t+1},matched:e>>1==r>>1};l--}}M>0&&(t+=o.length)}return a.done?{start:D,matched:!1}:null}(t,e,M,n,s.type,N,o)}function bc(t,e,M,i,N,o,n){let s=i.parent,r={from:N.from,to:N.to},D=0,a=null==s?void 0:s.cursor();if(a&&(M<0?a.childBefore(i.from):a.childAfter(i.to)))do{if(M<0?a.to<=i.from:a.from>=i.to){if(0==D&&o.indexOf(a.type.name)>-1&&a.from<a.to){let t=Cc(a);return{start:r,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Uc(a.type,M,n))D++;else if(Uc(a.type,-M,n)){if(0==D){let t=Cc(a);return{start:r,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}D--}}}while(M<0?a.prevSibling():a.nextSibling());return{start:r,matched:!1}}const fc=Object.create(null),vc=[eg.none],Zc=[],Vc=Object.create(null),Wc=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Wc[t]=Rc(fc,e);function Pc(t,e){Zc.indexOf(t)>-1||(Zc.push(t),console.warn(e))}function Rc(t,e){let M=[];for(let i of e.split(" ")){let e=[];for(let M of i.split(".")){let i=t[M]||uj[M];i?"function"==typeof i?e.length?e=e.map(i):Pc(M,`Modifier ${M} used at start of tag`):e.length?Pc(M,`Tag ${M} used as modifier`):e=Array.isArray(i)?i:[i]:Pc(M,`Unknown highlighting tag ${M}`)}for(let t of e)M.push(t)}if(!M.length)return 0;let i=e.replace(/ /g,"_"),N=i+" "+M.map((t=>t.id)),o=Vc[N];if(o)return o.id;let n=Vc[N]=eg.define({id:vc.length,name:i,props:[Bg({[i]:M})]});return vc.push(n),n.id}hr.RTL,hr.LTR;function Gc(t,e){return({state:M,dispatch:i})=>{if(M.readOnly)return!1;let N=t(e,M);return!!N&&(i(M.update(N)),!0)}}const Bc=Gc($c,0),_c=Gc(Xc,0),Fc=Gc(((t,e)=>Xc(t,e,function(t){let e=[];for(let M of t.selection.ranges){let i=t.doc.lineAt(M.from),N=M.to<=i.to?i:t.doc.lineAt(M.to);N.from>i.from&&N.from==M.to&&(N=M.to==i.to+1?i:t.doc.lineAt(M.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=N.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:N.to})}return e}(e))),0);function Jc(t,e){let M=t.languageDataAt("commentTokens",e);return M.length?M[0]:{}}const Hc=50;function Xc(t,e,M=e.selection.ranges){let i=M.map((t=>Jc(e,t.from).block));if(!i.every((t=>t)))return null;let N=M.map(((t,M)=>function(t,{open:e,close:M},i,N){let o,n,s=t.sliceDoc(i-Hc,i),r=t.sliceDoc(N,N+Hc),D=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(r)[0].length,l=s.length-D;if(s.slice(l-e.length,l)==e&&r.slice(a,a+M.length)==M)return{open:{pos:i-D,margin:D&&1},close:{pos:N+a,margin:a&&1}};N-i<=2*Hc?o=n=t.sliceDoc(i,N):(o=t.sliceDoc(i,i+Hc),n=t.sliceDoc(N-Hc,N));let u=/^\s*/.exec(o)[0].length,g=/\s*$/.exec(n)[0].length,j=n.length-g-M.length;return o.slice(u,u+e.length)==e&&n.slice(j,j+M.length)==M?{open:{pos:i+u+e.length,margin:/\s/.test(o.charAt(u+e.length))?1:0},close:{pos:N-g-M.length,margin:/\s/.test(n.charAt(j-1))?1:0}}:null}(e,i[M],t.from,t.to)));if(2!=t&&!N.every((t=>t)))return{changes:e.changes(M.map(((t,e)=>N[e]?[]:[{from:t.from,insert:i[e].open+" "},{from:t.to,insert:" "+i[e].close}])))};if(1!=t&&N.some((t=>t))){let t=[];for(let e,M=0;M<N.length;M++)if(e=N[M]){let N=i[M],{open:o,close:n}=e;t.push({from:o.pos-N.open.length,to:o.pos+o.margin},{from:n.pos-n.margin,to:n.pos+N.close.length})}return{changes:t}}return null}function $c(t,e,M=e.selection.ranges){let i=[],N=-1;for(let{from:t,to:o}of M){let M=i.length,n=1e9,s=Jc(e,t).line;if(s){for(let M=t;M<=o;){let r=e.doc.lineAt(M);if(r.from>N&&(t==o||o>r.from)){N=r.from;let t=/^\s*/.exec(r.text)[0].length,e=t==r.length,M=r.text.slice(t,t+s.length)==s?t:-1;t<r.text.length&&t<n&&(n=t),i.push({line:r,comment:M,token:s,indent:t,empty:e,single:!1})}M=r.to+1}if(n<1e9)for(let t=M;t<i.length;t++)i[t].indent<i[t].line.text.length&&(i[t].indent=n);i.length==M+1&&(i[M].single=!0)}}if(2!=t&&i.some((t=>t.comment<0&&(!t.empty||t.single)))){let t=[];for(let{line:e,token:M,indent:N,empty:o,single:n}of i)!n&&o||t.push({from:e.from+N,insert:M+" "});let M=e.changes(t);return{changes:M,selection:e.selection.map(M,1)}}if(1!=t&&i.some((t=>t.comment>=0))){let t=[];for(let{line:e,comment:M,token:N}of i)if(M>=0){let i=e.from+M,o=i+N.length;" "==e.text[o-e.from]&&o++,t.push({from:i,to:o})}return{changes:t}}return null}const qc=In.define(),Kc=In.define(),tz=Ro.define(),ez=Ro.define({combine:t=>Un(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(M,i)=>t(M,i)||e(M,i)})}),Mz=Xo.define({create:()=>Tz.empty,update(t,e){let M=e.state.facet(ez),i=e.annotation(qc);if(i){let N=rz.fromTransaction(e,i.selection),o=i.side,n=0==o?t.undone:t.done;return n=N?Dz(n,n.length,M.minDepth,N):gz(n,e.startState.selection),new Tz(0==o?i.rest:n,0==o?n:i.rest)}let N=e.annotation(Kc);if("full"!=N&&"before"!=N||(t=t.isolate()),!1===e.annotation(dn.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let o=rz.fromTransaction(e),n=e.annotation(dn.time),s=e.annotation(dn.userEvent);return o?t=t.addChanges(o,n,s,M,e):e.selection&&(t=t.addSelection(e.startState.selection,n,s,M.newGroupDelay)),"full"!=N&&"after"!=N||(t=t.isolate()),t},toJSON:t=>({done:t.done.map((t=>t.toJSON())),undone:t.undone.map((t=>t.toJSON()))}),fromJSON:t=>new Tz(t.done.map(rz.fromJSON),t.undone.map(rz.fromJSON))});function iz(t,e){return function({state:M,dispatch:i}){if(!e&&M.readOnly)return!1;let N=M.field(Mz,!1);if(!N)return!1;let o=N.pop(t,M,e);return!!o&&(i(o),!0)}}const Nz=iz(0,!1),oz=iz(1,!1),nz=iz(0,!0),sz=iz(1,!0);class rz{constructor(t,e,M,i,N){this.changes=t,this.effects=e,this.mapped=M,this.startSelection=i,this.selectionsAfter=N}setSelAfter(t){return new rz(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,M;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(M=this.startSelection)||void 0===M?void 0:M.toJSON(),selectionsAfter:this.selectionsAfter.map((t=>t.toJSON()))}}static fromJSON(t){return new rz(t.changes&&mo.fromJSON(t.changes),[],t.mapped&&wo.fromJSON(t.mapped),t.startSelection&&Vo.fromJSON(t.startSelection),t.selectionsAfter.map(Vo.fromJSON))}static fromTransaction(t,e){let M=lz;for(let e of t.startState.facet(tz)){let i=e(t);i.length&&(M=M.concat(i))}return!M.length&&t.changes.empty?null:new rz(t.changes.invert(t.startState.doc),M,void 0,e||t.startState.selection,lz)}static selection(t){return new rz(void 0,lz,void 0,void 0,t)}}function Dz(t,e,M,i){let N=e+1>M+20?e-M-1:0,o=t.slice(N,e);return o.push(i),o}function az(t,e){return t.length?e.length?t.concat(e):t:e}const lz=[],uz=200;function gz(t,e){if(t.length){let M=t[t.length-1],i=M.selectionsAfter.slice(Math.max(0,M.selectionsAfter.length-uz));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),Dz(t,t.length-1,1e9,M.setSelAfter(i)))}return[rz.selection([e])]}function jz(t){let e=t[t.length-1],M=t.slice();return M[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),M}function cz(t,e){if(!t.length)return t;let M=t.length,i=lz;for(;M;){let N=zz(t[M-1],e,i);if(N.changes&&!N.changes.empty||N.effects.length){let e=t.slice(0,M);return e[M-1]=N,e}e=N.mapped,M--,i=N.selectionsAfter}return i.length?[rz.selection(i)]:lz}function zz(t,e,M){let i=az(t.selectionsAfter.length?t.selectionsAfter.map((t=>t.map(e))):lz,M);if(!t.changes)return rz.selection(i);let N=t.changes.map(e),o=e.mapDesc(t.changes,!0),n=t.mapped?t.mapped.composeDesc(o):o;return new rz(N,yn.mapEffects(t.effects,e),n,t.startSelection.map(o),i)}const Iz=/^(input\.type|delete)($|\.)/;class Tz{constructor(t,e,M=0,i=void 0){this.done=t,this.undone=e,this.prevTime=M,this.prevUserEvent=i}isolate(){return this.prevTime?new Tz(this.done,this.undone):this}addChanges(t,e,M,i,N){let o=this.done,n=o[o.length-1];return o=n&&n.changes&&!n.changes.empty&&t.changes&&(!M||Iz.test(M))&&(!n.selectionsAfter.length&&e-this.prevTime<i.newGroupDelay&&i.joinToEvent(N,function(t,e){let M=[],i=!1;return t.iterChangedRanges(((t,e)=>M.push(t,e))),e.iterChangedRanges(((t,e,N,o)=>{for(let t=0;t<M.length;){let e=M[t++],n=M[t++];o>=e&&N<=n&&(i=!0)}})),i}(n.changes,t.changes))||"input.type.compose"==M)?Dz(o,o.length-1,i.minDepth,new rz(t.changes.compose(n.changes),az(yn.mapEffects(t.effects,n.changes),n.effects),n.mapped,n.startSelection,lz)):Dz(o,o.length,i.minDepth,t),new Tz(o,lz,e,M)}addSelection(t,e,M,i){let N=this.done.length?this.done[this.done.length-1].selectionsAfter:lz;return N.length>0&&e-this.prevTime<i&&M==this.prevUserEvent&&M&&/^select($|\.)/.test(M)&&function(t,e){return t.ranges.length==e.ranges.length&&0===t.ranges.filter(((t,M)=>t.empty!=e.ranges[M].empty)).length}(N[N.length-1],t)?this:new Tz(gz(this.done,t),this.undone,e,M)}addMapping(t){return new Tz(cz(this.done,t),cz(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,M){let i=0==t?this.done:this.undone;if(0==i.length)return null;let N=i[i.length-1],o=N.selectionsAfter[0]||e.selection;if(M&&N.selectionsAfter.length)return e.update({selection:N.selectionsAfter[N.selectionsAfter.length-1],annotations:qc.of({side:t,rest:jz(i),selection:o}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(N.changes){let M=1==i.length?lz:i.slice(0,i.length-1);return N.mapped&&(M=cz(M,N.mapped)),e.update({changes:N.changes,selection:N.startSelection,effects:N.effects,annotations:qc.of({side:t,rest:M,selection:o}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}Tz.empty=new Tz(lz,lz);const Oz=[{key:"Mod-z",run:Nz,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:oz,preventDefault:!0},{linux:"Ctrl-Shift-z",run:oz,preventDefault:!0},{key:"Mod-u",run:nz,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:sz,preventDefault:!0}];function yz(t,e){return Vo.create(t.ranges.map(e),t.mainIndex)}function dz(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Az({state:t,dispatch:e},M){let i=yz(t.selection,M);return!i.eq(t.selection,!0)&&(e(dz(t,i)),!0)}function hz(t,e){return Vo.cursor(e?t.to:t.from)}function Lz(t,e){return Az(t,(M=>M.empty?t.moveByChar(M,e):hz(M,e)))}function xz(t){return t.textDirectionAt(t.state.selection.main.head)==hr.LTR}const pz=t=>Lz(t,!xz(t)),Sz=t=>Lz(t,xz(t));function Qz(t,e){return Az(t,(M=>M.empty?t.moveByGroup(M,e):hz(M,e)))}function Ez(t,e,M){if(e.type.prop(M))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function kz(t,e,M){let i,N,o=yj(t).resolveInner(e.head),n=M?qu.closedBy:qu.openedBy;for(let i=e.head;;){let e=M?o.childAfter(i):o.childBefore(i);if(!e)break;Ez(t,e,n)?o=e:i=M?e.to:e.from}return N=o.type.prop(n)&&(i=M?Yc(t,o.from,1):Yc(t,o.to,-1))&&i.matched?M?i.end.to:i.end.from:M?o.to:o.from,Vo.cursor(N,M?-1:1)}function wz(t,e){return Az(t,(M=>{if(!M.empty)return hz(M,e);let i=t.moveVertically(M,e);return i.head!=M.head?i:t.moveToLineBoundary(M,e)}))}const mz=t=>wz(t,!1),Uz=t=>wz(t,!0);function Cz(t){let e,M=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,i=0,N=0;if(M){for(let e of t.state.facet(nl.scrollMargins)){let M=e(t);(null==M?void 0:M.top)&&(i=Math.max(null==M?void 0:M.top,i)),(null==M?void 0:M.bottom)&&(N=Math.max(null==M?void 0:M.bottom,N))}e=t.scrollDOM.clientHeight-i-N}else e=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:N,selfScroll:M,height:Math.max(t.defaultLineHeight,e-5)}}function Yz(t,e){let M,i=Cz(t),{state:N}=t,o=yz(N.selection,(M=>M.empty?t.moveVertically(M,e,i.height):hz(M,e)));if(o.eq(N.selection))return!1;if(i.selfScroll){let e=t.coordsAtPos(N.selection.main.head),n=t.scrollDOM.getBoundingClientRect(),s=n.top+i.marginTop,r=n.bottom-i.marginBottom;e&&e.top>s&&e.bottom<r&&(M=nl.scrollIntoView(o.main.head,{y:"start",yMargin:e.top-s}))}return t.dispatch(dz(N,o),{effects:M}),!0}const bz=t=>Yz(t,!1),fz=t=>Yz(t,!0);function vz(t,e,M){let i=t.lineBlockAt(e.head),N=t.moveToLineBoundary(e,M);if(N.head==e.head&&N.head!=(M?i.to:i.from)&&(N=t.moveToLineBoundary(e,M,!1)),!M&&N.head==i.from&&i.length){let M=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;M&&e.head!=i.from+M&&(N=Vo.cursor(i.from+M))}return N}function Zz(t,e){let M=yz(t.state.selection,(t=>{let M=e(t);return Vo.range(t.anchor,M.head,M.goalColumn,M.bidiLevel||void 0)}));return!M.eq(t.state.selection)&&(t.dispatch(dz(t.state,M)),!0)}function Vz(t,e){return Zz(t,(M=>t.moveByChar(M,e)))}const Wz=t=>Vz(t,!xz(t)),Pz=t=>Vz(t,xz(t));function Rz(t,e){return Zz(t,(M=>t.moveByGroup(M,e)))}function Gz(t,e){return Zz(t,(M=>t.moveVertically(M,e)))}const Bz=t=>Gz(t,!1),_z=t=>Gz(t,!0);function Fz(t,e){return Zz(t,(M=>t.moveVertically(M,e,Cz(t).height)))}const Jz=t=>Fz(t,!1),Hz=t=>Fz(t,!0),Xz=({state:t,dispatch:e})=>(e(dz(t,{anchor:0})),!0),$z=({state:t,dispatch:e})=>(e(dz(t,{anchor:t.doc.length})),!0),qz=({state:t,dispatch:e})=>(e(dz(t,{anchor:t.selection.main.anchor,head:0})),!0),Kz=({state:t,dispatch:e})=>(e(dz(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function tI(t,e){if(t.state.readOnly)return!1;let M="delete.selection",{state:i}=t,N=i.changeByRange((i=>{let{from:N,to:o}=i;if(N==o){let n=e(i);n<N?(M="delete.backward",n=eI(t,n,!1)):n>N&&(M="delete.forward",n=eI(t,n,!0)),N=Math.min(N,n),o=Math.max(o,n)}else N=eI(t,N,!1),o=eI(t,o,!0);return N==o?{range:i}:{changes:{from:N,to:o},range:Vo.cursor(N,N<i.head?-1:1)}}));return!N.changes.empty&&(t.dispatch(i.update(N,{scrollIntoView:!0,userEvent:M,effects:"delete.selection"==M?nl.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function eI(t,e,M){if(t instanceof nl)for(let i of t.state.facet(nl.atomicRanges).map((e=>e(t))))i.between(e,e,((t,i)=>{t<e&&i>e&&(e=M?i:t)}));return e}const MI=(t,e,M)=>tI(t,(i=>{let N,o,n=i.from,{state:s}=t,r=s.doc.lineAt(n);if(M&&!e&&n>r.from&&n<r.from+200&&!/[^ \t]/.test(N=r.text.slice(0,n-r.from))){if("\t"==N[N.length-1])return n-1;let t=Xn(N,s.tabSize)%Uj(s)||Uj(s);for(let e=0;e<t&&" "==N[N.length-1-e];e++)n--;o=n}else o=xo(r.text,n-r.from,e,e)+r.from,o==n&&r.number!=(e?s.doc.lines:1)?o+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(r.text.slice(o-r.from,n-r.from))&&(o=xo(r.text,o-r.from,!1,!1)+r.from);return o})),iI=t=>MI(t,!1,!0),NI=t=>MI(t,!0,!1),oI=(t,e)=>tI(t,(M=>{let i=M.head,{state:N}=t,o=N.doc.lineAt(i),n=N.charCategorizer(i);for(let t=null;;){if(i==(e?o.to:o.from)){i==M.head&&o.number!=(e?N.doc.lines:1)&&(i+=e?1:-1);break}let s=xo(o.text,i-o.from,e)+o.from,r=o.text.slice(Math.min(i,s)-o.from,Math.max(i,s)-o.from),D=n(r);if(null!=t&&D!=t)break;" "==r&&i==M.head||(t=D),i=s}return i})),nI=t=>oI(t,!1);function sI(t){let e=[],M=-1;for(let i of t.selection.ranges){let N=t.doc.lineAt(i.from),o=t.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=t.doc.lineAt(i.to-1)),M>=N.number){let t=e[e.length-1];t.to=o.to,t.ranges.push(i)}else e.push({from:N.from,to:o.to,ranges:[i]});M=o.number+1}return e}function rI(t,e,M){if(t.readOnly)return!1;let i=[],N=[];for(let e of sI(t)){if(M?e.to==t.doc.length:0==e.from)continue;let o=t.doc.lineAt(M?e.to+1:e.from-1),n=o.length+1;if(M){i.push({from:e.to,to:o.to},{from:e.from,insert:o.text+t.lineBreak});for(let M of e.ranges)N.push(Vo.range(Math.min(t.doc.length,M.anchor+n),Math.min(t.doc.length,M.head+n)))}else{i.push({from:o.from,to:e.from},{from:e.to,insert:t.lineBreak+o.text});for(let t of e.ranges)N.push(Vo.range(t.anchor-n,t.head-n))}}return!!i.length&&(e(t.update({changes:i,scrollIntoView:!0,selection:Vo.create(N,t.selection.mainIndex),userEvent:"move.line"})),!0)}function DI(t,e,M){if(t.readOnly)return!1;let i=[];for(let e of sI(t))M?i.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):i.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});return e(t.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const aI=uI(!1),lI=uI(!0);function uI(t){return({state:e,dispatch:M})=>{if(e.readOnly)return!1;let i=e.changeByRange((M=>{let{from:i,to:N}=M,o=e.doc.lineAt(i),n=!t&&i==N&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let M,i=yj(t).resolveInner(e),N=i.childBefore(e),o=i.childAfter(e);return N&&o&&N.to<=e&&o.from>=e&&(M=N.type.prop(qu.closedBy))&&M.indexOf(o.name)>-1&&t.doc.lineAt(N.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(N.to,o.from))?{from:N.to,to:o.from}:null}(e,i);t&&(i=N=(N<=o.to?o:e.doc.lineAt(N)).to);let s=new bj(e,{simulateBreak:i,simulateDoubleBreak:!!n}),r=Yj(s,i);for(null==r&&(r=Xn(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));N<o.to&&/\s/.test(o.text[N-o.from]);)N++;n?({from:i,to:N}=n):i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let D=["",Cj(e,r)];return n&&D.push(Cj(e,s.lineIndent(o.from,-1))),{changes:{from:i,to:N,insert:jo.of(D)},range:Vo.cursor(i+1+D[1].length)}}));return M(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function gI(t,e){let M=-1;return t.changeByRange((i=>{let N=[];for(let o=i.from;o<=i.to;){let n=t.doc.lineAt(o);n.number>M&&(i.empty||i.to>n.from)&&(e(n,N,i),M=n.number),o=n.to+1}let o=t.changes(N);return{changes:N,range:Vo.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}}))}const jI=[{key:"Ctrl-b",run:pz,shift:Wz,preventDefault:!0},{key:"Ctrl-f",run:Sz,shift:Pz},{key:"Ctrl-p",run:mz,shift:Bz},{key:"Ctrl-n",run:Uz,shift:_z},{key:"Ctrl-a",run:t=>Az(t,(e=>Vo.cursor(t.lineBlockAt(e.head).from,1))),shift:t=>Zz(t,(e=>Vo.cursor(t.lineBlockAt(e.head).from)))},{key:"Ctrl-e",run:t=>Az(t,(e=>Vo.cursor(t.lineBlockAt(e.head).to,-1))),shift:t=>Zz(t,(e=>Vo.cursor(t.lineBlockAt(e.head).to)))},{key:"Ctrl-d",run:NI},{key:"Ctrl-h",run:iI},{key:"Ctrl-k",run:t=>tI(t,(e=>{let M=t.lineBlockAt(e.head).to;return e.head<M?M:Math.min(t.state.doc.length,e.head+1)}))},{key:"Ctrl-Alt-h",run:nI},{key:"Ctrl-o",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let M=t.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:jo.of(["",""])},range:Vo.cursor(t.from)})));return e(t.update(M,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let M=t.changeByRange((e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let M=e.from,i=t.doc.lineAt(M),N=M==i.from?M-1:xo(i.text,M-i.from,!1)+i.from,o=M==i.to?M+1:xo(i.text,M-i.from,!0)+i.from;return{changes:{from:N,to:o,insert:t.doc.slice(M,o).append(t.doc.slice(N,M))},range:Vo.cursor(o)}}));return!M.changes.empty&&(e(t.update(M,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:fz}],cI=[{key:"ArrowLeft",run:pz,shift:Wz,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>Qz(t,!xz(t)),shift:t=>Rz(t,!xz(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>Az(t,(e=>vz(t,e,!xz(t)))),shift:t=>Zz(t,(e=>vz(t,e,!xz(t)))),preventDefault:!0},{key:"ArrowRight",run:Sz,shift:Pz,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>Qz(t,xz(t)),shift:t=>Rz(t,xz(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>Az(t,(e=>vz(t,e,xz(t)))),shift:t=>Zz(t,(e=>vz(t,e,xz(t)))),preventDefault:!0},{key:"ArrowUp",run:mz,shift:Bz,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Xz,shift:qz},{mac:"Ctrl-ArrowUp",run:bz,shift:Jz},{key:"ArrowDown",run:Uz,shift:_z,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$z,shift:Kz},{mac:"Ctrl-ArrowDown",run:fz,shift:Hz},{key:"PageUp",run:bz,shift:Jz},{key:"PageDown",run:fz,shift:Hz},{key:"Home",run:t=>Az(t,(e=>vz(t,e,!1))),shift:t=>Zz(t,(e=>vz(t,e,!1))),preventDefault:!0},{key:"Mod-Home",run:Xz,shift:qz},{key:"End",run:t=>Az(t,(e=>vz(t,e,!0))),shift:t=>Zz(t,(e=>vz(t,e,!0))),preventDefault:!0},{key:"Mod-End",run:$z,shift:Kz},{key:"Enter",run:aI,shift:aI},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:iI,shift:iI},{key:"Delete",run:NI},{key:"Mod-Backspace",mac:"Alt-Backspace",run:nI},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>oI(t,!0)},{mac:"Mod-Backspace",run:t=>tI(t,(e=>{let M=t.moveToLineBoundary(e,!1).head;return e.head>M?M:Math.max(0,e.head-1)}))},{mac:"Mod-Delete",run:t=>tI(t,(e=>{let M=t.moveToLineBoundary(e,!0).head;return e.head<M?M:Math.min(t.state.doc.length,e.head+1)}))}].concat(jI.map((t=>({mac:t.key,run:t.run,shift:t.shift})))),zI=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:t=>Az(t,(e=>kz(t.state,e,!xz(t)))),shift:t=>Zz(t,(e=>kz(t.state,e,!xz(t))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>Az(t,(e=>kz(t.state,e,xz(t)))),shift:t=>Zz(t,(e=>kz(t.state,e,xz(t))))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>rI(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>DI(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>rI(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>DI(t,e,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let M=t.selection,i=null;return M.ranges.length>1?i=Vo.create([M.main]):M.main.empty||(i=Vo.create([Vo.cursor(M.main.head)])),!!i&&(e(dz(t,i)),!0)}},{key:"Mod-Enter",run:lI},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let M=sI(t).map((({from:e,to:M})=>Vo.range(e,Math.min(M+1,t.doc.length))));return e(t.update({selection:Vo.create(M),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let M=yz(t.selection,(e=>{let M=yj(t),i=M.resolveStack(e.from,1);if(e.empty){let t=M.resolveStack(e.from,-1);t.node.from>=i.node.from&&t.node.to<=i.node.to&&(i=t)}for(let t=i;t;t=t.next){let{node:M}=t;if((M.from<e.from&&M.to>=e.to||M.to>e.to&&M.from<=e.from)&&t.next)return Vo.range(M.to,M.from)}return e}));return!M.eq(t.selection)&&(e(dz(t,M)),!0)},preventDefault:!0},{key:"Mod-[",run:({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(gI(t,((e,M)=>{let i=/^\s*/.exec(e.text)[0];if(!i)return;let N=Xn(i,t.tabSize),o=0,n=Cj(t,Math.max(0,N-Uj(t)));for(;o<i.length&&o<n.length&&i.charCodeAt(o)==n.charCodeAt(o);)o++;M.push({from:e.from+o,to:e.from+i.length,insert:n.slice(o)})})),{userEvent:"delete.dedent"})),!0)},{key:"Mod-]",run:({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(gI(t,((e,M)=>{M.push({from:e.from,insert:t.facet(mj)})})),{userEvent:"input.indent"})),!0)},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let M=Object.create(null),i=new bj(t,{overrideIndentation:t=>{let e=M[t];return null==e?-1:e}}),N=gI(t,((e,N,o)=>{let n=Yj(i,e.from);if(null==n)return;/\S/.test(e.text)||(n=0);let s=/^\s*/.exec(e.text)[0],r=Cj(t,n);(s!=r||o.from<e.from+s.length)&&(M[e.from]=n,N.push({from:e.from,to:e.from+s.length,insert:r}))}));return N.changes.empty||e(t.update(N,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:t=>{if(t.state.readOnly)return!1;let{state:e}=t,M=e.changes(sI(e).map((({from:t,to:M})=>(t>0?t--:M<e.doc.length&&M++,{from:t,to:M})))),i=yz(e.selection,(e=>{let M;if(t.lineWrapping){let i=t.lineBlockAt(e.head),N=t.coordsAtPos(e.head,e.assoc||1);N&&(M=i.bottom+t.documentTop-N.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,M)})).map(M);return t.dispatch({changes:M,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>function(t,e,M){let i=!1,N=yz(t.selection,(e=>{let N=Yc(t,e.head,-1)||Yc(t,e.head,1)||e.head>0&&Yc(t,e.head-1,1)||e.head<t.doc.length&&Yc(t,e.head+1,-1);if(!N||!N.end)return e;i=!0;let o=N.start.from==e.head?N.end.to:N.end.from;return M?Vo.range(e.anchor,o):Vo.cursor(o)}));return!!i&&(e(dz(t,N)),!0)}(t,e,!1)},{key:"Mod-/",run:t=>{let{state:e}=t,M=e.doc.lineAt(e.selection.main.from),i=Jc(t.state,M.from);return i.line?Bc(t):!!i.block&&Fc(t)}},{key:"Alt-A",run:_c},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat(cI);function II(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,M=arguments[1];if(M&&"object"==typeof M&&null==M.nodeType&&!Array.isArray(M)){for(var i in M)if(Object.prototype.hasOwnProperty.call(M,i)){var N=M[i];"string"==typeof N?t.setAttribute(i,N):null!=N&&(t[i]=N)}e++}for(;e<arguments.length;e++)TI(t,arguments[e]);return t}function TI(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var M=0;M<e.length;M++)TI(t,e[M])}}const OI="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class yI{constructor(t,e,M=0,i=t.length,N,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(M,i),this.bufferStart=M,this.normalize=N?t=>N(OI(t)):OI,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return po(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=So(t),M=this.bufferStart+this.bufferPos;this.bufferPos+=Qo(t);let i=this.normalize(e);if(i.length)for(let t=0,N=M;;t++){let o=i.charCodeAt(t),n=this.match(o,N,this.bufferPos+this.bufferStart);if(t==i.length-1){if(n)return this.value=n,this;break}N==M&&t<e.length&&e.charCodeAt(t)==o&&N++}}}match(t,e,M){let i=null;for(let e=0;e<this.matches.length;e+=2){let N=this.matches[e],o=!1;this.query.charCodeAt(N)==t&&(N==this.query.length-1?i={from:this.matches[e+1],to:M}:(this.matches[e]++,o=!0)),o||(this.matches.splice(e,2),e-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?i={from:e,to:M}:this.matches.push(1,e)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}"undefined"!=typeof Symbol&&(yI.prototype[Symbol.iterator]=function(){return this});const dI={from:-1,to:-1,match:/.*/.exec("")},AI="gm"+(null==/x/.unicode?"":"u");class hI{constructor(t,e,M,i=0,N=t.length){if(this.text=t,this.to=N,this.curLine="",this.done=!1,this.value=dI,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new pI(t,e,M,i,N);this.re=new RegExp(e,AI+((null==M?void 0:M.ignoreCase)?"i":"")),this.test=null==M?void 0:M.test,this.iter=t.iter();let o=t.lineAt(i);this.curLineStart=o.from,this.matchPos=SI(t,i),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let M=this.curLineStart+e.index,i=M+e[0].length;if(this.matchPos=SI(this.text,i+(M==i?1:0)),M==this.curLineStart+this.curLine.length&&this.nextLine(),(M<i||M>this.value.to)&&(!this.test||this.test(M,i,e)))return this.value={from:M,to:i,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),t=0}}}}const LI=new WeakMap;class xI{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,M){let i=LI.get(t);if(!i||i.from>=M||i.to<=e){let i=new xI(e,t.sliceString(e,M));return LI.set(t,i),i}if(i.from==e&&i.to==M)return i;let{text:N,from:o}=i;return o>e&&(N=t.sliceString(e,o)+N,o=e),i.to<M&&(N+=t.sliceString(i.to,M)),LI.set(t,new xI(o,N)),new xI(e,N.slice(e-o,M-o))}}class pI{constructor(t,e,M,i,N){this.text=t,this.to=N,this.done=!1,this.value=dI,this.matchPos=SI(t,i),this.re=new RegExp(e,AI+((null==M?void 0:M.ignoreCase)?"i":"")),this.test=null==M?void 0:M.test,this.flat=xI.get(t,i,this.chunkEnd(i+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,M=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,M,e)))return this.value={from:t,to:M,match:e},this.matchPos=SI(this.text,M+(t==M?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=xI.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function SI(t,e){if(e>=t.length)return e;let M,i=t.lineAt(e);for(;e<i.to&&(M=i.text.charCodeAt(e-i.from))>=56320&&M<57344;)e++;return e}function QI(t){let e=II("input",{class:"cm-textfield",name:"line",value:String(t.state.doc.lineAt(t.state.selection.main.head).number)});function M(){let M=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!M)return;let{state:i}=t,N=i.doc.lineAt(i.selection.main.head),[,o,n,s,r]=M,D=s?+s.slice(1):0,a=n?+n:N.number;if(n&&r){let t=a/100;o&&(t=t*("-"==o?-1:1)+N.number/i.doc.lines),a=Math.round(i.doc.lines*t)}else n&&o&&(a=a*("-"==o?-1:1)+N.number);let l=i.doc.line(Math.max(1,Math.min(i.doc.lines,a))),u=Vo.cursor(l.from+Math.max(0,Math.min(D,l.length)));t.dispatch({effects:[EI.of(!1),nl.scrollIntoView(u.from,{y:"center"})],selection:u}),t.focus()}return{dom:II("form",{class:"cm-gotoLine",onkeydown:e=>{27==e.keyCode?(e.preventDefault(),t.dispatch({effects:EI.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),M())},onsubmit:t=>{t.preventDefault(),M()}},II("label",t.state.phrase("Go to line"),": ",e)," ",II("button",{class:"cm-button",type:"submit"},t.state.phrase("go")))}}"undefined"!=typeof Symbol&&(hI.prototype[Symbol.iterator]=pI.prototype[Symbol.iterator]=function(){return this});const EI=yn.define(),kI=Xo.define({create:()=>!0,update(t,e){for(let M of e.effects)M.is(EI)&&(t=M.value);return t},provide:t=>xu.from(t,(t=>t?QI:null))}),wI=nl.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),mI={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},UI=Ro.define({combine:t=>Un(t,mI,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});const CI=lr.mark({class:"cm-selectionMatch"}),YI=lr.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function bI(t,e,M,i){return!(0!=M&&t(e.sliceDoc(M-1,M))==Qn.Word||i!=e.doc.length&&t(e.sliceDoc(i,i+1))==Qn.Word)}const fI=sD.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(UI),{state:M}=t,i=M.selection;if(i.ranges.length>1)return lr.none;let N,o=i.main,n=null;if(o.empty){if(!e.highlightWordAroundCursor)return lr.none;let t=M.wordAt(o.head);if(!t)return lr.none;n=M.charCategorizer(o.head),N=M.sliceDoc(t.from,t.to)}else{let t=o.to-o.from;if(t<e.minSelectionLength||t>200)return lr.none;if(e.wholeWords){if(N=M.sliceDoc(o.from,o.to),n=M.charCategorizer(o.head),!bI(n,M,o.from,o.to)||!function(t,e,M,i){return t(e.sliceDoc(M,M+1))==Qn.Word&&t(e.sliceDoc(i-1,i))==Qn.Word}(n,M,o.from,o.to))return lr.none}else if(N=M.sliceDoc(o.from,o.to),!N)return lr.none}let s=[];for(let i of t.visibleRanges){let t=new yI(M.doc,N,i.from,i.to);for(;!t.next().done;){let{from:i,to:N}=t.value;if((!n||bI(n,M,i,N))&&(o.empty&&i<=o.from&&N>=o.to?s.push(YI.range(i,N)):(i>=o.to||N<=o.from)&&s.push(CI.range(i,N)),s.length>e.maxMatches))return lr.none}}return lr.set(s)}},{decorations:t=>t.decorations}),vI=nl.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const ZI=Ro.define({combine:t=>Un(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new jT(t),scrollToMatch:t=>nl.scrollIntoView(t)})});class VI{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,AI),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,((t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"))}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new FI(this):new RI(this)}getCursor(t,e=0,M){let i=t.doc?t:mn.create({doc:t});return null==M&&(M=i.doc.length),this.regexp?GI(this,i,e,M):PI(this,i,e,M)}}class WI{constructor(t){this.spec=t}}function PI(t,e,M,i){return new yI(e.doc,t.unquoted,M,i,t.caseSensitive?void 0:t=>t.toLowerCase(),t.wholeWord?function(t,e){return(M,i,N,o)=>((o>M||o+N.length<i)&&(o=Math.max(0,M-2),N=t.sliceString(o,Math.min(t.length,i+2))),!(e(BI(N,M-o))==Qn.Word&&e(_I(N,M-o))==Qn.Word||e(_I(N,i-o))==Qn.Word&&e(BI(N,i-o))==Qn.Word))}(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}class RI extends WI{constructor(t){super(t)}nextMatch(t,e,M){let i=PI(this.spec,t,M,t.doc.length).nextOverlapping();if(i.done){let M=Math.min(t.doc.length,e+this.spec.unquoted.length);i=PI(this.spec,t,0,M).nextOverlapping()}return i.done||i.value.from==e&&i.value.to==M?null:i.value}prevMatchInRange(t,e,M){for(let i=M;;){let M=Math.max(e,i-1e4-this.spec.unquoted.length),N=PI(this.spec,t,M,i),o=null;for(;!N.nextOverlapping().done;)o=N.value;if(o)return o;if(M==e)return null;i-=1e4}}prevMatch(t,e,M){let i=this.prevMatchInRange(t,0,e);return i||(i=this.prevMatchInRange(t,Math.max(0,M-this.spec.unquoted.length),t.doc.length)),!i||i.from==e&&i.to==M?null:i}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let M=PI(this.spec,t,0,t.doc.length),i=[];for(;!M.next().done;){if(i.length>=e)return null;i.push(M.value)}return i}highlight(t,e,M,i){let N=PI(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(M+this.spec.unquoted.length,t.doc.length));for(;!N.next().done;)i(N.value.from,N.value.to)}}function GI(t,e,M,i){return new hI(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(N=e.charCategorizer(e.selection.main.head),(t,e,M)=>!M[0].length||(N(BI(M.input,M.index))!=Qn.Word||N(_I(M.input,M.index))!=Qn.Word)&&(N(_I(M.input,M.index+M[0].length))!=Qn.Word||N(BI(M.input,M.index+M[0].length))!=Qn.Word)):void 0},M,i);var N}function BI(t,e){return t.slice(xo(t,e,!1),e)}function _I(t,e){return t.slice(e,xo(t,e))}class FI extends WI{nextMatch(t,e,M){let i=GI(this.spec,t,M,t.doc.length).next();return i.done&&(i=GI(this.spec,t,0,e).next()),i.done?null:i.value}prevMatchInRange(t,e,M){for(let i=1;;i++){let N=Math.max(e,M-1e4*i),o=GI(this.spec,t,N,M),n=null;for(;!o.next().done;)n=o.value;if(n&&(N==e||n.from>N+10))return n;if(N==e)return null}}prevMatch(t,e,M){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,M,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((e,M)=>"$"==M?"$":"&"==M?t.match[0]:"0"!=M&&+M<t.match.length?t.match[M]:e))}matchAll(t,e){let M=GI(this.spec,t,0,t.doc.length),i=[];for(;!M.next().done;){if(i.length>=e)return null;i.push(M.value)}return i}highlight(t,e,M,i){let N=GI(this.spec,t,Math.max(0,e-250),Math.min(M+250,t.doc.length));for(;!N.next().done;)i(N.value.from,N.value.to)}}const JI=yn.define(),HI=yn.define(),XI=Xo.define({create:t=>new $I(rT(t).create(),null),update(t,e){for(let M of e.effects)M.is(JI)?t=new $I(M.value.create(),t.panel):M.is(HI)&&(t=new $I(t.query,M.value?sT:null));return t},provide:t=>xu.from(t,(t=>t.panel))});class $I{constructor(t,e){this.query=t,this.panel=e}}const qI=lr.mark({class:"cm-searchMatch"}),KI=lr.mark({class:"cm-searchMatch cm-searchMatch-selected"}),tT=sD.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(XI))}update(t){let e=t.state.field(XI);(e!=t.startState.field(XI)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return lr.none;let{view:M}=this,i=new Zn;for(let e=0,N=M.visibleRanges,o=N.length;e<o;e++){let{from:n,to:s}=N[e];for(;e<o-1&&s>N[e+1].from-500;)s=N[++e].to;t.highlight(M.state,n,s,((t,e)=>{let N=M.state.selection.ranges.some((M=>M.from==t&&M.to==e));i.add(t,e,N?KI:qI)}))}return i.finish()}},{decorations:t=>t.decorations});function eT(t){return e=>{let M=e.state.field(XI,!1);return M&&M.query.spec.valid?t(e,M):lT(e)}}const MT=eT(((t,{query:e})=>{let{to:M}=t.state.selection.main,i=e.nextMatch(t.state,M,M);if(!i)return!1;let N=Vo.single(i.from,i.to),o=t.state.facet(ZI);return t.dispatch({selection:N,effects:[TT(t,i),o.scrollToMatch(N.main,t)],userEvent:"select.search"}),aT(t),!0})),iT=eT(((t,{query:e})=>{let{state:M}=t,{from:i}=M.selection.main,N=e.prevMatch(M,i,i);if(!N)return!1;let o=Vo.single(N.from,N.to),n=t.state.facet(ZI);return t.dispatch({selection:o,effects:[TT(t,N),n.scrollToMatch(o.main,t)],userEvent:"select.search"}),aT(t),!0})),NT=eT(((t,{query:e})=>{let M=e.matchAll(t.state,1e3);return!(!M||!M.length)&&(t.dispatch({selection:Vo.create(M.map((t=>Vo.range(t.from,t.to)))),userEvent:"select.search.matches"}),!0)})),oT=eT(((t,{query:e})=>{let{state:M}=t,{from:i,to:N}=M.selection.main;if(M.readOnly)return!1;let o=e.nextMatch(M,i,i);if(!o)return!1;let n,s,r=o,D=[],a=[];if(r.from==i&&r.to==N&&(s=M.toText(e.getReplacement(r)),D.push({from:r.from,to:r.to,insert:s}),r=e.nextMatch(M,r.from,r.to),a.push(nl.announce.of(M.phrase("replaced match on line $",M.doc.lineAt(i).number)+"."))),r){let e=0==D.length||D[0].from>=o.to?0:o.to-o.from-s.length;n=Vo.single(r.from-e,r.to-e),a.push(TT(t,r)),a.push(M.facet(ZI).scrollToMatch(n.main,t))}return t.dispatch({changes:D,selection:n,effects:a,userEvent:"input.replace"}),!0})),nT=eT(((t,{query:e})=>{if(t.state.readOnly)return!1;let M=e.matchAll(t.state,1e9).map((t=>{let{from:M,to:i}=t;return{from:M,to:i,insert:e.getReplacement(t)}}));if(!M.length)return!1;let i=t.state.phrase("replaced $ matches",M.length)+".";return t.dispatch({changes:M,effects:nl.announce.of(i),userEvent:"input.replace.all"}),!0}));function sT(t){return t.state.facet(ZI).createPanel(t)}function rT(t,e){var M,i,N,o,n;let s=t.selection.main,r=s.empty||s.to>s.from+100?"":t.sliceDoc(s.from,s.to);if(e&&!r)return e;let D=t.facet(ZI);return new VI({search:(null!==(M=null==e?void 0:e.literal)&&void 0!==M?M:D.literal)?r:r.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==e?void 0:e.caseSensitive)&&void 0!==i?i:D.caseSensitive,literal:null!==(N=null==e?void 0:e.literal)&&void 0!==N?N:D.literal,regexp:null!==(o=null==e?void 0:e.regexp)&&void 0!==o?o:D.regexp,wholeWord:null!==(n=null==e?void 0:e.wholeWord)&&void 0!==n?n:D.wholeWord})}function DT(t){let e=du(t,sT);return e&&e.dom.querySelector("[main-field]")}function aT(t){let e=DT(t);e&&e==t.root.activeElement&&e.select()}const lT=t=>{let e=t.state.field(XI,!1);if(e&&e.panel){let M=DT(t);if(M&&M!=t.root.activeElement){let i=rT(t.state,e.query.spec);i.valid&&t.dispatch({effects:JI.of(i)}),M.focus(),M.select()}}else t.dispatch({effects:[HI.of(!0),e?JI.of(rT(t.state,e.query.spec)):yn.appendConfig.of(yT)]});return!0},uT=t=>{let e=t.state.field(XI,!1);if(!e||!e.panel)return!1;let M=du(t,sT);return M&&M.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:HI.of(!1)}),!0},gT=[{key:"Mod-f",run:lT,scope:"editor search-panel"},{key:"F3",run:MT,shift:iT,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:MT,shift:iT,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:uT,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:t,dispatch:e})=>{let M=t.selection;if(M.ranges.length>1||M.main.empty)return!1;let{from:i,to:N}=M.main,o=[],n=0;for(let e=new yI(t.doc,t.sliceDoc(i,N));!e.next().done;){if(o.length>1e3)return!1;e.value.from==i&&(n=o.length),o.push(Vo.range(e.value.from,e.value.to))}return e(t.update({selection:Vo.create(o,n),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:t=>{let e=du(t,QI);if(!e){let M=[EI.of(!0)];null==t.state.field(kI,!1)&&M.push(yn.appendConfig.of([kI,wI])),t.dispatch({effects:M}),e=du(t,QI)}return e&&e.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:t,dispatch:e})=>{let{ranges:M}=t.selection;if(M.some((t=>t.from===t.to)))return(({state:t,dispatch:e})=>{let{selection:M}=t,i=Vo.create(M.ranges.map((e=>t.wordAt(e.head)||Vo.cursor(e.head))),M.mainIndex);return!i.eq(M)&&(e(t.update({selection:i})),!0)})({state:t,dispatch:e});let i=t.sliceDoc(M[0].from,M[0].to);if(t.selection.ranges.some((e=>t.sliceDoc(e.from,e.to)!=i)))return!1;let N=function(t,e){let{main:M,ranges:i}=t.selection,N=t.wordAt(M.head),o=N&&N.from==M.from&&N.to==M.to;for(let M=!1,N=new yI(t.doc,e,i[i.length-1].to);;){if(N.next(),!N.done){if(M&&i.some((t=>t.from==N.value.from)))continue;if(o){let e=t.wordAt(N.value.from);if(!e||e.from!=N.value.from||e.to!=N.value.to)continue}return N.value}if(M)return null;N=new yI(t.doc,e,0,Math.max(0,i[i.length-1].from-1)),M=!0}}(t,i);return!!N&&(e(t.update({selection:t.selection.addRange(Vo.range(N.from,N.to),!1),effects:nl.scrollIntoView(N.to)})),!0)},preventDefault:!0}];class jT{constructor(t){this.view=t;let e=this.query=t.state.field(XI).query.spec;function M(t,e,M){return II("button",{class:"cm-button",name:t,onclick:e,type:"button"},M)}this.commit=this.commit.bind(this),this.searchField=II("input",{value:e.search,placeholder:cT(t,"Find"),"aria-label":cT(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=II("input",{value:e.replace,placeholder:cT(t,"Replace"),"aria-label":cT(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=II("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=II("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=II("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=II("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,M("next",(()=>MT(t)),[cT(t,"next")]),M("prev",(()=>iT(t)),[cT(t,"previous")]),M("select",(()=>NT(t)),[cT(t,"all")]),II("label",null,[this.caseField,cT(t,"match case")]),II("label",null,[this.reField,cT(t,"regexp")]),II("label",null,[this.wordField,cT(t,"by word")]),...t.state.readOnly?[]:[II("br"),this.replaceField,M("replace",(()=>oT(t)),[cT(t,"replace")]),M("replaceAll",(()=>nT(t)),[cT(t,"replace all")])],II("button",{name:"close",onclick:()=>uT(t),"aria-label":cT(t,"close"),type:"button"},["×"])])}commit(){let t=new VI({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:JI.of(t)}))}keydown(t){!function(t,e,M){return yl(zl(t.state),e,t,M)}(this.view,t,"search-panel")?13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?iT:MT)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),oT(this.view)):t.preventDefault()}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(JI)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ZI).top}}function cT(t,e){return t.state.phrase(e)}const zT=30,IT=/[\s\.,:;?!]/;function TT(t,{from:e,to:M}){let i=t.state.doc.lineAt(e),N=t.state.doc.lineAt(M).to,o=Math.max(i.from,e-zT),n=Math.min(N,M+zT),s=t.state.sliceDoc(o,n);if(o!=i.from)for(let t=0;t<zT;t++)if(!IT.test(s[t+1])&&IT.test(s[t])){s=s.slice(t);break}if(n!=N)for(let t=s.length-1;t>s.length-zT;t--)if(!IT.test(s[t-1])&&IT.test(s[t])){s=s.slice(0,t);break}return nl.announce.of(`${t.state.phrase("current match")}. ${s} ${t.state.phrase("on line")} ${i.number}.`)}const OT=nl.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),yT=[XI,Mn.low(tT),OT];class dT{constructor(t,e,M,i){this.state=t,this.pos=e,this.explicit=M,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=yj(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),M=Math.max(e.from,this.pos-250),i=e.text.slice(M-e.from,this.pos-e.from),N=i.search(ST(t,!1));return N<0?null:{from:M+N,to:this.pos,text:i.slice(N)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,M){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),M&&M.onDocChange&&(this.abortOnDocChange=!0))}}function AT(t){let e=Object.keys(t).join(""),M=/\w/.test(e);return M&&(e=e.replace(/\w/g,"")),`[${M?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function hT(t){let e=t.map((t=>"string"==typeof t?{label:t}:t)),[M,i]=e.every((t=>/^\w+$/.test(t.label)))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),M=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let t=1;t<i.length;t++)M[i[t]]=!0}let i=AT(e)+AT(M)+"*$";return[new RegExp("^"+i),new RegExp(i)]}(e);return t=>{let N=t.matchBefore(i);return N||t.explicit?{from:N?N.from:t.pos,options:e,validFor:M}:null}}function LT(t,e){return M=>{for(let e=yj(M.state).resolveInner(M.pos,-1);e;e=e.parent){if(t.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return e(M)}}class xT{constructor(t,e,M,i){this.completion=t,this.source=e,this.match=M,this.score=i}}function pT(t){return t.selection.main.from}function ST(t,e){var M;let{source:i}=t,N=e&&"^"!=i[0],o="$"!=i[i.length-1];return N||o?new RegExp(`${N?"^":""}(?:${i})${o?"$":""}`,null!==(M=t.flags)&&void 0!==M?M:t.ignoreCase?"i":""):t}const QT=In.define();const ET=new WeakMap;function kT(t){if(!Array.isArray(t))return t;let e=ET.get(t);return e||ET.set(t,e=hT(t)),e}const wT=yn.define(),mT=yn.define();class UT{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let M=po(t,e),i=Qo(M);this.chars.push(M);let N=t.slice(e,e+i),o=N.toUpperCase();this.folded.push(po(o==N?N.toLowerCase():o,0)),e+=i}this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(0==this.pattern.length)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:M,any:i,precise:N,byWord:o}=this;if(1==e.length){let i=po(t,0),N=Qo(i),o=N==t.length?0:-100;if(i==e[0]);else{if(i!=M[0])return null;o+=-200}return this.ret(o,[0,N])}let n=t.indexOf(this.pattern);if(0==n)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=e.length,r=0;if(n<0){for(let N=0,o=Math.min(t.length,200);N<o&&r<s;){let o=po(t,N);o!=e[r]&&o!=M[r]||(i[r++]=N),N+=Qo(o)}if(r<s)return null}let D=0,a=0,l=!1,u=0,g=-1,j=-1,c=/[a-z]/.test(t),z=!0;for(let i=0,r=Math.min(t.length,200),I=0;i<r&&a<s;){let r=po(t,i);n<0&&(D<s&&r==e[D]&&(N[D++]=i),u<s&&(r==e[u]||r==M[u]?(0==u&&(g=i),j=i+1,u++):u=0));let T,O=r<255?r>=48&&r<=57||r>=97&&r<=122?2:r>=65&&r<=90?1:0:(T=So(r))!=T.toLowerCase()?1:T!=T.toUpperCase()?2:0;(!i||1==O&&c||0==I&&0!=O)&&(e[a]==r||M[a]==r&&(l=!0)?o[a++]=i:o.length&&(z=!1)),I=O,i+=Qo(r)}return a==s&&0==o[0]&&z?this.result((l?-200:0)-100,o,t):u==s&&0==g?this.ret(-200-t.length+(j==t.length?0:-100),[0,j]):n>-1?this.ret(-700-t.length,[n,n+this.pattern.length]):u==s?this.ret(-900-t.length,[g,j]):a==s?this.result((l?-200:0)-100-700+(z?0:-1100),o,t):2==e.length?null:this.result((i[0]?-700:0)-200-1100,i,t)}result(t,e,M){let i=[],N=0;for(let t of e){let e=t+(this.astral?Qo(po(M,t)):1);N&&i[N-1]==t?i[N-1]=e:(i[N++]=t,i[N++]=e)}return this.ret(t-M.length,i)}}class CT{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),M=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return null==M?null:(this.matched=[0,e.length],this.score=M+(t.length==this.pattern.length?0:-100),this)}}const YT=Ro.define({combine:t=>Un(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:fT,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>M=>bT(t(M),e(M)),optionClass:(t,e)=>M=>bT(t(M),e(M)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function bT(t,e){return t?e?t+" "+e:t:e}function fT(t,e,M,i,N,o){let n,s,r=t.textDirection==hr.RTL,D=r,a=!1,l="top",u=e.left-N.left,g=N.right-e.right,j=i.right-i.left,c=i.bottom-i.top;if(D&&u<Math.min(j,g)?D=!1:!D&&g<Math.min(j,u)&&(D=!0),j<=(D?u:g))n=Math.max(N.top,Math.min(M.top,N.bottom-c))-e.top,s=Math.min(400,D?u:g);else{a=!0,s=Math.min(400,(r?e.right:N.right-e.left)-30);let t=N.bottom-e.bottom;t>=c||t>e.top?n=M.bottom-e.top:(l="bottom",n=e.bottom-M.top)}return{style:`${l}: ${n/((e.bottom-e.top)/o.offsetHeight)}px; max-width: ${s/((e.right-e.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(a?r?"left-narrow":"right-narrow":D?"left":"right")}}function vT(t,e,M){if(t<=M)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/M);return{from:t*M,to:(t+1)*M}}let i=Math.floor((t-e)/M);return{from:t-(i+1)*M,to:t-i*M}}class ZT{constructor(t,e,M){this.view=t,this.stateField=e,this.applyCompletion=M,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let i=t.state.field(e),{options:N,selected:o}=i.open,n=t.state.facet(YT);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map((t=>"cm-completionIcon-"+t))),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,M,i){let N=document.createElement("span");N.className="cm-completionLabel";let o=t.displayLabel||t.label,n=0;for(let t=0;t<i.length;){let e=i[t++],M=i[t++];e>n&&N.appendChild(document.createTextNode(o.slice(n,e)));let s=N.appendChild(document.createElement("span"));s.appendChild(document.createTextNode(o.slice(e,M))),s.className="cm-completionMatchedText",n=M}return n<o.length&&N.appendChild(document.createTextNode(o.slice(n))),N},position:50},{render(t){if(!t.detail)return null;let e=document.createElement("span");return e.className="cm-completionDetail",e.textContent=t.detail,e},position:80}),e.sort(((t,e)=>t.position-e.position)).map((t=>t.render))}(n),this.optionClass=n.optionClass,this.tooltipClass=n.tooltipClass,this.range=vT(N.length,o,n.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",(M=>{let{options:i}=t.state.field(e).open;for(let e,N=M.target;N&&N!=this.dom;N=N.parentNode)if("LI"==N.nodeName&&(e=/-(\d+)$/.exec(N.id))&&+e[1]<i.length)return this.applyCompletion(t,i[+e[1]]),void M.preventDefault()})),this.dom.addEventListener("focusout",(e=>{let M=t.state.field(this.stateField,!1);M&&M.tooltip&&t.state.facet(YT).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:mT.of(null)})})),this.showOptions(N,i.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(t){var e;let M=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),M!=i){let{options:N,selected:o,disabled:n}=M.open;i.open&&i.open.options==N||(this.range=vT(N.length,o,t.state.facet(YT).maxRenderedOptions),this.showOptions(N,M.id)),this.updateSel(),n!=(null===(e=i.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!n)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=vT(e.options.length,e.selected,this.view.state.facet(YT).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:M}=e.options[e.selected],{info:i}=M;if(!i)return;let N="string"==typeof i?document.createTextNode(i):i(M);if(!N)return;"then"in N?N.then((e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,M)})).catch((t=>iD(this.view.state,t,"completion info"))):this.addInfoPane(N,M)}}addInfoPane(t,e){this.destroyInfo();let M=this.info=document.createElement("div");if(M.className="cm-tooltip cm-completionInfo",null!=t.nodeType)M.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:i}=t;M.appendChild(e),this.infoDestroy=i||null}this.dom.appendChild(M),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let M=this.list.firstChild,i=this.range.from;M;M=M.nextSibling,i++)"LI"==M.nodeName&&M.id?i==t?M.hasAttribute("aria-selected")||(M.setAttribute("aria-selected","true"),e=M):M.hasAttribute("aria-selected")&&M.removeAttribute("aria-selected"):i--;return e&&function(t,e){let M=t.getBoundingClientRect(),i=e.getBoundingClientRect(),N=M.height/t.offsetHeight;i.top<M.top?t.scrollTop-=(M.top-i.top)/N:i.bottom>M.bottom&&(t.scrollTop+=(i.bottom-M.bottom)/N)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),M=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),N=this.space;if(!N){let t=this.dom.ownerDocument.defaultView||window;N={left:0,top:0,right:t.innerWidth,bottom:t.innerHeight}}return i.top>Math.min(N.bottom,e.bottom)-10||i.bottom<Math.max(N.top,e.top)+10?null:this.view.state.facet(YT).positionInfo(this.view,e,i,M,N,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,M){const i=document.createElement("ul");i.id=e,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let N=null;for(let o=M.from;o<M.to;o++){let{completion:n,match:s}=t[o],{section:r}=n;if(r){let t="string"==typeof r?r:r.name;if(t!=N&&(o>M.from||0==M.from))if(N=t,"string"!=typeof r&&r.header)i.appendChild(r.header(r));else{i.appendChild(document.createElement("completion-section")).textContent=t}}const D=i.appendChild(document.createElement("li"));D.id=e+"-"+o,D.setAttribute("role","option");let a=this.optionClass(n);a&&(D.className=a);for(let t of this.optionContent){let e=t(n,this.view.state,this.view,s);e&&D.appendChild(e)}}return M.from&&i.classList.add("cm-completionListIncompleteTop"),M.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function VT(t,e){return M=>new ZT(M,t,e)}function WT(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class PT{constructor(t,e,M,i,N,o){this.options=t,this.attrs=e,this.tooltip=M,this.timestamp=i,this.selected=N,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new PT(this.options,_T(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,M,i,N,o){if(i&&!o&&t.some((t=>t.isPending)))return i.setDisabled();let n=function(t,e){let M=[],i=null,N=t=>{M.push(t);let{section:e}=t.completion;if(e){i||(i=[]);let t="string"==typeof e?e:e.name;i.some((e=>e.name==t))||i.push("string"==typeof e?{name:t}:e)}},o=e.facet(YT);for(let i of t)if(i.hasResult()){let t=i.result.getMatch;if(!1===i.result.filter)for(let e of i.result.options)N(new xT(e,i.source,t?t(e):[],1e9-M.length));else{let M,n=e.sliceDoc(i.from,i.to),s=o.filterStrict?new CT(n):new UT(n);for(let e of i.result.options)if(M=s.match(e.label)){let o=e.displayLabel?t?t(e,M.matched):[]:M.matched;N(new xT(e,i.source,o,M.score+(e.boost||0)))}}}if(i){let t=Object.create(null),e=0,N=(t,e)=>{var M,i;return(null!==(M=t.rank)&&void 0!==M?M:1e9)-(null!==(i=e.rank)&&void 0!==i?i:1e9)||(t.name<e.name?-1:1)};for(let M of i.sort(N))e-=1e5,t[M.name]=e;for(let e of M){let{section:M}=e.completion;M&&(e.score+=t["string"==typeof M?M:M.name])}}let n=[],s=null,r=o.compareCompletions;for(let t of M.sort(((t,e)=>e.score-t.score||r(t.completion,e.completion)))){let e=t.completion;!s||s.label!=e.label||s.detail!=e.detail||null!=s.type&&null!=e.type&&s.type!=e.type||s.apply!=e.apply||s.boost!=e.boost?n.push(t):WT(t.completion)>WT(s)&&(n[n.length-1]=t),s=t.completion}return n}(t,e);if(!n.length)return i&&t.some((t=>t.isPending))?i.setDisabled():null;let s=e.facet(YT).selectOnOpen?0:-1;if(i&&i.selected!=s&&-1!=i.selected){let t=i.options[i.selected].completion;for(let e=0;e<n.length;e++)if(n[e].completion==t){s=e;break}}return new PT(n,_T(M,s),{pos:t.reduce(((t,e)=>e.hasResult()?Math.min(t,e.from):t),1e8),create:eO,above:N.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(t){return new PT(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new PT(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class RT{constructor(t,e,M){this.active=t,this.id=e,this.open=M}static start(){return new RT(FT,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,M=e.facet(YT),i=(M.override||e.languageDataAt("autocomplete",pT(e)).map(kT)).map((e=>{let i=this.active.find((t=>t.source==e))||new HT(e,this.active.some((t=>0!=t.state))?1:0);return i.update(t,M)}));i.length==this.active.length&&i.every(((t,e)=>t==this.active[e]))&&(i=this.active);let N=this.open,o=t.effects.some((t=>t.is($T)));N&&t.docChanged&&(N=N.map(t.changes)),t.selection||i.some((e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to)))||!function(t,e){if(t==e)return!0;for(let M=0,i=0;;){for(;M<t.length&&!t[M].hasResult();)M++;for(;i<e.length&&!e[i].hasResult();)i++;let N=M==t.length,o=i==e.length;if(N||o)return N==o;if(t[M++].result!=e[i++].result)return!1}}(i,this.active)||o?N=PT.build(i,e,this.id,N,M,o):N&&N.disabled&&!i.some((t=>t.isPending))&&(N=null),!N&&i.every((t=>!t.isPending))&&i.some((t=>t.hasResult()))&&(i=i.map((t=>t.hasResult()?new HT(t.source,0):t)));for(let e of t.effects)e.is(qT)&&(N=N&&N.setSelected(e.value,this.id));return i==this.active&&N==this.open?this:new RT(i,this.id,N)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?GT:BT}}const GT={"aria-autocomplete":"list"},BT={};function _T(t,e){let M={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(M["aria-activedescendant"]=t+"-"+e),M}const FT=[];function JT(t,e){if(t.isUserEvent("input.complete")){let M=t.annotation(QT);if(M&&e.activateOnCompletion(M))return 12}let M=t.isUserEvent("input.type");return M&&e.activateOnTyping?5:M?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class HT{constructor(t,e,M=!1){this.source=t,this.state=e,this.explicit=M}hasResult(){return!1}get isPending(){return 1==this.state}update(t,e){let M=JT(t,e),i=this;(8&M||16&M&&this.touches(t))&&(i=new HT(i.source,0)),4&M&&0==i.state&&(i=new HT(this.source,1)),i=i.updateFor(t,M);for(let e of t.effects)if(e.is(wT))i=new HT(i.source,1,e.value);else if(e.is(mT))i=new HT(i.source,0);else if(e.is($T))for(let t of e.value)t.source==i.source&&(i=t);return i}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(pT(t.state))}}class XT extends HT{constructor(t,e,M,i,N,o){super(t,3,e),this.limit=M,this.result=i,this.from=N,this.to=o}hasResult(){return!0}updateFor(t,e){var M;if(!(3&e))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let N=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),n=pT(t.state);if(n>o||!i||2&e&&(pT(t.startState)==this.from||n<this.limit))return new HT(this.source,4&e?1:0);let s=t.changes.mapPos(this.limit);return function(t,e,M,i){if(!t)return!1;let N=e.sliceDoc(M,i);return"function"==typeof t?t(N,M,i,e):ST(t,!0).test(N)}(i.validFor,t.state,N,o)?new XT(this.source,this.explicit,s,i,N,o):i.update&&(i=i.update(i,N,o,new dT(t.state,n,!1)))?new XT(this.source,this.explicit,s,i,i.from,null!==(M=i.to)&&void 0!==M?M:pT(t.state)):new HT(this.source,1,this.explicit)}map(t){if(t.empty)return this;return(this.result.map?this.result.map(this.result,t):this.result)?new XT(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new HT(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}const $T=yn.define({map:(t,e)=>t.map((t=>t.map(e)))}),qT=yn.define(),KT=Xo.define({create:()=>RT.start(),update:(t,e)=>t.update(e),provide:t=>[lu.from(t,(t=>t.tooltip)),nl.contentAttributes.from(t,(t=>t.attrs))]});function tO(t,e){const M=e.completion.apply||e.completion.label;let i=t.state.field(KT).active.find((t=>t.source==e.source));return i instanceof XT&&("string"==typeof M?t.dispatch(Object.assign(Object.assign({},function(t,e,M,i){let{main:N}=t.selection,o=M-N.from,n=i-N.from;return Object.assign(Object.assign({},t.changeByRange((s=>{if(s!=N&&M!=i&&t.sliceDoc(s.from+o,s.from+n)!=t.sliceDoc(M,i))return{range:s};let r=t.toText(e);return{changes:{from:s.from+o,to:i==N.from?s.to:s.from+n,insert:r},range:Vo.cursor(s.from+o+r.length)}}))),{scrollIntoView:!0,userEvent:"input.complete"})}(t.state,M,i.from,i.to)),{annotations:QT.of(e.completion)})):M(t,e.completion,i.from,i.to),!0)}const eO=VT(KT,tO);function MO(t,e="option"){return M=>{let i=M.state.field(KT,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<M.state.facet(YT).interactionDelay)return!1;let N,o=1;"page"==e&&(N=Tu(M,i.open.tooltip))&&(o=Math.max(2,Math.floor(N.dom.offsetHeight/N.dom.querySelector("li").offsetHeight)-1));let{length:n}=i.open.options,s=i.open.selected>-1?i.open.selected+o*(t?1:-1):t?0:n-1;return s<0?s="page"==e?0:n-1:s>=n&&(s="page"==e?n-1:0),M.dispatch({effects:qT.of(s)}),!0}}const iO=t=>{let e=t.state.field(KT,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(YT).interactionDelay)&&tO(t,e.open.options[e.open.selected])},NO=t=>!!t.state.field(KT,!1)&&(t.dispatch({effects:wT.of(!0)}),!0);class oO{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const nO=sD.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(KT).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(KT),M=t.state.facet(YT);if(!t.selectionSet&&!t.docChanged&&t.startState.field(KT)==e)return;let i=t.transactions.some((t=>{let e=JT(t,M);return 8&e||(t.selection||t.docChanged)&&!(3&e)}));for(let e=0;e<this.running.length;e++){let M=this.running[e];if(i||M.context.abortOnDocChange&&t.docChanged||M.updates.length+t.transactions.length>50&&Date.now()-M.time>1e3){for(let t of M.context.abortListeners)try{t()}catch(t){iD(this.view.state,t)}M.context.abortListeners=null,this.running.splice(e--,1)}else M.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some((t=>t.effects.some((t=>t.is(wT)))))&&(this.pendingStart=!0);let N=this.pendingStart?50:M.activateOnTypingDelay;if(this.debounceUpdate=e.active.some((t=>t.isPending&&!this.running.some((e=>e.active.source==t.source))))?setTimeout((()=>this.startUpdate()),N):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(KT);for(let t of e.active)t.isPending&&!this.running.some((e=>e.active.source==t.source))&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(YT).updateSyncTime))}startQuery(t){let{state:e}=this.view,M=pT(e),i=new dT(e,M,t.explicit,this.view),N=new oO(t,i);this.running.push(N),Promise.resolve(t.source(i)).then((t=>{N.context.aborted||(N.done=t||null,this.scheduleAccept())}),(t=>{this.view.dispatch({effects:mT.of(null)}),iD(this.view.state,t)}))}scheduleAccept(){this.running.every((t=>void 0!==t.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(YT).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],M=this.view.state.facet(YT),i=this.view.state.field(KT);for(let N=0;N<this.running.length;N++){let o=this.running[N];if(void 0===o.done)continue;if(this.running.splice(N--,1),o.done){let i=pT(o.updates.length?o.updates[0].startState:this.view.state),N=Math.min(i,o.done.from+(o.active.explicit?0:1)),n=new XT(o.active.source,o.active.explicit,N,o.done,o.done.from,null!==(t=o.done.to)&&void 0!==t?t:i);for(let t of o.updates)n=n.update(t,M);if(n.hasResult()){e.push(n);continue}}let n=i.active.find((t=>t.source==o.active.source));if(n&&n.isPending)if(null==o.done){let t=new HT(o.active.source,0);for(let e of o.updates)t=t.update(e,M);t.isPending||e.push(t)}else this.startQuery(n)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:$T.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(KT,!1);if(e&&e.tooltip&&this.view.state.facet(YT).closeOnBlur){let M=e.open&&Tu(this.view,e.open.tooltip);M&&M.dom.contains(t.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:mT.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:wT.of(!1)})),20),this.composing=0}}}),sO="object"==typeof navigator&&/Win/.test(navigator.platform),rO=Mn.highest(nl.domEventHandlers({keydown(t,e){let M=e.state.field(KT,!1);if(!M||!M.open||M.open.disabled||M.open.selected<0||t.key.length>1||t.ctrlKey&&(!sO||!t.altKey)||t.metaKey)return!1;let i=M.open.options[M.open.selected],N=M.active.find((t=>t.source==i.source)),o=i.completion.commitCharacters||N.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&tO(e,i),!1}})),DO=nl.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class aO{constructor(t,e,M,i){this.field=t,this.line=e,this.from=M,this.to=i}}class lO{constructor(t,e,M){this.field=t,this.from=e,this.to=M}map(t){let e=t.mapPos(this.from,-1,ko.TrackDel),M=t.mapPos(this.to,1,ko.TrackDel);return null==e||null==M?null:new lO(this.field,e,M)}}class uO{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let M=[],i=[e],N=t.doc.lineAt(e),o=/^\s*/.exec(N.text)[0];for(let N of this.lines){if(M.length){let M=o,n=/^\t*/.exec(N)[0].length;for(let e=0;e<n;e++)M+=t.facet(mj);i.push(e+M.length-n),N=M+N.slice(n)}M.push(N),e+=N.length+1}let n=this.fieldPositions.map((t=>new lO(t.field,i[t.line]+t.from,i[t.line]+t.to)));return{text:M,ranges:n}}static parse(t){let e,M=[],i=[],N=[];for(let o of t.split(/\r\n?|\n/)){for(;e=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let t=e[1]?+e[1]:null,n=e[2]||e[3]||"",s=-1,r=n.replace(/\\[{}]/g,(t=>t[1]));for(let e=0;e<M.length;e++)(null!=t?M[e].seq==t:r&&M[e].name==r)&&(s=e);if(s<0){let e=0;for(;e<M.length&&(null==t||null!=M[e].seq&&M[e].seq<t);)e++;M.splice(e,0,{seq:t,name:r}),s=e;for(let t of N)t.field>=s&&t.field++}N.push(new aO(s,i.length,e.index,e.index+r.length)),o=o.slice(0,e.index)+n+o.slice(e.index+e[0].length)}o=o.replace(/\\([{}])/g,((t,e,M)=>{for(let t of N)t.line==i.length&&t.from>M&&(t.from--,t.to--);return e})),i.push(o)}return new uO(i,N)}}let gO=lr.widget({widget:new class extends Dr{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),jO=lr.mark({class:"cm-snippetField"});class cO{constructor(t,e){this.ranges=t,this.active=e,this.deco=lr.set(t.map((t=>(t.from==t.to?gO:jO).range(t.from,t.to))))}map(t){let e=[];for(let M of this.ranges){let i=M.map(t);if(!i)return null;e.push(i)}return new cO(e,this.active)}selectionInsideField(t){return t.ranges.every((t=>this.ranges.some((e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))))}}const zO=yn.define({map:(t,e)=>t&&t.map(e)}),IO=yn.define(),TO=Xo.define({create:()=>null,update(t,e){for(let M of e.effects){if(M.is(zO))return M.value;if(M.is(IO)&&t)return new cO(t.ranges,M.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>nl.decorations.from(t,(t=>t?t.deco:lr.none))});function OO(t,e){return Vo.create(t.filter((t=>t.field==e)).map((t=>Vo.range(t.from,t.to))))}function yO(t){let e=uO.parse(t);return(t,M,i,N)=>{let{text:o,ranges:n}=e.instantiate(t.state,i),{main:s}=t.state.selection,r={changes:{from:i,to:N==s.from?s.to:N,insert:jo.of(o)},scrollIntoView:!0,annotations:M?[QT.of(M),dn.userEvent.of("input.complete")]:void 0};if(n.length&&(r.selection=OO(n,0)),n.some((t=>t.field>0))){let e=new cO(n,0),M=r.effects=[zO.of(e)];void 0===t.state.field(TO,!1)&&M.push(yn.appendConfig.of([TO,LO,pO,DO]))}t.dispatch(t.state.update(r))}}function dO(t){return({state:e,dispatch:M})=>{let i=e.field(TO,!1);if(!i||t<0&&0==i.active)return!1;let N=i.active+t,o=t>0&&!i.ranges.some((e=>e.field==N+t));return M(e.update({selection:OO(i.ranges,N),effects:zO.of(o?null:new cO(i.ranges,N)),scrollIntoView:!0})),!0}}const AO=[{key:"Tab",run:dO(1),shift:dO(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(TO,!1)&&(e(t.update({effects:zO.of(null)})),!0)}],hO=Ro.define({combine:t=>t.length?t[0]:AO}),LO=Mn.highest(jl.compute([hO],(t=>t.facet(hO))));function xO(t,e){return Object.assign(Object.assign({},e),{apply:yO(t)})}const pO=nl.domEventHandlers({mousedown(t,e){let M,i=e.state.field(TO,!1);if(!i||null==(M=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let N=i.ranges.find((t=>t.from<=M&&t.to>=M));return!(!N||N.field==i.active)&&(e.dispatch({selection:OO(i.ranges,N.field),effects:zO.of(i.ranges.some((t=>t.field>N.field))?new cO(i.ranges,N.field):null),scrollIntoView:!0}),!0)}}),SO={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},QO=yn.define({map(t,e){let M=e.mapPos(t,-1,ko.TrackAfter);return null==M?void 0:M}}),EO=new class extends Cn{};EO.startSide=1,EO.endSide=-1;const kO=Xo.define({create:()=>vn.empty,update(t,e){if(t=t.map(e.changes),e.selection){let M=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=M.from&&t<=M.to})}for(let M of e.effects)M.is(QO)&&(t=t.update({add:[EO.range(M.value,M.value+1)]}));return t}});const wO="()[]{}<>";function mO(t){for(let e=0;e<8;e+=2)if(wO.charCodeAt(e)==t)return wO.charAt(e+1);return So(t<128?t:t+1)}function UO(t,e){return t.languageDataAt("closeBrackets",e)[0]||SO}const CO="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),YO=nl.inputHandler.of(((t,e,M,i)=>{if((CO?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let N=t.state.selection.main;if(i.length>2||2==i.length&&1==Qo(po(i,0))||e!=N.from||M!=N.to)return!1;let o=function(t,e){let M=UO(t,t.selection.main.head),i=M.brackets||SO.brackets;for(let N of i){let o=mO(po(N,0));if(e==N)return o==N?WO(t,N,i.indexOf(N+N+N)>-1,M):ZO(t,N,o,M.before||SO.before);if(e==o&&fO(t,t.selection.main.from))return VO(t,N,o)}return null}(t.state,i);return!!o&&(t.dispatch(o),!0)})),bO=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let M=UO(t,t.selection.main.head).brackets||SO.brackets,i=null,N=t.changeByRange((e=>{if(e.empty){let i=function(t,e){let M=t.sliceString(e-2,e);return Qo(po(M,0))==M.length?M:M.slice(1)}(t.doc,e.head);for(let N of M)if(N==i&&vO(t.doc,e.head)==mO(po(N,0)))return{changes:{from:e.head-N.length,to:e.head+N.length},range:Vo.cursor(e.head-N.length)}}return{range:i=e}}));return i||e(t.update(N,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function fO(t,e){let M=!1;return t.field(kO).between(0,t.doc.length,(t=>{t==e&&(M=!0)})),M}function vO(t,e){let M=t.sliceString(e,e+2);return M.slice(0,Qo(po(M,0)))}function ZO(t,e,M,i){let N=null,o=t.changeByRange((o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:M,from:o.to}],effects:QO.of(o.to+e.length),range:Vo.range(o.anchor+e.length,o.head+e.length)};let n=vO(t.doc,o.head);return!n||/\s/.test(n)||i.indexOf(n)>-1?{changes:{insert:e+M,from:o.head},effects:QO.of(o.head+e.length),range:Vo.cursor(o.head+e.length)}:{range:N=o}}));return N?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function VO(t,e,M){let i=null,N=t.changeByRange((e=>e.empty&&vO(t.doc,e.head)==M?{changes:{from:e.head,to:e.head+M.length,insert:M},range:Vo.cursor(e.head+M.length)}:i={range:e}));return i?null:t.update(N,{scrollIntoView:!0,userEvent:"input.type"})}function WO(t,e,M,i){let N=i.stringPrefixes||SO.stringPrefixes,o=null,n=t.changeByRange((i=>{if(!i.empty)return{changes:[{insert:e,from:i.from},{insert:e,from:i.to}],effects:QO.of(i.to+e.length),range:Vo.range(i.anchor+e.length,i.head+e.length)};let n,s=i.head,r=vO(t.doc,s);if(r==e){if(PO(t,s))return{changes:{insert:e+e,from:s},effects:QO.of(s+e.length),range:Vo.cursor(s+e.length)};if(fO(t,s)){let i=M&&t.sliceDoc(s,s+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:s,to:s+i.length,insert:i},range:Vo.cursor(s+i.length)}}}else{if(M&&t.sliceDoc(s-2*e.length,s)==e+e&&(n=RO(t,s-2*e.length,N))>-1&&PO(t,n))return{changes:{insert:e+e+e+e,from:s},effects:QO.of(s+e.length),range:Vo.cursor(s+e.length)};if(t.charCategorizer(s)(r)!=Qn.Word&&RO(t,s,N)>-1&&!function(t,e,M,i){let N=yj(t).resolveInner(e,-1),o=i.reduce(((t,e)=>Math.max(t,e.length)),0);for(let n=0;n<5;n++){let n=t.sliceDoc(N.from,Math.min(N.to,N.from+M.length+o)),s=n.indexOf(M);if(!s||s>-1&&i.indexOf(n.slice(0,s))>-1){let e=N.firstChild;for(;e&&e.from==N.from&&e.to-e.from>M.length+s;){if(t.sliceDoc(e.to-M.length,e.to)==M)return!1;e=e.firstChild}return!0}let r=N.to==e&&N.parent;if(!r)break;N=r}return!1}(t,s,e,N))return{changes:{insert:e+e,from:s},effects:QO.of(s+e.length),range:Vo.cursor(s+e.length)}}return{range:o=i}}));return o?null:t.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function PO(t,e){let M=yj(t).resolveInner(e+1);return M.parent&&M.from==e}function RO(t,e,M){let i=t.charCategorizer(e);if(i(t.sliceDoc(e-1,e))!=Qn.Word)return e;for(let N of M){let M=e-N.length;if(t.sliceDoc(M,e)==N&&i(t.sliceDoc(M-1,M))!=Qn.Word)return M}return-1}function GO(t={}){return[rO,KT,YT.of(t),nO,_O,DO]}const BO=[{key:"Ctrl-Space",run:NO},{mac:"Alt-`",run:NO},{key:"Escape",run:t=>{let e=t.state.field(KT,!1);return!(!e||!e.active.some((t=>0!=t.state)))&&(t.dispatch({effects:mT.of(null)}),!0)}},{key:"ArrowDown",run:MO(!0)},{key:"ArrowUp",run:MO(!1)},{key:"PageDown",run:MO(!0,"page")},{key:"PageUp",run:MO(!1,"page")},{key:"Enter",run:iO}],_O=Mn.highest(jl.computeN([YT],(t=>t.facet(YT).defaultKeymap?[BO]:[])));class FO{constructor(t,e,M){this.from=t,this.to=e,this.diagnostic=M}}class JO{constructor(t,e,M){this.diagnostics=t,this.panel=e,this.selected=M}static init(t,e,M){let i=t,N=M.facet(oy).markerFilter;N&&(i=N(i,M));let o=t.slice().sort(((t,e)=>t.from-e.from||t.to-e.to)),n=new Zn,s=[],r=0;for(let t=0;;){let e,i,N=t==o.length?null:o[t];if(!N&&!s.length)break;for(s.length?(e=r,i=s.reduce(((t,e)=>Math.min(t,e.to)),N&&N.from>e?N.from:1e8)):(e=N.from,i=N.to,s.push(N),t++);t<o.length;){let M=o[t];if(M.from!=e||!(M.to>M.from||M.to==e)){i=Math.min(M.from,i);break}s.push(M),t++,i=Math.min(M.to,i)}let D=jy(s);if(s.some((t=>t.from==t.to||t.from==t.to-1&&M.doc.lineAt(t.from).to==t.from)))n.add(e,e,lr.widget({widget:new ry(D),diagnostics:s.slice()}));else{let t=s.reduce(((t,e)=>e.markClass?t+" "+e.markClass:t),"");n.add(e,i,lr.mark({class:"cm-lintRange cm-lintRange-"+D+t,diagnostics:s.slice(),inclusiveEnd:s.some((t=>t.to>i))}))}r=i;for(let t=0;t<s.length;t++)s[t].to<=r&&s.splice(t--,1)}let D=n.finish();return new JO(D,e,HO(D))}}function HO(t,e=null,M=0){let i=null;return t.between(M,1e9,((t,M,{spec:N})=>{if(!(e&&N.diagnostics.indexOf(e)<0))if(i){if(N.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new FO(i.from,M,i.diagnostic)}else i=new FO(t,M,e||N.diagnostics[0])})),i}const XO=yn.define(),$O=yn.define(),qO=yn.define(),KO=Xo.define({create:()=>new JO(lr.none,null,null),update(t,e){if(e.docChanged&&t.diagnostics.size){let M=t.diagnostics.map(e.changes),i=null,N=t.panel;if(t.selected){let N=e.changes.mapPos(t.selected.from,1);i=HO(M,t.selected.diagnostic,N)||HO(M,null,N)}!M.size&&N&&e.state.facet(oy).autoPanel&&(N=null),t=new JO(M,N,i)}for(let M of e.effects)if(M.is(XO)){let i=e.state.facet(oy).autoPanel?M.value.length?ay.open:null:t.panel;t=JO.init(M.value,i,e.state)}else M.is($O)?t=new JO(t.diagnostics,M.value?ay.open:null,t.selected):M.is(qO)&&(t=new JO(t.diagnostics,t.panel,M.value));return t},provide:t=>[xu.from(t,(t=>t.panel)),nl.decorations.from(t,(t=>t.diagnostics))]}),ty=lr.mark({class:"cm-lintRange cm-lintRange-active"});function ey(t,e,M){let i,{diagnostics:N}=t.state.field(KO),o=-1,n=-1;N.between(e-(M<0?1:0),e+(M>0?1:0),((t,N,{spec:s})=>{if(e>=t&&e<=N&&(t==N||(e>t||M>0)&&(e<N||M<0)))return i=s.diagnostics,o=t,n=N,!1}));let s=t.state.facet(oy).tooltipFilter;return i&&s&&(i=s(i,t.state)),i?{pos:o,end:n,above:t.state.doc.lineAt(o).to<n,create:()=>({dom:My(t,i)})}:null}function My(t,e){return II("ul",{class:"cm-tooltip-lint"},e.map((e=>sy(t,e,!1))))}const iy=t=>{let e=t.state.field(KO,!1);return!(!e||!e.panel)&&(t.dispatch({effects:$O.of(!1)}),!0)},Ny=[{key:"Mod-Shift-m",run:t=>{let e=t.state.field(KO,!1);var M,i;e&&e.panel||t.dispatch({effects:(M=t.state,i=[$O.of(!0)],M.field(KO,!1)?i:i.concat(yn.appendConfig.of(cy)))});let N=du(t,ay.open);return N&&N.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(KO,!1);if(!e)return!1;let M=t.state.selection.main,i=e.diagnostics.iter(M.to+1);return!(!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==M.from&&i.to==M.to))&&(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)}}],oy=Ro.define({combine:t=>Object.assign({sources:t.map((t=>t.source)).filter((t=>null!=t))},Un(t.map((t=>t.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(t,e)=>t?e?M=>t(M)||e(M):t:e}))});function ny(t){let e=[];if(t)t:for(let{name:M}of t){for(let t=0;t<M.length;t++){let i=M[t];if(/[a-zA-Z]/.test(i)&&!e.some((t=>t.toLowerCase()==i.toLowerCase()))){e.push(i);continue t}}e.push("")}return e}function sy(t,e,M){var i;let N=M?ny(e.actions):[];return II("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},II("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(i=e.actions)||void 0===i?void 0:i.map(((M,i)=>{let o=!1,n=i=>{if(i.preventDefault(),o)return;o=!0;let N=HO(t.state.field(KO).diagnostics,e);N&&M.apply(t,N.from,N.to)},{name:s}=M,r=N[i]?s.indexOf(N[i]):-1,D=r<0?s:[s.slice(0,r),II("u",s.slice(r,r+1)),s.slice(r+1)];return II("button",{type:"button",class:"cm-diagnosticAction",onclick:n,onmousedown:n,"aria-label":` Action: ${s}${r<0?"":` (access key "${N[i]})"`}.`},D)})),e.source&&II("div",{class:"cm-diagnosticSource"},e.source))}class ry extends Dr{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return II("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Dy{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=sy(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ay{constructor(t){this.view=t,this.items=[];this.list=II("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e=>{if(27==e.keyCode)iy(this.view),this.view.focus();else if(38==e.keyCode||33==e.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==e.keyCode||34==e.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==e.keyCode)this.moveSelection(0);else if(35==e.keyCode)this.moveSelection(this.items.length-1);else if(13==e.keyCode)this.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:M}=this.items[this.selectedIndex],i=ny(M.actions);for(let N=0;N<i.length;N++)if(i[N].toUpperCase().charCodeAt(0)==e.keyCode){let e=HO(this.view.state.field(KO).diagnostics,M);e&&M.actions[N].apply(t,e.from,e.to)}}}e.preventDefault()},onclick:t=>{for(let e=0;e<this.items.length;e++)this.items[e].dom.contains(t.target)&&this.moveSelection(e)}}),this.dom=II("div",{class:"cm-panel-lint"},this.list,II("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>iy(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(KO).selected;if(!t)return-1;for(let e=0;e<this.items.length;e++)if(this.items[e].diagnostic==t.diagnostic)return e;return-1}update(){let{diagnostics:t,selected:e}=this.view.state.field(KO),M=0,i=!1,N=null,o=new Set;for(t.between(0,this.view.state.doc.length,((t,n,{spec:s})=>{for(let t of s.diagnostics){if(o.has(t))continue;o.add(t);let n,s=-1;for(let e=M;e<this.items.length;e++)if(this.items[e].diagnostic==t){s=e;break}s<0?(n=new Dy(this.view,t),this.items.splice(M,0,n),i=!0):(n=this.items[s],s>M&&(this.items.splice(M,s-M),i=!0)),e&&n.diagnostic==e.diagnostic?n.dom.hasAttribute("aria-selected")||(n.dom.setAttribute("aria-selected","true"),N=n):n.dom.hasAttribute("aria-selected")&&n.dom.removeAttribute("aria-selected"),M++}}));M<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new Dy(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),N?(this.list.setAttribute("aria-activedescendant",N.id),this.view.requestMeasure({key:this,read:()=>({sel:N.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:t,panel:e})=>{let M=e.height/this.list.offsetHeight;t.top<e.top?this.list.scrollTop-=(e.top-t.top)/M:t.bottom>e.bottom&&(this.list.scrollTop+=(t.bottom-e.bottom)/M)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function e(){let e=t;t=e.nextSibling,e.remove()}for(let M of this.items)if(M.dom.parentNode==this.list){for(;t!=M.dom;)e();t=M.dom.nextSibling}else this.list.insertBefore(M.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=HO(this.view.state.field(KO).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:qO.of(e)})}static open(t){return new ay(t)}}function ly(t){return function(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const uy=nl.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:ly("#d11")},".cm-lintRange-warning":{backgroundImage:ly("orange")},".cm-lintRange-info":{backgroundImage:ly("#999")},".cm-lintRange-hint":{backgroundImage:ly("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function gy(t){return"error"==t?4:"warning"==t?3:"info"==t?2:1}function jy(t){let e="hint",M=1;for(let i of t){let t=gy(i.severity);t>M&&(M=t,e=i.severity)}return e}const cy=[KO,nl.decorations.compute([KO],(t=>{let{selected:e,panel:M}=t.field(KO);return e&&M&&e.from!=e.to?lr.set([ty.range(e.from,e.to)]):lr.none})),Iu(ey,{hideOn:function(t,e){let M=e.pos,i=e.end||M,N=t.state.facet(oy).hideOn(t,M,i);if(null!=N)return N;let o=t.startState.doc.lineAt(e.pos);return!(!t.effects.some((t=>t.is(XO)))&&!t.changes.touchesRange(o.from,Math.max(o.to,i)))}}),uy];class zy{constructor(t,e,M,i,N,o,n,s,r,D=0,a){this.p=t,this.stack=e,this.state=M,this.reducePos=i,this.pos=N,this.score=o,this.buffer=n,this.bufferBase=s,this.curContext=r,this.lookAhead=D,this.parent=a}toString(){return`[${this.stack.filter(((t,e)=>e%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,M=0){let i=t.parser.context;return new zy(t,[],e,M,M,0,[],0,i?new Iy(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let M=t>>19,i=65535&t,{parser:N}=this.p,o=this.reducePos<this.pos-25;o&&this.setLookAhead(this.pos);let n=N.dynamicPrecedence(i);if(n&&(this.score+=n),0==M)return this.pushState(N.getGoto(this.state,i,!0),this.reducePos),i<N.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),void this.reduceContext(i,this.reducePos);let s=this.stack.length-3*(M-1)-(262144&t?6:0),r=s?this.stack[s-2]:this.p.ranges[0].from,D=this.reducePos-r;D>=2e3&&!(null===(e=this.p.parser.nodeSet.types[i])||void 0===e?void 0:e.isAnonymous)&&(r==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=D):this.p.lastBigReductionSize<D&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=r,this.p.lastBigReductionSize=D));let a=s?this.stack[s-1]:0,l=this.bufferBase+this.buffer.length-a;if(i<N.minRepeatTerm||131072&t){let t=N.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,r,t,l+4,!0)}if(262144&t)this.state=this.stack[s];else{let t=this.stack[s-3];this.state=N.getGoto(t,i,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(i,r)}storeNode(t,e,M,i=4,N=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let t=this,i=this.buffer.length;if(0==i&&t.parent&&(i=t.bufferBase-t.parent.bufferBase,t=t.parent),i>0&&0==t.buffer[i-4]&&t.buffer[i-1]>-1){if(e==M)return;if(t.buffer[i-2]>=e)return void(t.buffer[i-2]=M)}}if(N&&this.pos!=M){let N=this.buffer.length;if(N>0&&0!=this.buffer[N-4]){let t=!1;for(let e=N;e>0&&this.buffer[e-2]>M;e-=4)if(this.buffer[e-1]>=0){t=!0;break}if(t)for(;N>0&&this.buffer[N-2]>M;)this.buffer[N]=this.buffer[N-4],this.buffer[N+1]=this.buffer[N-3],this.buffer[N+2]=this.buffer[N-2],this.buffer[N+3]=this.buffer[N-1],N-=4,i>4&&(i-=4)}this.buffer[N]=t,this.buffer[N+1]=e,this.buffer[N+2]=M,this.buffer[N+3]=i}else this.buffer.push(t,e,M,i)}shift(t,e,M,i){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=i,this.shiftContext(e,M),e<=this.p.parser.maxNode&&this.buffer.push(e,M,i,4);else{let N=t,{parser:o}=this.p;(i>this.pos||e<=o.maxNode)&&(this.pos=i,o.stateFlag(N,1)||(this.reducePos=i)),this.pushState(N,M),this.shiftContext(e,M),e<=o.maxNode&&this.buffer.push(e,M,i,4)}}apply(t,e,M,i){65536&t?this.reduce(t):this.shift(t,e,M,i)}useNode(t,e){let M=this.p.reused.length-1;(M<0||this.p.reused[M]!=t)&&(this.p.reused.push(t),M++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(M,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let M=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new zy(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,M,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let M=t<=this.p.parser.maxNode;M&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,M?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new Ty(this);;){let M=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==M)return!1;if(!(65536&M))return!0;e.reduce(M)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let M=[];for(let i,N=0;N<e.length;N+=2)(i=e[N+1])!=this.state&&this.p.parser.hasAction(i,t)&&M.push(e[N],i);if(this.stack.length<120)for(let t=0;M.length<8&&t<e.length;t+=2){let i=e[t+1];M.some(((t,e)=>1&e&&t==i))||M.push(e[t],i)}e=M}let M=[];for(let t=0;t<e.length&&M.length<4;t+=2){let i=e[t+1];if(i==this.state)continue;let N=this.split();N.pushState(i,this.pos),N.storeNode(0,N.pos,N.pos,4,!0),N.shiftContext(e[t],this.pos),N.reducePos=this.pos,N.score-=200,M.push(N)}return M}forceReduce(){let{parser:t}=this.p,e=t.stateSlot(this.state,5);if(!(65536&e))return!1;if(!t.validAction(this.state,e)){let M=e>>19,i=65535&e,N=this.stack.length-3*M;if(N<0||t.getGoto(this.stack[N],i,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],M=(i,N)=>{if(!e.includes(i))return e.push(i),t.allActions(i,(e=>{if(393216&e);else if(65536&e){let M=(e>>19)-N;if(M>1){let i=65535&e,N=this.stack.length-3*M;if(N>=0&&t.getGoto(this.stack[N],i,!1)>=0)return M<<19|65536|i}}else{let t=M(e,N+1);if(null!=t)return t}}))};return M(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||-3!=this.buffer[t])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||-4!=this.buffer[t])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new Iy(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){t>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Iy{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class Ty{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,M=t>>19;0==M?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(M-1);let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class Oy{constructor(t,e,M){this.stack=t,this.pos=e,this.index=M,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new Oy(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new Oy(this.stack,this.pos,this.index)}}function yy(t,e=Uint16Array){if("string"!=typeof t)return t;let M=null;for(let i=0,N=0;i<t.length;){let o=0;for(;;){let e=t.charCodeAt(i++),M=!1;if(126==e){o=65535;break}e>=92&&e--,e>=34&&e--;let N=e-32;if(N>=46&&(N-=46,M=!0),o+=N,M)break;o*=46}M?M[N++]=o:M=new e(o)}return M}class dy{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ay=new dy;class hy{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ay,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let M=this.range,i=this.rangeIndex,N=this.pos+t;for(;N<M.from;){if(!i)return null;let t=this.ranges[--i];N-=M.from-t.to,M=t}for(;e<0?N>M.to:N>=M.to;){if(i==this.ranges.length-1)return null;let t=this.ranges[++i];N+=t.from-M.to,M=t}return N}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e,M,i=this.chunkOff+t;if(i>=0&&i<this.chunk.length)e=this.pos+t,M=this.chunk.charCodeAt(i);else{let i=this.resolveOffset(t,1);if(null==i)return-1;if(e=i,e>=this.chunk2Pos&&e<this.chunk2Pos+this.chunk2.length)M=this.chunk2.charCodeAt(e-this.chunk2Pos);else{let t=this.rangeIndex,i=this.range;for(;i.to<=e;)i=this.ranges[++t];this.chunk2=this.input.chunk(this.chunk2Pos=e),e+this.chunk2.length>i.to&&(this.chunk2=this.chunk2.slice(0,i.to-e)),M=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),M}acceptToken(t,e=0){let M=e?this.resolveOffset(e,-1):this.pos;if(null==M||M<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=M}acceptTokenTo(t,e){this.token.value=t,this.token.end=e}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),e=this.pos+t.length;this.chunk=e>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=Ay,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let M="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(M+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return M}}class Ly{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:M}=e.p;Sy(this.data,t,e,this.id,M.data,M.tokenPrecTable)}}Ly.prototype.contextual=Ly.prototype.fallback=Ly.prototype.extend=!1;class xy{constructor(t,e,M){this.precTable=e,this.elseToken=M,this.data="string"==typeof t?yy(t):t}token(t,e){let M=t.pos,i=0;for(;;){let M=t.next<0,N=t.resolveOffset(1,1);if(Sy(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(null==this.elseToken)return;if(M||i++,null==N)break;t.reset(N,t.token)}i&&(t.reset(M,t.token),t.acceptToken(this.elseToken,i))}}xy.prototype.contextual=Ly.prototype.fallback=Ly.prototype.extend=!1;class py{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function Sy(t,e,M,i,N,o){let n=0,s=1<<i,{dialect:r}=M.p.parser;t:for(;s&t[n];){let M=t[n+1];for(let i=n+3;i<M;i+=2)if((t[i+1]&s)>0){let M=t[i];if(r.allows(M)&&(-1==e.token.value||e.token.value==M||Ey(M,e.token.value,N,o))){e.acceptToken(M);break}}let i=e.next,D=0,a=t[n+2];if(!(e.next<0&&a>D&&65535==t[M+3*a-3])){for(;D<a;){let N=D+a>>1,o=M+N+(N<<1),s=t[o],r=t[o+1]||65536;if(i<s)a=N;else{if(!(i>=r)){n=t[o+2],e.advance();continue t}D=N+1}}break}n=t[M+3*a-1]}}function Qy(t,e,M){for(let i,N=e;65535!=(i=t[N]);N++)if(i==M)return N-e;return-1}function Ey(t,e,M,i){let N=Qy(M,i,e);return N<0||Qy(M,i,t)<N}const ky="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let wy=null;function my(t,e,M){let i=t.cursor(og.IncludeAnonymous);for(i.moveTo(e);;)if(!(M<0?i.childBefore(e):i.childAfter(e)))for(;;){if((M<0?i.to<e:i.from>e)&&!i.type.isError)return M<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(M<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return M<0?0:t.length}}class Uy{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?my(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?my(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let M=this.trees[e],i=this.index[e];if(i==M.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let N=M.children[i],o=this.start[e]+M.positions[i];if(o>t)return this.nextStart=o,null;if(N instanceof ng){if(o==t){if(o<this.safeFrom)return null;let t=o+N.length;if(t<=this.safeTo){let e=N.prop(qu.lookAhead);if(!e||t+e<this.fragment.to)return N}}this.index[e]++,o+N.length>=Math.max(this.safeFrom,t)&&(this.trees.push(N),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+N.length}}}class Cy{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((t=>new dy))}getActions(t){let e=0,M=null,{parser:i}=t.p,{tokenizers:N}=i,o=i.stateSlot(t.state,3),n=t.curContext?t.curContext.hash:0,s=0;for(let i=0;i<N.length;i++){if(!(1<<i&o))continue;let r=N[i],D=this.tokens[i];if((!M||r.fallback)&&((r.contextual||D.start!=t.pos||D.mask!=o||D.context!=n)&&(this.updateCachedToken(D,r,t),D.mask=o,D.context=n),D.lookAhead>D.end+25&&(s=Math.max(D.lookAhead,s)),0!=D.value)){let i=e;if(D.extended>-1&&(e=this.addActions(t,D.extended,D.end,e)),e=this.addActions(t,D.value,D.end,e),!r.extend&&(M=D,e>i))break}}for(;this.actions.length>e;)this.actions.pop();return s&&t.setLookAhead(s),M||t.pos!=this.stream.end||(M=new dy,M.value=t.p.parser.eofTerm,M.start=M.end=t.pos,e=this.addActions(t,M.value,M.end,e)),this.mainToken=M,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new dy,{pos:M,p:i}=t;return e.start=M,e.end=Math.min(M+1,i.stream.end),e.value=M==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,M){let i=this.stream.clipPos(M.pos);if(e.token(this.stream.reset(i,t),M),t.value>-1){let{parser:e}=M.p;for(let i=0;i<e.specialized.length;i++)if(e.specialized[i]==t.value){let N=e.specializers[i](this.stream.read(t.start,t.end),M);if(N>=0&&M.p.parser.dialect.allows(N>>1)){1&N?t.extended=N>>1:t.value=N>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,M,i){for(let e=0;e<i;e+=3)if(this.actions[e]==t)return i;return this.actions[i++]=t,this.actions[i++]=e,this.actions[i++]=M,i}addActions(t,e,M,i){let{state:N}=t,{parser:o}=t.p,{data:n}=o;for(let t=0;t<2;t++)for(let s=o.stateSlot(N,t?2:1);;s+=3){if(65535==n[s]){if(1!=n[s+1]){0==i&&2==n[s+1]&&(i=this.putAction(Wy(n,s+2),e,M,i));break}s=Wy(n,s+2)}n[s]==e&&(i=this.putAction(Wy(n,s+1),e,M,i))}return i}}class Yy{constructor(t,e,M,i){this.parser=t,this.input=e,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new hy(e,i),this.tokens=new Cy(t,this.stream),this.topTerm=t.top[1];let{from:N}=i[0];this.stacks=[zy.start(this,t.top[0],N)],this.fragments=M.length&&this.stream.end-N>4*t.bufferLength?new Uy(M,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,M=this.stacks,i=this.minStackPos,N=this.stacks=[];if(this.bigReductionCount>300&&1==M.length){let[t]=M;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<M.length;o++){let n=M[o];for(;;){if(this.tokens.mainToken=null,n.pos>i)N.push(n);else{if(this.advanceStack(n,N,M))continue;{t||(t=[],e=[]),t.push(n);let M=this.tokens.getMainToken(n);e.push(M.value,M.end)}}break}}if(!N.length){let e=t&&function(t){let e=null;for(let M of t){let t=M.p.stoppedAt;(M.pos==M.p.stream.end||null!=t&&M.pos>t)&&M.p.parser.stateFlag(M.state,2)&&(!e||e.score<M.score)&&(e=M)}return e}(t);if(e)return ky&&console.log("Finish with "+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw ky&&t&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&t){let M=null!=this.stoppedAt&&t[0].pos>this.stoppedAt?t[0]:this.runRecovery(t,e,N);if(M)return ky&&console.log("Force-finish "+this.stackID(M)),this.stackToTree(M.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(N.length>t)for(N.sort(((t,e)=>e.score-t.score));N.length>t;)N.pop();N.some((t=>t.reducePos>i))&&this.recovering--}else if(N.length>1){t:for(let t=0;t<N.length-1;t++){let e=N[t];for(let M=t+1;M<N.length;M++){let i=N[M];if(e.sameState(i)||e.buffer.length>500&&i.buffer.length>500){if(!((e.score-i.score||e.buffer.length-i.buffer.length)>0)){N.splice(t--,1);continue t}N.splice(M--,1)}}}N.length>12&&N.splice(12,N.length-12)}this.minStackPos=N[0].pos;for(let t=1;t<N.length;t++)N[t].pos<this.minStackPos&&(this.minStackPos=N[t].pos);return null}stopAt(t){if(null!=this.stoppedAt&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,M){let i=t.pos,{parser:N}=this,o=ky?this.stackID(t)+" -> ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,M=e?t.curContext.hash:0;for(let n=this.fragments.nodeAt(i);n;){let i=this.parser.nodeSet.types[n.type.id]==n.type?N.getGoto(t.state,n.type.id):-1;if(i>-1&&n.length&&(!e||(n.prop(qu.contextHash)||0)==M))return t.useNode(n,i),ky&&console.log(o+this.stackID(t)+` (via reuse of ${N.getName(n.type.id)})`),!0;if(!(n instanceof ng)||0==n.children.length||n.positions[0]>0)break;let s=n.children[0];if(!(s instanceof ng&&0==n.positions[0]))break;n=s}}let n=N.stateSlot(t.state,4);if(n>0)return t.reduce(n),ky&&console.log(o+this.stackID(t)+` (via always-reduce ${N.getName(65535&n)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let s=this.tokens.getActions(t);for(let n=0;n<s.length;){let r=s[n++],D=s[n++],a=s[n++],l=n==s.length||!M,u=l?t:t.split(),g=this.tokens.mainToken;if(u.apply(r,D,g?g.start:u.pos,a),ky&&console.log(o+this.stackID(u)+` (via ${65536&r?`reduce of ${N.getName(65535&r)}`:"shift"} for ${N.getName(D)} @ ${i}${u==t?"":", split"})`),l)return!0;u.pos>i?e.push(u):M.push(u)}return!1}advanceFully(t,e){let M=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>M)return by(t,e),!0}}runRecovery(t,e,M){let i=null,N=!1;for(let o=0;o<t.length;o++){let n=t[o],s=e[o<<1],r=e[1+(o<<1)],D=ky?this.stackID(n)+" -> ":"";if(n.deadEnd){if(N)continue;if(N=!0,n.restart(),ky&&console.log(D+this.stackID(n)+" (restarted)"),this.advanceFully(n,M))continue}let a=n.split(),l=D;for(let t=0;a.forceReduce()&&t<10;t++){if(ky&&console.log(l+this.stackID(a)+" (via force-reduce)"),this.advanceFully(a,M))break;ky&&(l=this.stackID(a)+" -> ")}for(let t of n.recoverByInsert(s))ky&&console.log(D+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,M);this.stream.end>n.pos?(r==n.pos&&(r++,s=0),n.recoverByDelete(s,r),ky&&console.log(D+this.stackID(n)+` (via recover-delete ${this.parser.getName(s)})`),by(n,M)):(!i||i.score<n.score)&&(i=n)}return i}stackToTree(t){return t.close(),ng.build({buffer:Oy.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(wy||(wy=new WeakMap)).get(t);return e||wy.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function by(t,e){for(let M=0;M<e.length;M++){let i=e[M];if(i.pos==t.pos&&i.sameState(t))return void(e[M].score<t.score&&(e[M]=t))}e.push(t)}class fy{constructor(t,e,M){this.source=t,this.flags=e,this.disabled=M}allows(t){return!this.disabled||0==this.disabled[t]}}const vy=t=>t;class Zy{constructor(t){this.start=t.start,this.shift=t.shift||vy,this.reduce=t.reduce||vy,this.reuse=t.reuse||vy,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}class Vy extends pg{constructor(t){if(super(),this.wrappers=[],14!=t.version)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let M=0;M<t.repeatNodeCount;M++)e.push("");let M=Object.keys(t.topRules).map((e=>t.topRules[e][1])),i=[];for(let t=0;t<e.length;t++)i.push([]);function N(t,e,M){i[t].push([e,e.deserialize(String(M))])}if(t.nodeProps)for(let e of t.nodeProps){let t=e[0];"string"==typeof t&&(t=qu[t]);for(let M=1;M<e.length;){let i=e[M++];if(i>=0)N(i,t,e[M++]);else{let o=e[M+-i];for(let n=-i;n>0;n--)N(e[M++],t,o);M++}}}this.nodeSet=new Mg(e.map(((e,N)=>eg.define({name:N>=this.minRepeatTerm?void 0:e,id:N,props:i[N],top:M.indexOf(N)>-1,error:0==N,skipped:t.skippedNodes&&t.skippedNodes.indexOf(N)>-1})))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=Hu;let o=yy(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t<this.specializerSpecs.length;t++)this.specialized[t]=this.specializerSpecs[t].term;this.specializers=this.specializerSpecs.map(Py),this.states=yy(t.states,Uint32Array),this.data=yy(t.stateData),this.goto=yy(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map((t=>"number"==typeof t?new Ly(o,t):t)),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,M){let i=new Yy(this,t,e,M);for(let N of this.wrappers)i=N(i,t,e,M);return i}getGoto(t,e,M=!1){let i=this.goto;if(e>=i[0])return-1;for(let N=i[e+1];;){let e=i[N++],o=1&e,n=i[N++];if(o&&M)return n;for(let M=N+(e>>1);N<M;N++)if(i[N]==t)return n;if(o)return-1}}hasAction(t,e){let M=this.data;for(let i=0;i<2;i++)for(let N,o=this.stateSlot(t,i?2:1);;o+=3){if(65535==(N=M[o])){if(1!=M[o+1]){if(2==M[o+1])return Wy(M,o+2);break}N=M[o=Wy(M,o+2)]}if(N==e||0==N)return Wy(M,o+1)}return 0}stateSlot(t,e){return this.states[6*t+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){return!!this.allActions(t,(t=>t==e||null))}allActions(t,e){let M=this.stateSlot(t,4),i=M?e(M):void 0;for(let M=this.stateSlot(t,1);null==i;M+=3){if(65535==this.data[M]){if(1!=this.data[M+1])break;M=Wy(this.data,M+2)}i=e(Wy(this.data,M+1))}return i}nextStates(t){let e=[];for(let M=this.stateSlot(t,1);;M+=3){if(65535==this.data[M]){if(1!=this.data[M+1])break;M=Wy(this.data,M+2)}if(!(1&this.data[M+2])){let t=this.data[M+1];e.some(((e,M)=>1&M&&e==t))||e.push(this.data[M],t)}}return e}configure(t){let e=Object.assign(Object.create(Vy.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let M=this.topRules[t.top];if(!M)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=M}return t.tokenizers&&(e.tokenizers=this.tokenizers.map((e=>{let M=t.tokenizers.find((t=>t.from==e));return M?M.to:e}))),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map(((M,i)=>{let N=t.specializers.find((t=>t.from==M.external));if(!N)return M;let o=Object.assign(Object.assign({},M),{external:N.to});return e.specializers[i]=Py(o),o}))),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),M=e.map((()=>!1));if(t)for(let i of t.split(" ")){let t=e.indexOf(i);t>=0&&(M[t]=!0)}let i=null;for(let t=0;t<e.length;t++)if(!M[t])for(let M,N=this.dialects[e[t]];65535!=(M=this.data[N++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[M]=1;return new fy(t,M,i)}static deserialize(t){return new Vy(t)}}function Wy(t,e){return t[e]|t[e+1]<<16}function Py(t){if(t.external){let e=t.extend?1:0;return(M,i)=>t.external(M,i)<<1|e}return t.get}const Ry=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Gy=new Zy({start:!1,shift:(t,e)=>5==e||6==e||318==e?t:319==e,strict:!1}),By=new py(((t,e)=>{let{next:M}=t;(125==M||-1==M||e.context)&&t.acceptToken(316)}),{contextual:!0,fallback:!0}),_y=new py(((t,e)=>{let M,{next:i}=t;Ry.indexOf(i)>-1||(47!=i||47!=(M=t.peek(1))&&42!=M)&&(125==i||59==i||-1==i||e.context||t.acceptToken(314))}),{contextual:!0}),Fy=new py(((t,e)=>{91!=t.next||e.context||t.acceptToken(315)}),{contextual:!0}),Jy=new py(((t,e)=>{let{next:M}=t;if(43==M||45==M){if(t.advance(),M==t.next){t.advance();let M=!e.context&&e.canShift(1);t.acceptToken(M?1:2)}}else 63==M&&46==t.peek(1)&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(3))}),{contextual:!0});function Hy(t,e){return t>=65&&t<=90||t>=97&&t<=122||95==t||t>=192||!e&&t>=48&&t<=57}const Xy=new py(((t,e)=>{if(60!=t.next||!e.dialectEnabled(0))return;if(t.advance(),47==t.next)return;let M=0;for(;Ry.indexOf(t.next)>-1;)t.advance(),M++;if(Hy(t.next,!0)){for(t.advance(),M++;Hy(t.next,!1);)t.advance(),M++;for(;Ry.indexOf(t.next)>-1;)t.advance(),M++;if(44==t.next)return;for(let e=0;;e++){if(7==e){if(!Hy(t.next,!0))return;break}if(t.next!="extends".charCodeAt(e))break;t.advance(),M++}}t.acceptToken(4,-M)})),$y=Bg({"get set async static":uj.modifier,"for while do if else switch try catch finally return throw break continue default case":uj.controlKeyword,"in of await yield void typeof delete instanceof":uj.operatorKeyword,"let var const using function class extends":uj.definitionKeyword,"import export from":uj.moduleKeyword,"with debugger as new":uj.keyword,TemplateString:uj.special(uj.string),super:uj.atom,BooleanLiteral:uj.bool,this:uj.self,null:uj.null,Star:uj.modifier,VariableName:uj.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":uj.function(uj.variableName),VariableDefinition:uj.definition(uj.variableName),Label:uj.labelName,PropertyName:uj.propertyName,PrivatePropertyName:uj.special(uj.propertyName),"CallExpression/MemberExpression/PropertyName":uj.function(uj.propertyName),"FunctionDeclaration/VariableDefinition":uj.function(uj.definition(uj.variableName)),"ClassDeclaration/VariableDefinition":uj.definition(uj.className),"NewExpression/VariableName":uj.className,PropertyDefinition:uj.definition(uj.propertyName),PrivatePropertyDefinition:uj.definition(uj.special(uj.propertyName)),UpdateOp:uj.updateOperator,"LineComment Hashbang":uj.lineComment,BlockComment:uj.blockComment,Number:uj.number,String:uj.string,Escape:uj.escape,ArithOp:uj.arithmeticOperator,LogicOp:uj.logicOperator,BitOp:uj.bitwiseOperator,CompareOp:uj.compareOperator,RegExp:uj.regexp,Equals:uj.definitionOperator,Arrow:uj.function(uj.punctuation),": Spread":uj.punctuation,"( )":uj.paren,"[ ]":uj.squareBracket,"{ }":uj.brace,"InterpolationStart InterpolationEnd":uj.special(uj.brace),".":uj.derefOperator,", ;":uj.separator,"@":uj.meta,TypeName:uj.typeName,TypeDefinition:uj.definition(uj.typeName),"type enum interface implements namespace module declare":uj.definitionKeyword,"abstract global Privacy readonly override":uj.modifier,"is keyof unique infer asserts":uj.operatorKeyword,JSXAttributeValue:uj.attributeValue,JSXText:uj.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":uj.angleBracket,"JSXIdentifier JSXNameSpacedName":uj.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":uj.attributeName,"JSXBuiltin/JSXIdentifier":uj.standard(uj.tagName)}),qy={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,const:52,extends:56,this:60,true:68,false:68,null:80,void:84,typeof:88,super:104,new:138,delete:150,yield:159,await:163,class:168,public:231,private:231,protected:231,readonly:233,instanceof:252,satisfies:255,in:256,import:290,keyof:347,unique:351,infer:357,asserts:393,is:395,abstract:415,implements:417,type:419,let:422,var:424,using:427,interface:433,enum:437,namespace:443,module:445,declare:449,global:453,for:472,of:481,while:484,with:488,do:492,if:496,else:498,switch:502,case:508,try:514,catch:518,finally:522,return:526,throw:530,break:534,continue:538,debugger:542},Ky={__proto__:null,async:125,get:127,set:129,declare:191,public:193,private:193,protected:193,static:195,abstract:197,override:199,readonly:205,accessor:207,new:399},td={__proto__:null,"<":189},ed=Vy.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D_O.QQlO'#DeO.bQlO'#DpO%[QlO'#DxO0fQlO'#EQOOQ!0Lf'#EY'#EYO1PQ`O'#EVOOQO'#En'#EnOOQO'#Ij'#IjO1XQ`O'#GrO1dQ`O'#EmO1iQ`O'#EmO3hQ!0MxO'#JpO6[Q!0MxO'#JqO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#F{O9UQ`O'#FzOOQ!0Lf'#Jq'#JqOOQ!0Lb'#Jp'#JpO9ZQ`O'#GvOOQ['#K]'#K]O9fQ`O'#IWO9kQ!0LrO'#IXOOQ['#J^'#J^OOQ['#I]'#I]Q`QlOOQ`QlOOO9sQ!L^O'#DtO9zQlO'#D|O:RQlO'#EOO9aQ`O'#GrO:YQMhO'#CoO:hQ`O'#ElO:sQ`O'#EwO:xQMhO'#FdO;gQ`O'#GrOOQO'#K^'#K^O;lQ`O'#K^O;zQ`O'#GzO;zQ`O'#G{O;zQ`O'#G}O9aQ`O'#HQO<qQ`O'#HTO>YQ`O'#CeO>jQ`O'#HaO>rQ`O'#HgO>rQ`O'#HiO`QlO'#HkO>rQ`O'#HmO>rQ`O'#HpO>wQ`O'#HvO>|Q!0LsO'#H|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*lS-T'U']S0O*h*nQ0W*oQ2m-^Q4m0UR4r0XR(y#xQ!fQT-_'^-`]!qQ!r'^-`1g5qQ#p]R'g;wR)d$dY!uQ'^-`1g5qQ'i!rS's!v!yS'u!z5sS-o'j'kQ-q'lR2{-pT#kZ%dS#jZ%dS%jm,jU(e#h#i#lS.T(f(gQ.X(hQ0n+ZQ3Q.UU3R.V.W.YS6x3S3TR9T6yd#^W#W#Z%g(R([*W+W.O/hr#gZm#h#i#l%d(f(g(h+Z.U.V.W.Y3S3T6yS*Z$x*_Q/o*[Q1|,jQ2d-QQ4W/kQ6g2[Q7i4XQ8{6hT=_'V+XV#aW%g*WU#`W%g*WS(S#W([U(X#Z+W/hS-V'V+XT-y(R.OV'[!e%h*XQ$lfR)v$qT)k$l)lR3}/PT*]$x*_T*e${*WQ0q+cQ1_,QQ3V.aQ5j1aQ5u1iQ6}3ZQ8g5xQ9W6|Q:Q8fQ:d9VQ:|:SQ;U:fQ;`:}R;c;VnqOXst!Z#d%l&p&r&s&u,n,s2S2VQ&j!VR,c&gtmOXst!U!V!Z#d%l&g&p&r&s&u,n,s2S2VR,j&mT%km,jR1c,SR,b&eQ&T|R+z&UR+p&OT&n!W&qT&o!W&qT2U,s2V",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:378,context:Gy,nodeProps:[["isolate",-8,5,6,14,35,37,49,51,53,""],["group",-26,9,17,19,66,206,210,214,215,217,220,223,233,235,241,243,245,247,250,256,262,264,266,268,270,272,273,"Statement",-34,13,14,30,33,34,40,49,52,53,55,60,68,70,74,78,80,82,83,108,109,118,119,135,138,140,141,142,143,144,146,147,166,168,170,"Expression",-23,29,31,35,39,41,43,172,174,176,177,179,180,181,183,184,185,187,188,189,200,202,204,205,"Type",-3,86,101,107,"ClassItem"],["openedBy",23,"<",36,"InterpolationStart",54,"[",58,"{",71,"(",159,"JSXStartCloseTag"],["closedBy",-2,24,167,">",38,"InterpolationEnd",48,"]",59,"}",72,")",164,"JSXEndTag"]],propSources:[$y],skippedNodes:[0,5,6,276],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l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!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(a~~",141,338),new xy("j~RQYZXz{^~^O(O~~aP!P!Qd~iO(P~~",25,321)],topRules:{Script:[0,7],SingleExpression:[1,274],SingleClassItem:[2,275]},dialects:{jsx:0,ts:15091},dynamicPrecedences:{78:1,80:1,92:1,168:1,198:1},specialized:[{term:325,get:t=>qy[t]||-1},{term:341,get:t=>Ky[t]||-1},{term:93,get:t=>td[t]||-1}],tokenPrec:15116}),Md=[xO("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),xO("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),xO("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),xO("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),xO("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),xO("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),xO("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),xO("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),xO("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),xO('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),xO('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],id=Md.concat([xO("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),xO("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),xO("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Nd=new Lg,od=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function nd(t){return(e,M)=>{let i=e.node.getChild("VariableDefinition");return i&&M(i,t),!0}}const sd=["FunctionDeclaration"],rd={FunctionDeclaration:nd("function"),ClassDeclaration:nd("class"),ClassExpression:()=>!0,EnumDeclaration:nd("constant"),TypeAliasDeclaration:nd("type"),NamespaceDeclaration:nd("namespace"),VariableDefinition(t,e){t.matchContext(sd)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function Dd(t,e){let M=Nd.get(e);if(M)return M;let i=[],N=!0;function o(e,M){let N=t.sliceString(e.from,e.to);i.push({label:N,type:M})}return e.cursor(og.IncludeAnonymous).iterate((e=>{if(N)N=!1;else if(e.name){let t=rd[e.name];if(t&&t(e,o)||od.has(e.name))return!1}else if(e.to-e.from>8192){for(let M of Dd(t,e.node))i.push(M);return!1}})),Nd.set(e,i),i}const ad=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,ld=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function ud(t){let e=yj(t.state).resolveInner(t.pos,-1);if(ld.indexOf(e.name)>-1)return null;let M="VariableName"==e.name||e.to-e.from<20&&ad.test(t.state.sliceDoc(e.from,e.to));if(!M&&!t.explicit)return null;let i=[];for(let M=e;M;M=M.parent)od.has(M.name)&&(i=i.concat(Dd(t.state.doc,M)));return{options:i,from:M?e.from:t.pos,validFor:ad}}const gd=Oj.define({name:"javascript",parser:ed.configure({props:[fj.add({IfStatement:_j({except:/^\s*({|else\b)/}),TryStatement:_j({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Bj,SwitchBody:t=>{let e=t.textAfter,M=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return t.baseIndent+(M?0:i?1:2)*t.unit},Block:Rj({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":_j({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),Jj.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Hj,BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),jd={test:t=>/^JSX/.test(t.name),facet:cj({commentTokens:{block:{open:"{/*",close:"*/}"}}})},cd=gd.configure({dialect:"ts"},"typescript"),zd=gd.configure({dialect:"jsx",props:[zj.add((t=>t.isTop?[jd]:void 0))]}),Id=gd.configure({dialect:"jsx ts",props:[zj.add((t=>t.isTop?[jd]:void 0))]},"typescript");let Td=t=>({label:t,type:"keyword"});const Od="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Td),yd=Od.concat(["declare","implements","private","protected","public"].map(Td));function dd(t,e,M=t.length){for(let i=null==e?void 0:e.firstChild;i;i=i.nextSibling)if("JSXIdentifier"==i.name||"JSXBuiltin"==i.name||"JSXNamespacedName"==i.name||"JSXMemberExpression"==i.name)return t.sliceString(i.from,Math.min(i.to,M));return""}const Ad="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),hd=nl.inputHandler.of(((t,e,M,i,N)=>{if((Ad?t.composing:t.compositionStarted)||t.state.readOnly||e!=M||">"!=i&&"/"!=i||!gd.isActiveAt(t.state,e,-1))return!1;let o=N(),{state:n}=o,s=n.changeByRange((t=>{var e;let M,{head:N}=t,o=yj(n).resolveInner(N-1,-1);if("JSXStartTag"==o.name&&(o=o.parent),n.doc.sliceString(N-1,N)!=i||"JSXAttributeValue"==o.name&&o.to>N);else{if(">"==i&&"JSXFragmentTag"==o.name)return{range:t,changes:{from:N,insert:"</>"}};if("/"==i&&"JSXStartCloseTag"==o.name){let t=o.parent,i=t.parent;if(i&&t.from==N-2&&((M=dd(n.doc,i.firstChild,N))||"JSXFragmentTag"==(null===(e=i.firstChild)||void 0===e?void 0:e.name))){let t=`${M}>`;return{range:Vo.cursor(N+t.length,-1),changes:{from:N,insert:t}}}}else if(">"==i){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(o);if(e&&!/^\/?>|^<\//.test(n.doc.sliceString(N,N+2))&&(M=dd(n.doc,e,N)))return{range:t,changes:{from:N,insert:`</${M}>`}}}}return{range:t}}));return!s.changes.empty&&(t.dispatch([o,n.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));function Ld(t){return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}function xd(t,e,M){for(let i=!1;;){if(t.next<0)return;if(t.next==e&&!i)return void t.advance();i=M&&!i&&92==t.next,t.advance()}}function pd(t,e){for(;95==t.next||Ld(t.next);)null!=e&&(e+=String.fromCharCode(t.next)),t.advance();return e}function Sd(t,e){for(;48==t.next||49==t.next;)t.advance();e&&t.next==e&&t.advance()}function Qd(t,e){for(;;){if(46==t.next){if(e)break;e=!0}else if(t.next<48||t.next>57)break;t.advance()}if(69==t.next||101==t.next)for(t.advance(),43!=t.next&&45!=t.next||t.advance();t.next>=48&&t.next<=57;)t.advance()}function Ed(t){for(;!(t.next<0||10==t.next);)t.advance()}function kd(t,e){for(let M=0;M<e.length;M++)if(e.charCodeAt(M)==t)return!0;return!1}const wd=" \t\r\n";function md(t,e,M){let i=Object.create(null);i.true=i.false=5,i.null=i.unknown=6;for(let e of t.split(" "))e&&(i[e]=20);for(let t of e.split(" "))t&&(i[t]=21);for(let t of(M||"").split(" "))t&&(i[t]=24);return i}const Ud={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:md("absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ","array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ")};function Cd(t){return new py((e=>{var M;let{next:i}=e;if(e.advance(),kd(i,wd)){for(;kd(e.next,wd);)e.advance();e.acceptToken(36)}else if(36==i&&t.doubleDollarQuotedStrings){let t=pd(e,"");36==e.next&&(e.advance(),function(t,e){t:for(;;){if(t.next<0)return console.log("exit at end",t.pos);if(36==t.next){t.advance();for(let M=0;M<e.length;M++){if(t.next!=e.charCodeAt(M))continue t;t.advance()}if(36==t.next)return void t.advance()}else t.advance()}}(e,t),e.acceptToken(3))}else if(39==i||34==i&&t.doubleQuotedStrings)xd(e,i,t.backslashEscapes),e.acceptToken(3);else if(35==i&&t.hashComments||47==i&&47==e.next&&t.slashComments)Ed(e),e.acceptToken(1);else if(45!=i||45!=e.next||t.spaceAfterDashes&&32!=e.peek(1))if(47==i&&42==e.next){e.advance();for(let t=1;;){let M=e.next;if(e.next<0)break;if(e.advance(),42==M&&47==e.next){if(t--,e.advance(),!t)break}else 47==M&&42==e.next&&(t++,e.advance())}e.acceptToken(2)}else if(101!=i&&69!=i||39!=e.next)if(110!=i&&78!=i||39!=e.next||!t.charSetCasts)if(95==i&&t.charSetCasts)for(let M=0;;M++){if(39==e.next&&M>1){e.advance(),xd(e,39,t.backslashEscapes),e.acceptToken(3);break}if(!Ld(e.next))break;e.advance()}else if(t.plsqlQuotingMechanism&&(113==i||81==i)&&39==e.next&&e.peek(1)>0&&!kd(e.peek(1),wd)){let t=e.peek(1);e.advance(2),function(t,e){let M="[{<(".indexOf(String.fromCharCode(e)),i=M<0?e:"]}>)".charCodeAt(M);for(;;){if(t.next<0)return;if(t.next==i&&39==t.peek(1))return void t.advance(2);t.advance()}}(e,t),e.acceptToken(3)}else if(40==i)e.acceptToken(7);else if(41==i)e.acceptToken(8);else if(123==i)e.acceptToken(9);else if(125==i)e.acceptToken(10);else if(91==i)e.acceptToken(11);else if(93==i)e.acceptToken(12);else if(59==i)e.acceptToken(13);else if(t.unquotedBitLiterals&&48==i&&98==e.next)e.advance(),Sd(e),e.acceptToken(22);else if(98!=i&&66!=i||39!=e.next&&34!=e.next){if(48==i&&(120==e.next||88==e.next)||(120==i||88==i)&&39==e.next){let t=39==e.next;for(e.advance();(N=e.next)>=48&&N<=57||N>=97&&N<=102||N>=65&&N<=70;)e.advance();t&&39==e.next&&e.advance(),e.acceptToken(4)}else if(46==i&&e.next>=48&&e.next<=57)Qd(e,!0),e.acceptToken(4);else if(46==i)e.acceptToken(14);else if(i>=48&&i<=57)Qd(e,!1),e.acceptToken(4);else if(kd(i,t.operatorChars)){for(;kd(e.next,t.operatorChars);)e.advance();e.acceptToken(15)}else if(kd(i,t.specialVar))e.next==i&&e.advance(),function(t){if(39==t.next||34==t.next||96==t.next){let e=t.next;t.advance(),xd(t,e,!1)}else pd(t)}(e),e.acceptToken(17);else if(kd(i,t.identifierQuotes))xd(e,i,!1),e.acceptToken(19);else if(58==i||44==i)e.acceptToken(16);else if(Ld(i)){let N=pd(e,String.fromCharCode(i));e.acceptToken(46==e.next||46==e.peek(-N.length-1)?18:null!==(M=t.words[N.toLowerCase()])&&void 0!==M?M:18)}}else{const M=e.next;e.advance(),t.treatBitsAsBytes?(xd(e,M,t.backslashEscapes),e.acceptToken(23)):(Sd(e,M),e.acceptToken(22))}else e.advance(),xd(e,39,t.backslashEscapes),e.acceptToken(3);else e.advance(),xd(e,39,!0),e.acceptToken(3);else Ed(e),e.acceptToken(1);var N}))}const Yd=Cd(Ud),bd=Vy.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,Yd],topRules:{Script:[0,25]},tokenPrec:0});function fd(t){let e=t.cursor().moveTo(t.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function vd(t,e){let M=t.sliceString(e.from,e.to),i=/^([`'"])(.*)\1$/.exec(M);return i?i[2]:M}function Zd(t){return t&&("Identifier"==t.name||"QuotedIdentifier"==t.name)}function Vd(t,e){if("CompositeIdentifier"==e.name){let M=[];for(let i=e.firstChild;i;i=i.nextSibling)Zd(i)&&M.push(vd(t,i));return M}return[vd(t,e)]}function Wd(t,e){for(let M=[];;){if(!e||"."!=e.name)return M;let i=fd(e);if(!Zd(i))return M;M.unshift(vd(t,i)),e=fd(i)}}function Pd(t,e){let M=yj(t).resolveInner(e,-1),i=function(t,e){let M;for(let t=e;!M;t=t.parent){if(!t)return null;"Statement"==t.name&&(M=t)}let i=null;for(let e=M.firstChild,N=!1,o=null;e;e=e.nextSibling){let M="Keyword"==e.name?t.sliceString(e.from,e.to).toLowerCase():null,n=null;if(N)if("as"==M&&o&&Zd(e.nextSibling))n=vd(t,e.nextSibling);else{if(M&&Rd.has(M))break;o&&Zd(e)&&(n=vd(t,e))}else N="from"==M;n&&(i||(i=Object.create(null)),i[n]=Vd(t,o)),o=/Identifier$/.test(e.name)?e:null}return i}(t.doc,M);return"Identifier"==M.name||"QuotedIdentifier"==M.name||"Keyword"==M.name?{from:M.from,quoted:"QuotedIdentifier"==M.name?t.doc.sliceString(M.from,M.from+1):null,parents:Wd(t.doc,fd(M)),aliases:i}:"."==M.name?{from:e,quoted:null,parents:Wd(t.doc,M),aliases:i}:{from:e,quoted:null,parents:[],empty:!0,aliases:i}}const Rd=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));const Gd=/^\w*$/,Bd=/^[`'"]?\w*[`'"]?$/;function _d(t){return t.self&&"string"==typeof t.self.label}class Fd{constructor(t,e){this.idQuote=t,this.idCaseInsensitive=e,this.list=[],this.children=void 0}child(t){let e=this.children||(this.children=Object.create(null)),M=e[t];return M||(t&&!this.list.some((e=>e.label==t))&&this.list.push(Jd(t,"type",this.idQuote,this.idCaseInsensitive)),e[t]=new Fd(this.idQuote,this.idCaseInsensitive))}maybeChild(t){return this.children?this.children[t]:null}addCompletion(t){let e=this.list.findIndex((e=>e.label==t.label));e>-1?this.list[e]=t:this.list.push(t)}addCompletions(t){for(let e of t)this.addCompletion("string"==typeof e?Jd(e,"property",this.idQuote,this.idCaseInsensitive):e)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):_d(t)?this.addNamespace(t.children):this.addNamespaceObject(t)}addNamespaceObject(t){for(let e of Object.keys(t)){let M=t[e],i=null,N=e.replace(/\\?\./g,(t=>"."==t?"\0":t)).split("\0"),o=this;_d(M)&&(i=M.self,M=M.children);for(let t=0;t<N.length;t++)i&&t==N.length-1&&o.addCompletion(i),o=o.child(N[t].replace(/\\\./g,"."));o.addNamespace(M)}}}function Jd(t,e,M,i){return new RegExp("^[a-z_][a-z_\\d]*$",i?"i":"").test(t)?{label:t,type:e}:{label:t,type:e,apply:M+t+M}}let Hd=bd.configure({props:[fj.add({Statement:_j()}),Jj.add({Statement:(t,e)=>({from:Math.min(t.from+100,e.doc.lineAt(t.from).to),to:t.to}),BlockComment:t=>({from:t.from+2,to:t.to-2})}),Bg({Keyword:uj.keyword,Type:uj.typeName,Builtin:uj.standard(uj.name),Bits:uj.number,Bytes:uj.string,Bool:uj.bool,Null:uj.null,Number:uj.number,String:uj.string,Identifier:uj.name,QuotedIdentifier:uj.special(uj.string),SpecialVar:uj.special(uj.name),LineComment:uj.lineComment,BlockComment:uj.blockComment,Operator:uj.operator,"Semi Punctuation":uj.punctuation,"( )":uj.paren,"{ }":uj.brace,"[ ]":uj.squareBracket})]});class Xd{constructor(t,e,M){this.dialect=t,this.language=e,this.spec=M}get extension(){return this.language.extension}static define(t){let e=function(t,e,M,i){let N={};for(let e in Ud)N[e]=(t.hasOwnProperty(e)?t:Ud)[e];return e&&(N.words=md(e,M||"",i)),N}(t,t.keywords,t.types,t.builtin),M=Oj.define({name:"sql",parser:Hd.configure({tokenizers:[{from:Yd,to:Cd(e)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new Xd(e,M,t)}}function $d(t,e=!1){return function(t,e){let M=Object.keys(t).map((M=>({label:e?M.toUpperCase():M,type:21==t[M]?"type":20==t[M]?"keyword":"variable",boost:-1})));return LT(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],hT(M))}(t.dialect.words,e)}function qd(t,e=!1){return t.language.data.of({autocomplete:$d(t,e)})}function Kd(t){return t.schema?function(t,e,M,i,N,o){var n;let s=(null===(n=null==o?void 0:o.spec.identifierQuotes)||void 0===n?void 0:n[0])||'"',r=new Fd(s,!!(null==o?void 0:o.spec.caseInsensitiveIdentifiers)),D=N?r.child(N):null;return r.addNamespace(t),e&&(D||r).addCompletions(e),M&&r.addCompletions(M),D&&r.addCompletions(D.list),i&&r.addCompletions((D||r).child(i).list),t=>{let{parents:e,from:M,quoted:N,empty:o,aliases:n}=Pd(t.state,t.pos);if(o&&!t.explicit)return null;n&&1==e.length&&(e=n[e[0]]||e);let s=r;for(let t of e){for(;!s.children||!s.children[t];)if(s==r&&D)s=D;else{if(s!=D||!i)return null;s=s.child(i)}let e=s.maybeChild(t);if(!e)return null;s=e}let a=N&&t.state.sliceDoc(t.pos,t.pos+1)==N,l=s.list;return s==r&&n&&(l=l.concat(Object.keys(n).map((t=>({label:t,type:"constant"}))))),{from:M,to:a?t.pos+1:void 0,options:(u=N,g=l,u?g.map((t=>Object.assign(Object.assign({},t),{label:t.label[0]==u?t.label:u+t.label+u,apply:void 0}))):g),validFor:N?Bd:Gd};var u,g}}(t.schema,t.tables,t.schemas,t.defaultTable,t.defaultSchema,t.dialect||eA):()=>null}function tA(t){return t.schema?(t.dialect||eA).language.data.of({autocomplete:Kd(t)}):[]}const eA=Xd.define({}),MA=Bg({String:uj.string,Number:uj.number,"True False":uj.bool,PropertyName:uj.propertyName,Null:uj.null,", :":uj.separator,"[ ]":uj.squareBracket,"{ }":uj.brace}),iA=Vy.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[MA],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),NA=Oj.define({name:"json",parser:iA.configure({props:[fj.add({Object:_j({except:/^\s*\}/}),Array:_j({except:/^\s*\]/})}),Jj.add({"Object Array":Hj})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});const oA={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},nA={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},sA={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function rA(t){return 9==t||10==t||13==t||32==t}let DA=null,aA=null,lA=0;function uA(t,e){let M=t.pos+e;if(lA==M&&aA==t)return DA;let i=t.peek(e);for(;rA(i);)i=t.peek(++e);let N="";for(;45==(o=i)||46==o||58==o||o>=65&&o<=90||95==o||o>=97&&o<=122||o>=161;)N+=String.fromCharCode(i),i=t.peek(++e);var o;return aA=t,lA=M,DA=N?N.toLowerCase():i==gA||i==jA?void 0:null}const gA=63,jA=33;function cA(t,e){this.name=t,this.parent=e}const zA=[6,10,7,8,9],IA=new Zy({start:null,shift:(t,e,M,i)=>zA.indexOf(e)>-1?new cA(uA(i,1)||"",t):t,reduce:(t,e)=>20==e&&t?t.parent:t,reuse(t,e,M,i){let N=e.type.id;return 6==N||36==N?new cA(uA(i,1)||"",t):t},strict:!1}),TA=new py(((t,e)=>{if(60!=t.next)return void(t.next<0&&e.context&&t.acceptToken(57));t.advance();let M=47==t.next;M&&t.advance();let i=uA(t,0);if(void 0===i)return;if(!i)return t.acceptToken(M?14:6);let N=e.context?e.context.name:null;if(M){if(i==N)return t.acceptToken(11);if(N&&nA[N])return t.acceptToken(57,-2);if(e.dialectEnabled(0))return t.acceptToken(12);for(let t=e.context;t;t=t.parent)if(t.name==i)return;t.acceptToken(13)}else{if("script"==i)return t.acceptToken(7);if("style"==i)return t.acceptToken(8);if("textarea"==i)return t.acceptToken(9);if(oA.hasOwnProperty(i))return t.acceptToken(10);N&&sA[N]&&sA[N][i]?t.acceptToken(57,-1):t.acceptToken(6)}}),{contextual:!0}),OA=new py((t=>{for(let e=0,M=0;;M++){if(t.next<0){M&&t.acceptToken(58);break}if(45==t.next)e++;else{if(62==t.next&&e>=2){M>=3&&t.acceptToken(58,-2);break}e=0}t.advance()}}));const yA=new py(((t,e)=>{if(47==t.next&&62==t.peek(1)){let M=e.dialectEnabled(1)||function(t){for(;t;t=t.parent)if("svg"==t.name||"math"==t.name)return!0;return!1}(e.context);t.acceptToken(M?5:4,2)}else 62==t.next&&t.acceptToken(4,1)}));function dA(t,e,M){let i=2+t.length;return new py((N=>{for(let o=0,n=0,s=0;;s++){if(N.next<0){s&&N.acceptToken(e);break}if(0==o&&60==N.next||1==o&&47==N.next||o>=2&&o<i&&N.next==t.charCodeAt(o-2))o++,n++;else if(2!=o&&o!=i||!rA(N.next)){if(o==i&&62==N.next){s>n?N.acceptToken(e,-n):N.acceptToken(M,-(n-2));break}if((10==N.next||13==N.next)&&s){N.acceptToken(e,1);break}o=n=0}else n++;N.advance()}}))}const AA=dA("script",54,1),hA=dA("style",55,2),LA=dA("textarea",56,3),xA=Bg({"Text RawText":uj.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":uj.angleBracket,TagName:uj.tagName,"MismatchedCloseTag/TagName":[uj.tagName,uj.invalid],AttributeName:uj.attributeName,"AttributeValue UnquotedAttributeValue":uj.attributeValue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pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:IA,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[xA],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P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i.getChild(27);t&&(M[e.read(t.from,t.to)]=N?26==N.type.id?e.read(N.from+1,N.to-1):e.read(N.from,N.to):"")}return M}function QA(t,e){let M=t.getChild(22);return M?e.read(M.from,M.to):" "}function EA(t,e,M){let i;for(let N of M)if(!N.attrs||N.attrs(i||(i=SA(t.node.parent.firstChild,e))))return{parser:N.parser};return null}function kA(t=[],e=[]){let M=[],i=[],N=[],o=[];for(let e of t){("script"==e.tag?M:"style"==e.tag?i:"textarea"==e.tag?N:o).push(e)}let n=e.length?Object.create(null):null;for(let t of e)(n[t.name]||(n[t.name]=[])).push(t);return s=(t,e)=>{let s=t.type.id;if(28==s)return EA(t,e,M);if(31==s)return EA(t,e,i);if(34==s)return EA(t,e,N);if(20==s&&o.length){let M,i=t.node,N=i.firstChild,n=N&&QA(N,e);if(n)for(let t of o)if(t.tag==n&&(!t.attrs||t.attrs(M||(M=SA(N,e))))){let e=i.lastChild,M=37==e.type.id?e.from:i.to;if(M>N.to)return{parser:t.parser,overlay:[{from:N.to,to:M}]}}}if(n&&23==s){let M,i=t.node;if(M=i.firstChild){let t=n[e.read(M.from,M.to)];if(t)for(let M of t){if(M.tagName&&M.tagName!=QA(i.parent,e))continue;let t=i.lastChild;if(26==t.type.id){let e=t.from+1,i=t.lastChild,N=t.to-(i&&i.isError?0:1);if(N>e)return{parser:M.parser,overlay:[{from:e,to:N}]}}else if(27==t.type.id)return{parser:M.parser,overlay:[{from:t.from,to:t.to}]}}}}return null},(t,e,M,i)=>new mg(t,s,e,M,i);var s}const wA=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function mA(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function UA(t){return t>=48&&t<=57}const CA=new py(((t,e)=>{for(let M=!1,i=0,N=0;;N++){let{next:o}=t;if(mA(o)||45==o||95==o||M&&UA(o))!M&&(45!=o||N>0)&&(M=!0),i===N&&45==o&&i++,t.advance();else{if(92!=o||10==t.peek(1)){M&&t.acceptToken(40==o?101:2==i&&e.canShift(2)?2:102);break}t.advance(),t.next>-1&&t.advance(),M=!0}}})),YA=new py((t=>{if(wA.includes(t.peek(-1))){let{next:e}=t;(mA(e)||95==e||35==e||46==e||91==e||58==e&&mA(t.peek(1))||45==e||38==e)&&t.acceptToken(100)}})),bA=new py((t=>{if(!wA.includes(t.peek(-1))){let{next:e}=t;if(37==e&&(t.advance(),t.acceptToken(1)),mA(e)){do{t.advance()}while(mA(t.next)||UA(t.next));t.acceptToken(1)}}})),fA=Bg({"AtKeyword import charset namespace keyframes media supports":uj.definitionKeyword,"from to selector":uj.keyword,NamespaceName:uj.namespace,KeyframeName:uj.labelName,KeyframeRangeName:uj.operatorKeyword,TagName:uj.tagName,ClassName:uj.className,PseudoClassName:uj.constant(uj.className),IdName:uj.labelName,"FeatureName PropertyName":uj.propertyName,AttributeName:uj.attributeName,NumberLiteral:uj.number,KeywordQuery:uj.keyword,UnaryQueryOp:uj.operatorKeyword,"CallTag ValueName":uj.atom,VariableName:uj.variableName,Callee:uj.operatorKeyword,Unit:uj.unit,"UniversalSelector NestingSelector":uj.definitionOperator,MatchOp:uj.compareOperator,"ChildOp SiblingOp, LogicOp":uj.logicOperator,BinOp:uj.arithmeticOperator,Important:uj.modifier,Comment:uj.blockComment,ColorLiteral:uj.color,"ParenthesizedContent StringLiteral":uj.string,":":uj.punctuation,"PseudoOp #":uj.derefOperator,"; ,":uj.separator,"( )":uj.paren,"[ ]":uj.squareBracket,"{ }":uj.brace}),vA={__proto__:null,lang:34,"nth-child":34,"nth-last-child":34,"nth-of-type":34,"nth-last-of-type":34,dir:34,"host-context":34,url:62,"url-prefix":62,domain:62,regexp:62,selector:140},ZA={__proto__:null,"@import":120,"@media":144,"@charset":148,"@namespace":152,"@keyframes":158,"@supports":170},VA={__proto__:null,not:134,only:134},WA=Vy.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ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w!n#R#h#tQmTR!tnQ{VR!xqQ!x}Q#Z!XR#y!zq![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%Up![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%UU$f#m$h${R$z$eq!XZ]!T!m#S#U#X#q#{$Q$[$k$l$s$x%Up![Z]!T!m#S#U#X#q#{$Q$[$k$l$s$x%UQ!f^R#l!gT#^!Z#_Q|VR!yqQ!x|R#y!yQ!PWR!{rQ!RXR!|sQxUQ!wpQ#i!cQ#o!jQ#p!kQ$}$gR%Z$|SgPwQ!phQ#s!nR$n#tZfPhw!n#ta!b[`a!V!^!`#d#eR#b!^R!g^R!i_R#n!iS$g#m$hR%X${V$e#m$h${Q!rjR#w!rQdOShPwU!ldh#tR#t!nQ$Q#SU$r$Q$x%UQ$x$[R%U$sQ#_!ZR$Y#_Q$t$QR%V$tQpUS!vp$pR$p#}Q$l#qR%R$lQ!ogS#u!o#vR#v!pQ#f!_R$`#fQ$h#mR%O$hQ$|$gR%Y$|_cOPdhw!n#t^UOPdhw!n#tQ!uoQ!}tQ#OuQ#PvQ#}#RR$a#hR$R#SQ!VZQ!d]Q#V!TQ#q!m[$P#S$Q$[$s$x%UQ$S#UQ$U#XS$j#q$lQ$o#{R%Q$kR$O#RQiPR#QwQ!c[Q!kaR#Y!VU!_[a!VQ!j`Q#c!^Q#g!`Q$^#dR$_#e",nodeNames:"⚠ Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:117,nodeProps:[["isolate",-2,3,25,""],["openedBy",18,"(",33,"[",51,"{"],["closedBy",19,")",34,"]",52,"}"]],propSources:[fA],skippedNodes:[0,3,88],repeatNodeCount:11,tokenData:"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSp`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#[~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#[~p`OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^l)[UOy%^z#]%^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%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU^QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S_Qp`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Z^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS}SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!PQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!PQp`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!]Qp`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSr^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSq^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUp`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!cQp`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!UUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!T^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!SQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[YA,bA,CA,1,2,3,4,new xy("m~RRYZ[z{a~~g~aO#_~~dP!P!Qg~lO#`~~",28,106)],topRules:{StyleSheet:[0,4],Styles:[1,87]},specialized:[{term:101,get:t=>vA[t]||-1},{term:59,get:t=>ZA[t]||-1},{term:102,get:t=>VA[t]||-1}],tokenPrec:1219});let PA=null;function RA(){if(!PA&&"object"==typeof document&&document.body){let{style:t}=document.body,e=[],M=new Set;for(let i in t)"cssText"!=i&&"cssFloat"!=i&&"string"==typeof t[i]&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))),M.has(i)||(e.push(i),M.add(i)));PA=e.sort().map((t=>({type:"property",label:t,apply:t+": "})))}return PA||[]}const GA=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map((t=>({type:"class",label:t}))),BA=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((t=>({type:"keyword",label:t}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((t=>({type:"constant",label:t})))),_A=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((t=>({type:"type",label:t}))),FA=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map((t=>({type:"keyword",label:t}))),JA=/^(\w[\w-]*|-\w[\w-]*|)$/,HA=/^-(-[\w-]*)?$/;const XA=new Lg,$A=["Declaration"];function qA(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function KA(t,e,M){if(e.to-e.from>4096){let i=XA.get(e);if(i)return i;let N=[],o=new Set,n=e.cursor(og.IncludeAnonymous);if(n.firstChild())do{for(let e of KA(t,n.node,M))o.has(e.label)||(o.add(e.label),N.push(e))}while(n.nextSibling());return XA.set(e,N),N}{let i=[],N=new Set;return e.cursor().iterate((e=>{var o;if(M(e)&&e.matchContext($A)&&":"==(null===(o=e.node.nextSibling)||void 0===o?void 0:o.name)){let M=t.sliceString(e.from,e.to);N.has(M)||(N.add(M),i.push({label:M,type:"variable"}))}})),i}}const th=t=>e=>{let{state:M,pos:i}=e,N=yj(M).resolveInner(i,-1),o=N.type.isError&&N.from==N.to-1&&"-"==M.doc.sliceString(N.from,N.to);if("PropertyName"==N.name||(o||"TagName"==N.name)&&/^(Block|Styles)$/.test(N.resolve(N.to).name))return{from:N.from,options:RA(),validFor:JA};if("ValueName"==N.name)return{from:N.from,options:BA,validFor:JA};if("PseudoClassName"==N.name)return{from:N.from,options:GA,validFor:JA};if(t(N)||(e.explicit||o)&&function(t,e){var M;if(("("==t.name||t.type.isError)&&(t=t.parent||t),"ArgList"!=t.name)return!1;let i=null===(M=t.parent)||void 0===M?void 0:M.firstChild;return"Callee"==(null==i?void 0:i.name)&&"var"==e.sliceString(i.from,i.to)}(N,M.doc))return{from:t(N)||o?N.from:i,options:KA(M.doc,qA(N),t),validFor:HA};if("TagName"==N.name){for(let{parent:t}=N;t;t=t.parent)if("Block"==t.name)return{from:N.from,options:RA(),validFor:JA};return{from:N.from,options:_A,validFor:JA}}if("AtKeyword"==N.name)return{from:N.from,options:FA,validFor:JA};if(!e.explicit)return null;let n=N.resolve(i),s=n.childBefore(i);return s&&":"==s.name&&"PseudoClassSelector"==n.name?{from:i,options:GA,validFor:JA}:s&&":"==s.name&&"Declaration"==n.name||"ArgList"==n.name?{from:i,options:BA,validFor:JA}:"Block"==n.name||"Styles"==n.name?{from:i,options:RA(),validFor:JA}:null},eh=th((t=>"VariableName"==t.name)),Mh=Oj.define({name:"css",parser:WA.configure({props:[fj.add({Declaration:_j()}),Jj.add({"Block KeyframeList":Hj})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});const ih=[xO("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),xO("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),xO("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),xO("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),xO("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),xO("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),xO("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),xO("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),xO("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),xO('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),xO('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Nh=ih.concat([xO("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),xO("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),xO("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),oh=new Lg,nh=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function sh(t){return(e,M)=>{let i=e.node.getChild("VariableDefinition");return i&&M(i,t),!0}}const rh=["FunctionDeclaration"],Dh={FunctionDeclaration:sh("function"),ClassDeclaration:sh("class"),ClassExpression:()=>!0,EnumDeclaration:sh("constant"),TypeAliasDeclaration:sh("type"),NamespaceDeclaration:sh("namespace"),VariableDefinition(t,e){t.matchContext(rh)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function ah(t,e){let M=oh.get(e);if(M)return M;let i=[],N=!0;function o(e,M){let N=t.sliceString(e.from,e.to);i.push({label:N,type:M})}return e.cursor(og.IncludeAnonymous).iterate((e=>{if(N)N=!1;else if(e.name){let t=Dh[e.name];if(t&&t(e,o)||nh.has(e.name))return!1}else if(e.to-e.from>8192){for(let M of ah(t,e.node))i.push(M);return!1}})),oh.set(e,i),i}const lh=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,uh=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function gh(t){let e=yj(t.state).resolveInner(t.pos,-1);if(uh.indexOf(e.name)>-1)return null;let M="VariableName"==e.name||e.to-e.from<20&&lh.test(t.state.sliceDoc(e.from,e.to));if(!M&&!t.explicit)return null;let i=[];for(let M=e;M;M=M.parent)nh.has(M.name)&&(i=i.concat(ah(t.state.doc,M)));return{options:i,from:M?e.from:t.pos,validFor:lh}}const jh=Oj.define({name:"javascript",parser:ed.configure({props:[fj.add({IfStatement:_j({except:/^\s*({|else\b)/}),TryStatement:_j({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Bj,SwitchBody:t=>{let e=t.textAfter,M=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return t.baseIndent+(M?0:i?1:2)*t.unit},Block:Rj({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":_j({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),Jj.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Hj,BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),ch={test:t=>/^JSX/.test(t.name),facet:cj({commentTokens:{block:{open:"{/*",close:"*/}"}}})},zh=jh.configure({dialect:"ts"},"typescript"),Ih=jh.configure({dialect:"jsx",props:[zj.add((t=>t.isTop?[ch]:void 0))]}),Th=jh.configure({dialect:"jsx ts",props:[zj.add((t=>t.isTop?[ch]:void 0))]},"typescript");let Oh=t=>({label:t,type:"keyword"});const yh="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Oh),dh=yh.concat(["declare","implements","private","protected","public"].map(Oh));function Ah(t={}){let e=t.jsx?t.typescript?Th:Ih:t.typescript?zh:jh,M=t.typescript?Nh.concat(dh):ih.concat(yh);return new kj(e,[jh.data.of({autocomplete:LT(uh,hT(M))}),jh.data.of({autocomplete:gh}),t.jsx?xh:[]])}function hh(t,e,M=t.length){for(let i=null==e?void 0:e.firstChild;i;i=i.nextSibling)if("JSXIdentifier"==i.name||"JSXBuiltin"==i.name||"JSXNamespacedName"==i.name||"JSXMemberExpression"==i.name)return t.sliceString(i.from,Math.min(i.to,M));return""}const Lh="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),xh=nl.inputHandler.of(((t,e,M,i,N)=>{if((Lh?t.composing:t.compositionStarted)||t.state.readOnly||e!=M||">"!=i&&"/"!=i||!jh.isActiveAt(t.state,e,-1))return!1;let o=N(),{state:n}=o,s=n.changeByRange((t=>{var e;let M,{head:N}=t,o=yj(n).resolveInner(N-1,-1);if("JSXStartTag"==o.name&&(o=o.parent),n.doc.sliceString(N-1,N)!=i||"JSXAttributeValue"==o.name&&o.to>N);else{if(">"==i&&"JSXFragmentTag"==o.name)return{range:t,changes:{from:N,insert:"</>"}};if("/"==i&&"JSXStartCloseTag"==o.name){let t=o.parent,i=t.parent;if(i&&t.from==N-2&&((M=hh(n.doc,i.firstChild,N))||"JSXFragmentTag"==(null===(e=i.firstChild)||void 0===e?void 0:e.name))){let t=`${M}>`;return{range:Vo.cursor(N+t.length,-1),changes:{from:N,insert:t}}}}else if(">"==i){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(o);if(e&&"JSXOpenTag"==e.name&&!/^\/?>|^<\//.test(n.doc.sliceString(N,N+2))&&(M=hh(n.doc,e,N)))return{range:t,changes:{from:N,insert:`</${M}>`}}}}return{range:t}}));return!s.changes.empty&&(t.dispatch([o,n.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),ph=["_blank","_self","_top","_parent"],Sh=["ascii","utf-8","utf-16","latin1","latin1"],Qh=["get","post","put","delete"],Eh=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],kh=["true","false"],wh={},mh={a:{attrs:{href:null,ping:null,type:null,media:null,target:ph,hreflang:null}},abbr:wh,address:wh,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:wh,aside:wh,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:wh,base:{attrs:{href:null,target:ph}},bdi:wh,bdo:wh,blockquote:{attrs:{cite:null}},body:wh,br:wh,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Eh,formmethod:Qh,formnovalidate:["novalidate"],formtarget:ph,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:wh,center:wh,cite:wh,code:wh,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:wh,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:wh,div:wh,dl:wh,dt:wh,em:wh,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:wh,figure:wh,footer:wh,form:{attrs:{action:null,name:null,"accept-charset":Sh,autocomplete:["on","off"],enctype:Eh,method:Qh,novalidate:["novalidate"],target:ph}},h1:wh,h2:wh,h3:wh,h4:wh,h5:wh,h6:wh,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:wh,hgroup:wh,hr:wh,html:{attrs:{manifest:null}},i:wh,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Eh,formmethod:Qh,formnovalidate:["novalidate"],formtarget:ph,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:wh,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:wh,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:wh,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Sh,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:wh,noscript:wh,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:wh,param:{attrs:{name:null,value:null}},pre:wh,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:wh,rt:wh,ruby:wh,samp:wh,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Sh}},section:wh,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:wh,source:{attrs:{src:null,type:null,media:null}},span:wh,strong:wh,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:wh,summary:wh,sup:wh,table:wh,tbody:wh,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:wh,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:wh,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:wh,time:{attrs:{datetime:null}},title:wh,tr:wh,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:wh,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:wh},Uh={accesskey:null,class:null,contenteditable:kh,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:kh,autocorrect:kh,autocapitalize:kh,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":kh,"aria-autocomplete":["inline","list","both","none"],"aria-busy":kh,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":kh,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":kh,"aria-hidden":kh,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":kh,"aria-multiselectable":kh,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":kh,"aria-relevant":null,"aria-required":kh,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Ch="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((t=>"on"+t));for(let t of Ch)Uh[t]=null;class Yh{constructor(t,e){this.tags=Object.assign(Object.assign({},mh),t),this.globalAttrs=Object.assign(Object.assign({},Uh),e),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}function bh(t,e,M=t.length){if(!e)return"";let i=e.firstChild,N=i&&i.getChild("TagName");return N?t.sliceString(N.from,Math.min(N.to,M)):""}function fh(t,e=!1){for(;t;t=t.parent)if("Element"==t.name){if(!e)return t;e=!1}return null}function vh(t,e,M){let i=M.tags[bh(t,fh(e))];return(null==i?void 0:i.children)||M.allTags}function Zh(t,e){let M=[];for(let i=fh(e);i&&!i.type.isTop;i=fh(i.parent)){let N=bh(t,i);if(N&&"CloseTag"==i.lastChild.name)break;N&&M.indexOf(N)<0&&("EndTag"==e.name||e.from>=i.firstChild.to)&&M.push(N)}return M}Yh.default=new Yh;const Vh=/^[:\-\.\w\u00b7-\uffff]*$/;function Wh(t,e,M,i,N){let o=/\s*>/.test(t.sliceDoc(N,N+5))?"":">",n=fh(M,!0);return{from:i,to:N,options:vh(t.doc,n,e).map((t=>({label:t,type:"type"}))).concat(Zh(t.doc,M).map(((t,e)=>({label:"/"+t,apply:"/"+t+o,type:"type",boost:99-e})))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Ph(t,e,M,i){let N=/\s*>/.test(t.sliceDoc(i,i+5))?"":">";return{from:M,to:i,options:Zh(t.doc,e).map(((t,e)=>({label:t,apply:t+N,type:"type",boost:99-e}))),validFor:Vh}}function Rh(t,e){let{state:M,pos:i}=e,N=yj(M).resolveInner(i,-1),o=N.resolve(i);for(let t,e=i;o==N&&(t=N.childBefore(e));){let M=t.lastChild;if(!M||!M.type.isError||M.from<M.to)break;o=N=t,e=M.from}return"TagName"==N.name?N.parent&&/CloseTag$/.test(N.parent.name)?Ph(M,N,N.from,i):Wh(M,t,N,N.from,i):"StartTag"==N.name?Wh(M,t,N,i,i):"StartCloseTag"==N.name||"IncompleteCloseTag"==N.name?Ph(M,N,i,i):"OpenTag"==N.name||"SelfClosingTag"==N.name||"AttributeName"==N.name?function(t,e,M,i,N){let o=fh(M),n=o?e.tags[bh(t.doc,o)]:null,s=n&&n.attrs?Object.keys(n.attrs):[];return{from:i,to:N,options:(n&&!1===n.globalAttrs?s:s.length?s.concat(e.globalAttrNames):e.globalAttrNames).map((t=>({label:t,type:"property"}))),validFor:Vh}}(M,t,N,"AttributeName"==N.name?N.from:i,i):"Is"==N.name||"AttributeValue"==N.name||"UnquotedAttributeValue"==N.name?function(t,e,M,i,N){var o;let n,s=null===(o=M.parent)||void 0===o?void 0:o.getChild("AttributeName"),r=[];if(s){let o=t.sliceDoc(s.from,s.to),D=e.globalAttrs[o];if(!D){let i=fh(M),N=i?e.tags[bh(t.doc,i)]:null;D=(null==N?void 0:N.attrs)&&N.attrs[o]}if(D){let e=t.sliceDoc(i,N).toLowerCase(),M='"',o='"';/^['"]/.test(e)?(n='"'==e[0]?/^[^"]*$/:/^[^']*$/,M="",o=t.sliceDoc(N,N+1)==e[0]?"":e[0],e=e.slice(1),i++):n=/^[^\s<>='"]*$/;for(let t of D)r.push({label:t,apply:M+t+o,type:"constant"})}}return{from:i,to:N,options:r,validFor:n}}(M,t,N,"Is"==N.name?i:N.from,i):!e.explicit||"Element"!=o.name&&"Text"!=o.name&&"Document"!=o.name?null:function(t,e,M,i){let N=[],o=0;for(let i of vh(t.doc,M,e))N.push({label:"<"+i,type:"type"});for(let e of Zh(t.doc,M))N.push({label:"</"+e+">",type:"type",boost:99-o++});return{from:i,to:i,options:N,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(M,t,N,i)}function Gh(t){let{extraTags:e,extraGlobalAttributes:M}=t,i=M||e?new Yh(e,M):Yh.default;return t=>Rh(i,t)}const Bh=jh.parser.configure({top:"SingleExpression"}),_h=[{tag:"script",attrs:t=>"text/typescript"==t.type||"ts"==t.lang,parser:zh.parser},{tag:"script",attrs:t=>"text/babel"==t.type||"text/jsx"==t.type,parser:Ih.parser},{tag:"script",attrs:t=>"text/typescript-jsx"==t.type,parser:Th.parser},{tag:"script",attrs:t=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type),parser:Bh},{tag:"script",attrs:t=>!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type),parser:jh.parser},{tag:"style",attrs:t=>(!t.lang||"css"==t.lang)&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type)),parser:Mh.parser}],Fh=[{name:"style",parser:Mh.parser.configure({top:"Styles"})}].concat(Ch.map((t=>({name:t,parser:jh.parser})))),Jh=Oj.define({name:"html",parser:pA.configure({props:[fj.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag":t=>t.column(t.node.from)+t.unit,Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e,M=null;for(let e=t.node;;){let t=e.lastChild;if(!t||"Element"!=t.name||t.to!=e.to)break;M=e=t}return M&&(!(e=M.lastChild)||"CloseTag"!=e.name&&"SelfClosingTag"!=e.name)?t.lineIndent(M.from)+t.unit:null}}),Jj.add({Element(t){let e=t.firstChild,M=t.lastChild;return e&&"OpenTag"==e.name?{from:e.to,to:"CloseTag"==M.name?M.from:t.to}:null}}),mc.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Hh=Jh.configure({wrap:kA(_h,Fh)});const Xh=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),$h=nl.inputHandler.of(((t,e,M,i,N)=>{if(t.composing||t.state.readOnly||e!=M||">"!=i&&"/"!=i||!Hh.isActiveAt(t.state,e,-1))return!1;let o=N(),{state:n}=o,s=n.changeByRange((t=>{var e,M,N;let o,s=n.doc.sliceString(t.from-1,t.to)==i,{head:r}=t,D=yj(n).resolveInner(r,-1);if(s&&">"==i&&"EndTag"==D.name){let i=D.parent;if("CloseTag"!=(null===(M=null===(e=i.parent)||void 0===e?void 0:e.lastChild)||void 0===M?void 0:M.name)&&(o=bh(n.doc,i.parent,r))&&!Xh.has(o)){return{range:t,changes:{from:r,to:r+(">"===n.doc.sliceString(r,r+1)?1:0),insert:`</${o}>`}}}}else if(s&&"/"==i&&"IncompleteCloseTag"==D.name){let t=D.parent;if(D.from==r-2&&"CloseTag"!=(null===(N=t.lastChild)||void 0===N?void 0:N.name)&&(o=bh(n.doc,t,r))&&!Xh.has(o)){let t=r+(">"===n.doc.sliceString(r,r+1)?1:0),e=`${o}>`;return{range:Vo.cursor(r+e.length,-1),changes:{from:r,to:t,insert:e}}}}return{range:t}}));return!s.changes.empty&&(t.dispatch([o,n.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),qh=t=>void 0===t||t,Kh=(t={})=>{let e=[];qh(t.defaultKeymap)&&e.push(...zI),qh(t.closeBracketsKeymap)&&e.push(...bO),qh(t.searchKeymap)&&e.push(...gT),qh(t.historyKeymap)&&e.push(...Oz),qh(t.foldKeymap)&&e.push(...sc),qh(t.lintKeymap)&&e.push(...Ny);const M=[];return qh(t.highlightActiveLineGutter)&&M.push(Ju),qh(t.highlightSpecialChars)&&M.push(function(t={}){return[Gl.of(t),Bl||(Bl=sD.fromClass(class{constructor(t){this.view=t,this.decorations=lr.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Gl)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Zl({regexp:t.specialChars,decoration:(e,M,i)=>{let{doc:N}=M.state,o=po(e[0],0);if(9==o){let t=N.lineAt(i),e=M.state.tabSize,o=Xn(t.text,e,i-t.from);return lr.replace({widget:new Fl((e-o%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=lr.replace({widget:new _l(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Gl);t.startState.facet(Gl)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}()),qh(t.history)&&M.push(function(t={}){return[Mz,ez.of(t),nl.domEventHandlers({beforeinput(t,e){let M="historyUndo"==t.inputType?Nz:"historyRedo"==t.inputType?oz:null;return!!M&&(t.preventDefault(),M(e))}})]}()),qh(t.foldGutter)&&M.push(function(t={}){let e=Object.assign(Object.assign({},jc),t),M=new cc(e,!0),i=new cc(e,!1),N=sD.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Ej)!=t.state.facet(Ej)||t.startState.field(Mc,!1)!=t.state.field(Mc,!1)||yj(t.startState)!=yj(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new Zn;for(let N of t.viewportLineBlocks){let o=ic(t.state,N.from,N.to)?i:$j(t.state,N.from,N.to)?M:null;o&&e.add(N.from,N.from,o)}return e.finish()}}),{domEventHandlers:o}=e;return[N,wu({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(N))||void 0===e?void 0:e.markers)||vn.empty},initialSpacer:()=>new cc(e,!1),domEventHandlers:Object.assign(Object.assign({},o),{click:(t,e,M)=>{if(o.click&&o.click(t,e,M))return!0;let i=ic(t.state,e.from,e.to);if(i)return t.dispatch({effects:tc.of(i)}),!0;let N=$j(t.state,e.from,e.to);return!!N&&(t.dispatch({effects:Kj.of(N)}),!0)}})}),ac()]}()),qh(t.drawSelection)&&M.push(function(t={}){return[Ql.of(t),kl,ml,Cl,qr.of(!0)]}()),qh(t.dropCursor)&&M.push([bl,fl]),qh(t.allowMultipleSelections)&&M.push(mn.allowMultipleSelections.of(!0)),qh(t.indentOnInput)&&M.push(mn.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let M=t.newDoc,{head:i}=t.newSelection.main,N=M.lineAt(i);if(i>N.from+200)return t;let o=M.sliceString(N.from,i);if(!e.some((t=>t.test(o))))return t;let{state:n}=t,s=-1,r=[];for(let{head:t}of n.selection.ranges){let e=n.doc.lineAt(t);if(e.from==s)continue;s=e.from;let M=Yj(n,e.from);if(null==M)continue;let i=/^\s*/.exec(e.text)[0],N=Cj(n,M);i!=N&&r.push({from:e.from,to:e.from+i.length,insert:N})}return r.length?[t,{changes:r,sequential:!0}]:t}))),qh(t.bracketMatching)&&M.push(function(t={}){return[pc.of(t),wc]}()),qh(t.closeBrackets)&&M.push([YO,kO]),qh(t.autocompletion)&&M.push(GO()),qh(t.rectangularSelection)&&M.push(function(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return nl.mouseSelectionStyle.of(((t,M)=>e(M)?Kl(t,M):null))}()),qh(t.crosshairCursor)&&M.push(function(t={}){let[e,M]=tu[t.key||"Alt"],i=sD.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventObservers:{keydown(t){this.set(t.keyCode==e||M(t))},keyup(t){t.keyCode!=e&&M(t)||this.set(!1)},mousemove(t){this.set(M(t))}}});return[i,nl.contentAttributes.of((t=>{var e;return(null===(e=t.plugin(i))||void 0===e?void 0:e.isDown)?eu:null}))]}()),qh(t.highlightActiveLine)&&M.push(Hl),qh(t.highlightSelectionMatches)&&M.push(function(t){let e=[vI,fI];return t&&e.push(UI.of(t)),e}()),t.enableSearch||M.push(jl.of([{key:"Mod-f",run:()=>!0}])),t.tabSize&&"number"==typeof t.tabSize&&M.push(mj.of(" ".repeat(t.tabSize))),M.concat([jl.of(e.flat())]).filter(Boolean)},tL={"&":{fontSize:"14px",fontFamily:"Colfax-regular",fontWeight:"400"},".cm-content":{},".cm-scroller":{scrollbarWidth:"thin"}},eL={".cm-tooltip-autocomplete":{padding:"9px 12px",backgroundColor:"#FFFFFF",display:"block",fontSize:"14px",background:"white",border:"solid 1px #C7CED4",borderRadius:"0.25rem",paddingBlock:"0",paddingInline:"0",overscrollBehavior:"none",color:"hsl(240 5.3% 26.1%)"},".cm-tooltip.cm-completionInfo.cm-completionInfo-right":{fontFamily:"colfax-regular",backgroundColor:"#FFFFFF",color:"hsl(240 5.3% 26.1%)",padding:"6px 12px",borderTopRightRadius:"0.25rem",borderBottomRightRadius:"0.25rem",border:"solid 1px #C7CED4",fontSize:"14px"},".cm-tooltip.cm-tooltip-autocomplete > ul":{fontFamily:"colfax-regular",fontWeight:"400"},".cm-tooltip.cm-tooltip-autocomplete > ul > li":{padding:"9px 12px"},".cm-tooltip.cm-tooltip-autocomplete > ul > li:hover":{backgroundColor:"#005ea61a",color:"rgb(0, 0, 0)"},'.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected="true"]':{backgroundColor:"#005ea61a",color:"#005EA6"},'.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected="true"]:hover':{color:"#005EA6"},".cm-completionIcon":{display:"block",position:"relative"},".cm-completionIcon::after":{display:"block",content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00LjM2MDExIDYuMjVMNi45ODUxMSAxLjc1TDkuNjEwMTEgNi4yNUg0LjM2MDExWk01LjY5NTExIDUuNUg4LjMxMjYxTDcuMDAwMTEgMy4yNUw1LjY5NTExIDUuNVoiIGZpbGw9ImJsYWNrIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNi4yNSAxMi4yNUgxLjc1VjcuNzVINi4yNVYxMi4yNVpNMi41IDExLjVINS41VjguNUgyLjVWMTEuNVoiIGZpbGw9ImJsYWNrIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOC43NDk5NyAxMS44NzA4QzkuMTE5OTggMTIuMTE4IDkuNTU0OTkgMTIuMjUgMTAgMTIuMjVDMTAuNTk2NyAxMi4yNSAxMS4xNjkgMTIuMDEyOSAxMS41OTEgMTEuNTkxQzEyLjAxMjkgMTEuMTY5IDEyLjI1IDEwLjU5NjcgMTIuMjUgMTBDMTIuMjUgOS41NTQ5OSAxMi4xMTggOS4xMTk5OCAxMS44NzA4IDguNzQ5OTdDMTEuNjIzNiA4LjM3OTk2IDExLjI3MjIgOC4wOTE1NyAxMC44NjEgNy45MjEyN0MxMC40NDk5IDcuNzUwOTcgOS45OTc1MSA3LjcwNjQyIDkuNTYxMDUgNy43OTMyM0M5LjEyNDU5IDcuODgwMDUgOC43MjM2OCA4LjA5NDM0IDguNDA5MDEgOC40MDkwMUM4LjA5NDM0IDguNzIzNjggNy44ODAwNSA5LjEyNDU5IDcuNzkzMjMgOS41NjEwNUM3LjcwNjQyIDkuOTk3NTEgNy43NTA5NyAxMC40NDk5IDcuOTIxMjcgMTAuODYxQzguMDkxNTcgMTEuMjcyMiA4LjM3OTk2IDExLjYyMzYgOC43NDk5NyAxMS44NzA4Wk05LjE2NjY1IDguNzUyOEM5LjQxMzMyIDguNTg3OTggOS43MDMzMyA4LjUgMTAgOC41QzEwLjM5NzggOC41IDEwLjc3OTQgOC42NTgwNCAxMS4wNjA3IDguOTM5MzRDMTEuMzQyIDkuMjIwNjUgMTEuNSA5LjYwMjE4IDExLjUgMTBDMTEuNSAxMC4yOTY3IDExLjQxMiAxMC41ODY3IDExLjI0NzIgMTAuODMzNEMxMS4wODI0IDExLjA4IDEwLjg0ODEgMTEuMjcyMyAxMC41NzQgMTEuMzg1OEMxMC4yOTk5IDExLjQ5OTQgOS45OTgzNCAxMS41MjkxIDkuNzA3MzcgMTEuNDcxMkM5LjQxNjM5IDExLjQxMzMgOS4xNDkxMiAxMS4yNzA0IDguOTM5MzQgMTEuMDYwN0M4LjcyOTU2IDEwLjg1MDkgOC41ODY3IDEwLjU4MzYgOC41Mjg4MiAxMC4yOTI2QzguNDcwOTUgMTAuMDAxNyA4LjUwMDY1IDkuNzAwMDcgOC42MTQxOCA5LjQyNTk4QzguNzI3NzEgOS4xNTE4OSA4LjkxOTk3IDguOTE3NjIgOS4xNjY2NSA4Ljc1MjhaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionMatchedText":{textDecoration:"none"},".cm-completionIcon.cm-completionIcon-property::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuNjA1MjEgMTEuOTExVjcuODg0ODFMMS44MjU3NiA1LjkxNDYxVjkuOTQwODFMNS42MDUyMSAxMS45MTFaTTYuNDMwOTcgMTEuOTExTDEyLjE3NDIgOC42MDY3OVY0LjU4MDU5TDYuNDMwOTcgNy44ODQ4MVYxMS45MTFaTTYuMDE4MDkgNy4yMzE0MUwxMS44NzI1IDMuODY5OTlMNy45NjYwMyAxLjg1Njg5TDIuMTI3NDggNS4yMTgzMUw2LjAxODA5IDcuMjMxNDFaTTEgMTAuMzc2NFY0Ljk1NzYxTDcuOTgxOTEgMUwxMyAzLjYwOTI5VjkuMDI4MDlMNi4wMTgwOSAxM0wxIDEwLjM3NjRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-keyword::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuMTk5OTUgNC4wMTQ0OUM2LjE5OTk1IDMuNzkyNyA2LjI3ODE0IDMuNjAzMjkgNi40MzQ1IDMuNDQ2MjZDNi41OTA3NyAzLjI4OTE0IDYuNzc5MjcgMy4yMTA1OCA3IDMuMjEwNThDNy4yMjA3MyAzLjIxMDU4IDcuNDA5MjMgMy4yODkxNCA3LjU2NTUgMy40NDYyNkM3LjcyMTg2IDMuNjAzMjkgNy44MDAwNSAzLjc5MjcgNy44MDAwNSA0LjAxNDQ5QzcuODAwMDUgNC4yMzYyOCA3LjcyMTg2IDQuNDI1NjkgNy41NjU1IDQuNTgyNzJDNy40MDkyMyA0LjczOTg0IDcuMjIwNzMgNC44MTg0ID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TUzMjMgNS4wNDM2NiA5LjMxNDY0IDQuNTY0OTUgOS4zMTQ2NCA0LjAxNDQ5QzkuMzE0NjQgMy4zNzA4NSA5LjA4OSAyLjgyMjMxIDguNjM3NzMgMi4zNjg4NUM4LjE4NjQ1IDEuOTE1NCA3LjY0MDU1IDEuNjg4NjcgNyAxLjY4ODY3QzYuMzU5NDUgMS42ODg2NyA1LjgxMzU1IDEuOTE1NCA1LjM2MjI3IDIuMzY4ODVDNC45MTEgMi44MjIzMSA0LjY4NTM2IDMuMzcwODUgNC42ODUzNiA0LjAxNDQ5WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-variable::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuNjA1MjEgMTEuOTExVjcuODg0ODFMMS44MjU3NiA1LjkxNDYxVjkuOTQwODFMNS42MDUyMSAxMS45MTFaTTYuNDMwOTcgMTEuOTExTDEyLjE3NDIgOC42MDY3OVY0LjU4MDU5TDYuNDMwOTcgNy44ODQ4MVYxMS45MTFaTTYuMDE4MDkgNy4yMzE0MUwxMS44NzI1IDMuODY5OTlMNy45NjYwMyAxLjg1Njg5TDIuMTI3NDggNS4yMTgzMUw2LjAxODA5IDcuMjMxNDFaTTEgMTAuMzc2NFY0Ljk1NzYxTDcuOTgxOTEgMUwxMyAzLjYwOTI5VjkuMDI4MDlMNi4wMTgwOSAxM0wxIDEwLjM3NjRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-text::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuNjA1MjEgMTEuOTExVjcuODg0ODFMMS44MjU3NiA1LjkxNDYxVjkuOTQwODFMNS42MDUyMSAxMS45MTFaTTYuNDMwOTcgMTEuOTExTDEyLjE3NDIgOC42MDY3OVY0LjU4MDU5TDYuNDMwOTcgNy44ODQ4MVYxMS45MTFaTTYuMDE4MDkgNy4yMzE0MUwxMS44NzI1IDMuODY5OTlMNy45NjYwMyAxLjg1Njg5TDIuMTI3NDggNS4yMTgzMUw2LjAxODA5IDcuMjMxNDFaTTEgMTAuMzc2NFY0Ljk1NzYxTDcuOTgxOTEgMUwxMyAzLjYwOTI5VjkuMDI4MDlMNi4wMTgwOSAxM0wxIDEwLjM3NjRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-function::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNzE5ODMgNC4zNTY0NUwzLjMxODk0IDQuODA1NjZMMy4zNTgzNCA0Ljk3NTU5SDQuMzkwNjJDNC4xNzk4MyA2LjE4NDU3IDQuMDIyMjMgNy4yNzQ0MSAzLjcxOTgzIDguOTU0MUMzLjM1ODM0IDExLjA5NjcgMy4xNTA1IDExLjYyMyAzLjAyNzM4IDExLjgxNTRDMi45MTkwMyAxMi4wMDU5IDIuNzYzNCAxMi4xMDQ1IDIuNTUyNjEgMTIuMTA0NUMyLjMyMTEzIDEyLjEwN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QzExLjgxOTUgNC4xMjU5OCAxMS4zMDUzIDQuNjI0MDIgMTAuMzE1NCA2LjA4MzAxTDEwLjExMTUgNS40NTcwM0M5LjgyNTg3IDQuNTc4MTIgOS42MzY3NSA0LjEyNTk4IDkuMjM4ODEgNC4xMjU5OEM4Ljc3NTg2IDQuMTI1OTggOC4xMzk1NSA0LjY5MDQzIDcuNTE3MDIgNS41ODQ5Nkw3LjgyMzM2IDUuOTE1MDRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-class::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuOTA2NjUgMTNMMS41IDEwVjRMNi45MDY2NSAxTDEyLjMxMzMgNFYxMEw2LjkwNjY1IDEzWk01LjE0ODk3IDUuNTA3MzJDNS4zNjUzNSA1LjI1NzQyIDUuNjI5MTQgNS4wNTkxOCA1Ljk0MDM0IDQuOTEyNTlDNi4yNTE2NSA0Ljc2NiA2LjU3Mzc1IDQuNjkyNzEgNi45MDY2NSA0LjY5MjcxQzcuMjM5NTQgNC42OTI3MSA3LjU2MTY0IDQuNzY2IDcuODcyOTYgNC45MTI1OUM4LjE4NDE1IDUuMDU5MTggOC40NDc5NCA1LjI1NzQyIDguNjY0MzIgNS41MDczMkwxMC45MjUzIDQuMjYyMjRMNi45MDY2NSAyLjAzMTc0TDIuODg3OTkgNC4yNjIyNEw1LjE0ODk3IDUuNTA3MzJaTTYuNDU4OTYgMTEuNzMzN1Y5LjI3ODJDNS45MjExNyA5LjE2Njg1IDUuNDc2ODEgOC44OTg0MSA1LjEyNTkgOC40NzI4OEM0Ljc3NDg3IDguMDQ3MjQgNC41O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EuNzMzN1oiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo= ")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionLabel":{marginLeft:"18px"}};let ML=class extends Pt{constructor(){super(...arguments),this.value="",this.expandIcon="expand-2",this.placeholder="",this.customAutoCompletions={},this.customCompletionsPaths=[],this.language="javascript",this.errorMessage="",this.error=!1,this.enableSearch=!1,this.noborder=!1,this.multiline=!1,this.enableFoldGutters=!1,this.allowVariableInCustomSuggestion=!1,this.lineNumbers=!1,this.disableSyntaxHighlighting=!1,this.customThemeCSS=eL,this.lineNumbersMultiline=!0,this.hasScroller=!0,this.expandable=!0,this.readonly=!1,this.debounce=!1,this.debounceTimeout=200,this.aboveCursor=!1,this.tabCompletion=!1,this.timeOut=null,this.lineNumbersComp=new on,this.restrictSingleLineComp=new on,this.readOnlyComp=new on,this.customCompletionComp=new on,this.placeholderComp=new on,this.defaultSyntaxHighlightingComp=new on,this.themeComp=new on,this.customAutocomplete=t=>{const e=t.state.doc.sliceString(0,t.pos),M=e.split("\n").at(-1)?.split(" ").at(-1)||"",[i,N]=function(t){const e=Math.max(t.lastIndexOf("."),t.lastIndexOf("["));return-1===e?[t,""]:[t.slice(0,e+1),t.slice(e+1)]}(M);return this.getNestedSuggestions(t,i,N)||this.getTopLevelSuggestions(t,i)},this.insertBetweenCode=t=>{const e=this.view.state.changeByRange((e=>{const{from:M,to:i}=e;return{changes:{from:M,to:i,insert:t},range:e}}));this.view.dispatch(e)}}static get styles(){return[Mo]}connectedCallback(){super.connectedCallback(),this.emit("nile-init",void 0,!1)}disconnectedCallback(){super.disconnectedCallback(),this.view.destroy(),this.emit("nile-destroy",void 0,!1)}firstUpdated(){this.createNewView(),this.emit("nile-after-init",{codeMirrorInstance:this.view,createNewView:this.createNewView,insertAtCursor:this.insertBetweenCode},!1)}getTabCompletionKeymap(){return this.tabCompletion?jl.of([{key:"Tab",run:iO}]):[]}updated(t){super.updated(t),t.has("value")&&this.view.state.doc.toString()!=this.value&&this.singleLineMultiLineToggle(),t.has("multiline")&&(this.view.dispatch({effects:[this.lineNumbersComp.reconfigure(this.getLineNumbersExension()),this.restrictSingleLineComp.reconfigure(this.getSingleLineExtension())]}),this.singleLineMultiLineToggle()),t.has("readonly")&&this.view.dispatch({effects:[this.readOnlyComp.reconfigure(this.getReadOnlyExtension())]}),t.has("placeholder")&&this.view.dispatch({effects:[this.placeholderComp.reconfigure(this.getPlaceholderExtension())]}),(t.has("lineNumbers")||t.has("lineNumbersMultiline"))&&this.view.dispatch({effects:[this.lineNumbersComp.reconfigure(this.getLineNumbersExension())]}),(t.has("customAutoCompletions")||t.has("customCompletionsPaths"))&&this.view.dispatch({effects:[this.customCompletionComp.reconfigure(gd.data.of({autocomplete:this.customAutocomplete}))]}),t.has("disableSyntaxHighlighting")&&this.view.dispatch({effects:[this.defaultSyntaxHighlightingComp.reconfigure(this.getDefaultSyntaxHighlightingExtension())]}),t.has("customThemeCSS")&&this.view.dispatch({effects:[this.themeComp.reconfigure(this.getCustomThemeExtension())]})}render(){const t=!!this.errorMessage,e=!!this.error,M=!!this.noborder,i=!this.hasScroller;return R`<div
6919
+ `;let io=[],No=[];function oo(t){if(t<768)return!1;for(let e=0,M=io.length;;){let i=e+M>>1;if(t<io[i])M=i;else{if(!(t>=No[i]))return!0;e=i+1}if(e==M)return!1}}function no(t){return t>=127462&&t<=127487}(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,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e=0,M=0;e<t.length;e++)(e%2?No:io).push(M+=t[e])})();function so(t,e,M=!0,i=!0){return(M?ro:Do)(t,e,i)}function ro(t,e,M){if(e==t.length)return e;e&&lo(t.charCodeAt(e))&&uo(t.charCodeAt(e-1))&&e--;let i=ao(t,e);for(e+=go(i);e<t.length;){let N=ao(t,e);if(8205==i||8205==N||M&&oo(N))e+=go(N),i=N;else{if(!no(N))break;{let M=0,i=e-2;for(;i>=0&&no(ao(t,i));)M++,i-=2;if(M%2==0)break;e+=2}}}return e}function Do(t,e,M){for(;e>0;){let i=ro(t,e-2,M);if(i<e)return i;e--}return 0}function ao(t,e){let M=t.charCodeAt(e);if(!uo(M)||e+1==t.length)return M;let i=t.charCodeAt(e+1);return lo(i)?i-56320+(M-55296<<10)+65536:M}function lo(t){return t>=56320&&t<57344}function uo(t){return t>=55296&&t<56320}function go(t){return t<65536?1:2}class jo{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,M){[t,e]=Lo(this,t,e);let i=[];return this.decompose(0,t,i,2),M.length&&M.decompose(0,M.length,i,3),this.decompose(e,this.length,i,1),zo.from(i,this.length-(e-t)+M.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Lo(this,t,e);let M=[];return this.decompose(t,e,M,0),zo.from(M,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),M=this.length-this.scanIdentical(t,-1),i=new Oo(this),N=new Oo(t);for(let t=e,o=e;;){if(i.next(t),N.next(t),t=0,i.lineBreak!=N.lineBreak||i.done!=N.done||i.value!=N.value)return!1;if(o+=i.value.length,i.done||o>=M)return!0}}iter(t=1){return new Oo(this,t)}iterRange(t,e=this.length){return new yo(this,t,e)}iterLines(t,e){let M;if(null==t)M=this.iter();else{null==e&&(e=this.lines+1);let i=this.line(t).from;M=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Ao(M)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new co(t):zo.from(co.split(t,[])):jo.empty}}class co extends jo{constructor(t,e=function(t){let e=-1;for(let M of t)e+=M.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,M,i){for(let N=0;;N++){let o=this.text[N],n=i+o.length;if((e?M:n)>=t)return new ho(i,n,M,o);i=n+1,M++}}decompose(t,e,M,i){let N=t<=0&&e>=this.length?this:new co(To(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){let t=M.pop(),e=Io(N.text,t.text.slice(),0,N.length);if(e.length<=32)M.push(new co(e,t.length+N.length));else{let t=e.length>>1;M.push(new co(e.slice(0,t)),new co(e.slice(t)))}}else M.push(N)}replace(t,e,M){if(!(M instanceof co))return super.replace(t,e,M);[t,e]=Lo(this,t,e);let i=Io(this.text,Io(M.text,To(this.text,0,t)),e),N=this.length+M.length-(e-t);return i.length<=32?new co(i,N):zo.from(co.split(i,[]),N)}sliceString(t,e=this.length,M="\n"){[t,e]=Lo(this,t,e);let i="";for(let N=0,o=0;N<=e&&o<this.text.length;o++){let n=this.text[o],s=N+n.length;N>t&&o&&(i+=M),t<s&&e>N&&(i+=n.slice(Math.max(0,t-N),e-N)),N=s+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let M=[],i=-1;for(let N of t)M.push(N),i+=N.length+1,32==M.length&&(e.push(new co(M,i)),M=[],i=-1);return i>-1&&e.push(new co(M,i)),e}}class zo extends jo{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,M,i){for(let N=0;;N++){let o=this.children[N],n=i+o.length,s=M+o.lines-1;if((e?s:n)>=t)return o.lineInner(t,e,M,i);i=n+1,M=s+1}}decompose(t,e,M,i){for(let N=0,o=0;o<=e&&N<this.children.length;N++){let n=this.children[N],s=o+n.length;if(t<=s&&e>=o){let N=i&((o<=t?1:0)|(s>=e?2:0));o>=t&&s<=e&&!N?M.push(n):n.decompose(t-o,e-o,M,N)}o=s+1}}replace(t,e,M){if([t,e]=Lo(this,t,e),M.lines<this.lines)for(let i=0,N=0;i<this.children.length;i++){let o=this.children[i],n=N+o.length;if(t>=N&&e<=n){let s=o.replace(t-N,e-N,M),r=this.lines-o.lines+s.lines;if(s.lines<r>>4&&s.lines>r>>6){let N=this.children.slice();return N[i]=s,new zo(N,this.length-(e-t)+M.length)}return super.replace(N,n,s)}N=n+1}return super.replace(t,e,M)}sliceString(t,e=this.length,M="\n"){[t,e]=Lo(this,t,e);let i="";for(let N=0,o=0;N<this.children.length&&o<=e;N++){let n=this.children[N],s=o+n.length;o>t&&N&&(i+=M),t<s&&e>o&&(i+=n.sliceString(t-o,e-o,M)),o=s+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof zo))return 0;let M=0,[i,N,o,n]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,N+=e){if(i==o||N==n)return M;let s=this.children[i],r=t.children[N];if(s!=r)return M+s.scanIdentical(r,e);M+=s.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let M=0;for(let e of t)M+=e.lines;if(M<32){let M=[];for(let e of t)e.flatten(M);return new co(M,e)}let i=Math.max(32,M>>5),N=i<<1,o=i>>1,n=[],s=0,r=-1,D=[];function a(t){let e;if(t.lines>N&&t instanceof zo)for(let e of t.children)a(e);else t.lines>o&&(s>o||!s)?(l(),n.push(t)):t instanceof co&&s&&(e=D[D.length-1])instanceof co&&t.lines+e.lines<=32?(s+=t.lines,r+=t.length+1,D[D.length-1]=new co(e.text.concat(t.text),e.length+1+t.length)):(s+t.lines>i&&l(),s+=t.lines,r+=t.length+1,D.push(t))}function l(){0!=s&&(n.push(1==D.length?D[0]:zo.from(D,r)),r=-1,s=D.length=0)}for(let e of t)a(e);return l(),1==n.length?n[0]:new zo(n,e)}}function Io(t,e,M=0,i=1e9){for(let N=0,o=0,n=!0;o<t.length&&N<=i;o++){let s=t[o],r=N+s.length;r>=M&&(r>i&&(s=s.slice(0,i-N)),N<M&&(s=s.slice(M-N)),n?(e[e.length-1]+=s,n=!1):e.push(s)),N=r+1}return e}function To(t,e,M){return Io(t,[""],e,M)}jo.empty=new co([""],0);class Oo{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof co?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let M=this.nodes.length-1,i=this.nodes[M],N=this.offsets[M],o=N>>1,n=i instanceof co?i.text.length:i.children.length;if(o==(e>0?n:0)){if(0==M)return this.done=!0,this.value="",this;e>0&&this.offsets[M-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&N)==(e>0?0:1)){if(this.offsets[M]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof co){let N=i.text[o+(e<0?-1:0)];if(this.offsets[M]+=e,N.length>Math.max(0,t))return this.value=0==t?N:e>0?N.slice(t):N.slice(0,N.length-t),this;t-=N.length}else{let N=i.children[o+(e<0?-1:0)];t>N.length?(t-=N.length,this.offsets[M]+=e):(e<0&&this.offsets[M]--,this.nodes.push(N),this.offsets.push(e>0?1:(N instanceof co?N.text.length:N.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class yo{constructor(t,e,M){this.value="",this.done=!1,this.cursor=new Oo(t,e>M?-1:1),this.pos=e>M?t.length:0,this.from=Math.min(e,M),this.to=Math.max(e,M)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let M=e<0?this.pos-this.from:this.to-this.pos;t>M&&(t=M),M-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=M?i:e<0?i.slice(i.length-M):i.slice(0,M),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Ao{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:M,value:i}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):M?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(jo.prototype[Symbol.iterator]=function(){return this.iter()},Oo.prototype[Symbol.iterator]=yo.prototype[Symbol.iterator]=Ao.prototype[Symbol.iterator]=function(){return this});class ho{constructor(t,e,M,i){this.from=t,this.to=e,this.number=M,this.text=i}get length(){return this.to-this.from}}function Lo(t,e,M){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,M))]}function xo(t,e,M=!0,i=!0){return so(t,e,M,i)}function po(t,e){let M=t.charCodeAt(e);if(!(i=M,i>=55296&&i<56320&&e+1!=t.length))return M;var i;let N=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344}(N)?N-56320+(M-55296<<10)+65536:M}function So(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function Qo(t){return t<65536?1:2}const Eo=/\r\n?|\n/;var ko=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(ko||(ko={}));class wo{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let M=this.sections[e+1];t+=M<0?this.sections[e]:M}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,M=0,i=0;e<this.sections.length;){let N=this.sections[e++],o=this.sections[e++];o<0?(t(M,i,N),i+=N):i+=o,M+=N}}iterChangedRanges(t,e=!1){fo(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let M=this.sections[e++],i=this.sections[e++];i<0?t.push(M,i):t.push(i,M)}return new wo(t)}composeDesc(t){return this.empty?t:t.empty?this:Yo(this,t)}mapDesc(t,e=!1){return t.empty?this:bo(this,t,e)}mapPos(t,e=-1,M=ko.Simple){let i=0,N=0;for(let o=0;o<this.sections.length;){let n=this.sections[o++],s=this.sections[o++],r=i+n;if(s<0){if(r>t)return N+(t-i);N+=n}else{if(M!=ko.Simple&&r>=t&&(M==ko.TrackDel&&i<t&&r>t||M==ko.TrackBefore&&i<t||M==ko.TrackAfter&&r>t))return null;if(r>t||r==t&&e<0&&!n)return t==i||e<0?N:N+s;N+=s}i=r}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return N}touchesRange(t,e=t){for(let M=0,i=0;M<this.sections.length&&i<=e;){let N=i+this.sections[M++];if(this.sections[M++]>=0&&i<=e&&N>=t)return!(i<t&&N>e)||"cover";i=N}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let M=this.sections[e++],i=this.sections[e++];t+=(t?" ":"")+M+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new wo(t)}static create(t){return new wo(t)}}class mo extends wo{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return fo(this,((e,M,i,N,o)=>t=t.replace(i,i+(M-e),o)),!1),t}mapDesc(t,e=!1){return bo(this,t,e,!0)}invert(t){let e=this.sections.slice(),M=[];for(let i=0,N=0;i<e.length;i+=2){let o=e[i],n=e[i+1];if(n>=0){e[i]=n,e[i+1]=o;let s=i>>1;for(;M.length<s;)M.push(jo.empty);M.push(o?t.slice(N,N+o):jo.empty)}N+=o}return new mo(e,M)}compose(t){return this.empty?t:t.empty?this:Yo(this,t,!0)}map(t,e=!1){return t.empty?this:bo(this,t,e,!0)}iterChanges(t,e=!1){fo(this,t,e)}get desc(){return wo.create(this.sections)}filter(t){let e=[],M=[],i=[],N=new vo(this);t:for(let o=0,n=0;;){let s=o==t.length?1e9:t[o++];for(;n<s||n==s&&0==N.len;){if(N.done)break t;let t=Math.min(N.len,s-n);Uo(i,t,-1);let o=-1==N.ins?-1:0==N.off?N.ins:0;Uo(e,t,o),o>0&&Co(M,e,N.text),N.forward(t),n+=t}let r=t[o++];for(;n<r;){if(N.done)break t;let t=Math.min(N.len,r-n);Uo(e,t,-1),Uo(i,t,-1==N.ins?-1:0==N.off?N.ins:0),N.forward(t),n+=t}}return{changes:new mo(e,M),filtered:wo.create(i)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let M=this.sections[e],i=this.sections[e+1];i<0?t.push(M):0==i?t.push([M]):t.push([M].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,M){let i=[],N=[],o=0,n=null;function s(t=!1){if(!t&&!i.length)return;o<e&&Uo(i,e-o,-1);let M=new mo(i,N);n=n?n.compose(M.map(n)):M,i=[],N=[],o=0}return function t(r){if(Array.isArray(r))for(let e of r)t(e);else if(r instanceof mo){if(r.length!=e)throw new RangeError(`Mismatched change set length (got ${r.length}, expected ${e})`);s(),n=n?n.compose(r.map(n)):r}else{let{from:t,to:n=t,insert:D}=r;if(t>n||t<0||n>e)throw new RangeError(`Invalid change range ${t} to ${n} (in doc of length ${e})`);let a=D?"string"==typeof D?jo.of(D.split(M||Eo)):D:jo.empty,l=a.length;if(t==n&&0==l)return;t<o&&s(),t>o&&Uo(i,t-o,-1),Uo(i,n-t,l),Co(N,i,a),o=n}}(t),s(!n),n}static empty(t){return new mo(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],M=[];for(let i=0;i<t.length;i++){let N=t[i];if("number"==typeof N)e.push(N,-1);else{if(!Array.isArray(N)||"number"!=typeof N[0]||N.some(((t,e)=>e&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==N.length)e.push(N[0],0);else{for(;M.length<i;)M.push(jo.empty);M[i]=jo.of(N.slice(1)),e.push(N[0],M[i].length)}}}return new mo(e,M)}static createSet(t,e){return new mo(t,e)}}function Uo(t,e,M,i=!1){if(0==e&&M<=0)return;let N=t.length-2;N>=0&&M<=0&&M==t[N+1]?t[N]+=e:N>=0&&0==e&&0==t[N]?t[N+1]+=M:i?(t[N]+=e,t[N+1]+=M):t.push(e,M)}function Co(t,e,M){if(0==M.length)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(M);else{for(;t.length<i;)t.push(jo.empty);t.push(M)}}function fo(t,e,M){let i=t.inserted;for(let N=0,o=0,n=0;n<t.sections.length;){let s=t.sections[n++],r=t.sections[n++];if(r<0)N+=s,o+=s;else{let D=N,a=o,l=jo.empty;for(;D+=s,a+=r,r&&i&&(l=l.append(i[n-2>>1])),!(M||n==t.sections.length||t.sections[n+1]<0);)s=t.sections[n++],r=t.sections[n++];e(N,D,o,a,l),N=D,o=a}}}function bo(t,e,M,i=!1){let N=[],o=i?[]:null,n=new vo(t),s=new vo(e);for(let t=-1;;){if(n.done&&s.len||s.done&&n.len)throw new Error("Mismatched change set lengths");if(-1==n.ins&&-1==s.ins){let t=Math.min(n.len,s.len);Uo(N,t,-1),n.forward(t),s.forward(t)}else if(s.ins>=0&&(n.ins<0||t==n.i||0==n.off&&(s.len<n.len||s.len==n.len&&!M))){let e=s.len;for(Uo(N,s.ins,-1);e;){let M=Math.min(n.len,e);n.ins>=0&&t<n.i&&n.len<=M&&(Uo(N,0,n.ins),o&&Co(o,N,n.text),t=n.i),n.forward(M),e-=M}s.next()}else{if(!(n.ins>=0)){if(n.done&&s.done)return o?mo.createSet(N,o):wo.create(N);throw new Error("Mismatched change set lengths")}{let e=0,M=n.len;for(;M;)if(-1==s.ins){let t=Math.min(M,s.len);e+=t,M-=t,s.forward(t)}else{if(!(0==s.ins&&s.len<M))break;M-=s.len,s.next()}Uo(N,e,t<n.i?n.ins:0),o&&t<n.i&&Co(o,N,n.text),t=n.i,n.forward(n.len-M)}}}}function Yo(t,e,M=!1){let i=[],N=M?[]:null,o=new vo(t),n=new vo(e);for(let t=!1;;){if(o.done&&n.done)return N?mo.createSet(i,N):wo.create(i);if(0==o.ins)Uo(i,o.len,0,t),o.next();else if(0!=n.len||n.done){if(o.done||n.done)throw new Error("Mismatched change set lengths");{let e=Math.min(o.len2,n.len),M=i.length;if(-1==o.ins){let M=-1==n.ins?-1:n.off?0:n.ins;Uo(i,e,M,t),N&&M&&Co(N,i,n.text)}else-1==n.ins?(Uo(i,o.off?0:o.len,e,t),N&&Co(N,i,o.textBit(e))):(Uo(i,o.off?0:o.len,n.off?0:n.ins,t),N&&!n.off&&Co(N,i,n.text));t=(o.ins>e||n.ins>=0&&n.len>e)&&(t||i.length>M),o.forward2(e),n.forward(e)}}else Uo(i,0,n.ins,t),N&&Co(N,i,n.text),n.next()}}class vo{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?jo.empty:t[e]}textBit(t){let{inserted:e}=this.set,M=this.i-2>>1;return M>=e.length&&!t?jo.empty:e[M].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class Zo{constructor(t,e,M){this.from=t,this.to=e,this.flags=M}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let M,i;return this.empty?M=i=t.mapPos(this.from,e):(M=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),M==this.from&&i==this.to?this:new Zo(M,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return Vo.range(t,e);let M=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return Vo.range(this.anchor,M)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Vo.range(t.anchor,t.head)}static create(t,e,M){return new Zo(t,e,M)}}class Vo{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:Vo.create(this.ranges.map((M=>M.map(t,e))),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let M=0;M<this.ranges.length;M++)if(!this.ranges[M].eq(t.ranges[M],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new Vo([this.main],0)}addRange(t,e=!0){return Vo.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let M=this.ranges.slice();return M[e]=t,Vo.create(M,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((t=>t.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Vo(t.ranges.map((t=>Zo.fromJSON(t))),t.main)}static single(t,e=t){return new Vo([Vo.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let M=0,i=0;i<t.length;i++){let N=t[i];if(N.empty?N.from<=M:N.from<M)return Vo.normalized(t.slice(),e);M=N.to}return new Vo(t,e)}static cursor(t,e=0,M,i){return Zo.create(t,t,(0==e?0:e<0?8:16)|(null==M?7:Math.min(6,M))|(null!=i?i:16777215)<<6)}static range(t,e,M,i){let N=(null!=M?M:16777215)<<6|(null==i?7:Math.min(6,i));return e<t?Zo.create(e,t,48|N):Zo.create(t,e,(e>t?8:0)|N)}static normalized(t,e=0){let M=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(M);for(let M=1;M<t.length;M++){let i=t[M],N=t[M-1];if(i.empty?i.from<=N.to:i.from<N.to){let o=N.from,n=Math.max(i.to,N.to);M<=e&&e--,t.splice(--M,2,i.anchor>i.head?Vo.range(n,o):Vo.range(o,n))}}return new Vo(t,e)}}function Wo(t,e){for(let M of t.ranges)if(M.to>e)throw new RangeError("Selection points outside of document")}let Po=0;class Ro{constructor(t,e,M,i,N){this.combine=t,this.compareInput=e,this.compare=M,this.isStatic=i,this.id=Po++,this.default=t([]),this.extensions="function"==typeof N?N(this):N}get reader(){return this}static define(t={}){return new Ro(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:Go),!!t.static,t.enables)}of(t){return new Bo([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bo(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bo(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(M=>e(M.field(t))))}}function Go(t,e){return t==e||t.length==e.length&&t.every(((t,M)=>t===e[M]))}class Bo{constructor(t,e,M,i){this.dependencies=t,this.facet=e,this.type=M,this.value=i,this.id=Po++}dynamicSlot(t){var e;let M=this.value,i=this.facet.compareInput,N=this.id,o=t[N]>>1,n=2==this.type,s=!1,r=!1,D=[];for(let M of this.dependencies)"doc"==M?s=!0:"selection"==M?r=!0:1&(null!==(e=t[M.id])&&void 0!==e?e:1)||D.push(t[M.id]);return{create:t=>(t.values[o]=M(t),1),update(t,e){if(s&&e.docChanged||r&&(e.docChanged||e.selection)||Fo(t,D)){let e=M(t);if(n?!_o(e,t.values[o],i):!i(e,t.values[o]))return t.values[o]=e,1}return 0},reconfigure:(t,e)=>{let s,r=e.config.address[N];if(null!=r){let N=Dn(e,r);if(this.dependencies.every((M=>M instanceof Ro?e.facet(M)===t.facet(M):!(M instanceof Xo)||e.field(M,!1)==t.field(M,!1)))||(n?_o(s=M(t),N,i):i(s=M(t),N)))return t.values[o]=N,0}else s=M(t);return t.values[o]=s,1}}}}function _o(t,e,M){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!M(t[i],e[i]))return!1;return!0}function Fo(t,e){let M=!1;for(let i of e)1&rn(t,i)&&(M=!0);return M}function Jo(t,e,M){let i=M.map((e=>t[e.id])),N=M.map((t=>t.type)),o=i.filter((t=>!(1&t))),n=t[e.id]>>1;function s(t){let M=[];for(let e=0;e<i.length;e++){let o=Dn(t,i[e]);if(2==N[e])for(let t of o)M.push(t);else M.push(o)}return e.combine(M)}return{create(t){for(let e of i)rn(t,e);return t.values[n]=s(t),1},update(t,M){if(!Fo(t,o))return 0;let i=s(t);return e.compare(i,t.values[n])?0:(t.values[n]=i,1)},reconfigure(t,N){let o=Fo(t,i),r=N.config.facets[e.id],D=N.facet(e);if(r&&!o&&Go(M,r))return t.values[n]=D,0;let a=s(t);return e.compare(a,D)?(t.values[n]=D,0):(t.values[n]=a,1)}}}const Ho=Ro.define({static:!0});class Xo{constructor(t,e,M,i,N){this.id=t,this.createF=e,this.updateF=M,this.compareF=i,this.spec=N,this.provides=void 0}static define(t){let e=new Xo(Po++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(Ho).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,M)=>{let i=t.values[e],N=this.updateF(i,M);return this.compareF(i,N)?0:(t.values[e]=N,1)},reconfigure:(t,M)=>{let i,N=t.facet(Ho),o=M.facet(Ho);return(i=N.find((t=>t.field==this)))&&i!=o.find((t=>t.field==this))?(t.values[e]=i.create(t),1):null!=M.config.address[this.id]?(t.values[e]=M.field(this),0):(t.values[e]=this.create(t),1)}}}init(t){return[this,Ho.of({field:this,create:t})]}get extension(){return this}}const $o=4,qo=3,Ko=2,tn=1;function en(t){return e=>new Nn(e,t)}const Mn={highest:en(0),high:en(tn),default:en(Ko),low:en(qo),lowest:en($o)};class Nn{constructor(t,e){this.inner=t,this.prec=e}}class on{of(t){return new nn(this,t)}reconfigure(t){return on.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class nn{constructor(t,e){this.compartment=t,this.inner=e}}class sn{constructor(t,e,M,i,N,o){for(this.base=t,this.compartments=e,this.dynamicSlots=M,this.address=i,this.staticValues=N,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<M.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,M){let i=[],N=Object.create(null),o=new Map;for(let M of function(t,e,M){let i=[[],[],[],[],[]],N=new Map;function o(t,n){let s=N.get(t);if(null!=s){if(s<=n)return;let e=i[s].indexOf(t);e>-1&&i[s].splice(e,1),t instanceof nn&&M.delete(t.compartment)}if(N.set(t,n),Array.isArray(t))for(let e of t)o(e,n);else if(t instanceof nn){if(M.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=e.get(t.compartment)||t.inner;M.set(t.compartment,i),o(i,n)}else if(t instanceof Nn)o(t.inner,t.prec);else if(t instanceof Xo)i[n].push(t),t.provides&&o(t.provides,n);else if(t instanceof Bo)i[n].push(t),t.facet.extensions&&o(t.facet.extensions,Ko);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(e,n)}}return o(t,Ko),i.reduce(((t,e)=>t.concat(e)))}(t,e,o))M instanceof Xo?i.push(M):(N[M.facet.id]||(N[M.facet.id]=[])).push(M);let n=Object.create(null),s=[],r=[];for(let t of i)n[t.id]=r.length<<1,r.push((e=>t.slot(e)));let D=null==M?void 0:M.config.facets;for(let t in N){let e=N[t],i=e[0].facet,o=D&&D[t]||[];if(e.every((t=>0==t.type)))if(n[i.id]=s.length<<1|1,Go(o,e))s.push(M.facet(i));else{let t=i.combine(e.map((t=>t.value)));s.push(M&&i.compare(t,M.facet(i))?M.facet(i):t)}else{for(let t of e)0==t.type?(n[t.id]=s.length<<1|1,s.push(t.value)):(n[t.id]=r.length<<1,r.push((e=>t.dynamicSlot(e))));n[i.id]=r.length<<1,r.push((t=>Jo(t,i,e)))}}let a=r.map((t=>t(n)));return new sn(t,o,a,n,s,N)}}function rn(t,e){if(1&e)return 2;let M=e>>1,i=t.status[M];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;t.status[M]=4;let N=t.computeSlot(t,t.config.dynamicSlots[M]);return t.status[M]=2|N}function Dn(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const an=Ro.define(),ln=Ro.define({combine:t=>t.some((t=>t)),static:!0}),un=Ro.define({combine:t=>t.length?t[0]:void 0,static:!0}),gn=Ro.define(),jn=Ro.define(),cn=Ro.define(),zn=Ro.define({combine:t=>!!t.length&&t[0]});class In{constructor(t,e){this.type=t,this.value=e}static define(){return new Tn}}class Tn{of(t){return new In(this,t)}}class On{constructor(t){this.map=t}of(t){return new yn(this,t)}}class yn{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new yn(this.type,e)}is(t){return this.type==t}static define(t={}){return new On(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let M=[];for(let i of t){let t=i.map(e);t&&M.push(t)}return M}}yn.reconfigure=yn.define(),yn.appendConfig=yn.define();class dn{constructor(t,e,M,i,N,o){this.startState=t,this.changes=e,this.selection=M,this.effects=i,this.annotations=N,this.scrollIntoView=o,this._doc=null,this._state=null,M&&Wo(M,e.newLength),N.some((t=>t.type==dn.time))||(this.annotations=N.concat(dn.time.of(Date.now())))}static create(t,e,M,i,N,o){return new dn(t,e,M,i,N,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(dn.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function An(t,e){let M=[];for(let i=0,N=0;;){let o,n;if(i<t.length&&(N==e.length||e[N]>=t[i]))o=t[i++],n=t[i++];else{if(!(N<e.length))return M;o=e[N++],n=e[N++]}!M.length||M[M.length-1]<o?M.push(o,n):M[M.length-1]<n&&(M[M.length-1]=n)}}function hn(t,e,M){var i;let N,o,n;return M?(N=e.changes,o=mo.empty(e.changes.length),n=t.changes.compose(e.changes)):(N=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),n=t.changes.compose(N)),{changes:n,selection:e.selection?e.selection.map(o):null===(i=t.selection)||void 0===i?void 0:i.map(N),effects:yn.mapEffects(t.effects,N).concat(yn.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Ln(t,e,M){let i=e.selection,N=Sn(e.annotations);return e.userEvent&&(N=N.concat(dn.userEvent.of(e.userEvent))),{changes:e.changes instanceof mo?e.changes:mo.of(e.changes||[],M,t.facet(un)),selection:i&&(i instanceof Vo?i:Vo.single(i.anchor,i.head)),effects:Sn(e.effects),annotations:N,scrollIntoView:!!e.scrollIntoView}}function xn(t,e,M){let i=Ln(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(M=!1);for(let N=1;N<e.length;N++){!1===e[N].filter&&(M=!1);let o=!!e[N].sequential;i=hn(i,Ln(t,e[N],o?i.changes.newLength:t.doc.length),o)}let N=dn.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(t){let e=t.startState,M=e.facet(cn),i=t;for(let N=M.length-1;N>=0;N--){let o=M[N](t);o&&Object.keys(o).length&&(i=hn(i,Ln(e,o,t.changes.newLength),!0))}return i==t?t:dn.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(M?function(t){let e=t.startState,M=!0;for(let i of e.facet(gn)){let e=i(t);if(!1===e){M=!1;break}Array.isArray(e)&&(M=!0===M?e:An(M,e))}if(!0!==M){let i,N;if(!1===M)N=t.changes.invertedDesc,i=mo.empty(e.doc.length);else{let e=t.changes.filter(M);i=e.changes,N=e.filtered.mapDesc(e.changes).invertedDesc}t=dn.create(e,i,t.selection&&t.selection.map(N),yn.mapEffects(t.effects,N),t.annotations,t.scrollIntoView)}let i=e.facet(jn);for(let M=i.length-1;M>=0;M--){let N=i[M](t);t=N instanceof dn?N:Array.isArray(N)&&1==N.length&&N[0]instanceof dn?N[0]:xn(e,Sn(N),!1)}return t}(N):N)}dn.time=In.define(),dn.userEvent=In.define(),dn.addToHistory=In.define(),dn.remote=In.define();const pn=[];function Sn(t){return null==t?pn:Array.isArray(t)?t:[t]}var Qn=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Qn||(Qn={}));const En=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let kn;try{kn=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(v){}function wn(t){return e=>{if(!/\S/.test(e))return Qn.Space;if(function(t){if(kn)return kn.test(t);for(let e=0;e<t.length;e++){let M=t[e];if(/\w/.test(M)||M>"€"&&(M.toUpperCase()!=M.toLowerCase()||En.test(M)))return!0}return!1}(e))return Qn.Word;for(let M=0;M<t.length;M++)if(e.indexOf(t[M])>-1)return Qn.Word;return Qn.Other}}class mn{constructor(t,e,M,i,N,o){this.config=t,this.doc=e,this.selection=M,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=N,o&&(o._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)rn(this,t<<1);this.computeSlot=null}field(t,e=!0){let M=this.config.address[t.id];if(null!=M)return rn(this,M),Dn(this,M);if(e)throw new RangeError("Field is not present in this state")}update(...t){return xn(this,t,!0)}applyTransaction(t){let e,M=this.config,{base:i,compartments:N}=M;for(let e of t.effects)e.is(on.reconfigure)?(M&&(N=new Map,M.compartments.forEach(((t,e)=>N.set(e,t))),M=null),N.set(e.value.compartment,e.value.extension)):e.is(yn.reconfigure)?(M=null,i=e.value):e.is(yn.appendConfig)&&(M=null,i=Sn(i).concat(e.value));if(M)e=t.startState.values.slice();else{M=sn.resolve(i,N,this),e=new mn(M,this.doc,this.selection,M.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values}let o=t.startState.facet(ln)?t.newSelection:t.newSelection.asSingle();new mn(M,t.newDoc,o,e,((e,M)=>M.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:Vo.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,M=t(e.ranges[0]),i=this.changes(M.changes),N=[M.range],o=Sn(M.effects);for(let M=1;M<e.ranges.length;M++){let n=t(e.ranges[M]),s=this.changes(n.changes),r=s.map(i);for(let t=0;t<M;t++)N[t]=N[t].map(r);let D=i.mapDesc(s,!0);N.push(n.range.map(D)),i=i.compose(r),o=yn.mapEffects(o,r).concat(yn.mapEffects(Sn(n.effects),D))}return{changes:i,selection:Vo.create(N,e.mainIndex),effects:o}}changes(t=[]){return t instanceof mo?t:mo.of(t,this.doc.length,this.facet(mn.lineSeparator))}toText(t){return jo.of(t.split(this.facet(mn.lineSeparator)||Eo))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(rn(this,e),Dn(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let M in t){let i=t[M];i instanceof Xo&&null!=this.config.address[i.id]&&(e[M]=i.spec.toJSON(this.field(t[M]),this))}return e}static fromJSON(t,e={},M){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(M)for(let e in M)if(Object.prototype.hasOwnProperty.call(t,e)){let N=M[e],o=t[e];i.push(N.init((t=>N.spec.fromJSON(o,t))))}return mn.create({doc:t.doc,selection:Vo.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=sn.resolve(t.extensions||[],new Map),M=t.doc instanceof jo?t.doc:jo.of((t.doc||"").split(e.staticFacet(mn.lineSeparator)||Eo)),i=t.selection?t.selection instanceof Vo?t.selection:Vo.single(t.selection.anchor,t.selection.head):Vo.single(0);return Wo(i,M.length),e.staticFacet(ln)||(i=i.asSingle()),new mn(e,M,i,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(mn.tabSize)}get lineBreak(){return this.facet(mn.lineSeparator)||"\n"}get readOnly(){return this.facet(zn)}phrase(t,...e){for(let e of this.facet(mn.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,M)=>{if("$"==M)return"$";let i=+(M||1);return!i||i>e.length?t:e[i-1]}))),t}languageDataAt(t,e,M=-1){let i=[];for(let N of this.facet(an))for(let o of N(this,e,M))Object.prototype.hasOwnProperty.call(o,t)&&i.push(o[t]);return i}charCategorizer(t){return wn(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:M,length:i}=this.doc.lineAt(t),N=this.charCategorizer(t),o=t-M,n=t-M;for(;o>0;){let t=xo(e,o,!1);if(N(e.slice(t,o))!=Qn.Word)break;o=t}for(;n<i;){let t=xo(e,n);if(N(e.slice(n,t))!=Qn.Word)break;n=t}return o==n?null:Vo.range(o+M,n+M)}}function Un(t,e,M={}){let i={};for(let e of t)for(let t of Object.keys(e)){let N=e[t],o=i[t];if(void 0===o)i[t]=N;else if(o===N||void 0===N);else{if(!Object.hasOwnProperty.call(M,t))throw new Error("Config merge conflict for field "+t);i[t]=M[t](o,N)}}for(let t in e)void 0===i[t]&&(i[t]=e[t]);return i}mn.allowMultipleSelections=ln,mn.tabSize=Ro.define({combine:t=>t.length?t[0]:4}),mn.lineSeparator=un,mn.readOnly=zn,mn.phrases=Ro.define({compare(t,e){let M=Object.keys(t),i=Object.keys(e);return M.length==i.length&&M.every((M=>t[M]==e[M]))}}),mn.languageData=an,mn.changeFilter=gn,mn.transactionFilter=jn,mn.transactionExtender=cn,on.reconfigure=yn.define();class Cn{eq(t){return this==t}range(t,e=t){return fn.create(t,e,this)}}Cn.prototype.startSide=Cn.prototype.endSide=0,Cn.prototype.point=!1,Cn.prototype.mapMode=ko.TrackDel;let fn=class t{constructor(t,e,M){this.from=t,this.to=e,this.value=M}static create(e,M,i){return new t(e,M,i)}};function bn(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Yn{constructor(t,e,M,i){this.from=t,this.to=e,this.value=M,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,M,i=0){let N=M?this.to:this.from;for(let o=i,n=N.length;;){if(o==n)return o;let i=o+n>>1,s=N[i]-t||(M?this.value[i].endSide:this.value[i].startSide)-e;if(i==o)return s>=0?o:n;s>=0?n=i:o=i+1}}between(t,e,M,i){for(let N=this.findIndex(e,-1e9,!0),o=this.findIndex(M,1e9,!1,N);N<o;N++)if(!1===i(this.from[N]+t,this.to[N]+t,this.value[N]))return!1}map(t,e){let M=[],i=[],N=[],o=-1,n=-1;for(let s=0;s<this.value.length;s++){let r,D,a=this.value[s],l=this.from[s]+t,u=this.to[s]+t;if(l==u){let t=e.mapPos(l,a.startSide,a.mapMode);if(null==t)continue;if(r=D=t,a.startSide!=a.endSide&&(D=e.mapPos(l,a.endSide),D<r))continue}else if(r=e.mapPos(l,a.startSide),D=e.mapPos(u,a.endSide),r>D||r==D&&a.startSide>0&&a.endSide<=0)continue;(D-r||a.endSide-a.startSide)<0||(o<0&&(o=r),a.point&&(n=Math.max(n,D-r)),M.push(a),i.push(r-o),N.push(D-o))}return{mapped:M.length?new Yn(i,N,M,n):null,pos:o}}}class vn{constructor(t,e,M,i){this.chunkPos=t,this.chunk=e,this.nextLayer=M,this.maxPoint=i}static create(t,e,M,i){return new vn(t,e,M,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:M=!1,filterFrom:i=0,filterTo:N=this.length}=t,o=t.filter;if(0==e.length&&!o)return this;if(M&&(e=e.slice().sort(bn)),this.isEmpty)return e.length?vn.of(e):this;let n=new Wn(this,null,-1).goto(0),s=0,r=[],D=new Zn;for(;n.value||s<e.length;)if(s<e.length&&(n.from-e[s].from||n.startSide-e[s].value.startSide)>=0){let t=e[s++];D.addInner(t.from,t.to,t.value)||r.push(t)}else 1==n.rangeIndex&&n.chunkIndex<this.chunk.length&&(s==e.length||this.chunkEnd(n.chunkIndex)<e[s].from)&&(!o||i>this.chunkEnd(n.chunkIndex)||N<this.chunkPos[n.chunkIndex])&&D.addChunk(this.chunkPos[n.chunkIndex],this.chunk[n.chunkIndex])?n.nextChunk():((!o||i>n.to||N<n.from||o(n.from,n.to,n.value))&&(D.addInner(n.from,n.to,n.value)||r.push(fn.create(n.from,n.to,n.value))),n.next());return D.finishInner(this.nextLayer.isEmpty&&!r.length?vn.empty:this.nextLayer.update({add:r,filter:o,filterFrom:i,filterTo:N}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],M=[],i=-1;for(let N=0;N<this.chunk.length;N++){let o=this.chunkPos[N],n=this.chunk[N],s=t.touchesRange(o,o+n.length);if(!1===s)i=Math.max(i,n.maxPoint),e.push(n),M.push(t.mapPos(o));else if(!0===s){let{mapped:N,pos:s}=n.map(o,t);N&&(i=Math.max(i,N.maxPoint),e.push(N),M.push(s))}}let N=this.nextLayer.map(t);return 0==e.length?N:new vn(M,e,N||vn.empty,i)}between(t,e,M){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let N=this.chunkPos[i],o=this.chunk[i];if(e>=N&&t<=N+o.length&&!1===o.between(N,t-N,e-N,M))return}this.nextLayer.between(t,e,M)}}iter(t=0){return Pn.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Pn.from(t).goto(e)}static compare(t,e,M,i,N=-1){let o=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=N)),n=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=N)),s=Vn(o,n,M),r=new Gn(o,s,N),D=new Gn(n,s,N);M.iterGaps(((t,e,M)=>Bn(r,t,D,e,M,i))),M.empty&&0==M.length&&Bn(r,0,D,0,0,i)}static eq(t,e,M=0,i){null==i&&(i=999999999);let N=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),o=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(N.length!=o.length)return!1;if(!N.length)return!0;let n=Vn(N,o),s=new Gn(N,n,0).goto(M),r=new Gn(o,n,0).goto(M);for(;;){if(s.to!=r.to||!_n(s.active,r.active)||s.point&&(!r.point||!s.point.eq(r.point)))return!1;if(s.to>i)return!0;s.next(),r.next()}}static spans(t,e,M,i,N=-1){let o=new Gn(t,null,N).goto(e),n=e,s=o.openStart;for(;;){let t=Math.min(o.to,M);if(o.point){let M=o.activeForPoint(o.to),N=o.pointFrom<e?M.length+1:o.point.startSide<0?M.length:Math.min(M.length,s);i.point(n,t,o.point,M,N,o.pointRank),s=Math.min(o.openEnd(t),M.length)}else t>n&&(i.span(n,t,o.active,s),s=o.openEnd(t));if(o.to>M)return s+(o.point&&o.to>M?1:0);n=o.to,o.next()}}static of(t,e=!1){let M=new Zn;for(let i of t instanceof fn?[t]:e?function(t){if(t.length>1)for(let e=t[0],M=1;M<t.length;M++){let i=t[M];if(bn(e,i)>0)return t.slice().sort(bn);e=i}return t}(t):t)M.add(i.from,i.to,i.value);return M.finish()}static join(t){if(!t.length)return vn.empty;let e=t[t.length-1];for(let M=t.length-2;M>=0;M--)for(let i=t[M];i!=vn.empty;i=i.nextLayer)e=new vn(i.chunkPos,i.chunk,e,Math.max(i.maxPoint,e.maxPoint));return e}}vn.empty=new vn([],[],null,-1),vn.empty.nextLayer=vn.empty;class Zn{finishChunk(t){this.chunks.push(new Yn(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,M){this.addInner(t,e,M)||(this.nextLayer||(this.nextLayer=new Zn)).add(t,e,M)}addInner(t,e,M){let i=t-this.lastTo||M.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||M.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=M,this.lastFrom=t,this.lastTo=e,this.value.push(M),M.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let M=e.value.length-1;return this.last=e.value[M],this.lastFrom=e.from[M]+t,this.lastTo=e.to[M]+t,!0}finish(){return this.finishInner(vn.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=vn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Vn(t,e,M){let i=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&i.set(e.chunk[t],e.chunkPos[t]);let N=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let o=i.get(t.chunk[e]);null==o||(M?M.mapPos(o):o)!=t.chunkPos[e]||(null==M?void 0:M.touchesRange(o,o+t.chunk[e].length))||N.add(t.chunk[e])}return N}class Wn{constructor(t,e,M,i=0){this.layer=t,this.skip=e,this.minPoint=M,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,M){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,M=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!M||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],M=t+e.from[this.rangeIndex];if(this.from=M,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Pn{constructor(t){this.heap=t}static from(t,e=null,M=-1){let i=[];for(let N=0;N<t.length;N++)for(let o=t[N];!o.isEmpty;o=o.nextLayer)o.maxPoint>=M&&i.push(new Wn(o,e,M,N));return 1==i.length?i[0]:new Pn(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let M of this.heap)M.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Rn(this.heap,t);return this.next(),this}forward(t,e){for(let M of this.heap)M.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Rn(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Rn(this.heap,0)}}}function Rn(t,e){for(let M=t[e];;){let i=1+(e<<1);if(i>=t.length)break;let N=t[i];if(i+1<t.length&&N.compare(t[i+1])>=0&&(N=t[i+1],i++),M.compare(N)<0)break;t[i]=M,t[e]=N,e=i}}class Gn{constructor(t,e,M){this.minPoint=M,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Pn.from(t,e,M)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Fn(this.active,t),Fn(this.activeTo,t),Fn(this.activeRank,t),this.minActive=Hn(this.active,this.activeTo)}addActive(t){let e=0,{value:M,to:i,rank:N}=this.cursor;for(;e<this.activeRank.length&&(N-this.activeRank[e]||i-this.activeTo[e])>0;)e++;Jn(this.active,e,M),Jn(this.activeTo,e,i),Jn(this.activeRank,e,N),t&&Jn(t,e,this.cursor.from),this.minActive=Hn(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let M=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),M&&Fn(M,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(M),this.cursor.next()}}}if(M){this.openStart=0;for(let e=M.length-1;e>=0&&M[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let M=this.active.length-1;M>=0&&!(this.activeRank[M]<this.pointRank);M--)(this.activeTo[M]>t||this.activeTo[M]==t&&this.active[M].endSide>=this.point.endSide)&&e.push(this.active[M]);return e.reverse()}openEnd(t){let e=0;for(let M=this.activeTo.length-1;M>=0&&this.activeTo[M]>t;M--)e++;return e}}function Bn(t,e,M,i,N,o){t.goto(e),M.goto(i);let n=i+N,s=i,r=i-e;for(;;){let e=t.to+r-M.to,i=e||t.endSide-M.endSide,N=i<0?t.to+r:M.to,D=Math.min(N,n);if(t.point||M.point?t.point&&M.point&&(t.point==M.point||t.point.eq(M.point))&&_n(t.activeForPoint(t.to),M.activeForPoint(M.to))||o.comparePoint(s,D,t.point,M.point):D>s&&!_n(t.active,M.active)&&o.compareRange(s,D,t.active,M.active),N>n)break;(e||t.openEnd!=M.openEnd)&&o.boundChange&&o.boundChange(N),s=N,i<=0&&t.next(),i>=0&&M.next()}}function _n(t,e){if(t.length!=e.length)return!1;for(let M=0;M<t.length;M++)if(t[M]!=e[M]&&!t[M].eq(e[M]))return!1;return!0}function Fn(t,e){for(let M=e,i=t.length-1;M<i;M++)t[M]=t[M+1];t.pop()}function Jn(t,e,M){for(let M=t.length-1;M>=e;M--)t[M+1]=t[M];t[e]=M}function Hn(t,e){let M=-1,i=1e9;for(let N=0;N<e.length;N++)(e[N]-i||t[N].endSide-t[M].endSide)<0&&(M=N,i=e[N]);return M}function Xn(t,e,M=t.length){let i=0;for(let N=0;N<M&&N<t.length;)9==t.charCodeAt(N)?(i+=e-i%e,N++):(i++,N=xo(t,N));return i}function $n(t,e,M,i){for(let i=0,N=0;;){if(N>=e)return i;if(i==t.length)break;N+=9==t.charCodeAt(i)?M-N%M:1,i=xo(t,i)}return!0===i?-1:t.length}const qn="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),Kn="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),ts="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class es{constructor(t,e){this.rules=[];let{finish:M}=e||{};function i(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function N(t,e,o,n){let s=[],r=/^@(\w+)\b/.exec(t[0]),D=r&&"keyframes"==r[1];if(r&&null==e)return o.push(t[0]+";");for(let M in e){let n=e[M];if(/&/.test(M))N(M.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),n,o);else if(n&&"object"==typeof n){if(!r)throw new RangeError("The value of a property ("+M+") should be a primitive value.");N(i(M),n,s,D)}else null!=n&&s.push(M.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+n+";")}(s.length||D)&&o.push((!M||r||n?t:t.map(M)).join(", ")+" {"+s.join(" ")+"}")}for(let e in t)N(i(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=ts[qn]||1;return ts[qn]=t+1,"ͼ"+t.toString(36)}static mount(t,e,M){let i=t[Kn],N=M&&M.nonce;i?N&&i.setNonce(N):i=new is(t,N),i.mount(Array.isArray(e)?e:[e],t)}}let Ms=new Map;class is{constructor(t,e){let M=t.ownerDocument||t,i=M.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let e=Ms.get(M);if(e)return t[Kn]=e;this.sheet=new i.CSSStyleSheet,Ms.set(M,this)}else this.styleTag=M.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Kn]=this}mount(t,e){let M=this.sheet,i=0,N=0;for(let e=0;e<t.length;e++){let o=t[e],n=this.modules.indexOf(o);if(n<N&&n>-1&&(this.modules.splice(n,1),N--,n=-1),-1==n){if(this.modules.splice(N++,0,o),M)for(let t=0;t<o.rules.length;t++)M.insertRule(o.rules[t],i++)}else{for(;N<n;)i+=this.modules[N++].rules.length;i+=o.rules.length,N++}}if(M)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets]);else{let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t;let M=e.head||e;this.styleTag.parentNode!=M&&M.insertBefore(this.styleTag,M.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}for(var Ns={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:"'"},os={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ns="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ss="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),rs=0;rs<10;rs++)Ns[48+rs]=Ns[96+rs]=String(rs);for(rs=1;rs<=24;rs++)Ns[rs+111]="F"+rs;for(rs=65;rs<=90;rs++)Ns[rs]=String.fromCharCode(rs+32),os[rs]=String.fromCharCode(rs);for(var Ds in Ns)os.hasOwnProperty(Ds)||(os[Ds]=Ns[Ds]);function as(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function ls(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function us(t,e){if(!e.anchorNode)return!1;try{return ls(t,e.anchorNode)}catch(t){return!1}}function gs(t){return 3==t.nodeType?ps(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function js(t,e,M,i){return!!M&&(Is(t,e,M,i,-1)||Is(t,e,M,i,1))}function cs(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function zs(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Is(t,e,M,i,N){for(;;){if(t==M&&e==i)return!0;if(e==(N<0?0:Ts(t))){if("DIV"==t.nodeName)return!1;let M=t.parentNode;if(!M||1!=M.nodeType)return!1;e=cs(t)+(N<0?0:1),t=M}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(N<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=N<0?Ts(t):0}}}function Ts(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Os(t,e){let M=e?t.left:t.right;return{left:M,right:M,top:t.top,bottom:t.bottom}}function ys(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function ds(t,e){let M=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(M>.995&&M<1.005||!isFinite(M)||Math.abs(e.width-t.offsetWidth)<1)&&(M=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:M,scaleY:i}}class As{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:M}=t;this.set(e,Math.min(t.anchorOffset,e?Ts(e):0),M,Math.min(t.focusOffset,M?Ts(M):0))}set(t,e,M,i){this.anchorNode=t,this.anchorOffset=e,this.focusNode=M,this.focusOffset=i}}let hs,Ls=null;function xs(t){if(t.setActive)return t.setActive();if(Ls)return t.focus(Ls);let e=[];for(let M=t;M&&(e.push(M,M.scrollTop,M.scrollLeft),M!=M.ownerDocument);M=M.parentNode);if(t.focus(null==Ls?{get preventScroll(){return Ls={preventScroll:!0},!0}}:void 0),!Ls){Ls=!1;for(let t=0;t<e.length;){let M=e[t++],i=e[t++],N=e[t++];M.scrollTop!=i&&(M.scrollTop=i),M.scrollLeft!=N&&(M.scrollLeft=N)}}}function ps(t,e,M=e){let i=hs||(hs=document.createRange());return i.setEnd(t,M),i.setStart(t,e),i}function Ss(t,e,M,i){let N={key:e,code:e,keyCode:M,which:M,cancelable:!0};i&&({altKey:N.altKey,ctrlKey:N.ctrlKey,shiftKey:N.shiftKey,metaKey:N.metaKey}=i);let o=new KeyboardEvent("keydown",N);o.synthetic=!0,t.dispatchEvent(o);let n=new KeyboardEvent("keyup",N);return n.synthetic=!0,t.dispatchEvent(n),o.defaultPrevented||n.defaultPrevented}function Qs(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function Es(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function ks(t,e){for(let M=t,i=e;;){if(3==M.nodeType&&i>0)return{node:M,offset:i};if(1==M.nodeType&&i>0){if("false"==M.contentEditable)return null;M=M.childNodes[i-1],i=Ts(M)}else{if(!M.parentNode||zs(M))return null;i=cs(M),M=M.parentNode}}}function ws(t,e){for(let M=t,i=e;;){if(3==M.nodeType&&i<M.nodeValue.length)return{node:M,offset:i};if(1==M.nodeType&&i<M.childNodes.length){if("false"==M.contentEditable)return null;M=M.childNodes[i],i=0}else{if(!M.parentNode||zs(M))return null;i=cs(M)+1,M=M.parentNode}}}class ms{constructor(t,e,M=!0){this.node=t,this.offset=e,this.precise=M}static before(t,e){return new ms(t.parentNode,cs(t),e)}static after(t,e){return new ms(t.parentNode,cs(t)+1,e)}}const Us=[];class Cs{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let e=this.posAtStart;for(let M of this.children){if(M==t)return e;e+=M.length+M.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(2&this.flags){let M,i=this.dom,N=null;for(let o of this.children){if(7&o.flags){if(!o.dom&&(M=N?N.nextSibling:i.firstChild)){let t=Cs.get(M);(!t||!t.parent&&t.canReuseDOM(o))&&o.reuseDOM(M)}o.sync(t,e),o.flags&=-8}if(M=N?N.nextSibling:i.firstChild,e&&!e.written&&e.node==i&&M!=o.dom&&(e.written=!0),o.dom.parentNode==i)for(;M&&M!=o.dom;)M=fs(M);else i.insertBefore(o.dom,M);N=o.dom}for(M=N?N.nextSibling:i.firstChild,M&&e&&e.node==i&&(e.written=!0);M;)M=fs(M)}else if(1&this.flags)for(let M of this.children)7&M.flags&&(M.sync(t,e),M.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let M;if(t==this.dom)M=this.dom.childNodes[e];else{let i=0==Ts(t)?0:0==e?-1:1;for(;;){let e=t.parentNode;if(e==this.dom)break;0==i&&e.firstChild!=e.lastChild&&(i=t==e.firstChild?-1:1),t=e}M=i<0?t:t.nextSibling}if(M==this.dom.firstChild)return 0;for(;M&&!Cs.get(M);)M=M.nextSibling;if(!M)return this.length;for(let t=0,e=0;;t++){let i=this.children[t];if(i.dom==M)return e;e+=i.length+i.breakAfter}}domBoundsAround(t,e,M=0){let i=-1,N=-1,o=-1,n=-1;for(let s=0,r=M,D=M;s<this.children.length;s++){let M=this.children[s],a=r+M.length;if(r<t&&a>e)return M.domBoundsAround(t,e,r);if(a>=t&&-1==i&&(i=s,N=r),r>e&&M.dom.parentNode==this.dom){o=s,n=D;break}D=a,r=a+M.breakAfter}return{from:N,to:n<0?M+this.length:n,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),1&e.flags)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,M=Us){this.markDirty();for(let i=t;i<e;i++){let t=this.children[i];t.parent==this&&M.indexOf(t)<0&&t.destroy()}M.length<250?this.children.splice(t,e-t,...M):this.children=[].concat(this.children.slice(0,t),M,this.children.slice(e));for(let t=0;t<M.length;t++)M[t].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new bs(this.children,t,this.children.length)}childPos(t,e=1){return this.childCursor().findPos(t,e)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,e,M,i,N,o){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!(8&(this.flags|t.flags))}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}}function fs(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}Cs.prototype.breakAfter=0;class bs{constructor(t,e,M){this.children=t,this.pos=e,this.i=M,this.off=0}findPos(t,e=1){for(;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let M=this.children[--this.i];this.pos-=M.length+M.breakAfter}}}function Ys(t,e,M,i,N,o,n,s,r){let{children:D}=t,a=D.length?D[e]:null,l=o.length?o[o.length-1]:null,u=l?l.breakAfter:n;if(!(e==i&&a&&!n&&!u&&o.length<2&&a.merge(M,N,o.length?l:null,0==M,s,r))){if(i<D.length){let t=D[i];t&&(N<t.length||t.breakAfter&&(null==l?void 0:l.breakAfter))?(e==i&&(t=t.split(N),N=0),!u&&l&&t.merge(0,N,l,!0,0,r)?o[o.length-1]=t:((N||t.children.length&&!t.children[0].length)&&t.merge(0,N,null,!1,0,r),o.push(t))):(null==t?void 0:t.breakAfter)&&(l?l.breakAfter=1:n=1),i++}for(a&&(a.breakAfter=n,M>0&&(!n&&o.length&&a.merge(M,a.length,o[0],!1,s,0)?a.breakAfter=o.shift().breakAfter:(M<a.length||a.children.length&&0==a.children[a.children.length-1].length)&&a.merge(M,a.length,null,!1,s,0),e++));e<i&&o.length;)if(D[i-1].become(o[o.length-1]))i--,o.pop(),r=o.length?0:s;else{if(!D[e].become(o[0]))break;e++,o.shift(),s=o.length?0:r}!o.length&&e&&i<D.length&&!D[e-1].breakAfter&&D[i].merge(0,0,D[e-1],!1,s,r)&&e--,(e<i||o.length)&&t.replaceChildren(e,i,o)}}function vs(t,e,M,i,N,o){let n=t.childCursor(),{i:s,off:r}=n.findPos(M,1),{i:D,off:a}=n.findPos(e,-1),l=e-M;for(let t of i)l+=t.length;t.length+=l,Ys(t,D,a,s,r,i,0,N,o)}let Zs="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Vs="undefined"!=typeof document?document:{documentElement:{style:{}}};const Ws=/Edge\/(\d+)/.exec(Zs.userAgent),Ps=/MSIE \d/.test(Zs.userAgent),Rs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zs.userAgent),Gs=!!(Ps||Rs||Ws),Bs=!Gs&&/gecko\/(\d+)/i.test(Zs.userAgent),_s=!Gs&&/Chrome\/(\d+)/.exec(Zs.userAgent),Fs="webkitFontSmoothing"in Vs.documentElement.style,Js=!Gs&&/Apple Computer/.test(Zs.vendor),Hs=Js&&(/Mobile\/\w+/.test(Zs.userAgent)||Zs.maxTouchPoints>2);var Xs={mac:Hs||/Mac/.test(Zs.platform),windows:/Win/.test(Zs.platform),linux:/Linux|X11/.test(Zs.platform),ie:Gs,ie_version:Ps?Vs.documentMode||6:Rs?+Rs[1]:Ws?+Ws[1]:0,gecko:Bs,gecko_version:Bs?+(/Firefox\/(\d+)/.exec(Zs.userAgent)||[0,0])[1]:0,chrome:!!_s,chrome_version:_s?+_s[1]:0,ios:Hs,android:/Android\b/.test(Zs.userAgent),webkit:Fs,safari:Js,webkit_version:Fs?+(/\bAppleWebKit\/(\d+)/.exec(Zs.userAgent)||[0,0])[1]:0,tabSize:null!=Vs.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class $s extends Cs{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,M){return!(8&this.flags||M&&(!(M instanceof $s)||this.length-(e-t)+M.length>256||8&M.flags))&&(this.text=this.text.slice(0,t)+(M?M.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new $s(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new ms(this.dom,t)}domBoundsAround(t,e,M){return{from:M,to:M+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return function(t,e,M){let i=t.nodeValue.length;e>i&&(e=i);let N=e,o=e,n=0;0==e&&M<0||e==i&&M>=0?Xs.chrome||Xs.gecko||(e?(N--,n=1):o<i&&(o++,n=-1)):M<0?N--:o<i&&o++;let s=ps(t,N,o).getClientRects();if(!s.length)return null;let r=s[(n?n<0:M>=0)?0:s.length-1];Xs.safari&&!n&&0==r.width&&(r=Array.prototype.find.call(s,(t=>t.width))||r);return n?Os(r,n<0):r||null}(this.dom,t,e)}}class qs extends Cs{constructor(t,e=[],M=0){super(),this.mark=t,this.children=e,this.length=M;for(let t of e)t.setParent(this)}setAttrs(t){if(Qs(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!(8&(this.flags|t.flags))}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,M,i,N,o){return(!M||!(!(M instanceof qs&&M.mark.eq(this.mark))||t&&N<=0||e<this.length&&o<=0))&&(vs(this,t,e,M?M.children.slice():[],N-1,o-1),this.markDirty(),!0)}split(t){let e=[],M=0,i=-1,N=0;for(let o of this.children){let n=M+o.length;n>t&&e.push(M<t?o.split(t-M):o),i<0&&M>=t&&(i=N),M=n,N++}let o=this.length-t;return this.length=t,i>-1&&(this.children.length=i,this.markDirty()),new qs(this.mark,e,o)}domAtPos(t){return er(this,t)}coordsAt(t,e){return ir(this,t,e)}}class Ks extends Cs{static create(t,e,M){return new Ks(t,e,M)}constructor(t,e,M){super(),this.widget=t,this.length=e,this.side=M,this.prevWidget=null}split(t){let e=Ks.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,M,i,N,o){return!(M&&(!(M instanceof Ks&&this.widget.compare(M.widget))||t>0&&N<=0||e<this.length&&o<=0))&&(this.length=t+(M?M.length:0)+(this.length-e),!0)}become(t){return t instanceof Ks&&t.side==this.side&&this.widget.constructor==t.widget.constructor&&(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0)}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(0==this.length)return jo.empty;let t=this;for(;t.parent;)t=t.parent;let{view:e}=t,M=e&&e.state.doc,i=this.posAtStart;return M?M.slice(i,i+this.length):jo.empty}domAtPos(t){return(this.length?0==t:this.side>0)?ms.before(this.dom):ms.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let M=this.widget.coordsAt(this.dom,t,e);if(M)return M;let i=this.dom.getClientRects(),N=null;if(!i.length)return null;let o=this.side?this.side<0:t>0;for(let e=o?i.length-1:0;N=i[e],!(t>0?0==e:e==i.length-1||N.top<N.bottom);e+=o?-1:1);return Os(N,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class tr extends Cs{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof tr&&t.side==this.side}split(){return new tr(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?ms.before(this.dom):ms.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return jo.empty}get isHidden(){return!0}}function er(t,e){let M=t.dom,{children:i}=t,N=0;for(let t=0;N<i.length;N++){let o=i[N],n=t+o.length;if(!(n==t&&o.getSide()<=0)){if(e>t&&e<n&&o.dom.parentNode==M)return o.domAtPos(e-t);if(e<=t)break;t=n}}for(let t=N;t>0;t--){let e=i[t-1];if(e.dom.parentNode==M)return e.domAtPos(e.length)}for(let t=N;t<i.length;t++){let e=i[t];if(e.dom.parentNode==M)return e.domAtPos(0)}return new ms(M,0)}function Mr(t,e,M){let i,{children:N}=t;M>0&&e instanceof qs&&N.length&&(i=N[N.length-1])instanceof qs&&i.mark.eq(e.mark)?Mr(i,e.children[0],M-1):(N.push(e),e.setParent(t)),t.length+=e.length}function ir(t,e,M){let i=null,N=-1,o=null,n=-1;!function t(e,s){for(let r=0,D=0;r<e.children.length&&D<=s;r++){let a=e.children[r],l=D+a.length;l>=s&&(a.children.length?t(a,s-D):(!o||o.isHidden&&M>0)&&(l>s||D==l&&a.getSide()>0)?(o=a,n=s-D):(D<s||D==l&&a.getSide()<0&&!a.isHidden)&&(i=a,N=s-D)),D=l}}(t,e);let s=(M<0?i:o)||i||o;return s?s.coordsAt(Math.max(0,s==i?N:n),M):function(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let M=gs(e);return M[M.length-1]||null}(t)}function Nr(t,e){for(let M in t)"class"==M&&e.class?e.class+=" "+t.class:"style"==M&&e.style?e.style+=";"+t.style:e[M]=t[M];return e}$s.prototype.children=Ks.prototype.children=tr.prototype.children=Us;const or=Object.create(null);function nr(t,e,M){if(t==e)return!0;t||(t=or),e||(e=or);let i=Object.keys(t),N=Object.keys(e);if(i.length-(M&&i.indexOf(M)>-1?1:0)!=N.length-(M&&N.indexOf(M)>-1?1:0))return!1;for(let o of i)if(o!=M&&(-1==N.indexOf(o)||t[o]!==e[o]))return!1;return!0}function sr(t,e,M){let i=!1;if(e)for(let N in e)M&&N in M||(i=!0,"style"==N?t.style.cssText="":t.removeAttribute(N));if(M)for(let N in M)e&&e[N]==M[N]||(i=!0,"style"==N?t.style.cssText=M[N]:t.setAttribute(N,M[N]));return i}function rr(t){let e=Object.create(null);for(let M=0;M<t.attributes.length;M++){let i=t.attributes[M];e[i.name]=i.value}return e}class Dr{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,M){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var ar=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(ar||(ar={}));class lr extends Cn{constructor(t,e,M,i){super(),this.startSide=t,this.endSide=e,this.widget=M,this.spec=i}get heightRelevant(){return!1}static mark(t){return new ur(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),M=!!t.block;return e+=M&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new jr(t,e,e,M,t.widget||null,!1)}static replace(t){let e,M,i=!!t.block;if(t.isBlockGap)e=-5e8,M=4e8;else{let{start:N,end:o}=cr(t,i);e=(N?i?-3e8:-1:5e8)-1,M=1+(o?i?2e8:1:-6e8)}return new jr(t,e,M,i,t.widget||null,!0)}static line(t){return new gr(t)}static set(t,e=!1){return vn.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}lr.none=vn.empty;class ur extends lr{constructor(t){let{start:e,end:M}=cr(t);super(e?-1:5e8,M?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,M;return this==t||t instanceof ur&&this.tagName==t.tagName&&(this.class||(null===(e=this.attrs)||void 0===e?void 0:e.class))==(t.class||(null===(M=t.attrs)||void 0===M?void 0:M.class))&&nr(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}ur.prototype.point=!1;class gr extends lr{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof gr&&this.spec.class==t.spec.class&&nr(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}gr.prototype.mapMode=ko.TrackBefore,gr.prototype.point=!0;class jr extends lr{constructor(t,e,M,i,N,o){super(e,M,N,t),this.block=i,this.isReplace=o,this.mapMode=i?e<=0?ko.TrackBefore:ko.TrackAfter:ko.TrackDel}get type(){return this.startSide!=this.endSide?ar.WidgetRange:this.startSide<=0?ar.WidgetBefore:ar.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof jr&&function(t,e){return t==e||!!(t&&e&&t.compare(e))}(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function cr(t,e=!1){let{inclusiveStart:M,inclusiveEnd:i}=t;return null==M&&(M=t.inclusive),null==i&&(i=t.inclusive),{start:null!=M?M:e,end:null!=i?i:e}}function zr(t,e,M,i=0){let N=M.length-1;N>=0&&M[N]+i>=t?M[N]=Math.max(M[N],e):M.push(t,e)}jr.prototype.point=!0;class Ir extends Cs{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,M,i,N,o){if(M){if(!(M instanceof Ir))return!1;this.dom||M.transferDOM(this)}return i&&this.setDeco(M?M.attrs:null),vs(this,t,e,M?M.children.slice():[],N,o),!0}split(t){let e=new Ir;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i:M,off:i}=this.childPos(t);i&&(e.append(this.children[M].split(i),0),this.children[M].merge(i,this.children[M].length,null,!1,0,0),M++);for(let t=M;t<this.children.length;t++)e.append(this.children[t],0);for(;M>0&&0==this.children[M-1].length;)this.children[--M].destroy();return this.children.length=M,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){nr(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){Mr(this,t,e)}addLineDeco(t){let e=t.spec.attributes,M=t.spec.class;e&&(this.attrs=Nr(e,this.attrs||{})),M&&(this.attrs=Nr({class:M},this.attrs||{}))}domAtPos(t){return er(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6)}sync(t,e){var M;this.dom?4&this.flags&&(Qs(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(sr(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let i=this.dom.lastChild;for(;i&&Cs.get(i)instanceof qs;)i=i.lastChild;if(!(i&&this.length&&("BR"==i.nodeName||0!=(null===(M=Cs.get(i))||void 0===M?void 0:M.isEditable)||Xs.ios&&this.children.some((t=>t instanceof $s))))){let t=document.createElement("BR");t.cmIgnore=!0,this.dom.appendChild(t)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t,e=0;for(let M of this.children){if(!(M instanceof $s)||/[^ -~]/.test(M.text))return null;let i=gs(M.dom);if(1!=i.length)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(t,e){let M=ir(this,t,e);if(!this.children.length&&M&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=M.bottom-M.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight<e){let i=(e-t.textHeight)/2;return{top:M.top+i,bottom:M.bottom-i,left:M.left,right:M.left}}}return M}become(t){return t instanceof Ir&&0==this.children.length&&0==t.children.length&&nr(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter}covers(){return!0}static find(t,e){for(let M=0,i=0;M<t.children.length;M++){let N=t.children[M],o=i+N.length;if(o>=e){if(N instanceof Ir)return N;if(o>e)break}i=o+N.breakAfter}return null}}class Tr extends Cs{constructor(t,e,M){super(),this.widget=t,this.length=e,this.deco=M,this.breakAfter=0,this.prevWidget=null}merge(t,e,M,i,N,o){return!(M&&(!(M instanceof Tr&&this.widget.compare(M.widget))||t>0&&N<=0||e<this.length&&o<=0))&&(this.length=t+(M?M.length:0)+(this.length-e),!0)}domAtPos(t){return 0==t?ms.before(this.dom):ms.after(this.dom,t==this.length)}split(t){let e=this.length-t;this.length=t;let M=new Tr(this.widget,e,this.deco);return M.breakAfter=this.breakAfter,M}get children(){return Us}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):jo.empty}domBoundsAround(){return null}become(t){return t instanceof Tr&&t.widget.constructor==this.widget.constructor&&(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,e){let M=this.widget.coordsAt(this.dom,t,e);return M||(this.widget instanceof Or?null:Os(this.dom.getBoundingClientRect(),this.length?0==t:e<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:e,endSide:M}=this.deco;return e!=M&&(t<0?e<0:M>0)}}class Or extends Dr{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class yr{constructor(t,e,M,i){this.doc=t,this.pos=e,this.end=M,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Tr&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ir),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(dr(new tr(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof Tr||this.getLine()}buildText(t,e,M){for(;t>0;){if(this.textOff==this.text.length){let{value:e,lineBreak:M,done:i}=this.cursor.next(this.skip);if(this.skip=0,i)throw new Error("Ran out of text content when drawing inline views");if(M){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}this.text=e,this.textOff=0}let i=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-M)),this.getLine().append(dr(new $s(this.text.slice(this.textOff,this.textOff+i)),e),M),this.atCursorPos=!0,this.textOff+=i,t-=i,M=0}}span(t,e,M,i){this.buildText(e-t,M,i),this.pos=e,this.openStart<0&&(this.openStart=i)}point(t,e,M,i,N,o){if(this.disallowBlockEffectsFor[o]&&M instanceof jr){if(M.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let n=e-t;if(M instanceof jr)if(M.block)M.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Tr(M.widget||Ar.block,n,M));else{let o=Ks.create(M.widget||Ar.inline,n,n?0:M.startSide),s=this.atCursorPos&&!o.isEditable&&N<=i.length&&(t<e||M.startSide>0),r=!o.isEditable&&(t<e||N>i.length||M.startSide<=0),D=this.getLine();2!=this.pendingBuffer||s||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(i),s&&(D.append(dr(new tr(1),i),N),N=i.length+Math.max(0,N-i.length)),D.append(dr(o,i),N),this.atCursorPos=r,this.pendingBuffer=r?t<e||N>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(M);n&&(this.textOff+n<=this.text.length?this.textOff+=n:(this.skip+=n-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=N)}static build(t,e,M,i,N){let o=new yr(t,e,M,N);return o.openEnd=vn.spans(i,e,M,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function dr(t,e){for(let M of e)t=new qs(M,[t],t.length);return t}class Ar extends Dr{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ar.inline=new Ar("span"),Ar.block=new Ar("div");var hr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(hr||(hr={}));const Lr=hr.LTR,xr=hr.RTL;function pr(t){let e=[];for(let M=0;M<t.length;M++)e.push(1<<+t[M]);return e}const Sr=pr("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Qr=pr("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Er=Object.create(null),kr=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),M=t.charCodeAt(1);Er[e]=M,Er[M]=-e}function wr(t){return t<=247?Sr[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Qr[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const mr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ur{get dir(){return this.level%2?xr:Lr}constructor(t,e,M){this.from=t,this.to=e,this.level=M}side(t,e){return this.dir==e==t?this.to:this.from}forward(t,e){return t==(this.dir==e)}static find(t,e,M,i){let N=-1;for(let o=0;o<t.length;o++){let n=t[o];if(n.from<=e&&n.to>=e){if(n.level==M)return o;(N<0||(0!=i?i<0?n.from<e:n.to>e:t[N].level>n.level))&&(N=o)}}if(N<0)throw new RangeError("Index out of range");return N}}function Cr(t,e){if(t.length!=e.length)return!1;for(let M=0;M<t.length;M++){let i=t[M],N=e[M];if(i.from!=N.from||i.to!=N.to||i.direction!=N.direction||!Cr(i.inner,N.inner))return!1}return!0}const fr=[];function br(t,e,M,i,N,o,n){let s=i%2?2:1;if(i%2==N%2)for(let r=e,D=0;r<M;){let e=!0,a=!1;if(D==o.length||r<o[D].from){let t=fr[r];t!=s&&(e=!1,a=16==t)}let l=e||1!=s?null:[],u=e?i:i+1,g=r;t:for(;;)if(D<o.length&&g==o[D].from){if(a)break t;let j=o[D];if(!e)for(let t=j.to,e=D+1;;){if(t==M)break t;if(!(e<o.length&&o[e].from==t)){if(fr[t]==s)break t;break}t=o[e++].to}if(D++,l)l.push(j);else{j.from>r&&n.push(new Ur(r,j.from,u)),Yr(t,j.direction==Lr!=!(u%2)?i+1:i,N,j.inner,j.from,j.to,n),r=j.to}g=j.to}else{if(g==M||(e?fr[g]!=s:fr[g]==s))break;g++}l?br(t,r,g,i+1,N,l,n):r<g&&n.push(new Ur(r,g,u)),r=g}else for(let r=M,D=o.length;r>e;){let M=!0,a=!1;if(!D||r>o[D-1].to){let t=fr[r-1];t!=s&&(M=!1,a=16==t)}let l=M||1!=s?null:[],u=M?i:i+1,g=r;t:for(;;)if(D&&g==o[D-1].to){if(a)break t;let j=o[--D];if(!M)for(let t=j.from,M=D;;){if(t==e)break t;if(!M||o[M-1].to!=t){if(fr[t-1]==s)break t;break}t=o[--M].from}if(l)l.push(j);else{j.to<r&&n.push(new Ur(j.to,r,u)),Yr(t,j.direction==Lr!=!(u%2)?i+1:i,N,j.inner,j.from,j.to,n),r=j.from}g=j.from}else{if(g==e||(M?fr[g-1]!=s:fr[g-1]==s))break;g--}l?br(t,g,r,i+1,N,l,n):g<r&&n.push(new Ur(g,r,u)),r=g}}function Yr(t,e,M,i,N,o,n){let s=e%2?2:1;!function(t,e,M,i,N){for(let o=0;o<=i.length;o++){let n=o?i[o-1].to:e,s=o<i.length?i[o].from:M,r=o?256:N;for(let e=n,M=r,i=r;e<s;e++){let N=wr(t.charCodeAt(e));512==N?N=M:8==N&&4==i&&(N=16),fr[e]=4==N?2:N,7&N&&(i=N),M=N}for(let t=n,e=r,i=r;t<s;t++){let N=fr[t];if(128==N)t<s-1&&e==fr[t+1]&&24&e?N=fr[t]=e:fr[t]=256;else if(64==N){let N=t+1;for(;N<s&&64==fr[N];)N++;let o=t&&8==e||N<M&&8==fr[N]?1==i?1:8:256;for(let e=t;e<N;e++)fr[e]=o;t=N-1}else 8==N&&1==i&&(fr[t]=1);e=N,7&N&&(i=N)}}}(t,N,o,i,s),function(t,e,M,i,N){let o=1==N?2:1;for(let n=0,s=0,r=0;n<=i.length;n++){let D=n?i[n-1].to:e,a=n<i.length?i[n].from:M;for(let e,M,i,n=D;n<a;n++)if(M=Er[e=t.charCodeAt(n)])if(M<0){for(let t=s-3;t>=0;t-=3)if(kr[t+1]==-M){let e=kr[t+2],M=2&e?N:4&e?1&e?o:N:0;M&&(fr[n]=fr[kr[t]]=M),s=t;break}}else{if(189==kr.length)break;kr[s++]=n,kr[s++]=e,kr[s++]=r}else if(2==(i=fr[n])||1==i){let t=i==N;r=t?0:1;for(let e=s-3;e>=0;e-=3){let M=kr[e+2];if(2&M)break;if(t)kr[e+2]|=2;else{if(4&M)break;kr[e+2]|=4}}}}}(t,N,o,i,s),function(t,e,M,i){for(let N=0,o=i;N<=M.length;N++){let n=N?M[N-1].to:t,s=N<M.length?M[N].from:e;for(let r=n;r<s;){let n=fr[r];if(256==n){let n=r+1;for(;;)if(n==s){if(N==M.length)break;n=M[N++].to,s=N<M.length?M[N].from:e}else{if(256!=fr[n])break;n++}let D=1==o,a=D==(1==(n<e?fr[n]:i))?D?1:2:i;for(let e=n,i=N,o=i?M[i-1].to:t;e>r;)e==o&&(e=M[--i].from,o=i?M[i-1].to:t),fr[--e]=a;r=n}else o=n,r++}}}(N,o,i,s),br(t,N,o,e,M,i,n)}function vr(t){return[new Ur(0,t,0)]}let Zr="";function Vr(t,e,M,i,N){var o;let n=i.head-t.from,s=Ur.find(e,n,null!==(o=i.bidiLevel)&&void 0!==o?o:-1,i.assoc),r=e[s],D=r.side(N,M);if(n==D){let t=s+=N?1:-1;if(t<0||t>=e.length)return null;r=e[s=t],n=r.side(!N,M),D=r.side(N,M)}let a=xo(t.text,n,r.forward(N,M));(a<r.from||a>r.to)&&(a=D),Zr=t.text.slice(Math.min(n,a),Math.max(n,a));let l=s==(N?e.length-1:0)?null:e[s+(N?1:-1)];return l&&a==D&&l.level+(N?0:1)<r.level?Vo.cursor(l.side(!N,M)+t.from,l.forward(N,M)?1:-1,l.level):Vo.cursor(a+t.from,r.forward(N,M)?-1:1,r.level)}function Wr(t,e,M){for(let i=e;i<M;i++){let e=wr(t.charCodeAt(i));if(1==e)return Lr;if(2==e||4==e)return xr}return Lr}const Pr=Ro.define(),Rr=Ro.define(),Gr=Ro.define(),Br=Ro.define(),_r=Ro.define(),Fr=Ro.define(),Jr=Ro.define(),Hr=Ro.define(),Xr=Ro.define(),$r=Ro.define({combine:t=>t.some((t=>t))}),qr=Ro.define({combine:t=>t.some((t=>t))}),Kr=Ro.define();class tD{constructor(t,e="nearest",M="nearest",i=5,N=5,o=!1){this.range=t,this.y=e,this.x=M,this.yMargin=i,this.xMargin=N,this.isSnapshot=o}map(t){return t.empty?this:new tD(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new tD(Vo.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const eD=yn.define({map:(t,e)=>t.map(e)}),MD=yn.define();function iD(t,e,M){let i=t.facet(Br);i.length?i[0](e):window.onerror?window.onerror(String(e),M,void 0,void 0,e):M?console.error(M+":",e):console.error(e)}const ND=Ro.define({combine:t=>!t.length||t[0]});let oD=0;const nD=Ro.define();class sD{constructor(t,e,M,i,N){this.id=t,this.create=e,this.domEventHandlers=M,this.domEventObservers=i,this.extension=N(this)}static define(t,e){const{eventHandlers:M,eventObservers:i,provide:N,decorations:o}=e||{};return new sD(oD++,t,M,i,(t=>{let e=[nD.of(t)];return o&&e.push(lD.of((e=>{let M=e.plugin(t);return M?o(M):lr.none}))),N&&e.push(N(t)),e}))}static fromClass(t,e){return sD.define((e=>new t(e)),e)}}class rD{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(iD(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){iD(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){iD(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const DD=Ro.define(),aD=Ro.define(),lD=Ro.define(),uD=Ro.define(),gD=Ro.define(),jD=Ro.define();function cD(t,e){let M=t.state.facet(jD);if(!M.length)return M;let i=M.map((e=>e instanceof Function?e(t):e)),N=[];return vn.spans(i,e.from,e.to,{point(){},span(t,M,i,o){let n=t-e.from,s=M-e.from,r=N;for(let t=i.length-1;t>=0;t--,o--){let M,N=i[t].spec.bidiIsolate;if(null==N&&(N=Wr(e.text,n,s)),o>0&&r.length&&(M=r[r.length-1]).to==n&&M.direction==N)M.to=s,r=M.inner;else{let t={from:n,to:s,direction:N,inner:[]};r.push(t),r=t.inner}}}}),N}const zD=Ro.define();function ID(t){let e=0,M=0,i=0,N=0;for(let o of t.state.facet(zD)){let n=o(t);n&&(null!=n.left&&(e=Math.max(e,n.left)),null!=n.right&&(M=Math.max(M,n.right)),null!=n.top&&(i=Math.max(i,n.top)),null!=n.bottom&&(N=Math.max(N,n.bottom)))}return{left:e,right:M,top:i,bottom:N}}const TD=Ro.define();class OD{constructor(t,e,M,i){this.fromA=t,this.toA=e,this.fromB=M,this.toB=i}join(t){return new OD(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,M=this;for(;e>0;e--){let i=t[e-1];if(!(i.fromA>M.toA)){if(i.toA<M.fromA)break;M=M.join(i),t.splice(e-1,1)}}return t.splice(e,0,M),t}static extendWithRanges(t,e){if(0==e.length)return t;let M=[];for(let i=0,N=0,o=0,n=0;;i++){let s=i==t.length?null:t[i],r=o-n,D=s?s.fromB:1e9;for(;N<e.length&&e[N]<D;){let t=e[N],i=e[N+1],o=Math.max(n,t),s=Math.min(D,i);if(o<=s&&new OD(o+r,s+r,o,s).addToSet(M),i>D)break;N+=2}if(!s)return M;new OD(s.fromA,s.toA,s.fromB,s.toB).addToSet(M),o=s.toA,n=s.toB}}}class yD{constructor(t,e,M){this.view=t,this.state=e,this.transactions=M,this.flags=0,this.startState=t.state,this.changes=mo.empty(this.startState.doc.length);for(let t of M)this.changes=this.changes.compose(t.changes);let i=[];this.changes.iterChangedRanges(((t,e,M,N)=>i.push(new OD(t,e,M,N)))),this.changedRanges=i}static create(t,e,M){return new yD(t,e,M)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((t=>t.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class dD extends Cs{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=lr.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Ir],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new OD(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let M=t.changedRanges;this.minWidth>0&&M.length&&(M.every((({fromA:t,toA:e})=>e<this.minWidthFrom||t>this.minWidthTo))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?i=this.domChanged.newSel.head:function(t,e){let M=!1;e&&t.iterChangedRanges(((t,i)=>{t<e.to&&i>e.from&&(M=!0)}));return M}(t.changes,this.hasComposition)||t.selectionSet||(i=t.state.selection.main.head));let N=i>-1?function(t,e,M){let i=AD(t,M);if(!i)return null;let{node:N,from:o,to:n}=i,s=N.nodeValue;if(/[\n\r]/.test(s))return null;if(t.state.doc.sliceString(i.from,i.to)!=s)return null;let r=e.invertedDesc,D=new OD(r.mapPos(o),r.mapPos(n),o,n),a=[];for(let e=N.parentNode;;e=e.parentNode){let M=Cs.get(e);if(M instanceof qs)a.push({node:e,deco:M.mark});else{if(M instanceof Ir||"DIV"==e.nodeName&&e.parentNode==t.contentDOM)return{range:D,text:N,marks:a,line:e};if(e==t.contentDOM)return null;a.push({node:e,deco:new ur({inclusive:!0,attributes:rr(e),tagName:e.tagName.toLowerCase()})})}}}(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:e,to:i}=this.hasComposition;M=new OD(e,i,t.changes.mapPos(e,-1),t.changes.mapPos(i,1)).addToSet(M.slice())}this.hasComposition=N?{from:N.range.fromB,to:N.range.toB}:null,(Xs.ie||Xs.chrome)&&!N&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=function(t,e,M){let i=new hD;return vn.compare(t,e,M,i),i.changes}(this.decorations,this.updateDeco(),t.changes);return M=OD.extendWithRanges(M,o),!!(7&this.flags||0!=M.length)&&(this.updateInner(M,t.startState.doc.length,N),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,M){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,M);let{observer:i}=this.view;i.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=Xs.chrome||Xs.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,t),this.flags&=-8,t&&(t.written||i.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((t=>t.flags&=-9));let N=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let t of this.children)t instanceof Tr&&t.widget instanceof Or&&N.push(t.dom);i.updateGaps(N)}updateChildren(t,e,M){let i=M?M.range.addToSet(t.slice()):t,N=this.childCursor(e);for(let t=i.length-1;;t--){let e=t>=0?i[t]:null;if(!e)break;let o,n,s,r,{fromA:D,toA:a,fromB:l,toB:u}=e;if(M&&M.range.fromB<u&&M.range.toB>l){let t=yr.build(this.view.state.doc,l,M.range.fromB,this.decorations,this.dynamicDecorationMap),e=yr.build(this.view.state.doc,M.range.toB,u,this.decorations,this.dynamicDecorationMap);n=t.breakAtStart,s=t.openStart,r=e.openEnd;let i=this.compositionView(M);e.breakAtStart?i.breakAfter=1:e.content.length&&i.merge(i.length,i.length,e.content[0],!1,e.openStart,0)&&(i.breakAfter=e.content[0].breakAfter,e.content.shift()),t.content.length&&i.merge(0,0,t.content[t.content.length-1],!0,0,t.openEnd)&&t.content.pop(),o=t.content.concat(i).concat(e.content)}else({content:o,breakAtStart:n,openStart:s,openEnd:r}=yr.build(this.view.state.doc,l,u,this.decorations,this.dynamicDecorationMap));let{i:g,off:j}=N.findPos(a,1),{i:c,off:z}=N.findPos(D,-1);Ys(this,c,z,g,j,o,n,s,r)}M&&this.fixCompositionDOM(M)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let t of e.effects)t.is(MD)&&(this.editContextFormatting=t.value)}compositionView(t){let e=new $s(t.text.nodeValue);e.flags|=8;for(let{deco:M}of t.marks)e=new qs(M,[e],e.length);let M=new Ir;return M.append(e,0),M}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some((t=>7&t.flags))?1:0),this.markedForComposition.add(e);let M=Cs.get(t);M&&M!=e&&(M.dom=null),e.setDOM(t)},M=this.childPos(t.range.fromB,1),i=this.children[M.i];e(t.line,i);for(let N=t.marks.length-1;N>=-1;N--)M=i.childPos(M.off,1),i=i.children[M.i],e(N>=0?t.marks[N].node:t.text,i)}updateSelection(t=!1,e=!1){!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let M=this.view.root.activeElement,i=M==this.dom,N=!i&&!(this.view.state.facet(ND)||this.dom.tabIndex>-1)&&us(this.dom,this.view.observer.selectionRange)&&!(M&&this.dom.contains(M));if(!(i||e||N))return;let o=this.forceSelection;this.forceSelection=!1;let n=this.view.state.selection.main,s=this.moveToLine(this.domAtPos(n.anchor)),r=n.empty?s:this.moveToLine(this.domAtPos(n.head));if(Xs.gecko&&n.empty&&!this.hasComposition&&(1==(D=s).node.nodeType&&D.node.firstChild&&(0==D.offset||"false"==D.node.childNodes[D.offset-1].contentEditable)&&(D.offset==D.node.childNodes.length||"false"==D.node.childNodes[D.offset].contentEditable))){let t=document.createTextNode("");this.view.observer.ignore((()=>s.node.insertBefore(t,s.node.childNodes[s.offset]||null))),s=r=new ms(t,0),o=!0}var D;let a=this.view.observer.selectionRange;!o&&a.focusNode&&(js(s.node,s.offset,a.anchorNode,a.anchorOffset)&&js(r.node,r.offset,a.focusNode,a.focusOffset)||this.suppressWidgetCursorChange(a,n))||(this.view.observer.ignore((()=>{Xs.android&&Xs.chrome&&this.dom.contains(a.focusNode)&&function(t,e){for(let M=t;M&&M!=e;M=M.assignedSlot||M.parentNode)if(1==M.nodeType&&"false"==M.contentEditable)return!0;return!1}(a.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=as(this.view.root);if(t)if(n.empty){if(Xs.gecko){let t=function(t,e){return 1!=t.nodeType?0:(e&&"false"==t.childNodes[e-1].contentEditable?1:0)|(e<t.childNodes.length&&"false"==t.childNodes[e].contentEditable?2:0)}(s.node,s.offset);if(t&&3!=t){let e=(1==t?ks:ws)(s.node,s.offset);e&&(s=new ms(e.node,e.offset))}}t.collapse(s.node,s.offset),null!=n.bidiLevel&&void 0!==t.caretBidiLevel&&(t.caretBidiLevel=n.bidiLevel)}else if(t.extend){t.collapse(s.node,s.offset);try{t.extend(r.node,r.offset)}catch(t){}}else{let e=document.createRange();n.anchor>n.head&&([s,r]=[r,s]),e.setEnd(r.node,r.offset),e.setStart(s.node,s.offset),t.removeAllRanges(),t.addRange(e)}else;N&&this.view.root.activeElement==this.dom&&(this.dom.blur(),M&&M.focus())})),this.view.observer.setSelectionRange(s,r)),this.impreciseAnchor=s.precise?null:new ms(a.anchorNode,a.anchorOffset),this.impreciseHead=r.precise?null:new ms(a.focusNode,a.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&js(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,M=as(t.root),{anchorNode:i,anchorOffset:N}=t.observer.selectionRange;if(!(M&&e.empty&&e.assoc&&M.modify))return;let o=Ir.find(this,e.head);if(!o)return;let n=o.posAtStart;if(e.head==n||e.head==n+o.length)return;let s=this.coordsAt(e.head,-1),r=this.coordsAt(e.head,1);if(!s||!r||s.bottom>r.top)return;let D=this.domAtPos(e.head+e.assoc);M.collapse(D.node,D.offset),M.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let a=t.observer.selectionRange;t.docView.posFromDOM(a.anchorNode,a.anchorOffset)!=e.from&&M.collapse(i,N)}moveToLine(t){let e,M=this.dom;if(t.node!=M)return t;for(let i=t.offset;!e&&i<M.childNodes.length;i++){let t=Cs.get(M.childNodes[i]);t instanceof Ir&&(e=t.domAtPos(0))}for(let i=t.offset-1;!e&&i>=0;i--){let t=Cs.get(M.childNodes[i]);t instanceof Ir&&(e=t.domAtPos(t.length))}return e?new ms(e.node,e.offset,!0):t}nearest(t){for(let e=t;e;){let t=Cs.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let M=this.nearest(t);if(!M)throw new RangeError("Trying to find position for a DOM position outside of the document");return M.localPosFromDOM(t,e)+M.posAtStart}domAtPos(t){let{i:e,off:M}=this.childCursor().findPos(t,-1);for(;e<this.children.length-1;){let t=this.children[e];if(M<t.length||t instanceof Ir)break;e++,M=0}return this.children[e].domAtPos(M)}coordsAt(t,e){let M=null,i=0;for(let N=this.length,o=this.children.length-1;o>=0;o--){let n=this.children[o],s=N-n.breakAfter,r=s-n.length;if(s<t)break;if(r<=t&&(r<t||n.covers(-1))&&(s>t||n.covers(1))&&(!M||n instanceof Ir&&!(M instanceof Ir&&e>=0)))M=n,i=r;else if(M&&r==t&&s==t&&n instanceof Tr&&Math.abs(e)<2){if(n.deco.startSide<0)break;o&&(M=null)}N=r}return M?M.coordsAt(t-i,e):null}coordsForChar(t){let{i:e,off:M}=this.childPos(t,1),i=this.children[e];if(!(i instanceof Ir))return null;for(;i.children.length;){let{i:t,off:e}=i.childPos(M,1);for(;;t++){if(t==i.children.length)return null;if((i=i.children[t]).length)break}M=e}if(!(i instanceof $s))return null;let N=xo(i.text,M);if(N==M)return null;let o=ps(i.dom,M,N).getClientRects();for(let t=0;t<o.length;t++){let e=o[t];if(t==o.length-1||e.top<e.bottom&&e.left<e.right)return e}return null}measureVisibleLineHeights(t){let e=[],{from:M,to:i}=t,N=this.view.contentDOM.clientWidth,o=N>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,n=-1,s=this.view.textDirection==hr.LTR;for(let t=0,r=0;r<this.children.length;r++){let D=this.children[r],a=t+D.length;if(a>i)break;if(t>=M){let M=D.dom.getBoundingClientRect();if(e.push(M.height),o){let e=D.dom.lastChild,i=e?gs(e):[];if(i.length){let e=i[i.length-1],o=s?e.right-M.left:M.right-e.left;o>n&&(n=o,this.minWidth=N,this.minWidthFrom=t,this.minWidthTo=a)}}}t=a+D.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?hr.RTL:hr.LTR}measureTextSize(){for(let t of this.children)if(t instanceof Ir){let e=t.measureTextSize();if(e)return e}let t,e,M,i=document.createElement("div");return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(i);let N=gs(i.firstChild)[0];t=i.getBoundingClientRect().height,e=N?N.width/27:7,M=N?N.height:t,i.remove()})),{lineHeight:t,charWidth:e,textHeight:M}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new bs(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let M=0,i=0;;i++){let N=i==e.viewports.length?null:e.viewports[i],o=N?N.from-1:this.length;if(o>M){let i=(e.lineBlockAt(o).bottom-e.lineBlockAt(M).top)/this.view.scaleY;t.push(lr.replace({widget:new Or(i),block:!0,inclusive:!0,isBlockGap:!0}).range(M,o))}if(!N)break;M=N.to+1}return lr.set(t)}updateDeco(){let t=1,e=this.view.state.facet(lD).map((e=>(this.dynamicDecorationMap[t++]="function"==typeof e)?e(this.view):e)),M=!1,i=this.view.state.facet(uD).map(((t,e)=>{let i="function"==typeof t;return i&&(M=!0),i?t(this.view):t}));for(i.length&&(this.dynamicDecorationMap[t++]=M,e.push(vn.join(i))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations}scrollIntoView(t){if(t.isSnapshot){let e=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=e.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin)}for(let e of this.view.state.facet(Kr))try{if(e(this.view,t.range,t))return!0}catch(t){iD(this.view.state,t,"scroll handler")}let e,{range:M}=t,i=this.coordsAt(M.head,M.empty?M.assoc:M.head>M.anchor?-1:1);if(!i)return;!M.empty&&(e=this.coordsAt(M.anchor,M.anchor>M.head?-1:1))&&(i={left:Math.min(i.left,e.left),top:Math.min(i.top,e.top),right:Math.max(i.right,e.right),bottom:Math.max(i.bottom,e.bottom)});let N=ID(this.view),o={left:i.left-N.left,top:i.top-N.top,right:i.right+N.right,bottom:i.bottom+N.bottom},{offsetWidth:n,offsetHeight:s}=this.view.scrollDOM;!function(t,e,M,i,N,o,n,s){let r=t.ownerDocument,D=r.defaultView||window;for(let a=t,l=!1;a&&!l;)if(1==a.nodeType){let t,u=a==r.body,g=1,j=1;if(u)t=ys(D);else{if(/^(fixed|sticky)$/.test(getComputedStyle(a).position)&&(l=!0),a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth){a=a.assignedSlot||a.parentNode;continue}let e=a.getBoundingClientRect();({scaleX:g,scaleY:j}=ds(a,e)),t={left:e.left,right:e.left+a.clientWidth*g,top:e.top,bottom:e.top+a.clientHeight*j}}let c=0,z=0;if("nearest"==N)e.top<t.top?(z=-(t.top-e.top+n),M>0&&e.bottom>t.bottom+z&&(z=e.bottom-t.bottom+z+n)):e.bottom>t.bottom&&(z=e.bottom-t.bottom+n,M<0&&e.top-z<t.top&&(z=-(t.top+z-e.top+n)));else{let i=e.bottom-e.top,o=t.bottom-t.top;z=("center"==N&&i<=o?e.top+i/2-o/2:"start"==N||"center"==N&&M<0?e.top-n:e.bottom-o+n)-t.top}if("nearest"==i?e.left<t.left?(c=-(t.left-e.left+o),M>0&&e.right>t.right+c&&(c=e.right-t.right+c+o)):e.right>t.right&&(c=e.right-t.right+o,M<0&&e.left<t.left+c&&(c=-(t.left+c-e.left+o))):c=("center"==i?e.left+(e.right-e.left)/2-(t.right-t.left)/2:"start"==i==s?e.left-o:e.right-(t.right-t.left)+o)-t.left,c||z)if(u)D.scrollBy(c,z);else{let t=0,M=0;if(z){let t=a.scrollTop;a.scrollTop+=z/j,M=(a.scrollTop-t)*j}if(c){let e=a.scrollLeft;a.scrollLeft+=c/g,t=(a.scrollLeft-e)*g}e={left:e.left-t,top:e.top-M,right:e.right-t,bottom:e.bottom-M},t&&Math.abs(t-c)<1&&(i="nearest"),M&&Math.abs(M-z)<1&&(N="nearest")}if(u)break;a=a.assignedSlot||a.parentNode}else{if(11!=a.nodeType)break;a=a.host}}(this.view.scrollDOM,o,M.head<M.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,n),-n),Math.max(Math.min(t.yMargin,s),-s),this.view.textDirection==hr.LTR)}}function AD(t,e){let M=t.observer.selectionRange;if(!M.focusNode)return null;let i=ks(M.focusNode,M.focusOffset),N=ws(M.focusNode,M.focusOffset),o=i||N;if(N&&i&&N.node!=i.node){let e=Cs.get(N.node);if(!e||e instanceof $s&&e.text!=N.node.nodeValue)o=N;else if(t.docView.lastCompositionAfterCursor){let t=Cs.get(i.node);!t||t instanceof $s&&t.text!=i.node.nodeValue||(o=N)}}if(t.docView.lastCompositionAfterCursor=o!=i,!o)return null;let n=e-o.offset;return{from:n,to:n+o.node.nodeValue.length,node:o.node}}let hD=class{constructor(){this.changes=[]}compareRange(t,e){zr(t,e,this.changes)}comparePoint(t,e){zr(t,e,this.changes)}boundChange(t){zr(t,t,this.changes)}};function LD(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function xD(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function pD(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function SD(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function QD(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function ED(t,e,M){let i,N,o,n,s,r,D,a,l=!1;for(let u=t.firstChild;u;u=u.nextSibling){let t=gs(u);for(let g=0;g<t.length;g++){let j=t[g];N&&pD(N,j)&&(j=SD(QD(j,N.bottom),N.top));let c=LD(e,j),z=xD(M,j);if(0==c&&0==z)return 3==u.nodeType?kD(u,e,M):ED(u,e,M);if(!i||n>z||n==z&&o>c){i=u,N=j,o=c,n=z;let s=z?M<j.top?-1:1:c?e<j.left?-1:1:0;l=!s||(s>0?g<t.length-1:g>0)}0==c?M>j.bottom&&(!D||D.bottom<j.bottom)?(s=u,D=j):M<j.top&&(!a||a.top>j.top)&&(r=u,a=j):D&&pD(D,j)?D=QD(D,j.bottom):a&&pD(a,j)&&(a=SD(a,j.top))}}if(D&&D.bottom>=M?(i=s,N=D):a&&a.top<=M&&(i=r,N=a),!i)return{node:t,offset:0};let u=Math.max(N.left,Math.min(N.right,e));return 3==i.nodeType?kD(i,u,M):l&&"false"!=i.contentEditable?ED(i,u,M):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,i)+(e>=(N.left+N.right)/2?1:0)}}function kD(t,e,M){let i=t.nodeValue.length,N=-1,o=1e9,n=0;for(let s=0;s<i;s++){let i=ps(t,s,s+1).getClientRects();for(let r=0;r<i.length;r++){let D=i[r];if(D.top==D.bottom)continue;n||(n=e-D.left);let a=(D.top>M?D.top-M:M-D.bottom)-1;if(D.left-1<=e&&D.right+1>=e&&a<o){let M=e>=(D.left+D.right)/2,i=M;if(Xs.chrome||Xs.gecko){ps(t,s).getBoundingClientRect().left==D.right&&(i=!M)}if(a<=0)return{node:t,offset:s+(i?1:0)};N=s+(i?1:0),o=a}}}return{node:t,offset:N>-1?N:n>0?t.nodeValue.length:0}}function wD(t,e,M,i=-1){var N,o;let n,s=t.contentDOM.getBoundingClientRect(),r=s.top+t.viewState.paddingTop,{docHeight:D}=t.viewState,{x:a,y:l}=e,u=l-r;if(u<0)return 0;if(u>D)return t.state.doc.length;for(let e=t.viewState.heightOracle.textHeight/2,N=!1;n=t.elementAtHeight(u),n.type!=ar.Text;)for(;u=i>0?n.bottom+e:n.top-e,!(u>=0&&u<=D);){if(N)return M?null:0;N=!0,i=-i}l=r+u;let g=n.from;if(g<t.viewport.from)return 0==t.viewport.from?0:M?null:mD(t,s,n,a,l);if(g>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:M?null:mD(t,s,n,a,l);let j=t.dom.ownerDocument,c=t.root.elementFromPoint?t.root:j,z=c.elementFromPoint(a,l);z&&!t.contentDOM.contains(z)&&(z=null),z||(a=Math.max(s.left+1,Math.min(s.right-1,a)),z=c.elementFromPoint(a,l),z&&!t.contentDOM.contains(z)&&(z=null));let I,T=-1;if(z&&0!=(null===(N=t.docView.nearest(z))||void 0===N?void 0:N.isEditable)){if(j.caretPositionFromPoint){let t=j.caretPositionFromPoint(a,l);t&&({offsetNode:I,offset:T}=t)}else if(j.caretRangeFromPoint){let e=j.caretRangeFromPoint(a,l);e&&(({startContainer:I,startOffset:T}=e),(!t.contentDOM.contains(I)||Xs.safari&&function(t,e,M){let i;if(3!=t.nodeType||e!=(i=t.nodeValue.length))return!1;for(let e=t.nextSibling;e;e=e.nextSibling)if(1!=e.nodeType||"BR"!=e.nodeName)return!1;return ps(t,i-1,i).getBoundingClientRect().left>M}(I,T,a)||Xs.chrome&&function(t,e,M){if(0!=e)return!1;for(let e=t;;){let t=e.parentNode;if(!t||1!=t.nodeType||t.firstChild!=e)return!1;if(t.classList.contains("cm-line"))break;e=t}let i=1==t.nodeType?t.getBoundingClientRect():ps(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return M-i.left>5}(I,T,a))&&(I=void 0))}I&&(T=Math.min(Ts(I),T))}if(!I||!t.docView.dom.contains(I)){let e=Ir.find(t.docView,g);if(!e)return u>n.top+n.height/2?n.to:n.from;({node:I,offset:T}=ED(e.dom,a,l))}let O=t.docView.nearest(I);if(!O)return null;if(O.isWidget&&1==(null===(o=O.dom)||void 0===o?void 0:o.nodeType)){let t=O.dom.getBoundingClientRect();return e.y<t.top||e.y<=t.bottom&&e.x<=(t.left+t.right)/2?O.posAtStart:O.posAtEnd}return O.localPosFromDOM(I,T)+O.posAtStart}function mD(t,e,M,i,N){let o=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&M.height>1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;o+=Math.floor((N-M.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let n=t.state.sliceDoc(M.from,M.to);return M.from+$n(n,o,t.state.tabSize)}function UD(t,e){let M=t.lineBlockAt(e);if(Array.isArray(M.type))for(let t of M.type)if(t.to>e||t.to==e&&(t.to==M.to||t.type==ar.Text))return t;return M}function CD(t,e,M,i){let N=t.state.doc.lineAt(e.head),o=t.bidiSpans(N),n=t.textDirectionAt(N.from);for(let s=e,r=null;;){let e=Vr(N,o,n,s,M),D=Zr;if(!e){if(N.number==(M?t.state.doc.lines:1))return s;D="\n",N=t.state.doc.line(N.number+(M?1:-1)),o=t.bidiSpans(N),e=t.visualLineSide(N,!M)}if(r){if(!r(D))return s}else{if(!i)return e;r=i(D)}s=e}}function fD(t,e,M){for(;;){let i=0;for(let N of t)N.between(e-1,e+1,((t,N,o)=>{if(e>t&&e<N){let o=i||M||(e-t<N-e?-1:1);e=o<0?t:N,i=o}}));if(!i)return e}}function bD(t,e,M){let i=fD(t.state.facet(gD).map((e=>e(t))),M.from,e.head>M.from?-1:1);return i==M.from?M:Vo.cursor(i,i<M.from?1:-1)}const YD="￿";class vD{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(mn.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=YD}readRange(t,e){if(!t)return this;let M=t.parentNode;for(let i=t;;){this.findPointBefore(M,i);let t=this.text.length;this.readNode(i);let N=i.nextSibling;if(N==e)break;let o=Cs.get(i),n=Cs.get(N);(o&&n?o.breakAfter:(o?o.breakAfter:zs(i))||zs(N)&&("BR"!=i.nodeName||i.cmIgnore)&&this.text.length>t)&&this.lineBreak(),i=N}return this.findPointBefore(M,e),this}readTextNode(t){let e=t.nodeValue;for(let M of this.points)M.node==t&&(M.pos=this.text.length+Math.min(M.offset,e.length));for(let M=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let N,o=-1,n=1;if(this.lineSeparator?(o=e.indexOf(this.lineSeparator,M),n=this.lineSeparator.length):(N=i.exec(e))&&(o=N.index,n=N[0].length),this.append(e.slice(M,o<0?e.length:o)),o<0)break;if(this.lineBreak(),n>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=n-1);M=o+n}}readNode(t){if(t.cmIgnore)return;let e=Cs.get(t),M=e&&e.overrideDOMText;if(null!=M){this.findPointInside(t,M.length);for(let t=M.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let M of this.points)M.node==t&&t.childNodes[M.offset]==e&&(M.pos=this.text.length)}findPointInside(t,e){for(let M of this.points)(3==t.nodeType?M.node==t:t.contains(M.node))&&(M.pos=this.text.length+(ZD(t,M.node,M.offset)?e:0))}}function ZD(t,e,M){for(;;){if(!e||M<Ts(e))return!1;if(e==t)return!0;M=cs(e)+1,e=e.parentNode}}class VD{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class WD{constructor(t,e,M,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:N,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,M,0))){let e=N||o?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:M,anchorOffset:i,focusNode:N,focusOffset:o}=t.observer.selectionRange;M&&(e.push(new VD(M,i)),N==M&&o==i||e.push(new VD(N,o)));return e}(t),M=new vD(e,t.state);M.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=M.text,this.newSel=function(t,e){if(0==t.length)return null;let M=t[0].pos,i=2==t.length?t[1].pos:M;return M>-1&&i>-1?Vo.single(M+e,i+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,M=N&&N.node==e.focusNode&&N.offset==e.focusOffset||!ls(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),i=o&&o.node==e.anchorNode&&o.offset==e.anchorOffset||!ls(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),n=t.viewport;if((Xs.ios||Xs.chrome)&&t.state.selection.main.empty&&M!=i&&(n.from>0||n.to<t.state.doc.length)){let e=Math.min(M,i),N=Math.max(M,i),o=n.from-e,s=n.to-N;0!=o&&1!=o&&0!=e||0!=s&&-1!=s&&N!=t.state.doc.length||(M=0,i=t.state.doc.length)}this.newSel=Vo.single(i,M)}}}function PD(t,e){let M,{newSel:i}=e,N=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:i,to:n}=e.bounds,s=N.from,r=null;(8===o||Xs.android&&e.text.length<n-i)&&(s=N.to,r="end");let D=function(t,e,M,i){let N=Math.min(t.length,e.length),o=0;for(;o<N&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==N&&t.length==e.length)return null;let n=t.length,s=e.length;for(;n>0&&s>0&&t.charCodeAt(n-1)==e.charCodeAt(s-1);)n--,s--;if("end"==i){M-=n+Math.max(0,o-Math.min(n,s))-o}if(n<o&&t.length<e.length){o-=M<=o&&M>=n?o-M:0,s=o+(s-n),n=o}else if(s<o){o-=M<=o&&M>=s?o-M:0,n=o+(n-s),s=o}return{from:o,toA:n,toB:s}}(t.state.doc.sliceString(i,n,YD),e.text,s-i,r);D&&(Xs.chrome&&13==o&&D.toB==D.from+2&&e.text.slice(D.from,D.toB)==YD+YD&&D.toB--,M={from:i+D.from,to:i+D.toA,insert:jo.of(e.text.slice(D.from,D.toB).split(YD))})}else i&&(!t.hasFocus&&t.state.facet(ND)||i.main.eq(N))&&(i=null);if(!M&&!i)return!1;if(!M&&e.typeOver&&!N.empty&&i&&i.main.empty?M={from:N.from,to:N.to,insert:t.state.doc.slice(N.from,N.to)}:(Xs.mac||Xs.android)&&M&&M.from==M.to&&M.from==N.head-1&&/^\. ?$/.test(M.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(i&&2==M.insert.length&&(i=Vo.single(i.main.anchor-1,i.main.head-1)),M={from:M.from,to:M.to,insert:jo.of([M.insert.toString().replace("."," ")])}):M&&M.from>=N.from&&M.to<=N.to&&(M.from!=N.from||M.to!=N.to)&&N.to-N.from-(M.to-M.from)<=4?M={from:N.from,to:N.to,insert:t.state.doc.slice(N.from,M.from).append(M.insert).append(t.state.doc.slice(M.to,N.to))}:Xs.chrome&&M&&M.from==M.to&&M.from==N.head&&"\n "==M.insert.toString()&&t.lineWrapping&&(i&&(i=Vo.single(i.main.anchor-1,i.main.head-1)),M={from:N.from,to:N.to,insert:jo.of([" "])}),M)return RD(t,M,i,o);if(i&&!i.main.eq(N)){let e=!1,M="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),M=t.inputState.lastSelectionOrigin),t.dispatch({selection:i,scrollIntoView:e,userEvent:M}),!0}return!1}function RD(t,e,M,i=-1){if(Xs.ios&&t.inputState.flushIOSKey(e))return!0;let N=t.state.selection.main;if(Xs.android&&(e.to==N.to&&(e.from==N.from||e.from==N.from-1&&" "==t.state.sliceDoc(e.from,N.from))&&1==e.insert.length&&2==e.insert.lines&&Ss(t.contentDOM,"Enter",13)||(e.from==N.from-1&&e.to==N.to&&0==e.insert.length||8==i&&e.insert.length<e.to-e.from&&e.to>N.head)&&Ss(t.contentDOM,"Backspace",8)||e.from==N.from&&e.to==N.to+1&&0==e.insert.length&&Ss(t.contentDOM,"Delete",46)))return!0;let o,n=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s=()=>o||(o=function(t,e,M){let i,N=t.state,o=N.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!M||M.main.empty&&M.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let M=o.from<e.from?N.sliceDoc(o.from,e.from):"",n=o.to>e.to?N.sliceDoc(e.to,o.to):"";i=N.replaceSelection(t.state.toText(M+e.insert.sliceString(0,void 0,t.state.lineBreak)+n))}else{let n=N.changes(e),s=M&&M.main.to<=n.newLength?M.main:void 0;if(N.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let r,D=t.state.sliceDoc(e.from,e.to),a=M&&AD(t,M.main.head);if(a){let t=e.insert.length-(e.to-e.from);r={from:a.from,to:a.to-t}}else r=t.state.doc.lineAt(o.head);let l=o.to-e.to,u=o.to-o.from;i=N.changeByRange((M=>{if(M.from==o.from&&M.to==o.to)return{changes:n,range:s||M.map(n)};let i=M.to-l,a=i-D.length;if(M.to-M.from!=u||t.state.sliceDoc(a,i)!=D||M.to>=r.from&&M.from<=r.to)return{range:M};let g=N.changes({from:a,to:i,insert:e.insert}),j=M.to-o.to;return{changes:g,range:s?Vo.range(Math.max(0,s.anchor+j),Math.max(0,s.head+j)):M.map(g)}}))}else i={changes:n,selection:s&&N.selection.replaceRange(s)}}let n="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,n+=".compose",t.inputState.compositionFirstChange&&(n+=".start",t.inputState.compositionFirstChange=!1));return N.update(i,{userEvent:n,scrollIntoView:!0})}(t,e,M));return t.state.facet(Fr).some((M=>M(t,e.from,e.to,n,s)))||t.dispatch(s()),!0}class GD{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Xs.safari&&t.contentDOM.addEventListener("input",(()=>null)),Xs.gecko&&function(t){Ia.has(t)||(Ia.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{})))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let M,i=e.target;i!=t.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(M=Cs.get(i))&&M.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t))}runHandlers(t,e){let M=this.handlers[t];if(M){for(let t of M.observers)t(this.view,e);for(let t of M.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=_D(t),M=this.handlers,i=this.view.contentDOM;for(let t in e)if("scroll"!=t){let N=!e[t].handlers.length,o=M[t];o&&N!=!o.handlers.length&&(i.removeEventListener(t,this.handleEvent),o=null),o||i.addEventListener(t,this.handleEvent,{passive:N})}for(let t in M)"scroll"==t||e[t]||i.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&HD.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Xs.android&&Xs.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return!Xs.ios||t.synthetic||t.altKey||t.metaKey||!((e=FD.find((e=>e.keyCode==t.keyCode)))&&!t.ctrlKey||JD.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(!("Enter"==e.key&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString()))&&(this.pendingIOSKey=void 0,Ss(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0)))}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(Xs.safari&&!Xs.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function BD(t,e){return(M,i)=>{try{return e.call(t,i,M)}catch(t){iD(M.state,t)}}}function _D(t){let e=Object.create(null);function M(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec;if(t&&t.domEventHandlers)for(let i in t.domEventHandlers){let N=t.domEventHandlers[i];N&&M(i).handlers.push(BD(e.value,N))}if(t&&t.domEventObservers)for(let i in t.domEventObservers){let N=t.domEventObservers[i];N&&M(i).observers.push(BD(e.value,N))}}for(let t in qD)M(t).handlers.push(qD[t]);for(let t in KD)M(t).observers.push(KD[t]);return e}const FD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],JD="dthko",HD=[16,17,18,20,91,92,224,225];function XD(t){return.7*Math.max(0,t)+8}class $D{constructor(t,e,M,i){this.view=t,this.startEvent=e,this.style=M,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){let e,M,i=t.ownerDocument;for(let N=t.parentNode;N&&!(N==i.body||e&&M);)if(1==N.nodeType)!M&&N.scrollHeight>N.clientHeight&&(M=N),!e&&N.scrollWidth>N.clientWidth&&(e=N),N=N.assignedSlot||N.parentNode;else{if(11!=N.nodeType)break;N=N.host}return{x:e,y:M}}(t.contentDOM),this.atoms=t.state.facet(gD).map((e=>e(t)));let N=t.contentDOM.ownerDocument;N.addEventListener("mousemove",this.move=this.move.bind(this)),N.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(mn.allowMultipleSelections)&&function(t,e){let M=t.state.facet(Pr);return M.length?M[0](e):Xs.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:M}=t.state.selection;if(M.empty)return!1;let i=as(t.root);if(!i||0==i.rangeCount)return!0;let N=i.getRangeAt(0).getClientRects();for(let t=0;t<N.length;t++){let M=N[t];if(M.left<=e.clientX&&M.right>=e.clientX&&M.top<=e.clientY&&M.bottom>=e.clientY)return!0}return!1}(t,e)||1!=la(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&function(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,M=0,i=0,N=0,o=this.view.win.innerWidth,n=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:N,bottom:n}=this.scrollParents.y.getBoundingClientRect());let s=ID(this.view);t.clientX-s.left<=i+6?e=-XD(i-t.clientX):t.clientX+s.right>=o-6&&(e=XD(t.clientX-o)),t.clientY-s.top<=N+6?M=-XD(N-t.clientY):t.clientY+s.bottom>=n-6&&(M=XD(t.clientY-n)),this.setScrollSpeed(e,M)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let M=0;M<t.ranges.length;M++){let i=t.ranges[M],N=null;if(i.empty){let t=fD(this.atoms,i.from,0);t!=i.from&&(N=Vo.cursor(t,-1))}else{let t=fD(this.atoms,i.from,-1),e=fD(this.atoms,i.to,1);t==i.from&&e==i.to||(N=Vo.range(i.from==i.anchor?t:e,i.from==i.head?t:e))}N&&(e||(e=t.ranges.slice()),e[M]=N)}return e?Vo.create(e,t.mainIndex):t}select(t){let{view:e}=this,M=this.skipAtoms(this.style.get(t,this.extend,this.multiple));!this.mustSelect&&M.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:M,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some((t=>t.isUserEvent("input.type")))?this.destroy():this.style.update(t)&&setTimeout((()=>this.select(this.lastEvent)),20)}}const qD=Object.create(null),KD=Object.create(null),ta=Xs.ie&&Xs.ie_version<15||Xs.ios&&Xs.webkit_version<604;function ea(t,e,M){for(let i of t.facet(e))M=i(M,t);return M}function Ma(t,e){e=ea(t.state,Hr,e);let M,{state:i}=t,N=1,o=i.toText(e),n=o.lines==i.selection.ranges.length,s=null!=ga&&i.selection.ranges.every((t=>t.empty))&&ga==o.toString();if(s){let t=-1;M=i.changeByRange((M=>{let s=i.doc.lineAt(M.from);if(s.from==t)return{range:M};t=s.from;let r=i.toText((n?o.line(N++).text:e)+i.lineBreak);return{changes:{from:s.from,insert:r},range:Vo.cursor(M.from+r.length)}}))}else M=n?i.changeByRange((t=>{let e=o.line(N++);return{changes:{from:t.from,to:t.to,insert:e.text},range:Vo.cursor(t.from+e.length)}})):i.replaceSelection(o);t.dispatch(M,{userEvent:"input.paste",scrollIntoView:!0})}function ia(t,e,M,i){if(1==i)return Vo.cursor(e,M);if(2==i)return function(t,e,M=1){let i=t.charCategorizer(e),N=t.doc.lineAt(e),o=e-N.from;if(0==N.length)return Vo.cursor(e);0==o?M=1:o==N.length&&(M=-1);let n=o,s=o;M<0?n=xo(N.text,o,!1):s=xo(N.text,o);let r=i(N.text.slice(n,s));for(;n>0;){let t=xo(N.text,n,!1);if(i(N.text.slice(t,n))!=r)break;n=t}for(;s<N.length;){let t=xo(N.text,s);if(i(N.text.slice(s,t))!=r)break;s=t}return Vo.range(n+N.from,s+N.from)}(t.state,e,M);{let M=Ir.find(t.docView,e),i=t.state.doc.lineAt(M?M.posAtEnd:e),N=M?M.posAtStart:i.from,o=M?M.posAtEnd:i.to;return o<t.state.doc.length&&o==i.to&&o++,Vo.range(N,o)}}KD.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},qD.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),KD.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},KD.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},qD.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let M=null;for(let i of t.state.facet(Gr))if(M=i(t,e),M)break;if(M||0!=e.button||(M=function(t,e){let M=na(t,e),i=la(e),N=t.state.selection;return{update(t){t.docChanged&&(M.pos=t.changes.mapPos(M.pos),N=N.map(t.changes))},get(e,o,n){let s,r=na(t,e),D=ia(t,r.pos,r.bias,i);if(M.pos!=r.pos&&!o){let e=ia(t,M.pos,M.bias,i),N=Math.min(e.from,D.from),o=Math.max(e.to,D.to);D=N<D.from?Vo.range(N,o):Vo.range(o,N)}return o?N.replaceRange(N.main.extend(D.from,D.to)):n&&1==i&&N.ranges.length>1&&(s=function(t,e){for(let M=0;M<t.ranges.length;M++){let{from:i,to:N}=t.ranges[M];if(i<=e&&N>=e)return Vo.create(t.ranges.slice(0,M).concat(t.ranges.slice(M+1)),t.mainIndex==M?0:t.mainIndex-(t.mainIndex>M?1:0))}return null}(N,r.pos))?s:n?N.addRange(D):Vo.create([D])}}}(t,e)),M){let i=!t.hasFocus;t.inputState.startMouseSelection(new $D(t,e,M,i)),i&&t.observer.ignore((()=>{xs(t.contentDOM);let e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur()}));let N=t.inputState.mouseSelection;if(N)return N.start(e),!1===N.dragging}return!1};let Na=(t,e,M)=>e>=M.top&&e<=M.bottom&&t>=M.left&&t<=M.right;function oa(t,e,M,i){let N=Ir.find(t.docView,e);if(!N)return 1;let o=e-N.posAtStart;if(0==o)return 1;if(o==N.length)return-1;let n=N.coordsAt(o,-1);if(n&&Na(M,i,n))return-1;let s=N.coordsAt(o,1);return s&&Na(M,i,s)?1:n&&n.bottom>=i?-1:1}function na(t,e){let M=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:M,bias:oa(t,M,e.clientX,e.clientY)}}const sa=Xs.ie&&Xs.ie_version<=11;let ra=null,Da=0,aa=0;function la(t){if(!sa)return t.detail;let e=ra,M=aa;return ra=t,aa=Date.now(),Da=!e||M>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Da+1)%3:1}function ua(t,e,M,i){if(!(M=ea(t.state,Hr,M)))return;let N=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,n=i&&o&&function(t,e){let M=t.state.facet(Rr);return M.length?M[0](e):Xs.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:o.from,to:o.to}:null,s={from:N,insert:M},r=t.state.changes(n?[n,s]:s);t.focus(),t.dispatch({changes:r,selection:{anchor:r.mapPos(N,-1),head:r.mapPos(N,1)},userEvent:n?"move.drop":"input.drop"}),t.inputState.draggedContent=null}qD.dragstart=(t,e)=>{let{selection:{main:M}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let t=i.posAtStart,e=t+i.length;(t>=M.to||e<=M.from)&&(M=Vo.range(t,e))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=M,e.dataTransfer&&(e.dataTransfer.setData("Text",ea(t.state,Xr,t.state.sliceDoc(M.from,M.to))),e.dataTransfer.effectAllowed="copyMove"),!1},qD.dragend=t=>(t.inputState.draggedContent=null,!1),qD.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let M=e.dataTransfer.files;if(M&&M.length){let i=Array(M.length),N=0,o=()=>{++N==M.length&&ua(t,e,i.filter((t=>null!=t)).join(t.state.lineBreak),!1)};for(let t=0;t<M.length;t++){let e=new FileReader;e.onerror=o,e.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(i[t]=e.result),o()},e.readAsText(M[t])}return!0}{let M=e.dataTransfer.getData("Text");if(M)return ua(t,e,M,!0),!0}return!1},qD.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let M=ta?null:e.clipboardData;return M?(Ma(t,M.getData("text/plain")||M.getData("text/uri-list")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let M=e.appendChild(document.createElement("textarea"));M.style.cssText="position: fixed; left: -10000px; top: 10px",M.focus(),setTimeout((()=>{t.focus(),M.remove(),Ma(t,M.value)}),50)}(t),!1)};let ga=null;qD.copy=qD.cut=(t,e)=>{let{text:M,ranges:i,linewise:N}=function(t){let e=[],M=[],i=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),M.push(i));if(!e.length){let N=-1;for(let{from:i}of t.selection.ranges){let o=t.doc.lineAt(i);o.number>N&&(e.push(o.text),M.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),N=o.number}i=!0}return{text:ea(t,Xr,e.join(t.lineBreak)),ranges:M,linewise:i}}(t.state);if(!M&&!N)return!1;ga=N?M:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=ta?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",M),!0):(function(t,e){let M=t.dom.parentNode;if(!M)return;let i=M.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout((()=>{i.remove(),t.focus()}),50)}(t,M),!1)};const ja=In.define();function ca(t,e){let M=[];for(let i of t.facet(Jr)){let N=i(t,e);N&&M.push(N)}return M?t.update({effects:M,annotations:ja.of(!0)}):null}function za(t){setTimeout((()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let M=ca(t.state,e);M?t.dispatch(M):t.update([])}}),10)}KD.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),za(t)},KD.blur=t=>{t.observer.clearSelectionRange(),za(t)},KD.compositionstart=KD.compositionupdate=t=>{t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},KD.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Xs.chrome&&Xs.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then((()=>t.observer.flush())):setTimeout((()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])}),50))},KD.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},qD.beforeinput=(t,e)=>{var M,i;if("insertReplacementText"==e.inputType&&t.observer.editContext){let i=null===(M=e.dataTransfer)||void 0===M?void 0:M.getData("text/plain"),N=e.getTargetRanges();if(i&&N.length){let e=N[0],M=t.posAtDOM(e.startContainer,e.startOffset),o=t.posAtDOM(e.endContainer,e.endOffset);return RD(t,{from:M,to:o,insert:t.state.toText(i)},null),!0}}let N;if(Xs.chrome&&Xs.android&&(N=FD.find((t=>t.inputType==e.inputType)))&&(t.observer.delayAndroidKey(N.key,N.keyCode),"Backspace"==N.key||"Delete"==N.key)){let e=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout((()=>{var M;((null===(M=window.visualViewport)||void 0===M?void 0:M.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())}),100)}return Xs.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),Xs.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout((()=>KD.compositionend(t,e)),20),!1};const Ia=new Set;const Ta=["pre-wrap","normal","pre-line","break-spaces"];let Oa=!1;function ya(){Oa=!1}class da{constructor(t){this.lineWrapping=t,this.doc=jo.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let M=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(M+=Math.max(0,Math.ceil((e-t-M*this.lineLength*.5)/this.lineLength))),this.lineHeight*M}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Ta.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let M=0;M<t.length;M++){let i=t[M];i<0?M++:this.heightSamples[Math.floor(10*i)]||(e=!0,this.heightSamples[Math.floor(10*i)]=!0)}return e}refresh(t,e,M,i,N,o){let n=Ta.indexOf(t)>-1,s=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=n;if(this.lineWrapping=n,this.lineHeight=e,this.charWidth=M,this.textHeight=i,this.lineLength=N,s){this.heightSamples={};for(let t=0;t<o.length;t++){let e=o[t];e<0?t++:this.heightSamples[Math.floor(10*e)]=!0}}return s}}class Aa{constructor(t,e){this.from=t,this.heights=e,this.index=0}get more(){return this.index<this.heights.length}}class ha{constructor(t,e,M,i,N){this.from=t,this.length=e,this.top=M,this.height=i,this._content=N}get type(){return"number"==typeof this._content?ar.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof jr?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(t){let e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new ha(this.from,this.length+t.length,this.top,this.height+t.height,e)}}var La=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(La||(La={}));const xa=.001;class pa{constructor(t,e,M=2){this.length=t,this.height=e,this.flags=M}get outdated(){return(2&this.flags)>0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>xa&&(Oa=!0),this.height=t)}replace(t,e,M){return pa.of(M)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,M,i){let N=this,o=M.doc;for(let n=i.length-1;n>=0;n--){let{fromA:s,toA:r,fromB:D,toB:a}=i[n],l=N.lineAt(s,La.ByPosNoHeight,M.setDoc(e),0,0),u=l.to>=r?l:N.lineAt(r,La.ByPosNoHeight,M,0,0);for(a+=u.to-r,r=u.to;n>0&&l.from<=i[n-1].toA;)s=i[n-1].fromA,D=i[n-1].fromB,n--,s<l.from&&(l=N.lineAt(s,La.ByPosNoHeight,M,0,0));D+=l.from-s,s=l.from;let g=Ua.build(M.setDoc(o),t,D,a);N=Sa(N,N.replace(s,r,g))}return N.updateHeight(M,0)}static empty(){return new Ea(0,0)}static of(t){if(1==t.length)return t[0];let e=0,M=t.length,i=0,N=0;for(;;)if(e==M)if(i>2*N){let N=t[e-1];N.break?t.splice(--e,1,N.left,null,N.right):t.splice(--e,1,N.left,N.right),M+=1+N.break,i-=N.size}else{if(!(N>2*i))break;{let e=t[M];e.break?t.splice(M,1,e.left,null,e.right):t.splice(M,1,e.left,e.right),M+=2+e.break,N-=e.size}}else if(i<N){let M=t[e++];M&&(i+=M.size)}else{let e=t[--M];e&&(N+=e.size)}let o=0;return null==t[e-1]?(o=1,e--):null==t[e]&&(o=1,M++),new wa(pa.of(t.slice(0,e)),o,pa.of(t.slice(M)))}}function Sa(t,e){return t==e?t:(t.constructor!=e.constructor&&(Oa=!0),e)}pa.prototype.size=1;class Qa extends pa{constructor(t,e,M){super(t,e),this.deco=M}blockAt(t,e,M,i){return new ha(i,this.length,M,this.height,this.deco||0)}lineAt(t,e,M,i,N){return this.blockAt(0,M,i,N)}forEachLine(t,e,M,i,N,o){t<=N+this.length&&e>=N&&o(this.blockAt(0,M,i,N))}updateHeight(t,e=0,M=!1,i){return i&&i.from<=e&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ea extends Qa{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,M,i){return new ha(i,this.length,M,this.height,this.breaks)}replace(t,e,M){let i=M[0];return 1==M.length&&(i instanceof Ea||i instanceof ka&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof ka?i=new Ea(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):pa.of(M)}updateHeight(t,e=0,M=!1,i){return i&&i.from<=e&&i.more?this.setHeight(i.heights[i.index++]):(M||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ka extends pa{constructor(t){super(t,0)}heightMetrics(t,e){let M,i=t.doc.lineAt(e).number,N=t.doc.lineAt(e+this.length).number,o=N-i+1,n=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*o);M=e/o,this.length>o+1&&(n=(this.height-e)/(this.length-o-1))}else M=this.height/o;return{firstLine:i,lastLine:N,perLine:M,perChar:n}}blockAt(t,e,M,i){let{firstLine:N,lastLine:o,perLine:n,perChar:s}=this.heightMetrics(e,i);if(e.lineWrapping){let N=i+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-M)/this.height))*this.length)),o=e.doc.lineAt(N),r=n+o.length*s,D=Math.max(M,t-r/2);return new ha(o.from,o.length,D,r,0)}{let i=Math.max(0,Math.min(o-N,Math.floor((t-M)/n))),{from:s,length:r}=e.doc.line(N+i);return new ha(s,r,M+n*i,n,0)}}lineAt(t,e,M,i,N){if(e==La.ByHeight)return this.blockAt(t,M,i,N);if(e==La.ByPosNoHeight){let{from:e,to:i}=M.doc.lineAt(t);return new ha(e,i-e,0,0,0)}let{firstLine:o,perLine:n,perChar:s}=this.heightMetrics(M,N),r=M.doc.lineAt(t),D=n+r.length*s,a=r.number-o,l=i+n*a+s*(r.from-N-a);return new ha(r.from,r.length,Math.max(i,Math.min(l,i+this.height-D)),D,0)}forEachLine(t,e,M,i,N,o){t=Math.max(t,N),e=Math.min(e,N+this.length);let{firstLine:n,perLine:s,perChar:r}=this.heightMetrics(M,N);for(let D=t,a=i;D<=e;){let e=M.doc.lineAt(D);if(D==t){let M=e.number-n;a+=s*M+r*(t-N-M)}let i=s+r*e.length;o(new ha(e.from,e.length,a,i,0)),a+=i,D=e.to+1}}replace(t,e,M){let i=this.length-e;if(i>0){let t=M[M.length-1];t instanceof ka?M[M.length-1]=new ka(t.length+i):M.push(null,new ka(i-1))}if(t>0){let e=M[0];e instanceof ka?M[0]=new ka(t+e.length):M.unshift(new ka(t-1),null)}return pa.of(M)}decomposeLeft(t,e){e.push(new ka(t-1),null)}decomposeRight(t,e){e.push(null,new ka(this.length-t-1))}updateHeight(t,e=0,M=!1,i){let N=e+this.length;if(i&&i.from<=e+this.length&&i.more){let M=[],o=Math.max(e,i.from),n=-1;for(i.from>e&&M.push(new ka(i.from-e-1).updateHeight(t,e));o<=N&&i.more;){let e=t.doc.lineAt(o).length;M.length&&M.push(null);let N=i.heights[i.index++];-1==n?n=N:Math.abs(N-n)>=xa&&(n=-2);let s=new Ea(e,N);s.outdated=!1,M.push(s),o+=e+1}o<=N&&M.push(null,new ka(N-o).updateHeight(t,o));let s=pa.of(M);return(n<0||Math.abs(s.height-this.height)>=xa||Math.abs(n-this.heightMetrics(t,e).perLine)>=xa)&&(Oa=!0),Sa(this,s)}return(M||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class wa extends pa{constructor(t,e,M){super(t.length+e+M.length,t.height+M.height,e|(t.outdated||M.outdated?2:0)),this.left=t,this.right=M,this.size=t.size+M.size}get break(){return 1&this.flags}blockAt(t,e,M,i){let N=M+this.left.height;return t<N?this.left.blockAt(t,e,M,i):this.right.blockAt(t,e,N,i+this.left.length+this.break)}lineAt(t,e,M,i,N){let o=i+this.left.height,n=N+this.left.length+this.break,s=e==La.ByHeight?t<o:t<n,r=s?this.left.lineAt(t,e,M,i,N):this.right.lineAt(t,e,M,o,n);if(this.break||(s?r.to<n:r.from>n))return r;let D=e==La.ByPosNoHeight?La.ByPosNoHeight:La.ByPos;return s?r.join(this.right.lineAt(n,D,M,o,n)):this.left.lineAt(n,D,M,i,N).join(r)}forEachLine(t,e,M,i,N,o){let n=i+this.left.height,s=N+this.left.length+this.break;if(this.break)t<s&&this.left.forEachLine(t,e,M,i,N,o),e>=s&&this.right.forEachLine(t,e,M,n,s,o);else{let r=this.lineAt(s,La.ByPos,M,i,N);t<r.from&&this.left.forEachLine(t,r.from-1,M,i,N,o),r.to>=t&&r.from<=e&&o(r),e>r.to&&this.right.forEachLine(r.to+1,e,M,n,s,o)}}replace(t,e,M){let i=this.left.length+this.break;if(e<i)return this.balanced(this.left.replace(t,e,M),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-i,e-i,M));let N=[];t>0&&this.decomposeLeft(t,N);let o=N.length;for(let t of M)N.push(t);if(t>0&&ma(N,o-1),e<this.length){let t=N.length;this.decomposeRight(e,N),ma(N,t)}return pa.of(N)}decomposeLeft(t,e){let M=this.left.length;if(t<=M)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&(M++,t>=M&&e.push(null)),t>M&&this.right.decomposeLeft(t-M,e)}decomposeRight(t,e){let M=this.left.length,i=M+this.break;if(t>=i)return this.right.decomposeRight(t-i,e);t<M&&this.left.decomposeRight(t,e),this.break&&t<i&&e.push(null),e.push(this.right)}balanced(t,e){return t.size>2*e.size||e.size>2*t.size?pa.of(this.break?[t,null,e]:[t,e]):(this.left=Sa(this.left,t),this.right=Sa(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,M=!1,i){let{left:N,right:o}=this,n=e+N.length+this.break,s=null;return i&&i.from<=e+N.length&&i.more?s=N=N.updateHeight(t,e,M,i):N.updateHeight(t,e,M),i&&i.from<=n+o.length&&i.more?s=o=o.updateHeight(t,n,M,i):o.updateHeight(t,n,M),s?this.balanced(N,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ma(t,e){let M,i;null==t[e]&&(M=t[e-1])instanceof ka&&(i=t[e+1])instanceof ka&&t.splice(e-1,3,new ka(M.length+1+i.length))}class Ua{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),M=this.nodes[this.nodes.length-1];M instanceof Ea?M.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new Ea(t-this.pos,-1)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,M){if(t<e||M.heightRelevant){let i=M.widget?M.widget.estimatedHeight:0,N=M.widget?M.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=e-t;M.block?this.addBlock(new Qa(o,i,M)):(o||N||i>=5)&&this.addLineDeco(i,N,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new Ea(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let M=new ka(e-t);return this.oracle.doc.lineAt(t).to==e&&(M.flags|=4),M}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Ea)return t;let e=new Ea(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,M){let i=this.ensureLine();i.length+=M,i.collapsed+=M,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=e,this.writtenTo=this.pos=this.pos+M}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Ea||this.isCovered?(this.writtenTo<this.pos||null==e)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Ea(0,-1));let M=t;for(let t of this.nodes)t instanceof Ea&&t.updateHeight(this.oracle,M),M+=t?t.length:1;return this.nodes}static build(t,e,M,i){let N=new Ua(M,t);return vn.spans(e,M,i,N,0),N.finish(M)}}class Ca{constructor(){this.changes=[]}compareRange(){}comparePoint(t,e,M,i){(t<e||M&&M.heightRelevant||i&&i.heightRelevant)&&zr(t,e,this.changes,5)}}function fa(t,e){let M=t.getBoundingClientRect(),i=t.ownerDocument,N=i.defaultView||window,o=Math.max(0,M.left),n=Math.min(N.innerWidth,M.right),s=Math.max(0,M.top),r=Math.min(N.innerHeight,M.bottom);for(let e=t.parentNode;e&&e!=i.body;)if(1==e.nodeType){let M=e,i=window.getComputedStyle(M);if((M.scrollHeight>M.clientHeight||M.scrollWidth>M.clientWidth)&&"visible"!=i.overflow){let i=M.getBoundingClientRect();o=Math.max(o,i.left),n=Math.min(n,i.right),s=Math.max(s,i.top),r=Math.min(e==t.parentNode?N.innerHeight:r,i.bottom)}e="absolute"==i.position||"fixed"==i.position?M.offsetParent:M.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:o-M.left,right:Math.max(o,n)-M.left,top:s-(M.top+e),bottom:Math.max(s,r)-(M.top+e)}}function ba(t,e){let M=t.getBoundingClientRect();return{left:0,right:M.right-M.left,top:e,bottom:M.bottom-(M.top+e)}}class Ya{constructor(t,e,M,i){this.from=t,this.to=e,this.size=M,this.displaySize=i}static same(t,e){if(t.length!=e.length)return!1;for(let M=0;M<t.length;M++){let i=t[M],N=e[M];if(i.from!=N.from||i.to!=N.to||i.size!=N.size)return!1}return!0}draw(t,e){return lr.replace({widget:new va(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to)}}class va extends Dr{constructor(t,e){super(),this.size=t,this.vertical=e}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class Za{constructor(t){this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Ra,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=hr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let e=t.facet(aD).some((t=>"function"!=typeof t&&"cm-lineWrapping"==t.class));this.heightOracle=new da(e),this.stateDeco=t.facet(lD).filter((t=>"function"!=typeof t)),this.heightMap=pa.empty().applyChanges(this.stateDeco,jo.empty,this.heightOracle.setDoc(t.doc),[new OD(0,0,0,t.doc.length)]);for(let t=0;t<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());t++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=lr.set(this.lineGaps.map((t=>t.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let M=0;M<=1;M++){let i=M?e.head:e.anchor;if(!t.some((({from:t,to:e})=>i>=t&&i<=e))){let{from:e,to:M}=this.lineBlockAt(i);t.push(new Va(e,M))}}return this.viewports=t.sort(((t,e)=>t.from-e.from)),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Ra:new Ga(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(t=>{this.viewportLines.push(Ba(t,this.scaler))}))}update(t,e=null){this.state=t.state;let M=this.stateDeco;this.stateDeco=this.state.facet(lD).filter((t=>"function"!=typeof t));let i=t.changedRanges,N=OD.extendWithRanges(i,function(t,e,M){let i=new Ca;return vn.compare(t,e,M,i,0),i.changes}(M,this.stateDeco,t?t.changes:mo.empty(this.state.doc.length))),o=this.heightMap.height,n=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);ya(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),N),(this.heightMap.height!=o||Oa)&&(t.flags|=2),n?(this.scrollAnchorPos=t.changes.mapPos(n.from,-1),this.scrollAnchorHeight=n.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let s=N.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<s.from||e.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,e));let r=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,t.flags|=this.updateForViewport(),(r||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(qr)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,M=window.getComputedStyle(e),i=this.heightOracle,N=M.whiteSpace;this.defaultTextDirection="rtl"==M.direction?hr.RTL:hr.LTR;let o=this.heightOracle.mustRefreshForWrapping(N),n=e.getBoundingClientRect(),s=o||this.mustMeasureContent||this.contentDOMHeight!=n.height;this.contentDOMHeight=n.height,this.mustMeasureContent=!1;let r=0,D=0;if(n.width&&n.height){let{scaleX:t,scaleY:M}=ds(e,n);(t>.005&&Math.abs(this.scaleX-t)>.005||M>.005&&Math.abs(this.scaleY-M)>.005)&&(this.scaleX=t,this.scaleY=M,r|=16,o=s=!0)}let a=(parseInt(M.paddingTop)||0)*this.scaleY,l=(parseInt(M.paddingBottom)||0)*this.scaleY;this.paddingTop==a&&this.paddingBottom==l||(this.paddingTop=a,this.paddingBottom=l,r|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(s=!0),this.editorWidth=t.scrollDOM.clientWidth,r|=16);let u=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=u&&(this.scrollAnchorHeight=-1,this.scrollTop=u),this.scrolledToBottom=Es(t.scrollDOM);let g=(this.printing?ba:fa)(e,this.paddingTop),j=g.top-this.pixelViewport.top,c=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let z=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(z!=this.inView&&(this.inView=z,z&&(s=!0)),!this.inView&&!this.scrollTarget&&!function(t){let e=t.getBoundingClientRect(),M=t.ownerDocument.defaultView||window;return e.left<M.innerWidth&&e.right>0&&e.top<M.innerHeight&&e.bottom>0}(t.dom))return 0;let I=n.width;if(this.contentDOMWidth==I&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=n.width,this.editorHeight=t.scrollDOM.clientHeight,r|=16),s){let e=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(e)&&(o=!0),o||i.lineWrapping&&Math.abs(I-this.contentDOMWidth)>i.charWidth){let{lineHeight:M,charWidth:n,textHeight:s}=t.docView.measureTextSize();o=M>0&&i.refresh(N,M,n,s,I/n,e),o&&(t.docView.minWidth=0,r|=16)}j>0&&c>0?D=Math.max(j,c):j<0&&c<0&&(D=Math.min(j,c)),ya();for(let M of this.viewports){let N=M.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(M);this.heightMap=(o?pa.empty().applyChanges(this.stateDeco,jo.empty,this.heightOracle,[new OD(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Aa(M.from,N))}Oa&&(r|=2)}let T=!this.viewportIsAppropriate(this.viewport,D)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(2&r&&(r|=this.updateScaler()),this.viewport=this.getViewport(D,this.scrollTarget),r|=this.updateForViewport()),(2&r||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),r|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),r}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let M=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,N=this.heightOracle,{visibleTop:o,visibleBottom:n}=this,s=new Va(i.lineAt(o-1e3*M,La.ByHeight,N,0,0).from,i.lineAt(n+1e3*(1-M),La.ByHeight,N,0,0).to);if(e){let{head:t}=e.range;if(t<s.from||t>s.to){let M,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),n=i.lineAt(t,La.ByPos,N,0,0);M="center"==e.y?(n.top+n.bottom)/2-o/2:"start"==e.y||"nearest"==e.y&&t<s.from?n.top:n.bottom-o,s=new Va(i.lineAt(M-500,La.ByHeight,N,0,0).from,i.lineAt(M+o+500,La.ByHeight,N,0,0).to)}}return s}mapViewport(t,e){let M=e.mapPos(t.from,-1),i=e.mapPos(t.to,1);return new Va(this.heightMap.lineAt(M,La.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,La.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:e},M=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(t,La.ByPos,this.heightOracle,0,0),{bottom:N}=this.heightMap.lineAt(e,La.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:n}=this;return(0==t||i<=o-Math.max(10,Math.min(-M,250)))&&(e==this.state.doc.length||N>=n+Math.max(10,Math.min(M,250)))&&i>o-2e3&&N<n+2e3}mapLineGaps(t,e){if(!t.length||e.empty)return t;let M=[];for(let i of t)e.touchesRange(i.from,i.to)||M.push(new Ya(e.mapPos(i.from),e.mapPos(i.to),i.size,i.displaySize));return M}ensureLineGaps(t,e){let M=this.heightOracle.lineWrapping,i=M?1e4:2e3,N=i>>1,o=i<<1;if(this.defaultTextDirection!=hr.LTR&&!M)return[];let n=[],s=(i,o,r,D)=>{if(o-i<N)return;let a=this.state.selection.main,l=[a.from];a.empty||l.push(a.to);for(let t of l)if(t>i&&t<o)return s(i,t-10,r,D),void s(t+10,o,r,D);let u=function(t,e){for(let M of t)if(e(M))return M;return}(t,(t=>t.from>=r.from&&t.to<=r.to&&Math.abs(t.from-i)<N&&Math.abs(t.to-o)<N&&!l.some((e=>t.from<e&&t.to>e))));if(!u){if(o<r.to&&e&&M&&e.visibleRanges.some((t=>t.from<=o&&t.to>=o))){let t=e.moveToLineBoundary(Vo.cursor(o),!1,!0).head;t>i&&(o=t)}let t=this.gapSize(r,i,o,D);u=new Ya(i,o,t,M||t<2e6?t:2e6)}n.push(u)},r=e=>{if(e.length<o||e.type!=ar.Text)return;let N=function(t,e,M){let i=[],N=t,o=0;vn.spans(M,t,e,{span(){},point(t,e){t>N&&(i.push({from:N,to:t}),o+=t-N),N=e}},20),N<e&&(i.push({from:N,to:e}),o+=e-N);return{total:o,ranges:i}}(e.from,e.to,this.stateDeco);if(N.total<o)return;let n,r,D=this.scrollTarget?this.scrollTarget.range.head:null;if(M){let t,M,o=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=D){let i=Pa(N,D),n=((this.visibleBottom-this.visibleTop)/2+o)/e.height;t=i-n,M=i+n}else t=(this.visibleTop-e.top-o)/e.height,M=(this.visibleBottom-e.top+o)/e.height;n=Wa(N,t),r=Wa(N,M)}else{let M=N.total*this.heightOracle.charWidth,o=i*this.heightOracle.charWidth,s=0;if(M>2e6)for(let M of t)M.from>=e.from&&M.from<e.to&&M.size!=M.displaySize&&M.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=M.size-M.displaySize);let a,l,u=this.pixelViewport.left+s,g=this.pixelViewport.right+s;if(null!=D){let t=Pa(N,D),e=((g-u)/2+o)/M;a=t-e,l=t+e}else a=(u-o)/M,l=(g+o)/M;n=Wa(N,a),r=Wa(N,l)}n>e.from&&s(e.from,n,e,N),r<e.to&&s(r,e.to,e,N)};for(let t of this.viewportLines)Array.isArray(t.type)?t.type.forEach(r):r(t);return n}gapSize(t,e,M,i){let N=Pa(i,M)-Pa(i,e);return this.heightOracle.lineWrapping?t.height*N:i.total*this.heightOracle.charWidth*N}updateLineGaps(t){Ya.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=lr.set(t.map((t=>t.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(t){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let M=[];vn.spans(e,this.viewport.from,this.viewport.to,{span(t,e){M.push({from:t,to:e})},point(){}},20);let i=0;if(M.length!=this.visibleRanges.length)i=12;else for(let e=0;e<M.length&&!(8&i);e++){let N=this.visibleRanges[e],o=M[e];N.from==o.from&&N.to==o.to||(i|=4,t&&t.mapPos(N.from,-1)==o.from&&t.mapPos(N.to,1)==o.to||(i|=8))}return this.visibleRanges=M,i}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find((e=>e.from<=t&&e.to>=t))||Ba(this.heightMap.lineAt(t,La.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((e=>e.top<=t&&e.bottom>=t))||Ba(this.heightMap.lineAt(this.scaler.fromDOM(t),La.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Ba(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Va{constructor(t,e){this.from=t,this.to=e}}function Wa({total:t,ranges:e},M){if(M<=0)return e[0].from;if(M>=1)return e[e.length-1].to;let i=Math.floor(t*M);for(let t=0;;t++){let{from:M,to:N}=e[t],o=N-M;if(i<=o)return M+i;i-=o}}function Pa(t,e){let M=0;for(let{from:i,to:N}of t.ranges){if(e<=N){M+=e-i;break}M+=N-i}return M/t.total}const Ra={toDOM:t=>t,fromDOM:t=>t,scale:1,eq(t){return t==this}};class Ga{constructor(t,e,M){let i=0,N=0,o=0;this.viewports=M.map((({from:M,to:N})=>{let o=e.lineAt(M,La.ByPos,t,0,0).top,n=e.lineAt(N,La.ByPos,t,0,0).bottom;return i+=n-o,{from:M,to:N,top:o,bottom:n,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(e.height-i);for(let t of this.viewports)t.domTop=o+(t.top-N)*this.scale,o=t.domBottom=t.domTop+(t.bottom-t.top),N=t.bottom}toDOM(t){for(let e=0,M=0,i=0;;e++){let N=e<this.viewports.length?this.viewports[e]:null;if(!N||t<N.top)return i+(t-M)*this.scale;if(t<=N.bottom)return N.domTop+(t-N.top);M=N.bottom,i=N.domBottom}}fromDOM(t){for(let e=0,M=0,i=0;;e++){let N=e<this.viewports.length?this.viewports[e]:null;if(!N||t<N.domTop)return M+(t-i)/this.scale;if(t<=N.domBottom)return N.top+(t-N.domTop);M=N.bottom,i=N.domBottom}}eq(t){return t instanceof Ga&&(this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every(((e,M)=>e.from==t.viewports[M].from&&e.to==t.viewports[M].to)))}}function Ba(t,e){if(1==e.scale)return t;let M=e.toDOM(t.top),i=e.toDOM(t.bottom);return new ha(t.from,t.length,M,i-M,Array.isArray(t._content)?t._content.map((t=>Ba(t,e))):t._content)}const _a=Ro.define({combine:t=>t.join(" ")}),Fa=Ro.define({combine:t=>t.indexOf(!0)>-1}),Ja=es.newName(),Ha=es.newName(),Xa=es.newName(),$a={"&light":"."+Ha,"&dark":"."+Xa};function qa(t,e,M){return new es(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,(e=>{if("&"==e)return t;if(!M||!M[e])throw new RangeError(`Unsupported selector: ${e}`);return M[e]})):t+" "+e})}const Ka=qa("."+Ja,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},$a),tl={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},el=Xs.ie&&Xs.ie_version<=11;class Ml{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new As,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((e=>{for(let t of e)this.queue.push(t);(Xs.ie&&Xs.ie_version<=11||Xs.ios&&t.composing)&&e.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),!window.EditContext||!1===t.constructor.EDIT_CONTEXT||Xs.chrome&&Xs.chrome_version<126||(this.editContext=new ol(t),t.state.facet(ND)&&(t.contentDOM.editContext=this.editContext.editContext)),el&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()})),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(t){("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(((e,M)=>e!=t[M])))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:M}=this,i=this.selectionRange;if(M.state.facet(ND)?M.root.activeElement!=this.dom:!us(this.dom,i))return;let N=i.anchorNode&&M.docView.nearest(i.anchorNode);N&&N.ignoreEvent(t)?e||(this.selectionChanged=!1):(Xs.ie&&Xs.ie_version<=11||Xs.android&&Xs.chrome)&&!M.state.selection.main.empty&&i.focusNode&&js(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=as(t.root);if(!e)return!1;let M=Xs.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){let M=e.getComposedRanges(t.root)[0];if(M)return Nl(t,M)}let M=null;function i(t){t.preventDefault(),t.stopImmediatePropagation(),M=t.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),M?Nl(t,M):null}(this.view,e)||e;if(!M||this.selectionRange.eq(M))return!1;let i=us(this.dom,M);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&function(t,e){let M=e.focusNode,i=e.focusOffset;if(!M||e.anchorNode!=M||e.anchorOffset!=i)return!1;for(i=Math.min(i,Ts(M));;)if(i){if(1!=M.nodeType)return!1;let t=M.childNodes[i-1];"false"==t.contentEditable?i--:(M=t,i=Ts(M))}else{if(M==t)return!0;i=cs(M),M=M.parentNode}}(this.dom,M)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(M),i&&(this.selectionChanged=!0),!0)}setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,e=null;for(let M=this.dom;M;)if(1==M.nodeType)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==M?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(M),M=M.assignedSlot||M.parentNode;else{if(11!=M.nodeType)break;M=M.host}if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);for(let t of this.scrollTargets=e)t.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,tl),el&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),el&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,e){var M;if(!this.delayedAndroidKey){let t=()=>{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&Ss(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(null===(M=this.delayedAndroidKey)||void 0===M?void 0:M.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame((()=>{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,M=-1,i=!1;for(let N of t){let t=this.readMutation(N);t&&(t.typeOver&&(i=!0),-1==e?({from:e,to:M}=t):(e=Math.min(t.from,e),M=Math.max(t.to,M)))}return{from:e,to:M,typeOver:i}}readChange(){let{from:t,to:e,typeOver:M}=this.processRecords(),i=this.selectionChanged&&us(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let N=new WD(this.view,t,e,M);return this.view.docView.domChanged={newSel:N.newSel?N.newSel.main:null},N}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let M=this.view.state,i=PD(this.view,e);return this.view.state==M&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){let M=il(e,t.previousSibling||t.target.previousSibling,-1),i=il(e,t.nextSibling||t.target.nextSibling,1);return{from:M?e.posAfter(M):e.posAtStart,to:i?e.posBefore(i):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ND)!=t.state.facet(ND)&&(t.view.contentDOM.editContext=t.state.facet(ND)?this.editContext.editContext:null))}destroy(){var t,e,M;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(M=this.resizeScroll)||void 0===M||M.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function il(t,e,M){for(;e;){let i=Cs.get(e);if(i&&i.parent==t)return i;let N=e.parentNode;e=N!=t.dom?N:M>0?e.nextSibling:e.previousSibling}return null}function Nl(t,e){let M=e.startContainer,i=e.startOffset,N=e.endContainer,o=e.endOffset,n=t.docView.domAtPos(t.state.selection.main.anchor);return js(n.node,n.offset,N,o)&&([M,i,N,o]=[N,o,M,i]),{anchorNode:M,anchorOffset:i,focusNode:N,focusOffset:o}}class ol{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=e=>{let M=t.state.selection.main,{anchor:i,head:N}=M,o=this.toEditorPos(e.updateRangeStart),n=this.toEditorPos(e.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:e.updateRangeStart,editorBase:o,drifted:!1});let s={from:o,to:n,insert:jo.of(e.text.split("\n"))};if(s.from==this.from&&i<this.from?s.from=i:s.to==this.to&&i>this.to&&(s.to=i),s.from!=s.to||s.insert.length){if((Xs.mac||Xs.android)&&s.from==N-1&&/^\. ?$/.test(e.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(s={from:o,to:n,insert:jo.of([e.text.replace("."," ")])}),this.pendingContextChange=s,!t.state.readOnly){let M=this.to-this.from+(s.to-s.from+s.insert.length);RD(t,s,Vo.single(this.toEditorPos(e.selectionStart,M),this.toEditorPos(e.selectionEnd,M)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state))}else{let i=Vo.single(this.toEditorPos(e.selectionStart),this.toEditorPos(e.selectionEnd));i.main.eq(M)||t.dispatch({selection:i,userEvent:"select"})}},this.handlers.characterboundsupdate=M=>{let i=[],N=null;for(let e=this.toEditorPos(M.rangeStart),o=this.toEditorPos(M.rangeEnd);e<o;e++){let M=t.coordsForChar(e);N=M&&new DOMRect(M.left,M.top,M.right-M.left,M.bottom-M.top)||N||new DOMRect,i.push(N)}e.updateCharacterBounds(M.rangeStart,i)},this.handlers.textformatupdate=e=>{let M=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,i=t.underlineThickness;if("None"!=e&&"None"!=i){let N=this.toEditorPos(t.rangeStart),o=this.toEditorPos(t.rangeEnd);if(N<o){let t=`text-decoration: underline ${"Dashed"==e?"dashed ":"Squiggle"==e?"wavy ":""}${"Thin"==i?1:2}px`;M.push(lr.mark({attributes:{style:t}}).range(N,o))}}}t.dispatch({effects:MD.of(lr.set(M))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:e}=this.composing;this.composing=null,e&&this.reset(t.state)}};for(let t in this.handlers)e.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=as(t.root);e&&e.rangeCount&&this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,M=!1,i=this.pendingContextChange;return t.changes.iterChanges(((N,o,n,s,r)=>{if(M)return;let D=r.length-(o-N);if(i&&o>=i.to){if(i.from==N&&i.to==o&&i.insert.eq(r))return i=this.pendingContextChange=null,e+=D,void(this.to+=D);i=null,this.revertPending(t.state)}if(N+=e,(o+=e)<=this.from)this.from+=D,this.to+=D;else if(N<this.to){if(N<this.from||o>this.to||this.to-this.from+r.length>3e4)return void(M=!0);this.editContext.updateText(this.toContextPos(N),this.toContextPos(o),r.toString()),this.to+=D}e+=D})),i&&!M&&this.revertPending(t.state),!M}update(t){let e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some((t=>!t.isUserEvent("input.type")&&t.changes.touchesRange(this.from,this.to))))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,M=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),i=this.toContextPos(e.head);this.editContext.selectionStart==M&&this.editContext.selectionEnd==i||this.editContext.updateSelection(M,i)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>3e4)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let M=this.composing;return M&&M.drifted?M.editorBase+(t-M.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class nl{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:M}=t;this.dispatchTransactions=t.dispatchTransactions||M&&(t=>t.forEach((t=>M(t,this))))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new Za(t.state||mn.create(t)),t.scrollTo&&t.scrollTo.is(eD)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(nD).map((t=>new rD(t)));for(let t of this.plugins)t.update(this);this.observer=new Ml(this),this.inputState=new GD(this),this.inputState.ensureHandlers(this.plugins),this.docView=new dD(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then((()=>this.requestMeasure()))}dispatch(...t){let e=1==t.length&&t[0]instanceof dn?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,M=!1,i=!1,N=this.state;for(let e of t){if(e.startState!=N)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");N=e.state}if(this.destroyed)return void(this.viewState.state=N);let o=this.hasFocus,n=0,s=null;t.some((t=>t.annotation(ja)))?(this.inputState.notifiedFocused=o,n=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,s=ca(N,o),s||(n=1));let r=this.observer.delayedAndroidKey,D=null;if(r?(this.observer.clearDelayedAndroidKey(),D=this.observer.readChange(),(D&&!this.state.doc.eq(N.doc)||!this.state.selection.eq(N.selection))&&(D=null)):this.observer.clear(),N.facet(mn.phrases)!=this.state.facet(mn.phrases))return this.setState(N);e=yD.create(this,N,t),e.flags|=n;let a=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(a&&(a=a.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection;a=new tD(t.empty?t:Vo.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)t.is(eD)&&(a=t.value.clip(this.state))}this.viewState.update(e,a),this.bidiCache=Dl.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),M=this.docView.update(e),this.state.facet(TD)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(M,t.some((t=>t.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(e.startState.facet(_a)!=e.state.facet(_a)&&(this.viewState.mustMeasureContent=!0),(M||i||a||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),M&&this.docViewUpdate(),!e.empty)for(let t of this.state.facet(_r))try{t(e)}catch(t){iD(this.state,t,"update listener")}(s||D)&&Promise.resolve().then((()=>{s&&this.state==s.startState&&this.dispatch(s),D&&!PD(this,D)&&r.force&&Ss(this.contentDOM,r.key,r.keyCode)}))}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new Za(t),this.plugins=t.facet(nD).map((t=>new rD(t))),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new dD(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(nD),M=t.state.facet(nD);if(e!=M){let i=[];for(let N of M){let M=e.indexOf(N);if(M<0)i.push(new rD(N));else{let e=this.plugins[M];e.mustUpdate=t,i.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t<this.plugins.length;t++)this.plugins[t].update(this);e!=M&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let e=t.value;if(e&&e.docViewUpdate)try{e.docViewUpdate(this)}catch(t){iD(this.state,t,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,M=this.scrollDOM,i=M.scrollTop*this.scaleY,{scrollAnchorPos:N,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(o<0)if(Es(M))N=-1,o=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(i);N=t.from,o=t.top}this.updateState=1;let n=this.viewState.measure(this);if(!n&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let s=[];4&n||([this.measureRequests,s]=[s,this.measureRequests]);let r=s.map((t=>{try{return t.read(this)}catch(t){return iD(this.state,t),rl}})),D=yD.create(this,this.state,[]),a=!1;D.flags|=n,e?e.flags|=n:e=D,this.updateState=2,D.empty||(this.updatePlugins(D),this.inputState.update(D),this.updateAttrs(),a=this.docView.update(D),a&&this.docViewUpdate());for(let t=0;t<s.length;t++)if(r[t]!=rl)try{let e=s[t];e.write&&e.write(r[t],this)}catch(t){iD(this.state,t)}if(a&&this.docView.updateSelection(!0),!D.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}{let t=(N<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(N).top)-o;if(t>1||t<-1){i+=t,M.scrollTop=i/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(_r))t(e)}get themeClasses(){return Ja+" "+(this.state.facet(Fa)?Xa:Ha)+" "+this.state.facet(_a)}updateAttrs(){let t=al(this,DD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ND)?"true":"false",class:"cm-content",style:`${Xs.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),al(this,aD,e);let M=this.observer.ignore((()=>{let M=sr(this.contentDOM,this.contentAttrs,e),i=sr(this.dom,this.editorAttrs,t);return M||i}));return this.editorAttrs=t,this.contentAttrs=e,M}showAnnouncements(t){let e=!0;for(let M of t)for(let t of M.effects)if(t.is(nl.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(TD);let t=this.state.facet(nl.cspNonce);es.mount(this.root,this.styleModules.concat(Ka).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key)return void(this.measureRequests[e]=t);this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(void 0===e||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find((e=>e.spec==t))||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,M){return bD(this,t,CD(this,t,e,M))}moveByGroup(t,e){return bD(this,t,CD(this,t,e,(e=>function(t,e,M){let i=t.state.charCategorizer(e),N=i(M);return t=>{let e=i(t);return N==Qn.Space&&(N=e),N==e}}(this,t.head,e))))}visualLineSide(t,e){let M=this.bidiSpans(t),i=this.textDirectionAt(t.from),N=M[e?M.length-1:0];return Vo.cursor(N.side(e,i)+t.from,N.forward(!e,i)?1:-1)}moveToLineBoundary(t,e,M=!0){return function(t,e,M,i){let N=UD(t,e.head),o=i&&N.type==ar.Text&&(t.lineWrapping||N.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>N.from?e.head-1:e.head):null;if(o){let e=t.dom.getBoundingClientRect(),i=t.textDirectionAt(N.from),n=t.posAtCoords({x:M==(i==hr.LTR)?e.right-1:e.left+1,y:(o.top+o.bottom)/2});if(null!=n)return Vo.cursor(n,M?-1:1)}return Vo.cursor(M?N.to:N.from,M?-1:1)}(this,t,e,M)}moveVertically(t,e,M){return bD(this,t,function(t,e,M,i){let N=e.head,o=M?1:-1;if(N==(M?t.state.doc.length:0))return Vo.cursor(N,e.assoc);let n,s=e.goalColumn,r=t.contentDOM.getBoundingClientRect(),D=t.coordsAtPos(N,e.assoc||-1),a=t.documentTop;if(D)null==s&&(s=D.left-r.left),n=o<0?D.top:D.bottom;else{let e=t.viewState.lineBlockAt(N);null==s&&(s=Math.min(r.right-r.left,t.defaultCharacterWidth*(N-e.from))),n=(o<0?e.top:e.bottom)+a}let l=r.left+s,u=null!=i?i:t.viewState.heightOracle.textHeight>>1;for(let e=0;;e+=10){let M=n+(u+e)*o,i=wD(t,{x:l,y:M},!1,o);if(M<r.top||M>r.bottom||(o<0?i<N:i>N)){let e=t.docView.coordsForChar(i),N=!e||M<e.top?-1:1;return Vo.cursor(i,N,void 0,s)}}}(this,t,e,M))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),wD(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let M=this.docView.coordsAt(t,e);if(!M||M.left==M.right)return M;let i=this.state.doc.lineAt(t),N=this.bidiSpans(i);return Os(M,N[Ur.find(N,t-i.from,-1,e)].dir==hr.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet($r)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>sl)return vr(t.length);let e,M=this.textDirectionAt(t.from);for(let i of this.bidiCache)if(i.from==t.from&&i.dir==M&&(i.fresh||Cr(i.isolates,e=cD(this,t))))return i.order;e||(e=cD(this,t));let i=function(t,e,M){if(!t)return[new Ur(0,0,e==xr?1:0)];if(e==Lr&&!M.length&&!mr.test(t))return vr(t.length);if(M.length)for(;t.length>fr.length;)fr[fr.length]=256;let i=[],N=e==Lr?0:1;return Yr(t,N,N,M,0,t.length,i),i}(t.text,M,e);return this.bidiCache.push(new Dl(t.from,t.to,M,e,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Xs.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{xs(this.contentDOM),this.docView.updateSelection()}))}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return eD.of(new tD("number"==typeof t?Vo.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,M=this.viewState.scrollAnchorAt(t);return eD.of(new tD(Vo.cursor(M.from),"start","start",M.top-t,e,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return sD.define((()=>({})),{eventHandlers:t})}static domEventObservers(t){return sD.define((()=>({})),{eventObservers:t})}static theme(t,e){let M=es.newName(),i=[_a.of(M),TD.of(qa(`.${M}`,t))];return e&&e.dark&&i.push(Fa.of(!0)),i}static baseTheme(t){return Mn.lowest(TD.of(qa("."+Ja,t,$a)))}static findFromDOM(t){var e;let M=t.querySelector(".cm-content"),i=M&&Cs.get(M)||Cs.get(t);return(null===(e=null==i?void 0:i.rootView)||void 0===e?void 0:e.view)||null}}nl.styleModule=TD,nl.inputHandler=Fr,nl.clipboardInputFilter=Hr,nl.clipboardOutputFilter=Xr,nl.scrollHandler=Kr,nl.focusChangeEffect=Jr,nl.perLineTextDirection=$r,nl.exceptionSink=Br,nl.updateListener=_r,nl.editable=ND,nl.mouseSelectionStyle=Gr,nl.dragMovesSelection=Rr,nl.clickAddsSelectionRange=Pr,nl.decorations=lD,nl.outerDecorations=uD,nl.atomicRanges=gD,nl.bidiIsolatedRanges=jD,nl.scrollMargins=zD,nl.darkTheme=Fa,nl.cspNonce=Ro.define({combine:t=>t.length?t[0]:""}),nl.contentAttributes=aD,nl.editorAttributes=DD,nl.lineWrapping=nl.contentAttributes.of({class:"cm-lineWrapping"}),nl.announce=yn.define();const sl=4096,rl={};class Dl{constructor(t,e,M,i,N,o){this.from=t,this.to=e,this.dir=M,this.isolates=i,this.fresh=N,this.order=o}static update(t,e){if(e.empty&&!t.some((t=>t.fresh)))return t;let M=[],i=t.length?t[t.length-1].dir:hr.LTR;for(let N=Math.max(0,t.length-10);N<t.length;N++){let o=t[N];o.dir!=i||e.touchesRange(o.from,o.to)||M.push(new Dl(e.mapPos(o.from,1),e.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return M}}function al(t,e,M){for(let i=t.state.facet(e),N=i.length-1;N>=0;N--){let e=i[N],o="function"==typeof e?e(t):e;o&&Nr(o,M)}return M}const ll=Xs.mac?"mac":Xs.windows?"win":Xs.linux?"linux":"key";function ul(t,e,M){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==M&&e.shiftKey&&(t="Shift-"+t),t}const gl=Mn.default(nl.domEventHandlers({keydown:(t,e)=>yl(zl(e.state),t,e,"editor")})),jl=Ro.define({enables:gl}),cl=new WeakMap;function zl(t){let e=t.facet(jl),M=cl.get(e);return M||cl.set(e,M=function(t,e=ll){let M=Object.create(null),i=Object.create(null),N=(t,e)=>{let M=i[t];if(null==M)i[t]=e;else if(M!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},o=(t,i,o,n,s)=>{var r,D;let a=M[t]||(M[t]=Object.create(null)),l=i.split(/ (?!$)/).map((t=>function(t,e){const M=t.split(/-(?!$)/);let i,N,o,n,s=M[M.length-1];"Space"==s&&(s=" ");for(let t=0;t<M.length-1;++t){const s=M[t];if(/^(cmd|meta|m)$/i.test(s))n=!0;else if(/^a(lt)?$/i.test(s))i=!0;else if(/^(c|ctrl|control)$/i.test(s))N=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);"mac"==e?n=!0:N=!0}}return i&&(s="Alt-"+s),N&&(s="Ctrl-"+s),n&&(s="Meta-"+s),o&&(s="Shift-"+s),s}(t,e)));for(let e=1;e<l.length;e++){let M=l.slice(0,e).join(" ");N(M,!0),a[M]||(a[M]={preventDefault:!0,stopPropagation:!1,run:[e=>{let i=Il={view:e,prefix:M,scope:t};return setTimeout((()=>{Il==i&&(Il=null)}),Tl),!0}]})}let u=l.join(" ");N(u,!1);let g=a[u]||(a[u]={preventDefault:!1,stopPropagation:!1,run:(null===(D=null===(r=a._any)||void 0===r?void 0:r.run)||void 0===D?void 0:D.slice())||[]});o&&g.run.push(o),n&&(g.preventDefault=!0),s&&(g.stopPropagation=!0)};for(let i of t){let t=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let e of t){let t=M[e]||(M[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:N}=i;for(let e in t)t[e].run.push((t=>N(t,Ol)))}let N=i[e]||i.key;if(N)for(let e of t)o(e,N,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(e,"Shift-"+N,i.shift,i.preventDefault,i.stopPropagation)}return M}(e.reduce(((t,e)=>t.concat(e)),[]))),M}let Il=null;const Tl=4e3;let Ol=null;function yl(t,e,M,i){Ol=e;let N=function(t){var e=!(ns&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ss&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?os:Ns)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),o=Qo(po(N,0))==N.length&&" "!=N,n="",s=!1,r=!1,D=!1;Il&&Il.view==M&&Il.scope==i&&(n=Il.prefix+" ",HD.indexOf(e.keyCode)<0&&(r=!0,Il=null));let a,l,u=new Set,g=t=>{if(t){for(let e of t.run)if(!u.has(e)&&(u.add(e),e(M)))return t.stopPropagation&&(D=!0),!0;t.preventDefault&&(t.stopPropagation&&(D=!0),r=!0)}return!1},j=t[i];return j&&(g(j[n+ul(N,e,!o)])?s=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Xs.windows&&e.ctrlKey&&e.altKey)&&(a=Ns[e.keyCode])&&a!=N?(g(j[n+ul(a,e,!0)])||e.shiftKey&&(l=os[e.keyCode])!=N&&l!=a&&g(j[n+ul(l,e,!1)]))&&(s=!0):o&&e.shiftKey&&g(j[n+ul(N,e,!0)])&&(s=!0),!s&&g(j._any)&&(s=!0)),r&&(s=!0),s&&D&&e.stopPropagation(),Ol=null,s}class dl{constructor(t,e,M,i,N){this.className=t,this.left=e,this.top=M,this.width=i,this.height=N}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,M){if(M.empty){let i=t.coordsAtPos(M.head,M.assoc||1);if(!i)return[];let N=Al(t);return[new dl(e,i.left-N.left,i.top-N.top,null,i.bottom-i.top)]}return function(t,e,M){if(M.to<=t.viewport.from||M.from>=t.viewport.to)return[];let i=Math.max(M.from,t.viewport.from),N=Math.min(M.to,t.viewport.to),o=t.textDirection==hr.LTR,n=t.contentDOM,s=n.getBoundingClientRect(),r=Al(t),D=n.querySelector(".cm-line"),a=D&&window.getComputedStyle(D),l=s.left+(a?parseInt(a.paddingLeft)+Math.min(0,parseInt(a.textIndent)):0),u=s.right-(a?parseInt(a.paddingRight):0),g=UD(t,i),j=UD(t,N),c=g.type==ar.Text?g:null,z=j.type==ar.Text?j:null;c&&(t.lineWrapping||g.widgetLineBreaks)&&(c=hl(t,i,1,c));z&&(t.lineWrapping||j.widgetLineBreaks)&&(z=hl(t,N,-1,z));if(c&&z&&c.from==z.from&&c.to==z.to)return T(O(M.from,M.to,c));{let e=c?O(M.from,null,c):y(g,!1),i=z?O(null,M.to,z):y(j,!0),N=[];return(c||g).to<(z||j).from-(c&&z?1:0)||g.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2<i.top?N.push(I(l,e.bottom,u,i.top)):e.bottom<i.top&&t.elementAtHeight((e.bottom+i.top)/2).type==ar.Text&&(e.bottom=i.top=(e.bottom+i.top)/2),T(e).concat(N).concat(T(i))}function I(t,M,i,N){return new dl(e,t-r.left,M-r.top,i-t,N-M)}function T({top:t,bottom:e,horizontal:M}){let i=[];for(let N=0;N<M.length;N+=2)i.push(I(M[N],t,M[N+1],e));return i}function O(e,M,i){let N=1e9,n=-1e9,s=[];function r(e,M,r,D,a){let g=t.coordsAtPos(e,e==i.to?-2:2),j=t.coordsAtPos(r,r==i.from?2:-2);g&&j&&(N=Math.min(g.top,j.top,N),n=Math.max(g.bottom,j.bottom,n),a==hr.LTR?s.push(o&&M?l:g.left,o&&D?u:j.right):s.push(!o&&D?l:j.left,!o&&M?u:g.right))}let D=null!=e?e:i.from,a=null!=M?M:i.to;for(let i of t.visibleRanges)if(i.to>D&&i.from<a)for(let N=Math.max(i.from,D),o=Math.min(i.to,a);;){let i=t.state.doc.lineAt(N);for(let n of t.bidiSpans(i)){let t=n.from+i.from,s=n.to+i.from;if(t>=o)break;s>N&&r(Math.max(t,N),null==e&&t<=D,Math.min(s,o),null==M&&s>=a,n.dir)}if(N=i.to+1,N>=o)break}return 0==s.length&&r(D,null==e,a,null==M,t.textDirection),{top:N,bottom:n,horizontal:s}}function y(t,e){let M=s.top+(e?t.top:t.bottom);return{top:M,bottom:M,horizontal:[]}}}(t,e,M)}}function Al(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==hr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function hl(t,e,M,i){let N=t.coordsAtPos(e,2*M);if(!N)return i;let o=t.dom.getBoundingClientRect(),n=(N.top+N.bottom)/2,s=t.posAtCoords({x:o.left+1,y:n}),r=t.posAtCoords({x:o.right-1,y:n});return null==s||null==r?i:{from:Math.max(i.from,Math.min(s,r)),to:Math.min(i.to,Math.max(s,r))}}class Ll{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(xl)!=t.state.facet(xl)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,M=t.facet(xl);for(;e<M.length&&M[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:e}=this.view;t==this.scaleX&&e==this.scaleY||(this.scaleX=t,this.scaleY=e,this.dom.style.transform=`scale(${1/t}, ${1/e})`)}draw(t){if(t.length!=this.drawn.length||t.some(((t,e)=>!function(t,e){return t.constructor==e.constructor&&t.eq(e)}(t,this.drawn[e])))){let e=this.dom.firstChild,M=0;for(let i of t)i.update&&e&&i.constructor&&this.drawn[M].constructor&&i.update(e,this.drawn[M])?(e=e.nextSibling,M++):this.dom.insertBefore(i.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const xl=Ro.define();function pl(t){return[sD.define((e=>new Ll(e,t))),xl.of(t)]}const Sl=!(Xs.ios&&Xs.webkit&&Xs.webkit_version<534),Ql=Ro.define({combine:t=>Un(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function El(t){return t.startState.facet(Ql)!=t.state.facet(Ql)}const kl=pl({above:!0,markers(t){let{state:e}=t,M=e.facet(Ql),i=[];for(let N of e.selection.ranges){let o=N==e.selection.main;if(N.empty?!o||Sl:M.drawRangeCursor){let e=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",M=N.empty?N:Vo.cursor(N.head,N.head>N.anchor?-1:1);for(let N of dl.forRange(t,e,M))i.push(N)}}return i},update(t,e){t.transactions.some((t=>t.selection))&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let M=El(t);return M&&wl(t.state,e),t.docChanged||t.selectionSet||M},mount(t,e){wl(e.state,t)},class:"cm-cursorLayer"});function wl(t,e){e.style.animationDuration=t.facet(Ql).cursorBlinkRate+"ms"}const ml=pl({above:!1,markers:t=>t.state.selection.ranges.map((e=>e.empty?[]:dl.forRange(t,"cm-selectionBackground",e))).reduce(((t,e)=>t.concat(e))),update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||El(t),class:"cm-selectionLayer"}),Ul={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Sl&&(Ul[".cm-line"].caretColor=Ul[".cm-content"].caretColor="transparent !important");const Cl=Mn.highest(nl.theme(Ul)),fl=yn.define({map:(t,e)=>null==t?null:e.mapPos(t)}),bl=Xo.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce(((t,e)=>e.is(fl)?e.value:t),t))}),Yl=sD.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let M=t.state.field(bl);null==M?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(bl)!=M||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(bl),M=null!=e&&t.coordsAtPos(e);if(!M)return null;let i=t.scrollDOM.getBoundingClientRect();return{left:M.left-i.left+t.scrollDOM.scrollLeft*t.scaleX,top:M.top-i.top+t.scrollDOM.scrollTop*t.scaleY,height:M.bottom-M.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:M}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/M+"px",this.cursor.style.height=t.height/M+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(bl)!=t&&this.view.dispatch({effects:fl.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function vl(t,e,M,i,N){e.lastIndex=0;for(let o,n=t.iterRange(M,i),s=M;!n.next().done;s+=n.value.length)if(!n.lineBreak)for(;o=e.exec(n.value);)N(s+o.index,o)}class Zl{constructor(t){const{regexp:e,decoration:M,decorate:i,boundary:N,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,i)this.addMatch=(t,e,M,N)=>i(N,M,M+t[0].length,t,e);else if("function"==typeof M)this.addMatch=(t,e,i,N)=>{let o=M(t,e,i);o&&N(i,i+t[0].length,o)};else{if(!M)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,i,N)=>N(i,i+t[0].length,M)}this.boundary=N,this.maxLength=o}createDeco(t){let e=new Zn,M=e.add.bind(e);for(let{from:e,to:i}of function(t,e){let M=t.visibleRanges;if(1==M.length&&M[0].from==t.viewport.from&&M[0].to==t.viewport.to)return M;let i=[];for(let{from:N,to:o}of M)N=Math.max(t.state.doc.lineAt(N).from,N-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),i.length&&i[i.length-1].to>=N?i[i.length-1].to=o:i.push({from:N,to:o});return i}(t,this.maxLength))vl(t.state.doc,this.regexp,e,i,((e,i)=>this.addMatch(i,t,e,M)));return e.finish()}updateDeco(t,e){let M=1e9,i=-1;return t.docChanged&&t.changes.iterChanges(((e,N,o,n)=>{n>=t.view.viewport.from&&o<=t.view.viewport.to&&(M=Math.min(o,M),i=Math.max(n,i))})),t.viewportMoved||i-M>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,e.map(t.changes),M,i):e}updateRange(t,e,M,i){for(let N of t.visibleRanges){let o=Math.max(N.from,M),n=Math.min(N.to,i);if(n>o){let M=t.state.doc.lineAt(o),i=M.to<n?t.state.doc.lineAt(n):M,s=Math.max(N.from,M.from),r=Math.min(N.to,i.to);if(this.boundary){for(;o>M.from;o--)if(this.boundary.test(M.text[o-1-M.from])){s=o;break}for(;n<i.to;n++)if(this.boundary.test(i.text[n-i.from])){r=n;break}}let D,a=[],l=(t,e,M)=>a.push(M.range(t,e));if(M==i)for(this.regexp.lastIndex=s-M.from;(D=this.regexp.exec(M.text))&&D.index<r-M.from;)this.addMatch(D,t,D.index+M.from,l);else vl(t.state.doc,this.regexp,s,r,((e,M)=>this.addMatch(M,t,e,l)));e=e.update({filterFrom:s,filterTo:r,filter:(t,e)=>t<s||e>r,add:a})}}return e}}const Vl=null!=/x/.unicode?"gu":"g",Wl=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",Vl),Pl={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Rl=null;const Gl=Ro.define({combine(t){let e=Un(t,{render:null,specialChars:Wl,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==Rl&&"undefined"!=typeof document&&document.body){let e=document.body.style;Rl=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return Rl||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,Vl)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Vl)),e}});let Bl=null;class _l extends Dr{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),M=t.state.phrase("Control character")+" "+(Pl[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,M,e);if(i)return i;let N=document.createElement("span");return N.textContent=e,N.title=M,N.setAttribute("aria-label",M),N.className="cm-specialChar",N}ignoreEvent(){return!1}}class Fl extends Dr{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const Jl=lr.line({class:"cm-activeLine"}),Hl=sD.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,M=[];for(let i of t.state.selection.ranges){let N=t.lineBlockAt(i.head);N.from>e&&(M.push(Jl.range(N.from)),e=N.from)}return lr.set(M)}},{decorations:t=>t.decorations});class Xl extends Dr{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(t):this.content.cloneNode(!0)),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?gs(t.firstChild):[];if(!e.length)return null;let M=window.getComputedStyle(t.parentNode),i=Os(e[0],"rtl"!=M.direction),N=parseInt(M.lineHeight);return i.bottom-i.top>1.5*N?{left:i.left,right:i.right,top:i.top,bottom:i.top+N}:i}ignoreEvent(){return!1}}const $l=2e3;function ql(t,e){let M=t.posAtCoords({x:e.clientX,y:e.clientY},!1),i=t.state.doc.lineAt(M),N=M-i.from,o=N>$l?-1:N==i.length?function(t,e){let M=t.coordsAtPos(t.viewport.from);return M?Math.round(Math.abs((M.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):Xn(i.text,t.state.tabSize,M-i.from);return{line:i.number,col:o,off:N}}function Kl(t,e){let M=ql(t,e),i=t.state.selection;return M?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(M.line).from),N=t.state.doc.lineAt(e);M={line:N.number,col:M.col,off:Math.min(M.off,N.length)},i=i.map(t.changes)}},get(e,N,o){let n=ql(t,e);if(!n)return i;let s=function(t,e,M){let i=Math.min(e.line,M.line),N=Math.max(e.line,M.line),o=[];if(e.off>$l||M.off>$l||e.col<0||M.col<0){let n=Math.min(e.off,M.off),s=Math.max(e.off,M.off);for(let e=i;e<=N;e++){let M=t.doc.line(e);M.length<=s&&o.push(Vo.range(M.from+n,M.to+s))}}else{let n=Math.min(e.col,M.col),s=Math.max(e.col,M.col);for(let e=i;e<=N;e++){let M=t.doc.line(e),i=$n(M.text,n,t.tabSize,!0);if(i<0)o.push(Vo.cursor(M.to));else{let e=$n(M.text,s,t.tabSize);o.push(Vo.range(M.from+i,M.from+e))}}}return o}(t.state,M,n);return s.length?o?Vo.create(s.concat(i.ranges)):Vo.create(s):i}}:null}const tu={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},eu={style:"cursor: crosshair"};const Mu="-10000px";class iu{constructor(t,e,M,i){this.facet=e,this.createTooltipView=M,this.removeTooltipView=i,this.input=t.state.facet(e),this.tooltips=this.input.filter((t=>t));let N=null;this.tooltipViews=this.tooltips.map((t=>N=M(t,N)))}update(t,e){var M;let i=t.state.facet(this.facet),N=i.filter((t=>t));if(i===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let o=[],n=e?[]:null;for(let M=0;M<N.length;M++){let i=N[M],s=-1;if(i){for(let t=0;t<this.tooltips.length;t++){let e=this.tooltips[t];e&&e.create==i.create&&(s=t)}if(s<0)o[M]=this.createTooltipView(i,M?o[M-1]:null),n&&(n[M]=!!i.above);else{let i=o[M]=this.tooltipViews[s];n&&(n[M]=e[s]),i.update&&i.update(t)}}}for(let t of this.tooltipViews)o.indexOf(t)<0&&(this.removeTooltipView(t),null===(M=t.destroy)||void 0===M||M.call(t));return e&&(n.forEach(((t,M)=>e[M]=t)),e.length=n.length),this.input=i,this.tooltips=N,this.tooltipViews=o,!0}}function Nu(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const ou=Ro.define({combine:t=>{var e,M,i;return{position:Xs.ios?"absolute":(null===(e=t.find((t=>t.position)))||void 0===e?void 0:e.position)||"fixed",parent:(null===(M=t.find((t=>t.parent)))||void 0===M?void 0:M.parent)||null,tooltipSpace:(null===(i=t.find((t=>t.tooltipSpace)))||void 0===i?void 0:i.tooltipSpace)||Nu}}}),nu=new WeakMap,su=sD.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(ou);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver((()=>this.measureSoon())):null,this.manager=new iu(t,lu,((t,e)=>this.createTooltip(t,e)),(t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()})),this.above=this.manager.tooltips.map((t=>!!t.above)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let M=e||t.geometryChanged,i=t.state.facet(ou);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;M=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);M=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);M&&this.maybeMeasure()}createTooltip(t,e){let M=t.create(this.view),i=e?e.dom:null;if(M.dom.classList.add("cm-tooltip"),t.arrow&&!M.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",M.dom.appendChild(t)}return M.dom.style.position=this.position,M.dom.style.top=Mu,M.dom.style.left="0px",this.container.insertBefore(M.dom,i),M.mount&&M.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(M.dom),M}destroy(){var t,e,M;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(M=this.intersectionObserver)||void 0===M||M.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,M=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(Xs.gecko)M=t.offsetParent!=this.container.ownerDocument.body;else if(t.style.top==Mu&&"0px"==t.style.left){let e=t.getBoundingClientRect();M=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(M||"absolute"==this.position)if(this.parent){let M=this.parent.getBoundingClientRect();M.width&&M.height&&(t=M.width/this.parent.offsetWidth,e=M.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),N=ID(this.view);return{visible:{left:i.left+N.left,top:i.top+N.top,right:i.right-N.right,bottom:i.bottom-N.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(((t,e)=>{let M=this.manager.tooltipViews[e];return M.getCoords?M.getCoords(t.pos):this.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((({dom:t})=>t.getBoundingClientRect())),space:this.view.state.facet(ou).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:M}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{visible:M,space:i,scaleX:N,scaleY:o}=t,n=[];for(let s=0;s<this.manager.tooltips.length;s++){let r=this.manager.tooltips[s],D=this.manager.tooltipViews[s],{dom:a}=D,l=t.pos[s],u=t.size[s];if(!l||!1!==r.clip&&(l.bottom<=Math.max(M.top,i.top)||l.top>=Math.min(M.bottom,i.bottom)||l.right<Math.max(M.left,i.left)-.1||l.left>Math.min(M.right,i.right)+.1)){a.style.top=Mu;continue}let g=r.arrow?D.dom.querySelector(".cm-tooltip-arrow"):null,j=g?7:0,c=u.right-u.left,z=null!==(e=nu.get(D))&&void 0!==e?e:u.bottom-u.top,I=D.offset||au,T=this.view.textDirection==hr.LTR,O=u.width>i.right-i.left?T?i.left:i.right-u.width:T?Math.max(i.left,Math.min(l.left-(g?14:0)+I.x,i.right-c)):Math.min(Math.max(i.left,l.left-c+(g?14:0)-I.x),i.right-c),y=this.above[s];!r.strictSide&&(y?l.top-z-j-I.y<i.top:l.bottom+z+j+I.y>i.bottom)&&y==i.bottom-l.bottom>l.top-i.top&&(y=this.above[s]=!y);let d=(y?l.top-i.top:i.bottom-l.bottom)-j;if(d<z&&!1!==D.resize){if(d<this.view.defaultLineHeight){a.style.top=Mu;continue}nu.set(D,z),a.style.height=(z=d)/o+"px"}else a.style.height&&(a.style.height="");let A=y?l.top-z-j-I.y:l.bottom+j+I.y,h=O+c;if(!0!==D.overlap)for(let t of n)t.left<h&&t.right>O&&t.top<A+z&&t.bottom>A&&(A=y?t.top-z-2-j:t.bottom+j+2);if("absolute"==this.position?(a.style.top=(A-t.parent.top)/o+"px",ru(a,(O-t.parent.left)/N)):(a.style.top=A/o+"px",ru(a,O/N)),g){let t=l.left+(T?I.x:-I.x)-(O+14-7);g.style.left=t/N+"px"}!0!==D.overlap&&n.push({left:O,top:A,right:h,bottom:A+z}),a.classList.toggle("cm-tooltip-above",y),a.classList.toggle("cm-tooltip-below",!y),D.positioned&&D.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Mu}},{eventObservers:{scroll(){this.maybeMeasure()}}});function ru(t,e){let M=parseInt(t.style.left,10);(isNaN(M)||Math.abs(e-M)>1)&&(t.style.left=e+"px")}const Du=nl.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),au={x:0,y:0},lu=Ro.define({enables:[su,Du]}),uu=Ro.define({combine:t=>t.reduce(((t,e)=>t.concat(e)),[])});class gu{static create(t){return new gu(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new iu(t,uu,((t,e)=>this.createHostedView(t,e)),(t=>t.dom.remove()))}createHostedView(t,e){let M=t.create(this.view);return M.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(M.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&M.mount&&M.mount(this.view),M}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(t){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)null===(t=e.destroy)||void 0===t||t.call(e)}passProp(t){let e;for(let M of this.manager.tooltipViews){let i=M[t];if(void 0!==i)if(void 0===e)e=i;else if(e!==i)return}return e}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const ju=lu.compute([uu],(t=>{let e=t.facet(uu);return 0===e.length?null:{pos:Math.min(...e.map((t=>t.pos))),end:Math.max(...e.map((t=>{var e;return null!==(e=t.end)&&void 0!==e?e:t.pos}))),create:gu.create,above:e[0].above,arrow:e.some((t=>t.arrow))}}));class cu{constructor(t,e,M,i,N){this.view=t,this.source=e,this.field=M,this.setHover=i,this.hoverTime=N,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:e}=this,M=t.docView.nearest(e.target);if(!M)return;let i,N=1;if(M instanceof Ks)i=M.posAtStart;else{if(i=t.posAtCoords(e),null==i)return;let M=t.coordsAtPos(i);if(!M||e.y<M.top||e.y>M.bottom||e.x<M.left-t.defaultCharacterWidth||e.x>M.right+t.defaultCharacterWidth)return;let o=t.bidiSpans(t.state.doc.lineAt(i)).find((t=>t.from<=i&&t.to>=i)),n=o&&o.dir==hr.RTL?-1:1;N=e.x<M.left?-n:n}let o=this.source(t,i,N);if(null==o?void 0:o.then){let e=this.pending={pos:i};o.then((M=>{this.pending==e&&(this.pending=null,!M||Array.isArray(M)&&!M.length||t.dispatch({effects:this.setHover.of(Array.isArray(M)?M:[M])}))}),(e=>iD(t.state,e,"hover tooltip")))}else!o||Array.isArray(o)&&!o.length||t.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let t=this.view.plugin(su),e=t?t.manager.tooltips.findIndex((t=>t.create==gu.create)):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,M;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:N}=this;if(i.length&&N&&!function(t,e){let M,{left:i,right:N,top:o,bottom:n}=t.getBoundingClientRect();if(M=t.querySelector(".cm-tooltip-arrow")){let t=M.getBoundingClientRect();o=Math.min(t.top,o),n=Math.max(t.bottom,n)}return e.clientX>=i-zu&&e.clientX<=N+zu&&e.clientY>=o-zu&&e.clientY<=n+zu}(N.dom,t)||this.pending){let{pos:N}=i[0]||this.pending,o=null!==(M=null===(e=i[0])||void 0===e?void 0:e.end)&&void 0!==M?M:N;(N==o?this.view.posAtCoords(this.lastMove)==N:function(t,e,M,i,N){let o=t.scrollDOM.getBoundingClientRect(),n=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.right<i||o.top>N||Math.min(o.bottom,n)<N)return!1;let s=t.posAtCoords({x:i,y:N},!1);return s>=e&&s<=M}(this.view,N,o,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:e}=this;if(e.length){let{tooltip:e}=this;e&&e.dom.contains(t.relatedTarget)?this.watchTooltipLeave(e.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let e=M=>{t.removeEventListener("mouseleave",e),this.active.length&&!this.view.dom.contains(M.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const zu=4;function Iu(t,e={}){let M=yn.define(),i=Xo.define({create:()=>[],update(t,i){if(t.length&&(e.hideOnChange&&(i.docChanged||i.selection)?t=[]:e.hideOn&&(t=t.filter((t=>!e.hideOn(i,t)))),i.docChanged)){let e=[];for(let M of t){let t=i.changes.mapPos(M.pos,-1,ko.TrackDel);if(null!=t){let N=Object.assign(Object.create(null),M);N.pos=t,null!=N.end&&(N.end=i.changes.mapPos(N.end)),e.push(N)}}t=e}for(let e of i.effects)e.is(M)&&(t=e.value),e.is(Ou)&&(t=[]);return t},provide:t=>uu.from(t)});return{active:i,extension:[i,sD.define((N=>new cu(N,t,i,M,e.hoverTime||300))),ju]}}function Tu(t,e){let M=t.plugin(su);if(!M)return null;let i=M.manager.tooltips.indexOf(e);return i<0?null:M.manager.tooltipViews[i]}const Ou=yn.define(),yu=Ro.define({combine(t){let e,M;for(let i of t)e=e||i.topContainer,M=M||i.bottomContainer;return{topContainer:e,bottomContainer:M}}});function du(t,e){let M=t.plugin(Au),i=M?M.specs.indexOf(e):-1;return i>-1?M.panels[i]:null}const Au=sD.fromClass(class{constructor(t){this.input=t.state.facet(xu),this.specs=this.input.filter((t=>t)),this.panels=this.specs.map((e=>e(t)));let e=t.state.facet(yu);this.top=new hu(t,!0,e.topContainer),this.bottom=new hu(t,!1,e.bottomContainer),this.top.sync(this.panels.filter((t=>t.top))),this.bottom.sync(this.panels.filter((t=>!t.top)));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(yu);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new hu(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new hu(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let M=t.state.facet(xu);if(M!=this.input){let e=M.filter((t=>t)),i=[],N=[],o=[],n=[];for(let M of e){let e,s=this.specs.indexOf(M);s<0?(e=M(t.view),n.push(e)):(e=this.panels[s],e.update&&e.update(t)),i.push(e),(e.top?N:o).push(e)}this.specs=e,this.panels=i,this.top.sync(N),this.bottom.sync(o);for(let t of n)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>nl.scrollMargins.of((e=>{let M=e.plugin(t);return M&&{top:M.top.scrollMargin(),bottom:M.bottom.scrollMargin()}}))});class hu{constructor(t,e,M){this.view=t,this.top=e,this.container=M,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Lu(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Lu(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Lu(t){let e=t.nextSibling;return t.remove(),e}const xu=Ro.define({enables:Au});class pu extends Cn{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}pu.prototype.elementClass="",pu.prototype.toDOM=void 0,pu.prototype.mapMode=ko.TrackBefore,pu.prototype.startSide=pu.prototype.endSide=-1,pu.prototype.point=!0;const Su=Ro.define(),Qu=Ro.define(),Eu={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>vn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ku=Ro.define();function wu(t){return[Uu(),ku.of(Object.assign(Object.assign({},Eu),t))]}const mu=Ro.define({combine:t=>t.some((t=>t))});function Uu(t){let e=[Cu];return t&&!1===t.fixed&&e.push(mu.of(!0)),e}const Cu=sD.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(ku).map((e=>new vu(t,e)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!t.state.facet(mu),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,M=t.view.viewport,i=Math.min(e.to,M.to)-Math.max(e.from,M.from);this.syncGutters(i<.8*(M.to-M.from))}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(mu)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let M=vn.iter(this.view.state.facet(Su),this.view.viewport.from),i=[],N=this.gutters.map((t=>new Yu(t,this.view.viewport,-this.view.documentPadding.top)));for(let t of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(t.type)){let e=!0;for(let o of t.type)if(o.type==ar.Text&&e){bu(M,i,o.from);for(let t of N)t.line(this.view,o,i);e=!1}else if(o.widget)for(let t of N)t.widget(this.view,o)}else if(t.type==ar.Text){bu(M,i,t.from);for(let e of N)e.line(this.view,t,i)}else if(t.widget)for(let e of N)e.widget(this.view,t);for(let t of N)t.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(ku),M=t.state.facet(ku),i=t.docChanged||t.heightChanged||t.viewportChanged||!vn.eq(t.startState.facet(Su),t.state.facet(Su),t.view.viewport.from,t.view.viewport.to);if(e==M)for(let e of this.gutters)e.update(t)&&(i=!0);else{i=!0;let N=[];for(let i of M){let M=e.indexOf(i);M<0?N.push(new vu(this.view,i)):(this.gutters[M].update(t),N.push(this.gutters[M]))}for(let t of this.gutters)t.dom.remove(),N.indexOf(t)<0&&t.destroy();for(let t of N)this.dom.appendChild(t.dom);this.gutters=N}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>nl.scrollMargins.of((e=>{let M=e.plugin(t);return M&&0!=M.gutters.length&&M.fixed?e.textDirection==hr.LTR?{left:M.dom.offsetWidth*e.scaleX}:{right:M.dom.offsetWidth*e.scaleX}:null}))});function fu(t){return Array.isArray(t)?t:[t]}function bu(t,e,M){for(;t.value&&t.from<=M;)t.from==M&&e.push(t.value),t.next()}class Yu{constructor(t,e,M){this.gutter=t,this.height=M,this.i=0,this.cursor=vn.iter(t.markers,e.from)}addElement(t,e,M){let{gutter:i}=this,N=(e.top-this.height)/t.scaleY,o=e.height/t.scaleY;if(this.i==i.elements.length){let e=new Zu(t,o,N,M);i.elements.push(e),i.dom.appendChild(e.dom)}else i.elements[this.i].update(t,o,N,M);this.height=e.bottom,this.i++}line(t,e,M){let i=[];bu(this.cursor,i,e.from),M.length&&(i=i.concat(M));let N=this.gutter.config.lineMarker(t,e,i);N&&i.unshift(N);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(t,e,i)}widget(t,e){let M=this.gutter.config.widgetMarker(t,e.widget,e),i=M?[M]:null;for(let M of t.state.facet(Qu)){let N=M(t,e.widget,e);N&&(i||(i=[])).push(N)}i&&this.addElement(t,e,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class vu{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let M in e.domEventHandlers)this.dom.addEventListener(M,(i=>{let N,o=i.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let t=o.getBoundingClientRect();N=(t.top+t.bottom)/2}else N=i.clientY;let n=t.lineBlockAtHeight(N-t.documentTop);e.domEventHandlers[M](t,n,i)&&i.preventDefault()}));this.markers=fu(e.markers(t)),e.initialSpacer&&(this.spacer=new Zu(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=fu(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let M=t.view.viewport;return!vn.eq(this.markers,e,M.from,M.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class Zu{constructor(t,e,M,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,M,i)}update(t,e,M,i){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=M&&(this.dom.style.marginTop=(this.above=M)?M+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let M=0;M<t.length;M++)if(!t[M].compare(e[M]))return!1;return!0}(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,e){let M="cm-gutterElement",i=this.dom.firstChild;for(let N=0,o=0;;){let n=o,s=N<e.length?e[N++]:null,r=!1;if(s){let t=s.elementClass;t&&(M+=" "+t);for(let t=o;t<this.markers.length;t++)if(this.markers[t].compare(s)){n=t,r=!0;break}}else n=this.markers.length;for(;o<n;){let t=this.markers[o++];if(t.toDOM){t.destroy(i);let e=i.nextSibling;i.remove(),i=e}}if(!s)break;s.toDOM&&(r?i=i.nextSibling:this.dom.insertBefore(s.toDOM(t),i)),r&&o++}this.dom.className=M,this.markers=e}destroy(){this.setMarkers(null,[])}}const Vu=Ro.define(),Wu=Ro.define(),Pu=Ro.define({combine:t=>Un(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let M=Object.assign({},t);for(let t in e){let i=M[t],N=e[t];M[t]=i?(t,e,M)=>i(t,e,M)||N(t,e,M):N}return M}})});class Ru extends pu{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Gu(t,e){return t.state.facet(Pu).formatNumber(e,t.state)}const Bu=ku.compute([Pu],(t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(Vu),lineMarker:(t,e,M)=>M.some((t=>t.toDOM))?null:new Ru(Gu(t,t.state.doc.lineAt(e.from).number)),widgetMarker:(t,e,M)=>{for(let i of t.state.facet(Wu)){let N=i(t,e,M);if(N)return N}return null},lineMarkerChange:t=>t.startState.facet(Pu)!=t.state.facet(Pu),initialSpacer:t=>new Ru(Gu(t,_u(t.state.doc.lines))),updateSpacer(t,e){let M=Gu(e.view,_u(e.view.state.doc.lines));return M==t.number?t:new Ru(M)},domEventHandlers:t.facet(Pu).domEventHandlers})));function _u(t){let e=9;for(;e<t;)e=10*e+9;return e}const Fu=new class extends pu{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Ju=Su.compute(["selection"],(t=>{let e=[],M=-1;for(let i of t.selection.ranges){let N=t.doc.lineAt(i.head).from;N>M&&(M=N,e.push(Fu.range(N)))}return vn.of(e)}));const Hu=1024;let Xu=0,$u=class{constructor(t,e){this.from=t,this.to=e}};class qu{constructor(t={}){this.id=Xu++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=eg.match(t)),e=>{let M=t(e);return void 0===M?null:[this,M]}}}qu.closedBy=new qu({deserialize:t=>t.split(" ")}),qu.openedBy=new qu({deserialize:t=>t.split(" ")}),qu.group=new qu({deserialize:t=>t.split(" ")}),qu.isolate=new qu({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),qu.contextHash=new qu({perNode:!0}),qu.lookAhead=new qu({perNode:!0}),qu.mounted=new qu({perNode:!0});class Ku{constructor(t,e,M){this.tree=t,this.overlay=e,this.parser=M}static get(t){return t&&t.props&&t.props[qu.mounted.id]}}const tg=Object.create(null);class eg{constructor(t,e,M,i=0){this.name=t,this.props=e,this.id=M,this.flags=i}static define(t){let e=t.props&&t.props.length?Object.create(null):tg,M=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),i=new eg(t.name||"",e,t.id,M);if(t.props)for(let M of t.props)if(Array.isArray(M)||(M=M(i)),M){if(M[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[M[0].id]=M[1]}return i}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(qu.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let M in t)for(let i of M.split(" "))e[i]=t[M];return t=>{for(let M=t.prop(qu.group),i=-1;i<(M?M.length:0);i++){let N=e[i<0?t.name:M[i]];if(N)return N}}}}eg.none=new eg("",Object.create(null),0,8);class Mg{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let M of this.types){let i=null;for(let e of t){let t=e(M);t&&(i||(i=Object.assign({},M.props)),i[t[0].id]=t[1])}e.push(i?new eg(M.name,i,M.id,M.flags):M)}return new Mg(e)}}const ig=new WeakMap,Ng=new WeakMap;var og;!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"}(og||(og={}));class ng{constructor(t,e,M,i,N){if(this.type=t,this.children=e,this.positions=M,this.length=i,this.props=null,N&&N.length){this.props=Object.create(null);for(let[t,e]of N)this.props["number"==typeof t?t:t.id]=e}}toString(){let t=Ku.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let t of this.children){let M=t.toString();M&&(e&&(e+=","),e+=M)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Og(this.topNode,t)}cursorAt(t,e=0,M=0){let i=ig.get(this)||this.topNode,N=new Og(i);return N.moveTo(t,e),ig.set(this,N._tree),N}get topNode(){return new ug(this,0,0,null)}resolve(t,e=0){let M=ag(ig.get(this)||this.topNode,t,e,!1);return ig.set(this,M),M}resolveInner(t,e=0){let M=ag(Ng.get(this)||this.topNode,t,e,!0);return Ng.set(this,M),M}resolveStack(t,e=0){return function(t,e,M){let i=t.resolveInner(e,M),N=null;for(let t=i instanceof ug?i:i.context.parent;t;t=t.parent)if(t.index<0){let o=t.parent;(N||(N=[i])).push(o.resolve(e,M)),t=o}else{let o=Ku.get(t.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let n=new ug(o.tree,o.overlay[0].from+t.from,-1,t);(N||(N=[i])).push(ag(n,e,M,!1))}}return N?Ig(N):i}(this,t,e)}iterate(t){let{enter:e,leave:M,from:i=0,to:N=this.length}=t,o=t.mode||0,n=(o&og.IncludeAnonymous)>0;for(let t=this.cursor(o|og.IncludeAnonymous);;){let o=!1;if(t.from<=N&&t.to>=i&&(!n&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;o=!0}for(;o&&M&&(n||!t.type.isAnonymous)&&M(t),!t.nextSibling();){if(!t.parent())return;o=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:hg(eg.none,this.children,this.positions,0,this.children.length,0,this.length,((t,e,M)=>new ng(this.type,t,e,M,this.propValues)),t.makeTree||((t,e,M)=>new ng(eg.none,t,e,M)))}static build(t){return function(t){var e;let{buffer:M,nodeSet:i,maxBufferLength:N=Hu,reused:o=[],minRepeatType:n=i.types.length}=t,s=Array.isArray(M)?new sg(M,M.length):M,r=i.types,D=0,a=0;function l(t,e,M,T,O,y){let{id:d,start:A,end:h,size:L}=s,x=a,p=D;for(;L<0;){if(s.next(),-1==L){let e=o[d];return M.push(e),void T.push(A-t)}if(-3==L)return void(D=d);if(-4==L)return void(a=d);throw new RangeError(`Unrecognized record size: ${L}`)}let S,Q,E=r[d],k=A-t;if(h-A<=N&&(Q=z(s.pos-e,O))){let e=new Uint16Array(Q.size-Q.skip),M=s.pos-Q.size,N=e.length;for(;s.pos>M;)N=I(Q.start,e,N);S=new rg(e,h-Q.start,i),k=Q.start-t}else{let t=s.pos-L;s.next();let e=[],M=[],i=d>=n?d:-1,o=0,r=h;for(;s.pos>t;)i>=0&&s.id==i&&s.size>=0?(s.end<=r-N&&(j(e,M,A,o,s.end,r,i,x,p),o=e.length,r=s.end),s.next()):y>2500?u(A,t,e,M):l(A,t,e,M,i,y+1);if(i>=0&&o>0&&o<e.length&&j(e,M,A,o,A,r,i,x,p),e.reverse(),M.reverse(),i>-1&&o>0){let t=g(E,p);S=hg(E,e,M,0,e.length,0,h-A,t,t)}else S=c(E,e,M,h-A,x-h,p)}M.push(S),T.push(k)}function u(t,e,M,o){let n=[],r=0,D=-1;for(;s.pos>e;){let{id:t,start:e,end:M,size:i}=s;if(i>4)s.next();else{if(D>-1&&e<D)break;D<0&&(D=M-N),n.push(t,e,M),r++,s.next()}}if(r){let e=new Uint16Array(4*r),N=n[n.length-2];for(let t=n.length-3,M=0;t>=0;t-=3)e[M++]=n[t],e[M++]=n[t+1]-N,e[M++]=n[t+2]-N,e[M++]=M;M.push(new rg(e,n[2]-N,i)),o.push(N-t)}}function g(t,e){return(M,i,N)=>{let o,n,s=0,r=M.length-1;if(r>=0&&(o=M[r])instanceof ng){if(!r&&o.type==t&&o.length==N)return o;(n=o.prop(qu.lookAhead))&&(s=i[r]+o.length+n)}return c(t,M,i,N,s,e)}}function j(t,e,M,N,o,n,s,r,D){let a=[],l=[];for(;t.length>N;)a.push(t.pop()),l.push(e.pop()+M-o);t.push(c(i.types[s],a,l,n-o,r-n,D)),e.push(o-M)}function c(t,e,M,i,N,o,n){if(o){let t=[qu.contextHash,o];n=n?[t].concat(n):[t]}if(N>25){let t=[qu.lookAhead,N];n=n?[t].concat(n):[t]}return new ng(t,e,M,i,n)}function z(t,e){let M=s.fork(),i=0,o=0,r=0,D=M.end-N,a={size:0,start:0,skip:0};t:for(let N=M.pos-t;M.pos>N;){let t=M.size;if(M.id==e&&t>=0){a.size=i,a.start=o,a.skip=r,r+=4,i+=4,M.next();continue}let s=M.pos-t;if(t<0||s<N||M.start<D)break;let l=M.id>=n?4:0,u=M.start;for(M.next();M.pos>s;){if(M.size<0){if(-3!=M.size)break t;l+=4}else M.id>=n&&(l+=4);M.next()}o=u,i+=t,r+=l}return(e<0||i==t)&&(a.size=i,a.start=o,a.skip=r),a.size>4?a:void 0}function I(t,e,M){let{id:i,start:N,end:o,size:r}=s;if(s.next(),r>=0&&i<n){let n=M;if(r>4){let i=s.pos-(r-4);for(;s.pos>i;)M=I(t,e,M)}e[--M]=n,e[--M]=o-t,e[--M]=N-t,e[--M]=i}else-3==r?D=i:-4==r&&(a=i);return M}let T=[],O=[];for(;s.pos>0;)l(t.start||0,t.bufferStart||0,T,O,-1,0);let y=null!==(e=t.length)&&void 0!==e?e:T.length?O[0]+T[0].length:0;return new ng(r[t.topID],T.reverse(),O.reverse(),y)}(t)}}ng.empty=new ng(eg.none,[],[],0);class sg{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new sg(this.buffer,this.index)}}class rg{constructor(t,e,M){this.buffer=t,this.length=e,this.set=M}get type(){return eg.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],M=this.buffer[t+3],i=this.set.types[e],N=i.name;if(/\W/.test(N)&&!i.isError&&(N=JSON.stringify(N)),M==(t+=4))return N;let o=[];for(;t<M;)o.push(this.childString(t)),t=this.buffer[t+3];return N+"("+o.join(",")+")"}findChild(t,e,M,i,N){let{buffer:o}=this,n=-1;for(let s=t;s!=e&&!(Dg(N,i,o[s+1],o[s+2])&&(n=s,M>0));s=o[s+3]);return n}slice(t,e,M){let i=this.buffer,N=new Uint16Array(e-t),o=0;for(let n=t,s=0;n<e;){N[s++]=i[n++],N[s++]=i[n++]-M;let e=N[s++]=i[n++]-M;N[s++]=i[n++]-t,o=Math.max(o,e)}return new rg(N,o,this.set)}}function Dg(t,e,M,i){switch(t){case-2:return M<e;case-1:return i>=e&&M<e;case 0:return M<e&&i>e;case 1:return M<=e&&i>e;case 2:return i>e;case 4:return!0}}function ag(t,e,M,i){for(var N;t.from==t.to||(M<1?t.from>=e:t.from>e)||(M>-1?t.to<=e:t.to<e);){let e=!i&&t instanceof ug&&t.index<0?null:t.parent;if(!e)return t;t=e}let o=i?0:og.IgnoreOverlays;if(i)for(let i=t,n=i.parent;n;i=n,n=i.parent)i instanceof ug&&i.index<0&&(null===(N=n.enter(e,M,o))||void 0===N?void 0:N.from)!=i.from&&(t=n);for(;;){let i=t.enter(e,M,o);if(!i)return t;t=i}}class lg{cursor(t=0){return new Og(this,t)}getChild(t,e=null,M=null){let i=gg(this,t,e,M);return i.length?i[0]:null}getChildren(t,e=null,M=null){return gg(this,t,e,M)}resolve(t,e=0){return ag(this,t,e,!1)}resolveInner(t,e=0){return ag(this,t,e,!0)}matchContext(t){return jg(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),M=this;for(;e;){let t=e.lastChild;if(!t||t.to!=e.to)break;t.type.isError&&t.from==t.to?(M=e,e=t.prevSibling):e=t}return M}get node(){return this}get next(){return this.parent}}class ug extends lg{constructor(t,e,M,i){super(),this._tree=t,this.from=e,this.index=M,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,M,i,N=0){for(let o=this;;){for(let{children:n,positions:s}=o._tree,r=e>0?n.length:-1;t!=r;t+=e){let r=n[t],D=s[t]+o.from;if(Dg(i,M,D,D+r.length))if(r instanceof rg){if(N&og.ExcludeBuffers)continue;let n=r.findChild(0,r.buffer.length,e,M-D,i);if(n>-1)return new zg(new cg(o,r,t,D),null,n)}else if(N&og.IncludeAnonymous||!r.type.isAnonymous||yg(r)){let n;if(!(N&og.IgnoreMounts)&&(n=Ku.get(r))&&!n.overlay)return new ug(n.tree,D,t,o);let s=new ug(r,D,t,o);return N&og.IncludeAnonymous||!s.type.isAnonymous?s:s.nextChild(e<0?r.children.length-1:0,e,M,i)}}if(N&og.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,M=0){let i;if(!(M&og.IgnoreOverlays)&&(i=Ku.get(this._tree))&&i.overlay){let M=t-this.from;for(let{from:t,to:N}of i.overlay)if((e>0?t<=M:t<M)&&(e<0?N>=M:N>M))return new ug(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,M)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function gg(t,e,M,i){let N=t.cursor(),o=[];if(!N.firstChild())return o;if(null!=M)for(let t=!1;!t;)if(t=N.type.is(M),!N.nextSibling())return o;for(;;){if(null!=i&&N.type.is(i))return o;if(N.type.is(e)&&o.push(N.node),!N.nextSibling())return null==i?o:[]}}function jg(t,e,M=e.length-1){for(let i=t;M>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[M]&&e[M]!=i.name)return!1;M--}}return!0}class cg{constructor(t,e,M,i){this.parent=t,this.buffer=e,this.index=M,this.start=i}}class zg extends lg{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,M){super(),this.context=t,this._parent=e,this.index=M,this.type=t.buffer.set.types[t.buffer.buffer[M]]}child(t,e,M){let{buffer:i}=this.context,N=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.context.start,M);return N<0?null:new zg(this.context,this,N)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,M=0){if(M&og.ExcludeBuffers)return null;let{buffer:i}=this.context,N=i.findChild(this.index+4,i.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return N<0?null:new zg(this.context,this,N)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new zg(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new zg(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:M}=this.context,i=this.index+4,N=M.buffer[this.index+3];if(N>i){let o=M.buffer[this.index+1];t.push(M.slice(i,N,o)),e.push(0)}return new ng(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ig(t){if(!t.length)return null;let e=0,M=t[0];for(let i=1;i<t.length;i++){let N=t[i];(N.from>M.from||N.to<M.to)&&(M=N,e=i)}let i=M instanceof ug&&M.index<0?null:M.parent,N=t.slice();return i?N[e]=i:N.splice(e,1),new Tg(N,M)}class Tg{constructor(t,e){this.heads=t,this.node=e}get next(){return Ig(this.heads)}}class Og{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ug)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let e=t._parent;e;e=e._parent)this.stack.unshift(e.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}yieldBuf(t,e){this.index=t;let{start:M,buffer:i}=this.buffer;return this.type=e||i.set.types[i.buffer[t]],this.from=M+i.buffer[t+1],this.to=M+i.buffer[t+2],!0}yield(t){return!!t&&(t instanceof ug?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,M){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,M,this.mode));let{buffer:i}=this.buffer,N=i.findChild(this.index+4,i.buffer[this.index+3],t,e-this.buffer.start,M);return!(N<0)&&(this.stack.push(this.index),this.yieldBuf(N))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,M=this.mode){return this.buffer?!(M&og.ExcludeBuffers)&&this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,M))}parent(){if(!this.buffer)return this.yieldNode(this.mode&og.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&og.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));let{buffer:e}=this.buffer,M=this.stack.length-1;if(t<0){let t=M<0?0:this.stack[M]+4;if(this.index!=t)return this.yieldBuf(e.findChild(t,this.index,-1,0,4))}else{let t=e.buffer[this.index+3];if(t<(M<0?e.buffer.length:e.buffer[this.stack[M]+3]))return this.yieldBuf(t)}return M<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,M,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let t=0;t<this.index;t++)if(i.buffer.buffer[t+3]<this.index)return!1;({index:e,parent:M}=i)}else({index:e,_parent:M}=this._tree);for(;M;({index:e,_parent:M}=M))if(e>-1)for(let i=e+t,N=t<0?-1:M._tree.children.length;i!=N;i+=t){let t=M._tree.children[i];if(this.mode&og.IncludeAnonymous||t instanceof rg||!t.type.isAnonymous||yg(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,M=0;if(t&&t.context==this.buffer)t:for(let i=this.index,N=this.stack.length;N>=0;){for(let o=t;o;o=o._parent)if(o.index==i){if(i==this.index)return o;e=o,M=N+1;break t}i=this.stack[--N]}for(let t=M;t<this.stack.length;t++)e=new zg(this.buffer,e,this.stack[t]);return this.bufferNode=new zg(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let M=0;;){let i=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){M++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&e&&e(this),i=this.type.isAnonymous,!M)return;if(this.nextSibling())break;this.parent(),M--,i=!0}}}matchContext(t){if(!this.buffer)return jg(this.node.parent,t);let{buffer:e}=this.buffer,{types:M}=e.set;for(let i=t.length-1,N=this.stack.length-1;i>=0;N--){if(N<0)return jg(this._tree,t,i);let o=M[e.buffer[this.stack[N]]];if(!o.isAnonymous){if(t[i]&&t[i]!=o.name)return!1;i--}}return!0}}function yg(t){return t.children.some((t=>t instanceof rg||!t.type.isAnonymous||yg(t)))}const dg=new WeakMap;function Ag(t,e){if(!t.isAnonymous||e instanceof rg||e.type!=t)return 1;let M=dg.get(e);if(null==M){M=1;for(let i of e.children){if(i.type!=t||!(i instanceof ng)){M=1;break}M+=Ag(t,i)}dg.set(e,M)}return M}function hg(t,e,M,i,N,o,n,s,r){let D=0;for(let M=i;M<N;M++)D+=Ag(t,e[M]);let a=Math.ceil(1.5*D/8),l=[],u=[];return function e(M,i,N,n,s){for(let D=N;D<n;){let N=D,g=i[D],j=Ag(t,M[D]);for(D++;D<n;D++){let e=Ag(t,M[D]);if(j+e>=a)break;j+=e}if(D==N+1){if(j>a){let t=M[N];e(t.children,t.positions,0,t.children.length,i[N]+s);continue}l.push(M[N])}else{let e=i[D-1]+M[D-1].length-g;l.push(hg(t,M,i,N,D,g,e,null,r))}u.push(g+s-o)}}(e,M,i,N,0),(s||r)(l,u,n)}class Lg{constructor(){this.map=new WeakMap}setBuffer(t,e,M){let i=this.map.get(t);i||this.map.set(t,i=new Map),i.set(e,M)}getBuffer(t,e){let M=this.map.get(t);return M&&M.get(e)}set(t,e){t instanceof zg?this.setBuffer(t.context.buffer,t.index,e):t instanceof ug&&this.map.set(t.tree,e)}get(t){return t instanceof zg?this.getBuffer(t.context.buffer,t.index):t instanceof ug?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class xg{constructor(t,e,M,i,N=!1,o=!1){this.from=t,this.to=e,this.tree=M,this.offset=i,this.open=(N?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],M=!1){let i=[new xg(0,t.length,t,0,!1,M)];for(let M of e)M.to>t.length&&i.push(M);return i}static applyChanges(t,e,M=128){if(!e.length)return t;let i=[],N=1,o=t.length?t[0]:null;for(let n=0,s=0,r=0;;n++){let D=n<e.length?e[n]:null,a=D?D.fromA:1e9;if(a-s>=M)for(;o&&o.from<a;){let e=o;if(s>=e.from||a<=e.to||r){let t=Math.max(e.from,s)-r,M=Math.min(e.to,a)-r;e=t>=M?null:new xg(t,M,e.tree,e.offset+r,n>0,!!D)}if(e&&i.push(e),o.to>a)break;o=N<t.length?t[N++]:null}if(!D)break;s=D.toA,r=D.toA-D.toB}return i}}class pg{startParse(t,e,M){return"string"==typeof t&&(t=new Sg(t)),M=M?M.length?M.map((t=>new $u(t.from,t.to))):[new $u(0,0)]:[new $u(0,t.length)],this.createParse(t,e||[],M)}parse(t,e,M){let i=this.startParse(t,e,M);for(;;){let t=i.advance();if(t)return t}}}class Sg{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}class Qg{constructor(t,e,M,i,N){this.parser=t,this.parse=e,this.overlay=M,this.target=i,this.from=N}}function Eg(t){if(!t.length||t.some((t=>t.from>=t.to)))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class kg{constructor(t,e,M,i,N,o,n){this.parser=t,this.predicate=e,this.mounts=M,this.index=i,this.start=N,this.target=o,this.prev=n,this.depth=0,this.ranges=[]}}const wg=new qu({perNode:!0});class mg{constructor(t,e,M,i,N){this.nest=e,this.input=M,this.fragments=i,this.ranges=N,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return null!=this.stoppedAt&&(t=new ng(t.type,t.children,t.positions,t.length,t.propValues.concat([[wg,this.stoppedAt]]))),t}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let M=Object.assign(Object.create(null),t.target.props);M[qu.mounted.id]=new Ku(e,t.overlay,t.parser),t.target.props=M}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].from<t&&(t=Math.min(t,this.inner[e].parse.parsedPos));return t}stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].parse.stopAt(t)}startInner(){let t=new Yg(this.fragments),e=null,M=null,i=new Og(new ug(this.baseTree,this.ranges[0].from,0,null),og.IncludeAnonymous|og.IgnoreMounts);t:for(let N,o;;){let n,s=!0;if(null!=this.stoppedAt&&i.from>=this.stoppedAt)s=!1;else if(t.hasNode(i)){if(e){let t=e.mounts.find((t=>t.frag.from<=i.from&&t.frag.to>=i.to&&t.mount.overlay));if(t)for(let M of t.mount.overlay){let N=M.from+t.pos,o=M.to+t.pos;N>=i.from&&o<=i.to&&!e.ranges.some((t=>t.from<o&&t.to>N))&&e.ranges.push({from:N,to:o})}}s=!1}else if(M&&(o=Ug(M.ranges,i.from,i.to)))s=2!=o;else if(!i.type.isAnonymous&&(N=this.nest(i,this.input))&&(i.from<i.to||!N.overlay)){i.tree||fg(i);let o=t.findMounts(i.from,N.parser);if("function"==typeof N.overlay)e=new kg(N.parser,N.overlay,o,this.inner.length,i.from,i.tree,e);else{let t=vg(this.ranges,N.overlay||(i.from<i.to?[new $u(i.from,i.to)]:[]));t.length&&Eg(t),!t.length&&N.overlay||this.inner.push(new Qg(N.parser,t.length?N.parser.startParse(this.input,Vg(o,t),t):N.parser.startParse(""),N.overlay?N.overlay.map((t=>new $u(t.from-i.from,t.to-i.from))):null,i.tree,t.length?t[0].from:i.from)),N.overlay?t.length&&(M={ranges:t,depth:0,prev:M}):s=!1}}else if(e&&(n=e.predicate(i))&&(!0===n&&(n=new $u(i.from,i.to)),n.from<n.to)){let t=e.ranges.length-1;t>=0&&e.ranges[t].to==n.from?e.ranges[t]={from:e.ranges[t].from,to:n.to}:e.ranges.push(n)}if(s&&i.firstChild())e&&e.depth++,M&&M.depth++;else for(;!i.nextSibling();){if(!i.parent())break t;if(e&&! --e.depth){let t=vg(this.ranges,e.ranges);t.length&&(Eg(t),this.inner.splice(e.index,0,new Qg(e.parser,e.parser.startParse(this.input,Vg(e.mounts,t),t),e.ranges.map((t=>new $u(t.from-e.start,t.to-e.start))),e.target,t[0].from))),e=e.prev}M&&! --M.depth&&(M=M.prev)}}}}function Ug(t,e,M){for(let i of t){if(i.from>=M)break;if(i.to>e)return i.from<=e&&i.to>=M?2:1}return 0}function Cg(t,e,M,i,N,o){if(e<M){let n=t.buffer[e+1];i.push(t.slice(e,M,n)),N.push(n-o)}}function fg(t){let{node:e}=t,M=[],i=e.context.buffer;do{M.push(t.index),t.parent()}while(!t.tree);let N=t.tree,o=N.children.indexOf(i),n=N.children[o],s=n.buffer,r=[o];N.children[o]=function t(i,N,o,D,a,l){let u=M[l],g=[],j=[];Cg(n,i,u,g,j,D);let c=s[u+1],z=s[u+2];r.push(g.length);let I=l?t(u+4,s[u+3],n.set.types[s[u]],c,z-c,l-1):e.toTree();return g.push(I),j.push(c-D),Cg(n,s[u+3],N,g,j,D),new ng(o,g,j,a)}(0,s.length,eg.none,0,n.length,M.length-1);for(let e of r){let M=t.tree.children[e],i=t.tree.positions[e];t.yield(new ug(M,i+t.from,e,t._tree))}}class bg{constructor(t,e){this.offset=e,this.done=!1,this.cursor=t.cursor(og.IncludeAnonymous|og.IgnoreMounts)}moveTo(t){let{cursor:e}=this,M=t-this.offset;for(;!this.done&&e.from<M;)e.to>=t&&e.enter(M,1,og.IgnoreOverlays|og.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(!(e.children.length&&0==e.positions[0]&&e.children[0]instanceof ng))break;e=e.children[0]}return!1}}let Yg=class{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let M=this.curFrag=t[0];this.curTo=null!==(e=M.tree.prop(wg))&&void 0!==e?e:M.to,this.inner=new bg(M.tree,-M.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=e.tree.prop(wg))&&void 0!==t?t:e.to,this.inner=new bg(e.tree,-e.offset)}}findMounts(t,e){var M;let i=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let t=this.inner.cursor.node;t;t=t.parent){let N=null===(M=t.tree)||void 0===M?void 0:M.prop(qu.mounted);if(N&&N.parser==e)for(let e=this.fragI;e<this.fragments.length;e++){let M=this.fragments[e];if(M.from>=t.to)break;M.tree==this.curFrag.tree&&i.push({frag:M,pos:t.from-M.offset,mount:N})}}}return i}};function vg(t,e){let M=null,i=e;for(let N=1,o=0;N<t.length;N++){let n=t[N-1].to,s=t[N].from;for(;o<i.length;o++){let t=i[o];if(t.from>=s)break;t.to<=n||(M||(i=M=e.slice()),t.from<n?(M[o]=new $u(t.from,n),t.to>s&&M.splice(o+1,0,new $u(s,t.to))):t.to>s?M[o--]=new $u(s,t.to):M.splice(o--,1))}}return i}function Zg(t,e,M,i){let N=0,o=0,n=!1,s=!1,r=-1e9,D=[];for(;;){let a=N==t.length?1e9:n?t[N].to:t[N].from,l=o==e.length?1e9:s?e[o].to:e[o].from;if(n!=s){let t=Math.max(r,M),e=Math.min(a,l,i);t<e&&D.push(new $u(t,e))}if(r=Math.min(a,l),1e9==r)break;a==r&&(n?(n=!1,N++):n=!0),l==r&&(s?(s=!1,o++):s=!0)}return D}function Vg(t,e){let M=[];for(let{pos:i,mount:N,frag:o}of t){let t=i+(N.overlay?N.overlay[0].from:0),n=t+N.tree.length,s=Math.max(o.from,t),r=Math.min(o.to,n);if(N.overlay){let n=N.overlay.map((t=>new $u(t.from+i,t.to+i))),D=Zg(e,n,s,r);for(let e=0,i=s;;e++){let n=e==D.length,s=n?r:D[e].from;if(s>i&&M.push(new xg(i,s,N.tree,-t,o.from>=i||o.openStart,o.to<=s||o.openEnd)),n)break;i=D[e].to}}else M.push(new xg(s,r,N.tree,-t,o.from>=t||o.openStart,o.to<=n||o.openEnd))}return M}let Wg=0;class Pg{constructor(t,e,M,i){this.name=t,this.set=e,this.base=M,this.modified=i,this.id=Wg++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let M="string"==typeof t?t:"?";if(t instanceof Pg&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let i=new Pg(M,[],null,[]);if(i.set.push(i),e)for(let t of e.set)i.set.push(t);return i}static defineModifier(t){let e=new Gg(t);return t=>t.modified.indexOf(e)>-1?t:Gg.get(t.base||t,t.modified.concat(e).sort(((t,e)=>t.id-e.id)))}}let Rg=0;class Gg{constructor(t){this.name=t,this.instances=[],this.id=Rg++}static get(t,e){if(!e.length)return t;let M=e[0].instances.find((M=>M.base==t&&function(t,e){return t.length==e.length&&t.every(((t,M)=>t==e[M]))}(e,M.modified)));if(M)return M;let i=[],N=new Pg(t.name,i,t,e);for(let t of e)t.instances.push(N);let o=function(t){let e=[[]];for(let M=0;M<t.length;M++)for(let i=0,N=e.length;i<N;i++)e.push(e[i].concat(t[M]));return e.sort(((t,e)=>e.length-t.length))}(e);for(let e of t.set)if(!e.modified.length)for(let t of o)i.push(Gg.get(e,t));return N}}function Bg(t){let e=Object.create(null);for(let M in t){let i=t[M];Array.isArray(i)||(i=[i]);for(let t of M.split(" "))if(t){let M=[],N=2,o=t;for(let e=0;;){if("..."==o&&e>0&&e+3==t.length){N=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw new RangeError("Invalid path: "+t);if(M.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),e+=i[0].length,e==t.length)break;let n=t[e++];if(e==t.length&&"!"==n){N=0;break}if("/"!=n)throw new RangeError("Invalid path: "+t);o=t.slice(e)}let n=M.length-1,s=M[n];if(!s)throw new RangeError("Invalid path: "+t);let r=new Fg(i,N,n>0?M.slice(0,n):null);e[s]=r.sort(e[s])}}return _g.add(e)}const _g=new qu;class Fg{constructor(t,e,M,i){this.tags=t,this.mode=e,this.context=M,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}function Jg(t,e){let M=Object.create(null);for(let e of t)if(Array.isArray(e.tag))for(let t of e.tag)M[t.id]=e.class;else M[e.tag.id]=e.class;let{scope:i,all:N=null}=e||{};return{style:t=>{let e=N;for(let i of t)for(let t of i.set){let i=M[t.id];if(i){e=e?e+" "+i:i;break}}return e},scope:i}}function Hg(t,e,M,i=0,N=t.length){let o=new Xg(i,Array.isArray(e)?e:[e],M);o.highlightRange(t.cursor(),i,N,"",o.highlighters),o.flush(N)}Fg.empty=new Fg([],2,null);class Xg{constructor(t,e,M){this.at=t,this.highlighters=e,this.span=M,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,M,i,N){let{type:o,from:n,to:s}=t;if(n>=M||s<=e)return;o.isTop&&(N=this.highlighters.filter((t=>!t.scope||t.scope(o))));let r=i,D=function(t){let e=t.type.prop(_g);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||Fg.empty,a=function(t,e){let M=null;for(let i of t){let t=i.style(e);t&&(M=M?M+" "+t:t)}return M}(N,D.tags);if(a&&(r&&(r+=" "),r+=a,1==D.mode&&(i+=(i?" ":"")+a)),this.startSpan(Math.max(e,n),r),D.opaque)return;let l=t.tree&&t.tree.prop(qu.mounted);if(l&&l.overlay){let o=t.node.enter(l.overlay[0].from+n,1),D=this.highlighters.filter((t=>!t.scope||t.scope(l.tree.type))),a=t.firstChild();for(let u=0,g=n;;u++){let j=u<l.overlay.length?l.overlay[u]:null,c=j?j.from+n:s,z=Math.max(e,g),I=Math.min(M,c);if(z<I&&a)for(;t.from<I&&(this.highlightRange(t,z,I,i,N),this.startSpan(Math.min(I,t.to),r),!(t.to>=c)&&t.nextSibling()););if(!j||c>M)break;g=j.to+n,g>e&&(this.highlightRange(o.cursor(),Math.max(e,j.from+n),Math.min(M,g),"",D),this.startSpan(Math.min(M,g),r))}a&&t.parent()}else if(t.firstChild()){l&&(i="");do{if(!(t.to<=e)){if(t.from>=M)break;this.highlightRange(t,e,M,i,N),this.startSpan(Math.min(M,t.to),r)}}while(t.nextSibling());t.parent()}}}const $g=Pg.define,qg=$g(),Kg=$g(),tj=$g(Kg),ej=$g(Kg),Mj=$g(),ij=$g(Mj),Nj=$g(Mj),oj=$g(),nj=$g(oj),sj=$g(),rj=$g(),Dj=$g(),aj=$g(Dj),lj=$g(),uj={comment:qg,lineComment:$g(qg),blockComment:$g(qg),docComment:$g(qg),name:Kg,variableName:$g(Kg),typeName:tj,tagName:$g(tj),propertyName:ej,attributeName:$g(ej),className:$g(Kg),labelName:$g(Kg),namespace:$g(Kg),macroName:$g(Kg),literal:Mj,string:ij,docString:$g(ij),character:$g(ij),attributeValue:$g(ij),number:Nj,integer:$g(Nj),float:$g(Nj),bool:$g(Mj),regexp:$g(Mj),escape:$g(Mj),color:$g(Mj),url:$g(Mj),keyword:sj,self:$g(sj),null:$g(sj),atom:$g(sj),unit:$g(sj),modifier:$g(sj),operatorKeyword:$g(sj),controlKeyword:$g(sj),definitionKeyword:$g(sj),moduleKeyword:$g(sj),operator:rj,derefOperator:$g(rj),arithmeticOperator:$g(rj),logicOperator:$g(rj),bitwiseOperator:$g(rj),compareOperator:$g(rj),updateOperator:$g(rj),definitionOperator:$g(rj),typeOperator:$g(rj),controlOperator:$g(rj),punctuation:Dj,separator:$g(Dj),bracket:aj,angleBracket:$g(aj),squareBracket:$g(aj),paren:$g(aj),brace:$g(aj),content:oj,heading:nj,heading1:$g(nj),heading2:$g(nj),heading3:$g(nj),heading4:$g(nj),heading5:$g(nj),heading6:$g(nj),contentSeparator:$g(oj),list:$g(oj),quote:$g(oj),emphasis:$g(oj),strong:$g(oj),link:$g(oj),monospace:$g(oj),strikethrough:$g(oj),inserted:$g(),deleted:$g(),changed:$g(),invalid:$g(),meta:lj,documentMeta:$g(lj),annotation:$g(lj),processingInstruction:$g(lj),definition:Pg.defineModifier("definition"),constant:Pg.defineModifier("constant"),function:Pg.defineModifier("function"),standard:Pg.defineModifier("standard"),local:Pg.defineModifier("local"),special:Pg.defineModifier("special")};for(let t in uj){let e=uj[t];e instanceof Pg&&(e.name=t)}var gj;Jg([{tag:uj.link,class:"tok-link"},{tag:uj.heading,class:"tok-heading"},{tag:uj.emphasis,class:"tok-emphasis"},{tag:uj.strong,class:"tok-strong"},{tag:uj.keyword,class:"tok-keyword"},{tag:uj.atom,class:"tok-atom"},{tag:uj.bool,class:"tok-bool"},{tag:uj.url,class:"tok-url"},{tag:uj.labelName,class:"tok-labelName"},{tag:uj.inserted,class:"tok-inserted"},{tag:uj.deleted,class:"tok-deleted"},{tag:uj.literal,class:"tok-literal"},{tag:uj.string,class:"tok-string"},{tag:uj.number,class:"tok-number"},{tag:[uj.regexp,uj.escape,uj.special(uj.string)],class:"tok-string2"},{tag:uj.variableName,class:"tok-variableName"},{tag:uj.local(uj.variableName),class:"tok-variableName tok-local"},{tag:uj.definition(uj.variableName),class:"tok-variableName tok-definition"},{tag:uj.special(uj.variableName),class:"tok-variableName2"},{tag:uj.definition(uj.propertyName),class:"tok-propertyName tok-definition"},{tag:uj.typeName,class:"tok-typeName"},{tag:uj.namespace,class:"tok-namespace"},{tag:uj.className,class:"tok-className"},{tag:uj.macroName,class:"tok-macroName"},{tag:uj.propertyName,class:"tok-propertyName"},{tag:uj.operator,class:"tok-operator"},{tag:uj.comment,class:"tok-comment"},{tag:uj.meta,class:"tok-meta"},{tag:uj.invalid,class:"tok-invalid"},{tag:uj.punctuation,class:"tok-punctuation"}]);const jj=new qu;function cj(t){return Ro.define({combine:t?e=>e.concat(t):void 0})}const zj=new qu;class Ij{constructor(t,e,M=[],i=""){this.data=t,this.name=i,mn.prototype.hasOwnProperty("tree")||Object.defineProperty(mn.prototype,"tree",{get(){return yj(this)}}),this.parser=e,this.extension=[Ej.of(this),mn.languageData.of(((t,e,M)=>{let i=Tj(t,e,M),N=i.type.prop(jj);if(!N)return[];let o=t.facet(N),n=i.type.prop(zj);if(n){let N=i.resolve(e-i.from,M);for(let e of n)if(e.test(N,t)){let M=t.facet(e.facet);return"replace"==e.type?M:M.concat(o)}}return o}))].concat(M)}isActiveAt(t,e,M=-1){return Tj(t,e,M).type.prop(jj)==this.data}findRegions(t){let e=t.facet(Ej);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let M=[],i=(t,e)=>{if(t.prop(jj)==this.data)return void M.push({from:e,to:e+t.length});let N=t.prop(qu.mounted);if(N){if(N.tree.prop(jj)==this.data){if(N.overlay)for(let t of N.overlay)M.push({from:t.from+e,to:t.to+e});else M.push({from:e,to:e+t.length});return}if(N.overlay){let t=M.length;if(i(N.tree,N.overlay[0].from+e),M.length>t)return}}for(let M=0;M<t.children.length;M++){let N=t.children[M];N instanceof ng&&i(N,t.positions[M]+e)}};return i(yj(t),0),M}get allowsNesting(){return!0}}function Tj(t,e,M){let i=t.facet(Ej),N=yj(t).topNode;if(!i||i.allowsNesting)for(let t=N;t;t=t.enter(e,M,og.ExcludeBuffers))t.type.isTop&&(N=t);return N}Ij.setState=yn.define();class Oj extends Ij{constructor(t,e,M){super(t,e,[],M),this.parser=e}static define(t){let e=cj(t.languageData);return new Oj(e,t.parser.configure({props:[jj.add((t=>t.isTop?e:void 0))]}),t.name)}configure(t,e){return new Oj(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function yj(t){let e=t.field(Ij.state,!1);return e?e.tree:ng.empty}class dj{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let M=this.cursorPos-this.string.length;return t<M||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-M,e-M)}}let Aj=null;class hj{constructor(t,e,M=[],i,N,o,n,s){this.parser=t,this.state=e,this.fragments=M,this.tree=i,this.treeLen=N,this.viewport=o,this.skipped=n,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,e,M){return new hj(t,e,[],ng.empty,0,M,[],null)}startParse(){return this.parser.startParse(new dj(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=ng.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var M;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(xg.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(M=this.parse.stoppedAt)&&void 0!==M?M:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}}))}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(xg.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=Aj;Aj=this;try{return t()}finally{Aj=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Lj(t,e.from,e.to);return t}changes(t,e){let{fragments:M,tree:i,treeLen:N,viewport:o,skipped:n}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,M,i,N)=>e.push({fromA:t,toA:M,fromB:i,toB:N}))),M=xg.applyChanges(M,e),i=ng.empty,N=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){n=[];for(let e of this.skipped){let M=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);M<i&&n.push({from:M,to:i})}}}return new hj(this.parser,e,M,i,N,o,n,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:M,to:i}=this.skipped[e];M<t.to&&i>t.from&&(this.fragments=Lj(this.fragments,M,i),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends pg{createParse(e,M,i){let N=i[0].from,o=i[i.length-1].to,n={parsedPos:N,advance(){let e=Aj;if(e){for(let t of i)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new ng(eg.none,[],[],o-N)},stoppedAt:null,stopAt(){}};return n}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return Aj}}function Lj(t,e,M){return xg.applyChanges(t,[{fromA:e,toA:M,fromB:e,toB:M}])}class xj{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),M=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,M)||e.takeTree(),new xj(e)}static init(t){let e=Math.min(3e3,t.doc.length),M=hj.create(t.facet(Ej).parser,t,{from:0,to:e});return M.work(20,e)||M.takeTree(),new xj(M)}}Ij.state=Xo.define({create:xj.init,update(t,e){for(let t of e.effects)if(t.is(Ij.setState))return t.value;return e.startState.facet(Ej)!=e.state.facet(Ej)?xj.init(e.state):t.apply(e)}});let pj=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(pj=t=>{let e=-1,M=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(M):cancelIdleCallback(e)});const Sj="undefined"!=typeof navigator&&(null===(gj=navigator.scheduling)||void 0===gj?void 0:gj.isInputPending)?()=>navigator.scheduling.isInputPending():null,Qj=sD.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Ij.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Ij.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=pj(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:M,viewport:{to:i}}=this.view,N=M.field(Ij.state);if(N.tree==N.context.tree&&N.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!Sj?Math.max(25,t.timeRemaining()-5):1e9),n=N.context.treeLen<i&&M.doc.length>i+1e3,s=N.context.work((()=>Sj&&Sj()||Date.now()>o),i+(n?0:1e5));this.chunkBudget-=Date.now()-e,(s||this.chunkBudget<=0)&&(N.context.takeTree(),this.view.dispatch({effects:Ij.setState.of(new xj(N.context))})),this.chunkBudget>0&&(!s||n)&&this.scheduleWork(),this.checkAsyncSchedule(N.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>iD(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ej=Ro.define({combine:t=>t.length?t[0]:null,enables:t=>[Ij.state,Qj,nl.contentAttributes.compute([t],(e=>{let M=e.facet(t);return M&&M.name?{"data-language":M.name}:{}}))]});class kj{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const wj=Ro.define(),mj=Ro.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Uj(t){let e=t.facet(mj);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function Cj(t,e){let M="",i=t.tabSize,N=t.facet(mj)[0];if("\t"==N){for(;e>=i;)M+="\t",e-=i;N=" "}for(let t=0;t<e;t++)M+=N;return M}function fj(t,e){t instanceof mn&&(t=new bj(t));for(let M of t.state.facet(wj)){let i=M(t,e);if(void 0!==i)return i}let M=yj(t.state);return M.length>=e?function(t,e,M){let i=e.resolveStack(M),N=e.resolveInner(M,-1).resolve(M,0).enterUnfinishedNodesBefore(M);if(N!=i.node){let t=[];for(let e=N;e&&(e.from!=i.node.from||e.type!=i.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)i={node:t[e],next:i}}return vj(i,t,M)}(t,M,e):null}class bj{constructor(t,e={}){this.state=t,this.options=e,this.unit=Uj(t)}lineAt(t,e=1){let M=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:N}=this.options;return null!=i&&i>=M.from&&i<=M.to?N&&i==t?{text:"",from:t}:(e<0?i<t:i<=t)?{text:M.text.slice(i-M.from),from:i}:{text:M.text.slice(0,i-M.from),from:M.from}:M}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:M,from:i}=this.lineAt(t,e);return M.slice(t-i,Math.min(M.length,t+100-i))}column(t,e=1){let{text:M,from:i}=this.lineAt(t,e),N=this.countColumn(M,t-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(N+=o-this.countColumn(M,M.search(/\S|$/))),N}countColumn(t,e=t.length){return Xn(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:M,from:i}=this.lineAt(t,e),N=this.options.overrideIndentation;if(N){let t=N(i);if(t>-1)return t}return this.countColumn(M,M.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Yj=new qu;function vj(t,e,M){for(let i=t;i;i=i.next){let t=Zj(i.node);if(t)return t(Wj.create(e,M,i))}return 0}function Zj(t){let e=t.type.prop(Yj);if(e)return e;let M,i=t.firstChild;if(i&&(M=i.type.prop(qu.closedBy))){let e=t.lastChild,i=e&&M.indexOf(e.name)>-1;return t=>Gj(t,!0,1,void 0,i&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?Vj:null}function Vj(){return 0}class Wj extends bj{constructor(t,e,M){super(t.state,t.options),this.base=t,this.pos=e,this.context=M}get node(){return this.context.node}static create(t,e,M){return new Wj(t,e,M)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let M=t.resolve(e.from);for(;M.parent&&M.parent.from==M.from;)M=M.parent;if(Pj(M,t))break;e=this.state.doc.lineAt(M.from)}return this.lineIndent(e.from)}continue(){return vj(this.context.next,this.base,this.pos)}}function Pj(t,e){for(let M=e;M;M=M.parent)if(t==M)return!0;return!1}function Rj({closing:t,align:e=!0,units:M=1}){return i=>Gj(i,e,M,t)}function Gj(t,e,M,i,N){let o=t.textAfter,n=o.match(/^\s*/)[0].length,s=i&&o.slice(n,n+i.length)==i||N==t.pos+n,r=e?function(t){let e=t.node,M=e.childAfter(e.from),i=e.lastChild;if(!M)return null;let N=t.options.simulateBreak,o=t.state.doc.lineAt(M.from),n=null==N||N<=o.from?o.to:Math.min(o.to,N);for(let t=M.to;;){let N=e.childAfter(t);if(!N||N==i)return null;if(!N.type.isSkipped){if(N.from>=n)return null;let t=/^ */.exec(o.text.slice(M.to-o.from))[0].length;return{from:M.from,to:M.to+t}}t=N.to}}(t):null;return r?s?t.column(r.from):t.column(r.to):t.baseIndent+(s?0:t.unit*M)}const Bj=t=>t.baseIndent;function _j({except:t,units:e=1}={}){return M=>{let i=t&&t.test(M.textAfter);return M.baseIndent+(i?0:e*M.unit)}}const Fj=Ro.define(),Jj=new qu;function Hj(t){let e=t.firstChild,M=t.lastChild;return e&&e.to<M.from?{from:e.to,to:M.type.isError?t.to:M.from}:null}function Xj(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function $j(t,e,M){for(let i of t.facet(Fj)){let N=i(t,e,M);if(N)return N}return function(t,e,M){let i=yj(t);if(i.length<M)return null;let N=null;for(let o=i.resolveStack(M,1);o;o=o.next){let n=o.node;if(n.to<=M||n.from>M)continue;if(N&&n.from<e)break;let s=n.type.prop(Jj);if(s&&(n.to<i.length-50||i.length==t.doc.length||!Xj(n))){let i=s(n,t);i&&i.from<=M&&i.from>=e&&i.to>M&&(N=i)}}return N}(t,e,M)}function qj(t,e){let M=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return M>=i?void 0:{from:M,to:i}}const Kj=yn.define({map:qj}),tc=yn.define({map:qj});function ec(t){let e=[];for(let{head:M}of t.state.selection.ranges)e.some((t=>t.from<=M&&t.to>=M))||e.push(t.lineBlockAt(M));return e}const Mc=Xo.define({create:()=>lr.none,update(t,e){t=t.map(e.changes);for(let M of e.effects)if(M.is(Kj)&&!Nc(t,M.value.from,M.value.to)){let{preparePlaceholder:i}=e.state.facet(Dc),N=i?lr.replace({widget:new gc(i(e.state,M.value))}):uc;t=t.update({add:[N.range(M.value.from,M.value.to)]})}else M.is(tc)&&(t=t.update({filter:(t,e)=>M.value.from!=t||M.value.to!=e,filterFrom:M.value.from,filterTo:M.value.to}));if(e.selection){let M=!1,{head:i}=e.selection.main;t.between(i,i,((t,e)=>{t<i&&e>i&&(M=!0)})),M&&(t=t.update({filterFrom:i,filterTo:i,filter:(t,e)=>e<=i||t>=i}))}return t},provide:t=>nl.decorations.from(t),toJSON(t,e){let M=[];return t.between(0,e.doc.length,((t,e)=>{M.push(t,e)})),M},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let M=0;M<t.length;){let i=t[M++],N=t[M++];if("number"!=typeof i||"number"!=typeof N)throw new RangeError("Invalid JSON for fold state");e.push(uc.range(i,N))}return lr.set(e,!0)}});function ic(t,e,M){var i;let N=null;return null===(i=t.field(Mc,!1))||void 0===i||i.between(e,M,((t,e)=>{(!N||N.from>t)&&(N={from:t,to:e})})),N}function Nc(t,e,M){let i=!1;return t.between(e,e,((t,N)=>{t==e&&N==M&&(i=!0)})),i}function oc(t,e){return t.field(Mc,!1)?e:e.concat(yn.appendConfig.of(ac()))}function nc(t,e,M=!0){let i=t.state.doc.lineAt(e.from).number,N=t.state.doc.lineAt(e.to).number;return nl.announce.of(`${t.state.phrase(M?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${N}.`)}const sc=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of ec(t)){let M=$j(t.state,e.from,e.to);if(M)return t.dispatch({effects:oc(t.state,[Kj.of(M),nc(t,M)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(Mc,!1))return!1;let e=[];for(let M of ec(t)){let i=ic(t.state,M.from,M.to);i&&e.push(tc.of(i),nc(t,i,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,M=[];for(let i=0;i<e.doc.length;){let N=t.lineBlockAt(i),o=$j(e,N.from,N.to);o&&M.push(Kj.of(o)),i=(o?t.lineBlockAt(o.to):N).to+1}return M.length&&t.dispatch({effects:oc(t.state,M)}),!!M.length}},{key:"Ctrl-Alt-]",run:t=>{let e=t.state.field(Mc,!1);if(!e||!e.size)return!1;let M=[];return e.between(0,t.state.doc.length,((t,e)=>{M.push(tc.of({from:t,to:e}))})),t.dispatch({effects:M}),!0}}],rc={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Dc=Ro.define({combine:t=>Un(t,rc)});function ac(t){let e=[Mc,zc];return t&&e.push(Dc.of(t)),e}function lc(t,e){let{state:M}=t,i=M.facet(Dc),N=e=>{let M=t.lineBlockAt(t.posAtDOM(e.target)),i=ic(t.state,M.from,M.to);i&&t.dispatch({effects:tc.of(i)}),e.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,N,e);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",M.phrase("folded code")),o.title=M.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=N,o}const uc=lr.replace({widget:new class extends Dr{toDOM(t){return lc(t,null)}}});class gc extends Dr{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return lc(t,this.value)}}const jc={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class cc extends pu{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}const zc=nl.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Ic{constructor(t,e){let M;function i(t){let e=es.newName();return(M||(M=Object.create(null)))["."+e]=t,e}this.specs=t;const N="string"==typeof e.all?e.all:e.all?i(e.all):void 0,o=e.scope;this.scope=o instanceof Ij?t=>t.prop(jj)==o.data:o?t=>t==o:void 0,this.style=Jg(t.map((t=>({tag:t.tag,class:t.class||i(Object.assign({},t,{tag:null}))}))),{all:N}).style,this.module=M?new es(M):null,this.themeType=e.themeType}static define(t,e){return new Ic(t,e||{})}}const Tc=Ro.define(),Oc=Ro.define({combine:t=>t.length?[t[0]]:null});function yc(t){let e=t.facet(Tc);return e.length?e:t.facet(Oc)}class dc{constructor(t){this.markCache=Object.create(null),this.tree=yj(t.state),this.decorations=this.buildDeco(t,yc(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=yj(t.state),M=yc(t.state),i=M!=yc(t.startState),{viewport:N}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<N.to&&!i&&e.type==this.tree.type&&o>=N.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||i)&&(this.tree=e,this.decorations=this.buildDeco(t.view,M),this.decoratedTo=N.to)}buildDeco(t,e){if(!e||!this.tree.length)return lr.none;let M=new Zn;for(let{from:i,to:N}of t.visibleRanges)Hg(this.tree,e,((t,e,i)=>{M.add(t,e,this.markCache[i]||(this.markCache[i]=lr.mark({class:i})))}),i,N);return M.finish()}}const Ac=Mn.high(sD.fromClass(dc,{decorations:t=>t.decorations})),hc=Ic.define([{tag:uj.meta,color:"#404740"},{tag:uj.link,textDecoration:"underline"},{tag:uj.heading,textDecoration:"underline",fontWeight:"bold"},{tag:uj.emphasis,fontStyle:"italic"},{tag:uj.strong,fontWeight:"bold"},{tag:uj.strikethrough,textDecoration:"line-through"},{tag:uj.keyword,color:"#708"},{tag:[uj.atom,uj.bool,uj.url,uj.contentSeparator,uj.labelName],color:"#219"},{tag:[uj.literal,uj.inserted],color:"#164"},{tag:[uj.string,uj.deleted],color:"#a11"},{tag:[uj.regexp,uj.escape,uj.special(uj.string)],color:"#e40"},{tag:uj.definition(uj.variableName),color:"#00f"},{tag:uj.local(uj.variableName),color:"#30a"},{tag:[uj.typeName,uj.namespace],color:"#085"},{tag:uj.className,color:"#167"},{tag:[uj.special(uj.variableName),uj.macroName],color:"#256"},{tag:uj.definition(uj.propertyName),color:"#00c"},{tag:uj.comment,color:"#940"},{tag:uj.invalid,color:"#f00"}]),Lc=nl.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),xc="()[]{}",pc=Ro.define({combine:t=>Un(t,{afterCursor:!0,brackets:xc,maxScanDistance:1e4,renderMatch:Ec})}),Sc=lr.mark({class:"cm-matchingBracket"}),Qc=lr.mark({class:"cm-nonmatchingBracket"});function Ec(t){let e=[],M=t.matched?Sc:Qc;return e.push(M.range(t.start.from,t.start.to)),t.end&&e.push(M.range(t.end.from,t.end.to)),e}const kc=Xo.define({create:()=>lr.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let M=[],i=e.state.facet(pc);for(let t of e.state.selection.ranges){if(!t.empty)continue;let N=fc(e.state,t.head,-1,i)||t.head>0&&fc(e.state,t.head-1,1,i)||i.afterCursor&&(fc(e.state,t.head,1,i)||t.head<e.state.doc.length&&fc(e.state,t.head+1,-1,i));N&&(M=M.concat(i.renderMatch(N,e.state)))}return lr.set(M,!0)},provide:t=>nl.decorations.from(t)}),wc=[kc,Lc];const mc=new qu;function Uc(t,e,M){let i=t.prop(e<0?qu.openedBy:qu.closedBy);if(i)return i;if(1==t.name.length){let i=M.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[M[i+e]]}return null}function Cc(t){let e=t.type.prop(mc);return e?e(t.node):t}function fc(t,e,M,i={}){let N=i.maxScanDistance||1e4,o=i.brackets||xc,n=yj(t),s=n.resolveInner(e,M);for(let i=s;i;i=i.parent){let N=Uc(i.type,M,o);if(N&&i.from<i.to){let n=Cc(i);if(n&&(M>0?e>=n.from&&e<n.to:e>n.from&&e<=n.to))return bc(t,e,M,i,n,N,o)}}return function(t,e,M,i,N,o,n){let s=M<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),r=n.indexOf(s);if(r<0||r%2==0!=M>0)return null;let D={from:M<0?e-1:e,to:M>0?e+1:e},a=t.doc.iterRange(e,M>0?t.doc.length:0),l=0;for(let t=0;!a.next().done&&t<=o;){let o=a.value;M<0&&(t+=o.length);let s=e+t*M;for(let t=M>0?0:o.length-1,e=M>0?o.length:-1;t!=e;t+=M){let e=n.indexOf(o[t]);if(!(e<0||i.resolveInner(s+t,1).type!=N))if(e%2==0==M>0)l++;else{if(1==l)return{start:D,end:{from:s+t,to:s+t+1},matched:e>>1==r>>1};l--}}M>0&&(t+=o.length)}return a.done?{start:D,matched:!1}:null}(t,e,M,n,s.type,N,o)}function bc(t,e,M,i,N,o,n){let s=i.parent,r={from:N.from,to:N.to},D=0,a=null==s?void 0:s.cursor();if(a&&(M<0?a.childBefore(i.from):a.childAfter(i.to)))do{if(M<0?a.to<=i.from:a.from>=i.to){if(0==D&&o.indexOf(a.type.name)>-1&&a.from<a.to){let t=Cc(a);return{start:r,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Uc(a.type,M,n))D++;else if(Uc(a.type,-M,n)){if(0==D){let t=Cc(a);return{start:r,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}D--}}}while(M<0?a.prevSibling():a.nextSibling());return{start:r,matched:!1}}const Yc=Object.create(null),vc=[eg.none],Zc=[],Vc=Object.create(null),Wc=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Wc[t]=Rc(Yc,e);function Pc(t,e){Zc.indexOf(t)>-1||(Zc.push(t),console.warn(e))}function Rc(t,e){let M=[];for(let i of e.split(" ")){let e=[];for(let M of i.split(".")){let i=t[M]||uj[M];i?"function"==typeof i?e.length?e=e.map(i):Pc(M,`Modifier ${M} used at start of tag`):e.length?Pc(M,`Tag ${M} used as modifier`):e=Array.isArray(i)?i:[i]:Pc(M,`Unknown highlighting tag ${M}`)}for(let t of e)M.push(t)}if(!M.length)return 0;let i=e.replace(/ /g,"_"),N=i+" "+M.map((t=>t.id)),o=Vc[N];if(o)return o.id;let n=Vc[N]=eg.define({id:vc.length,name:i,props:[Bg({[i]:M})]});return vc.push(n),n.id}hr.RTL,hr.LTR;function Gc(t,e){return({state:M,dispatch:i})=>{if(M.readOnly)return!1;let N=t(e,M);return!!N&&(i(M.update(N)),!0)}}const Bc=Gc($c,0),_c=Gc(Xc,0),Fc=Gc(((t,e)=>Xc(t,e,function(t){let e=[];for(let M of t.selection.ranges){let i=t.doc.lineAt(M.from),N=M.to<=i.to?i:t.doc.lineAt(M.to);N.from>i.from&&N.from==M.to&&(N=M.to==i.to+1?i:t.doc.lineAt(M.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=N.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:N.to})}return e}(e))),0);function Jc(t,e){let M=t.languageDataAt("commentTokens",e);return M.length?M[0]:{}}const Hc=50;function Xc(t,e,M=e.selection.ranges){let i=M.map((t=>Jc(e,t.from).block));if(!i.every((t=>t)))return null;let N=M.map(((t,M)=>function(t,{open:e,close:M},i,N){let o,n,s=t.sliceDoc(i-Hc,i),r=t.sliceDoc(N,N+Hc),D=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(r)[0].length,l=s.length-D;if(s.slice(l-e.length,l)==e&&r.slice(a,a+M.length)==M)return{open:{pos:i-D,margin:D&&1},close:{pos:N+a,margin:a&&1}};N-i<=2*Hc?o=n=t.sliceDoc(i,N):(o=t.sliceDoc(i,i+Hc),n=t.sliceDoc(N-Hc,N));let u=/^\s*/.exec(o)[0].length,g=/\s*$/.exec(n)[0].length,j=n.length-g-M.length;return o.slice(u,u+e.length)==e&&n.slice(j,j+M.length)==M?{open:{pos:i+u+e.length,margin:/\s/.test(o.charAt(u+e.length))?1:0},close:{pos:N-g-M.length,margin:/\s/.test(n.charAt(j-1))?1:0}}:null}(e,i[M],t.from,t.to)));if(2!=t&&!N.every((t=>t)))return{changes:e.changes(M.map(((t,e)=>N[e]?[]:[{from:t.from,insert:i[e].open+" "},{from:t.to,insert:" "+i[e].close}])))};if(1!=t&&N.some((t=>t))){let t=[];for(let e,M=0;M<N.length;M++)if(e=N[M]){let N=i[M],{open:o,close:n}=e;t.push({from:o.pos-N.open.length,to:o.pos+o.margin},{from:n.pos-n.margin,to:n.pos+N.close.length})}return{changes:t}}return null}function $c(t,e,M=e.selection.ranges){let i=[],N=-1;for(let{from:t,to:o}of M){let M=i.length,n=1e9,s=Jc(e,t).line;if(s){for(let M=t;M<=o;){let r=e.doc.lineAt(M);if(r.from>N&&(t==o||o>r.from)){N=r.from;let t=/^\s*/.exec(r.text)[0].length,e=t==r.length,M=r.text.slice(t,t+s.length)==s?t:-1;t<r.text.length&&t<n&&(n=t),i.push({line:r,comment:M,token:s,indent:t,empty:e,single:!1})}M=r.to+1}if(n<1e9)for(let t=M;t<i.length;t++)i[t].indent<i[t].line.text.length&&(i[t].indent=n);i.length==M+1&&(i[M].single=!0)}}if(2!=t&&i.some((t=>t.comment<0&&(!t.empty||t.single)))){let t=[];for(let{line:e,token:M,indent:N,empty:o,single:n}of i)!n&&o||t.push({from:e.from+N,insert:M+" "});let M=e.changes(t);return{changes:M,selection:e.selection.map(M,1)}}if(1!=t&&i.some((t=>t.comment>=0))){let t=[];for(let{line:e,comment:M,token:N}of i)if(M>=0){let i=e.from+M,o=i+N.length;" "==e.text[o-e.from]&&o++,t.push({from:i,to:o})}return{changes:t}}return null}const qc=In.define(),Kc=In.define(),tz=Ro.define(),ez=Ro.define({combine:t=>Un(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(M,i)=>t(M,i)||e(M,i)})}),Mz=Xo.define({create:()=>Tz.empty,update(t,e){let M=e.state.facet(ez),i=e.annotation(qc);if(i){let N=rz.fromTransaction(e,i.selection),o=i.side,n=0==o?t.undone:t.done;return n=N?Dz(n,n.length,M.minDepth,N):gz(n,e.startState.selection),new Tz(0==o?i.rest:n,0==o?n:i.rest)}let N=e.annotation(Kc);if("full"!=N&&"before"!=N||(t=t.isolate()),!1===e.annotation(dn.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let o=rz.fromTransaction(e),n=e.annotation(dn.time),s=e.annotation(dn.userEvent);return o?t=t.addChanges(o,n,s,M,e):e.selection&&(t=t.addSelection(e.startState.selection,n,s,M.newGroupDelay)),"full"!=N&&"after"!=N||(t=t.isolate()),t},toJSON:t=>({done:t.done.map((t=>t.toJSON())),undone:t.undone.map((t=>t.toJSON()))}),fromJSON:t=>new Tz(t.done.map(rz.fromJSON),t.undone.map(rz.fromJSON))});function iz(t,e){return function({state:M,dispatch:i}){if(!e&&M.readOnly)return!1;let N=M.field(Mz,!1);if(!N)return!1;let o=N.pop(t,M,e);return!!o&&(i(o),!0)}}const Nz=iz(0,!1),oz=iz(1,!1),nz=iz(0,!0),sz=iz(1,!0);class rz{constructor(t,e,M,i,N){this.changes=t,this.effects=e,this.mapped=M,this.startSelection=i,this.selectionsAfter=N}setSelAfter(t){return new rz(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,M;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(M=this.startSelection)||void 0===M?void 0:M.toJSON(),selectionsAfter:this.selectionsAfter.map((t=>t.toJSON()))}}static fromJSON(t){return new rz(t.changes&&mo.fromJSON(t.changes),[],t.mapped&&wo.fromJSON(t.mapped),t.startSelection&&Vo.fromJSON(t.startSelection),t.selectionsAfter.map(Vo.fromJSON))}static fromTransaction(t,e){let M=lz;for(let e of t.startState.facet(tz)){let i=e(t);i.length&&(M=M.concat(i))}return!M.length&&t.changes.empty?null:new rz(t.changes.invert(t.startState.doc),M,void 0,e||t.startState.selection,lz)}static selection(t){return new rz(void 0,lz,void 0,void 0,t)}}function Dz(t,e,M,i){let N=e+1>M+20?e-M-1:0,o=t.slice(N,e);return o.push(i),o}function az(t,e){return t.length?e.length?t.concat(e):t:e}const lz=[],uz=200;function gz(t,e){if(t.length){let M=t[t.length-1],i=M.selectionsAfter.slice(Math.max(0,M.selectionsAfter.length-uz));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),Dz(t,t.length-1,1e9,M.setSelAfter(i)))}return[rz.selection([e])]}function jz(t){let e=t[t.length-1],M=t.slice();return M[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),M}function cz(t,e){if(!t.length)return t;let M=t.length,i=lz;for(;M;){let N=zz(t[M-1],e,i);if(N.changes&&!N.changes.empty||N.effects.length){let e=t.slice(0,M);return e[M-1]=N,e}e=N.mapped,M--,i=N.selectionsAfter}return i.length?[rz.selection(i)]:lz}function zz(t,e,M){let i=az(t.selectionsAfter.length?t.selectionsAfter.map((t=>t.map(e))):lz,M);if(!t.changes)return rz.selection(i);let N=t.changes.map(e),o=e.mapDesc(t.changes,!0),n=t.mapped?t.mapped.composeDesc(o):o;return new rz(N,yn.mapEffects(t.effects,e),n,t.startSelection.map(o),i)}const Iz=/^(input\.type|delete)($|\.)/;class Tz{constructor(t,e,M=0,i=void 0){this.done=t,this.undone=e,this.prevTime=M,this.prevUserEvent=i}isolate(){return this.prevTime?new Tz(this.done,this.undone):this}addChanges(t,e,M,i,N){let o=this.done,n=o[o.length-1];return o=n&&n.changes&&!n.changes.empty&&t.changes&&(!M||Iz.test(M))&&(!n.selectionsAfter.length&&e-this.prevTime<i.newGroupDelay&&i.joinToEvent(N,function(t,e){let M=[],i=!1;return t.iterChangedRanges(((t,e)=>M.push(t,e))),e.iterChangedRanges(((t,e,N,o)=>{for(let t=0;t<M.length;){let e=M[t++],n=M[t++];o>=e&&N<=n&&(i=!0)}})),i}(n.changes,t.changes))||"input.type.compose"==M)?Dz(o,o.length-1,i.minDepth,new rz(t.changes.compose(n.changes),az(yn.mapEffects(t.effects,n.changes),n.effects),n.mapped,n.startSelection,lz)):Dz(o,o.length,i.minDepth,t),new Tz(o,lz,e,M)}addSelection(t,e,M,i){let N=this.done.length?this.done[this.done.length-1].selectionsAfter:lz;return N.length>0&&e-this.prevTime<i&&M==this.prevUserEvent&&M&&/^select($|\.)/.test(M)&&function(t,e){return t.ranges.length==e.ranges.length&&0===t.ranges.filter(((t,M)=>t.empty!=e.ranges[M].empty)).length}(N[N.length-1],t)?this:new Tz(gz(this.done,t),this.undone,e,M)}addMapping(t){return new Tz(cz(this.done,t),cz(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,M){let i=0==t?this.done:this.undone;if(0==i.length)return null;let N=i[i.length-1],o=N.selectionsAfter[0]||e.selection;if(M&&N.selectionsAfter.length)return e.update({selection:N.selectionsAfter[N.selectionsAfter.length-1],annotations:qc.of({side:t,rest:jz(i),selection:o}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(N.changes){let M=1==i.length?lz:i.slice(0,i.length-1);return N.mapped&&(M=cz(M,N.mapped)),e.update({changes:N.changes,selection:N.startSelection,effects:N.effects,annotations:qc.of({side:t,rest:M,selection:o}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}Tz.empty=new Tz(lz,lz);const Oz=[{key:"Mod-z",run:Nz,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:oz,preventDefault:!0},{linux:"Ctrl-Shift-z",run:oz,preventDefault:!0},{key:"Mod-u",run:nz,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:sz,preventDefault:!0}];function yz(t,e){return Vo.create(t.ranges.map(e),t.mainIndex)}function dz(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Az({state:t,dispatch:e},M){let i=yz(t.selection,M);return!i.eq(t.selection,!0)&&(e(dz(t,i)),!0)}function hz(t,e){return Vo.cursor(e?t.to:t.from)}function Lz(t,e){return Az(t,(M=>M.empty?t.moveByChar(M,e):hz(M,e)))}function xz(t){return t.textDirectionAt(t.state.selection.main.head)==hr.LTR}const pz=t=>Lz(t,!xz(t)),Sz=t=>Lz(t,xz(t));function Qz(t,e){return Az(t,(M=>M.empty?t.moveByGroup(M,e):hz(M,e)))}function Ez(t,e,M){if(e.type.prop(M))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function kz(t,e,M){let i,N,o=yj(t).resolveInner(e.head),n=M?qu.closedBy:qu.openedBy;for(let i=e.head;;){let e=M?o.childAfter(i):o.childBefore(i);if(!e)break;Ez(t,e,n)?o=e:i=M?e.to:e.from}return N=o.type.prop(n)&&(i=M?fc(t,o.from,1):fc(t,o.to,-1))&&i.matched?M?i.end.to:i.end.from:M?o.to:o.from,Vo.cursor(N,M?-1:1)}function wz(t,e){return Az(t,(M=>{if(!M.empty)return hz(M,e);let i=t.moveVertically(M,e);return i.head!=M.head?i:t.moveToLineBoundary(M,e)}))}const mz=t=>wz(t,!1),Uz=t=>wz(t,!0);function Cz(t){let e,M=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,i=0,N=0;if(M){for(let e of t.state.facet(nl.scrollMargins)){let M=e(t);(null==M?void 0:M.top)&&(i=Math.max(null==M?void 0:M.top,i)),(null==M?void 0:M.bottom)&&(N=Math.max(null==M?void 0:M.bottom,N))}e=t.scrollDOM.clientHeight-i-N}else e=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:N,selfScroll:M,height:Math.max(t.defaultLineHeight,e-5)}}function fz(t,e){let M,i=Cz(t),{state:N}=t,o=yz(N.selection,(M=>M.empty?t.moveVertically(M,e,i.height):hz(M,e)));if(o.eq(N.selection))return!1;if(i.selfScroll){let e=t.coordsAtPos(N.selection.main.head),n=t.scrollDOM.getBoundingClientRect(),s=n.top+i.marginTop,r=n.bottom-i.marginBottom;e&&e.top>s&&e.bottom<r&&(M=nl.scrollIntoView(o.main.head,{y:"start",yMargin:e.top-s}))}return t.dispatch(dz(N,o),{effects:M}),!0}const bz=t=>fz(t,!1),Yz=t=>fz(t,!0);function vz(t,e,M){let i=t.lineBlockAt(e.head),N=t.moveToLineBoundary(e,M);if(N.head==e.head&&N.head!=(M?i.to:i.from)&&(N=t.moveToLineBoundary(e,M,!1)),!M&&N.head==i.from&&i.length){let M=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;M&&e.head!=i.from+M&&(N=Vo.cursor(i.from+M))}return N}function Zz(t,e){let M=yz(t.state.selection,(t=>{let M=e(t);return Vo.range(t.anchor,M.head,M.goalColumn,M.bidiLevel||void 0)}));return!M.eq(t.state.selection)&&(t.dispatch(dz(t.state,M)),!0)}function Vz(t,e){return Zz(t,(M=>t.moveByChar(M,e)))}const Wz=t=>Vz(t,!xz(t)),Pz=t=>Vz(t,xz(t));function Rz(t,e){return Zz(t,(M=>t.moveByGroup(M,e)))}function Gz(t,e){return Zz(t,(M=>t.moveVertically(M,e)))}const Bz=t=>Gz(t,!1),_z=t=>Gz(t,!0);function Fz(t,e){return Zz(t,(M=>t.moveVertically(M,e,Cz(t).height)))}const Jz=t=>Fz(t,!1),Hz=t=>Fz(t,!0),Xz=({state:t,dispatch:e})=>(e(dz(t,{anchor:0})),!0),$z=({state:t,dispatch:e})=>(e(dz(t,{anchor:t.doc.length})),!0),qz=({state:t,dispatch:e})=>(e(dz(t,{anchor:t.selection.main.anchor,head:0})),!0),Kz=({state:t,dispatch:e})=>(e(dz(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function tI(t,e){if(t.state.readOnly)return!1;let M="delete.selection",{state:i}=t,N=i.changeByRange((i=>{let{from:N,to:o}=i;if(N==o){let n=e(i);n<N?(M="delete.backward",n=eI(t,n,!1)):n>N&&(M="delete.forward",n=eI(t,n,!0)),N=Math.min(N,n),o=Math.max(o,n)}else N=eI(t,N,!1),o=eI(t,o,!0);return N==o?{range:i}:{changes:{from:N,to:o},range:Vo.cursor(N,N<i.head?-1:1)}}));return!N.changes.empty&&(t.dispatch(i.update(N,{scrollIntoView:!0,userEvent:M,effects:"delete.selection"==M?nl.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function eI(t,e,M){if(t instanceof nl)for(let i of t.state.facet(nl.atomicRanges).map((e=>e(t))))i.between(e,e,((t,i)=>{t<e&&i>e&&(e=M?i:t)}));return e}const MI=(t,e,M)=>tI(t,(i=>{let N,o,n=i.from,{state:s}=t,r=s.doc.lineAt(n);if(M&&!e&&n>r.from&&n<r.from+200&&!/[^ \t]/.test(N=r.text.slice(0,n-r.from))){if("\t"==N[N.length-1])return n-1;let t=Xn(N,s.tabSize)%Uj(s)||Uj(s);for(let e=0;e<t&&" "==N[N.length-1-e];e++)n--;o=n}else o=xo(r.text,n-r.from,e,e)+r.from,o==n&&r.number!=(e?s.doc.lines:1)?o+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(r.text.slice(o-r.from,n-r.from))&&(o=xo(r.text,o-r.from,!1,!1)+r.from);return o})),iI=t=>MI(t,!1,!0),NI=t=>MI(t,!0,!1),oI=(t,e)=>tI(t,(M=>{let i=M.head,{state:N}=t,o=N.doc.lineAt(i),n=N.charCategorizer(i);for(let t=null;;){if(i==(e?o.to:o.from)){i==M.head&&o.number!=(e?N.doc.lines:1)&&(i+=e?1:-1);break}let s=xo(o.text,i-o.from,e)+o.from,r=o.text.slice(Math.min(i,s)-o.from,Math.max(i,s)-o.from),D=n(r);if(null!=t&&D!=t)break;" "==r&&i==M.head||(t=D),i=s}return i})),nI=t=>oI(t,!1);function sI(t){let e=[],M=-1;for(let i of t.selection.ranges){let N=t.doc.lineAt(i.from),o=t.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=t.doc.lineAt(i.to-1)),M>=N.number){let t=e[e.length-1];t.to=o.to,t.ranges.push(i)}else e.push({from:N.from,to:o.to,ranges:[i]});M=o.number+1}return e}function rI(t,e,M){if(t.readOnly)return!1;let i=[],N=[];for(let e of sI(t)){if(M?e.to==t.doc.length:0==e.from)continue;let o=t.doc.lineAt(M?e.to+1:e.from-1),n=o.length+1;if(M){i.push({from:e.to,to:o.to},{from:e.from,insert:o.text+t.lineBreak});for(let M of e.ranges)N.push(Vo.range(Math.min(t.doc.length,M.anchor+n),Math.min(t.doc.length,M.head+n)))}else{i.push({from:o.from,to:e.from},{from:e.to,insert:t.lineBreak+o.text});for(let t of e.ranges)N.push(Vo.range(t.anchor-n,t.head-n))}}return!!i.length&&(e(t.update({changes:i,scrollIntoView:!0,selection:Vo.create(N,t.selection.mainIndex),userEvent:"move.line"})),!0)}function DI(t,e,M){if(t.readOnly)return!1;let i=[];for(let e of sI(t))M?i.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):i.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});return e(t.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const aI=uI(!1),lI=uI(!0);function uI(t){return({state:e,dispatch:M})=>{if(e.readOnly)return!1;let i=e.changeByRange((M=>{let{from:i,to:N}=M,o=e.doc.lineAt(i),n=!t&&i==N&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let M,i=yj(t).resolveInner(e),N=i.childBefore(e),o=i.childAfter(e);return N&&o&&N.to<=e&&o.from>=e&&(M=N.type.prop(qu.closedBy))&&M.indexOf(o.name)>-1&&t.doc.lineAt(N.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(N.to,o.from))?{from:N.to,to:o.from}:null}(e,i);t&&(i=N=(N<=o.to?o:e.doc.lineAt(N)).to);let s=new bj(e,{simulateBreak:i,simulateDoubleBreak:!!n}),r=fj(s,i);for(null==r&&(r=Xn(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));N<o.to&&/\s/.test(o.text[N-o.from]);)N++;n?({from:i,to:N}=n):i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let D=["",Cj(e,r)];return n&&D.push(Cj(e,s.lineIndent(o.from,-1))),{changes:{from:i,to:N,insert:jo.of(D)},range:Vo.cursor(i+1+D[1].length)}}));return M(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function gI(t,e){let M=-1;return t.changeByRange((i=>{let N=[];for(let o=i.from;o<=i.to;){let n=t.doc.lineAt(o);n.number>M&&(i.empty||i.to>n.from)&&(e(n,N,i),M=n.number),o=n.to+1}let o=t.changes(N);return{changes:N,range:Vo.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}}))}const jI=[{key:"Ctrl-b",run:pz,shift:Wz,preventDefault:!0},{key:"Ctrl-f",run:Sz,shift:Pz},{key:"Ctrl-p",run:mz,shift:Bz},{key:"Ctrl-n",run:Uz,shift:_z},{key:"Ctrl-a",run:t=>Az(t,(e=>Vo.cursor(t.lineBlockAt(e.head).from,1))),shift:t=>Zz(t,(e=>Vo.cursor(t.lineBlockAt(e.head).from)))},{key:"Ctrl-e",run:t=>Az(t,(e=>Vo.cursor(t.lineBlockAt(e.head).to,-1))),shift:t=>Zz(t,(e=>Vo.cursor(t.lineBlockAt(e.head).to)))},{key:"Ctrl-d",run:NI},{key:"Ctrl-h",run:iI},{key:"Ctrl-k",run:t=>tI(t,(e=>{let M=t.lineBlockAt(e.head).to;return e.head<M?M:Math.min(t.state.doc.length,e.head+1)}))},{key:"Ctrl-Alt-h",run:nI},{key:"Ctrl-o",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let M=t.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:jo.of(["",""])},range:Vo.cursor(t.from)})));return e(t.update(M,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let M=t.changeByRange((e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let M=e.from,i=t.doc.lineAt(M),N=M==i.from?M-1:xo(i.text,M-i.from,!1)+i.from,o=M==i.to?M+1:xo(i.text,M-i.from,!0)+i.from;return{changes:{from:N,to:o,insert:t.doc.slice(M,o).append(t.doc.slice(N,M))},range:Vo.cursor(o)}}));return!M.changes.empty&&(e(t.update(M,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Yz}],cI=[{key:"ArrowLeft",run:pz,shift:Wz,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>Qz(t,!xz(t)),shift:t=>Rz(t,!xz(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>Az(t,(e=>vz(t,e,!xz(t)))),shift:t=>Zz(t,(e=>vz(t,e,!xz(t)))),preventDefault:!0},{key:"ArrowRight",run:Sz,shift:Pz,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>Qz(t,xz(t)),shift:t=>Rz(t,xz(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>Az(t,(e=>vz(t,e,xz(t)))),shift:t=>Zz(t,(e=>vz(t,e,xz(t)))),preventDefault:!0},{key:"ArrowUp",run:mz,shift:Bz,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Xz,shift:qz},{mac:"Ctrl-ArrowUp",run:bz,shift:Jz},{key:"ArrowDown",run:Uz,shift:_z,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$z,shift:Kz},{mac:"Ctrl-ArrowDown",run:Yz,shift:Hz},{key:"PageUp",run:bz,shift:Jz},{key:"PageDown",run:Yz,shift:Hz},{key:"Home",run:t=>Az(t,(e=>vz(t,e,!1))),shift:t=>Zz(t,(e=>vz(t,e,!1))),preventDefault:!0},{key:"Mod-Home",run:Xz,shift:qz},{key:"End",run:t=>Az(t,(e=>vz(t,e,!0))),shift:t=>Zz(t,(e=>vz(t,e,!0))),preventDefault:!0},{key:"Mod-End",run:$z,shift:Kz},{key:"Enter",run:aI,shift:aI},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:iI,shift:iI},{key:"Delete",run:NI},{key:"Mod-Backspace",mac:"Alt-Backspace",run:nI},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>oI(t,!0)},{mac:"Mod-Backspace",run:t=>tI(t,(e=>{let M=t.moveToLineBoundary(e,!1).head;return e.head>M?M:Math.max(0,e.head-1)}))},{mac:"Mod-Delete",run:t=>tI(t,(e=>{let M=t.moveToLineBoundary(e,!0).head;return e.head<M?M:Math.min(t.state.doc.length,e.head+1)}))}].concat(jI.map((t=>({mac:t.key,run:t.run,shift:t.shift})))),zI=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:t=>Az(t,(e=>kz(t.state,e,!xz(t)))),shift:t=>Zz(t,(e=>kz(t.state,e,!xz(t))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>Az(t,(e=>kz(t.state,e,xz(t)))),shift:t=>Zz(t,(e=>kz(t.state,e,xz(t))))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>rI(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>DI(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>rI(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>DI(t,e,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let M=t.selection,i=null;return M.ranges.length>1?i=Vo.create([M.main]):M.main.empty||(i=Vo.create([Vo.cursor(M.main.head)])),!!i&&(e(dz(t,i)),!0)}},{key:"Mod-Enter",run:lI},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let M=sI(t).map((({from:e,to:M})=>Vo.range(e,Math.min(M+1,t.doc.length))));return e(t.update({selection:Vo.create(M),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let M=yz(t.selection,(e=>{let M=yj(t),i=M.resolveStack(e.from,1);if(e.empty){let t=M.resolveStack(e.from,-1);t.node.from>=i.node.from&&t.node.to<=i.node.to&&(i=t)}for(let t=i;t;t=t.next){let{node:M}=t;if((M.from<e.from&&M.to>=e.to||M.to>e.to&&M.from<=e.from)&&t.next)return Vo.range(M.to,M.from)}return e}));return!M.eq(t.selection)&&(e(dz(t,M)),!0)},preventDefault:!0},{key:"Mod-[",run:({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(gI(t,((e,M)=>{let i=/^\s*/.exec(e.text)[0];if(!i)return;let N=Xn(i,t.tabSize),o=0,n=Cj(t,Math.max(0,N-Uj(t)));for(;o<i.length&&o<n.length&&i.charCodeAt(o)==n.charCodeAt(o);)o++;M.push({from:e.from+o,to:e.from+i.length,insert:n.slice(o)})})),{userEvent:"delete.dedent"})),!0)},{key:"Mod-]",run:({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(gI(t,((e,M)=>{M.push({from:e.from,insert:t.facet(mj)})})),{userEvent:"input.indent"})),!0)},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let M=Object.create(null),i=new bj(t,{overrideIndentation:t=>{let e=M[t];return null==e?-1:e}}),N=gI(t,((e,N,o)=>{let n=fj(i,e.from);if(null==n)return;/\S/.test(e.text)||(n=0);let s=/^\s*/.exec(e.text)[0],r=Cj(t,n);(s!=r||o.from<e.from+s.length)&&(M[e.from]=n,N.push({from:e.from,to:e.from+s.length,insert:r}))}));return N.changes.empty||e(t.update(N,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:t=>{if(t.state.readOnly)return!1;let{state:e}=t,M=e.changes(sI(e).map((({from:t,to:M})=>(t>0?t--:M<e.doc.length&&M++,{from:t,to:M})))),i=yz(e.selection,(e=>{let M;if(t.lineWrapping){let i=t.lineBlockAt(e.head),N=t.coordsAtPos(e.head,e.assoc||1);N&&(M=i.bottom+t.documentTop-N.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,M)})).map(M);return t.dispatch({changes:M,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>function(t,e,M){let i=!1,N=yz(t.selection,(e=>{let N=fc(t,e.head,-1)||fc(t,e.head,1)||e.head>0&&fc(t,e.head-1,1)||e.head<t.doc.length&&fc(t,e.head+1,-1);if(!N||!N.end)return e;i=!0;let o=N.start.from==e.head?N.end.to:N.end.from;return M?Vo.range(e.anchor,o):Vo.cursor(o)}));return!!i&&(e(dz(t,N)),!0)}(t,e,!1)},{key:"Mod-/",run:t=>{let{state:e}=t,M=e.doc.lineAt(e.selection.main.from),i=Jc(t.state,M.from);return i.line?Bc(t):!!i.block&&Fc(t)}},{key:"Alt-A",run:_c},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat(cI);function II(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,M=arguments[1];if(M&&"object"==typeof M&&null==M.nodeType&&!Array.isArray(M)){for(var i in M)if(Object.prototype.hasOwnProperty.call(M,i)){var N=M[i];"string"==typeof N?t.setAttribute(i,N):null!=N&&(t[i]=N)}e++}for(;e<arguments.length;e++)TI(t,arguments[e]);return t}function TI(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var M=0;M<e.length;M++)TI(t,e[M])}}const OI="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class yI{constructor(t,e,M=0,i=t.length,N,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(M,i),this.bufferStart=M,this.normalize=N?t=>N(OI(t)):OI,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return po(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=So(t),M=this.bufferStart+this.bufferPos;this.bufferPos+=Qo(t);let i=this.normalize(e);if(i.length)for(let t=0,N=M;;t++){let o=i.charCodeAt(t),n=this.match(o,N,this.bufferPos+this.bufferStart);if(t==i.length-1){if(n)return this.value=n,this;break}N==M&&t<e.length&&e.charCodeAt(t)==o&&N++}}}match(t,e,M){let i=null;for(let e=0;e<this.matches.length;e+=2){let N=this.matches[e],o=!1;this.query.charCodeAt(N)==t&&(N==this.query.length-1?i={from:this.matches[e+1],to:M}:(this.matches[e]++,o=!0)),o||(this.matches.splice(e,2),e-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?i={from:e,to:M}:this.matches.push(1,e)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}"undefined"!=typeof Symbol&&(yI.prototype[Symbol.iterator]=function(){return this});const dI={from:-1,to:-1,match:/.*/.exec("")},AI="gm"+(null==/x/.unicode?"":"u");class hI{constructor(t,e,M,i=0,N=t.length){if(this.text=t,this.to=N,this.curLine="",this.done=!1,this.value=dI,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new pI(t,e,M,i,N);this.re=new RegExp(e,AI+((null==M?void 0:M.ignoreCase)?"i":"")),this.test=null==M?void 0:M.test,this.iter=t.iter();let o=t.lineAt(i);this.curLineStart=o.from,this.matchPos=SI(t,i),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let M=this.curLineStart+e.index,i=M+e[0].length;if(this.matchPos=SI(this.text,i+(M==i?1:0)),M==this.curLineStart+this.curLine.length&&this.nextLine(),(M<i||M>this.value.to)&&(!this.test||this.test(M,i,e)))return this.value={from:M,to:i,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),t=0}}}}const LI=new WeakMap;class xI{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,M){let i=LI.get(t);if(!i||i.from>=M||i.to<=e){let i=new xI(e,t.sliceString(e,M));return LI.set(t,i),i}if(i.from==e&&i.to==M)return i;let{text:N,from:o}=i;return o>e&&(N=t.sliceString(e,o)+N,o=e),i.to<M&&(N+=t.sliceString(i.to,M)),LI.set(t,new xI(o,N)),new xI(e,N.slice(e-o,M-o))}}class pI{constructor(t,e,M,i,N){this.text=t,this.to=N,this.done=!1,this.value=dI,this.matchPos=SI(t,i),this.re=new RegExp(e,AI+((null==M?void 0:M.ignoreCase)?"i":"")),this.test=null==M?void 0:M.test,this.flat=xI.get(t,i,this.chunkEnd(i+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,M=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,M,e)))return this.value={from:t,to:M,match:e},this.matchPos=SI(this.text,M+(t==M?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=xI.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function SI(t,e){if(e>=t.length)return e;let M,i=t.lineAt(e);for(;e<i.to&&(M=i.text.charCodeAt(e-i.from))>=56320&&M<57344;)e++;return e}function QI(t){let e=II("input",{class:"cm-textfield",name:"line",value:String(t.state.doc.lineAt(t.state.selection.main.head).number)});function M(){let M=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!M)return;let{state:i}=t,N=i.doc.lineAt(i.selection.main.head),[,o,n,s,r]=M,D=s?+s.slice(1):0,a=n?+n:N.number;if(n&&r){let t=a/100;o&&(t=t*("-"==o?-1:1)+N.number/i.doc.lines),a=Math.round(i.doc.lines*t)}else n&&o&&(a=a*("-"==o?-1:1)+N.number);let l=i.doc.line(Math.max(1,Math.min(i.doc.lines,a))),u=Vo.cursor(l.from+Math.max(0,Math.min(D,l.length)));t.dispatch({effects:[EI.of(!1),nl.scrollIntoView(u.from,{y:"center"})],selection:u}),t.focus()}return{dom:II("form",{class:"cm-gotoLine",onkeydown:e=>{27==e.keyCode?(e.preventDefault(),t.dispatch({effects:EI.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),M())},onsubmit:t=>{t.preventDefault(),M()}},II("label",t.state.phrase("Go to line"),": ",e)," ",II("button",{class:"cm-button",type:"submit"},t.state.phrase("go")))}}"undefined"!=typeof Symbol&&(hI.prototype[Symbol.iterator]=pI.prototype[Symbol.iterator]=function(){return this});const EI=yn.define(),kI=Xo.define({create:()=>!0,update(t,e){for(let M of e.effects)M.is(EI)&&(t=M.value);return t},provide:t=>xu.from(t,(t=>t?QI:null))}),wI=nl.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),mI={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},UI=Ro.define({combine:t=>Un(t,mI,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});const CI=lr.mark({class:"cm-selectionMatch"}),fI=lr.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function bI(t,e,M,i){return!(0!=M&&t(e.sliceDoc(M-1,M))==Qn.Word||i!=e.doc.length&&t(e.sliceDoc(i,i+1))==Qn.Word)}const YI=sD.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(UI),{state:M}=t,i=M.selection;if(i.ranges.length>1)return lr.none;let N,o=i.main,n=null;if(o.empty){if(!e.highlightWordAroundCursor)return lr.none;let t=M.wordAt(o.head);if(!t)return lr.none;n=M.charCategorizer(o.head),N=M.sliceDoc(t.from,t.to)}else{let t=o.to-o.from;if(t<e.minSelectionLength||t>200)return lr.none;if(e.wholeWords){if(N=M.sliceDoc(o.from,o.to),n=M.charCategorizer(o.head),!bI(n,M,o.from,o.to)||!function(t,e,M,i){return t(e.sliceDoc(M,M+1))==Qn.Word&&t(e.sliceDoc(i-1,i))==Qn.Word}(n,M,o.from,o.to))return lr.none}else if(N=M.sliceDoc(o.from,o.to),!N)return lr.none}let s=[];for(let i of t.visibleRanges){let t=new yI(M.doc,N,i.from,i.to);for(;!t.next().done;){let{from:i,to:N}=t.value;if((!n||bI(n,M,i,N))&&(o.empty&&i<=o.from&&N>=o.to?s.push(fI.range(i,N)):(i>=o.to||N<=o.from)&&s.push(CI.range(i,N)),s.length>e.maxMatches))return lr.none}}return lr.set(s)}},{decorations:t=>t.decorations}),vI=nl.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const ZI=Ro.define({combine:t=>Un(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new jT(t),scrollToMatch:t=>nl.scrollIntoView(t)})});class VI{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,AI),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,((t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"))}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new FI(this):new RI(this)}getCursor(t,e=0,M){let i=t.doc?t:mn.create({doc:t});return null==M&&(M=i.doc.length),this.regexp?GI(this,i,e,M):PI(this,i,e,M)}}class WI{constructor(t){this.spec=t}}function PI(t,e,M,i){return new yI(e.doc,t.unquoted,M,i,t.caseSensitive?void 0:t=>t.toLowerCase(),t.wholeWord?function(t,e){return(M,i,N,o)=>((o>M||o+N.length<i)&&(o=Math.max(0,M-2),N=t.sliceString(o,Math.min(t.length,i+2))),!(e(BI(N,M-o))==Qn.Word&&e(_I(N,M-o))==Qn.Word||e(_I(N,i-o))==Qn.Word&&e(BI(N,i-o))==Qn.Word))}(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}class RI extends WI{constructor(t){super(t)}nextMatch(t,e,M){let i=PI(this.spec,t,M,t.doc.length).nextOverlapping();if(i.done){let M=Math.min(t.doc.length,e+this.spec.unquoted.length);i=PI(this.spec,t,0,M).nextOverlapping()}return i.done||i.value.from==e&&i.value.to==M?null:i.value}prevMatchInRange(t,e,M){for(let i=M;;){let M=Math.max(e,i-1e4-this.spec.unquoted.length),N=PI(this.spec,t,M,i),o=null;for(;!N.nextOverlapping().done;)o=N.value;if(o)return o;if(M==e)return null;i-=1e4}}prevMatch(t,e,M){let i=this.prevMatchInRange(t,0,e);return i||(i=this.prevMatchInRange(t,Math.max(0,M-this.spec.unquoted.length),t.doc.length)),!i||i.from==e&&i.to==M?null:i}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let M=PI(this.spec,t,0,t.doc.length),i=[];for(;!M.next().done;){if(i.length>=e)return null;i.push(M.value)}return i}highlight(t,e,M,i){let N=PI(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(M+this.spec.unquoted.length,t.doc.length));for(;!N.next().done;)i(N.value.from,N.value.to)}}function GI(t,e,M,i){return new hI(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(N=e.charCategorizer(e.selection.main.head),(t,e,M)=>!M[0].length||(N(BI(M.input,M.index))!=Qn.Word||N(_I(M.input,M.index))!=Qn.Word)&&(N(_I(M.input,M.index+M[0].length))!=Qn.Word||N(BI(M.input,M.index+M[0].length))!=Qn.Word)):void 0},M,i);var N}function BI(t,e){return t.slice(xo(t,e,!1),e)}function _I(t,e){return t.slice(e,xo(t,e))}class FI extends WI{nextMatch(t,e,M){let i=GI(this.spec,t,M,t.doc.length).next();return i.done&&(i=GI(this.spec,t,0,e).next()),i.done?null:i.value}prevMatchInRange(t,e,M){for(let i=1;;i++){let N=Math.max(e,M-1e4*i),o=GI(this.spec,t,N,M),n=null;for(;!o.next().done;)n=o.value;if(n&&(N==e||n.from>N+10))return n;if(N==e)return null}}prevMatch(t,e,M){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,M,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((e,M)=>"$"==M?"$":"&"==M?t.match[0]:"0"!=M&&+M<t.match.length?t.match[M]:e))}matchAll(t,e){let M=GI(this.spec,t,0,t.doc.length),i=[];for(;!M.next().done;){if(i.length>=e)return null;i.push(M.value)}return i}highlight(t,e,M,i){let N=GI(this.spec,t,Math.max(0,e-250),Math.min(M+250,t.doc.length));for(;!N.next().done;)i(N.value.from,N.value.to)}}const JI=yn.define(),HI=yn.define(),XI=Xo.define({create:t=>new $I(rT(t).create(),null),update(t,e){for(let M of e.effects)M.is(JI)?t=new $I(M.value.create(),t.panel):M.is(HI)&&(t=new $I(t.query,M.value?sT:null));return t},provide:t=>xu.from(t,(t=>t.panel))});class $I{constructor(t,e){this.query=t,this.panel=e}}const qI=lr.mark({class:"cm-searchMatch"}),KI=lr.mark({class:"cm-searchMatch cm-searchMatch-selected"}),tT=sD.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(XI))}update(t){let e=t.state.field(XI);(e!=t.startState.field(XI)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return lr.none;let{view:M}=this,i=new Zn;for(let e=0,N=M.visibleRanges,o=N.length;e<o;e++){let{from:n,to:s}=N[e];for(;e<o-1&&s>N[e+1].from-500;)s=N[++e].to;t.highlight(M.state,n,s,((t,e)=>{let N=M.state.selection.ranges.some((M=>M.from==t&&M.to==e));i.add(t,e,N?KI:qI)}))}return i.finish()}},{decorations:t=>t.decorations});function eT(t){return e=>{let M=e.state.field(XI,!1);return M&&M.query.spec.valid?t(e,M):lT(e)}}const MT=eT(((t,{query:e})=>{let{to:M}=t.state.selection.main,i=e.nextMatch(t.state,M,M);if(!i)return!1;let N=Vo.single(i.from,i.to),o=t.state.facet(ZI);return t.dispatch({selection:N,effects:[TT(t,i),o.scrollToMatch(N.main,t)],userEvent:"select.search"}),aT(t),!0})),iT=eT(((t,{query:e})=>{let{state:M}=t,{from:i}=M.selection.main,N=e.prevMatch(M,i,i);if(!N)return!1;let o=Vo.single(N.from,N.to),n=t.state.facet(ZI);return t.dispatch({selection:o,effects:[TT(t,N),n.scrollToMatch(o.main,t)],userEvent:"select.search"}),aT(t),!0})),NT=eT(((t,{query:e})=>{let M=e.matchAll(t.state,1e3);return!(!M||!M.length)&&(t.dispatch({selection:Vo.create(M.map((t=>Vo.range(t.from,t.to)))),userEvent:"select.search.matches"}),!0)})),oT=eT(((t,{query:e})=>{let{state:M}=t,{from:i,to:N}=M.selection.main;if(M.readOnly)return!1;let o=e.nextMatch(M,i,i);if(!o)return!1;let n,s,r=o,D=[],a=[];if(r.from==i&&r.to==N&&(s=M.toText(e.getReplacement(r)),D.push({from:r.from,to:r.to,insert:s}),r=e.nextMatch(M,r.from,r.to),a.push(nl.announce.of(M.phrase("replaced match on line $",M.doc.lineAt(i).number)+"."))),r){let e=0==D.length||D[0].from>=o.to?0:o.to-o.from-s.length;n=Vo.single(r.from-e,r.to-e),a.push(TT(t,r)),a.push(M.facet(ZI).scrollToMatch(n.main,t))}return t.dispatch({changes:D,selection:n,effects:a,userEvent:"input.replace"}),!0})),nT=eT(((t,{query:e})=>{if(t.state.readOnly)return!1;let M=e.matchAll(t.state,1e9).map((t=>{let{from:M,to:i}=t;return{from:M,to:i,insert:e.getReplacement(t)}}));if(!M.length)return!1;let i=t.state.phrase("replaced $ matches",M.length)+".";return t.dispatch({changes:M,effects:nl.announce.of(i),userEvent:"input.replace.all"}),!0}));function sT(t){return t.state.facet(ZI).createPanel(t)}function rT(t,e){var M,i,N,o,n;let s=t.selection.main,r=s.empty||s.to>s.from+100?"":t.sliceDoc(s.from,s.to);if(e&&!r)return e;let D=t.facet(ZI);return new VI({search:(null!==(M=null==e?void 0:e.literal)&&void 0!==M?M:D.literal)?r:r.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==e?void 0:e.caseSensitive)&&void 0!==i?i:D.caseSensitive,literal:null!==(N=null==e?void 0:e.literal)&&void 0!==N?N:D.literal,regexp:null!==(o=null==e?void 0:e.regexp)&&void 0!==o?o:D.regexp,wholeWord:null!==(n=null==e?void 0:e.wholeWord)&&void 0!==n?n:D.wholeWord})}function DT(t){let e=du(t,sT);return e&&e.dom.querySelector("[main-field]")}function aT(t){let e=DT(t);e&&e==t.root.activeElement&&e.select()}const lT=t=>{let e=t.state.field(XI,!1);if(e&&e.panel){let M=DT(t);if(M&&M!=t.root.activeElement){let i=rT(t.state,e.query.spec);i.valid&&t.dispatch({effects:JI.of(i)}),M.focus(),M.select()}}else t.dispatch({effects:[HI.of(!0),e?JI.of(rT(t.state,e.query.spec)):yn.appendConfig.of(yT)]});return!0},uT=t=>{let e=t.state.field(XI,!1);if(!e||!e.panel)return!1;let M=du(t,sT);return M&&M.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:HI.of(!1)}),!0},gT=[{key:"Mod-f",run:lT,scope:"editor search-panel"},{key:"F3",run:MT,shift:iT,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:MT,shift:iT,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:uT,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:t,dispatch:e})=>{let M=t.selection;if(M.ranges.length>1||M.main.empty)return!1;let{from:i,to:N}=M.main,o=[],n=0;for(let e=new yI(t.doc,t.sliceDoc(i,N));!e.next().done;){if(o.length>1e3)return!1;e.value.from==i&&(n=o.length),o.push(Vo.range(e.value.from,e.value.to))}return e(t.update({selection:Vo.create(o,n),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:t=>{let e=du(t,QI);if(!e){let M=[EI.of(!0)];null==t.state.field(kI,!1)&&M.push(yn.appendConfig.of([kI,wI])),t.dispatch({effects:M}),e=du(t,QI)}return e&&e.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:t,dispatch:e})=>{let{ranges:M}=t.selection;if(M.some((t=>t.from===t.to)))return(({state:t,dispatch:e})=>{let{selection:M}=t,i=Vo.create(M.ranges.map((e=>t.wordAt(e.head)||Vo.cursor(e.head))),M.mainIndex);return!i.eq(M)&&(e(t.update({selection:i})),!0)})({state:t,dispatch:e});let i=t.sliceDoc(M[0].from,M[0].to);if(t.selection.ranges.some((e=>t.sliceDoc(e.from,e.to)!=i)))return!1;let N=function(t,e){let{main:M,ranges:i}=t.selection,N=t.wordAt(M.head),o=N&&N.from==M.from&&N.to==M.to;for(let M=!1,N=new yI(t.doc,e,i[i.length-1].to);;){if(N.next(),!N.done){if(M&&i.some((t=>t.from==N.value.from)))continue;if(o){let e=t.wordAt(N.value.from);if(!e||e.from!=N.value.from||e.to!=N.value.to)continue}return N.value}if(M)return null;N=new yI(t.doc,e,0,Math.max(0,i[i.length-1].from-1)),M=!0}}(t,i);return!!N&&(e(t.update({selection:t.selection.addRange(Vo.range(N.from,N.to),!1),effects:nl.scrollIntoView(N.to)})),!0)},preventDefault:!0}];class jT{constructor(t){this.view=t;let e=this.query=t.state.field(XI).query.spec;function M(t,e,M){return II("button",{class:"cm-button",name:t,onclick:e,type:"button"},M)}this.commit=this.commit.bind(this),this.searchField=II("input",{value:e.search,placeholder:cT(t,"Find"),"aria-label":cT(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=II("input",{value:e.replace,placeholder:cT(t,"Replace"),"aria-label":cT(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=II("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=II("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=II("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=II("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,M("next",(()=>MT(t)),[cT(t,"next")]),M("prev",(()=>iT(t)),[cT(t,"previous")]),M("select",(()=>NT(t)),[cT(t,"all")]),II("label",null,[this.caseField,cT(t,"match case")]),II("label",null,[this.reField,cT(t,"regexp")]),II("label",null,[this.wordField,cT(t,"by word")]),...t.state.readOnly?[]:[II("br"),this.replaceField,M("replace",(()=>oT(t)),[cT(t,"replace")]),M("replaceAll",(()=>nT(t)),[cT(t,"replace all")])],II("button",{name:"close",onclick:()=>uT(t),"aria-label":cT(t,"close"),type:"button"},["×"])])}commit(){let t=new VI({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:JI.of(t)}))}keydown(t){!function(t,e,M){return yl(zl(t.state),e,t,M)}(this.view,t,"search-panel")?13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?iT:MT)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),oT(this.view)):t.preventDefault()}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(JI)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ZI).top}}function cT(t,e){return t.state.phrase(e)}const zT=30,IT=/[\s\.,:;?!]/;function TT(t,{from:e,to:M}){let i=t.state.doc.lineAt(e),N=t.state.doc.lineAt(M).to,o=Math.max(i.from,e-zT),n=Math.min(N,M+zT),s=t.state.sliceDoc(o,n);if(o!=i.from)for(let t=0;t<zT;t++)if(!IT.test(s[t+1])&&IT.test(s[t])){s=s.slice(t);break}if(n!=N)for(let t=s.length-1;t>s.length-zT;t--)if(!IT.test(s[t-1])&&IT.test(s[t])){s=s.slice(0,t);break}return nl.announce.of(`${t.state.phrase("current match")}. ${s} ${t.state.phrase("on line")} ${i.number}.`)}const OT=nl.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),yT=[XI,Mn.low(tT),OT];class dT{constructor(t,e,M,i){this.state=t,this.pos=e,this.explicit=M,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=yj(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),M=Math.max(e.from,this.pos-250),i=e.text.slice(M-e.from,this.pos-e.from),N=i.search(ST(t,!1));return N<0?null:{from:M+N,to:this.pos,text:i.slice(N)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,M){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),M&&M.onDocChange&&(this.abortOnDocChange=!0))}}function AT(t){let e=Object.keys(t).join(""),M=/\w/.test(e);return M&&(e=e.replace(/\w/g,"")),`[${M?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function hT(t){let e=t.map((t=>"string"==typeof t?{label:t}:t)),[M,i]=e.every((t=>/^\w+$/.test(t.label)))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),M=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let t=1;t<i.length;t++)M[i[t]]=!0}let i=AT(e)+AT(M)+"*$";return[new RegExp("^"+i),new RegExp(i)]}(e);return t=>{let N=t.matchBefore(i);return N||t.explicit?{from:N?N.from:t.pos,options:e,validFor:M}:null}}function LT(t,e){return M=>{for(let e=yj(M.state).resolveInner(M.pos,-1);e;e=e.parent){if(t.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return e(M)}}class xT{constructor(t,e,M,i){this.completion=t,this.source=e,this.match=M,this.score=i}}function pT(t){return t.selection.main.from}function ST(t,e){var M;let{source:i}=t,N=e&&"^"!=i[0],o="$"!=i[i.length-1];return N||o?new RegExp(`${N?"^":""}(?:${i})${o?"$":""}`,null!==(M=t.flags)&&void 0!==M?M:t.ignoreCase?"i":""):t}const QT=In.define();const ET=new WeakMap;function kT(t){if(!Array.isArray(t))return t;let e=ET.get(t);return e||ET.set(t,e=hT(t)),e}const wT=yn.define(),mT=yn.define();class UT{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let M=po(t,e),i=Qo(M);this.chars.push(M);let N=t.slice(e,e+i),o=N.toUpperCase();this.folded.push(po(o==N?N.toLowerCase():o,0)),e+=i}this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(0==this.pattern.length)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:M,any:i,precise:N,byWord:o}=this;if(1==e.length){let i=po(t,0),N=Qo(i),o=N==t.length?0:-100;if(i==e[0]);else{if(i!=M[0])return null;o+=-200}return this.ret(o,[0,N])}let n=t.indexOf(this.pattern);if(0==n)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=e.length,r=0;if(n<0){for(let N=0,o=Math.min(t.length,200);N<o&&r<s;){let o=po(t,N);o!=e[r]&&o!=M[r]||(i[r++]=N),N+=Qo(o)}if(r<s)return null}let D=0,a=0,l=!1,u=0,g=-1,j=-1,c=/[a-z]/.test(t),z=!0;for(let i=0,r=Math.min(t.length,200),I=0;i<r&&a<s;){let r=po(t,i);n<0&&(D<s&&r==e[D]&&(N[D++]=i),u<s&&(r==e[u]||r==M[u]?(0==u&&(g=i),j=i+1,u++):u=0));let T,O=r<255?r>=48&&r<=57||r>=97&&r<=122?2:r>=65&&r<=90?1:0:(T=So(r))!=T.toLowerCase()?1:T!=T.toUpperCase()?2:0;(!i||1==O&&c||0==I&&0!=O)&&(e[a]==r||M[a]==r&&(l=!0)?o[a++]=i:o.length&&(z=!1)),I=O,i+=Qo(r)}return a==s&&0==o[0]&&z?this.result((l?-200:0)-100,o,t):u==s&&0==g?this.ret(-200-t.length+(j==t.length?0:-100),[0,j]):n>-1?this.ret(-700-t.length,[n,n+this.pattern.length]):u==s?this.ret(-900-t.length,[g,j]):a==s?this.result((l?-200:0)-100-700+(z?0:-1100),o,t):2==e.length?null:this.result((i[0]?-700:0)-200-1100,i,t)}result(t,e,M){let i=[],N=0;for(let t of e){let e=t+(this.astral?Qo(po(M,t)):1);N&&i[N-1]==t?i[N-1]=e:(i[N++]=t,i[N++]=e)}return this.ret(t-M.length,i)}}class CT{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),M=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return null==M?null:(this.matched=[0,e.length],this.score=M+(t.length==this.pattern.length?0:-100),this)}}const fT=Ro.define({combine:t=>Un(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:YT,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>M=>bT(t(M),e(M)),optionClass:(t,e)=>M=>bT(t(M),e(M)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function bT(t,e){return t?e?t+" "+e:t:e}function YT(t,e,M,i,N,o){let n,s,r=t.textDirection==hr.RTL,D=r,a=!1,l="top",u=e.left-N.left,g=N.right-e.right,j=i.right-i.left,c=i.bottom-i.top;if(D&&u<Math.min(j,g)?D=!1:!D&&g<Math.min(j,u)&&(D=!0),j<=(D?u:g))n=Math.max(N.top,Math.min(M.top,N.bottom-c))-e.top,s=Math.min(400,D?u:g);else{a=!0,s=Math.min(400,(r?e.right:N.right-e.left)-30);let t=N.bottom-e.bottom;t>=c||t>e.top?n=M.bottom-e.top:(l="bottom",n=e.bottom-M.top)}return{style:`${l}: ${n/((e.bottom-e.top)/o.offsetHeight)}px; max-width: ${s/((e.right-e.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(a?r?"left-narrow":"right-narrow":D?"left":"right")}}function vT(t,e,M){if(t<=M)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/M);return{from:t*M,to:(t+1)*M}}let i=Math.floor((t-e)/M);return{from:t-(i+1)*M,to:t-i*M}}class ZT{constructor(t,e,M){this.view=t,this.stateField=e,this.applyCompletion=M,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let i=t.state.field(e),{options:N,selected:o}=i.open,n=t.state.facet(fT);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map((t=>"cm-completionIcon-"+t))),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,M,i){let N=document.createElement("span");N.className="cm-completionLabel";let o=t.displayLabel||t.label,n=0;for(let t=0;t<i.length;){let e=i[t++],M=i[t++];e>n&&N.appendChild(document.createTextNode(o.slice(n,e)));let s=N.appendChild(document.createElement("span"));s.appendChild(document.createTextNode(o.slice(e,M))),s.className="cm-completionMatchedText",n=M}return n<o.length&&N.appendChild(document.createTextNode(o.slice(n))),N},position:50},{render(t){if(!t.detail)return null;let e=document.createElement("span");return e.className="cm-completionDetail",e.textContent=t.detail,e},position:80}),e.sort(((t,e)=>t.position-e.position)).map((t=>t.render))}(n),this.optionClass=n.optionClass,this.tooltipClass=n.tooltipClass,this.range=vT(N.length,o,n.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",(M=>{let{options:i}=t.state.field(e).open;for(let e,N=M.target;N&&N!=this.dom;N=N.parentNode)if("LI"==N.nodeName&&(e=/-(\d+)$/.exec(N.id))&&+e[1]<i.length)return this.applyCompletion(t,i[+e[1]]),void M.preventDefault()})),this.dom.addEventListener("focusout",(e=>{let M=t.state.field(this.stateField,!1);M&&M.tooltip&&t.state.facet(fT).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:mT.of(null)})})),this.showOptions(N,i.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(t){var e;let M=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),M!=i){let{options:N,selected:o,disabled:n}=M.open;i.open&&i.open.options==N||(this.range=vT(N.length,o,t.state.facet(fT).maxRenderedOptions),this.showOptions(N,M.id)),this.updateSel(),n!=(null===(e=i.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!n)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=vT(e.options.length,e.selected,this.view.state.facet(fT).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:M}=e.options[e.selected],{info:i}=M;if(!i)return;let N="string"==typeof i?document.createTextNode(i):i(M);if(!N)return;"then"in N?N.then((e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,M)})).catch((t=>iD(this.view.state,t,"completion info"))):this.addInfoPane(N,M)}}addInfoPane(t,e){this.destroyInfo();let M=this.info=document.createElement("div");if(M.className="cm-tooltip cm-completionInfo",null!=t.nodeType)M.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:i}=t;M.appendChild(e),this.infoDestroy=i||null}this.dom.appendChild(M),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let M=this.list.firstChild,i=this.range.from;M;M=M.nextSibling,i++)"LI"==M.nodeName&&M.id?i==t?M.hasAttribute("aria-selected")||(M.setAttribute("aria-selected","true"),e=M):M.hasAttribute("aria-selected")&&M.removeAttribute("aria-selected"):i--;return e&&function(t,e){let M=t.getBoundingClientRect(),i=e.getBoundingClientRect(),N=M.height/t.offsetHeight;i.top<M.top?t.scrollTop-=(M.top-i.top)/N:i.bottom>M.bottom&&(t.scrollTop+=(i.bottom-M.bottom)/N)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),M=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),N=this.space;if(!N){let t=this.dom.ownerDocument.defaultView||window;N={left:0,top:0,right:t.innerWidth,bottom:t.innerHeight}}return i.top>Math.min(N.bottom,e.bottom)-10||i.bottom<Math.max(N.top,e.top)+10?null:this.view.state.facet(fT).positionInfo(this.view,e,i,M,N,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,M){const i=document.createElement("ul");i.id=e,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let N=null;for(let o=M.from;o<M.to;o++){let{completion:n,match:s}=t[o],{section:r}=n;if(r){let t="string"==typeof r?r:r.name;if(t!=N&&(o>M.from||0==M.from))if(N=t,"string"!=typeof r&&r.header)i.appendChild(r.header(r));else{i.appendChild(document.createElement("completion-section")).textContent=t}}const D=i.appendChild(document.createElement("li"));D.id=e+"-"+o,D.setAttribute("role","option");let a=this.optionClass(n);a&&(D.className=a);for(let t of this.optionContent){let e=t(n,this.view.state,this.view,s);e&&D.appendChild(e)}}return M.from&&i.classList.add("cm-completionListIncompleteTop"),M.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function VT(t,e){return M=>new ZT(M,t,e)}function WT(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class PT{constructor(t,e,M,i,N,o){this.options=t,this.attrs=e,this.tooltip=M,this.timestamp=i,this.selected=N,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new PT(this.options,_T(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,M,i,N,o){if(i&&!o&&t.some((t=>t.isPending)))return i.setDisabled();let n=function(t,e){let M=[],i=null,N=t=>{M.push(t);let{section:e}=t.completion;if(e){i||(i=[]);let t="string"==typeof e?e:e.name;i.some((e=>e.name==t))||i.push("string"==typeof e?{name:t}:e)}},o=e.facet(fT);for(let i of t)if(i.hasResult()){let t=i.result.getMatch;if(!1===i.result.filter)for(let e of i.result.options)N(new xT(e,i.source,t?t(e):[],1e9-M.length));else{let M,n=e.sliceDoc(i.from,i.to),s=o.filterStrict?new CT(n):new UT(n);for(let e of i.result.options)if(M=s.match(e.label)){let o=e.displayLabel?t?t(e,M.matched):[]:M.matched;N(new xT(e,i.source,o,M.score+(e.boost||0)))}}}if(i){let t=Object.create(null),e=0,N=(t,e)=>{var M,i;return(null!==(M=t.rank)&&void 0!==M?M:1e9)-(null!==(i=e.rank)&&void 0!==i?i:1e9)||(t.name<e.name?-1:1)};for(let M of i.sort(N))e-=1e5,t[M.name]=e;for(let e of M){let{section:M}=e.completion;M&&(e.score+=t["string"==typeof M?M:M.name])}}let n=[],s=null,r=o.compareCompletions;for(let t of M.sort(((t,e)=>e.score-t.score||r(t.completion,e.completion)))){let e=t.completion;!s||s.label!=e.label||s.detail!=e.detail||null!=s.type&&null!=e.type&&s.type!=e.type||s.apply!=e.apply||s.boost!=e.boost?n.push(t):WT(t.completion)>WT(s)&&(n[n.length-1]=t),s=t.completion}return n}(t,e);if(!n.length)return i&&t.some((t=>t.isPending))?i.setDisabled():null;let s=e.facet(fT).selectOnOpen?0:-1;if(i&&i.selected!=s&&-1!=i.selected){let t=i.options[i.selected].completion;for(let e=0;e<n.length;e++)if(n[e].completion==t){s=e;break}}return new PT(n,_T(M,s),{pos:t.reduce(((t,e)=>e.hasResult()?Math.min(t,e.from):t),1e8),create:eO,above:N.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(t){return new PT(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new PT(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class RT{constructor(t,e,M){this.active=t,this.id=e,this.open=M}static start(){return new RT(FT,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,M=e.facet(fT),i=(M.override||e.languageDataAt("autocomplete",pT(e)).map(kT)).map((e=>{let i=this.active.find((t=>t.source==e))||new HT(e,this.active.some((t=>0!=t.state))?1:0);return i.update(t,M)}));i.length==this.active.length&&i.every(((t,e)=>t==this.active[e]))&&(i=this.active);let N=this.open,o=t.effects.some((t=>t.is($T)));N&&t.docChanged&&(N=N.map(t.changes)),t.selection||i.some((e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to)))||!function(t,e){if(t==e)return!0;for(let M=0,i=0;;){for(;M<t.length&&!t[M].hasResult();)M++;for(;i<e.length&&!e[i].hasResult();)i++;let N=M==t.length,o=i==e.length;if(N||o)return N==o;if(t[M++].result!=e[i++].result)return!1}}(i,this.active)||o?N=PT.build(i,e,this.id,N,M,o):N&&N.disabled&&!i.some((t=>t.isPending))&&(N=null),!N&&i.every((t=>!t.isPending))&&i.some((t=>t.hasResult()))&&(i=i.map((t=>t.hasResult()?new HT(t.source,0):t)));for(let e of t.effects)e.is(qT)&&(N=N&&N.setSelected(e.value,this.id));return i==this.active&&N==this.open?this:new RT(i,this.id,N)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?GT:BT}}const GT={"aria-autocomplete":"list"},BT={};function _T(t,e){let M={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(M["aria-activedescendant"]=t+"-"+e),M}const FT=[];function JT(t,e){if(t.isUserEvent("input.complete")){let M=t.annotation(QT);if(M&&e.activateOnCompletion(M))return 12}let M=t.isUserEvent("input.type");return M&&e.activateOnTyping?5:M?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class HT{constructor(t,e,M=!1){this.source=t,this.state=e,this.explicit=M}hasResult(){return!1}get isPending(){return 1==this.state}update(t,e){let M=JT(t,e),i=this;(8&M||16&M&&this.touches(t))&&(i=new HT(i.source,0)),4&M&&0==i.state&&(i=new HT(this.source,1)),i=i.updateFor(t,M);for(let e of t.effects)if(e.is(wT))i=new HT(i.source,1,e.value);else if(e.is(mT))i=new HT(i.source,0);else if(e.is($T))for(let t of e.value)t.source==i.source&&(i=t);return i}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(pT(t.state))}}class XT extends HT{constructor(t,e,M,i,N,o){super(t,3,e),this.limit=M,this.result=i,this.from=N,this.to=o}hasResult(){return!0}updateFor(t,e){var M;if(!(3&e))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let N=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),n=pT(t.state);if(n>o||!i||2&e&&(pT(t.startState)==this.from||n<this.limit))return new HT(this.source,4&e?1:0);let s=t.changes.mapPos(this.limit);return function(t,e,M,i){if(!t)return!1;let N=e.sliceDoc(M,i);return"function"==typeof t?t(N,M,i,e):ST(t,!0).test(N)}(i.validFor,t.state,N,o)?new XT(this.source,this.explicit,s,i,N,o):i.update&&(i=i.update(i,N,o,new dT(t.state,n,!1)))?new XT(this.source,this.explicit,s,i,i.from,null!==(M=i.to)&&void 0!==M?M:pT(t.state)):new HT(this.source,1,this.explicit)}map(t){if(t.empty)return this;return(this.result.map?this.result.map(this.result,t):this.result)?new XT(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new HT(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}const $T=yn.define({map:(t,e)=>t.map((t=>t.map(e)))}),qT=yn.define(),KT=Xo.define({create:()=>RT.start(),update:(t,e)=>t.update(e),provide:t=>[lu.from(t,(t=>t.tooltip)),nl.contentAttributes.from(t,(t=>t.attrs))]});function tO(t,e){const M=e.completion.apply||e.completion.label;let i=t.state.field(KT).active.find((t=>t.source==e.source));return i instanceof XT&&("string"==typeof M?t.dispatch(Object.assign(Object.assign({},function(t,e,M,i){let{main:N}=t.selection,o=M-N.from,n=i-N.from;return Object.assign(Object.assign({},t.changeByRange((s=>{if(s!=N&&M!=i&&t.sliceDoc(s.from+o,s.from+n)!=t.sliceDoc(M,i))return{range:s};let r=t.toText(e);return{changes:{from:s.from+o,to:i==N.from?s.to:s.from+n,insert:r},range:Vo.cursor(s.from+o+r.length)}}))),{scrollIntoView:!0,userEvent:"input.complete"})}(t.state,M,i.from,i.to)),{annotations:QT.of(e.completion)})):M(t,e.completion,i.from,i.to),!0)}const eO=VT(KT,tO);function MO(t,e="option"){return M=>{let i=M.state.field(KT,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<M.state.facet(fT).interactionDelay)return!1;let N,o=1;"page"==e&&(N=Tu(M,i.open.tooltip))&&(o=Math.max(2,Math.floor(N.dom.offsetHeight/N.dom.querySelector("li").offsetHeight)-1));let{length:n}=i.open.options,s=i.open.selected>-1?i.open.selected+o*(t?1:-1):t?0:n-1;return s<0?s="page"==e?0:n-1:s>=n&&(s="page"==e?n-1:0),M.dispatch({effects:qT.of(s)}),!0}}const iO=t=>{let e=t.state.field(KT,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(fT).interactionDelay)&&tO(t,e.open.options[e.open.selected])},NO=t=>!!t.state.field(KT,!1)&&(t.dispatch({effects:wT.of(!0)}),!0);class oO{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const nO=sD.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(KT).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(KT),M=t.state.facet(fT);if(!t.selectionSet&&!t.docChanged&&t.startState.field(KT)==e)return;let i=t.transactions.some((t=>{let e=JT(t,M);return 8&e||(t.selection||t.docChanged)&&!(3&e)}));for(let e=0;e<this.running.length;e++){let M=this.running[e];if(i||M.context.abortOnDocChange&&t.docChanged||M.updates.length+t.transactions.length>50&&Date.now()-M.time>1e3){for(let t of M.context.abortListeners)try{t()}catch(t){iD(this.view.state,t)}M.context.abortListeners=null,this.running.splice(e--,1)}else M.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some((t=>t.effects.some((t=>t.is(wT)))))&&(this.pendingStart=!0);let N=this.pendingStart?50:M.activateOnTypingDelay;if(this.debounceUpdate=e.active.some((t=>t.isPending&&!this.running.some((e=>e.active.source==t.source))))?setTimeout((()=>this.startUpdate()),N):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(KT);for(let t of e.active)t.isPending&&!this.running.some((e=>e.active.source==t.source))&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(fT).updateSyncTime))}startQuery(t){let{state:e}=this.view,M=pT(e),i=new dT(e,M,t.explicit,this.view),N=new oO(t,i);this.running.push(N),Promise.resolve(t.source(i)).then((t=>{N.context.aborted||(N.done=t||null,this.scheduleAccept())}),(t=>{this.view.dispatch({effects:mT.of(null)}),iD(this.view.state,t)}))}scheduleAccept(){this.running.every((t=>void 0!==t.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(fT).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],M=this.view.state.facet(fT),i=this.view.state.field(KT);for(let N=0;N<this.running.length;N++){let o=this.running[N];if(void 0===o.done)continue;if(this.running.splice(N--,1),o.done){let i=pT(o.updates.length?o.updates[0].startState:this.view.state),N=Math.min(i,o.done.from+(o.active.explicit?0:1)),n=new XT(o.active.source,o.active.explicit,N,o.done,o.done.from,null!==(t=o.done.to)&&void 0!==t?t:i);for(let t of o.updates)n=n.update(t,M);if(n.hasResult()){e.push(n);continue}}let n=i.active.find((t=>t.source==o.active.source));if(n&&n.isPending)if(null==o.done){let t=new HT(o.active.source,0);for(let e of o.updates)t=t.update(e,M);t.isPending||e.push(t)}else this.startQuery(n)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:$T.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(KT,!1);if(e&&e.tooltip&&this.view.state.facet(fT).closeOnBlur){let M=e.open&&Tu(this.view,e.open.tooltip);M&&M.dom.contains(t.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:mT.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:wT.of(!1)})),20),this.composing=0}}}),sO="object"==typeof navigator&&/Win/.test(navigator.platform),rO=Mn.highest(nl.domEventHandlers({keydown(t,e){let M=e.state.field(KT,!1);if(!M||!M.open||M.open.disabled||M.open.selected<0||t.key.length>1||t.ctrlKey&&(!sO||!t.altKey)||t.metaKey)return!1;let i=M.open.options[M.open.selected],N=M.active.find((t=>t.source==i.source)),o=i.completion.commitCharacters||N.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&tO(e,i),!1}})),DO=nl.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class aO{constructor(t,e,M,i){this.field=t,this.line=e,this.from=M,this.to=i}}class lO{constructor(t,e,M){this.field=t,this.from=e,this.to=M}map(t){let e=t.mapPos(this.from,-1,ko.TrackDel),M=t.mapPos(this.to,1,ko.TrackDel);return null==e||null==M?null:new lO(this.field,e,M)}}class uO{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let M=[],i=[e],N=t.doc.lineAt(e),o=/^\s*/.exec(N.text)[0];for(let N of this.lines){if(M.length){let M=o,n=/^\t*/.exec(N)[0].length;for(let e=0;e<n;e++)M+=t.facet(mj);i.push(e+M.length-n),N=M+N.slice(n)}M.push(N),e+=N.length+1}let n=this.fieldPositions.map((t=>new lO(t.field,i[t.line]+t.from,i[t.line]+t.to)));return{text:M,ranges:n}}static parse(t){let e,M=[],i=[],N=[];for(let o of t.split(/\r\n?|\n/)){for(;e=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let t=e[1]?+e[1]:null,n=e[2]||e[3]||"",s=-1,r=n.replace(/\\[{}]/g,(t=>t[1]));for(let e=0;e<M.length;e++)(null!=t?M[e].seq==t:r&&M[e].name==r)&&(s=e);if(s<0){let e=0;for(;e<M.length&&(null==t||null!=M[e].seq&&M[e].seq<t);)e++;M.splice(e,0,{seq:t,name:r}),s=e;for(let t of N)t.field>=s&&t.field++}N.push(new aO(s,i.length,e.index,e.index+r.length)),o=o.slice(0,e.index)+n+o.slice(e.index+e[0].length)}o=o.replace(/\\([{}])/g,((t,e,M)=>{for(let t of N)t.line==i.length&&t.from>M&&(t.from--,t.to--);return e})),i.push(o)}return new uO(i,N)}}let gO=lr.widget({widget:new class extends Dr{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),jO=lr.mark({class:"cm-snippetField"});class cO{constructor(t,e){this.ranges=t,this.active=e,this.deco=lr.set(t.map((t=>(t.from==t.to?gO:jO).range(t.from,t.to))))}map(t){let e=[];for(let M of this.ranges){let i=M.map(t);if(!i)return null;e.push(i)}return new cO(e,this.active)}selectionInsideField(t){return t.ranges.every((t=>this.ranges.some((e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))))}}const zO=yn.define({map:(t,e)=>t&&t.map(e)}),IO=yn.define(),TO=Xo.define({create:()=>null,update(t,e){for(let M of e.effects){if(M.is(zO))return M.value;if(M.is(IO)&&t)return new cO(t.ranges,M.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>nl.decorations.from(t,(t=>t?t.deco:lr.none))});function OO(t,e){return Vo.create(t.filter((t=>t.field==e)).map((t=>Vo.range(t.from,t.to))))}function yO(t){let e=uO.parse(t);return(t,M,i,N)=>{let{text:o,ranges:n}=e.instantiate(t.state,i),{main:s}=t.state.selection,r={changes:{from:i,to:N==s.from?s.to:N,insert:jo.of(o)},scrollIntoView:!0,annotations:M?[QT.of(M),dn.userEvent.of("input.complete")]:void 0};if(n.length&&(r.selection=OO(n,0)),n.some((t=>t.field>0))){let e=new cO(n,0),M=r.effects=[zO.of(e)];void 0===t.state.field(TO,!1)&&M.push(yn.appendConfig.of([TO,LO,pO,DO]))}t.dispatch(t.state.update(r))}}function dO(t){return({state:e,dispatch:M})=>{let i=e.field(TO,!1);if(!i||t<0&&0==i.active)return!1;let N=i.active+t,o=t>0&&!i.ranges.some((e=>e.field==N+t));return M(e.update({selection:OO(i.ranges,N),effects:zO.of(o?null:new cO(i.ranges,N)),scrollIntoView:!0})),!0}}const AO=[{key:"Tab",run:dO(1),shift:dO(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(TO,!1)&&(e(t.update({effects:zO.of(null)})),!0)}],hO=Ro.define({combine:t=>t.length?t[0]:AO}),LO=Mn.highest(jl.compute([hO],(t=>t.facet(hO))));function xO(t,e){return Object.assign(Object.assign({},e),{apply:yO(t)})}const pO=nl.domEventHandlers({mousedown(t,e){let M,i=e.state.field(TO,!1);if(!i||null==(M=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let N=i.ranges.find((t=>t.from<=M&&t.to>=M));return!(!N||N.field==i.active)&&(e.dispatch({selection:OO(i.ranges,N.field),effects:zO.of(i.ranges.some((t=>t.field>N.field))?new cO(i.ranges,N.field):null),scrollIntoView:!0}),!0)}}),SO={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},QO=yn.define({map(t,e){let M=e.mapPos(t,-1,ko.TrackAfter);return null==M?void 0:M}}),EO=new class extends Cn{};EO.startSide=1,EO.endSide=-1;const kO=Xo.define({create:()=>vn.empty,update(t,e){if(t=t.map(e.changes),e.selection){let M=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=M.from&&t<=M.to})}for(let M of e.effects)M.is(QO)&&(t=t.update({add:[EO.range(M.value,M.value+1)]}));return t}});const wO="()[]{}<>";function mO(t){for(let e=0;e<8;e+=2)if(wO.charCodeAt(e)==t)return wO.charAt(e+1);return So(t<128?t:t+1)}function UO(t,e){return t.languageDataAt("closeBrackets",e)[0]||SO}const CO="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),fO=nl.inputHandler.of(((t,e,M,i)=>{if((CO?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let N=t.state.selection.main;if(i.length>2||2==i.length&&1==Qo(po(i,0))||e!=N.from||M!=N.to)return!1;let o=function(t,e){let M=UO(t,t.selection.main.head),i=M.brackets||SO.brackets;for(let N of i){let o=mO(po(N,0));if(e==N)return o==N?WO(t,N,i.indexOf(N+N+N)>-1,M):ZO(t,N,o,M.before||SO.before);if(e==o&&YO(t,t.selection.main.from))return VO(t,N,o)}return null}(t.state,i);return!!o&&(t.dispatch(o),!0)})),bO=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let M=UO(t,t.selection.main.head).brackets||SO.brackets,i=null,N=t.changeByRange((e=>{if(e.empty){let i=function(t,e){let M=t.sliceString(e-2,e);return Qo(po(M,0))==M.length?M:M.slice(1)}(t.doc,e.head);for(let N of M)if(N==i&&vO(t.doc,e.head)==mO(po(N,0)))return{changes:{from:e.head-N.length,to:e.head+N.length},range:Vo.cursor(e.head-N.length)}}return{range:i=e}}));return i||e(t.update(N,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function YO(t,e){let M=!1;return t.field(kO).between(0,t.doc.length,(t=>{t==e&&(M=!0)})),M}function vO(t,e){let M=t.sliceString(e,e+2);return M.slice(0,Qo(po(M,0)))}function ZO(t,e,M,i){let N=null,o=t.changeByRange((o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:M,from:o.to}],effects:QO.of(o.to+e.length),range:Vo.range(o.anchor+e.length,o.head+e.length)};let n=vO(t.doc,o.head);return!n||/\s/.test(n)||i.indexOf(n)>-1?{changes:{insert:e+M,from:o.head},effects:QO.of(o.head+e.length),range:Vo.cursor(o.head+e.length)}:{range:N=o}}));return N?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function VO(t,e,M){let i=null,N=t.changeByRange((e=>e.empty&&vO(t.doc,e.head)==M?{changes:{from:e.head,to:e.head+M.length,insert:M},range:Vo.cursor(e.head+M.length)}:i={range:e}));return i?null:t.update(N,{scrollIntoView:!0,userEvent:"input.type"})}function WO(t,e,M,i){let N=i.stringPrefixes||SO.stringPrefixes,o=null,n=t.changeByRange((i=>{if(!i.empty)return{changes:[{insert:e,from:i.from},{insert:e,from:i.to}],effects:QO.of(i.to+e.length),range:Vo.range(i.anchor+e.length,i.head+e.length)};let n,s=i.head,r=vO(t.doc,s);if(r==e){if(PO(t,s))return{changes:{insert:e+e,from:s},effects:QO.of(s+e.length),range:Vo.cursor(s+e.length)};if(YO(t,s)){let i=M&&t.sliceDoc(s,s+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:s,to:s+i.length,insert:i},range:Vo.cursor(s+i.length)}}}else{if(M&&t.sliceDoc(s-2*e.length,s)==e+e&&(n=RO(t,s-2*e.length,N))>-1&&PO(t,n))return{changes:{insert:e+e+e+e,from:s},effects:QO.of(s+e.length),range:Vo.cursor(s+e.length)};if(t.charCategorizer(s)(r)!=Qn.Word&&RO(t,s,N)>-1&&!function(t,e,M,i){let N=yj(t).resolveInner(e,-1),o=i.reduce(((t,e)=>Math.max(t,e.length)),0);for(let n=0;n<5;n++){let n=t.sliceDoc(N.from,Math.min(N.to,N.from+M.length+o)),s=n.indexOf(M);if(!s||s>-1&&i.indexOf(n.slice(0,s))>-1){let e=N.firstChild;for(;e&&e.from==N.from&&e.to-e.from>M.length+s;){if(t.sliceDoc(e.to-M.length,e.to)==M)return!1;e=e.firstChild}return!0}let r=N.to==e&&N.parent;if(!r)break;N=r}return!1}(t,s,e,N))return{changes:{insert:e+e,from:s},effects:QO.of(s+e.length),range:Vo.cursor(s+e.length)}}return{range:o=i}}));return o?null:t.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function PO(t,e){let M=yj(t).resolveInner(e+1);return M.parent&&M.from==e}function RO(t,e,M){let i=t.charCategorizer(e);if(i(t.sliceDoc(e-1,e))!=Qn.Word)return e;for(let N of M){let M=e-N.length;if(t.sliceDoc(M,e)==N&&i(t.sliceDoc(M-1,M))!=Qn.Word)return M}return-1}function GO(t={}){return[rO,KT,fT.of(t),nO,_O,DO]}const BO=[{key:"Ctrl-Space",run:NO},{mac:"Alt-`",run:NO},{key:"Escape",run:t=>{let e=t.state.field(KT,!1);return!(!e||!e.active.some((t=>0!=t.state)))&&(t.dispatch({effects:mT.of(null)}),!0)}},{key:"ArrowDown",run:MO(!0)},{key:"ArrowUp",run:MO(!1)},{key:"PageDown",run:MO(!0,"page")},{key:"PageUp",run:MO(!1,"page")},{key:"Enter",run:iO}],_O=Mn.highest(jl.computeN([fT],(t=>t.facet(fT).defaultKeymap?[BO]:[])));class FO{constructor(t,e,M){this.from=t,this.to=e,this.diagnostic=M}}class JO{constructor(t,e,M){this.diagnostics=t,this.panel=e,this.selected=M}static init(t,e,M){let i=t,N=M.facet(oy).markerFilter;N&&(i=N(i,M));let o=t.slice().sort(((t,e)=>t.from-e.from||t.to-e.to)),n=new Zn,s=[],r=0;for(let t=0;;){let e,i,N=t==o.length?null:o[t];if(!N&&!s.length)break;for(s.length?(e=r,i=s.reduce(((t,e)=>Math.min(t,e.to)),N&&N.from>e?N.from:1e8)):(e=N.from,i=N.to,s.push(N),t++);t<o.length;){let M=o[t];if(M.from!=e||!(M.to>M.from||M.to==e)){i=Math.min(M.from,i);break}s.push(M),t++,i=Math.min(M.to,i)}let D=jy(s);if(s.some((t=>t.from==t.to||t.from==t.to-1&&M.doc.lineAt(t.from).to==t.from)))n.add(e,e,lr.widget({widget:new ry(D),diagnostics:s.slice()}));else{let t=s.reduce(((t,e)=>e.markClass?t+" "+e.markClass:t),"");n.add(e,i,lr.mark({class:"cm-lintRange cm-lintRange-"+D+t,diagnostics:s.slice(),inclusiveEnd:s.some((t=>t.to>i))}))}r=i;for(let t=0;t<s.length;t++)s[t].to<=r&&s.splice(t--,1)}let D=n.finish();return new JO(D,e,HO(D))}}function HO(t,e=null,M=0){let i=null;return t.between(M,1e9,((t,M,{spec:N})=>{if(!(e&&N.diagnostics.indexOf(e)<0))if(i){if(N.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new FO(i.from,M,i.diagnostic)}else i=new FO(t,M,e||N.diagnostics[0])})),i}const XO=yn.define(),$O=yn.define(),qO=yn.define(),KO=Xo.define({create:()=>new JO(lr.none,null,null),update(t,e){if(e.docChanged&&t.diagnostics.size){let M=t.diagnostics.map(e.changes),i=null,N=t.panel;if(t.selected){let N=e.changes.mapPos(t.selected.from,1);i=HO(M,t.selected.diagnostic,N)||HO(M,null,N)}!M.size&&N&&e.state.facet(oy).autoPanel&&(N=null),t=new JO(M,N,i)}for(let M of e.effects)if(M.is(XO)){let i=e.state.facet(oy).autoPanel?M.value.length?ay.open:null:t.panel;t=JO.init(M.value,i,e.state)}else M.is($O)?t=new JO(t.diagnostics,M.value?ay.open:null,t.selected):M.is(qO)&&(t=new JO(t.diagnostics,t.panel,M.value));return t},provide:t=>[xu.from(t,(t=>t.panel)),nl.decorations.from(t,(t=>t.diagnostics))]}),ty=lr.mark({class:"cm-lintRange cm-lintRange-active"});function ey(t,e,M){let i,{diagnostics:N}=t.state.field(KO),o=-1,n=-1;N.between(e-(M<0?1:0),e+(M>0?1:0),((t,N,{spec:s})=>{if(e>=t&&e<=N&&(t==N||(e>t||M>0)&&(e<N||M<0)))return i=s.diagnostics,o=t,n=N,!1}));let s=t.state.facet(oy).tooltipFilter;return i&&s&&(i=s(i,t.state)),i?{pos:o,end:n,above:t.state.doc.lineAt(o).to<n,create:()=>({dom:My(t,i)})}:null}function My(t,e){return II("ul",{class:"cm-tooltip-lint"},e.map((e=>sy(t,e,!1))))}const iy=t=>{let e=t.state.field(KO,!1);return!(!e||!e.panel)&&(t.dispatch({effects:$O.of(!1)}),!0)},Ny=[{key:"Mod-Shift-m",run:t=>{let e=t.state.field(KO,!1);var M,i;e&&e.panel||t.dispatch({effects:(M=t.state,i=[$O.of(!0)],M.field(KO,!1)?i:i.concat(yn.appendConfig.of(cy)))});let N=du(t,ay.open);return N&&N.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(KO,!1);if(!e)return!1;let M=t.state.selection.main,i=e.diagnostics.iter(M.to+1);return!(!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==M.from&&i.to==M.to))&&(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)}}],oy=Ro.define({combine:t=>Object.assign({sources:t.map((t=>t.source)).filter((t=>null!=t))},Un(t.map((t=>t.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(t,e)=>t?e?M=>t(M)||e(M):t:e}))});function ny(t){let e=[];if(t)t:for(let{name:M}of t){for(let t=0;t<M.length;t++){let i=M[t];if(/[a-zA-Z]/.test(i)&&!e.some((t=>t.toLowerCase()==i.toLowerCase()))){e.push(i);continue t}}e.push("")}return e}function sy(t,e,M){var i;let N=M?ny(e.actions):[];return II("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},II("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(i=e.actions)||void 0===i?void 0:i.map(((M,i)=>{let o=!1,n=i=>{if(i.preventDefault(),o)return;o=!0;let N=HO(t.state.field(KO).diagnostics,e);N&&M.apply(t,N.from,N.to)},{name:s}=M,r=N[i]?s.indexOf(N[i]):-1,D=r<0?s:[s.slice(0,r),II("u",s.slice(r,r+1)),s.slice(r+1)];return II("button",{type:"button",class:"cm-diagnosticAction",onclick:n,onmousedown:n,"aria-label":` Action: ${s}${r<0?"":` (access key "${N[i]})"`}.`},D)})),e.source&&II("div",{class:"cm-diagnosticSource"},e.source))}class ry extends Dr{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return II("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Dy{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=sy(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ay{constructor(t){this.view=t,this.items=[];this.list=II("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e=>{if(27==e.keyCode)iy(this.view),this.view.focus();else if(38==e.keyCode||33==e.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==e.keyCode||34==e.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==e.keyCode)this.moveSelection(0);else if(35==e.keyCode)this.moveSelection(this.items.length-1);else if(13==e.keyCode)this.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:M}=this.items[this.selectedIndex],i=ny(M.actions);for(let N=0;N<i.length;N++)if(i[N].toUpperCase().charCodeAt(0)==e.keyCode){let e=HO(this.view.state.field(KO).diagnostics,M);e&&M.actions[N].apply(t,e.from,e.to)}}}e.preventDefault()},onclick:t=>{for(let e=0;e<this.items.length;e++)this.items[e].dom.contains(t.target)&&this.moveSelection(e)}}),this.dom=II("div",{class:"cm-panel-lint"},this.list,II("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>iy(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(KO).selected;if(!t)return-1;for(let e=0;e<this.items.length;e++)if(this.items[e].diagnostic==t.diagnostic)return e;return-1}update(){let{diagnostics:t,selected:e}=this.view.state.field(KO),M=0,i=!1,N=null,o=new Set;for(t.between(0,this.view.state.doc.length,((t,n,{spec:s})=>{for(let t of s.diagnostics){if(o.has(t))continue;o.add(t);let n,s=-1;for(let e=M;e<this.items.length;e++)if(this.items[e].diagnostic==t){s=e;break}s<0?(n=new Dy(this.view,t),this.items.splice(M,0,n),i=!0):(n=this.items[s],s>M&&(this.items.splice(M,s-M),i=!0)),e&&n.diagnostic==e.diagnostic?n.dom.hasAttribute("aria-selected")||(n.dom.setAttribute("aria-selected","true"),N=n):n.dom.hasAttribute("aria-selected")&&n.dom.removeAttribute("aria-selected"),M++}}));M<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new Dy(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),N?(this.list.setAttribute("aria-activedescendant",N.id),this.view.requestMeasure({key:this,read:()=>({sel:N.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:t,panel:e})=>{let M=e.height/this.list.offsetHeight;t.top<e.top?this.list.scrollTop-=(e.top-t.top)/M:t.bottom>e.bottom&&(this.list.scrollTop+=(t.bottom-e.bottom)/M)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function e(){let e=t;t=e.nextSibling,e.remove()}for(let M of this.items)if(M.dom.parentNode==this.list){for(;t!=M.dom;)e();t=M.dom.nextSibling}else this.list.insertBefore(M.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=HO(this.view.state.field(KO).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:qO.of(e)})}static open(t){return new ay(t)}}function ly(t){return function(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const uy=nl.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:ly("#d11")},".cm-lintRange-warning":{backgroundImage:ly("orange")},".cm-lintRange-info":{backgroundImage:ly("#999")},".cm-lintRange-hint":{backgroundImage:ly("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function gy(t){return"error"==t?4:"warning"==t?3:"info"==t?2:1}function jy(t){let e="hint",M=1;for(let i of t){let t=gy(i.severity);t>M&&(M=t,e=i.severity)}return e}const cy=[KO,nl.decorations.compute([KO],(t=>{let{selected:e,panel:M}=t.field(KO);return e&&M&&e.from!=e.to?lr.set([ty.range(e.from,e.to)]):lr.none})),Iu(ey,{hideOn:function(t,e){let M=e.pos,i=e.end||M,N=t.state.facet(oy).hideOn(t,M,i);if(null!=N)return N;let o=t.startState.doc.lineAt(e.pos);return!(!t.effects.some((t=>t.is(XO)))&&!t.changes.touchesRange(o.from,Math.max(o.to,i)))}}),uy];class zy{constructor(t,e,M,i,N,o,n,s,r,D=0,a){this.p=t,this.stack=e,this.state=M,this.reducePos=i,this.pos=N,this.score=o,this.buffer=n,this.bufferBase=s,this.curContext=r,this.lookAhead=D,this.parent=a}toString(){return`[${this.stack.filter(((t,e)=>e%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,M=0){let i=t.parser.context;return new zy(t,[],e,M,M,0,[],0,i?new Iy(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let M=t>>19,i=65535&t,{parser:N}=this.p,o=this.reducePos<this.pos-25;o&&this.setLookAhead(this.pos);let n=N.dynamicPrecedence(i);if(n&&(this.score+=n),0==M)return this.pushState(N.getGoto(this.state,i,!0),this.reducePos),i<N.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),void this.reduceContext(i,this.reducePos);let s=this.stack.length-3*(M-1)-(262144&t?6:0),r=s?this.stack[s-2]:this.p.ranges[0].from,D=this.reducePos-r;D>=2e3&&!(null===(e=this.p.parser.nodeSet.types[i])||void 0===e?void 0:e.isAnonymous)&&(r==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=D):this.p.lastBigReductionSize<D&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=r,this.p.lastBigReductionSize=D));let a=s?this.stack[s-1]:0,l=this.bufferBase+this.buffer.length-a;if(i<N.minRepeatTerm||131072&t){let t=N.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,r,t,l+4,!0)}if(262144&t)this.state=this.stack[s];else{let t=this.stack[s-3];this.state=N.getGoto(t,i,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(i,r)}storeNode(t,e,M,i=4,N=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let t=this,i=this.buffer.length;if(0==i&&t.parent&&(i=t.bufferBase-t.parent.bufferBase,t=t.parent),i>0&&0==t.buffer[i-4]&&t.buffer[i-1]>-1){if(e==M)return;if(t.buffer[i-2]>=e)return void(t.buffer[i-2]=M)}}if(N&&this.pos!=M){let N=this.buffer.length;if(N>0&&0!=this.buffer[N-4]){let t=!1;for(let e=N;e>0&&this.buffer[e-2]>M;e-=4)if(this.buffer[e-1]>=0){t=!0;break}if(t)for(;N>0&&this.buffer[N-2]>M;)this.buffer[N]=this.buffer[N-4],this.buffer[N+1]=this.buffer[N-3],this.buffer[N+2]=this.buffer[N-2],this.buffer[N+3]=this.buffer[N-1],N-=4,i>4&&(i-=4)}this.buffer[N]=t,this.buffer[N+1]=e,this.buffer[N+2]=M,this.buffer[N+3]=i}else this.buffer.push(t,e,M,i)}shift(t,e,M,i){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=i,this.shiftContext(e,M),e<=this.p.parser.maxNode&&this.buffer.push(e,M,i,4);else{let N=t,{parser:o}=this.p;(i>this.pos||e<=o.maxNode)&&(this.pos=i,o.stateFlag(N,1)||(this.reducePos=i)),this.pushState(N,M),this.shiftContext(e,M),e<=o.maxNode&&this.buffer.push(e,M,i,4)}}apply(t,e,M,i){65536&t?this.reduce(t):this.shift(t,e,M,i)}useNode(t,e){let M=this.p.reused.length-1;(M<0||this.p.reused[M]!=t)&&(this.p.reused.push(t),M++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(M,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let M=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new zy(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,M,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let M=t<=this.p.parser.maxNode;M&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,M?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new Ty(this);;){let M=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==M)return!1;if(!(65536&M))return!0;e.reduce(M)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let M=[];for(let i,N=0;N<e.length;N+=2)(i=e[N+1])!=this.state&&this.p.parser.hasAction(i,t)&&M.push(e[N],i);if(this.stack.length<120)for(let t=0;M.length<8&&t<e.length;t+=2){let i=e[t+1];M.some(((t,e)=>1&e&&t==i))||M.push(e[t],i)}e=M}let M=[];for(let t=0;t<e.length&&M.length<4;t+=2){let i=e[t+1];if(i==this.state)continue;let N=this.split();N.pushState(i,this.pos),N.storeNode(0,N.pos,N.pos,4,!0),N.shiftContext(e[t],this.pos),N.reducePos=this.pos,N.score-=200,M.push(N)}return M}forceReduce(){let{parser:t}=this.p,e=t.stateSlot(this.state,5);if(!(65536&e))return!1;if(!t.validAction(this.state,e)){let M=e>>19,i=65535&e,N=this.stack.length-3*M;if(N<0||t.getGoto(this.stack[N],i,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],M=(i,N)=>{if(!e.includes(i))return e.push(i),t.allActions(i,(e=>{if(393216&e);else if(65536&e){let M=(e>>19)-N;if(M>1){let i=65535&e,N=this.stack.length-3*M;if(N>=0&&t.getGoto(this.stack[N],i,!1)>=0)return M<<19|65536|i}}else{let t=M(e,N+1);if(null!=t)return t}}))};return M(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||-3!=this.buffer[t])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||-4!=this.buffer[t])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new Iy(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){t>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Iy{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class Ty{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,M=t>>19;0==M?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(M-1);let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class Oy{constructor(t,e,M){this.stack=t,this.pos=e,this.index=M,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new Oy(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new Oy(this.stack,this.pos,this.index)}}function yy(t,e=Uint16Array){if("string"!=typeof t)return t;let M=null;for(let i=0,N=0;i<t.length;){let o=0;for(;;){let e=t.charCodeAt(i++),M=!1;if(126==e){o=65535;break}e>=92&&e--,e>=34&&e--;let N=e-32;if(N>=46&&(N-=46,M=!0),o+=N,M)break;o*=46}M?M[N++]=o:M=new e(o)}return M}class dy{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ay=new dy;class hy{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ay,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let M=this.range,i=this.rangeIndex,N=this.pos+t;for(;N<M.from;){if(!i)return null;let t=this.ranges[--i];N-=M.from-t.to,M=t}for(;e<0?N>M.to:N>=M.to;){if(i==this.ranges.length-1)return null;let t=this.ranges[++i];N+=t.from-M.to,M=t}return N}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e,M,i=this.chunkOff+t;if(i>=0&&i<this.chunk.length)e=this.pos+t,M=this.chunk.charCodeAt(i);else{let i=this.resolveOffset(t,1);if(null==i)return-1;if(e=i,e>=this.chunk2Pos&&e<this.chunk2Pos+this.chunk2.length)M=this.chunk2.charCodeAt(e-this.chunk2Pos);else{let t=this.rangeIndex,i=this.range;for(;i.to<=e;)i=this.ranges[++t];this.chunk2=this.input.chunk(this.chunk2Pos=e),e+this.chunk2.length>i.to&&(this.chunk2=this.chunk2.slice(0,i.to-e)),M=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),M}acceptToken(t,e=0){let M=e?this.resolveOffset(e,-1):this.pos;if(null==M||M<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=M}acceptTokenTo(t,e){this.token.value=t,this.token.end=e}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),e=this.pos+t.length;this.chunk=e>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=Ay,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let M="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(M+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return M}}class Ly{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:M}=e.p;Sy(this.data,t,e,this.id,M.data,M.tokenPrecTable)}}Ly.prototype.contextual=Ly.prototype.fallback=Ly.prototype.extend=!1;class xy{constructor(t,e,M){this.precTable=e,this.elseToken=M,this.data="string"==typeof t?yy(t):t}token(t,e){let M=t.pos,i=0;for(;;){let M=t.next<0,N=t.resolveOffset(1,1);if(Sy(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(null==this.elseToken)return;if(M||i++,null==N)break;t.reset(N,t.token)}i&&(t.reset(M,t.token),t.acceptToken(this.elseToken,i))}}xy.prototype.contextual=Ly.prototype.fallback=Ly.prototype.extend=!1;class py{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function Sy(t,e,M,i,N,o){let n=0,s=1<<i,{dialect:r}=M.p.parser;t:for(;s&t[n];){let M=t[n+1];for(let i=n+3;i<M;i+=2)if((t[i+1]&s)>0){let M=t[i];if(r.allows(M)&&(-1==e.token.value||e.token.value==M||Ey(M,e.token.value,N,o))){e.acceptToken(M);break}}let i=e.next,D=0,a=t[n+2];if(!(e.next<0&&a>D&&65535==t[M+3*a-3])){for(;D<a;){let N=D+a>>1,o=M+N+(N<<1),s=t[o],r=t[o+1]||65536;if(i<s)a=N;else{if(!(i>=r)){n=t[o+2],e.advance();continue t}D=N+1}}break}n=t[M+3*a-1]}}function Qy(t,e,M){for(let i,N=e;65535!=(i=t[N]);N++)if(i==M)return N-e;return-1}function Ey(t,e,M,i){let N=Qy(M,i,e);return N<0||Qy(M,i,t)<N}const ky="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let wy=null;function my(t,e,M){let i=t.cursor(og.IncludeAnonymous);for(i.moveTo(e);;)if(!(M<0?i.childBefore(e):i.childAfter(e)))for(;;){if((M<0?i.to<e:i.from>e)&&!i.type.isError)return M<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(M<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return M<0?0:t.length}}class Uy{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?my(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?my(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let M=this.trees[e],i=this.index[e];if(i==M.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let N=M.children[i],o=this.start[e]+M.positions[i];if(o>t)return this.nextStart=o,null;if(N instanceof ng){if(o==t){if(o<this.safeFrom)return null;let t=o+N.length;if(t<=this.safeTo){let e=N.prop(qu.lookAhead);if(!e||t+e<this.fragment.to)return N}}this.index[e]++,o+N.length>=Math.max(this.safeFrom,t)&&(this.trees.push(N),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+N.length}}}class Cy{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((t=>new dy))}getActions(t){let e=0,M=null,{parser:i}=t.p,{tokenizers:N}=i,o=i.stateSlot(t.state,3),n=t.curContext?t.curContext.hash:0,s=0;for(let i=0;i<N.length;i++){if(!(1<<i&o))continue;let r=N[i],D=this.tokens[i];if((!M||r.fallback)&&((r.contextual||D.start!=t.pos||D.mask!=o||D.context!=n)&&(this.updateCachedToken(D,r,t),D.mask=o,D.context=n),D.lookAhead>D.end+25&&(s=Math.max(D.lookAhead,s)),0!=D.value)){let i=e;if(D.extended>-1&&(e=this.addActions(t,D.extended,D.end,e)),e=this.addActions(t,D.value,D.end,e),!r.extend&&(M=D,e>i))break}}for(;this.actions.length>e;)this.actions.pop();return s&&t.setLookAhead(s),M||t.pos!=this.stream.end||(M=new dy,M.value=t.p.parser.eofTerm,M.start=M.end=t.pos,e=this.addActions(t,M.value,M.end,e)),this.mainToken=M,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new dy,{pos:M,p:i}=t;return e.start=M,e.end=Math.min(M+1,i.stream.end),e.value=M==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,M){let i=this.stream.clipPos(M.pos);if(e.token(this.stream.reset(i,t),M),t.value>-1){let{parser:e}=M.p;for(let i=0;i<e.specialized.length;i++)if(e.specialized[i]==t.value){let N=e.specializers[i](this.stream.read(t.start,t.end),M);if(N>=0&&M.p.parser.dialect.allows(N>>1)){1&N?t.extended=N>>1:t.value=N>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,M,i){for(let e=0;e<i;e+=3)if(this.actions[e]==t)return i;return this.actions[i++]=t,this.actions[i++]=e,this.actions[i++]=M,i}addActions(t,e,M,i){let{state:N}=t,{parser:o}=t.p,{data:n}=o;for(let t=0;t<2;t++)for(let s=o.stateSlot(N,t?2:1);;s+=3){if(65535==n[s]){if(1!=n[s+1]){0==i&&2==n[s+1]&&(i=this.putAction(Wy(n,s+2),e,M,i));break}s=Wy(n,s+2)}n[s]==e&&(i=this.putAction(Wy(n,s+1),e,M,i))}return i}}class fy{constructor(t,e,M,i){this.parser=t,this.input=e,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new hy(e,i),this.tokens=new Cy(t,this.stream),this.topTerm=t.top[1];let{from:N}=i[0];this.stacks=[zy.start(this,t.top[0],N)],this.fragments=M.length&&this.stream.end-N>4*t.bufferLength?new Uy(M,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,M=this.stacks,i=this.minStackPos,N=this.stacks=[];if(this.bigReductionCount>300&&1==M.length){let[t]=M;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<M.length;o++){let n=M[o];for(;;){if(this.tokens.mainToken=null,n.pos>i)N.push(n);else{if(this.advanceStack(n,N,M))continue;{t||(t=[],e=[]),t.push(n);let M=this.tokens.getMainToken(n);e.push(M.value,M.end)}}break}}if(!N.length){let e=t&&function(t){let e=null;for(let M of t){let t=M.p.stoppedAt;(M.pos==M.p.stream.end||null!=t&&M.pos>t)&&M.p.parser.stateFlag(M.state,2)&&(!e||e.score<M.score)&&(e=M)}return e}(t);if(e)return ky&&console.log("Finish with "+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw ky&&t&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&t){let M=null!=this.stoppedAt&&t[0].pos>this.stoppedAt?t[0]:this.runRecovery(t,e,N);if(M)return ky&&console.log("Force-finish "+this.stackID(M)),this.stackToTree(M.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(N.length>t)for(N.sort(((t,e)=>e.score-t.score));N.length>t;)N.pop();N.some((t=>t.reducePos>i))&&this.recovering--}else if(N.length>1){t:for(let t=0;t<N.length-1;t++){let e=N[t];for(let M=t+1;M<N.length;M++){let i=N[M];if(e.sameState(i)||e.buffer.length>500&&i.buffer.length>500){if(!((e.score-i.score||e.buffer.length-i.buffer.length)>0)){N.splice(t--,1);continue t}N.splice(M--,1)}}}N.length>12&&N.splice(12,N.length-12)}this.minStackPos=N[0].pos;for(let t=1;t<N.length;t++)N[t].pos<this.minStackPos&&(this.minStackPos=N[t].pos);return null}stopAt(t){if(null!=this.stoppedAt&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,M){let i=t.pos,{parser:N}=this,o=ky?this.stackID(t)+" -> ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,M=e?t.curContext.hash:0;for(let n=this.fragments.nodeAt(i);n;){let i=this.parser.nodeSet.types[n.type.id]==n.type?N.getGoto(t.state,n.type.id):-1;if(i>-1&&n.length&&(!e||(n.prop(qu.contextHash)||0)==M))return t.useNode(n,i),ky&&console.log(o+this.stackID(t)+` (via reuse of ${N.getName(n.type.id)})`),!0;if(!(n instanceof ng)||0==n.children.length||n.positions[0]>0)break;let s=n.children[0];if(!(s instanceof ng&&0==n.positions[0]))break;n=s}}let n=N.stateSlot(t.state,4);if(n>0)return t.reduce(n),ky&&console.log(o+this.stackID(t)+` (via always-reduce ${N.getName(65535&n)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let s=this.tokens.getActions(t);for(let n=0;n<s.length;){let r=s[n++],D=s[n++],a=s[n++],l=n==s.length||!M,u=l?t:t.split(),g=this.tokens.mainToken;if(u.apply(r,D,g?g.start:u.pos,a),ky&&console.log(o+this.stackID(u)+` (via ${65536&r?`reduce of ${N.getName(65535&r)}`:"shift"} for ${N.getName(D)} @ ${i}${u==t?"":", split"})`),l)return!0;u.pos>i?e.push(u):M.push(u)}return!1}advanceFully(t,e){let M=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>M)return by(t,e),!0}}runRecovery(t,e,M){let i=null,N=!1;for(let o=0;o<t.length;o++){let n=t[o],s=e[o<<1],r=e[1+(o<<1)],D=ky?this.stackID(n)+" -> ":"";if(n.deadEnd){if(N)continue;if(N=!0,n.restart(),ky&&console.log(D+this.stackID(n)+" (restarted)"),this.advanceFully(n,M))continue}let a=n.split(),l=D;for(let t=0;a.forceReduce()&&t<10;t++){if(ky&&console.log(l+this.stackID(a)+" (via force-reduce)"),this.advanceFully(a,M))break;ky&&(l=this.stackID(a)+" -> ")}for(let t of n.recoverByInsert(s))ky&&console.log(D+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,M);this.stream.end>n.pos?(r==n.pos&&(r++,s=0),n.recoverByDelete(s,r),ky&&console.log(D+this.stackID(n)+` (via recover-delete ${this.parser.getName(s)})`),by(n,M)):(!i||i.score<n.score)&&(i=n)}return i}stackToTree(t){return t.close(),ng.build({buffer:Oy.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(wy||(wy=new WeakMap)).get(t);return e||wy.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function by(t,e){for(let M=0;M<e.length;M++){let i=e[M];if(i.pos==t.pos&&i.sameState(t))return void(e[M].score<t.score&&(e[M]=t))}e.push(t)}class Yy{constructor(t,e,M){this.source=t,this.flags=e,this.disabled=M}allows(t){return!this.disabled||0==this.disabled[t]}}const vy=t=>t;class Zy{constructor(t){this.start=t.start,this.shift=t.shift||vy,this.reduce=t.reduce||vy,this.reuse=t.reuse||vy,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}class Vy extends pg{constructor(t){if(super(),this.wrappers=[],14!=t.version)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let M=0;M<t.repeatNodeCount;M++)e.push("");let M=Object.keys(t.topRules).map((e=>t.topRules[e][1])),i=[];for(let t=0;t<e.length;t++)i.push([]);function N(t,e,M){i[t].push([e,e.deserialize(String(M))])}if(t.nodeProps)for(let e of t.nodeProps){let t=e[0];"string"==typeof t&&(t=qu[t]);for(let M=1;M<e.length;){let i=e[M++];if(i>=0)N(i,t,e[M++]);else{let o=e[M+-i];for(let n=-i;n>0;n--)N(e[M++],t,o);M++}}}this.nodeSet=new Mg(e.map(((e,N)=>eg.define({name:N>=this.minRepeatTerm?void 0:e,id:N,props:i[N],top:M.indexOf(N)>-1,error:0==N,skipped:t.skippedNodes&&t.skippedNodes.indexOf(N)>-1})))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=Hu;let o=yy(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t<this.specializerSpecs.length;t++)this.specialized[t]=this.specializerSpecs[t].term;this.specializers=this.specializerSpecs.map(Py),this.states=yy(t.states,Uint32Array),this.data=yy(t.stateData),this.goto=yy(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map((t=>"number"==typeof t?new Ly(o,t):t)),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,M){let i=new fy(this,t,e,M);for(let N of this.wrappers)i=N(i,t,e,M);return i}getGoto(t,e,M=!1){let i=this.goto;if(e>=i[0])return-1;for(let N=i[e+1];;){let e=i[N++],o=1&e,n=i[N++];if(o&&M)return n;for(let M=N+(e>>1);N<M;N++)if(i[N]==t)return n;if(o)return-1}}hasAction(t,e){let M=this.data;for(let i=0;i<2;i++)for(let N,o=this.stateSlot(t,i?2:1);;o+=3){if(65535==(N=M[o])){if(1!=M[o+1]){if(2==M[o+1])return Wy(M,o+2);break}N=M[o=Wy(M,o+2)]}if(N==e||0==N)return Wy(M,o+1)}return 0}stateSlot(t,e){return this.states[6*t+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){return!!this.allActions(t,(t=>t==e||null))}allActions(t,e){let M=this.stateSlot(t,4),i=M?e(M):void 0;for(let M=this.stateSlot(t,1);null==i;M+=3){if(65535==this.data[M]){if(1!=this.data[M+1])break;M=Wy(this.data,M+2)}i=e(Wy(this.data,M+1))}return i}nextStates(t){let e=[];for(let M=this.stateSlot(t,1);;M+=3){if(65535==this.data[M]){if(1!=this.data[M+1])break;M=Wy(this.data,M+2)}if(!(1&this.data[M+2])){let t=this.data[M+1];e.some(((e,M)=>1&M&&e==t))||e.push(this.data[M],t)}}return e}configure(t){let e=Object.assign(Object.create(Vy.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let M=this.topRules[t.top];if(!M)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=M}return t.tokenizers&&(e.tokenizers=this.tokenizers.map((e=>{let M=t.tokenizers.find((t=>t.from==e));return M?M.to:e}))),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map(((M,i)=>{let N=t.specializers.find((t=>t.from==M.external));if(!N)return M;let o=Object.assign(Object.assign({},M),{external:N.to});return e.specializers[i]=Py(o),o}))),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),M=e.map((()=>!1));if(t)for(let i of t.split(" ")){let t=e.indexOf(i);t>=0&&(M[t]=!0)}let i=null;for(let t=0;t<e.length;t++)if(!M[t])for(let M,N=this.dialects[e[t]];65535!=(M=this.data[N++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[M]=1;return new Yy(t,M,i)}static deserialize(t){return new Vy(t)}}function Wy(t,e){return t[e]|t[e+1]<<16}function Py(t){if(t.external){let e=t.extend?1:0;return(M,i)=>t.external(M,i)<<1|e}return t.get}const Ry=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Gy=new Zy({start:!1,shift:(t,e)=>5==e||6==e||318==e?t:319==e,strict:!1}),By=new py(((t,e)=>{let{next:M}=t;(125==M||-1==M||e.context)&&t.acceptToken(316)}),{contextual:!0,fallback:!0}),_y=new py(((t,e)=>{let M,{next:i}=t;Ry.indexOf(i)>-1||(47!=i||47!=(M=t.peek(1))&&42!=M)&&(125==i||59==i||-1==i||e.context||t.acceptToken(314))}),{contextual:!0}),Fy=new py(((t,e)=>{91!=t.next||e.context||t.acceptToken(315)}),{contextual:!0}),Jy=new py(((t,e)=>{let{next:M}=t;if(43==M||45==M){if(t.advance(),M==t.next){t.advance();let M=!e.context&&e.canShift(1);t.acceptToken(M?1:2)}}else 63==M&&46==t.peek(1)&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(3))}),{contextual:!0});function Hy(t,e){return t>=65&&t<=90||t>=97&&t<=122||95==t||t>=192||!e&&t>=48&&t<=57}const Xy=new py(((t,e)=>{if(60!=t.next||!e.dialectEnabled(0))return;if(t.advance(),47==t.next)return;let M=0;for(;Ry.indexOf(t.next)>-1;)t.advance(),M++;if(Hy(t.next,!0)){for(t.advance(),M++;Hy(t.next,!1);)t.advance(),M++;for(;Ry.indexOf(t.next)>-1;)t.advance(),M++;if(44==t.next)return;for(let e=0;;e++){if(7==e){if(!Hy(t.next,!0))return;break}if(t.next!="extends".charCodeAt(e))break;t.advance(),M++}}t.acceptToken(4,-M)})),$y=Bg({"get set async static":uj.modifier,"for while do if else switch try catch finally return throw break continue default case":uj.controlKeyword,"in of await yield void typeof delete instanceof":uj.operatorKeyword,"let var const using function class extends":uj.definitionKeyword,"import export from":uj.moduleKeyword,"with debugger as new":uj.keyword,TemplateString:uj.special(uj.string),super:uj.atom,BooleanLiteral:uj.bool,this:uj.self,null:uj.null,Star:uj.modifier,VariableName:uj.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":uj.function(uj.variableName),VariableDefinition:uj.definition(uj.variableName),Label:uj.labelName,PropertyName:uj.propertyName,PrivatePropertyName:uj.special(uj.propertyName),"CallExpression/MemberExpression/PropertyName":uj.function(uj.propertyName),"FunctionDeclaration/VariableDefinition":uj.function(uj.definition(uj.variableName)),"ClassDeclaration/VariableDefinition":uj.definition(uj.className),"NewExpression/VariableName":uj.className,PropertyDefinition:uj.definition(uj.propertyName),PrivatePropertyDefinition:uj.definition(uj.special(uj.propertyName)),UpdateOp:uj.updateOperator,"LineComment Hashbang":uj.lineComment,BlockComment:uj.blockComment,Number:uj.number,String:uj.string,Escape:uj.escape,ArithOp:uj.arithmeticOperator,LogicOp:uj.logicOperator,BitOp:uj.bitwiseOperator,CompareOp:uj.compareOperator,RegExp:uj.regexp,Equals:uj.definitionOperator,Arrow:uj.function(uj.punctuation),": Spread":uj.punctuation,"( )":uj.paren,"[ ]":uj.squareBracket,"{ }":uj.brace,"InterpolationStart InterpolationEnd":uj.special(uj.brace),".":uj.derefOperator,", ;":uj.separator,"@":uj.meta,TypeName:uj.typeName,TypeDefinition:uj.definition(uj.typeName),"type enum interface implements namespace module declare":uj.definitionKeyword,"abstract global Privacy readonly override":uj.modifier,"is keyof unique infer asserts":uj.operatorKeyword,JSXAttributeValue:uj.attributeValue,JSXText:uj.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":uj.angleBracket,"JSXIdentifier JSXNameSpacedName":uj.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":uj.attributeName,"JSXBuiltin/JSXIdentifier":uj.standard(uj.tagName)}),qy={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,const:52,extends:56,this:60,true:68,false:68,null:80,void:84,typeof:88,super:104,new:138,delete:150,yield:159,await:163,class:168,public:231,private:231,protected:231,readonly:233,instanceof:252,satisfies:255,in:256,import:290,keyof:347,unique:351,infer:357,asserts:393,is:395,abstract:415,implements:417,type:419,let:422,var:424,using:427,interface:433,enum:437,namespace:443,module:445,declare:449,global:453,for:472,of:481,while:484,with:488,do:492,if:496,else:498,switch:502,case:508,try:514,catch:518,finally:522,return:526,throw:530,break:534,continue:538,debugger:542},Ky={__proto__:null,async:125,get:127,set:129,declare:191,public:193,private:193,protected:193,static:195,abstract:197,override:199,readonly:205,accessor:207,new:399},td={__proto__:null,"<":189},ed=Vy.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D_O.QQlO'#DeO.bQlO'#DpO%[QlO'#DxO0fQlO'#EQOOQ!0Lf'#EY'#EYO1PQ`O'#EVOOQO'#En'#EnOOQO'#Ij'#IjO1XQ`O'#GrO1dQ`O'#EmO1iQ`O'#EmO3hQ!0MxO'#JpO6[Q!0MxO'#JqO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#F{O9UQ`O'#FzOOQ!0Lf'#Jq'#JqOOQ!0Lb'#Jp'#JpO9ZQ`O'#GvOOQ['#K]'#K]O9fQ`O'#IWO9kQ!0LrO'#IXOOQ['#J^'#J^OOQ['#I]'#I]Q`QlOOQ`QlOOO9sQ!L^O'#DtO9zQlO'#D|O:RQlO'#EOO9aQ`O'#GrO:YQMhO'#CoO:hQ`O'#ElO:sQ`O'#EwO:xQMhO'#FdO;gQ`O'#GrOOQO'#K^'#K^O;lQ`O'#K^O;zQ`O'#GzO;zQ`O'#G{O;zQ`O'#G}O9aQ`O'#HQO<qQ`O'#HTO>YQ`O'#CeO>jQ`O'#HaO>rQ`O'#HgO>rQ`O'#HiO`QlO'#HkO>rQ`O'#HmO>rQ`O'#HpO>wQ`O'#HvO>|Q!0LsO'#H|O%[QlO'#IOO?XQ!0LsO'#IQO?dQ!0LsO'#ISO9kQ!0LrO'#IUO?oQ!0MxO'#CiO@qQpO'#DjQOQ`OOO%[QlO'#EOOAXQ`O'#ERO:YQMhO'#ElOAdQ`O'#ElOAoQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Do'#DoOOQ!0Lb'#J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+ZQ3Q.UU3R.V.W.YS6x3S3TR9T6yd#^W#W#Z%g(R([*W+W.O/hr#gZm#h#i#l%d(f(g(h+Z.U.V.W.Y3S3T6yS*Z$x*_Q/o*[Q1|,jQ2d-QQ4W/kQ6g2[Q7i4XQ8{6hT=_'V+XV#aW%g*WU#`W%g*WS(S#W([U(X#Z+W/hS-V'V+XT-y(R.OV'[!e%h*XQ$lfR)v$qT)k$l)lR3}/PT*]$x*_T*e${*WQ0q+cQ1_,QQ3V.aQ5j1aQ5u1iQ6}3ZQ8g5xQ9W6|Q:Q8fQ:d9VQ:|:SQ;U:fQ;`:}R;c;VnqOXst!Z#d%l&p&r&s&u,n,s2S2VQ&j!VR,c&gtmOXst!U!V!Z#d%l&g&p&r&s&u,n,s2S2VR,j&mT%km,jR1c,SR,b&eQ&T|R+z&UR+p&OT&n!W&qT&o!W&qT2U,s2V",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:378,context:Gy,nodeProps:[["isolate",-8,5,6,14,35,37,49,51,53,""],["group",-26,9,17,19,66,206,210,214,215,217,220,223,233,235,241,243,245,247,250,256,262,264,266,268,270,272,273,"Statement",-34,13,14,30,33,34,40,49,52,53,55,60,68,70,74,78,80,82,83,108,109,118,119,135,138,140,141,142,143,144,146,147,166,168,170,"Expression",-23,29,31,35,39,41,43,172,174,176,177,179,180,181,183,184,185,187,188,189,200,202,204,205,"Type",-3,86,101,107,"ClassItem"],["openedBy",23,"<",36,"InterpolationStart",54,"[",58,"{",71,"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,92:1,168:1,198:1},specialized:[{term:325,get:t=>qy[t]||-1},{term:341,get:t=>Ky[t]||-1},{term:93,get:t=>td[t]||-1}],tokenPrec:15116}),Md=[xO("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),xO("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),xO("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),xO("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),xO("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),xO("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),xO("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),xO("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),xO("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),xO('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),xO('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],id=Md.concat([xO("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),xO("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),xO("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Nd=new Lg,od=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function nd(t){return(e,M)=>{let i=e.node.getChild("VariableDefinition");return i&&M(i,t),!0}}const sd=["FunctionDeclaration"],rd={FunctionDeclaration:nd("function"),ClassDeclaration:nd("class"),ClassExpression:()=>!0,EnumDeclaration:nd("constant"),TypeAliasDeclaration:nd("type"),NamespaceDeclaration:nd("namespace"),VariableDefinition(t,e){t.matchContext(sd)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function Dd(t,e){let M=Nd.get(e);if(M)return M;let i=[],N=!0;function o(e,M){let N=t.sliceString(e.from,e.to);i.push({label:N,type:M})}return e.cursor(og.IncludeAnonymous).iterate((e=>{if(N)N=!1;else if(e.name){let t=rd[e.name];if(t&&t(e,o)||od.has(e.name))return!1}else if(e.to-e.from>8192){for(let M of Dd(t,e.node))i.push(M);return!1}})),Nd.set(e,i),i}const ad=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,ld=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function ud(t){let e=yj(t.state).resolveInner(t.pos,-1);if(ld.indexOf(e.name)>-1)return null;let M="VariableName"==e.name||e.to-e.from<20&&ad.test(t.state.sliceDoc(e.from,e.to));if(!M&&!t.explicit)return null;let i=[];for(let M=e;M;M=M.parent)od.has(M.name)&&(i=i.concat(Dd(t.state.doc,M)));return{options:i,from:M?e.from:t.pos,validFor:ad}}const gd=Oj.define({name:"javascript",parser:ed.configure({props:[Yj.add({IfStatement:_j({except:/^\s*({|else\b)/}),TryStatement:_j({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Bj,SwitchBody:t=>{let e=t.textAfter,M=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return t.baseIndent+(M?0:i?1:2)*t.unit},Block:Rj({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":_j({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),Jj.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Hj,BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),jd={test:t=>/^JSX/.test(t.name),facet:cj({commentTokens:{block:{open:"{/*",close:"*/}"}}})},cd=gd.configure({dialect:"ts"},"typescript"),zd=gd.configure({dialect:"jsx",props:[zj.add((t=>t.isTop?[jd]:void 0))]}),Id=gd.configure({dialect:"jsx ts",props:[zj.add((t=>t.isTop?[jd]:void 0))]},"typescript");let Td=t=>({label:t,type:"keyword"});const Od="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Td),yd=Od.concat(["declare","implements","private","protected","public"].map(Td));function dd(t,e,M=t.length){for(let i=null==e?void 0:e.firstChild;i;i=i.nextSibling)if("JSXIdentifier"==i.name||"JSXBuiltin"==i.name||"JSXNamespacedName"==i.name||"JSXMemberExpression"==i.name)return t.sliceString(i.from,Math.min(i.to,M));return""}const Ad="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),hd=nl.inputHandler.of(((t,e,M,i,N)=>{if((Ad?t.composing:t.compositionStarted)||t.state.readOnly||e!=M||">"!=i&&"/"!=i||!gd.isActiveAt(t.state,e,-1))return!1;let o=N(),{state:n}=o,s=n.changeByRange((t=>{var e;let M,{head:N}=t,o=yj(n).resolveInner(N-1,-1);if("JSXStartTag"==o.name&&(o=o.parent),n.doc.sliceString(N-1,N)!=i||"JSXAttributeValue"==o.name&&o.to>N);else{if(">"==i&&"JSXFragmentTag"==o.name)return{range:t,changes:{from:N,insert:"</>"}};if("/"==i&&"JSXStartCloseTag"==o.name){let t=o.parent,i=t.parent;if(i&&t.from==N-2&&((M=dd(n.doc,i.firstChild,N))||"JSXFragmentTag"==(null===(e=i.firstChild)||void 0===e?void 0:e.name))){let t=`${M}>`;return{range:Vo.cursor(N+t.length,-1),changes:{from:N,insert:t}}}}else if(">"==i){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(o);if(e&&!/^\/?>|^<\//.test(n.doc.sliceString(N,N+2))&&(M=dd(n.doc,e,N)))return{range:t,changes:{from:N,insert:`</${M}>`}}}}return{range:t}}));return!s.changes.empty&&(t.dispatch([o,n.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));function Ld(t){return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}function xd(t,e,M){for(let i=!1;;){if(t.next<0)return;if(t.next==e&&!i)return void t.advance();i=M&&!i&&92==t.next,t.advance()}}function pd(t,e){for(;95==t.next||Ld(t.next);)null!=e&&(e+=String.fromCharCode(t.next)),t.advance();return e}function Sd(t,e){for(;48==t.next||49==t.next;)t.advance();e&&t.next==e&&t.advance()}function Qd(t,e){for(;;){if(46==t.next){if(e)break;e=!0}else if(t.next<48||t.next>57)break;t.advance()}if(69==t.next||101==t.next)for(t.advance(),43!=t.next&&45!=t.next||t.advance();t.next>=48&&t.next<=57;)t.advance()}function Ed(t){for(;!(t.next<0||10==t.next);)t.advance()}function kd(t,e){for(let M=0;M<e.length;M++)if(e.charCodeAt(M)==t)return!0;return!1}const wd=" \t\r\n";function md(t,e,M){let i=Object.create(null);i.true=i.false=5,i.null=i.unknown=6;for(let e of t.split(" "))e&&(i[e]=20);for(let t of e.split(" "))t&&(i[t]=21);for(let t of(M||"").split(" "))t&&(i[t]=24);return i}const Ud={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:md("absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ","array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ")};function Cd(t){return new py((e=>{var M;let{next:i}=e;if(e.advance(),kd(i,wd)){for(;kd(e.next,wd);)e.advance();e.acceptToken(36)}else if(36==i&&t.doubleDollarQuotedStrings){let t=pd(e,"");36==e.next&&(e.advance(),function(t,e){t:for(;;){if(t.next<0)return console.log("exit at end",t.pos);if(36==t.next){t.advance();for(let M=0;M<e.length;M++){if(t.next!=e.charCodeAt(M))continue t;t.advance()}if(36==t.next)return void t.advance()}else t.advance()}}(e,t),e.acceptToken(3))}else if(39==i||34==i&&t.doubleQuotedStrings)xd(e,i,t.backslashEscapes),e.acceptToken(3);else if(35==i&&t.hashComments||47==i&&47==e.next&&t.slashComments)Ed(e),e.acceptToken(1);else if(45!=i||45!=e.next||t.spaceAfterDashes&&32!=e.peek(1))if(47==i&&42==e.next){e.advance();for(let t=1;;){let M=e.next;if(e.next<0)break;if(e.advance(),42==M&&47==e.next){if(t--,e.advance(),!t)break}else 47==M&&42==e.next&&(t++,e.advance())}e.acceptToken(2)}else if(101!=i&&69!=i||39!=e.next)if(110!=i&&78!=i||39!=e.next||!t.charSetCasts)if(95==i&&t.charSetCasts)for(let M=0;;M++){if(39==e.next&&M>1){e.advance(),xd(e,39,t.backslashEscapes),e.acceptToken(3);break}if(!Ld(e.next))break;e.advance()}else if(t.plsqlQuotingMechanism&&(113==i||81==i)&&39==e.next&&e.peek(1)>0&&!kd(e.peek(1),wd)){let t=e.peek(1);e.advance(2),function(t,e){let M="[{<(".indexOf(String.fromCharCode(e)),i=M<0?e:"]}>)".charCodeAt(M);for(;;){if(t.next<0)return;if(t.next==i&&39==t.peek(1))return void t.advance(2);t.advance()}}(e,t),e.acceptToken(3)}else if(40==i)e.acceptToken(7);else if(41==i)e.acceptToken(8);else if(123==i)e.acceptToken(9);else if(125==i)e.acceptToken(10);else if(91==i)e.acceptToken(11);else if(93==i)e.acceptToken(12);else if(59==i)e.acceptToken(13);else if(t.unquotedBitLiterals&&48==i&&98==e.next)e.advance(),Sd(e),e.acceptToken(22);else if(98!=i&&66!=i||39!=e.next&&34!=e.next){if(48==i&&(120==e.next||88==e.next)||(120==i||88==i)&&39==e.next){let t=39==e.next;for(e.advance();(N=e.next)>=48&&N<=57||N>=97&&N<=102||N>=65&&N<=70;)e.advance();t&&39==e.next&&e.advance(),e.acceptToken(4)}else if(46==i&&e.next>=48&&e.next<=57)Qd(e,!0),e.acceptToken(4);else if(46==i)e.acceptToken(14);else if(i>=48&&i<=57)Qd(e,!1),e.acceptToken(4);else if(kd(i,t.operatorChars)){for(;kd(e.next,t.operatorChars);)e.advance();e.acceptToken(15)}else if(kd(i,t.specialVar))e.next==i&&e.advance(),function(t){if(39==t.next||34==t.next||96==t.next){let e=t.next;t.advance(),xd(t,e,!1)}else pd(t)}(e),e.acceptToken(17);else if(kd(i,t.identifierQuotes))xd(e,i,!1),e.acceptToken(19);else if(58==i||44==i)e.acceptToken(16);else if(Ld(i)){let N=pd(e,String.fromCharCode(i));e.acceptToken(46==e.next||46==e.peek(-N.length-1)?18:null!==(M=t.words[N.toLowerCase()])&&void 0!==M?M:18)}}else{const M=e.next;e.advance(),t.treatBitsAsBytes?(xd(e,M,t.backslashEscapes),e.acceptToken(23)):(Sd(e,M),e.acceptToken(22))}else e.advance(),xd(e,39,t.backslashEscapes),e.acceptToken(3);else e.advance(),xd(e,39,!0),e.acceptToken(3);else Ed(e),e.acceptToken(1);var N}))}const fd=Cd(Ud),bd=Vy.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,fd],topRules:{Script:[0,25]},tokenPrec:0});function Yd(t){let e=t.cursor().moveTo(t.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function vd(t,e){let M=t.sliceString(e.from,e.to),i=/^([`'"])(.*)\1$/.exec(M);return i?i[2]:M}function Zd(t){return t&&("Identifier"==t.name||"QuotedIdentifier"==t.name)}function Vd(t,e){if("CompositeIdentifier"==e.name){let M=[];for(let i=e.firstChild;i;i=i.nextSibling)Zd(i)&&M.push(vd(t,i));return M}return[vd(t,e)]}function Wd(t,e){for(let M=[];;){if(!e||"."!=e.name)return M;let i=Yd(e);if(!Zd(i))return M;M.unshift(vd(t,i)),e=Yd(i)}}function Pd(t,e){let M=yj(t).resolveInner(e,-1),i=function(t,e){let M;for(let t=e;!M;t=t.parent){if(!t)return null;"Statement"==t.name&&(M=t)}let i=null;for(let e=M.firstChild,N=!1,o=null;e;e=e.nextSibling){let M="Keyword"==e.name?t.sliceString(e.from,e.to).toLowerCase():null,n=null;if(N)if("as"==M&&o&&Zd(e.nextSibling))n=vd(t,e.nextSibling);else{if(M&&Rd.has(M))break;o&&Zd(e)&&(n=vd(t,e))}else N="from"==M;n&&(i||(i=Object.create(null)),i[n]=Vd(t,o)),o=/Identifier$/.test(e.name)?e:null}return i}(t.doc,M);return"Identifier"==M.name||"QuotedIdentifier"==M.name||"Keyword"==M.name?{from:M.from,quoted:"QuotedIdentifier"==M.name?t.doc.sliceString(M.from,M.from+1):null,parents:Wd(t.doc,Yd(M)),aliases:i}:"."==M.name?{from:e,quoted:null,parents:Wd(t.doc,M),aliases:i}:{from:e,quoted:null,parents:[],empty:!0,aliases:i}}const Rd=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));const Gd=/^\w*$/,Bd=/^[`'"]?\w*[`'"]?$/;function _d(t){return t.self&&"string"==typeof t.self.label}class Fd{constructor(t,e){this.idQuote=t,this.idCaseInsensitive=e,this.list=[],this.children=void 0}child(t){let e=this.children||(this.children=Object.create(null)),M=e[t];return M||(t&&!this.list.some((e=>e.label==t))&&this.list.push(Jd(t,"type",this.idQuote,this.idCaseInsensitive)),e[t]=new Fd(this.idQuote,this.idCaseInsensitive))}maybeChild(t){return this.children?this.children[t]:null}addCompletion(t){let e=this.list.findIndex((e=>e.label==t.label));e>-1?this.list[e]=t:this.list.push(t)}addCompletions(t){for(let e of t)this.addCompletion("string"==typeof e?Jd(e,"property",this.idQuote,this.idCaseInsensitive):e)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):_d(t)?this.addNamespace(t.children):this.addNamespaceObject(t)}addNamespaceObject(t){for(let e of Object.keys(t)){let M=t[e],i=null,N=e.replace(/\\?\./g,(t=>"."==t?"\0":t)).split("\0"),o=this;_d(M)&&(i=M.self,M=M.children);for(let t=0;t<N.length;t++)i&&t==N.length-1&&o.addCompletion(i),o=o.child(N[t].replace(/\\\./g,"."));o.addNamespace(M)}}}function Jd(t,e,M,i){return new RegExp("^[a-z_][a-z_\\d]*$",i?"i":"").test(t)?{label:t,type:e}:{label:t,type:e,apply:M+t+M}}let Hd=bd.configure({props:[Yj.add({Statement:_j()}),Jj.add({Statement:(t,e)=>({from:Math.min(t.from+100,e.doc.lineAt(t.from).to),to:t.to}),BlockComment:t=>({from:t.from+2,to:t.to-2})}),Bg({Keyword:uj.keyword,Type:uj.typeName,Builtin:uj.standard(uj.name),Bits:uj.number,Bytes:uj.string,Bool:uj.bool,Null:uj.null,Number:uj.number,String:uj.string,Identifier:uj.name,QuotedIdentifier:uj.special(uj.string),SpecialVar:uj.special(uj.name),LineComment:uj.lineComment,BlockComment:uj.blockComment,Operator:uj.operator,"Semi Punctuation":uj.punctuation,"( )":uj.paren,"{ }":uj.brace,"[ ]":uj.squareBracket})]});class Xd{constructor(t,e,M){this.dialect=t,this.language=e,this.spec=M}get extension(){return this.language.extension}static define(t){let e=function(t,e,M,i){let N={};for(let e in Ud)N[e]=(t.hasOwnProperty(e)?t:Ud)[e];return e&&(N.words=md(e,M||"",i)),N}(t,t.keywords,t.types,t.builtin),M=Oj.define({name:"sql",parser:Hd.configure({tokenizers:[{from:fd,to:Cd(e)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new Xd(e,M,t)}}function $d(t,e=!1){return function(t,e){let M=Object.keys(t).map((M=>({label:e?M.toUpperCase():M,type:21==t[M]?"type":20==t[M]?"keyword":"variable",boost:-1})));return LT(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],hT(M))}(t.dialect.words,e)}function qd(t,e=!1){return t.language.data.of({autocomplete:$d(t,e)})}function Kd(t){return t.schema?function(t,e,M,i,N,o){var n;let s=(null===(n=null==o?void 0:o.spec.identifierQuotes)||void 0===n?void 0:n[0])||'"',r=new Fd(s,!!(null==o?void 0:o.spec.caseInsensitiveIdentifiers)),D=N?r.child(N):null;return r.addNamespace(t),e&&(D||r).addCompletions(e),M&&r.addCompletions(M),D&&r.addCompletions(D.list),i&&r.addCompletions((D||r).child(i).list),t=>{let{parents:e,from:M,quoted:N,empty:o,aliases:n}=Pd(t.state,t.pos);if(o&&!t.explicit)return null;n&&1==e.length&&(e=n[e[0]]||e);let s=r;for(let t of e){for(;!s.children||!s.children[t];)if(s==r&&D)s=D;else{if(s!=D||!i)return null;s=s.child(i)}let e=s.maybeChild(t);if(!e)return null;s=e}let a=N&&t.state.sliceDoc(t.pos,t.pos+1)==N,l=s.list;return s==r&&n&&(l=l.concat(Object.keys(n).map((t=>({label:t,type:"constant"}))))),{from:M,to:a?t.pos+1:void 0,options:(u=N,g=l,u?g.map((t=>Object.assign(Object.assign({},t),{label:t.label[0]==u?t.label:u+t.label+u,apply:void 0}))):g),validFor:N?Bd:Gd};var u,g}}(t.schema,t.tables,t.schemas,t.defaultTable,t.defaultSchema,t.dialect||eA):()=>null}function tA(t){return t.schema?(t.dialect||eA).language.data.of({autocomplete:Kd(t)}):[]}const eA=Xd.define({}),MA=Bg({String:uj.string,Number:uj.number,"True False":uj.bool,PropertyName:uj.propertyName,Null:uj.null,", :":uj.separator,"[ ]":uj.squareBracket,"{ }":uj.brace}),iA=Vy.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[MA],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),NA=Oj.define({name:"json",parser:iA.configure({props:[Yj.add({Object:_j({except:/^\s*\}/}),Array:_j({except:/^\s*\]/})}),Jj.add({"Object Array":Hj})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});const oA={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},nA={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},sA={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function rA(t){return 9==t||10==t||13==t||32==t}let DA=null,aA=null,lA=0;function uA(t,e){let M=t.pos+e;if(lA==M&&aA==t)return DA;let i=t.peek(e);for(;rA(i);)i=t.peek(++e);let N="";for(;45==(o=i)||46==o||58==o||o>=65&&o<=90||95==o||o>=97&&o<=122||o>=161;)N+=String.fromCharCode(i),i=t.peek(++e);var o;return aA=t,lA=M,DA=N?N.toLowerCase():i==gA||i==jA?void 0:null}const gA=63,jA=33;function cA(t,e){this.name=t,this.parent=e}const zA=[6,10,7,8,9],IA=new Zy({start:null,shift:(t,e,M,i)=>zA.indexOf(e)>-1?new cA(uA(i,1)||"",t):t,reduce:(t,e)=>20==e&&t?t.parent:t,reuse(t,e,M,i){let N=e.type.id;return 6==N||36==N?new cA(uA(i,1)||"",t):t},strict:!1}),TA=new py(((t,e)=>{if(60!=t.next)return void(t.next<0&&e.context&&t.acceptToken(57));t.advance();let M=47==t.next;M&&t.advance();let i=uA(t,0);if(void 0===i)return;if(!i)return t.acceptToken(M?14:6);let N=e.context?e.context.name:null;if(M){if(i==N)return t.acceptToken(11);if(N&&nA[N])return t.acceptToken(57,-2);if(e.dialectEnabled(0))return t.acceptToken(12);for(let t=e.context;t;t=t.parent)if(t.name==i)return;t.acceptToken(13)}else{if("script"==i)return t.acceptToken(7);if("style"==i)return t.acceptToken(8);if("textarea"==i)return t.acceptToken(9);if(oA.hasOwnProperty(i))return t.acceptToken(10);N&&sA[N]&&sA[N][i]?t.acceptToken(57,-1):t.acceptToken(6)}}),{contextual:!0}),OA=new py((t=>{for(let e=0,M=0;;M++){if(t.next<0){M&&t.acceptToken(58);break}if(45==t.next)e++;else{if(62==t.next&&e>=2){M>=3&&t.acceptToken(58,-2);break}e=0}t.advance()}}));const yA=new py(((t,e)=>{if(47==t.next&&62==t.peek(1)){let M=e.dialectEnabled(1)||function(t){for(;t;t=t.parent)if("svg"==t.name||"math"==t.name)return!0;return!1}(e.context);t.acceptToken(M?5:4,2)}else 62==t.next&&t.acceptToken(4,1)}));function dA(t,e,M){let i=2+t.length;return new py((N=>{for(let o=0,n=0,s=0;;s++){if(N.next<0){s&&N.acceptToken(e);break}if(0==o&&60==N.next||1==o&&47==N.next||o>=2&&o<i&&N.next==t.charCodeAt(o-2))o++,n++;else if(2!=o&&o!=i||!rA(N.next)){if(o==i&&62==N.next){s>n?N.acceptToken(e,-n):N.acceptToken(M,-(n-2));break}if((10==N.next||13==N.next)&&s){N.acceptToken(e,1);break}o=n=0}else n++;N.advance()}}))}const AA=dA("script",54,1),hA=dA("style",55,2),LA=dA("textarea",56,3),xA=Bg({"Text RawText":uj.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":uj.angleBracket,TagName:uj.tagName,"MismatchedCloseTag/TagName":[uj.tagName,uj.invalid],AttributeName:uj.attributeName,"AttributeValue UnquotedAttributeValue":uj.attributeValue,Is:uj.definitionOperator,"EntityReference CharacterReference":uj.character,Comment:uj.blockComment,ProcessingInst:uj.processingInstruction,DoctypeDecl:uj.documentMeta}),pA=Vy.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#C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OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:IA,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[xA],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UV`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pT`POv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!cpOv(Vx;'S(V;'S;=`(h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4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[AA,hA,LA,yA,TA,OA,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:509},tokenPrec:511});function SA(t,e){let M=Object.create(null);for(let i of t.getChildren(23)){let t=i.getChild(24),N=i.getChild(26)||i.getChild(27);t&&(M[e.read(t.from,t.to)]=N?26==N.type.id?e.read(N.from+1,N.to-1):e.read(N.from,N.to):"")}return M}function QA(t,e){let M=t.getChild(22);return M?e.read(M.from,M.to):" "}function EA(t,e,M){let i;for(let N of M)if(!N.attrs||N.attrs(i||(i=SA(t.node.parent.firstChild,e))))return{parser:N.parser};return null}function kA(t=[],e=[]){let M=[],i=[],N=[],o=[];for(let e of t){("script"==e.tag?M:"style"==e.tag?i:"textarea"==e.tag?N:o).push(e)}let n=e.length?Object.create(null):null;for(let t of e)(n[t.name]||(n[t.name]=[])).push(t);return s=(t,e)=>{let s=t.type.id;if(28==s)return EA(t,e,M);if(31==s)return EA(t,e,i);if(34==s)return EA(t,e,N);if(20==s&&o.length){let M,i=t.node,N=i.firstChild,n=N&&QA(N,e);if(n)for(let t of o)if(t.tag==n&&(!t.attrs||t.attrs(M||(M=SA(N,e))))){let e=i.lastChild,M=37==e.type.id?e.from:i.to;if(M>N.to)return{parser:t.parser,overlay:[{from:N.to,to:M}]}}}if(n&&23==s){let M,i=t.node;if(M=i.firstChild){let t=n[e.read(M.from,M.to)];if(t)for(let M of t){if(M.tagName&&M.tagName!=QA(i.parent,e))continue;let t=i.lastChild;if(26==t.type.id){let e=t.from+1,i=t.lastChild,N=t.to-(i&&i.isError?0:1);if(N>e)return{parser:M.parser,overlay:[{from:e,to:N}]}}else if(27==t.type.id)return{parser:M.parser,overlay:[{from:t.from,to:t.to}]}}}}return null},(t,e,M,i)=>new mg(t,s,e,M,i);var s}const wA=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function mA(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function UA(t){return t>=48&&t<=57}const CA=new py(((t,e)=>{for(let M=!1,i=0,N=0;;N++){let{next:o}=t;if(mA(o)||45==o||95==o||M&&UA(o))!M&&(45!=o||N>0)&&(M=!0),i===N&&45==o&&i++,t.advance();else{if(92!=o||10==t.peek(1)){M&&t.acceptToken(40==o?101:2==i&&e.canShift(2)?2:102);break}t.advance(),t.next>-1&&t.advance(),M=!0}}})),fA=new py((t=>{if(wA.includes(t.peek(-1))){let{next:e}=t;(mA(e)||95==e||35==e||46==e||91==e||58==e&&mA(t.peek(1))||45==e||38==e)&&t.acceptToken(100)}})),bA=new py((t=>{if(!wA.includes(t.peek(-1))){let{next:e}=t;if(37==e&&(t.advance(),t.acceptToken(1)),mA(e)){do{t.advance()}while(mA(t.next)||UA(t.next));t.acceptToken(1)}}})),YA=Bg({"AtKeyword import charset namespace keyframes media supports":uj.definitionKeyword,"from to selector":uj.keyword,NamespaceName:uj.namespace,KeyframeName:uj.labelName,KeyframeRangeName:uj.operatorKeyword,TagName:uj.tagName,ClassName:uj.className,PseudoClassName:uj.constant(uj.className),IdName:uj.labelName,"FeatureName PropertyName":uj.propertyName,AttributeName:uj.attributeName,NumberLiteral:uj.number,KeywordQuery:uj.keyword,UnaryQueryOp:uj.operatorKeyword,"CallTag ValueName":uj.atom,VariableName:uj.variableName,Callee:uj.operatorKeyword,Unit:uj.unit,"UniversalSelector NestingSelector":uj.definitionOperator,MatchOp:uj.compareOperator,"ChildOp SiblingOp, LogicOp":uj.logicOperator,BinOp:uj.arithmeticOperator,Important:uj.modifier,Comment:uj.blockComment,ColorLiteral:uj.color,"ParenthesizedContent StringLiteral":uj.string,":":uj.punctuation,"PseudoOp #":uj.derefOperator,"; ,":uj.separator,"( )":uj.paren,"[ ]":uj.squareBracket,"{ }":uj.brace}),vA={__proto__:null,lang:34,"nth-child":34,"nth-last-child":34,"nth-of-type":34,"nth-last-of-type":34,dir:34,"host-context":34,url:62,"url-prefix":62,domain:62,regexp:62,selector:140},ZA={__proto__:null,"@import":120,"@media":144,"@charset":148,"@namespace":152,"@keyframes":158,"@supports":170},VA={__proto__:null,not:134,only:134},WA=Vy.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#CiO$qQ[O'#DUO$vQ[O'#DXOOQP'#En'#EnO${QdO'#DhO%jQ[O'#DuO${QdO'#DwO%{Q[O'#DyO&WQ[O'#D|O&`Q[O'#ESO&nQ[O'#EUOOQS'#Em'#EmOOQS'#EX'#EXQYQ[OOO&uQXO'#CdO'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Q$[$k$l$s$x%UQ!f^R#l!gT#^!Z#_Q|VR!yqQ!x|R#y!yQ!PWR!{rQ!RXR!|sQxUQ!wpQ#i!cQ#o!jQ#p!kQ$}$gR%Z$|SgPwQ!phQ#s!nR$n#tZfPhw!n#ta!b[`a!V!^!`#d#eR#b!^R!g^R!i_R#n!iS$g#m$hR%X${V$e#m$h${Q!rjR#w!rQdOShPwU!ldh#tR#t!nQ$Q#SU$r$Q$x%UQ$x$[R%U$sQ#_!ZR$Y#_Q$t$QR%V$tQpUS!vp$pR$p#}Q$l#qR%R$lQ!ogS#u!o#vR#v!pQ#f!_R$`#fQ$h#mR%O$hQ$|$gR%Y$|_cOPdhw!n#t^UOPdhw!n#tQ!uoQ!}tQ#OuQ#PvQ#}#RR$a#hR$R#SQ!VZQ!d]Q#V!TQ#q!m[$P#S$Q$[$s$x%UQ$S#UQ$U#XS$j#q$lQ$o#{R%Q$kR$O#RQiPR#QwQ!c[Q!kaR#Y!VU!_[a!VQ!j`Q#c!^Q#g!`Q$^#dR$_#e",nodeNames:"⚠ Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:117,nodeProps:[["isolate",-2,3,25,""],["openedBy",18,"(",33,"[",51,"{"],["closed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^nC^S!Z^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS}SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!PQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!PQp`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!]Qp`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSr^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSq^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUp`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!cQp`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!UUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!T^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!SQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[fA,bA,CA,1,2,3,4,new xy("m~RRYZ[z{a~~g~aO#_~~dP!P!Qg~lO#`~~",28,106)],topRules:{StyleSheet:[0,4],Styles:[1,87]},specialized:[{term:101,get:t=>vA[t]||-1},{term:59,get:t=>ZA[t]||-1},{term:102,get:t=>VA[t]||-1}],tokenPrec:1219});let PA=null;function RA(){if(!PA&&"object"==typeof document&&document.body){let{style:t}=document.body,e=[],M=new Set;for(let i in t)"cssText"!=i&&"cssFloat"!=i&&"string"==typeof t[i]&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))),M.has(i)||(e.push(i),M.add(i)));PA=e.sort().map((t=>({type:"property",label:t,apply:t+": "})))}return PA||[]}const GA=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map((t=>({type:"class",label:t}))),BA=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((t=>({type:"keyword",label:t}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((t=>({type:"constant",label:t})))),_A=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((t=>({type:"type",label:t}))),FA=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map((t=>({type:"keyword",label:t}))),JA=/^(\w[\w-]*|-\w[\w-]*|)$/,HA=/^-(-[\w-]*)?$/;const XA=new Lg,$A=["Declaration"];function qA(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function KA(t,e,M){if(e.to-e.from>4096){let i=XA.get(e);if(i)return i;let N=[],o=new Set,n=e.cursor(og.IncludeAnonymous);if(n.firstChild())do{for(let e of KA(t,n.node,M))o.has(e.label)||(o.add(e.label),N.push(e))}while(n.nextSibling());return XA.set(e,N),N}{let i=[],N=new Set;return e.cursor().iterate((e=>{var o;if(M(e)&&e.matchContext($A)&&":"==(null===(o=e.node.nextSibling)||void 0===o?void 0:o.name)){let M=t.sliceString(e.from,e.to);N.has(M)||(N.add(M),i.push({label:M,type:"variable"}))}})),i}}const th=t=>e=>{let{state:M,pos:i}=e,N=yj(M).resolveInner(i,-1),o=N.type.isError&&N.from==N.to-1&&"-"==M.doc.sliceString(N.from,N.to);if("PropertyName"==N.name||(o||"TagName"==N.name)&&/^(Block|Styles)$/.test(N.resolve(N.to).name))return{from:N.from,options:RA(),validFor:JA};if("ValueName"==N.name)return{from:N.from,options:BA,validFor:JA};if("PseudoClassName"==N.name)return{from:N.from,options:GA,validFor:JA};if(t(N)||(e.explicit||o)&&function(t,e){var M;if(("("==t.name||t.type.isError)&&(t=t.parent||t),"ArgList"!=t.name)return!1;let i=null===(M=t.parent)||void 0===M?void 0:M.firstChild;return"Callee"==(null==i?void 0:i.name)&&"var"==e.sliceString(i.from,i.to)}(N,M.doc))return{from:t(N)||o?N.from:i,options:KA(M.doc,qA(N),t),validFor:HA};if("TagName"==N.name){for(let{parent:t}=N;t;t=t.parent)if("Block"==t.name)return{from:N.from,options:RA(),validFor:JA};return{from:N.from,options:_A,validFor:JA}}if("AtKeyword"==N.name)return{from:N.from,options:FA,validFor:JA};if(!e.explicit)return null;let n=N.resolve(i),s=n.childBefore(i);return s&&":"==s.name&&"PseudoClassSelector"==n.name?{from:i,options:GA,validFor:JA}:s&&":"==s.name&&"Declaration"==n.name||"ArgList"==n.name?{from:i,options:BA,validFor:JA}:"Block"==n.name||"Styles"==n.name?{from:i,options:RA(),validFor:JA}:null},eh=th((t=>"VariableName"==t.name)),Mh=Oj.define({name:"css",parser:WA.configure({props:[Yj.add({Declaration:_j()}),Jj.add({"Block KeyframeList":Hj})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});const ih=[xO("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),xO("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),xO("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),xO("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),xO("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),xO("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),xO("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),xO("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),xO("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),xO('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),xO('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Nh=ih.concat([xO("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),xO("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),xO("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),oh=new Lg,nh=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function sh(t){return(e,M)=>{let i=e.node.getChild("VariableDefinition");return i&&M(i,t),!0}}const rh=["FunctionDeclaration"],Dh={FunctionDeclaration:sh("function"),ClassDeclaration:sh("class"),ClassExpression:()=>!0,EnumDeclaration:sh("constant"),TypeAliasDeclaration:sh("type"),NamespaceDeclaration:sh("namespace"),VariableDefinition(t,e){t.matchContext(rh)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function ah(t,e){let M=oh.get(e);if(M)return M;let i=[],N=!0;function o(e,M){let N=t.sliceString(e.from,e.to);i.push({label:N,type:M})}return e.cursor(og.IncludeAnonymous).iterate((e=>{if(N)N=!1;else if(e.name){let t=Dh[e.name];if(t&&t(e,o)||nh.has(e.name))return!1}else if(e.to-e.from>8192){for(let M of ah(t,e.node))i.push(M);return!1}})),oh.set(e,i),i}const lh=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,uh=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function gh(t){let e=yj(t.state).resolveInner(t.pos,-1);if(uh.indexOf(e.name)>-1)return null;let M="VariableName"==e.name||e.to-e.from<20&&lh.test(t.state.sliceDoc(e.from,e.to));if(!M&&!t.explicit)return null;let i=[];for(let M=e;M;M=M.parent)nh.has(M.name)&&(i=i.concat(ah(t.state.doc,M)));return{options:i,from:M?e.from:t.pos,validFor:lh}}const jh=Oj.define({name:"javascript",parser:ed.configure({props:[Yj.add({IfStatement:_j({except:/^\s*({|else\b)/}),TryStatement:_j({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Bj,SwitchBody:t=>{let e=t.textAfter,M=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return t.baseIndent+(M?0:i?1:2)*t.unit},Block:Rj({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":_j({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),Jj.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Hj,BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),ch={test:t=>/^JSX/.test(t.name),facet:cj({commentTokens:{block:{open:"{/*",close:"*/}"}}})},zh=jh.configure({dialect:"ts"},"typescript"),Ih=jh.configure({dialect:"jsx",props:[zj.add((t=>t.isTop?[ch]:void 0))]}),Th=jh.configure({dialect:"jsx ts",props:[zj.add((t=>t.isTop?[ch]:void 0))]},"typescript");let Oh=t=>({label:t,type:"keyword"});const yh="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Oh),dh=yh.concat(["declare","implements","private","protected","public"].map(Oh));function Ah(t={}){let e=t.jsx?t.typescript?Th:Ih:t.typescript?zh:jh,M=t.typescript?Nh.concat(dh):ih.concat(yh);return new kj(e,[jh.data.of({autocomplete:LT(uh,hT(M))}),jh.data.of({autocomplete:gh}),t.jsx?xh:[]])}function hh(t,e,M=t.length){for(let i=null==e?void 0:e.firstChild;i;i=i.nextSibling)if("JSXIdentifier"==i.name||"JSXBuiltin"==i.name||"JSXNamespacedName"==i.name||"JSXMemberExpression"==i.name)return t.sliceString(i.from,Math.min(i.to,M));return""}const Lh="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),xh=nl.inputHandler.of(((t,e,M,i,N)=>{if((Lh?t.composing:t.compositionStarted)||t.state.readOnly||e!=M||">"!=i&&"/"!=i||!jh.isActiveAt(t.state,e,-1))return!1;let o=N(),{state:n}=o,s=n.changeByRange((t=>{var e;let M,{head:N}=t,o=yj(n).resolveInner(N-1,-1);if("JSXStartTag"==o.name&&(o=o.parent),n.doc.sliceString(N-1,N)!=i||"JSXAttributeValue"==o.name&&o.to>N);else{if(">"==i&&"JSXFragmentTag"==o.name)return{range:t,changes:{from:N,insert:"</>"}};if("/"==i&&"JSXStartCloseTag"==o.name){let t=o.parent,i=t.parent;if(i&&t.from==N-2&&((M=hh(n.doc,i.firstChild,N))||"JSXFragmentTag"==(null===(e=i.firstChild)||void 0===e?void 0:e.name))){let t=`${M}>`;return{range:Vo.cursor(N+t.length,-1),changes:{from:N,insert:t}}}}else if(">"==i){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(o);if(e&&"JSXOpenTag"==e.name&&!/^\/?>|^<\//.test(n.doc.sliceString(N,N+2))&&(M=hh(n.doc,e,N)))return{range:t,changes:{from:N,insert:`</${M}>`}}}}return{range:t}}));return!s.changes.empty&&(t.dispatch([o,n.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),ph=["_blank","_self","_top","_parent"],Sh=["ascii","utf-8","utf-16","latin1","latin1"],Qh=["get","post","put","delete"],Eh=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],kh=["true","false"],wh={},mh={a:{attrs:{href:null,ping:null,type:null,media:null,target:ph,hreflang:null}},abbr:wh,address:wh,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:wh,aside:wh,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:wh,base:{attrs:{href:null,target:ph}},bdi:wh,bdo:wh,blockquote:{attrs:{cite:null}},body:wh,br:wh,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Eh,formmethod:Qh,formnovalidate:["novalidate"],formtarget:ph,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:wh,center:wh,cite:wh,code:wh,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:wh,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:wh,div:wh,dl:wh,dt:wh,em:wh,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:wh,figure:wh,footer:wh,form:{attrs:{action:null,name:null,"accept-charset":Sh,autocomplete:["on","off"],enctype:Eh,method:Qh,novalidate:["novalidate"],target:ph}},h1:wh,h2:wh,h3:wh,h4:wh,h5:wh,h6:wh,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:wh,hgroup:wh,hr:wh,html:{attrs:{manifest:null}},i:wh,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Eh,formmethod:Qh,formnovalidate:["novalidate"],formtarget:ph,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:wh,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:wh,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:wh,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Sh,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:wh,noscript:wh,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:wh,param:{attrs:{name:null,value:null}},pre:wh,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:wh,rt:wh,ruby:wh,samp:wh,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Sh}},section:wh,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:wh,source:{attrs:{src:null,type:null,media:null}},span:wh,strong:wh,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:wh,summary:wh,sup:wh,table:wh,tbody:wh,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:wh,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:wh,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:wh,time:{attrs:{datetime:null}},title:wh,tr:wh,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:wh,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:wh},Uh={accesskey:null,class:null,contenteditable:kh,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:kh,autocorrect:kh,autocapitalize:kh,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":kh,"aria-autocomplete":["inline","list","both","none"],"aria-busy":kh,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":kh,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":kh,"aria-hidden":kh,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":kh,"aria-multiselectable":kh,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":kh,"aria-relevant":null,"aria-required":kh,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Ch="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((t=>"on"+t));for(let t of Ch)Uh[t]=null;class fh{constructor(t,e){this.tags=Object.assign(Object.assign({},mh),t),this.globalAttrs=Object.assign(Object.assign({},Uh),e),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}function bh(t,e,M=t.length){if(!e)return"";let i=e.firstChild,N=i&&i.getChild("TagName");return N?t.sliceString(N.from,Math.min(N.to,M)):""}function Yh(t,e=!1){for(;t;t=t.parent)if("Element"==t.name){if(!e)return t;e=!1}return null}function vh(t,e,M){let i=M.tags[bh(t,Yh(e))];return(null==i?void 0:i.children)||M.allTags}function Zh(t,e){let M=[];for(let i=Yh(e);i&&!i.type.isTop;i=Yh(i.parent)){let N=bh(t,i);if(N&&"CloseTag"==i.lastChild.name)break;N&&M.indexOf(N)<0&&("EndTag"==e.name||e.from>=i.firstChild.to)&&M.push(N)}return M}fh.default=new fh;const Vh=/^[:\-\.\w\u00b7-\uffff]*$/;function Wh(t,e,M,i,N){let o=/\s*>/.test(t.sliceDoc(N,N+5))?"":">",n=Yh(M,!0);return{from:i,to:N,options:vh(t.doc,n,e).map((t=>({label:t,type:"type"}))).concat(Zh(t.doc,M).map(((t,e)=>({label:"/"+t,apply:"/"+t+o,type:"type",boost:99-e})))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Ph(t,e,M,i){let N=/\s*>/.test(t.sliceDoc(i,i+5))?"":">";return{from:M,to:i,options:Zh(t.doc,e).map(((t,e)=>({label:t,apply:t+N,type:"type",boost:99-e}))),validFor:Vh}}function Rh(t,e){let{state:M,pos:i}=e,N=yj(M).resolveInner(i,-1),o=N.resolve(i);for(let t,e=i;o==N&&(t=N.childBefore(e));){let M=t.lastChild;if(!M||!M.type.isError||M.from<M.to)break;o=N=t,e=M.from}return"TagName"==N.name?N.parent&&/CloseTag$/.test(N.parent.name)?Ph(M,N,N.from,i):Wh(M,t,N,N.from,i):"StartTag"==N.name?Wh(M,t,N,i,i):"StartCloseTag"==N.name||"IncompleteCloseTag"==N.name?Ph(M,N,i,i):"OpenTag"==N.name||"SelfClosingTag"==N.name||"AttributeName"==N.name?function(t,e,M,i,N){let o=Yh(M),n=o?e.tags[bh(t.doc,o)]:null,s=n&&n.attrs?Object.keys(n.attrs):[];return{from:i,to:N,options:(n&&!1===n.globalAttrs?s:s.length?s.concat(e.globalAttrNames):e.globalAttrNames).map((t=>({label:t,type:"property"}))),validFor:Vh}}(M,t,N,"AttributeName"==N.name?N.from:i,i):"Is"==N.name||"AttributeValue"==N.name||"UnquotedAttributeValue"==N.name?function(t,e,M,i,N){var o;let n,s=null===(o=M.parent)||void 0===o?void 0:o.getChild("AttributeName"),r=[];if(s){let o=t.sliceDoc(s.from,s.to),D=e.globalAttrs[o];if(!D){let i=Yh(M),N=i?e.tags[bh(t.doc,i)]:null;D=(null==N?void 0:N.attrs)&&N.attrs[o]}if(D){let e=t.sliceDoc(i,N).toLowerCase(),M='"',o='"';/^['"]/.test(e)?(n='"'==e[0]?/^[^"]*$/:/^[^']*$/,M="",o=t.sliceDoc(N,N+1)==e[0]?"":e[0],e=e.slice(1),i++):n=/^[^\s<>='"]*$/;for(let t of D)r.push({label:t,apply:M+t+o,type:"constant"})}}return{from:i,to:N,options:r,validFor:n}}(M,t,N,"Is"==N.name?i:N.from,i):!e.explicit||"Element"!=o.name&&"Text"!=o.name&&"Document"!=o.name?null:function(t,e,M,i){let N=[],o=0;for(let i of vh(t.doc,M,e))N.push({label:"<"+i,type:"type"});for(let e of Zh(t.doc,M))N.push({label:"</"+e+">",type:"type",boost:99-o++});return{from:i,to:i,options:N,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(M,t,N,i)}function Gh(t){let{extraTags:e,extraGlobalAttributes:M}=t,i=M||e?new fh(e,M):fh.default;return t=>Rh(i,t)}const Bh=jh.parser.configure({top:"SingleExpression"}),_h=[{tag:"script",attrs:t=>"text/typescript"==t.type||"ts"==t.lang,parser:zh.parser},{tag:"script",attrs:t=>"text/babel"==t.type||"text/jsx"==t.type,parser:Ih.parser},{tag:"script",attrs:t=>"text/typescript-jsx"==t.type,parser:Th.parser},{tag:"script",attrs:t=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type),parser:Bh},{tag:"script",attrs:t=>!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type),parser:jh.parser},{tag:"style",attrs:t=>(!t.lang||"css"==t.lang)&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type)),parser:Mh.parser}],Fh=[{name:"style",parser:Mh.parser.configure({top:"Styles"})}].concat(Ch.map((t=>({name:t,parser:jh.parser})))),Jh=Oj.define({name:"html",parser:pA.configure({props:[Yj.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag":t=>t.column(t.node.from)+t.unit,Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e,M=null;for(let e=t.node;;){let t=e.lastChild;if(!t||"Element"!=t.name||t.to!=e.to)break;M=e=t}return M&&(!(e=M.lastChild)||"CloseTag"!=e.name&&"SelfClosingTag"!=e.name)?t.lineIndent(M.from)+t.unit:null}}),Jj.add({Element(t){let e=t.firstChild,M=t.lastChild;return e&&"OpenTag"==e.name?{from:e.to,to:"CloseTag"==M.name?M.from:t.to}:null}}),mc.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Hh=Jh.configure({wrap:kA(_h,Fh)});const Xh=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),$h=nl.inputHandler.of(((t,e,M,i,N)=>{if(t.composing||t.state.readOnly||e!=M||">"!=i&&"/"!=i||!Hh.isActiveAt(t.state,e,-1))return!1;let o=N(),{state:n}=o,s=n.changeByRange((t=>{var e,M,N;let o,s=n.doc.sliceString(t.from-1,t.to)==i,{head:r}=t,D=yj(n).resolveInner(r,-1);if(s&&">"==i&&"EndTag"==D.name){let i=D.parent;if("CloseTag"!=(null===(M=null===(e=i.parent)||void 0===e?void 0:e.lastChild)||void 0===M?void 0:M.name)&&(o=bh(n.doc,i.parent,r))&&!Xh.has(o)){return{range:t,changes:{from:r,to:r+(">"===n.doc.sliceString(r,r+1)?1:0),insert:`</${o}>`}}}}else if(s&&"/"==i&&"IncompleteCloseTag"==D.name){let t=D.parent;if(D.from==r-2&&"CloseTag"!=(null===(N=t.lastChild)||void 0===N?void 0:N.name)&&(o=bh(n.doc,t,r))&&!Xh.has(o)){let t=r+(">"===n.doc.sliceString(r,r+1)?1:0),e=`${o}>`;return{range:Vo.cursor(r+e.length,-1),changes:{from:r,to:t,insert:e}}}}return{range:t}}));return!s.changes.empty&&(t.dispatch([o,n.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),qh=t=>void 0===t||t,Kh=(t={})=>{let e=[];qh(t.defaultKeymap)&&e.push(...zI),qh(t.closeBracketsKeymap)&&e.push(...bO),qh(t.searchKeymap)&&e.push(...gT),qh(t.historyKeymap)&&e.push(...Oz),qh(t.foldKeymap)&&e.push(...sc),qh(t.lintKeymap)&&e.push(...Ny);const M=[];return qh(t.highlightActiveLineGutter)&&M.push(Ju),qh(t.highlightSpecialChars)&&M.push(function(t={}){return[Gl.of(t),Bl||(Bl=sD.fromClass(class{constructor(t){this.view=t,this.decorations=lr.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Gl)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Zl({regexp:t.specialChars,decoration:(e,M,i)=>{let{doc:N}=M.state,o=po(e[0],0);if(9==o){let t=N.lineAt(i),e=M.state.tabSize,o=Xn(t.text,e,i-t.from);return lr.replace({widget:new Fl((e-o%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=lr.replace({widget:new _l(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Gl);t.startState.facet(Gl)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}()),qh(t.history)&&M.push(function(t={}){return[Mz,ez.of(t),nl.domEventHandlers({beforeinput(t,e){let M="historyUndo"==t.inputType?Nz:"historyRedo"==t.inputType?oz:null;return!!M&&(t.preventDefault(),M(e))}})]}()),qh(t.foldGutter)&&M.push(function(t={}){let e=Object.assign(Object.assign({},jc),t),M=new cc(e,!0),i=new cc(e,!1),N=sD.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Ej)!=t.state.facet(Ej)||t.startState.field(Mc,!1)!=t.state.field(Mc,!1)||yj(t.startState)!=yj(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new Zn;for(let N of t.viewportLineBlocks){let o=ic(t.state,N.from,N.to)?i:$j(t.state,N.from,N.to)?M:null;o&&e.add(N.from,N.from,o)}return e.finish()}}),{domEventHandlers:o}=e;return[N,wu({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(N))||void 0===e?void 0:e.markers)||vn.empty},initialSpacer:()=>new cc(e,!1),domEventHandlers:Object.assign(Object.assign({},o),{click:(t,e,M)=>{if(o.click&&o.click(t,e,M))return!0;let i=ic(t.state,e.from,e.to);if(i)return t.dispatch({effects:tc.of(i)}),!0;let N=$j(t.state,e.from,e.to);return!!N&&(t.dispatch({effects:Kj.of(N)}),!0)}})}),ac()]}()),qh(t.drawSelection)&&M.push(function(t={}){return[Ql.of(t),kl,ml,Cl,qr.of(!0)]}()),qh(t.dropCursor)&&M.push([bl,Yl]),qh(t.allowMultipleSelections)&&M.push(mn.allowMultipleSelections.of(!0)),qh(t.indentOnInput)&&M.push(mn.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let M=t.newDoc,{head:i}=t.newSelection.main,N=M.lineAt(i);if(i>N.from+200)return t;let o=M.sliceString(N.from,i);if(!e.some((t=>t.test(o))))return t;let{state:n}=t,s=-1,r=[];for(let{head:t}of n.selection.ranges){let e=n.doc.lineAt(t);if(e.from==s)continue;s=e.from;let M=fj(n,e.from);if(null==M)continue;let i=/^\s*/.exec(e.text)[0],N=Cj(n,M);i!=N&&r.push({from:e.from,to:e.from+i.length,insert:N})}return r.length?[t,{changes:r,sequential:!0}]:t}))),qh(t.bracketMatching)&&M.push(function(t={}){return[pc.of(t),wc]}()),qh(t.closeBrackets)&&M.push([fO,kO]),qh(t.autocompletion)&&M.push(GO()),qh(t.rectangularSelection)&&M.push(function(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return nl.mouseSelectionStyle.of(((t,M)=>e(M)?Kl(t,M):null))}()),qh(t.crosshairCursor)&&M.push(function(t={}){let[e,M]=tu[t.key||"Alt"],i=sD.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventObservers:{keydown(t){this.set(t.keyCode==e||M(t))},keyup(t){t.keyCode!=e&&M(t)||this.set(!1)},mousemove(t){this.set(M(t))}}});return[i,nl.contentAttributes.of((t=>{var e;return(null===(e=t.plugin(i))||void 0===e?void 0:e.isDown)?eu:null}))]}()),qh(t.highlightActiveLine)&&M.push(Hl),qh(t.highlightSelectionMatches)&&M.push(function(t){let e=[vI,YI];return t&&e.push(UI.of(t)),e}()),t.enableSearch||M.push(jl.of([{key:"Mod-f",run:()=>!0}])),t.tabSize&&"number"==typeof t.tabSize&&M.push(mj.of(" ".repeat(t.tabSize))),M.concat([jl.of(e.flat())]).filter(Boolean)},tL={"&":{fontSize:"14px",fontFamily:"Colfax-regular",fontWeight:"400"},".cm-content":{},".cm-scroller":{scrollbarWidth:"thin"}},eL={".cm-tooltip-autocomplete":{padding:"9px 12px",backgroundColor:"#FFFFFF",display:"block",fontSize:"14px",background:"white",border:"solid 1px #C7CED4",borderRadius:"0.25rem",paddingBlock:"0",paddingInline:"0",overscrollBehavior:"none",color:"hsl(240 5.3% 26.1%)"},".cm-tooltip.cm-completionInfo.cm-completionInfo-right":{fontFamily:"colfax-regular",backgroundColor:"#FFFFFF",color:"hsl(240 5.3% 26.1%)",padding:"6px 12px",borderTopRightRadius:"0.25rem",borderBottomRightRadius:"0.25rem",border:"solid 1px #C7CED4",fontSize:"14px"},".cm-tooltip.cm-tooltip-autocomplete > ul":{fontFamily:"colfax-regular",fontWeight:"400"},".cm-tooltip.cm-tooltip-autocomplete > ul > li":{padding:"9px 12px"},".cm-tooltip.cm-tooltip-autocomplete > ul > li:hover":{backgroundColor:"#005ea61a",color:"rgb(0, 0, 0)"},'.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected="true"]':{backgroundColor:"#005ea61a",color:"#005EA6"},'.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected="true"]:hover':{color:"#005EA6"},".cm-completionIcon":{display:"block",position:"relative"},".cm-completionIcon::after":{display:"block",content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM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MiA4LjM3OTk2IDExLjYyMzYgOC43NDk5NyAxMS44NzA4Wk05LjE2NjY1IDguNzUyOEM5LjQxMzMyIDguNTg3OTggOS43MDMzMyA4LjUgMTAgOC41QzEwLjM5NzggOC41IDEwLjc3OTQgOC42NTgwNCAxMS4wNjA3IDguOTM5MzRDMTEuMzQyIDkuMjIwNjUgMTEuNSA5LjYwMjE4IDExLjUgMTBDMTEuNSAxMC4yOTY3IDExLjQxMiAxMC41ODY3IDExLjI0NzIgMTAuODMzNEMxMS4wODI0IDExLjA4IDEwLjg0ODEgMTEuMjcyMyAxMC41NzQgMTEuMzg1OEMxMC4yOTk5IDExLjQ5OTQgOS45OTgzNCAxMS41MjkxIDkuNzA3MzcgMTEuNDcxMkM5LjQxNjM5IDExLjQxMzMgOS4xNDkxMiAxMS4yNzA0IDguOTM5MzQgMTEuMDYwN0M4LjcyOTU2IDEwLjg1MDkgOC41ODY3IDEwLjU4MzYgOC41Mjg4MiAxMC4yOTI2QzguNDcwOTUgMTAuMDAxNyA4LjUwMDY1IDkuNzAwMDcgOC42MTQxOCA5LjQyNTk4QzguNzI3NzEgOS4xNTE4OSA4LjkxOTk3IDguOTE3NjIgOS4xNjY2NSA4Ljc1MjhaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionMatchedText":{textDecoration:"none"},".cm-completionIcon.cm-completionIcon-property::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuNjA1MjEgMTEuOTExVjcuODg0ODFMMS44MjU3NiA1LjkxNDYxVjkuOTQwODFMNS42MDUyMSAxMS45MTFaTTYuNDMwOTcgMTEuOTExTDEyLjE3NDIgOC42MDY3OVY0LjU4MDU5TDYuNDMwOTcgNy44ODQ4MVYxMS45MTFaTTYuMDE4MDkgNy4yMzE0MUwxMS44NzI1IDMuODY5OTlMNy45NjYwMyAxLjg1Njg5TDIuMTI3NDggNS4yMTgzMUw2LjAxODA5IDcuMjMxNDFaTTEgMTAuMzc2NFY0Ljk1NzYxTDcuOTgxOTEgMUwxMyAzLjYwOTI5VjkuMDI4MDlMNi4wMTgwOSAxM0wxIDEwLjM3NjRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-keyword::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuMTk5OTUgNC4wMTQ0OUM2LjE5OTk1IDMuNzkyNyA2LjI3ODE0IDMuNjAzMjkgNi40MzQ1IDMuNDQ2MjZDNi41OTA3NyAzLjI4OTE0IDYuNzc5MjcgMy4yMTA1OCA3IDMuMjEwNThDNy4yMjA3MyAzLjIxMDU4IDcuNDA5MjMgMy4yODkxNCA3LjU2NTUgMy40NDYyNkM3LjcyMTg2IDMuNjAzMjkgNy44MDAwNSAzLjc5MjcgNy44MDAwNSA0LjAxNDQ5QzcuODAwMDUgNC4yMzYyOCA3LjcyMTg2IDQuNDI1NjkgNy41NjU1IDQuNTgyNzJDNy40MDkyMyA0LjczOTg0IDcuMjIwNzMgNC44MTg0IDcgNC44MTg0QzYuNzc5MjcgNC44MTg0IDYuNTkwNzcgNC43Mzk4NCA2LjQzNDUgNC41ODI3MkM2LjI3ODE0IDQuNDI1NjkgNi4xOTk5NSA0LjIzNjI4IDYuMTk5OTUgNC4wMTQ0OVpNNi45MzM1OSAxM0w1LjAyNTE4IDEwLjk3OTFMN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4ODY3QzYuMzU5NDUgMS42ODg2NyA1LjgxMzU1IDEuOTE1NCA1LjM2MjI3IDIuMzY4ODVDNC45MTEgMi44MjIzMSA0LjY4NTM2IDMuMzcwODUgNC42ODUzNiA0LjAxNDQ5WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-variable::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuNjA1MjEgMTEuOTExVjcuODg0ODFMMS44MjU3NiA1LjkxNDYxVjkuOTQwODFMNS42MDUyMSAxMS45MTFaTTYuNDMwOTcgMTEuOTExTDEyLjE3NDIgOC42MDY3OVY0LjU4MDU5TDYuNDMwOTcgNy44ODQ4MVYxMS45MTFaTTYuMDE4MDkgNy4yMzE0MUwxMS44NzI1IDMuODY5OTlMNy45NjYwMyAxLjg1Njg5TDIuMTI3NDggNS4yMTgzMUw2LjAxODA5IDcuMjMxNDFaTTEgMTAuMzc2NFY0Ljk1NzYxTDcuOTgxOTEgMUwxMyAzLjYwOTI5VjkuMDI4MDlMNi4wMTgwOSAxM0wxIDEwLjM3NjRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-text::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuNjA1MjEgMTEuOTExVjcuODg0ODFMMS44MjU3NiA1LjkxNDYxVjkuOTQwODFMNS42MDUyMSAxMS45MTFaTTYuNDMwOTcgMTEuOTExTDEyLjE3NDIgOC42MDY3OVY0LjU4MDU5TDYuNDMwOTcgNy44ODQ4MVYxMS45MTFaTTYuMDE4MDkgNy4yMzE0MUwxMS44NzI1IDMuODY5OTlMNy45NjYwMyAxLjg1Njg5TDIuMTI3NDggNS4yMTgzMUw2LjAxODA5IDcuMjMxNDFaTTEgMTAuMzc2NFY0Ljk1NzYxTDcuOTgxOTEgMUwxMyAzLjYwOTI5VjkuMDI4MDlMNi4wMTgwOSAxM0wxIDEwLjM3NjRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-function::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNzE5ODMgNC4zNTY0NUwzLjMxODk0IDQuODA1NjZMMy4zNTgzNCA0Ljk3NTU5SDQuMzkwNjJDNC4xNzk4MyA2LjE4NDU3IDQuMDIyMjMgNy4yNzQ0MSAzLjcxOTgzIDguOTU0MUMzLjM1ODM0IDExLjA5NjcgMy4xNTA1IDExLjYyMyAzLjAyNzM4IDExLjgxNTRDMi45MTkwMyAxMi4wMDU5IDIuNzYzNCAxMi4xMDQ1IDIuNTUyNjEgMTIuMTA0NUMyLjMyMTEzIDEyLjEwNDUgMS45MDI1IDExLjkyMjkgMS42Nzc5MiAxMS43MTY4QzEuNTk3MTUgMTEuNjYyMSAxLjUwMTYxIDExLjY3NTggMS40MDAxNSAxMS43NDIyQzEuMTk3MjQgMTEuOTEyMSAxLjAwMDI0IDEyLjE3MzggMS4wMDAyNCAxMi40MDgyQzAuOTg4ND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Mzk1NSA0LjY5MDQzIDcuNTE3MDIgNS41ODQ5Nkw3LjgyMzM2IDUuOTE1MDRaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionIcon.cm-completionIcon-class::after":{content:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuOTA2NjUgMTNMMS41IDEwVjRMNi45MDY2NSAxTDEyLjMxMzMgNFYxMEw2LjkwNjY1IDEzWk01LjE0ODk3IDUuNTA3MzJDNS4zNjUzNSA1LjI1NzQyIDUuNjI5MTQgNS4wNTkxOCA1Ljk0MDM0IDQuOTEyNTlDNi4yNTE2NSA0Ljc2NiA2LjU3Mzc1IDQuNjkyNzEgNi45MDY2NSA0LjY5MjcxQzcuMjM5NTQgNC42OTI3MSA3LjU2MTY0IDQuNzY2IDcuODcyOTYgNC45MTI1OUM4LjE4NDE1IDUuMDU5MTggOC40NDc5NCA1LjI1NzQyIDguNjY0MzIgNS41MDczMkwxMC45MjUzIDQuMjYyMjRMNi45MDY2NSAyLjAzMTc0TDIuODg3OTkgNC4yNjIyNEw1LjE0ODk3IDUuNTA3MzJaTTYuNDU4OTYgMTEuNzMzN1Y5LjI3ODJDNS45MjExNyA5LjE2Njg1IDUuNDc2ODEgOC44OTg0MSA1LjEyNTkgOC40NzI4OEM0Ljc3NDg3IDguMDQ3MjQgNC41OTkzNSA3LjU1NjI4IDQuNTk5MzUgN0M0LjU5OTM1IDYuODgzNDkgNC42MDU1NSA2Ljc2NDA1IDQuNjE3OTUgNi42NDE2OEM0LjYzMDIzIDYuNTE5NDMgNC42NjM3NSA2LjQwNTczIDQuNzE4NSA2LjMwMDU4TDIuMzk1MzcgNS4wMDQwMlY5LjQ3NTUyTDYuNDU4OTYgMTEuNzMzN1pNNi45MDY2NSA4LjQxMTkzQzcuMzA0MDUgOC40MTE5MyA3LjYzODcyIDguMjc1OTYgNy45MTA2NiA4LjAwNDAyQzguMTgyNiA3LjczMjA4IDguMzE4NTcgNy4zOTc0MSA4LjMxODU3IDdDOC4zMTg1NyA2LjYwMjU5IDguMTgyNiA2LjI2NzkyIDcuOTEwNjYgNS45OTU5OEM3LjYzODcyIDUuNzI0MDQgNy4zMDQwNSA1LjU4ODA3IDYuOTA2NjUgNS41ODgwN0M2LjUwOTI0IDUuNTg4MDcgNi4xNzQ1NyA1LjcyNDA0IDUuOTAyNjMgNS45OTU5OEM1LjYzMDY5IDYuMjY3OTIgNS40OTQ3MiA2LjYwMjU5IDUuNDk0NzIgN0M1LjQ5NDcyIDcuMzk3NDEgNS42MzA2OSA3LjczMjA4IDUuOTAyNjMgOC4wMDQwMkM2LjE3NDU3IDguMjc1OTYgNi41MDkyNCA4LjQxMTkzIDYuOTA2NjUgOC40MTE5M1pNNy4zNTQzMyAxMS43MzM3TDExLjQxNzkgOS40NzU1MlY1LjAwNDAyTDkuMDk0NzkgNi4zMDA1OEM5LjEzODA3IDYuNDA1NzMgOS4xNjg3MSA2LjUxOTQzIDkuMTg2NzQgNi42NDE2OEM5LjIwNDg3IDYuNzY0MDUgOS4yMTM5NCA2Ljg4MzQ5IDkuMjEzOTQgN0M5LjIxMzk0IDcuNTU2MjggOS4wMzg0MyA4LjA0NzI0IDguNjg3NCA4LjQ3Mjg4QzguMzM2NDggOC44OTg0MSA3Ljg5MjEzIDkuMTY2ODUgNy4zNTQzMyA5LjI3ODJWMTEuNzMzN1oiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo= ")',position:"absolute",left:"0px",top:"2px",lineHeight:"0",verticalAlign:"middle"},".cm-completionLabel":{marginLeft:"18px"}};let ML=class extends Pt{constructor(){super(...arguments),this.value="",this.expandIcon="expand-2",this.placeholder="",this.customAutoCompletions={},this.customCompletionsPaths=[],this.language="javascript",this.errorMessage="",this.error=!1,this.enableSearch=!1,this.noborder=!1,this.multiline=!1,this.enableFoldGutters=!1,this.allowVariableInCustomSuggestion=!1,this.lineNumbers=!1,this.disableSyntaxHighlighting=!1,this.customThemeCSS=eL,this.lineNumbersMultiline=!0,this.hasScroller=!0,this.expandable=!0,this.readonly=!1,this.debounce=!1,this.debounceTimeout=200,this.aboveCursor=!1,this.tabCompletion=!1,this.timeOut=null,this.lineNumbersComp=new on,this.restrictSingleLineComp=new on,this.readOnlyComp=new on,this.customCompletionComp=new on,this.placeholderComp=new on,this.defaultSyntaxHighlightingComp=new on,this.themeComp=new on,this.customAutocomplete=t=>{const e=t.state.doc.sliceString(0,t.pos),M=e.split("\n").at(-1)?.split(" ").at(-1)||"",[i,N]=function(t){const e=Math.max(t.lastIndexOf("."),t.lastIndexOf("["));return-1===e?[t,""]:[t.slice(0,e+1),t.slice(e+1)]}(M);return this.getNestedSuggestions(t,i,N)||this.getTopLevelSuggestions(t,i)},this.insertBetweenCode=t=>{const e=this.view.state.changeByRange((e=>{const{from:M,to:i}=e;return{changes:{from:M,to:i,insert:t},range:e}}));this.view.dispatch(e)}}static get styles(){return[Mo]}connectedCallback(){super.connectedCallback(),this.emit("nile-init",void 0,!1)}disconnectedCallback(){super.disconnectedCallback(),this.view.destroy(),this.emit("nile-destroy",void 0,!1)}firstUpdated(){this.createNewView(),this.emit("nile-after-init",{codeMirrorInstance:this.view,createNewView:this.createNewView,insertAtCursor:this.insertBetweenCode},!1)}getTabCompletionKeymap(){return this.tabCompletion?jl.of([{key:"Tab",run:iO}]):[]}updated(t){super.updated(t),t.has("value")&&this.view.state.doc.toString()!=this.value&&this.singleLineMultiLineToggle(),t.has("multiline")&&(this.view.dispatch({effects:[this.lineNumbersComp.reconfigure(this.getLineNumbersExension()),this.restrictSingleLineComp.reconfigure(this.getSingleLineExtension())]}),this.singleLineMultiLineToggle()),t.has("readonly")&&this.view.dispatch({effects:[this.readOnlyComp.reconfigure(this.getReadOnlyExtension())]}),t.has("placeholder")&&this.view.dispatch({effects:[this.placeholderComp.reconfigure(this.getPlaceholderExtension())]}),(t.has("lineNumbers")||t.has("lineNumbersMultiline"))&&this.view.dispatch({effects:[this.lineNumbersComp.reconfigure(this.getLineNumbersExension())]}),(t.has("customAutoCompletions")||t.has("customCompletionsPaths"))&&this.view.dispatch({effects:[this.customCompletionComp.reconfigure(gd.data.of({autocomplete:this.customAutocomplete}))]}),t.has("disableSyntaxHighlighting")&&this.view.dispatch({effects:[this.defaultSyntaxHighlightingComp.reconfigure(this.getDefaultSyntaxHighlightingExtension())]}),t.has("customThemeCSS")&&this.view.dispatch({effects:[this.themeComp.reconfigure(this.getCustomThemeExtension())]})}render(){const t=!!this.errorMessage,e=!!this.error,M=!!this.noborder,i=!this.hasScroller;return R`<div
6920
6920
  part="code-editor-base"
6921
6921
  class=${Lt({code__editor__container:!0,noborder:M,error:e||t,code__editor__singleline:!this.multiline,"no-scroller":i})}
6922
6922
  >
@@ -8004,7 +8004,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
8004
8004
  <slot name="filter__content" part="filter__content"></slot>
8005
8005
  </nile-popover>`:R``}
8006
8006
  </div>
8007
- </div>`:null}`}};t([gt({type:Boolean,reflect:!0})],CL.prototype,"havesort",void 0),t([gt({type:Boolean,reflect:!0})],CL.prototype,"havefilter",void 0),t([gt({type:String,reflect:!0,attribute:"icon-name"})],CL.prototype,"iconName",void 0),t([jt()],CL.prototype,"sorting_ct",void 0),CL=t([at("nile-table-header-item")],CL);const YL=n`
8007
+ </div>`:null}`}};t([gt({type:Boolean,reflect:!0})],CL.prototype,"havesort",void 0),t([gt({type:Boolean,reflect:!0})],CL.prototype,"havefilter",void 0),t([gt({type:String,reflect:!0,attribute:"icon-name"})],CL.prototype,"iconName",void 0),t([jt()],CL.prototype,"sorting_ct",void 0),CL=t([at("nile-table-header-item")],CL);const fL=n`
8008
8008
  :host {
8009
8009
  }
8010
8010
 
@@ -8091,7 +8091,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
8091
8091
  .variant__green {
8092
8092
  background: var(--nile-avatar-background-color-green);
8093
8093
  }
8094
- `;let bL=class extends Pt{constructor(){super(...arguments),this.src="",this.variant="text",this.icon="user",this.name="",this.bgColor="",this.textColor="#fff",this.borderColor="",this.size="md",this.isRounded=!0,this.imageError=!1}static get styles(){return[YL]}generateInitials(){if(!this.name)return"";const t=this.name.split(" ").filter((t=>t.length>0)).map((t=>t.charAt(0).toUpperCase())).slice(0,2);return t.length>1?t[0]+t[1]:t[0]}generateVariantCode(t){const e=t.charCodeAt(0),M=1==t.length?e:t.charCodeAt(1);return(e*M+e%23+M%23)%5}getDefaultIconSize(){switch(this.size){case"sm":return"10";case"md":default:return"16";case"lg":return"20";case"xl":return"24";case"2xl":return"28"}}render(){if("image"!=this.variant||this.imageError){const t=this.generateInitials();return"text"==this.variant&&t?this.getContentWrapped(R`${t}`,t):this.getContentWrapped(this.getIconContent(),t)}return this.getImageContent()}getContentWrapped(t,e){const M=this.generateVariantCode(e);return R`
8094
+ `;let bL=class extends Pt{constructor(){super(...arguments),this.src="",this.variant="text",this.icon="user",this.name="",this.bgColor="",this.textColor="#fff",this.borderColor="",this.size="md",this.isRounded=!0,this.imageError=!1}static get styles(){return[fL]}generateInitials(){if(!this.name)return"";const t=this.name.split(" ").filter((t=>t.length>0)).map((t=>t.charAt(0).toUpperCase())).slice(0,2);return t.length>1?t[0]+t[1]:t[0]}generateVariantCode(t){const e=t.charCodeAt(0),M=1==t.length?e:t.charCodeAt(1);return(e*M+e%23+M%23)%5}getDefaultIconSize(){switch(this.size){case"sm":return"10";case"md":default:return"16";case"lg":return"20";case"xl":return"24";case"2xl":return"28"}}render(){if("image"!=this.variant||this.imageError){const t=this.generateInitials();return"text"==this.variant&&t?this.getContentWrapped(R`${t}`,t):this.getContentWrapped(this.getIconContent(),t)}return this.getImageContent()}getContentWrapped(t,e){const M=this.generateVariantCode(e);return R`
8095
8095
  <div
8096
8096
  class=${Lt({text__avatar:!0,avatar__small:"sm"===this.size,avatar__medium:"md"===this.size,avatar__large:"lg"===this.size,avatar__extralarge:"xl"===this.size,avatar__2xl:"2xl"===this.size,avatar__rounded:this.isRounded,variant__orange:0===M&&!this.bgColor,variant__pink:1===M&&!this.bgColor,variant__blue:2===M&&!this.bgColor,variant__light_blue:3===M&&!this.bgColor,variant__green:4===M&&!this.bgColor})}
8097
8097
  part="avatar__content"
@@ -8116,7 +8116,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
8116
8116
  style=" background-image: url(${this.src}), linear-gradient(lightgray, lightgray);"
8117
8117
  @error="${()=>this.imageError=!0}"
8118
8118
  @load="${()=>this.imageError=!1}"
8119
- />`}};t([gt({type:String,reflect:!0})],bL.prototype,"src",void 0),t([gt({type:String,reflect:!0})],bL.prototype,"variant",void 0),t([gt({type:String,reflect:!0})],bL.prototype,"icon",void 0),t([gt({type:String,reflect:!0})],bL.prototype,"name",void 0),t([gt({type:String,reflect:!0,attribute:"bg-color"})],bL.prototype,"bgColor",void 0),t([gt({type:String,reflect:!0,attribute:"text-color"})],bL.prototype,"textColor",void 0),t([gt({type:String,reflect:!0,attribute:"border-color"})],bL.prototype,"borderColor",void 0),t([gt({reflect:!0})],bL.prototype,"size",void 0),t([gt({type:Boolean,reflect:!0})],bL.prototype,"isRounded",void 0),t([jt()],bL.prototype,"imageError",void 0),bL=t([at("nile-avatar")],bL);const fL=n`
8119
+ />`}};t([gt({type:String,reflect:!0})],bL.prototype,"src",void 0),t([gt({type:String,reflect:!0})],bL.prototype,"variant",void 0),t([gt({type:String,reflect:!0})],bL.prototype,"icon",void 0),t([gt({type:String,reflect:!0})],bL.prototype,"name",void 0),t([gt({type:String,reflect:!0,attribute:"bg-color"})],bL.prototype,"bgColor",void 0),t([gt({type:String,reflect:!0,attribute:"text-color"})],bL.prototype,"textColor",void 0),t([gt({type:String,reflect:!0,attribute:"border-color"})],bL.prototype,"borderColor",void 0),t([gt({reflect:!0})],bL.prototype,"size",void 0),t([gt({type:Boolean,reflect:!0})],bL.prototype,"isRounded",void 0),t([jt()],bL.prototype,"imageError",void 0),bL=t([at("nile-avatar")],bL);const YL=n`
8120
8120
  :host {
8121
8121
  display: block;
8122
8122
  width: 100%;
@@ -8152,7 +8152,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
8152
8152
  [hidden] {
8153
8153
  display: none;
8154
8154
  }
8155
- `;let vL=class extends Pt{constructor(){super(...arguments),this.heading="",this.subHeading=""}static get styles(){return[fL]}render(){return R`<slot class="header">
8155
+ `;let vL=class extends Pt{constructor(){super(...arguments),this.heading="",this.subHeading=""}static get styles(){return[YL]}render(){return R`<slot class="header">
8156
8156
  <slot
8157
8157
  name="header__heading"
8158
8158
  class="header__heading"
@@ -10387,7 +10387,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
10387
10387
  input[type="file"] {
10388
10388
  display: none;
10389
10389
  }
10390
- `,t([zt(".editor")],Cx.prototype,"editor",void 0),t([zt(".image-input")],Cx.prototype,"fileInput",void 0),t([jt()],Cx.prototype,"content",void 0),t([jt()],Cx.prototype,"currentAlign",void 0),Cx=t([at("nile-richcodeeditor")],Cx);const Yx=n`
10390
+ `,t([zt(".editor")],Cx.prototype,"editor",void 0),t([zt(".image-input")],Cx.prototype,"fileInput",void 0),t([jt()],Cx.prototype,"content",void 0),t([jt()],Cx.prototype,"currentAlign",void 0),Cx=t([at("nile-richcodeeditor")],Cx);const fx=n`
10391
10391
  :host {
10392
10392
  /* you can add host-level vars or rules here if needed */
10393
10393
  }
@@ -10611,9 +10611,9 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
10611
10611
  } */
10612
10612
 
10613
10613
 
10614
- `;var bx;let fx=bx=class extends rt{constructor(){super(...arguments),this.toolbar="",this.mentions={},this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionSuggestions=[],this.mentionFiltered=[],this.mentionX=0,this.mentionY=0,this.previewHTML="",this.characterCount=0,this.wordCount=0,this.lastRange=null}createRenderRoot(){return this}get parsedToolbar(){return this.toolbar?this.toolbar.split(",").map((t=>t.trim())).filter((t=>Object.keys(this.constructor.TOOLBAR_CONFIG).includes(t))):["bold","italic","underline","font","fontsize","color","background","border","left","center","right","justify","ul","ol","heading","link","hr"]}render(){return R`
10614
+ `;var bx;let Yx=bx=class extends rt{constructor(){super(...arguments),this.toolbar="",this.mentions={},this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionSuggestions=[],this.mentionFiltered=[],this.mentionX=0,this.mentionY=0,this.previewHTML="",this.characterCount=0,this.wordCount=0,this.lastRange=null}createRenderRoot(){return this}get parsedToolbar(){return this.toolbar?this.toolbar.split(",").map((t=>t.trim())).filter((t=>Object.keys(this.constructor.TOOLBAR_CONFIG).includes(t))):["bold","italic","underline","font","fontsize","color","background","border","left","center","right","justify","ul","ol","heading","link","hr"]}render(){return R`
10615
10615
  <style>
10616
- ${Yx}
10616
+ ${fx}
10617
10617
  </style>
10618
10618
 
10619
10619
  <input id="imageInput" type="file" accept="image/*" @change="${this.onImageSelected}" />
@@ -10650,7 +10650,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
10650
10650
  <div class="preview">
10651
10651
  <div class="content">${pt(this.previewHTML)}</div>
10652
10652
  </div>
10653
- `}onKeyUp(t){const e=t.key;this.saveSelection(),!this.mentionOpen&&this.mentions[e]&&this.openMention(e)}onKeyDown(t){if(!this.mentionOpen)return;const e=t.key;"ArrowDown"!==e&&"ArrowUp"!==e&&"Enter"!==e||(t.preventDefault(),"Enter"===e&&this.mentionFiltered.length&&this.selectMention(this.mentionFiltered[0]))}openMention(t){if(this.saveSelection(),!this.lastRange)return;const e=this.lastRange.cloneRange();e.collapse(!1);const M=e.getClientRects();if(!M.length)return void console.error("no caret rect; is the range in a text node?");const i=M[0],N=this.editor.closest(".editor-container"),o=N?N.getBoundingClientRect():this.editor.getBoundingClientRect();this.mentionX=i.left-o.left+(this.editor.scrollLeft||0),this.mentionY=i.bottom-o.top+(this.editor.scrollTop||0),this.mentionTrigger=t,this.mentionSuggestions=this.mentions[t]||[],this.mentionQuery="",this.updateMentionFiltered(),this.mentionOpen=!0}closeMention(){this.mentionOpen=!1,this.mentionTrigger=null}handleMention(){if(!this.mentionOpen||!this.mentionTrigger)return;const t=window.getSelection();if(!t||!t.anchorNode)return;const e=t.anchorNode.textContent||"",M=e.lastIndexOf(this.mentionTrigger);M>=0?(this.mentionQuery=e.substring(M+1),this.updateMentionFiltered()):this.closeMention()}updateMentionFiltered(){const t=this.mentionQuery.toLowerCase();this.mentionFiltered=this.mentionSuggestions.filter((e=>e.label.toLowerCase().startsWith(t)))}selectMention(t){if(this.restoreSelection(),!this.lastRange||!this.mentionTrigger)return;let e=this.lastRange.startContainer,M=this.lastRange.startOffset;if(e.nodeType!==Node.TEXT_NODE){const t=e.childNodes[M];if(t?.nodeType!==Node.TEXT_NODE)return;e=t,M=0}const i=e,N=(i.textContent||"").lastIndexOf(this.mentionTrigger,M);if(N<0)return;const o=N+1+this.mentionQuery.length,n=document.createRange();n.setStart(i,N),n.setEnd(i,o),n.deleteContents();const s=document.createElement("span");s.classList.add("mention"),s.textContent=`${this.mentionTrigger}${t.key}`,n.insertNode(s);const r=document.createTextNode(" ");s.after(r);const D=window.getSelection(),a=document.createRange();a.setStartAfter(r),a.collapse(!0),D?.removeAllRanges(),D?.addRange(a),this.lastRange=a.cloneRange(),this.closeMention(),this.syncPreview()}saveSelection(){const t=window.getSelection();t&&t.rangeCount&&(this.lastRange=t.getRangeAt(0).cloneRange())}restoreSelection(){const t=window.getSelection();t?.removeAllRanges(),this.lastRange&&t?.addRange(this.lastRange)}format(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement(t);e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}formatHeadingFromDropdown(t){if(!t)return;if(this.restoreSelection(),!this.lastRange)return;let e=this.lastRange.startContainer;for(;e&&e!==this.editor&&!(e instanceof HTMLElement&&/^(H[1-6]|P|DIV)$/i.test(e.tagName));)e=e.parentNode;if(e instanceof HTMLElement&&e!==this.editor){const M=document.createElement(t);return M.innerHTML=e.innerHTML,e.replaceWith(M),void this.afterEdit(M)}const M=document.createElement(t);M.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(M),this.afterEdit(M)}formatAlign(t){if(this.restoreSelection(),!this.lastRange)return;let e=this.lastRange.startContainer;for(;e&&e!==this.editor&&!(e instanceof HTMLElement&&"block"===getComputedStyle(e).display);)e=e.parentNode;if(e instanceof HTMLElement&&e!==this.editor)return e.style.textAlign=e.style.textAlign===t?"":t,void this.afterEdit(e);const M=document.createElement("div");M.style.textAlign=t,M.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(M),this.afterEdit(M)}formatList(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement(t),M=this.lastRange.extractContents(),i=document.createElement("div");i.appendChild(M),i.childNodes.forEach((t=>{const M=document.createElement("li");M.appendChild(t),e.appendChild(M)})),this.lastRange.insertNode(e),this.afterEdit(e)}promptLink(){const t=prompt("Enter URL:","https://");t&&this.formatLink(t)}formatColor(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("span");e.style.color=t,e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e);const M=this.querySelector(".color-bar");M&&(M.style.backgroundColor=t)}formatBackgroundColor(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("span");e.style.backgroundColor=t,e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}formatLink(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("a");e.href=t,e.target="_blank",e.rel="noopener",e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}promptImage(){this.imageInput.value="",this.imageInput.click()}onImageSelected(t){const e=t.target;if(e.files?.length){const t=new FileReader;t.onload=()=>this.formatImage(t.result),t.readAsDataURL(e.files[0])}}formatImage(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("img");e.src=t,e.alt="Image",this.lastRange.insertNode(e),this.afterEdit(e)}formatFontFamily(t){if(!t)return;if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("span");e.style.fontFamily=t,e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}formatFontSize(t){if(!t)return;if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("span");e.style.fontSize=t,e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}toggleBorder(){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement("span");t.style.border="1px solid #000",t.style.padding="2px",t.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(t),this.afterEdit(t)}insertHorizontalRule(){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement("hr");this.lastRange.insertNode(t),this.afterEdit(t)}formatQuote(){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement("blockquote");t.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(t),this.afterEdit(t)}formatCode(){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement("code");t.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(t),this.afterEdit(t)}afterEdit(t){const e=document.createRange();e.setStartAfter(t),e.collapse(!0);const M=window.getSelection();M?.removeAllRanges(),M?.addRange(e),this.saveSelection(),this.syncPreview()}updateCounts(){const t=this.editor.textContent||"";this.characterCount=t.length,this.wordCount=t.trim()?t.trim().split(/\s+/).length:0}syncPreview(){this.previewHTML=this.editor.innerHTML,this.updateCounts(),console.log("nile-lightdomeditor content-changed:",this.previewHTML),this.dispatchEvent(new CustomEvent("content-changed",{detail:{html:this.previewHTML},bubbles:!0,composed:!0}))}};fx.TOOLBAR_CONFIG={bold:t=>R`<button type="button" @click="${()=>t.format("b")}" title="Bold" class="format-btn">
10653
+ `}onKeyUp(t){const e=t.key;this.saveSelection(),!this.mentionOpen&&this.mentions[e]&&this.openMention(e)}onKeyDown(t){if(!this.mentionOpen)return;const e=t.key;"ArrowDown"!==e&&"ArrowUp"!==e&&"Enter"!==e||(t.preventDefault(),"Enter"===e&&this.mentionFiltered.length&&this.selectMention(this.mentionFiltered[0]))}openMention(t){if(this.saveSelection(),!this.lastRange)return;const e=this.lastRange.cloneRange();e.collapse(!1);const M=e.getClientRects();if(!M.length)return void console.error("no caret rect; is the range in a text node?");const i=M[0],N=this.editor.closest(".editor-container"),o=N?N.getBoundingClientRect():this.editor.getBoundingClientRect();this.mentionX=i.left-o.left+(this.editor.scrollLeft||0),this.mentionY=i.bottom-o.top+(this.editor.scrollTop||0),this.mentionTrigger=t,this.mentionSuggestions=this.mentions[t]||[],this.mentionQuery="",this.updateMentionFiltered(),this.mentionOpen=!0}closeMention(){this.mentionOpen=!1,this.mentionTrigger=null}handleMention(){if(!this.mentionOpen||!this.mentionTrigger)return;const t=window.getSelection();if(!t||!t.anchorNode)return;const e=t.anchorNode.textContent||"",M=e.lastIndexOf(this.mentionTrigger);M>=0?(this.mentionQuery=e.substring(M+1),this.updateMentionFiltered()):this.closeMention()}updateMentionFiltered(){const t=this.mentionQuery.toLowerCase();this.mentionFiltered=this.mentionSuggestions.filter((e=>e.label.toLowerCase().startsWith(t)))}selectMention(t){if(this.restoreSelection(),!this.lastRange||!this.mentionTrigger)return;let e=this.lastRange.startContainer,M=this.lastRange.startOffset;if(e.nodeType!==Node.TEXT_NODE){const t=e.childNodes[M];if(t?.nodeType!==Node.TEXT_NODE)return;e=t,M=0}const i=e,N=(i.textContent||"").lastIndexOf(this.mentionTrigger,M);if(N<0)return;const o=N+1+this.mentionQuery.length,n=document.createRange();n.setStart(i,N),n.setEnd(i,o),n.deleteContents();const s=document.createElement("span");s.classList.add("mention"),s.textContent=`${this.mentionTrigger}${t.key}`,n.insertNode(s);const r=document.createTextNode(" ");s.after(r);const D=window.getSelection(),a=document.createRange();a.setStartAfter(r),a.collapse(!0),D?.removeAllRanges(),D?.addRange(a),this.lastRange=a.cloneRange(),this.closeMention(),this.syncPreview()}saveSelection(){const t=window.getSelection();t&&t.rangeCount&&(this.lastRange=t.getRangeAt(0).cloneRange())}restoreSelection(){const t=window.getSelection();t?.removeAllRanges(),this.lastRange&&t?.addRange(this.lastRange)}format(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement(t);e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}formatHeadingFromDropdown(t){if(!t)return;if(this.restoreSelection(),!this.lastRange)return;let e=this.lastRange.startContainer;for(;e&&e!==this.editor&&!(e instanceof HTMLElement&&/^(H[1-6]|P|DIV)$/i.test(e.tagName));)e=e.parentNode;if(e instanceof HTMLElement&&e!==this.editor){const M=document.createElement(t);return M.innerHTML=e.innerHTML,e.replaceWith(M),void this.afterEdit(M)}const M=document.createElement(t);M.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(M),this.afterEdit(M)}formatAlign(t){if(this.restoreSelection(),!this.lastRange)return;let e=this.lastRange.startContainer;for(;e&&e!==this.editor&&!(e instanceof HTMLElement&&"block"===getComputedStyle(e).display);)e=e.parentNode;if(e instanceof HTMLElement&&e!==this.editor)return e.style.textAlign=e.style.textAlign===t?"":t,void this.afterEdit(e);const M=document.createElement("div");M.style.textAlign=t,M.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(M),this.afterEdit(M)}formatList(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement(t),M=this.lastRange.extractContents(),i=document.createElement("div");i.appendChild(M),i.childNodes.forEach((t=>{const M=document.createElement("li");M.appendChild(t),e.appendChild(M)})),this.lastRange.insertNode(e),this.afterEdit(e)}promptLink(){const t=prompt("Enter URL:","https://");t&&this.formatLink(t)}formatColor(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("span");e.style.color=t,e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e);const M=this.querySelector(".color-bar");M&&(M.style.backgroundColor=t)}formatBackgroundColor(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("span");e.style.backgroundColor=t,e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}formatLink(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("a");e.href=t,e.target="_blank",e.rel="noopener",e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}promptImage(){this.imageInput.value="",this.imageInput.click()}onImageSelected(t){const e=t.target;if(e.files?.length){const t=new FileReader;t.onload=()=>this.formatImage(t.result),t.readAsDataURL(e.files[0])}}formatImage(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("img");e.src=t,e.alt="Image",this.lastRange.insertNode(e),this.afterEdit(e)}formatFontFamily(t){if(!t)return;if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("span");e.style.fontFamily=t,e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}formatFontSize(t){if(!t)return;if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement("span");e.style.fontSize=t,e.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(e),this.afterEdit(e)}toggleBorder(){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement("span");t.style.border="1px solid #000",t.style.padding="2px",t.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(t),this.afterEdit(t)}insertHorizontalRule(){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement("hr");this.lastRange.insertNode(t),this.afterEdit(t)}formatQuote(){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement("blockquote");t.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(t),this.afterEdit(t)}formatCode(){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement("code");t.appendChild(this.lastRange.extractContents()),this.lastRange.insertNode(t),this.afterEdit(t)}afterEdit(t){const e=document.createRange();e.setStartAfter(t),e.collapse(!0);const M=window.getSelection();M?.removeAllRanges(),M?.addRange(e),this.saveSelection(),this.syncPreview()}updateCounts(){const t=this.editor.textContent||"";this.characterCount=t.length,this.wordCount=t.trim()?t.trim().split(/\s+/).length:0}syncPreview(){this.previewHTML=this.editor.innerHTML,this.updateCounts(),console.log("nile-lightdomeditor content-changed:",this.previewHTML),this.dispatchEvent(new CustomEvent("content-changed",{detail:{html:this.previewHTML},bubbles:!0,composed:!0}))}};Yx.TOOLBAR_CONFIG={bold:t=>R`<button type="button" @click="${()=>t.format("b")}" title="Bold" class="format-btn">
10654
10654
  <strong>B</strong>
10655
10655
  </button>`,italic:t=>R`<button type="button" @click="${()=>t.format("i")}" title="Italic" class="format-btn">
10656
10656
  <em>I</em>
@@ -10732,7 +10732,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
10732
10732
  </svg>
10733
10733
  </button>`,hr:t=>R`<button type="button" @click="${()=>t.insertHorizontalRule()}" title="Horizontal Rule" class="format-btn">
10734
10734
  <span style="font-weight: bold;">—</span>
10735
- </button>`},t([gt({type:String})],fx.prototype,"toolbar",void 0),t([gt({attribute:"mentions",converter:{fromAttribute:t=>{try{const e=JSON.parse(t),M={};for(const t of Object.keys(e)){const i=e[t];Array.isArray(i)&&(M[t]=i.filter((t=>t&&"string"==typeof t.key&&"string"==typeof t.label)).map((t=>({key:t.key,label:t.label}))))}return M}catch{return{}}},toAttribute:t=>JSON.stringify(t)}})],fx.prototype,"mentions",void 0),t([jt()],fx.prototype,"mentionOpen",void 0),t([jt()],fx.prototype,"mentionTrigger",void 0),t([jt()],fx.prototype,"mentionQuery",void 0),t([jt()],fx.prototype,"mentionSuggestions",void 0),t([jt()],fx.prototype,"mentionFiltered",void 0),t([jt()],fx.prototype,"mentionX",void 0),t([jt()],fx.prototype,"mentionY",void 0),t([zt(".editor")],fx.prototype,"editor",void 0),t([zt("#imageInput")],fx.prototype,"imageInput",void 0),t([jt()],fx.prototype,"previewHTML",void 0),t([jt()],fx.prototype,"characterCount",void 0),t([jt()],fx.prototype,"wordCount",void 0),fx=bx=t([at("nile-lightdomeditor")],fx);let vx=class extends rt{createRenderRoot(){return this}shouldUpdate(){return!1}};vx=t([at("nile-rte-toolbar")],vx);let Zx=class extends rt{constructor(){super(...arguments),this.name="",this.label=""}createRenderRoot(){return this}shouldUpdate(){return!1}};t([gt({type:String})],Zx.prototype,"name",void 0),t([gt({type:String})],Zx.prototype,"label",void 0),Zx=t([at("nile-rte-toolbar-item")],Zx);const Vx=new Set(["p","h1","h2","h3","h4","h5","h6"]);function Wx(t){return Vx.has(t)}let Px=class extends rt{constructor(){super(...arguments),this.type="",this.options="[]",this.label="",this.selectedValue=""}createRenderRoot(){return this}mapAlignIcon(t){return{left:"align-left",center:"align-center",right:"align-right",justify:"nile-justify"}[t]||"align-left"}get parsedOptions(){const t=this.optionsObj??this.options;let e=(()=>{if(Array.isArray(t))return t;try{return JSON.parse(String(t))}catch{return[]}})().map((t=>{const e=t?.value??t;return{value:e,label:t?.label??t?.value??t,icon:t?.icon??("align"===this.type?this.mapAlignIcon(String(e)):void 0)}}));if("heading"===this.type){e.length;e=e.filter((t=>Wx(t.value))),e.length,this.selectedValue&&!Wx(this.selectedValue)&&(this.selectedValue="")}return e}ensureDefault(){if(!this.selectedValue){const t=this.parsedOptions[0];t&&(this.selectedValue=t.value)}}onSelect(t){"heading"!==this.type||Wx(t)?(this.selectedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))):console.warn(`[nile-rte-select] Ignoring invalid heading value: ${t}`)}connectedCallback(){super.connectedCallback(),this.injectLocalStyles()}injectLocalStyles(){if(this.querySelector("style[data-rte-select-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-select-style","true"),t.textContent="\n nile-menu.rte-align-menu::part(menu__items-wrapper) {\n display: flex;\n }\n nile-menu.rte-align-menu,\n nile-menu.rte-default-menu {\n margin-top: 0px;\n }\n nile-button.rte-align-trigger::part(base),\n nile-button.rte-default-trigger::part(base) {\n min-width: 32px;\n height: 32px;\n padding: 0px 6px;\n box-shadow: none;\n }\n ",this.insertBefore(t,this.firstChild)}render(){const t=this.parsedOptions;this.ensureDefault();const e=t.find((t=>t.value===this.selectedValue));if("align"===this.type){const M=e?.icon?R`<nile-icon name="${e.icon}"></nile-icon>`:this.label||"Align";return R`
10735
+ </button>`},t([gt({type:String})],Yx.prototype,"toolbar",void 0),t([gt({attribute:"mentions",converter:{fromAttribute:t=>{try{const e=JSON.parse(t),M={};for(const t of Object.keys(e)){const i=e[t];Array.isArray(i)&&(M[t]=i.filter((t=>t&&"string"==typeof t.key&&"string"==typeof t.label)).map((t=>({key:t.key,label:t.label}))))}return M}catch{return{}}},toAttribute:t=>JSON.stringify(t)}})],Yx.prototype,"mentions",void 0),t([jt()],Yx.prototype,"mentionOpen",void 0),t([jt()],Yx.prototype,"mentionTrigger",void 0),t([jt()],Yx.prototype,"mentionQuery",void 0),t([jt()],Yx.prototype,"mentionSuggestions",void 0),t([jt()],Yx.prototype,"mentionFiltered",void 0),t([jt()],Yx.prototype,"mentionX",void 0),t([jt()],Yx.prototype,"mentionY",void 0),t([zt(".editor")],Yx.prototype,"editor",void 0),t([zt("#imageInput")],Yx.prototype,"imageInput",void 0),t([jt()],Yx.prototype,"previewHTML",void 0),t([jt()],Yx.prototype,"characterCount",void 0),t([jt()],Yx.prototype,"wordCount",void 0),Yx=bx=t([at("nile-lightdomeditor")],Yx);let vx=class extends rt{createRenderRoot(){return this}shouldUpdate(){return!1}};vx=t([at("nile-rte-toolbar")],vx);let Zx=class extends rt{constructor(){super(...arguments),this.name="",this.label=""}createRenderRoot(){return this}shouldUpdate(){return!1}};t([gt({type:String})],Zx.prototype,"name",void 0),t([gt({type:String})],Zx.prototype,"label",void 0),Zx=t([at("nile-rte-toolbar-item")],Zx);const Vx=new Set(["p","h1","h2","h3","h4","h5","h6"]);function Wx(t){return Vx.has(t)}let Px=class extends rt{constructor(){super(...arguments),this.type="",this.options="[]",this.label="",this.selectedValue=""}createRenderRoot(){return this}mapAlignIcon(t){return{left:"align-left",center:"align-center",right:"align-right",justify:"nile-justify"}[t]||"align-left"}get parsedOptions(){const t=this.optionsObj??this.options;let e=(()=>{if(Array.isArray(t))return t;try{return JSON.parse(String(t))}catch{return[]}})().map((t=>{const e=t?.value??t;return{value:e,label:t?.label??t?.value??t,icon:t?.icon??("align"===this.type?this.mapAlignIcon(String(e)):void 0)}}));if("heading"===this.type){e.length;e=e.filter((t=>Wx(t.value))),e.length,this.selectedValue&&!Wx(this.selectedValue)&&(this.selectedValue="")}return e}ensureDefault(){if(!this.selectedValue){const t=this.parsedOptions[0];t&&(this.selectedValue=t.value)}}onSelect(t){"heading"!==this.type||Wx(t)?(this.selectedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))):console.warn(`[nile-rte-select] Ignoring invalid heading value: ${t}`)}connectedCallback(){super.connectedCallback(),this.injectLocalStyles()}injectLocalStyles(){if(this.querySelector("style[data-rte-select-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-select-style","true"),t.textContent="\n nile-menu.rte-align-menu::part(menu__items-wrapper) {\n display: flex;\n }\n nile-menu.rte-align-menu,\n nile-menu.rte-default-menu {\n margin-top: 0px;\n }\n nile-button.rte-align-trigger::part(base),\n nile-button.rte-default-trigger::part(base) {\n min-width: 32px;\n height: 32px;\n padding: 0px 6px;\n box-shadow: none;\n }\n ",this.insertBefore(t,this.firstChild)}render(){const t=this.parsedOptions;this.ensureDefault();const e=t.find((t=>t.value===this.selectedValue));if("align"===this.type){const M=e?.icon?R`<nile-icon name="${e.icon}"></nile-icon>`:this.label||"Align";return R`
10736
10736
  <nile-dropdown class="rte-align-dd">
10737
10737
  <nile-button slot="trigger" variant="tertiary" class="rte-align-trigger">
10738
10738
  ${M}
@@ -10783,7 +10783,7 @@ class MN{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
10783
10783
  `))}
10784
10784
  </nile-menu>
10785
10785
  </nile-dropdown>
10786
- `}};t([gt({type:String})],Px.prototype,"type",void 0),t([gt({type:String})],Px.prototype,"options",void 0),t([gt({attribute:!1})],Px.prototype,"optionsObj",void 0),t([gt({type:String})],Px.prototype,"label",void 0),t([jt()],Px.prototype,"selectedValue",void 0),Px=t([at("nile-rte-select")],Px);let Rx=class extends rt{constructor(){super(...arguments),this.type="foreColor",this.label="Text Color",this.value="#000000"}createRenderRoot(){return this}shouldUpdate(){return!1}};t([gt({type:String})],Rx.prototype,"type",void 0),t([gt({type:String})],Rx.prototype,"label",void 0),t([gt({type:String})],Rx.prototype,"value",void 0),Rx=t([at("nile-rte-color")],Rx);let Gx=class extends rt{createRenderRoot(){return this}shouldUpdate(){return!1}};Gx=t([at("nile-rte-divider")],Gx);let Bx=class extends rt{createRenderRoot(){return this}shouldUpdate(){return!1}};Bx=t([at("nile-rte-preview")],Bx);let _x=class extends rt{constructor(){super(...arguments),this.mentions={},this.mentionFormat={},this.itemsFormats={},this.mentionColors={},this.externalConfig={},this.itemsConfig={},this.itemsColors={},this.editorEl=null,this.hostEl=null,this.dropdownEl=null,this.menuEl=null,this.lastRange=null,this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionSuggestions=[],this.mentionFiltered=[],this.mentionX=0,this.mentionY=0,this.triggerBtn=null,this.mo=null,this.onSelectionChange=()=>{if(!this.editorEl)return;const t=document.getSelection();if(!t||0===t.rangeCount)return;const e=t.getRangeAt(0);this.editorEl.contains(e.commonAncestorContainer)&&(this.lastRange=e.cloneRange())},this.saveSelection=()=>{const t=window.getSelection();t&&t.rangeCount&&(this.lastRange=t.getRangeAt(0).cloneRange())},this.onEditorInput=()=>{this.mentionOpen&&this.handleMention()},this.onEditorKeyUp=t=>{this.saveSelection();const e=t.key,M=this.config;!this.mentionOpen&&e&&M[e]?this.openMention(e):this.mentionOpen&&this.handleMention()},this.onEditorKeyDown=t=>{if(!this.mentionOpen)return;const e=t.key;"ArrowDown"===e||"ArrowUp"===e||"Enter"===e?(t.preventDefault(),"Enter"===e&&this.mentionFiltered.length&&this.selectMention(this.mentionFiltered[0])):"Escape"===e&&(t.preventDefault(),this.closeMention())},this.repositionMention=()=>{if(!this.mentionOpen||!this.hostEl||!this.triggerBtn)return;const t=this.getCaretClientRect();if(!t)return;const e=this.hostEl.getBoundingClientRect();this.mentionX=t.left-e.left,this.mentionY=t.bottom-e.top,this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`}}createRenderRoot(){return this}getTriggerFormat(t){const e=this.itemsFormats[t]||{},M=this.mentionFormat[t]||{};return{prefix:e.prefix??M.prefix??"",suffix:e.suffix??M.suffix??""}}formatLabel(t,e){const{prefix:M,suffix:i}=this.getTriggerFormat(t);return`${M??""}${e}${i??""}`}get config(){return{...this.externalConfig,...this.mentions,...this.itemsConfig}}attach(t,e){this.editorEl=t,this.hostEl=e,this.injectStyles(),this.ensureMentionDropdown(),this.rebuildConfigFromChildren(),this.mo=new MutationObserver((()=>this.rebuildConfigFromChildren())),this.mo.observe(this,{childList:!0,subtree:!0,attributes:!0}),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.saveSelection),this.editorEl.addEventListener("keyup",this.onEditorKeyUp),this.editorEl.addEventListener("keydown",this.onEditorKeyDown),this.editorEl.addEventListener("scroll",this.repositionMention),document.addEventListener("selectionchange",this.onSelectionChange,!0)}detach(){this.mo&&(this.mo.disconnect(),this.mo=null),this.editorEl&&(this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.saveSelection),this.editorEl.removeEventListener("keyup",this.onEditorKeyUp),this.editorEl.removeEventListener("keydown",this.onEditorKeyDown),this.editorEl.removeEventListener("scroll",this.repositionMention)),document.removeEventListener("selectionchange",this.onSelectionChange,!0)}setExternalConfig(t){this.externalConfig=t||{}}disconnectedCallback(){this.detach(),super.disconnectedCallback()}rebuildConfigFromChildren(){const t={},e={},M={},i=Array.from(this.querySelectorAll("nile-rte-mentions-item"));for(const N of i){const i=N.mentionsCharacter??N.getAttribute("mentionscharacter")??"";if(!i||"string"!=typeof i)continue;let o=N.mentionsData??(()=>{const t=N.getAttribute("mentionsdata");if(!t)return null;try{const e=JSON.parse(t);return Array.isArray(e)?e.filter((t=>t&&"string"==typeof t.key&&"string"==typeof t.label)):[]}catch{return[]}})();const n=N.mentionsColor??N.getAttribute("mentionscolor")??"",s=N.mentionsPrefix??N.getAttribute("mentionsprefix")??"",r=N.mentionsSuffix??N.getAttribute("mentionssuffix")??"";Array.isArray(o)||(o=[]),t[i]=o,n&&(e[i]=String(n)),(s||r)&&(M[i]={prefix:s,suffix:r})}this.itemsConfig=t,this.itemsColors=e,this.itemsFormats=M}injectStyles(){if(this.querySelector("style[data-mentions-style]"))return;const t=document.createElement("style");t.setAttribute("data-mentions-style","true"),t.textContent="\n .mention-dropdown {\n position: absolute; z-index: 1000; list-style: none; margin: 0; padding: 4px;\n border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;\n box-shadow: 0 4px 10px rgba(0,0,0,.08); max-height: 180px; overflow: auto; font-size: 14px;\n }\n .mention-dropdown li { padding: 6px 8px; cursor: pointer; border-radius: 4px; }\n .mention-dropdown li:hover { background: #f1f5f9; }\n .mention { background: #eef2ff; padding: 0 3px; border-radius: 3px; }\n nile-menu.mentions-menu::part(menu__items-wrapper){\n max-height: 260px;\n }\n\n ",this.insertBefore(t,this.firstChild)}getTriggerColor(t){return this.itemsColors[t]??this.mentionColors[t]}ensureMentionDropdown(){if(this.dropdownEl||!this.hostEl)return;const t=document.createElement("nile-dropdown");t.style.zIndex="1000";const e=document.createElement("nile-button");e.setAttribute("slot","trigger"),e.style.position="absolute",e.style.width="1px",e.style.height="1px",e.style.border="0",e.style.padding="0",e.style.opacity="0",e.style.pointerEvents="none",t.appendChild(e),this.triggerBtn=e;const M=document.createElement("nile-menu");M.classList.add("mentions-menu"),t.appendChild(M),this.hostEl.appendChild(t),this.dropdownEl=t,this.menuEl=M}restoreSelection(){if(!this.lastRange)return;const t=document.getSelection();t&&(t.removeAllRanges(),t.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCaretClientRect(){const t=document.getSelection();if(!t||0===t.rangeCount)return null;const e=t.getRangeAt(0).cloneRange();e.collapse(!1);const M=e.getClientRects();if(M&&M.length>0)return M[0];const i=document.createElement("span");i.setAttribute("data-caret-marker","1"),i.textContent="​",e.insertNode(i);const N=i.getBoundingClientRect(),o=document.createRange();return o.setStartAfter(i),o.collapse(!0),t.removeAllRanges(),t.addRange(o),i.remove(),N||null}openMention(t){if(this.saveSelection(),!this.editorEl||!this.dropdownEl||!this.hostEl)return;const e=this.getCaretClientRect();if(!e)return;const M=this.hostEl.getBoundingClientRect();this.mentionX=e.left-M.left,this.mentionY=e.bottom-M.top,this.mentionTrigger=t,this.mentionSuggestions=this.config[t]||[],this.mentionQuery="",this.updateMentionFiltered(),this.mentionOpen=!0,this.renderMentionList()}closeMention(){this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionFiltered=[],this.dropdownEl?.removeAttribute("open")}handleMention(){if(!this.mentionOpen||!this.mentionTrigger)return;const t=window.getSelection();if(!t||!t.anchorNode)return;let e=t.anchorNode;if(e.nodeType!==Node.TEXT_NODE){const M=e.childNodes?.[t.anchorOffset]||e.firstChild;M?.nodeType===Node.TEXT_NODE&&(e=M)}const M=e&&e.nodeType===Node.TEXT_NODE&&e.textContent||"",i=M.lastIndexOf(this.mentionTrigger);i>=0?(this.mentionQuery=M.substring(i+1),this.updateMentionFiltered(),this.renderMentionList()):this.closeMention()}updateMentionFiltered(){const t=this.mentionQuery.toLowerCase();this.mentionFiltered=(this.mentionSuggestions||[]).filter((e=>e.label.toLowerCase().startsWith(t)))}renderMentionList(){if(this.dropdownEl&&this.menuEl&&this.triggerBtn)if(this.triggerBtn.style.position="absolute",this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`,this.menuEl.innerHTML="",this.mentionOpen&&this.mentionFiltered.length){for(const t of this.mentionFiltered){const e=document.createElement("nile-menu-item");this.formatLabel(this.mentionTrigger,t.label),e.textContent=t.label,e.addEventListener("mousedown",(e=>{e.preventDefault(),this.selectMention(t)})),this.menuEl.appendChild(e)}this.dropdownEl.setAttribute("open","")}else this.dropdownEl.removeAttribute("open")}selectMention(t){if(this.restoreSelection(),!this.lastRange||!this.mentionTrigger||!this.editorEl)return;let e=this.lastRange.startContainer,M=this.lastRange.startOffset;if(e.nodeType!==Node.TEXT_NODE){const t=e.childNodes[M];if(t?.nodeType!==Node.TEXT_NODE)return;e=t,M=0}const i=e,N=(i.textContent||"").lastIndexOf(this.mentionTrigger,M);if(N<0)return;const o=N+1+this.mentionQuery.length,n=document.createRange();n.setStart(i,N),n.setEnd(i,o),n.deleteContents();const s=document.createElement("span");s.classList.add("mention");const r=this.formatLabel(this.mentionTrigger,t.label),D=!(!this.getTriggerFormat(this.mentionTrigger).prefix&&!this.getTriggerFormat(this.mentionTrigger).suffix);s.textContent=D?r:`${this.mentionTrigger}${t.label}`;const a=this.getTriggerColor(this.mentionTrigger);a&&(s.style.backgroundColor=a),n.insertNode(s);const l=document.createTextNode(" ");s.after(l);const u=window.getSelection(),g=document.createRange();g.setStartAfter(l),g.collapse(!0),u?.removeAllRanges(),u?.addRange(g),this.lastRange=g.cloneRange(),this.closeMention(),this.editorEl.dispatchEvent(new InputEvent("input",{bubbles:!0}))}};function Fx(t,e){for(;t&&t!==e;){if(t instanceof HTMLElement){const e=getComputedStyle(t).display;if(t.tagName.match(/^(P|DIV|H1|H2|H3|H4|H5|H6|LI)$/)||"block"===e||"list-item"===e)return t}t=t?.parentNode||null}return e}function Jx(t){const e=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!e)return"#000000";return`#${Number(e[1]).toString(16).padStart(2,"0")}${Number(e[2]).toString(16).padStart(2,"0")}${Number(e[3]).toString(16).padStart(2,"0")}`}function Hx(t,e,M){const i=document.createElement(e);M&&Object.entries(M).forEach((([t,e])=>i.setAttribute(t,e)));try{t.surroundContents(i)}catch{const e=t.extractContents();i.appendChild(e),t.insertNode(i)}}function Xx(t,e,M){const i=document.getSelection();if(!i||0===i.rangeCount)return;const N=i.getRangeAt(0);if(N.collapsed){const t=document.createElement(e);M&&Object.entries(M).forEach((([e,M])=>t.setAttribute(e,M))),t.appendChild(document.createTextNode("​")),N.insertNode(t);const o=document.createRange();return o.setStart(t.firstChild,1),o.collapse(!0),i.removeAllRanges(),void i.addRange(o)}let o=N.startContainer,n=null;for(;o&&o!==t;){if(o instanceof HTMLElement&&o.tagName.toLowerCase()===e){n=o;break}o=o.parentNode}n?function(t){const e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}}(n):Hx(N,e,M)}function $x(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=Fx(M.getRangeAt(0).startContainer,t);i&&(i.style.textAlign="justify"===e?"justify":e)}t([gt({attribute:"mentions",converter:{fromAttribute:t=>{try{const e=JSON.parse(t),M={};for(const t of Object.keys(e)){const i=e[t];Array.isArray(i)&&(M[t]=i.filter((t=>t&&"string"==typeof t.key&&"string"==typeof t.label)).map((t=>({key:t.key,label:t.label}))))}return M}catch{return{}}},toAttribute:t=>JSON.stringify(t)}})],_x.prototype,"mentions",void 0),t([gt({attribute:"mentionformat",converter:{fromAttribute:t=>{try{const e=JSON.parse(t);return e&&"object"==typeof e?e:{}}catch{return{}}},toAttribute:t=>JSON.stringify(t??{})}})],_x.prototype,"mentionFormat",void 0),t([jt()],_x.prototype,"itemsFormats",void 0),t([gt({attribute:"mentioncolors",converter:{fromAttribute:t=>{try{const e=JSON.parse(t);return e&&"object"==typeof e?e:{}}catch{return{}}},toAttribute:t=>JSON.stringify(t??{})}})],_x.prototype,"mentionColors",void 0),t([jt()],_x.prototype,"externalConfig",void 0),t([jt()],_x.prototype,"itemsConfig",void 0),t([jt()],_x.prototype,"itemsColors",void 0),_x=t([at("nile-rte-mentions")],_x);const qx=n`
10786
+ `}};t([gt({type:String})],Px.prototype,"type",void 0),t([gt({type:String})],Px.prototype,"options",void 0),t([gt({attribute:!1})],Px.prototype,"optionsObj",void 0),t([gt({type:String})],Px.prototype,"label",void 0),t([jt()],Px.prototype,"selectedValue",void 0),Px=t([at("nile-rte-select")],Px);let Rx=class extends rt{constructor(){super(...arguments),this.type="foreColor",this.label="Text Color",this.value="#000000"}createRenderRoot(){return this}shouldUpdate(){return!1}};t([gt({type:String})],Rx.prototype,"type",void 0),t([gt({type:String})],Rx.prototype,"label",void 0),t([gt({type:String})],Rx.prototype,"value",void 0),Rx=t([at("nile-rte-color")],Rx);let Gx=class extends rt{createRenderRoot(){return this}shouldUpdate(){return!1}};Gx=t([at("nile-rte-divider")],Gx);let Bx=class extends rt{createRenderRoot(){return this}shouldUpdate(){return!1}};Bx=t([at("nile-rte-preview")],Bx);let _x=class extends rt{constructor(){super(...arguments),this.mentions={},this.mentionFormat={},this.itemsFormats={},this.mentionColors={},this.externalConfig={},this.itemsConfig={},this.itemsColors={},this.editorEl=null,this.hostEl=null,this.dropdownEl=null,this.menuEl=null,this.lastRange=null,this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionSuggestions=[],this.mentionFiltered=[],this.mentionX=0,this.mentionY=0,this.triggerBtn=null,this.mo=null,this.onSelectionChange=()=>{if(!this.editorEl)return;const t=document.getSelection();if(!t||0===t.rangeCount)return;const e=t.getRangeAt(0);this.editorEl.contains(e.commonAncestorContainer)&&(this.lastRange=e.cloneRange())},this.saveSelection=()=>{const t=window.getSelection();t&&t.rangeCount&&(this.lastRange=t.getRangeAt(0).cloneRange())},this.onEditorInput=()=>{this.mentionOpen&&this.handleMention()},this.onEditorKeyUp=t=>{this.saveSelection();const e=t.key,M=this.config;!this.mentionOpen&&e&&M[e]?this.openMention(e):this.mentionOpen&&this.handleMention()},this.onEditorKeyDown=t=>{if(!this.mentionOpen)return;const e=t.key;"ArrowDown"===e||"ArrowUp"===e||"Enter"===e?(t.preventDefault(),"Enter"===e&&this.mentionFiltered.length&&this.selectMention(this.mentionFiltered[0])):"Escape"===e&&(t.preventDefault(),this.closeMention())},this.repositionMention=()=>{if(!this.mentionOpen||!this.hostEl||!this.triggerBtn)return;const t=this.getCaretClientRect();if(!t)return;const e=this.hostEl.getBoundingClientRect();this.mentionX=t.left-e.left,this.mentionY=t.bottom-e.top,this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`}}createRenderRoot(){return this}getTriggerFormat(t){const e=this.itemsFormats[t]||{},M=this.mentionFormat[t]||{};return{prefix:e.prefix??M.prefix??"",suffix:e.suffix??M.suffix??""}}formatLabel(t,e){const{prefix:M,suffix:i}=this.getTriggerFormat(t);return`${M??""}${e}${i??""}`}get config(){return{...this.externalConfig,...this.mentions,...this.itemsConfig}}attach(t,e){this.editorEl=t,this.hostEl=e,this.injectStyles(),this.ensureMentionDropdown(),this.rebuildConfigFromChildren(),this.mo=new MutationObserver((()=>this.rebuildConfigFromChildren())),this.mo.observe(this,{childList:!0,subtree:!0,attributes:!0}),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.saveSelection),this.editorEl.addEventListener("keyup",this.onEditorKeyUp),this.editorEl.addEventListener("keydown",this.onEditorKeyDown),this.editorEl.addEventListener("scroll",this.repositionMention),document.addEventListener("selectionchange",this.onSelectionChange,!0)}detach(){this.mo&&(this.mo.disconnect(),this.mo=null),this.editorEl&&(this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.saveSelection),this.editorEl.removeEventListener("keyup",this.onEditorKeyUp),this.editorEl.removeEventListener("keydown",this.onEditorKeyDown),this.editorEl.removeEventListener("scroll",this.repositionMention)),document.removeEventListener("selectionchange",this.onSelectionChange,!0)}setExternalConfig(t){this.externalConfig=t||{}}disconnectedCallback(){this.detach(),super.disconnectedCallback()}rebuildConfigFromChildren(){const t={},e={},M={},i=Array.from(this.querySelectorAll("nile-rte-mentions-item"));for(const N of i){const i=N.mentionsCharacter??N.getAttribute("mentionscharacter")??"";if(!i||"string"!=typeof i)continue;let o=N.mentionsData??(()=>{const t=N.getAttribute("mentionsdata");if(!t)return null;try{const e=JSON.parse(t);return Array.isArray(e)?e.filter((t=>t&&"string"==typeof t.key&&"string"==typeof t.label)):[]}catch{return[]}})();const n=N.mentionsColor??N.getAttribute("mentionscolor")??"",s=N.mentionsPrefix??N.getAttribute("mentionsprefix")??"",r=N.mentionsSuffix??N.getAttribute("mentionssuffix")??"";Array.isArray(o)||(o=[]),t[i]=o,n&&(e[i]=String(n)),(s||r)&&(M[i]={prefix:s,suffix:r})}this.itemsConfig=t,this.itemsColors=e,this.itemsFormats=M}injectStyles(){if(this.querySelector("style[data-mentions-style]"))return;const t=document.createElement("style");t.setAttribute("data-mentions-style","true"),t.textContent="\n .mention-dropdown {\n position: absolute; z-index: 1000; list-style: none; margin: 0; padding: 4px;\n border: 1px solid #e5e7eb; border-radius: 6px; background: #fff;\n box-shadow: 0 4px 10px rgba(0,0,0,.08); max-height: 180px; overflow: auto; font-size: 14px;\n }\n .mention-dropdown li { padding: 6px 8px; cursor: pointer; border-radius: 4px; }\n .mention-dropdown li:hover { background: #f1f5f9; }\n .mention { background: #eef2ff; padding: 0 3px; border-radius: 3px; }\n nile-menu.mentions-menu::part(menu__items-wrapper){\n max-height: 260px;\n }\n\n ",this.insertBefore(t,this.firstChild)}getTriggerColor(t){return this.itemsColors[t]??this.mentionColors[t]}ensureMentionDropdown(){if(this.dropdownEl||!this.hostEl)return;const t=document.createElement("nile-dropdown");t.style.zIndex="1000";const e=document.createElement("nile-button");e.setAttribute("slot","trigger"),e.style.position="absolute",e.style.width="1px",e.style.height="1px",e.style.border="0",e.style.padding="0",e.style.opacity="0",e.style.pointerEvents="none",t.appendChild(e),this.triggerBtn=e;const M=document.createElement("nile-menu");M.classList.add("mentions-menu"),t.appendChild(M),this.hostEl.appendChild(t),this.dropdownEl=t,this.menuEl=M}restoreSelection(){if(!this.lastRange)return;const t=document.getSelection();t&&(t.removeAllRanges(),t.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCaretClientRect(){const t=document.getSelection();if(!t||0===t.rangeCount)return null;const e=t.getRangeAt(0).cloneRange();e.collapse(!1);const M=e.getClientRects();if(M&&M.length>0)return M[0];const i=document.createElement("span");i.setAttribute("data-caret-marker","1"),i.textContent="​",e.insertNode(i);const N=i.getBoundingClientRect(),o=document.createRange();return o.setStartAfter(i),o.collapse(!0),t.removeAllRanges(),t.addRange(o),i.remove(),N||null}openMention(t){if(this.saveSelection(),!this.editorEl||!this.dropdownEl||!this.hostEl)return;const e=this.getCaretClientRect();if(!e)return;const M=this.hostEl.getBoundingClientRect();this.mentionX=e.left-M.left,this.mentionY=e.bottom-M.top,this.mentionTrigger=t,this.mentionSuggestions=this.config[t]||[],this.mentionQuery="",this.updateMentionFiltered(),this.mentionOpen=!0,this.renderMentionList()}closeMention(){this.mentionOpen=!1,this.mentionTrigger=null,this.mentionQuery="",this.mentionFiltered=[],this.dropdownEl?.removeAttribute("open")}handleMention(){if(!this.mentionOpen||!this.mentionTrigger)return;const t=window.getSelection();if(!t||!t.anchorNode)return;let e=t.anchorNode;if(e.nodeType!==Node.TEXT_NODE){const M=e.childNodes?.[t.anchorOffset]||e.firstChild;M?.nodeType===Node.TEXT_NODE&&(e=M)}const M=e&&e.nodeType===Node.TEXT_NODE&&e.textContent||"",i=M.lastIndexOf(this.mentionTrigger);i>=0?(this.mentionQuery=M.substring(i+1),this.updateMentionFiltered(),this.renderMentionList()):this.closeMention()}updateMentionFiltered(){const t=this.mentionQuery.toLowerCase();this.mentionFiltered=(this.mentionSuggestions||[]).filter((e=>e.label.toLowerCase().startsWith(t)))}renderMentionList(){if(this.dropdownEl&&this.menuEl&&this.triggerBtn)if(this.triggerBtn.style.position="absolute",this.triggerBtn.style.left=`${this.mentionX}px`,this.triggerBtn.style.top=`${this.mentionY}px`,this.menuEl.innerHTML="",this.mentionOpen&&this.mentionFiltered.length){for(const t of this.mentionFiltered){const e=document.createElement("nile-menu-item");this.formatLabel(this.mentionTrigger,t.label),e.textContent=t.label,e.addEventListener("mousedown",(e=>{e.preventDefault(),this.selectMention(t)})),this.menuEl.appendChild(e)}this.dropdownEl.setAttribute("open","")}else this.dropdownEl.removeAttribute("open")}selectMention(t){if(this.restoreSelection(),!this.lastRange||!this.mentionTrigger||!this.editorEl)return;let e=this.lastRange.startContainer,M=this.lastRange.startOffset;if(e.nodeType!==Node.TEXT_NODE){const t=e.childNodes[M];if(t?.nodeType!==Node.TEXT_NODE)return;e=t,M=0}const i=e,N=(i.textContent||"").lastIndexOf(this.mentionTrigger,M);if(N<0)return;const o=N+1+this.mentionQuery.length,n=document.createRange();n.setStart(i,N),n.setEnd(i,o),n.deleteContents();const s=document.createElement("span");s.classList.add("mention");const r=this.formatLabel(this.mentionTrigger,t.label),D=!(!this.getTriggerFormat(this.mentionTrigger).prefix&&!this.getTriggerFormat(this.mentionTrigger).suffix);s.textContent=D?r:`${this.mentionTrigger}${t.label}`;const a=this.getTriggerColor(this.mentionTrigger);a&&(s.style.backgroundColor=a),n.insertNode(s);const l=document.createTextNode(" ");s.after(l);const u=window.getSelection(),g=document.createRange();g.setStartAfter(l),g.collapse(!0),u?.removeAllRanges(),u?.addRange(g),this.lastRange=g.cloneRange(),this.closeMention(),this.editorEl.dispatchEvent(new InputEvent("input",{bubbles:!0}))}};function Fx(t,e){for(;t&&t!==e;){if(t instanceof HTMLElement){const e=getComputedStyle(t).display;if(t.tagName.match(/^(P|DIV|H1|H2|H3|H4|H5|H6|LI)$/)||"block"===e||"list-item"===e)return t}t=t?.parentNode||null}return e}function Jx(t){const e=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!e)return"#000000";return`#${Number(e[1]).toString(16).padStart(2,"0")}${Number(e[2]).toString(16).padStart(2,"0")}${Number(e[3]).toString(16).padStart(2,"0")}`}function Hx(t,e,M){const i=document.createElement(e);M&&Object.entries(M).forEach((([t,e])=>i.setAttribute(t,e)));try{t.surroundContents(i)}catch{const e=t.extractContents();i.appendChild(e),t.insertNode(i)}}function Xx(t,e,M){const i=document.getSelection();if(!i||0===i.rangeCount)return;const N=i.getRangeAt(0);if(N.collapsed){const t=document.createElement(e);M&&Object.entries(M).forEach((([e,M])=>t.setAttribute(e,M))),t.appendChild(document.createTextNode("​")),N.insertNode(t);const o=document.createRange();return o.setStart(t.firstChild,1),o.collapse(!0),i.removeAllRanges(),void i.addRange(o)}let o=N.startContainer,n=null;for(;o&&o!==t;){if(o instanceof HTMLElement&&o.tagName.toLowerCase()===e){n=o;break}o=o.parentNode}n?function(t){const e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}}(n):Hx(N,e,M)}function $x(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=Fx(M.getRangeAt(0).startContainer,t);i&&(i.style.textAlign="justify"===e?"justify":e)}function qx(t,e,M){for(;e&&e!==t;){if(e instanceof HTMLSpanElement&&e.hasAttribute(M))return e;e=e.parentNode}return null}function Kx(t,e,M,i){const N=window.getSelection();if(!N||0===N.rangeCount)return;const o=N.getRangeAt(0);if(!t.contains(o.commonAncestorContainer))return;const n=o.cloneRange();if(n.collapsed){const o=qx(t,n.startContainer,i);if(o)return o.style[e]=M,void ep(t,i,e);const s=document.createElement("span");s.setAttribute(i,"1"),s.style[e]=M,s.appendChild(document.createTextNode("​")),n.insertNode(s);const r=document.createRange();return r.setStart(s.firstChild,1),r.collapse(!0),N.removeAllRanges(),N.addRange(r),void ep(t,i,e)}const s=qx(t,n.startContainer,i),r=qx(t,n.endContainer,i);if(s&&s===r){if(function(t,e){const M=document.createRange();return M.selectNodeContents(e),t.compareBoundaryPoints(Range.START_TO_START,M)<=0&&t.compareBoundaryPoints(Range.END_TO_END,M)>=0}(n,s))s.style[e]=M;else{const t=function(t,e,M,i,N){const o=t.style[i],n=document.createRange();n.setStart(t,0),n.setEnd(e.startContainer,e.startOffset);const s=document.createRange();s.setStart(e.endContainer,e.endOffset),s.setEnd(t,t.childNodes.length);const r=document.createDocumentFragment(),D=t=>{const e=document.createElement("span");return e.setAttribute(M,"1"),e.style[i]=t,e};if(tp(n)){const t=D(o);t.appendChild(n.cloneContents()),r.appendChild(t)}const a=D(N);if(a.appendChild(e.cloneContents()),r.appendChild(a),tp(s)){const t=D(o);t.appendChild(s.cloneContents()),r.appendChild(t)}return t.replaceWith(r),a}(s,n,i,e,M),N=window.getSelection(),o=document.createRange();o.selectNodeContents(t),N?.removeAllRanges(),N?.addRange(o)}return void ep(t,i,e)}const D=(()=>{let t=n.commonAncestorContainer;for(;t&&!(t instanceof HTMLElement);)t=t.parentNode;return t})(),a=document.createTreeWalker(D||t,NodeFilter.SHOW_TEXT,{acceptNode:t=>{if(!t.nodeValue||!t.nodeValue.trim())return NodeFilter.FILTER_REJECT;const e=document.createRange();e.selectNodeContents(t);return n.compareBoundaryPoints(Range.END_TO_START,e)<0&&n.compareBoundaryPoints(Range.START_TO_END,e)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),l=[];let u;for(;u=a.nextNode();)l.push(u);l.forEach((N=>{let o=0,s=N.length;N===n.startContainer&&(o=n.startOffset),N===n.endContainer&&(s=n.endOffset),o>0&&(N=N.splitText(o)),s<N.length&&N.splitText(s);const r=qx(t,N,i);if(r)return void(r.style[e]=M);const D=document.createElement("span");D.setAttribute(i,"1"),D.style[e]=M;N.parentElement.replaceChild(D,N),D.appendChild(N)})),ep(t,i,e),N.removeAllRanges(),N.addRange(n)}function tp(t){if(t.collapsed)return!1;return(t.cloneContents().textContent||"").length>0}function ep(t,e,M){const i=Array.from(t.querySelectorAll(`span[${e}]`)),N=t=>t.style[M];i.forEach((t=>{Array.from(t.querySelectorAll(`span[${e}]`)).forEach((e=>{if(N(e)===N(t)){for(;e.firstChild;)t.insertBefore(e.firstChild,e);e.remove()}}));const M=t.previousSibling;if(M instanceof HTMLSpanElement&&M.hasAttribute(e)&&N(M)===N(t)){for(;t.firstChild;)M.appendChild(t.firstChild);return void t.remove()}const i=t.nextSibling;if(i instanceof HTMLSpanElement&&i.hasAttribute(e)&&N(i)===N(t)){for(;i.firstChild;)t.appendChild(i.firstChild);i.remove()}}))}t([gt({attribute:"mentions",converter:{fromAttribute:t=>{try{const e=JSON.parse(t),M={};for(const t of Object.keys(e)){const i=e[t];Array.isArray(i)&&(M[t]=i.filter((t=>t&&"string"==typeof t.key&&"string"==typeof t.label)).map((t=>({key:t.key,label:t.label}))))}return M}catch{return{}}},toAttribute:t=>JSON.stringify(t)}})],_x.prototype,"mentions",void 0),t([gt({attribute:"mentionformat",converter:{fromAttribute:t=>{try{const e=JSON.parse(t);return e&&"object"==typeof e?e:{}}catch{return{}}},toAttribute:t=>JSON.stringify(t??{})}})],_x.prototype,"mentionFormat",void 0),t([jt()],_x.prototype,"itemsFormats",void 0),t([gt({attribute:"mentioncolors",converter:{fromAttribute:t=>{try{const e=JSON.parse(t);return e&&"object"==typeof e?e:{}}catch{return{}}},toAttribute:t=>JSON.stringify(t??{})}})],_x.prototype,"mentionColors",void 0),t([jt()],_x.prototype,"externalConfig",void 0),t([jt()],_x.prototype,"itemsConfig",void 0),t([jt()],_x.prototype,"itemsColors",void 0),_x=t([at("nile-rte-mentions")],_x);const Mp=n`
10787
10787
  /* Host positioning for overlays */
10788
10788
  nile-rich-text-editor { position: relative; display: block; font-family: inherit; }
10789
10789
 
@@ -10824,7 +10824,9 @@ nile-rte-toolbar-item > nile-button::part(base) {
10824
10824
  .editor h5 { font-size:0.83em }
10825
10825
  .editor h6 { font-size:0.67em }
10826
10826
 
10827
- .editor { min-height:160px; padding:12px; border:1px solid #e5e7eb; border-radius:0 0 8px 8px; background:#fff; outline:none; }
10827
+ .editor { min-height:160px; padding:12px; border:1px solid #e5e7eb; border-radius:0 0 8px 8px; background:#fff; outline:none; white-space: pre-wrap;
10828
+ tab-size: 4;
10829
+ -moz-tab-size: 4; }
10828
10830
  nile-rte-preview { display:block; margin-top:10px; padding:10px; border:1px dashed #cbd5e1; border-radius:8px; background:#fafafa; }
10829
10831
 
10830
10832
  .rte-color-trigger {
@@ -10869,20 +10871,20 @@ nile-rte-toolbar-item > nile-button::part(base) {
10869
10871
  background: currentColor; /* overridden via JS */
10870
10872
  }
10871
10873
 
10872
- `,Kx={bold:"nile-bold",italic:"nile-italic",underline:"nile-underline",link:"user",left:"nile-leftalign",center:"nile-centeralign",right:"nile-rightalign",justify:"nile-justify",ul:"nile-ul",ol:"nile-ol",clear:"error"};let tp=class extends rt{constructor(){super(...arguments),this.value="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.mentionsEl=null,this.onSelectionChange=()=>{if(!this.editorEl)return;const t=document.getSelection();if(!t||0===t.rangeCount)return;const e=t.getRangeAt(0);this.editorEl.contains(e.commonAncestorContainer)&&(this.lastRange=e.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}shouldUpdate(){return!1}injectCss(t){if(this.querySelector("style[data-rte-style]"))return;const e=document.createElement("style");e.setAttribute("data-rte-style","true"),e.textContent=t,this.insertBefore(e,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(qx.cssText),this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.ensureEditor(),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),this.updateToolbarState(),this.syncPreview(),document.addEventListener("selectionchange",this.onSelectionChange,!0)}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange,!0),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const t=document.createElement("div");t.className="editor",t.setAttribute("contenteditable","true"),this.toolbarEl?.nextSibling?this.insertBefore(t,this.toolbarEl.nextSibling):this.previewEl?this.insertBefore(t,this.previewEl):this.appendChild(t),this.editorEl=t}this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>"),this.ensureAtLeastOneParagraph()}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.updateContent()})),this.editorEl.addEventListener("mouseup",(()=>this.saveSelection())),this.editorEl.addEventListener("keyup",(()=>this.saveSelection()))}wireAuthoredToolbar(t){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(t.children).forEach((t=>{const e=t.tagName.toLowerCase();if("nile-rte-select"!==e||"align"!==t.getAttribute("type")){if("nile-rte-toolbar-item"===e){let e=t.querySelector(":scope > nile-button");const M=t.getAttribute("name")||"",i=t.getAttribute("label")||M,N=t.getAttribute("icon"),o=t.innerHTML.trim().length>0;if(e||(e=document.createElement("nile-button"),e.variant="tertiary",e.size="small"),N)e.innerHTML=`<nile-icon name="${N}" aria-label="${i}"></nile-icon>`,t.innerHTML="";else if(o)e.innerHTML=t.innerHTML,t.innerHTML="";else{const N=Kx[M];N?e.innerHTML=`<nile-icon name="${N}" size="20" color="black" aria-label="${i}"></nile-icon>`:e.textContent=i||M,t.innerHTML=""}e.isConnected||t.appendChild(e),e.setAttribute("aria-label",i),e.addEventListener("mousedown",(t=>t.preventDefault())),e.addEventListener("click",(()=>this.onToolbarCommand(M)));const n=this.buttonMap.get(M)??[];return n.push(e),void this.buttonMap.set(M,n)}if("nile-rte-select"!==e){if("nile-rte-color"===e){const e=t.getAttribute("label")??"Text color",M=t.getAttribute("value")??"#000000",i=t.getAttribute("mode")??"text";let N=t.querySelector(':scope > input[type="color"]');N||(N=document.createElement("input"),N.type="color",N.style.position="absolute",N.style.opacity="0",N.style.pointerEvents="none",t.appendChild(N)),N.title=e,N.value=M;let o=t.querySelector(":scope > button.rte-color-trigger");o||(o=document.createElement("button"),o.type="button",o.className="rte-color-trigger",o.setAttribute("aria-label",e),o.innerHTML="background"===i?'\n <span class="swatch-box" aria-hidden="true"></span>\n ':'\n <span class="glyph-stack" aria-hidden="true">\n <span class="glyph">A</span>\n <span class="underline"></span>\n </span>\n ',t.appendChild(o));const n=o.querySelector(".underline"),s=o.querySelector(".swatch-box");"background"===i?(this.bgColorInput=N,this.bgSwatchEl=s,this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=N.value)):(this.colorInput=N,this.colorSwatchEl=n,this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=N.value)),o.addEventListener("click",(t=>{t.preventDefault(),this.focusAndRestore(),N.click()})),N.addEventListener("input",(()=>{this.focusAndRestore(),"background"===i?(!function(t,e){const M=window.getSelection();if(!M||0===M.rangeCount)return;const i=M.getRangeAt(0);if(!t.contains(i.commonAncestorContainer)||i.collapsed)return;const N=document.createElement("span");N.style.backgroundColor=e,N.appendChild(i.extractContents()),i.insertNode(N);const o=document.createRange();o.setStartAfter(N),o.collapse(!0),M.removeAllRanges(),M.addRange(o)}(this.editorEl,N.value),this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=N.value)):(!function(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=M.getRangeAt(0);if(i.collapsed){const t=document.createElement("span");t.style.color=e,t.appendChild(document.createTextNode("​")),i.insertNode(t);const N=document.createRange();return N.setStart(t.firstChild,1),N.collapse(!0),M.removeAllRanges(),void M.addRange(N)}Hx(i,"span",{style:`color:${e}`})}(this.editorEl,N.value),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=N.value)),this.updateContent(),this.updateToolbarState()})),o.addEventListener("mousedown",(t=>t.preventDefault())),N.addEventListener("mousedown",(t=>t.preventDefault()))}}else{const e=t.getAttribute("type")||"";t.addEventListener("change",(t=>{this.focusAndRestore();const M=t.detail;"heading"===e?function(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=Fx(M.getRangeAt(0).startContainer,t);if(!i)return;if(i.tagName.toLowerCase()===e)return;const N=document.createElement(e);for(;i.firstChild;)N.appendChild(i.firstChild);i.replaceWith(N);const o=document.createRange();o.selectNodeContents(N),o.collapse(!0),M.removeAllRanges(),M.addRange(o)}(this.editorEl,M):"font"===e&&function(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=M.getRangeAt(0);if(i.collapsed){const t=document.createElement("span");t.style.fontFamily=e,t.appendChild(document.createTextNode("​")),i.insertNode(t);const N=document.createRange();return N.setStart(t.firstChild,1),N.collapse(!0),M.removeAllRanges(),void M.addRange(N)}Hx(i,"span",{style:`font-family:${e}`})}(this.editorEl,M),this.updateContent(),this.updateToolbarState()}))}}else t.addEventListener("change",(t=>{this.focusAndRestore();const e=t.detail;$x(this.editorEl,e),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const t=window.getSelection();t&&t.rangeCount&&(this.lastRange=t.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const t=document.getSelection();t&&(t.removeAllRanges(),t.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}insertList(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement(t),M=this.lastRange.extractContents(),i=document.createElement("div");i.appendChild(M),Array.from(i.childNodes).forEach((t=>{if(t.nodeType===Node.TEXT_NODE&&!t.textContent?.trim())return;const M=document.createElement("li");M.appendChild(t),e.appendChild(M)})),this.lastRange.insertNode(e),this.afterListEdit(e)}afterListEdit(t){const e=document.createRange();e.setStartAfter(t),e.collapse(!0);const M=window.getSelection();M?.removeAllRanges(),M?.addRange(e),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const t=this.editorEl;if(!t)return;const e=""===(t.textContent??"").replace(/\u200B/g,"").trim();if(0===t.childNodes.length||e)return void(t.innerHTML="<p><br></p>");if(!t.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const e=document.createElement("p");for(;t.firstChild;)e.appendChild(t.firstChild);return e.hasChildNodes()||e.appendChild(document.createElement("br")),void t.appendChild(e)}t.querySelectorAll("p").forEach((t=>{""===(t.textContent??"").replace(/\u200B/g,"")&&(t.innerHTML.toLowerCase().includes("<br")||(t.innerHTML="<br>"))}))}onToolbarCommand(t){switch(this.focusAndRestore(),t){case"bold":Xx(this.editorEl,"strong");break;case"italic":Xx(this.editorEl,"em");break;case"underline":Xx(this.editorEl,"u");break;case"left":$x(this.editorEl,"left");break;case"center":$x(this.editorEl,"center");break;case"right":$x(this.editorEl,"right");break;case"justify":$x(this.editorEl,"justify");break;case"ul":this.insertList("ul");break;case"ol":this.insertList("ol");break;case"link":!function(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=M.getRangeAt(0);let N=i.startContainer,o=null;for(;N&&N!==t;){if(N instanceof HTMLAnchorElement){o=N;break}N=N.parentNode}const n=e??("undefined"!=typeof window&&window.prompt("Enter URL",o?.href||"https://")||"");if(!n)return;if(o)return void(o.href=n);if(i.collapsed){const t=document.createElement("a");t.href=n,t.textContent=n,i.insertNode(t);const e=document.createRange();return e.setStartAfter(t),e.collapse(!0),M.removeAllRanges(),void M.addRange(e)}const s=document.createElement("a");s.href=n;try{i.surroundContents(s)}catch{const t=i.extractContents();s.appendChild(t),i.insertNode(s)}}(this.editorEl);break;case"clear":const t=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),e=[];for(;t.nextNode();){const M=t.currentNode;M.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(M.tagName)&&e.push(M)}for(const t of e){for(;t.firstChild;)t.parentNode?.insertBefore(t.firstChild,t);t.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(t,e){const M=this.buttonMap.get(t);if(M)for(const t of M)t.toggleAttribute("data-active",!!e)}updateToolbarState(){if(!this.editorEl)return;const t=document.getSelection();if(!t||0===t.rangeCount)return;const e=t.getRangeAt(0);if(!this.editorEl.contains(e.commonAncestorContainer))return;const M=function(t){for(;t&&!(t instanceof HTMLElement);)t=t.parentNode;return t}(e.startContainer)||this.editorEl,i=getComputedStyle(M),N=Fx(e.startContainer,this.editorEl)||this.editorEl,o=(()=>{let t=M;for(;t&&t!==this.editorEl;){if(t instanceof HTMLElement){const e=t.tagName.toLowerCase();if("strong"===e||"b"===e)return!0;const M=getComputedStyle(t).fontWeight;if(parseInt(M,10)>=600)return!0}t=t.parentNode}return!1})(),n=(()=>{let t=M;for(;t&&t!==this.editorEl;){if(t instanceof HTMLElement){const e=t.tagName.toLowerCase();if("em"===e||"i"===e)return!0;if("italic"===getComputedStyle(t).fontStyle)return!0}t=t.parentNode}return!1})(),s=(()=>{let t=M;for(;t&&t!==this.editorEl;){if(t instanceof HTMLElement){const e=getComputedStyle(t).textDecorationLine;if(e&&e.includes("underline"))return!0;if("u"===t.tagName.toLowerCase())return!0}t=t.parentNode}return!1})(),r=!!M.closest("a"),D=N.style.textAlign||getComputedStyle(N).textAlign||"start",a="start"===D?"left":D,l=!!M.closest("li")&&M.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",n),this.setBtnActive("underline",s),this.setBtnActive("link",r),this.setBtnActive("left","left"===a&&!["center","right","justify"].includes(a)),this.setBtnActive("center","center"===a),this.setBtnActive("right","right"===a),this.setBtnActive("justify","justify"===a),this.setBtnActive("ul","ul"===l),this.setBtnActive("ol","ol"===l),this.headingSelect){const t=N.tagName.toLowerCase(),e=["h1","h2","h3"].includes(t)?t:"p";this.headingSelect.value!==e&&(this.headingSelect.value=e)}if(this.fontSelect){const t=(i.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(t)for(const e of Array.from(this.fontSelect.options))if(e.value.toLowerCase()===t){this.fontSelect.value=e.value;break}}if(this.colorInput){const t=Jx(i.color);t&&this.colorInput.value.toLowerCase()!==t.toLowerCase()&&(this.colorInput.value=t),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const t=getComputedStyle(M).backgroundColor;if(t&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t)){const e=Jx(t);e&&this.bgColorInput.value.toLowerCase()!==e.toLowerCase()&&(this.bgColorInput.value=e)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){this.editorEl&&(this.ensureAtLeastOneParagraph(),this.content=this.editorEl.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("content-changed",{detail:{content:this.content},bubbles:!0,composed:!0})))}};t([gt({type:String})],tp.prototype,"value",void 0),t([gt({attribute:"mentions",converter:{fromAttribute:t=>{try{const e=JSON.parse(t),M={};for(const t of Object.keys(e)){const i=e[t];Array.isArray(i)&&(M[t]=i.filter((t=>t&&"string"==typeof t.key&&"string"==typeof t.label)).map((t=>({key:t.key,label:t.label}))))}return M}catch{return{}}},toAttribute:t=>JSON.stringify(t)}})],tp.prototype,"mentions",void 0),t([jt()],tp.prototype,"content",void 0),tp=t([at("nile-rich-text-editor")],tp);
10874
+ `,ip={bold:"nile-bold",italic:"nile-italic",underline:"nile-underline",link:"user",left:"nile-leftalign",center:"nile-centeralign",right:"nile-rightalign",justify:"nile-justify",ul:"nile-ul",ol:"nile-ol",clear:"error"};let Np=class extends rt{constructor(){super(...arguments),this.value="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.mentionsEl=null,this.onEditorKeydown=t=>{if("Tab"!==t.key)return;t.preventDefault(),this.focusAndRestore();const e=window.getSelection();if(!e||0===e.rangeCount)return;const M=e.getRangeAt(0);if(t.shiftKey){if(M.collapsed&&M.startContainer.nodeType===Node.TEXT_NODE){const t=M.startContainer,i=M.startOffset,N=t.data.slice(0,i),o=N.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==N.length){t.data=o+t.data.slice(i);const M=document.createRange();M.setStart(t,o.length),M.collapse(!0),e.removeAllRanges(),e.addRange(M),this.updateContent(),this.updateToolbarState()}}return}M.deleteContents();const i=document.createTextNode("\t");M.insertNode(i);const N=document.createRange();N.setStartAfter(i),N.collapse(!0),e.removeAllRanges(),e.addRange(N),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const t=document.getSelection();if(!t||0===t.rangeCount)return;const e=t.getRangeAt(0);this.editorEl.contains(e.commonAncestorContainer)&&(this.lastRange=e.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}shouldUpdate(){return!1}injectCss(t){if(this.querySelector("style[data-rte-style]"))return;const e=document.createElement("style");e.setAttribute("data-rte-style","true"),e.textContent=t,this.insertBefore(e,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(Mp.cssText),this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.ensureEditor(),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),this.updateToolbarState(),this.syncPreview(),document.addEventListener("selectionchange",this.onSelectionChange,!0)}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange,!0),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const t=document.createElement("article");t.className="editor",t.setAttribute("contenteditable","true"),this.toolbarEl?.nextSibling?this.insertBefore(t,this.toolbarEl.nextSibling):this.previewEl?this.insertBefore(t,this.previewEl):this.appendChild(t),this.editorEl=t}this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>"),this.ensureAtLeastOneParagraph()}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.updateContent()})),this.editorEl.addEventListener("mouseup",(()=>this.saveSelection())),this.editorEl.addEventListener("keyup",(()=>this.saveSelection())),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(t){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(t.children).forEach((t=>{const e=t.tagName.toLowerCase();if("nile-rte-select"!==e||"align"!==t.getAttribute("type")){if("nile-rte-toolbar-item"===e){let e=t.querySelector(":scope > nile-button");const M=t.getAttribute("name")||"",i=t.getAttribute("label")||M,N=t.getAttribute("icon"),o=t.innerHTML.trim().length>0;if(e||(e=document.createElement("nile-button"),e.variant="tertiary",e.size="small"),N)e.innerHTML=`<nile-icon name="${N}" aria-label="${i}"></nile-icon>`,t.innerHTML="";else if(o)e.innerHTML=t.innerHTML,t.innerHTML="";else{const N=ip[M];N?e.innerHTML=`<nile-icon name="${N}" size="20" color="black" aria-label="${i}"></nile-icon>`:e.textContent=i||M,t.innerHTML=""}e.isConnected||t.appendChild(e),e.setAttribute("aria-label",i),e.addEventListener("mousedown",(t=>t.preventDefault())),e.addEventListener("click",(()=>this.onToolbarCommand(M)));const n=this.buttonMap.get(M)??[];return n.push(e),void this.buttonMap.set(M,n)}if("nile-rte-select"!==e){if("nile-rte-color"===e){const e=t.getAttribute("label")??"Text color",M=t.getAttribute("value")??"#000000",i=t.getAttribute("mode")??"text";let N=t.querySelector(':scope > input[type="color"]');N||(N=document.createElement("input"),N.type="color",N.style.position="absolute",N.style.opacity="0",N.style.pointerEvents="none",t.appendChild(N)),N.title=e,N.value=M;let o=t.querySelector(":scope > button.rte-color-trigger");o||(o=document.createElement("button"),o.type="button",o.className="rte-color-trigger",o.setAttribute("aria-label",e),o.innerHTML="background"===i?'\n <span class="swatch-box" aria-hidden="true"></span>\n ':'\n <span class="glyph-stack" aria-hidden="true">\n <span class="glyph">A</span>\n <span class="underline"></span>\n </span>\n ',t.appendChild(o));const n=o.querySelector(".underline"),s=o.querySelector(".swatch-box");"background"===i?(this.bgColorInput=N,this.bgSwatchEl=s,this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=N.value)):(this.colorInput=N,this.colorSwatchEl=n,this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=N.value)),o.addEventListener("click",(t=>{t.preventDefault(),this.focusAndRestore(),N.click()})),N.addEventListener("input",(()=>{var t,e;this.focusAndRestore(),"background"===i?(t=this.editorEl,e=N.value,Kx(t,"backgroundColor",e,"data-rte-bg"),this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=N.value)):(!function(t,e){Kx(t,"color",e,"data-rte-color")}(this.editorEl,N.value),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=N.value)),this.updateContent(),this.updateToolbarState()})),o.addEventListener("mousedown",(t=>t.preventDefault())),N.addEventListener("mousedown",(t=>t.preventDefault()))}}else{const e=t.getAttribute("type")||"";t.addEventListener("change",(t=>{this.focusAndRestore();const M=t.detail;"heading"===e?function(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=Fx(M.getRangeAt(0).startContainer,t);if(!i)return;if(i.tagName.toLowerCase()===e)return;const N=document.createElement(e);for(;i.firstChild;)N.appendChild(i.firstChild);i.replaceWith(N);const o=document.createRange();o.selectNodeContents(N),o.collapse(!0),M.removeAllRanges(),M.addRange(o)}(this.editorEl,M):"font"===e&&function(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=M.getRangeAt(0);if(i.collapsed){const t=document.createElement("span");t.style.fontFamily=e,t.appendChild(document.createTextNode("​")),i.insertNode(t);const N=document.createRange();return N.setStart(t.firstChild,1),N.collapse(!0),M.removeAllRanges(),void M.addRange(N)}Hx(i,"span",{style:`font-family:${e}`})}(this.editorEl,M),this.updateContent(),this.updateToolbarState()}))}}else t.addEventListener("change",(t=>{this.focusAndRestore();const e=t.detail;$x(this.editorEl,e),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const t=window.getSelection();t&&t.rangeCount&&(this.lastRange=t.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const t=document.getSelection();t&&(t.removeAllRanges(),t.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}insertList(t){if(this.restoreSelection(),!this.lastRange)return;const e=document.createElement(t),M=this.lastRange.extractContents(),i=document.createElement("div");i.appendChild(M),Array.from(i.childNodes).forEach((t=>{if(t.nodeType===Node.TEXT_NODE&&!t.textContent?.trim())return;const M=document.createElement("li");M.appendChild(t),e.appendChild(M)})),this.lastRange.insertNode(e),this.afterListEdit(e)}afterListEdit(t){const e=document.createRange();e.setStartAfter(t),e.collapse(!0);const M=window.getSelection();M?.removeAllRanges(),M?.addRange(e),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const t=this.editorEl;if(!t)return;const e=""===(t.textContent??"").replace(/\u200B/g,"").trim();if(0===t.childNodes.length||e)return void(t.innerHTML="<p><br></p>");if(!t.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const e=document.createElement("p");for(;t.firstChild;)e.appendChild(t.firstChild);return e.hasChildNodes()||e.appendChild(document.createElement("br")),void t.appendChild(e)}t.querySelectorAll("p").forEach((t=>{""===(t.textContent??"").replace(/\u200B/g,"")&&(t.innerHTML.toLowerCase().includes("<br")||(t.innerHTML="<br>"))}))}onToolbarCommand(t){switch(this.focusAndRestore(),t){case"bold":Xx(this.editorEl,"strong");break;case"italic":Xx(this.editorEl,"em");break;case"underline":Xx(this.editorEl,"u");break;case"left":$x(this.editorEl,"left");break;case"center":$x(this.editorEl,"center");break;case"right":$x(this.editorEl,"right");break;case"justify":$x(this.editorEl,"justify");break;case"ul":this.insertList("ul");break;case"ol":this.insertList("ol");break;case"link":!function(t,e){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=M.getRangeAt(0);let N=i.startContainer,o=null;for(;N&&N!==t;){if(N instanceof HTMLAnchorElement){o=N;break}N=N.parentNode}const n=e??("undefined"!=typeof window&&window.prompt("Enter URL",o?.href||"https://")||"");if(!n)return;if(o)return void(o.href=n);if(i.collapsed){const t=document.createElement("a");t.href=n,t.textContent=n,i.insertNode(t);const e=document.createRange();return e.setStartAfter(t),e.collapse(!0),M.removeAllRanges(),void M.addRange(e)}const s=document.createElement("a");s.href=n;try{i.surroundContents(s)}catch{const t=i.extractContents();s.appendChild(t),i.insertNode(s)}}(this.editorEl);break;case"clear":const t=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),e=[];for(;t.nextNode();){const M=t.currentNode;M.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(M.tagName)&&e.push(M)}for(const t of e){for(;t.firstChild;)t.parentNode?.insertBefore(t.firstChild,t);t.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(t,e){const M=this.buttonMap.get(t);if(M)for(const t of M)t.toggleAttribute("data-active",!!e)}updateToolbarState(){if(!this.editorEl)return;const t=document.getSelection();if(!t||0===t.rangeCount)return;const e=t.getRangeAt(0);if(!this.editorEl.contains(e.commonAncestorContainer))return;const M=function(t){for(;t&&!(t instanceof HTMLElement);)t=t.parentNode;return t}(e.startContainer)||this.editorEl,i=getComputedStyle(M),N=Fx(e.startContainer,this.editorEl)||this.editorEl,o=(()=>{let t=M;for(;t&&t!==this.editorEl;){if(t instanceof HTMLElement){const e=t.tagName.toLowerCase();if("strong"===e||"b"===e)return!0;const M=getComputedStyle(t).fontWeight;if(parseInt(M,10)>=600)return!0}t=t.parentNode}return!1})(),n=(()=>{let t=M;for(;t&&t!==this.editorEl;){if(t instanceof HTMLElement){const e=t.tagName.toLowerCase();if("em"===e||"i"===e)return!0;if("italic"===getComputedStyle(t).fontStyle)return!0}t=t.parentNode}return!1})(),s=(()=>{let t=M;for(;t&&t!==this.editorEl;){if(t instanceof HTMLElement){const e=getComputedStyle(t).textDecorationLine;if(e&&e.includes("underline"))return!0;if("u"===t.tagName.toLowerCase())return!0}t=t.parentNode}return!1})(),r=!!M.closest("a"),D=N.style.textAlign||getComputedStyle(N).textAlign||"start",a="start"===D?"left":D,l=!!M.closest("li")&&M.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",n),this.setBtnActive("underline",s),this.setBtnActive("link",r),this.setBtnActive("left","left"===a&&!["center","right","justify"].includes(a)),this.setBtnActive("center","center"===a),this.setBtnActive("right","right"===a),this.setBtnActive("justify","justify"===a),this.setBtnActive("ul","ul"===l),this.setBtnActive("ol","ol"===l),this.headingSelect){const t=N.tagName.toLowerCase(),e=["h1","h2","h3"].includes(t)?t:"p";this.headingSelect.value!==e&&(this.headingSelect.value=e)}if(this.fontSelect){const t=(i.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(t)for(const e of Array.from(this.fontSelect.options))if(e.value.toLowerCase()===t){this.fontSelect.value=e.value;break}}if(this.colorInput){const t=Jx(i.color);t&&this.colorInput.value.toLowerCase()!==t.toLowerCase()&&(this.colorInput.value=t),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const t=getComputedStyle(M).backgroundColor;if(t&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t)){const e=Jx(t);e&&this.bgColorInput.value.toLowerCase()!==e.toLowerCase()&&(this.bgColorInput.value=e)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const t=this.editorEl.cloneNode(!0),e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),M=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e.nextNode()&&M.nextNode();){const t=e.currentNode,i=M.currentNode,N=window.getComputedStyle(t),o=Array.from(N).map((t=>`${t}:${N.getPropertyValue(t)}`)).join(";");i.setAttribute("style",o)}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("content-changed",{detail:{content:this.content},bubbles:!0,composed:!0}))}};t([gt({type:String})],Np.prototype,"value",void 0),t([gt({attribute:"mentions",converter:{fromAttribute:t=>{try{const e=JSON.parse(t),M={};for(const t of Object.keys(e)){const i=e[t];Array.isArray(i)&&(M[t]=i.filter((t=>t&&"string"==typeof t.key&&"string"==typeof t.label)).map((t=>({key:t.key,label:t.label}))))}return M}catch{return{}}},toAttribute:t=>JSON.stringify(t)}})],Np.prototype,"mentions",void 0),t([jt()],Np.prototype,"content",void 0),Np=t([at("nile-rich-text-editor")],Np);
10873
10875
  /**
10874
10876
  * @license
10875
10877
  * Copyright 2021 Google LLC
10876
10878
  * SPDX-License-Identifier: BSD-3-Clause
10877
10879
  */
10878
- class ep{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===t?.roundAverageSize&&(this._roundAverageSize=!0)}set(t,e){const M=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-M}get averageSize(){if(this._map.size>0){const t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}
10880
+ class op{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===t?.roundAverageSize&&(this._roundAverageSize=!0)}set(t,e){const M=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-M}get averageSize(){if(this._map.size>0){const t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}
10879
10881
  /**
10880
10882
  * @license
10881
10883
  * Copyright 2021 Google LLC
10882
10884
  * SPDX-License-Identifier: BSD-3-Clause
10883
- */function Mp(t){return"horizontal"===t?"width":"height"}class ip{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then((()=>this.config=e||this._getDefaultConfig()))}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:e,_viewDim2:M}=this;Object.assign(this._viewportSize,t),M!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[Mp(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const t=this._scrollPosition,{index:e,block:M}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:M||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){const{block:e}=t,M=Math.min(this.items.length,Math.max(0,t.index)),i=this._getItemPosition(M)[this._positionDim];let N=i;if("start"!==e){const t=this._getItemSize(M)[this._sizeDim];if("center"===e)N=i-.5*this._viewDim1+.5*t;else{const M=i-this._viewDim1+t;if("end"===e)N=M;else{const t=this._scrollPosition;N=Math.abs(t-i)<Math.abs(t-M)?i:M}}}return N+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(N)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const t=new Map;if(-1!==this._first&&-1!==this._last)for(let e=this._first;e<=this._last;e++)t.set(e,this._getItemPosition(e));const e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(-1===this._first||-1===this._last)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let M=this._last;for(;M>this._first&&Math.round(this._getItemPosition(M)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)M--;e===this._firstVisible&&M===this._lastVisible||(this._firstVisible=e,this._lastVisible=M,t&&t.emit&&this._sendVisibilityChangedMessage())}}
10885
+ */function np(t){return"horizontal"===t?"width":"height"}class sp{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then((()=>this.config=e||this._getDefaultConfig()))}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:e,_viewDim2:M}=this;Object.assign(this._viewportSize,t),M!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[np(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const t=this._scrollPosition,{index:e,block:M}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:M||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){const{block:e}=t,M=Math.min(this.items.length,Math.max(0,t.index)),i=this._getItemPosition(M)[this._positionDim];let N=i;if("start"!==e){const t=this._getItemSize(M)[this._sizeDim];if("center"===e)N=i-.5*this._viewDim1+.5*t;else{const M=i-this._viewDim1+t;if("end"===e)N=M;else{const t=this._scrollPosition;N=Math.abs(t-i)<Math.abs(t-M)?i:M}}}return N+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(N)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const t=new Map;if(-1!==this._first&&-1!==this._last)for(let e=this._first;e<=this._last;e++)t.set(e,this._getItemPosition(e));const e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(-1===this._first||-1===this._last)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let M=this._last;for(;M>this._first&&Math.round(this._getItemPosition(M)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)M--;e===this._firstVisible&&M===this._lastVisible||(this._firstVisible=e,this._lastVisible=M,t&&t.emit&&this._sendVisibilityChangedMessage())}}
10884
10886
  /**
10885
10887
  * @license
10886
10888
  * Copyright 2021 Google LLC
10887
10889
  * SPDX-License-Identifier: BSD-3-Clause
10888
- */function Np(t){return"horizontal"===t?"marginLeft":"marginTop"}function op(t){return"horizontal"===t?"marginRight":"marginBottom"}function np(t){return"horizontal"===t?"xOffset":"yOffset"}function sp(t,e){const M=[t,e].sort();return M[1]<=0?Math.min(...M):M[0]>=0?Math.max(...M):M[0]+M[1]}class rp{constructor(){this._childSizeCache=new ep,this._marginSizeCache=new ep,this._metricsCache=new Map}update(t,e){const M=new Set;Object.keys(t).forEach((i=>{const N=Number(i);this._metricsCache.set(N,t[N]),this._childSizeCache.set(N,t[N][Mp(e)]),M.add(N),M.add(N+1)}));for(const t of M){const M=this._metricsCache.get(t)?.[Np(e)]||0,i=this._metricsCache.get(t-1)?.[op(e)]||0;this._marginSizeCache.set(t,sp(M,i))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[Np(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var Dp=Object.freeze({__proto__:null,FlowLayout:class extends ip{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new rp,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){const e=this._metricsCache;if(-1===this._first||-1===this._last)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){const M=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(M*e.averageChildSize+(M-1)*e.averageMarginSize)}{const M=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+M*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){const e=this._getPhysicalItem(t),{averageMarginSize:M}=this._metricsCache;return 0===t?this._metricsCache.getMarginSize(0)??M:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(0===this._physicalItems.size)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);const M=this._getPhysicalItem(this._first),i=this._getPhysicalItem(this._last),N=M.pos;if(i.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(N>e)return this._calculateAnchor(t,e);let o=this._firstVisible-1,n=-1/0;for(;n<t;){n=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){const t=this._newPhysicalItems;let e,M;if(this._stable=!0,null!==this.pin){const{index:t}=this.pin;this._anchorIdx=t,this._anchorPos=this._getPosition(t)}if(e=this._scrollPosition-this._overhang,M=this._scrollPosition+this._viewDim1+this._overhang,M<0||e>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(e,M),this._anchorPos=this._getPosition(this._anchorIdx));let i=this._getSize(this._anchorIdx);void 0===i&&(this._stable=!1,i=this._getAverageSize());const N=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=N),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-i);let n=0;for(this._anchorPos+i+o<e&&(n=e-(this._anchorPos+i+o)),this._anchorPos-N>M&&(n=M-(this._anchorPos-N)),n&&(this._scrollPosition-=n,e-=n,M-=n,this._scrollError+=n),t.set(this._anchorIdx,{pos:this._anchorPos,size:i}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-N,this._physicalMax=this._anchorPos+i+o;this._physicalMin>e&&this._first>0;){let e=this._getSize(--this._first);void 0===e&&(this._stable=!1,e=this._getAverageSize());let M=this._metricsCache.getMarginSize(this._first);void 0===M&&(this._stable=!1,M=this._metricsCache.averageMarginSize),this._physicalMin-=e;const i=this._physicalMin;if(t.set(this._first,{pos:i,size:e}),this._physicalMin-=M,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<M&&this._last<this.items.length-1;){let e=this._getSize(++this._last);void 0===e&&(this._stable=!1,e=this._getAverageSize());let M=this._metricsCache.getMarginSize(this._last);void 0===M&&(this._stable=!1,M=this._metricsCache.averageMarginSize);const i=this._physicalMax;if(t.set(this._last,{pos:i,size:e}),this._physicalMax+=e+M,!this._stable&&!this._estimate)break}const s=this._calculateError();s&&(this._physicalMin-=s,this._physicalMax-=s,this._anchorPos-=s,this._scrollPosition-=s,t.forEach((t=>t.pos-=s)),this._scrollError+=s),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:t,_last:e}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){const{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[np(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});export{cx as NileAccordion,uN as NileAutoComplete,bL as NileAvatar,le as NileBadge,rL as NileBreadcrumb,aL as NileBreadcrumbItem,Bt as NileButton,TL as NileButtonFilter,mN as NileButtonToggle,CN as NileButtonToggleGroup,pN as NileCalendar,jL as NileCard,Ye as NileCheckbox,jN as NileChip,yL as NileCircularProgressbar,ML as NileCodeEditor,RN as NileContentEditor,TN as NileDatePicker,BN as NileDialog,Ix as NileDivider,Ue as NileDrawer,Oi as NileDropdown,VL as NileEmptyState,yN as NileErrorMessage,FN as NileErrorNotification,kx as NileFilterChip,AN as NileFormErrorMessage,uL as NileFormGroup,LN as NileFormHelpText,qL as NileFormatDate,_t as NileHeading,PL as NileHero,JL as NileHeroHeader,wt as NileIcon,ae as NileIconButton,xx as NileInlineEdit,Ne as NileInput,fx as NileLightdomeditor,EN as NileLink,gx as NileList,lx as NileListItem,oi as NileLoader,se as NileMenu,Ii as NileMenuItem,ci as NileOption,vL as NilePageHeader,Ux as NilePagination,zL as NilePopover,KM as NilePopup,si as NileProgressBar,fe as NileRadio,Ze as NileRadioGroup,tp as NileRichTextEditor,Cx as NileRichcodeeditor,dx as NileSectionMessage,gi as NileSelect,oe as NileSidebar,AL as NileSidebarMenu,LL as NileSidebarMenuItems,pL as NileSidebarWrapper,ii as NileSlideToggle,Di as NileSpinner,ex as NileSplitPanel,_L as NileStepper,GL as NileStepperItem,VN as NileSwitcher,qN as NileTab,HN as NileTabGroup,eo as NileTabPanel,Sx as NileTable,mL as NileTableBody,QL as NileTableCellItem,CL as NileTableHeaderItem,kL as NileTableRow,ui as NileTag,zN as NileTextarea,Ox as NileTitle,nL as NileToast,hx as NileToolbar,ei as NileTooltip,Dx as NileTree,nx as NileTreeItem,XL as NileVerticalStepperItem};
10890
+ */function rp(t){return"horizontal"===t?"marginLeft":"marginTop"}function Dp(t){return"horizontal"===t?"marginRight":"marginBottom"}function ap(t){return"horizontal"===t?"xOffset":"yOffset"}function lp(t,e){const M=[t,e].sort();return M[1]<=0?Math.min(...M):M[0]>=0?Math.max(...M):M[0]+M[1]}class up{constructor(){this._childSizeCache=new op,this._marginSizeCache=new op,this._metricsCache=new Map}update(t,e){const M=new Set;Object.keys(t).forEach((i=>{const N=Number(i);this._metricsCache.set(N,t[N]),this._childSizeCache.set(N,t[N][np(e)]),M.add(N),M.add(N+1)}));for(const t of M){const M=this._metricsCache.get(t)?.[rp(e)]||0,i=this._metricsCache.get(t-1)?.[Dp(e)]||0;this._marginSizeCache.set(t,lp(M,i))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[rp(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}var gp=Object.freeze({__proto__:null,FlowLayout:class extends sp{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new up,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){const e=this._metricsCache;if(-1===this._first||-1===this._last)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){const M=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(M*e.averageChildSize+(M-1)*e.averageMarginSize)}{const M=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+M*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){const e=this._getPhysicalItem(t),{averageMarginSize:M}=this._metricsCache;return 0===t?this._metricsCache.getMarginSize(0)??M:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(0===this._physicalItems.size)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);const M=this._getPhysicalItem(this._first),i=this._getPhysicalItem(this._last),N=M.pos;if(i.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(N>e)return this._calculateAnchor(t,e);let o=this._firstVisible-1,n=-1/0;for(;n<t;){n=this._getPhysicalItem(++o).pos+this._metricsCache.getChildSize(o)}return o}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){const t=this._newPhysicalItems;let e,M;if(this._stable=!0,null!==this.pin){const{index:t}=this.pin;this._anchorIdx=t,this._anchorPos=this._getPosition(t)}if(e=this._scrollPosition-this._overhang,M=this._scrollPosition+this._viewDim1+this._overhang,M<0||e>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(e,M),this._anchorPos=this._getPosition(this._anchorIdx));let i=this._getSize(this._anchorIdx);void 0===i&&(this._stable=!1,i=this._getAverageSize());const N=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=N),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-i);let n=0;for(this._anchorPos+i+o<e&&(n=e-(this._anchorPos+i+o)),this._anchorPos-N>M&&(n=M-(this._anchorPos-N)),n&&(this._scrollPosition-=n,e-=n,M-=n,this._scrollError+=n),t.set(this._anchorIdx,{pos:this._anchorPos,size:i}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-N,this._physicalMax=this._anchorPos+i+o;this._physicalMin>e&&this._first>0;){let e=this._getSize(--this._first);void 0===e&&(this._stable=!1,e=this._getAverageSize());let M=this._metricsCache.getMarginSize(this._first);void 0===M&&(this._stable=!1,M=this._metricsCache.averageMarginSize),this._physicalMin-=e;const i=this._physicalMin;if(t.set(this._first,{pos:i,size:e}),this._physicalMin-=M,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<M&&this._last<this.items.length-1;){let e=this._getSize(++this._last);void 0===e&&(this._stable=!1,e=this._getAverageSize());let M=this._metricsCache.getMarginSize(this._last);void 0===M&&(this._stable=!1,M=this._metricsCache.averageMarginSize);const i=this._physicalMax;if(t.set(this._last,{pos:i,size:e}),this._physicalMax+=e+M,!this._stable&&!this._estimate)break}const s=this._calculateError();s&&(this._physicalMin-=s,this._physicalMax-=s,this._anchorPos-=s,this._scrollPosition-=s,t.forEach((t=>t.pos-=s)),this._scrollError+=s),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:t,_last:e}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){const{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[ap(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});export{cx as NileAccordion,uN as NileAutoComplete,bL as NileAvatar,le as NileBadge,rL as NileBreadcrumb,aL as NileBreadcrumbItem,Bt as NileButton,TL as NileButtonFilter,mN as NileButtonToggle,CN as NileButtonToggleGroup,pN as NileCalendar,jL as NileCard,fe as NileCheckbox,jN as NileChip,yL as NileCircularProgressbar,ML as NileCodeEditor,RN as NileContentEditor,TN as NileDatePicker,BN as NileDialog,Ix as NileDivider,Ue as NileDrawer,Oi as NileDropdown,VL as NileEmptyState,yN as NileErrorMessage,FN as NileErrorNotification,kx as NileFilterChip,AN as NileFormErrorMessage,uL as NileFormGroup,LN as NileFormHelpText,qL as NileFormatDate,_t as NileHeading,PL as NileHero,JL as NileHeroHeader,wt as NileIcon,ae as NileIconButton,xx as NileInlineEdit,Ne as NileInput,Yx as NileLightdomeditor,EN as NileLink,gx as NileList,lx as NileListItem,oi as NileLoader,se as NileMenu,Ii as NileMenuItem,ci as NileOption,vL as NilePageHeader,Ux as NilePagination,zL as NilePopover,KM as NilePopup,si as NileProgressBar,Ye as NileRadio,Ze as NileRadioGroup,Np as NileRichTextEditor,Cx as NileRichcodeeditor,dx as NileSectionMessage,gi as NileSelect,oe as NileSidebar,AL as NileSidebarMenu,LL as NileSidebarMenuItems,pL as NileSidebarWrapper,ii as NileSlideToggle,Di as NileSpinner,ex as NileSplitPanel,_L as NileStepper,GL as NileStepperItem,VN as NileSwitcher,qN as NileTab,HN as NileTabGroup,eo as NileTabPanel,Sx as NileTable,mL as NileTableBody,QL as NileTableCellItem,CL as NileTableHeaderItem,kL as NileTableRow,ui as NileTag,zN as NileTextarea,Ox as NileTitle,nL as NileToast,hx as NileToolbar,ei as NileTooltip,Dx as NileTree,nx as NileTreeItem,XL as NileVerticalStepperItem};